diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 35eb1dd..94a25f7 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/First.patch b/First.patch
new file mode 100644
index 0000000..7393ed0
--- /dev/null
+++ b/First.patch
@@ -0,0 +1,93 @@
+Index: app/src/main/java/hunnu/sj/raise_money/MainActivity.java
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- app/src/main/java/hunnu/sj/raise_money/MainActivity.java (date 1571791518000)
++++ app/src/main/java/hunnu/sj/raise_money/MainActivity.java (date 1571791523878)
+@@ -25,7 +25,7 @@
+
+ private AppBarConfiguration mAppBarConfiguration;
+
+-
++
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+Index: app/src/main/res/layout/activity_main.xml
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- app/src/main/res/layout/activity_main.xml (date 1571791518000)
++++ app/src/main/res/layout/activity_main.xml (date 1571794335249)
+@@ -22,4 +22,6 @@
+ app:headerLayout="@layout/nav_header_main"
+ app:menu="@menu/activity_main_drawer" />
+
++
++
+
+Index: app/src/main/res/layout/nav_header_main.xml
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- app/src/main/res/layout/nav_header_main.xml (date 1571791518000)
++++ app/src/main/res/layout/nav_header_main.xml (date 1571794335139)
+@@ -18,7 +18,7 @@
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/nav_header_desc"
+ android:paddingTop="@dimen/nav_header_vertical_spacing"
+- app:srcCompat="@mipmap/ic_launcher_round" />
++ app:srcCompat="@drawable/ic_menu_gallery" />
+
+ UTF-8
+===================================================================
+--- app/src/main/res/menu/activity_main_drawer.xml (date 1571791518000)
++++ app/src/main/res/menu/activity_main_drawer.xml (date 1571794361373)
+@@ -1,38 +1,4 @@
+
+
++ tools:showIn="navigation_view"/>
diff --git a/app/build.gradle b/app/build.gradle
index 201ab66..8244057 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,7 +4,7 @@ android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
- applicationId "hunnu.sj.raise2"
+ applicationId "hunnu.sj.raise_money"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
@@ -22,9 +22,13 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ implementation 'androidx.navigation:navigation-fragment:2.0.0'
+ implementation 'androidx.navigation:navigation-ui:2.0.0'
+ implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
- implementation 'com.google.android.material:material:1.0.0'
}
diff --git a/app/src/androidTest/java/hunnu/sj/raise2/ExampleInstrumentedTest.java b/app/src/androidTest/java/hunnu/sj/raise_money/ExampleInstrumentedTest.java
similarity index 86%
rename from app/src/androidTest/java/hunnu/sj/raise2/ExampleInstrumentedTest.java
rename to app/src/androidTest/java/hunnu/sj/raise_money/ExampleInstrumentedTest.java
index 42907f6..215196e 100644
--- a/app/src/androidTest/java/hunnu/sj/raise2/ExampleInstrumentedTest.java
+++ b/app/src/androidTest/java/hunnu/sj/raise_money/ExampleInstrumentedTest.java
@@ -1,4 +1,4 @@
-package hunnu.sj.raise2;
+package hunnu.sj.raise_money;
import android.content.Context;
@@ -22,6 +22,6 @@ public class ExampleInstrumentedTest {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
- assertEquals("hunnu.sj.raise2", appContext.getPackageName());
+ assertEquals("hunnu.sj.raise_money", appContext.getPackageName());
}
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index e9e0670..7420136 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
+ package="hunnu.sj.raise_money">
-
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise2/MainActivity.java b/app/src/main/java/hunnu/sj/raise2/MainActivity.java
deleted file mode 100644
index ee9d6d9..0000000
--- a/app/src/main/java/hunnu/sj/raise2/MainActivity.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package hunnu.sj.raise2;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-import android.os.Bundle;
-
-public class MainActivity extends AppCompatActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- }
-}
diff --git a/app/src/main/java/hunnu/sj/raise_money/MainActivity.java b/app/src/main/java/hunnu/sj/raise_money/MainActivity.java
new file mode 100644
index 0000000..1e9eb78
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/MainActivity.java
@@ -0,0 +1,85 @@
+package hunnu.sj.raise_money;
+
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.android.material.snackbar.Snackbar;
+
+import android.view.MenuItem;
+import android.view.View;
+
+import androidx.navigation.NavController;
+import androidx.navigation.Navigation;
+import androidx.navigation.ui.AppBarConfiguration;
+import androidx.navigation.ui.NavigationUI;
+
+import com.google.android.material.navigation.NavigationView;
+
+import androidx.drawerlayout.widget.DrawerLayout;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import android.view.Menu;
+import android.widget.TextView;
+
+public class MainActivity extends AppCompatActivity {
+ private AppBarConfiguration mAppBarConfiguration;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ TextView menu_name = findViewById(R.id.user_name);
+ TextView menu_role = findViewById(R.id.user_role);
+ Intent intent = getIntent();
+ User user;
+ user = (User) intent.getSerializableExtra("user");
+ menu_name.setText(user.getName());
+ menu_role.setText(user.getPasd());
+ Toolbar toolbar = findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ FloatingActionButton fab = findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
+ .setAction("Action", null).show();
+ }
+ });
+ DrawerLayout drawer = findViewById(R.id.drawer_layout);
+ NavigationView navigationView = findViewById(R.id.nav_view);
+ // Passing each menu ID as a set of Ids because each
+ // menu should be considered as top level destinations.
+ mAppBarConfiguration = new AppBarConfiguration.Builder(
+ R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow,
+ R.id.nav_tools, R.id.nav_share, R.id.nav_send)
+ .setDrawerLayout(drawer)
+ .build();
+ NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
+ NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
+ NavigationUI.setupWithNavController(navigationView, navController);
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.main, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onSupportNavigateUp() {
+ NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
+ return NavigationUI.navigateUp(navController, mAppBarConfiguration)
+ || super.onSupportNavigateUp();
+ }
+
+ public void onNeedHelp(MenuItem item){
+ Intent intent = new Intent(this, UploadActivity.class);
+ startActivity(intent);
+ }
+}
diff --git a/app/src/main/java/hunnu/sj/raise_money/SignInActivity.java b/app/src/main/java/hunnu/sj/raise_money/SignInActivity.java
new file mode 100644
index 0000000..f582473
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/SignInActivity.java
@@ -0,0 +1,42 @@
+package hunnu.sj.raise_money;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Message;
+import android.view.View;
+import android.widget.EditText;
+
+import java.io.Serializable;
+
+public class SignInActivity extends AppCompatActivity {
+ public static final String IS_SIGNIN = "is.user.sign.in";
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_signin);
+ }
+
+ public void user_commit(View view){
+ EditText usnm = findViewById(R.id.user_name);
+ EditText pswd = findViewById(R.id.pass_word);
+ String name = usnm.getText().toString();
+ String pasd = pswd.getText().toString();
+ if(!name.equals("admin")){
+ usnm.setError("用户名错误");
+ }else if(!pasd.equals("admin")){
+ pswd.setError("密码错误");
+ }else{
+ User user = new User();
+ user.setName(name);
+ user.setPasd(pasd);
+ Bundle bundle = new Bundle();
+ bundle.putSerializable("user",user);
+ Intent intent =new Intent(this,MainActivity.class);
+ intent.putExtras(bundle);
+ startActivity(intent);
+ }
+
+ }
+}
diff --git a/app/src/main/java/hunnu/sj/raise_money/UploadActivity.java b/app/src/main/java/hunnu/sj/raise_money/UploadActivity.java
new file mode 100644
index 0000000..5d78215
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/UploadActivity.java
@@ -0,0 +1,98 @@
+package hunnu.sj.raise_money;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.content.FileProvider;
+
+import android.content.Intent;
+
+
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.provider.MediaStore;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+
+import hunnu.sj.raise_money.R;
+
+public class UploadActivity extends AppCompatActivity {
+ public static final int TAKE_PHOTO = 1;
+ private ImageView stu_pic;
+ private ImageView[] stu_src;
+ private Uri imageUri;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_upload);
+ stu_pic = findViewById(R.id.stu_pic);
+ }
+
+ protected void onUploadPic(View view){
+ /*File outputImage = new File(getExternalCacheDir(),"output_image.jpg");
+ try {
+ if(outputImage.exists()){
+ outputImage.delete();
+ }
+ outputImage.createNewFile();
+ }catch (IOException e){
+ e.printStackTrace();
+ }
+ if(Build.VERSION.SDK_INT>=24){
+ imageUri = FileProvider.getUriForFile(UploadActivity.this,"com.example.cameraalbumtest.fileprovider",outputImage);
+ }else {
+ imageUri = Uri.fromFile(outputImage);
+ }*/
+
+ Intent intent = new Intent(Intent.ACTION_PICK,null);
+ intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,"image/*");
+ startActivityForResult(intent,1);
+ }
+
+ private void onLoadPic(){
+ Intent intent = new Intent(Intent.ACTION_PICK,null);
+ intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,"image/*");
+ startActivity(intent);
+ }
+
+ private class stu{
+ private ImageView stu_pic;
+ private ImageView stu_src1;
+ private ImageView stu_src2;
+ private ImageView stu_src3;
+ public void setStu_pic(ImageView imageView){
+ this.stu_pic = imageView;
+ }
+ public ImageView getStu_pic(){
+ return stu_pic;
+ }
+
+ public void setStu_src1(ImageView imageView){
+ this.stu_src1 = imageView;
+ }
+
+ public ImageView getStu_src1() {
+ return stu_src1;
+ }
+
+ public void setStu_src2(ImageView stu_src2) {
+ this.stu_src2 = stu_src2;
+ }
+
+ public ImageView getStu_src2() {
+ return stu_src2;
+ }
+
+ public void setStu_src3(ImageView stu_src3) {
+ this.stu_src3 = stu_src3;
+ }
+
+ public ImageView getStu_src3() {
+ return stu_src3;
+ }
+ }
+}
diff --git a/app/src/main/java/hunnu/sj/raise_money/User.java b/app/src/main/java/hunnu/sj/raise_money/User.java
new file mode 100644
index 0000000..04c97a9
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/User.java
@@ -0,0 +1,24 @@
+package hunnu.sj.raise_money;
+
+import java.io.Serializable;
+
+public class User implements Serializable{
+ private String name;
+ private String pasd;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setPasd(String pasd) {
+ this.pasd = pasd;
+ }
+
+ public String getPasd() {
+ return pasd;
+ }
+}
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/gallery/GalleryFragment.java b/app/src/main/java/hunnu/sj/raise_money/ui/gallery/GalleryFragment.java
new file mode 100644
index 0000000..ab51654
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/gallery/GalleryFragment.java
@@ -0,0 +1,35 @@
+package hunnu.sj.raise_money.ui.gallery;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import hunnu.sj.raise_money.R;
+
+public class GalleryFragment extends Fragment {
+
+ private GalleryViewModel galleryViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ galleryViewModel =
+ ViewModelProviders.of(this).get(GalleryViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_gallery, container, false);
+ final TextView textView = root.findViewById(R.id.text_gallery);
+ galleryViewModel.getText().observe(this, new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/gallery/GalleryViewModel.java b/app/src/main/java/hunnu/sj/raise_money/ui/gallery/GalleryViewModel.java
new file mode 100644
index 0000000..47e180e
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/gallery/GalleryViewModel.java
@@ -0,0 +1,19 @@
+package hunnu.sj.raise_money.ui.gallery;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class GalleryViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public GalleryViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is gallery fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/home/HomeFragment.java b/app/src/main/java/hunnu/sj/raise_money/ui/home/HomeFragment.java
new file mode 100644
index 0000000..b6307bb
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/home/HomeFragment.java
@@ -0,0 +1,35 @@
+package hunnu.sj.raise_money.ui.home;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import hunnu.sj.raise_money.R;
+
+public class HomeFragment extends Fragment {
+
+ private HomeViewModel homeViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ homeViewModel =
+ ViewModelProviders.of(this).get(HomeViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_home, container, false);
+ final TextView textView = root.findViewById(R.id.text_home);
+ homeViewModel.getText().observe(this, new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/home/HomeViewModel.java b/app/src/main/java/hunnu/sj/raise_money/ui/home/HomeViewModel.java
new file mode 100644
index 0000000..6441b86
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/home/HomeViewModel.java
@@ -0,0 +1,19 @@
+package hunnu.sj.raise_money.ui.home;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class HomeViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public HomeViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is home fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/send/SendFragment.java b/app/src/main/java/hunnu/sj/raise_money/ui/send/SendFragment.java
new file mode 100644
index 0000000..f112c9b
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/send/SendFragment.java
@@ -0,0 +1,35 @@
+package hunnu.sj.raise_money.ui.send;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import hunnu.sj.raise_money.R;
+
+public class SendFragment extends Fragment {
+
+ private SendViewModel sendViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ sendViewModel =
+ ViewModelProviders.of(this).get(SendViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_send, container, false);
+ final TextView textView = root.findViewById(R.id.text_send);
+ sendViewModel.getText().observe(this, new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/send/SendViewModel.java b/app/src/main/java/hunnu/sj/raise_money/ui/send/SendViewModel.java
new file mode 100644
index 0000000..14d3f2d
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/send/SendViewModel.java
@@ -0,0 +1,19 @@
+package hunnu.sj.raise_money.ui.send;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class SendViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public SendViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is send fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/share/ShareFragment.java b/app/src/main/java/hunnu/sj/raise_money/ui/share/ShareFragment.java
new file mode 100644
index 0000000..17748f1
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/share/ShareFragment.java
@@ -0,0 +1,35 @@
+package hunnu.sj.raise_money.ui.share;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import hunnu.sj.raise_money.R;
+
+public class ShareFragment extends Fragment {
+
+ private ShareViewModel shareViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ shareViewModel =
+ ViewModelProviders.of(this).get(ShareViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_share, container, false);
+ final TextView textView = root.findViewById(R.id.text_share);
+ shareViewModel.getText().observe(this, new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/share/ShareViewModel.java b/app/src/main/java/hunnu/sj/raise_money/ui/share/ShareViewModel.java
new file mode 100644
index 0000000..90d87a8
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/share/ShareViewModel.java
@@ -0,0 +1,19 @@
+package hunnu.sj.raise_money.ui.share;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class ShareViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public ShareViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is share fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/slideshow/SlideshowFragment.java b/app/src/main/java/hunnu/sj/raise_money/ui/slideshow/SlideshowFragment.java
new file mode 100644
index 0000000..0733a85
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/slideshow/SlideshowFragment.java
@@ -0,0 +1,35 @@
+package hunnu.sj.raise_money.ui.slideshow;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import hunnu.sj.raise_money.R;
+
+public class SlideshowFragment extends Fragment {
+
+ private SlideshowViewModel slideshowViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ slideshowViewModel =
+ ViewModelProviders.of(this).get(SlideshowViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_slideshow, container, false);
+ final TextView textView = root.findViewById(R.id.text_slideshow);
+ slideshowViewModel.getText().observe(this, new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/slideshow/SlideshowViewModel.java b/app/src/main/java/hunnu/sj/raise_money/ui/slideshow/SlideshowViewModel.java
new file mode 100644
index 0000000..da08f5f
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/slideshow/SlideshowViewModel.java
@@ -0,0 +1,19 @@
+package hunnu.sj.raise_money.ui.slideshow;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class SlideshowViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public SlideshowViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is slideshow fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/tools/ToolsFragment.java b/app/src/main/java/hunnu/sj/raise_money/ui/tools/ToolsFragment.java
new file mode 100644
index 0000000..07c8308
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/tools/ToolsFragment.java
@@ -0,0 +1,35 @@
+package hunnu.sj.raise_money.ui.tools;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import hunnu.sj.raise_money.R;
+
+public class ToolsFragment extends Fragment {
+
+ private ToolsViewModel toolsViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ toolsViewModel =
+ ViewModelProviders.of(this).get(ToolsViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_tools, container, false);
+ final TextView textView = root.findViewById(R.id.text_tools);
+ toolsViewModel.getText().observe(this, new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/hunnu/sj/raise_money/ui/tools/ToolsViewModel.java b/app/src/main/java/hunnu/sj/raise_money/ui/tools/ToolsViewModel.java
new file mode 100644
index 0000000..dc495d3
--- /dev/null
+++ b/app/src/main/java/hunnu/sj/raise_money/ui/tools/ToolsViewModel.java
@@ -0,0 +1,19 @@
+package hunnu.sj.raise_money.ui.tools;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class ToolsViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public ToolsViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is tools fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-xhdpi/ic_1.png b/app/src/main/res/drawable-xhdpi/ic_1.png
new file mode 100644
index 0000000..00ad37a
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_1.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_launcher_round.png b/app/src/main/res/drawable-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dffca36
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/drawable/edit_background.xml b/app/src/main/res/drawable/edit_background.xml
new file mode 100644
index 0000000..dc41ee6
--- /dev/null
+++ b/app/src/main/res/drawable/edit_background.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_menu_camera.xml b/app/src/main/res/drawable/ic_menu_camera.xml
new file mode 100644
index 0000000..634fe92
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_camera.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_gallery.xml b/app/src/main/res/drawable/ic_menu_gallery.xml
new file mode 100644
index 0000000..03c7709
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_gallery.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_manage.xml b/app/src/main/res/drawable/ic_menu_manage.xml
new file mode 100644
index 0000000..aeb047d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_manage.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_menu_send.xml b/app/src/main/res/drawable/ic_menu_send.xml
new file mode 100644
index 0000000..fdf1c90
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_send.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_share.xml b/app/src/main/res/drawable/ic_menu_share.xml
new file mode 100644
index 0000000..338d95a
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_share.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_slideshow.xml b/app/src/main/res/drawable/ic_menu_slideshow.xml
new file mode 100644
index 0000000..5e9e163
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_slideshow.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_search_black_24dp.xml b/app/src/main/res/drawable/ic_search_black_24dp.xml
new file mode 100644
index 0000000..affc7ba
--- /dev/null
+++ b/app/src/main/res/drawable/ic_search_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml
new file mode 100644
index 0000000..6d81870
--- /dev/null
+++ b/app/src/main/res/drawable/side_nav_bar.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 4fc2444..3c36b67 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,18 +1,32 @@
-
+ android:fitsSystemWindows="true"
+ tools:openDrawer="start">
-
+
+
+
+
+ android:layout_height="match_parent"
+ android:layout_gravity="start"
+ android:fitsSystemWindows="true"
+ app:headerLayout="@layout/nav_header_main"
+ app:menu="@menu/activity_main_drawer" />
+
+
-
\ No newline at end of file
+
diff --git a/app/src/main/res/layout/activity_signin.xml b/app/src/main/res/layout/activity_signin.xml
new file mode 100644
index 0000000..4de8826
--- /dev/null
+++ b/app/src/main/res/layout/activity_signin.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_upload.xml b/app/src/main/res/layout/activity_upload.xml
new file mode 100644
index 0000000..f22c064
--- /dev/null
+++ b/app/src/main/res/layout/activity_upload.xml
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml
new file mode 100644
index 0000000..e9fa907
--- /dev/null
+++ b/app/src/main/res/layout/app_bar_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
new file mode 100644
index 0000000..04b67fd
--- /dev/null
+++ b/app/src/main/res/layout/content_main.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_gallery.xml b/app/src/main/res/layout/fragment_gallery.xml
new file mode 100644
index 0000000..5391c78
--- /dev/null
+++ b/app/src/main/res/layout/fragment_gallery.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
new file mode 100644
index 0000000..fba9341
--- /dev/null
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_send.xml b/app/src/main/res/layout/fragment_send.xml
new file mode 100644
index 0000000..5f5d116
--- /dev/null
+++ b/app/src/main/res/layout/fragment_send.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_share.xml b/app/src/main/res/layout/fragment_share.xml
new file mode 100644
index 0000000..5854a8d
--- /dev/null
+++ b/app/src/main/res/layout/fragment_share.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_slideshow.xml b/app/src/main/res/layout/fragment_slideshow.xml
new file mode 100644
index 0000000..6bb5bb8
--- /dev/null
+++ b/app/src/main/res/layout/fragment_slideshow.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_tools.xml b/app/src/main/res/layout/fragment_tools.xml
new file mode 100644
index 0000000..d7996fa
--- /dev/null
+++ b/app/src/main/res/layout/fragment_tools.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml
new file mode 100644
index 0000000..a23e036
--- /dev/null
+++ b/app/src/main/res/layout/nav_header_main.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/switch_item.xml b/app/src/main/res/layout/switch_item.xml
new file mode 100644
index 0000000..ee492c6
--- /dev/null
+++ b/app/src/main/res/layout/switch_item.xml
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml
new file mode 100644
index 0000000..4cc23e1
--- /dev/null
+++ b/app/src/main/res/menu/activity_main_drawer.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml
new file mode 100644
index 0000000..a2411e3
--- /dev/null
+++ b/app/src/main/res/menu/main.xml
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml
new file mode 100644
index 0000000..0c0049d
--- /dev/null
+++ b/app/src/main/res/navigation/mobile_navigation.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..fd7a058
--- /dev/null
+++ b/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,8 @@
+
+
+
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..4ab4520
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,8 @@
+
+
+ 16dp
+ 16dp
+ 8dp
+ 176dp
+ 16dp
+
\ No newline at end of file
diff --git a/app/src/main/res/values/menu/新建文本文档.txt b/app/src/main/res/values/menu/新建文本文档.txt
new file mode 100644
index 0000000..e69de29
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4173fd4..b4ef3f2 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,3 +1,21 @@
- Raise2
+ Raise_Money
+ Open navigation drawer
+ Close navigation drawer
+ Android Studio
+ android.studio@android.com
+ Navigation header
+ Settings
+
+ Home
+ Gallery
+ Slideshow
+ Tools
+ Share
+ Send
+ 用户姓名
+ 用户角色
+ HeadPortrait
+ 申请帮助
+ onUploadPic
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 5885930..545b9c6 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -8,4 +8,13 @@
- @color/colorAccent
+
+
+
+
+
+
diff --git a/app/src/test/java/hunnu/sj/raise2/ExampleUnitTest.java b/app/src/test/java/hunnu/sj/raise_money/ExampleUnitTest.java
similarity index 91%
rename from app/src/test/java/hunnu/sj/raise2/ExampleUnitTest.java
rename to app/src/test/java/hunnu/sj/raise_money/ExampleUnitTest.java
index cc1a678..b1828f9 100644
--- a/app/src/test/java/hunnu/sj/raise2/ExampleUnitTest.java
+++ b/app/src/test/java/hunnu/sj/raise_money/ExampleUnitTest.java
@@ -1,4 +1,4 @@
-package hunnu.sj.raise2;
+package hunnu.sj.raise_money;
import org.junit.Test;
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b0e85bb..8e8a214 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,4 +1,4 @@
-#Wed Oct 23 12:38:05 CST 2019
+#Wed Oct 23 08:27:26 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
diff --git a/settings.gradle b/settings.gradle
index c492b2f..71e1151 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,2 @@
include ':app'
-rootProject.name='Raise2'
+rootProject.name='Raise_Money'