Skip to content

Commit

Permalink
Merge pull request #771 from wzq-55552/master
Browse files Browse the repository at this point in the history
#3 提交实验3代码
  • Loading branch information
zengsn authored Mar 18, 2019
2 parents c8b720f + adef6d4 commit 8dca45d
Show file tree
Hide file tree
Showing 10 changed files with 356 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package edu.hzuapps.androidlabs.soft1714080902133;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


//惠大宿舍缴电费app
//主页,查询,缴费,充值
//只实现了一个点击事件,以后实验补充
public class Soft1714080902133HomeActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.soft_1714080902133_homeactivity);
Button b1 = findViewById(R.id.home_button4);
//点击事件
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//意图实现跳转Activity
Intent intent = new Intent(Soft1714080902133HomeActivity.this, Soft1714080902133UserActivity.class);
startActivity(intent);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package edu.hzuapps.androidlabs.soft1714080902133;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;

//惠大宿舍缴电费app
//个人中心,用户信息,先实现点击事件,后期把首页,个人中心,用tab连接起来,实现滑动
public class Soft1714080902133UserActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.soft_1714080902133_useractivity);
}

//跳转登录界面
public void go_login(View view) {
Intent intent = new Intent(Soft1714080902133UserActivity.this, Soft1714080902133LoginActivity.class);
startActivity(intent);
finish();
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home://点击了返回,结束该活动,返回上一个活动
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Soft1714080902133HomeActivity">


<android.support.v7.widget.Toolbar
app:title="惠大宿舍缴电费app"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:id="@+id/home_toolbar"/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button
android:layout_margin="10dp"
android:layout_centerHorizontal="true"
android:id="@+id/home_button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/titleBlue"
android:text="充值" />

<Button
android:layout_margin="10dp"
android:layout_centerHorizontal="true"
android:layout_below="@+id/home_button1"
android:id="@+id/home_button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/titleBlue"
android:text="查询" />

<Button
android:layout_margin="10dp"
android:layout_centerHorizontal="true"
android:layout_below="@+id/home_button2"
android:id="@+id/home_button3"
android:layout_width="100dp"
android:layout_height="200dp"
android:background="@color/titleBlue"
android:text="缴费" />

<Button
android:layout_margin="10dp"
android:layout_centerHorizontal="true"
android:layout_below="@+id/home_button3"
android:id="@+id/home_button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/titleBlue"
android:text="个人中心" />

<!--背景图片-->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/text1"
android:drawableTop="@drawable/backgound"
/>

</RelativeLayout>


</LinearLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Soft1714080902133UserActivity"
android:background="@color/gray">

<android.support.v7.widget.Toolbar
app:title="个人中心"
android:id="@+id/users_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
app:navigationIcon="?attr/homeAsUpIndicator"
/>

<include
layout="@layout/user_context"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<TextView
android:layout_marginTop="32dp"
android:background="@color/white"
android:textColor="@color/red"
android:layout_width="match_parent"
android:layout_height="48dp"
android:textSize="20sp"
android:text="@string/button_01"
android:gravity="center"
android:onClick="go_login"/>

</LinearLayout>
117 changes: 117 additions & 0 deletions students/soft1714080902133/app/src/main/res/layout/user_context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showIn="@layout/soft_1714080902133_useractivity">

<!--头部-->
<RelativeLayout
android:background="@color/colorPrimary"
android:layout_width="match_parent"
android:layout_height="120dp"
android:orientation="horizontal" >

<!--将图片圆形化,头部-->
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/users_icon_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:src="@drawable/head" />


<ImageView
android:id="@+id/change_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/users_icon_image"
android:layout_marginStart="-20dp"
android:layout_toEndOf="@+id/users_icon_image"
app:srcCompat="@android:drawable/ic_menu_gallery" />

</RelativeLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="1dp" />

<!--昵称-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="16dp"
android:onClick="change_nickname">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/view_01"
android:textSize="18sp" />

<TextView
android:id="@+id/user_nickname_show"
android:textSize="18sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:drawableEnd="@drawable/ic_chevron_right_black_24dp"
android:text="夜殇" />

</RelativeLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="1dp" />

<!--性别-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="16dp"
android:onClick="change_sex" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/view_02"
android:textSize="18sp" />

<TextView
android:id="@+id/user_sex_show"
android:textSize="18sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:drawableEnd="@drawable/ic_chevron_right_black_24dp"
android:text="" />

</RelativeLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="1dp" />

<!--账号管理-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:layout_marginTop="32dp"
android:padding="16dp"
android:onClick="user_account_management">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/view_account_management"
android:textSize="18sp"
android:drawableEnd="@drawable/ic_chevron_right_black_24dp"/>

</RelativeLayout>

</LinearLayout>
11 changes: 11 additions & 0 deletions students/soft1714080902133/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#0090ff</color>
<color name="colorPrimaryDark">#0070ff</color>
<color name="colorAccent">#808080</color>
<color name="titleBlue">#87ceeb</color>
<color name="white">#ffffff</color>
<color name="gray">#F7F7F7</color>
<color name="black">#000000</color>
<color name="red">#ff0000</color>
</resources>
42 changes: 42 additions & 0 deletions students/soft1714080902133/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<resources>
<string name="app_name">惠大宿舍缴电费app</string>

<!--登录的String-->
<string name="login_textview1">忘记密码?</string>
<string name="login_textview2">新用户注册</string>
<string name="title_activity_login">登录</string>
<string name="prompt_email">学号/手机号</string>
<string name="prompt_password">密码</string>
<string name="action_sign_in">登录</string>
<string name="error_invalid_email">账号不存在!</string>
<string name="error_invalid_password">密码太短!</string>
<string name="error_incorrect_password">密码错误!</string>
<string name="error_field_required">该区域不能为空!</string>

<!--注册-->
<string name="register_username">输入手机号</string>
<string name="register_password">输6–20位入密码</string>
<string name="input_number">输入学号</string>
<string name="input_nickname">输入昵称</string>
<string name="register">注册</string>
<string name="submit">提交</string>

<!--用户信息-->
<string name="number">学号</string>
<string name="telephone">手机号</string>
<string name="nickname">昵称</string>
<string name="sex">性别</string>
<string name="password">密码</string>
<string name="sex_male">男</string>
<string name="sex_female">女</string>
<string name="sex_secrecy">保密</string>

<!--个人中心=-->
<string name="view_01">昵称</string>
<string name="view_account_management">账号管理</string>
<string name="view_02">性别</string>
<string name="view_03">学号</string>
<string name="button_01">退出账号</string>


</resources>
11 changes: 11 additions & 0 deletions students/soft1714080902133/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>

0 comments on commit 8dca45d

Please sign in to comment.