Skip to content

Commit

Permalink
Merge pull request #984 from wzq-55552/master
Browse files Browse the repository at this point in the history
#4 提交实验4代码
  • Loading branch information
zengsn authored Mar 26, 2019
2 parents cf93b99 + 5279405 commit abeea44
Show file tree
Hide file tree
Showing 11 changed files with 525 additions and 14 deletions.
35 changes: 35 additions & 0 deletions students/soft1714080902133/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.hzuapps.androidlabs.soft1714080902133">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Soft1714080902133PaymentActivity"></activity>

<activity android:name=".Soft1714080902133RechargeActivity" />

<activity android:name=".Soft1714080902133PerfectInformationActivity" />

<activity android:name=".Soft1714080902133HomeActivity" />

<activity android:name=".Soft1714080902133UserActivity" />

<activity android:name=".Soft1714080902133ForgetPasswordActivity" />

<activity android:name=".Soft1714080902133RegisterActivity" />

<activity android:name=".Soft1714080902133LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.hzuapps.androidlabs.soft1714080902133;
package edu.hzuapps.androidlabs.soft1714080902133;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
Expand All @@ -16,15 +16,42 @@ public class Soft1714080902133HomeActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.soft_1714080902133_homeactivity);
Button b1 = findViewById(R.id.home_button4);
Button b4 = findViewById(R.id.home_button4);//个人中心
//点击事件
b1.setOnClickListener(new View.OnClickListener() {
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//意图实现跳转Activity
Intent intent = new Intent(Soft1714080902133HomeActivity.this, Soft1714080902133UserActivity.class);
startActivity(intent);
}
});

Button b1 = findViewById(R.id.home_button1);//充值
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Soft1714080902133HomeActivity.this, Soft1714080902133RechargeActivity.class);
startActivity(intent);
}
});

/*Button b2 = findViewById(R.id.home_button2);//查询
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Soft1714080902133HomeActivity.this, Soft1714080902133RechargeActivity);
startActivity(intent);
}
});*/

Button b3 = findViewById(R.id.home_button3);//缴费
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Soft1714080902133HomeActivity.this,Soft1714080902133PaymentActivity.class);
startActivity(intent);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package edu.hzuapps.androidlabs.soft1714080902133;

import android.content.Intent;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

public class Soft1714080902133PaymentActivity extends AppCompatActivity {

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

//界面标题bar
Toolbar toolbar = (Toolbar) findViewById(R.id.payment_toolbar);
setSupportActionBar(toolbar);//获得ToolBar实例
ActionBar actionBar = getSupportActionBar();
if (actionBar!=null){
actionBar.setDisplayHomeAsUpEnabled(true);//菜单,默认图片返回图片
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home://点击了返回,结束该活动,返回上一个活动
Intent intent = new Intent(Soft1714080902133PaymentActivity.this, Soft1714080902133HomeActivity.class);
startActivity(intent);
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package edu.hzuapps.androidlabs.soft1714080902133;

import android.content.Intent;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

public class Soft1714080902133RechargeActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.soft_1714080902133_rechargeactivity);
//界面标题bar
Toolbar toolbar = (Toolbar) findViewById(R.id.re_toolbar);
setSupportActionBar(toolbar);//获得ToolBar实例
ActionBar actionBar = getSupportActionBar();
if (actionBar!=null){
actionBar.setDisplayHomeAsUpEnabled(true);//菜单,默认图片返回图片
}

}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home://点击了返回,结束该活动,返回上一个活动
Intent intent = new Intent(Soft1714080902133RechargeActivity.this, Soft1714080902133HomeActivity.class);
startActivity(intent);
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package edu.hzuapps.androidlabs.soft1714080902133;
package edu.hzuapps.androidlabs.soft1714080902133;

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

import edu.hzuapps.androidlabs.soft1714080902133.javabean.Soft1714080902133User;

//惠大宿舍缴电费app
//个人中心,用户信息,先实现点击事件,后期把首页,个人中心,用tab连接起来,实现滑动
public class Soft1714080902133UserActivity extends AppCompatActivity {
Expand All @@ -14,6 +18,13 @@ public class Soft1714080902133UserActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.soft_1714080902133_useractivity);

Toolbar toolbar = (Toolbar) findViewById(R.id.users_toolbar);
setSupportActionBar(toolbar);//获得ToolBar实例
ActionBar actionBar = getSupportActionBar();
if (actionBar!=null){
actionBar.setDisplayHomeAsUpEnabled(true);//菜单,默认图片返回图片
}
}

//跳转登录界面
Expand All @@ -23,10 +34,19 @@ public void go_login(View view) {
finish();
}

//完善信息
public void user_account_management(View view){
Intent intent = new Intent(Soft1714080902133UserActivity.this, Soft1714080902133PerfectInformationActivity.class);
startActivity(intent);
finish();
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home://点击了返回,结束该活动,返回上一个活动
case android.R.id.home://点击了返回,结束该活动,返回上一个活动
Intent intent = new Intent(Soft1714080902133UserActivity.this, Soft1714080902133HomeActivity.class);
startActivity(intent);
finish();
return true;
}
Expand Down
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,65 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">

<TextView
android:layout_marginLeft="40dp"
android:layout_marginTop="10dp"
android:textSize="18sp"
android:id="@+id/re_view01"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="账户充值"/>

<RelativeLayout
android:layout_below="@id/re_view01"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">


<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>

<CheckBox
android:layout_margin="10dp"
android:id="@+id/checkBox10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10元" />

<CheckBox
android:layout_margin="10dp"
android:id="@+id/checkBox100"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="100元" />

<CheckBox
android:layout_margin="10dp"
android:id="@+id/checkBox500"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="500元" />

<CheckBox
android:layout_margin="10dp"
android:id="@+id/checkBox1000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1000元" />

</LinearLayout>

</RelativeLayout>



</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Soft1714080902133HomeActivity">
tools:context=".Soft1714080902133HomeActivity"
android:background="@drawable/backgound">


<android.support.v7.widget.Toolbar
Expand Down Expand Up @@ -59,13 +60,7 @@
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>

Expand Down
Loading

0 comments on commit abeea44

Please sign in to comment.