diff --git a/前端/test/app/src/main/AndroidManifest.xml b/前端/test/app/src/main/AndroidManifest.xml index 2fe1059..8d301b1 100644 --- a/前端/test/app/src/main/AndroidManifest.xml +++ b/前端/test/app/src/main/AndroidManifest.xml @@ -18,6 +18,14 @@ + + + + + + + + \ No newline at end of file diff --git a/前端/test/app/src/main/java/com/example/administrator/test/AboutappActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/AboutappActivity.java index c101486..08ad30a 100644 --- a/前端/test/app/src/main/java/com/example/administrator/test/AboutappActivity.java +++ b/前端/test/app/src/main/java/com/example/administrator/test/AboutappActivity.java @@ -1,8 +1,10 @@ package com.example.administrator.test; +import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.method.ScrollingMovementMethod; +import android.view.View; import android.widget.TextView; public class AboutappActivity extends AppCompatActivity { @@ -14,4 +16,10 @@ public class AboutappActivity extends AppCompatActivity { // 设置当前textView内容过多的时候可以滚动 tv.setMovementMethod(ScrollingMovementMethod.getInstance()); } + + public void back(View view){ + Intent intent = new Intent(); + intent.setClass(this, HelpActivity.class); + startActivity(intent); + } } diff --git a/前端/test/app/src/main/java/com/example/administrator/test/ActivityCollector.java b/前端/test/app/src/main/java/com/example/administrator/test/ActivityCollector.java new file mode 100644 index 0000000..c11e22f --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/ActivityCollector.java @@ -0,0 +1,25 @@ +package com.example.administrator.test; + +import android.app.Activity; + +import java.util.ArrayList; +import java.util.List; +//管理活动器,用于退出APP +public class ActivityCollector { + public static List activities=new ArrayList<>(); + public static void addActivity(Activity activity){ + activities.add(activity); + } + + public static void removeActivity(Activity activity){ + activities.remove(activity); + } + + public static void finishAll(){ + for (Activity activity:activities){ + if(!activity.isFinishing()){ + activity.finish(); + } + } + } +} diff --git a/前端/test/app/src/main/java/com/example/administrator/test/ContactusActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/ContactusActivity.java new file mode 100644 index 0000000..611eaed --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/ContactusActivity.java @@ -0,0 +1,19 @@ +package com.example.administrator.test; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +public class ContactusActivity extends AppCompatActivity { + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.help_contact); + } + + public void back(View view){ + Intent intent = new Intent(); + intent.setClass(this, HelpActivity.class); + startActivity(intent); + } +} diff --git a/前端/test/app/src/main/java/com/example/administrator/test/DataActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/DataActivity.java new file mode 100644 index 0000000..89d1c86 --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/DataActivity.java @@ -0,0 +1,19 @@ +package com.example.administrator.test; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +public class DataActivity extends AppCompatActivity { + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.my_changedata); + } + + public void back(View view){ + Intent intent = new Intent(); + intent.setClass(this, IndexActivity.class); + startActivity(intent); + } +} diff --git a/前端/test/app/src/main/java/com/example/administrator/test/DiaryActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/DiaryActivity.java new file mode 100644 index 0000000..e1cc9fc --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/DiaryActivity.java @@ -0,0 +1,11 @@ +package com.example.administrator.test; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; + +public class DiaryActivity extends AppCompatActivity { + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.index_diary); + } +} diff --git a/前端/test/app/src/main/java/com/example/administrator/test/FunctionActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/FunctionActivity.java index 4846d9d..1d0840d 100644 --- a/前端/test/app/src/main/java/com/example/administrator/test/FunctionActivity.java +++ b/前端/test/app/src/main/java/com/example/administrator/test/FunctionActivity.java @@ -1,8 +1,10 @@ package com.example.administrator.test; +import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.method.ScrollingMovementMethod; +import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; @@ -21,4 +23,10 @@ public class FunctionActivity extends AppCompatActivity { // 设置当前textView内容过多的时候可以滚动 tv.setMovementMethod(ScrollingMovementMethod.getInstance()); } + + public void back(View view){ + Intent intent = new Intent(); + intent.setClass(this, HelpActivity.class); + startActivity(intent); + } } diff --git a/前端/test/app/src/main/java/com/example/administrator/test/HelpActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/HelpActivity.java new file mode 100644 index 0000000..f076e63 --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/HelpActivity.java @@ -0,0 +1,55 @@ +package com.example.administrator.test; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +public class HelpActivity extends AppCompatActivity implements View.OnClickListener { + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.my_help); + + initUI(); + } + + private void initUI() { + findViewById(R.id.aboutfunction).setOnClickListener(this); + findViewById(R.id.aboutapp).setOnClickListener(this); + findViewById(R.id.subissue).setOnClickListener(this); + findViewById(R.id.contactus).setOnClickListener(this); + } + + @Override + public void onClick(View v) { + Intent intent=new Intent(); + switch (v.getId()){ + case R.id.aboutfunction: + intent.setClass(getApplicationContext(),FunctionActivity.class); + break; + case R.id.aboutapp: + intent.setClass(getApplicationContext(),AboutappActivity.class); + break; + case R.id.subissue: + intent.setClass(getApplicationContext(),IssueActivity.class); + break; + case R.id.contactus: + intent.setClass(getApplicationContext(),ContactusActivity.class); + break; + case R.id.passwordchange: + intent.setClass(getApplicationContext(),PasswordActivity.class); + break; + case R.id.help: + intent.setClass(getApplicationContext(),HelpActivity.class); + break; + + } + startActivity(intent); + } + + public void back(View view){ + Intent intent = new Intent(); + intent.setClass(this, IndexActivity.class); + startActivity(intent); + } +} diff --git a/前端/test/app/src/main/java/com/example/administrator/test/IndexActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/IndexActivity.java index 8a3f317..96b1991 100644 --- a/前端/test/app/src/main/java/com/example/administrator/test/IndexActivity.java +++ b/前端/test/app/src/main/java/com/example/administrator/test/IndexActivity.java @@ -1,20 +1,97 @@ package com.example.administrator.test; +import android.content.Intent; +import android.support.v4.view.GravityCompat; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.view.MenuItem; +import android.view.View; import android.widget.AbsListView; import android.widget.TextView; +import android.support.v7.widget.Toolbar; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.util.Observable; -public class IndexActivity extends AppCompatActivity{ +public class IndexActivity extends AppCompatActivity implements View.OnClickListener { + private DrawerLayout mDrawerLayout; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_index); + Toolbar toolbar=(Toolbar) findViewById(R.id.toolbar) ; + setSupportActionBar(toolbar); + + mDrawerLayout=(DrawerLayout) findViewById(R.id.drawer_layout); + ActionBar actionBar=getSupportActionBar(); + //if (actionBar!=null){ + actionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setHomeAsUpIndicator(R.mipmap.indexmy); + actionBar.setDisplayShowTitleEnabled(false); + // } + + //初始化方法 + initUI(); + } + + private void initUI() { + findViewById(R.id.indexmemopng).setOnClickListener(this); + findViewById(R.id.indexdiarypng).setOnClickListener(this); +// findViewById(R.id.indexsharepng).setOnClickListener(this); + findViewById(R.id.accountchange).setOnClickListener(this); + findViewById(R.id.datachange).setOnClickListener(this); + findViewById(R.id.passwordchange).setOnClickListener(this); + findViewById(R.id.help).setOnClickListener(this); +// findViewById(R.id.leaveapp).setOnClickListener(this); + } + + public boolean onOptionsItemSelected(MenuItem item){ + switch (item.getItemId()){ + case android.R.id.home: + mDrawerLayout.openDrawer(GravityCompat.START); + break; + } + return true; } + + @Override + public void onClick(View v) { + Intent intent=new Intent(); + switch (v.getId()){ + case R.id.indexmemopng: + //跳转到备忘录界面 + intent.setClass(getApplicationContext(),MemoActivity.class); + break; + case R.id.indexdiarypng: + intent.setClass(getApplicationContext(),DiaryActivity.class); + break; + //进入朋友圈 +// case R.id.indexsharepng: +// break; + case R.id.accountchange: + intent.setClass(getApplicationContext(),LoginActivity.class); + break; + case R.id.datachange: + intent.setClass(getApplicationContext(),DataActivity.class); + break; + case R.id.passwordchange: + intent.setClass(getApplicationContext(),PasswordActivity.class); + break; + case R.id.help: + intent.setClass(getApplicationContext(),HelpActivity.class); + break; + //退出APP +// case R.id.leaveapp: +// intent.setClass(getApplicationContext(),HelpActivity.class); +// break; + + } + startActivity(intent); + } + } diff --git a/前端/test/app/src/main/java/com/example/administrator/test/IssueActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/IssueActivity.java new file mode 100644 index 0000000..a734c98 --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/IssueActivity.java @@ -0,0 +1,19 @@ +package com.example.administrator.test; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +public class IssueActivity extends AppCompatActivity { + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.help_issue); + } + + public void back(View view){ + Intent intent = new Intent(); + intent.setClass(this, HelpActivity.class); + startActivity(intent); + } +} diff --git a/前端/test/app/src/main/java/com/example/administrator/test/LoginActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/LoginActivity.java new file mode 100644 index 0000000..7cd5fcd --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/LoginActivity.java @@ -0,0 +1,11 @@ +package com.example.administrator.test; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; + +public class LoginActivity extends AppCompatActivity { + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + } +} diff --git a/前端/test/app/src/main/java/com/example/administrator/test/PasswordActivity.java b/前端/test/app/src/main/java/com/example/administrator/test/PasswordActivity.java new file mode 100644 index 0000000..7342229 --- /dev/null +++ b/前端/test/app/src/main/java/com/example/administrator/test/PasswordActivity.java @@ -0,0 +1,19 @@ +package com.example.administrator.test; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +public class PasswordActivity extends AppCompatActivity { + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.res_password); + } + + public void back(View view){ + Intent intent = new Intent(); + intent.setClass(this, IndexActivity.class); + startActivity(intent); + } +} diff --git a/前端/test/app/src/main/res/layout/activity_index.xml b/前端/test/app/src/main/res/layout/activity_index.xml index 715631d..a6ede9a 100644 --- a/前端/test/app/src/main/res/layout/activity_index.xml +++ b/前端/test/app/src/main/res/layout/activity_index.xml @@ -5,8 +5,12 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/indexbackground"> + android:background="@drawable/allbackground30" + android:id="@+id/drawer_layout"> + + + + + + android:src="@drawable/indexmemo" + android:layout_gravity="right"/> @@ -67,7 +81,7 @@ android:layout_width="140dp" android:layout_height="140dp" android:src="@drawable/indexshare" - android:layout_gravity="right"/> + android:layout_gravity="left"/> - - - - @@ -102,7 +100,8 @@ android:layout_height="match_parent" android:background="#fff" android:orientation="vertical" - android:layout_gravity="start"> + android:layout_gravity="start" + android:clickable="true"> + - + - + + android:orientation="horizontal" + android:id="@+id/accountchange"> + android:orientation="horizontal" + android:id="@+id/datachange"> + android:orientation="horizontal" + android:id="@+id/passwordchange"> + android:orientation="horizontal" + android:id="@+id/help"> - -