├── .idea
├── .name
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── vcs.xml
├── modules.xml
├── runConfigurations.xml
├── gradle.xml
├── compiler.xml
└── misc.xml
├── app
├── .gitignore
├── libs
│ └── achartengine-1.0.0.jar
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── bg.png
│ │ │ │ ├── circle_bg3.png
│ │ │ │ ├── go_detail.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── mymoney_bg.png
│ │ │ │ ├── detail_income.png
│ │ │ │ ├── detail_payout.png
│ │ │ │ ├── common_title_bg.png
│ │ │ │ ├── home_mbank_1_normal.png
│ │ │ │ ├── home_mbank_2_normal.png
│ │ │ │ ├── home_mbank_3_normal.png
│ │ │ │ ├── home_mbank_4_normal.png
│ │ │ │ ├── home_mbank_5_normal.png
│ │ │ │ ├── home_mbank_6_normal.png
│ │ │ │ ├── expense_cost_btn_normal.png
│ │ │ │ ├── form_row_input_divider.png
│ │ │ │ ├── form_row_layout_bottom.png
│ │ │ │ ├── form_row_layout_middle.png
│ │ │ │ ├── common_toolbar_btn_focused.png
│ │ │ │ ├── common_toolbar_btn_normal.png
│ │ │ │ ├── common_toolbar_btn_pressed.png
│ │ │ │ ├── expense_cost_btn_focused.png
│ │ │ │ ├── expense_cost_btn_pressed.png
│ │ │ │ ├── turnplate_center_unlogin.png
│ │ │ │ ├── widget_keypad_clean_normal.png
│ │ │ │ ├── widget_keypad_digit_normal.png
│ │ │ │ ├── widget_keypad_done_focused.png
│ │ │ │ ├── widget_keypad_done_normal.png
│ │ │ │ ├── widget_keypad_done_pressed.png
│ │ │ │ ├── form_row_input_middle_normal.png
│ │ │ │ ├── widget_keypad_cancel_focused.png
│ │ │ │ ├── widget_keypad_cancel_normal.png
│ │ │ │ ├── widget_keypad_cancel_pressed.png
│ │ │ │ ├── widget_keypad_clean_focused.png
│ │ │ │ ├── widget_keypad_clean_pressed.png
│ │ │ │ ├── widget_keypad_delete_focused.png
│ │ │ │ ├── widget_keypad_delete_normal.png
│ │ │ │ ├── widget_keypad_delete_pressed.png
│ │ │ │ ├── widget_keypad_digit_focused.png
│ │ │ │ ├── widget_keypad_digit_pressed.png
│ │ │ │ ├── widget_keypad_display_normal.png
│ │ │ │ ├── form_row_input_middle_focused.png
│ │ │ │ ├── form_row_input_middle_pressed.png
│ │ │ │ ├── turnplate_mask_unlogin_normal.png
│ │ │ │ ├── widget_keypad_display_focused.png
│ │ │ │ ├── widget_keypad_display_pressed.png
│ │ │ │ ├── expense_cameral_money_display_bg.png
│ │ │ │ └── form_row_input_middle_short_left_seleted.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── values
│ │ │ │ ├── ids.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── values-v21
│ │ │ │ └── styles.xml
│ │ │ ├── drawable
│ │ │ │ ├── cycleanytext_shape.xml
│ │ │ │ ├── rounded_edittext.xml
│ │ │ │ ├── expense_cost_btn.xml
│ │ │ │ ├── rounded_focused.xml
│ │ │ │ ├── common_toolbar_btn.xml
│ │ │ │ ├── widget_keypad_done.xml
│ │ │ │ ├── widget_keypad_clean.xml
│ │ │ │ ├── widget_keypad_digit.xml
│ │ │ │ ├── form_row_input_middle_short_left.xml
│ │ │ │ ├── widget_keypad_cancel.xml
│ │ │ │ ├── widget_keypad_delete.xml
│ │ │ │ ├── form_row_input_middle.xml
│ │ │ │ ├── widget_keypad_display.xml
│ │ │ │ └── rounded_edittext_states.xml
│ │ │ ├── menu
│ │ │ │ └── menu_main.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ └── layout
│ │ │ │ ├── fragment_one.xml
│ │ │ │ ├── fragment_two.xml
│ │ │ │ ├── circle_menu_item.xml
│ │ │ │ ├── about_us.xml
│ │ │ │ ├── wish.xml
│ │ │ │ ├── setting.xml
│ │ │ │ ├── fragment_one_item.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── regist.xml
│ │ │ │ ├── res_password.xml
│ │ │ │ ├── login.xml
│ │ │ │ ├── count.xml
│ │ │ │ ├── keypad.xml
│ │ │ │ ├── spending.xml
│ │ │ │ └── expense_proces.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── hyl
│ │ │ │ ├── accountbook
│ │ │ │ ├── WishActivity.java
│ │ │ │ ├── SettingActivity.java
│ │ │ │ ├── AboutUsActivity.java
│ │ │ │ ├── RegistActivity.java
│ │ │ │ ├── LoginActivity.java
│ │ │ │ ├── ResPwdActivity.java
│ │ │ │ ├── TwoFragment.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── KeyPad.java
│ │ │ │ ├── CountActivity.java
│ │ │ │ ├── OneFragment.java
│ │ │ │ ├── SpendingActivity.java
│ │ │ │ ├── CircleMenuLayout.java
│ │ │ │ └── ExpenseProcesActivity.java
│ │ │ │ ├── dao
│ │ │ │ └── DBOpenHelper.java
│ │ │ │ └── util
│ │ │ │ └── pubFun.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── hyl
│ │ │ └── accountbook
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── hyl
│ │ └── accountbook
│ │ └── ApplicationTest.java
├── proguard-rules.pro
├── build.gradle
└── app.iml
├── settings.gradle
├── effectpic
└── 未命名.gif
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
├── accountBook.iml
├── gradlew.bat
├── README.md
├── README_V2.0.md
├── gradlew
└── LICENSE
/.idea/.name:
--------------------------------------------------------------------------------
1 | accountBook
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/effectpic/未命名.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/effectpic/未命名.gif
--------------------------------------------------------------------------------
/app/libs/achartengine-1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/libs/achartengine-1.0.0.jar
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/bg.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/circle_bg3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/circle_bg3.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/go_detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/go_detail.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/mymoney_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/mymoney_bg.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/detail_income.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/detail_income.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/detail_payout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/detail_payout.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/common_title_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/common_title_bg.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/home_mbank_1_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/home_mbank_1_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/home_mbank_2_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/home_mbank_2_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/home_mbank_3_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/home_mbank_3_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/home_mbank_4_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/home_mbank_4_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/home_mbank_5_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/home_mbank_5_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/home_mbank_6_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/home_mbank_6_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/expense_cost_btn_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/expense_cost_btn_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/form_row_input_divider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/form_row_input_divider.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/form_row_layout_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/form_row_layout_bottom.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/form_row_layout_middle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/form_row_layout_middle.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/common_toolbar_btn_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/common_toolbar_btn_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/common_toolbar_btn_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/common_toolbar_btn_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/common_toolbar_btn_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/common_toolbar_btn_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/expense_cost_btn_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/expense_cost_btn_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/expense_cost_btn_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/expense_cost_btn_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/turnplate_center_unlogin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/turnplate_center_unlogin.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_clean_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_clean_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_digit_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_digit_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_done_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_done_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_done_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_done_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_done_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_done_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/form_row_input_middle_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/form_row_input_middle_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_cancel_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_cancel_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_cancel_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_cancel_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_cancel_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_cancel_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_clean_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_clean_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_clean_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_clean_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_delete_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_delete_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_delete_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_delete_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_delete_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_delete_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_digit_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_digit_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_digit_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_digit_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_display_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_display_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/form_row_input_middle_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/form_row_input_middle_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/form_row_input_middle_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/form_row_input_middle_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/turnplate_mask_unlogin_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/turnplate_mask_unlogin_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_display_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_display_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/widget_keypad_display_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/widget_keypad_display_pressed.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/expense_cameral_money_display_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/expense_cameral_money_display_bg.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/form_row_input_middle_short_left_seleted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AnneHan/accountBook/HEAD/app/src/main/res/mipmap-hdpi/form_row_input_middle_short_left_seleted.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Sep 19 11:31:38 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 | >
2 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/cycleanytext_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/test/java/com/hyl/accountbook/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/hyl/accountbook/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_edittext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/expense_cost_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_focused.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/common_toolbar_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/widget_keypad_done.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/widget_keypad_clean.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/widget_keypad_digit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/form_row_input_middle_short_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/widget_keypad_cancel.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/widget_keypad_delete.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/form_row_input_middle.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/widget_keypad_display.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_edittext_states.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
12 |
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/WishActivity.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | /**
7 | * @programName: WishActivity.java
8 | * @programFunction: the wish wall page
9 | * @createDate: 2018/09/19
10 | * @author: AnneHan
11 | * @version:
12 | * xx. yyyy/mm/dd ver author comments
13 | * 01. 2018/09/19 1.00 AnneHan New Create
14 | */
15 | public class WishActivity extends AppCompatActivity {
16 | protected void onCreate(Bundle savedInstanceState){
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.wish);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/SettingActivity.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | /**
7 | * @programName: SettingActivity.java
8 | * @programFunction: the setting page
9 | * @createDate: 2018/09/19
10 | * @author: AnneHan
11 | * @version:
12 | * xx. yyyy/mm/dd ver author comments
13 | * 01. 2018/09/19 1.00 AnneHan New Create
14 | */
15 | public class SettingActivity extends AppCompatActivity {
16 | protected void onCreate(Bundle savedInstanceState){
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.setting);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_two.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 | #fff
8 | #ffffffff
9 | #000
10 | #1ba0e1
11 | #0c92d4
12 | #00000000
13 | #000000
14 |
15 | #88cc44
16 | #ff6600
17 |
18 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/AboutUsActivity.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.widget.TextView;
6 |
7 | /**
8 | * @programName: AboutUsActivity.java
9 | * @programFunction: About Us page
10 | * @createDate: 2018/09/19
11 | * @author: AnneHan
12 | * @version:
13 | * xx. yyyy/mm/dd ver author comments
14 | * 01. 2018/09/19 1.00 AnneHan New Create
15 | */
16 | public class AboutUsActivity extends AppCompatActivity {
17 | private TextView tvAboutUs;
18 | private TextView tvIntroduce;
19 |
20 | protected void onCreate(Bundle savedInstanceState){
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.about_us);
23 | }
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/circle_menu_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
22 |
23 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/app/src/main/res/layout/about_us.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/wish.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
25 |
26 |
--------------------------------------------------------------------------------
/accountBook.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion '29.0.3'
6 |
7 | defaultConfig {
8 | applicationId "com.hyl.accountbook"
9 | minSdkVersion 19
10 | targetSdkVersion 29
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | sourceSets {
21 | main {
22 | jniLibs.srcDirs = ['libs']
23 | }
24 | }
25 | }
26 |
27 | dependencies {
28 | compile fileTree(dir: 'libs', include: ['*.jar'])
29 | testCompile 'junit:junit:4.12'
30 | /*compile 'com.android.support:appcompat-v7:23.2.0'
31 | compile 'com.android.support:design:23.2.0'*/
32 | compile 'com.android.support:appcompat-v7:+'
33 | compile 'com.android.support:design:+'
34 | compile files('libs/achartengine-1.0.0.jar')
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_one_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
16 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/regist.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
26 |
27 |
37 |
38 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 金金记较
3 | Hello world!
4 | Settings
5 |
6 | 类别
7 | 子类别
8 | 账户
9 | 商家
10 | 项目
11 | 保存
12 | 取消
13 |
14 | 关于我们
15 | 我们团队立志要开发一款简单的、好用的、人性化 的个人钱包管理APP软件;
16 | 此软件能带您轻松管理自己的收入和花销,还有统计和警告功能,再也不用担心钱花超了。
17 |
18 | 登录
19 | 忘记密码
20 | 开始注册
21 | 注册
22 | 重置密码
23 | 确认
24 |
25 | 明细
26 | 类别报表
27 |
28 | 特色设置
29 | 该功能正在开发中,敬请期待!
30 |
31 | 心愿墙
32 | 该功能正在开发中,敬请期待!
33 |
34 | 统计
35 | 该功能正在开发中,敬请期待!
36 |
37 |
38 | 备注
39 | 保存
40 | 取消
41 |
42 |
43 | 请填写金额
44 | 编辑成功
45 | 保存成功
46 | 编辑收入
47 | 编辑支出
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/dao/DBOpenHelper.java:
--------------------------------------------------------------------------------
1 | package com.hyl.dao;
2 |
3 | import android.content.Context;
4 | import android.database.sqlite.SQLiteDatabase;
5 | import android.database.sqlite.SQLiteOpenHelper;
6 | import android.database.sqlite.SQLiteDatabase.CursorFactory;
7 |
8 | /**
9 | * @programName: DBOpenHelper.java
10 | * @programFunction: database helper class
11 | * @createDate: 2018/09/19
12 | * @author: AnneHan
13 | * @version:
14 | * xx. yyyy/mm/dd ver author comments
15 | * 01. 2018/09/19 1.00 AnneHan New Create
16 | */
17 | public class DBOpenHelper extends SQLiteOpenHelper {
18 | public DBOpenHelper(Context context,String name, CursorFactory factory,
19 | int version){
20 | super(context, name, factory, version);
21 | }
22 |
23 | @Override
24 | //首次创建数据库的时候调用,一般可以执行建库,建表的操作
25 | //Sqlite没有单独的布尔存储类型,它使用INTEGER作为存储类型,0为false,1为true
26 | public void onCreate(SQLiteDatabase db){
27 | //user table
28 | db.execSQL("create table if not exists user_tb(_id integer primary key autoincrement," +
29 | "userID text not null," +
30 | "pwd text not null)");
31 |
32 | //Configuration table
33 | db.execSQL("create table if not exists refCode_tb(_id integer primary key autoincrement," +
34 | "CodeType text not null," +
35 | "CodeID text not null," +
36 | "CodeName text null)");
37 |
38 | //costDetail_tb
39 | db.execSQL("create table if not exists basicCode_tb(_id integer primary key autoincrement," +
40 | "userID text not null," +
41 | "Type integer not null," +
42 | "incomeWay text not null," +
43 | "incomeBy text not null," +
44 | "category text not null," +
45 | "item text not null," +
46 | "cost money not null," +
47 | "note text not null," +
48 | "makeDate text not null)");
49 | }
50 |
51 | @Override//当数据库的版本发生变化时,会自动执行
52 | public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
53 |
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/res_password.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
26 |
27 |
37 |
38 |
48 |
49 |
56 |
57 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/RegistActivity.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import com.hyl.dao.DBOpenHelper;
4 | import com.hyl.util.pubFun;
5 |
6 | import android.content.ContentValues;
7 | import android.database.Cursor;
8 | import android.database.sqlite.SQLiteDatabase;
9 | import android.os.Bundle;
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.view.View;
12 | import android.widget.Button;
13 | import android.widget.EditText;
14 | import android.widget.Toast;
15 |
16 | /**
17 | * @programName: RegistActivity.java
18 | * @programFunction: the regiter page
19 | * @createDate: 2018/09/19
20 | * @author: AnneHan
21 | * @version:
22 | * xx. yyyy/mm/dd ver author comments
23 | * 01. 2018/09/19 1.00 AnneHan New Create
24 | */
25 | public class RegistActivity extends AppCompatActivity {
26 | private EditText editPhone;
27 | private EditText editPwd;
28 | private Button btnRegist;
29 |
30 | protected void onCreate(Bundle savedInstanceState){
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.regist);
33 | editPhone = (EditText) findViewById(R.id.editPhone);
34 | editPwd = (EditText) findViewById(R.id.editPwd);
35 | btnRegist = (Button) findViewById(R.id.btnRegist);
36 | }
37 |
38 | /**
39 | * register event
40 | * @param v
41 | */
42 | public void OnMyRegistClick(View v)
43 | {
44 | boolean isTrue = true;
45 | if(pubFun.isPhoneNumberValid(editPhone.getText().toString()) == false){
46 | isTrue = false;
47 | Toast.makeText(this, "手机号格式不正确!", Toast.LENGTH_SHORT).show();
48 | return;
49 | }
50 | if(pubFun.isEmpty(editPwd.getText().toString())){
51 | isTrue = false;
52 | Toast.makeText(this, "密码不能为空!", Toast.LENGTH_SHORT).show();
53 | return;
54 | }
55 |
56 | if(isTrue = true){
57 | //call DBOpenHelper
58 | DBOpenHelper helper = new DBOpenHelper(this,"qianbao.db",null,1);
59 | SQLiteDatabase db = helper.getWritableDatabase();
60 | Cursor c = db.query("user_tb",null,"userID=?",new String[]{editPhone.getText().toString()},null,null,null);
61 | if(c!=null && c.getCount() >= 1){
62 | Toast.makeText(this, "该用户已存在", Toast.LENGTH_SHORT).show();
63 | c.close();
64 | }
65 | else{
66 | //insert data
67 | ContentValues values= new ContentValues();
68 | values.put("userID",editPhone.getText().toString());
69 | values.put("pwd",editPwd.getText().toString());
70 | long rowid = db.insert("user_tb",null,values);
71 |
72 | Toast.makeText(this, "注册成功", Toast.LENGTH_SHORT).show();
73 | this.finish();
74 | }
75 | db.close();
76 | }else{
77 | return;
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/util/pubFun.java:
--------------------------------------------------------------------------------
1 | package com.hyl.util;
2 |
3 | import android.text.format.Time;
4 |
5 | import java.text.SimpleDateFormat;
6 | import java.util.Date;
7 | import java.util.regex.Matcher;
8 | import java.util.regex.Pattern;
9 |
10 | /**
11 | * @programName: pubFun.java
12 | * @programFunction: public function
13 | * @createDate: 2018/09/19
14 | * @author: AnneHan
15 | * @version:
16 | * xx. yyyy/mm/dd ver author comments
17 | * 01. 2018/09/19 1.00 AnneHan New Create
18 | */
19 | public class pubFun {
20 | /**
21 | * check string is empty
22 | * @param input
23 | * @return
24 | */
25 | public static boolean isEmpty( String input )
26 | {
27 | if ( input == null || "".equals( input ) )
28 | return true;
29 |
30 | for ( int i = 0; i < input.length(); i++ )
31 | {
32 | char c = input.charAt( i );
33 | if ( c != ' ' && c != '\t' && c != '\r' && c != '\n' )
34 | {
35 | return false;
36 | }
37 | }
38 | return true;
39 | }
40 |
41 | /**
42 | * check phone is valid
43 | * @param phoneNumber
44 | * @return
45 | */
46 | public static boolean isPhoneNumberValid(String phoneNumber) {
47 | boolean isValid = false;
48 | //Acceptable phone formats include:
49 | String expression = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{5})$";
50 | String expression2 = "^\\(?(\\d{3})\\)?[- ]?(\\d{4})[- ]?(\\d{4})$";
51 | CharSequence inputStr = phoneNumber;
52 | Pattern pattern = Pattern.compile(expression);
53 | Matcher matcher = pattern.matcher(inputStr);
54 |
55 | Pattern pattern2 = Pattern.compile(expression2);
56 | Matcher matcher2 = pattern2.matcher(inputStr);
57 | if(matcher.matches() || matcher2.matches()) {
58 | isValid = true;
59 | }
60 | return isValid;
61 | }
62 |
63 | /**
64 | * 获取当前年月日
65 | * 输出的值为System.out: 月:8 ##年:2018 ##日:20 ##时:11(其中输出的月份的值是实际月份-1)
66 | * @param strFlag
67 | * @return
68 | */
69 | public static Integer getTime(String strFlag){
70 | Time t = new Time(); // or Time t=new Time("GMT+8"); 加上Time Zone资料
71 | t.setToNow(); // 取得系统时间
72 | int reValue = 0;
73 | if(strFlag == "Y"){
74 | reValue = t.year;
75 | }else if(strFlag == "M"){
76 | reValue = t.month;
77 | }else if(strFlag == "D"){
78 | reValue = t.monthDay;
79 | }else if(strFlag == "H"){
80 | reValue = t.hour;
81 | }
82 | return reValue;
83 | }
84 |
85 | /**
86 | *
87 | * @param date
88 | * @return
89 | */
90 | public static String format(Date date){
91 | String str = "";
92 | SimpleDateFormat ymd = null;
93 | ymd = new SimpleDateFormat("yyyy-MM-dd");
94 | str = ymd.format(date);
95 | return str;
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/login.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
26 |
27 |
37 |
38 |
45 |
46 |
47 |
52 |
53 |
54 |
65 |
66 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # accountBook
2 | 这是我独立做的第一个APP,是一个记账本APP。
3 | This is the first APP, I've ever done on my own. It's a accountbook APP.
4 |
5 | # 关于我
6 | ***
7 | Author | AnneHan
8 | -- | --
9 | E-mail | lilyhyl@163.com
10 | Blog | https://www.cnblogs.com/AnneHan/
11 | ***
12 |
13 | # 效果图
14 | (备注:在把图片制作成gif时,图片的质量受损,所以最终呈现出来的gif图片,背景变得有些模糊)
15 |
16 |
17 | # 开发环境
18 | IDE:Android Studio
19 | Database:SQLite
20 |
21 | # 功能介绍
22 | 该APP共包含6个功能,分别是:
23 | 1、登录&注册功能:
24 | 进入该界面,默认是让用户进行登录操作;
25 | 若用户之前没有注册过,则会提示让用户进行注册;
26 | 若用户忘记登录密码,也有重置密码的功能。
27 |
28 | 2、收入&支出功能:
29 | 该功能分为两个页签:明细、类别报表
30 | 这两个页签内容,都根据月份来统计呈现(开发中,目前是呈现所有收支明细)
31 | 并根据月份,显示当月的收入与支出(开发中,目前是呈现固定值)
32 |
33 | 明细页签:
34 | 在该页签最下方会显示【记一笔】按钮,点击该按钮,会提示让用户选择记录的类型,是收入 or 支出
35 | 然后会进入到记录收支明细的界面
36 | 根据用户的选择类型,来呈现不同的内容
37 | 当用户录入好收支明细,点击保存,会返回到明细页签,此时会刷新明细页签的内容(刷新功能开发中)
38 |
39 | 类别报表页签:
40 | 该页签会根据用户的收支明细的类别来进行统计,呈现方式是圆形饼图(具体的统计逻辑开发中)
41 |
42 | 3、统计功能:
43 | 该功能分为两个页签:明细、类别报表(该功能和收入&支出功能类似)
44 | 这两个页签内容,都根据月份来统计呈现(开发中,目前是呈现所有收支明细)
45 | 并根据月份,显示当月的结余,以及相比上月支出(开发中,目前是呈现固定值)
46 |
47 | 4、特殊设置功能:该功能正在设计中。
48 |
49 | 5、心愿墙功能:该功能正在设计中。
50 |
51 | 6、关于我们功能:该功能主要是对APP进行简要介绍。
52 |
53 | # 数据库设计:
54 | 目前APP共涉及到三个表,分别是:用户信息表、配置表、收支明细表
55 | ```Java
56 | public void onCreate(SQLiteDatabase db){
57 | //user table
58 | db.execSQL("create table if not exists user_tb(_id integer primary key autoincrement," +
59 | "userID text not null," +
60 | "pwd text not null)");
61 |
62 | //Configuration table
63 | db.execSQL("create table if not exists refCode_tb(_id integer primary key autoincrement," +
64 | "CodeType text not null," +
65 | "CodeID text not null," +
66 | "CodeName text null)");
67 |
68 | //costDetail_tb
69 | db.execSQL("create table if not exists basicCode_tb(_id integer primary key autoincrement," +
70 | "userID text not null," +
71 | "Type integer not null," +
72 | "incomeWay text not null," +
73 | "incomeBy text not null," +
74 | "category text not null," +
75 | "item text not null," +
76 | "cost money not null," +
77 | "note text not null," +
78 | "makeDate text not null)");
79 | }
80 | ```
81 |
82 | # 教程
83 | 以下博文是根据APP中涉及到的功能进行整理的,如下:
84 | * [Android Studio 快速实现上传项目到Github(详细步骤)](https://www.cnblogs.com/AnneHan/p/9707232.html)
85 | * [Android Studio 在项目中引用第三方jar包](https://www.cnblogs.com/AnneHan/p/9708051.html)
86 | * [Android Studio 通过一个登录功能介绍SQLite数据库的使用](https://www.cnblogs.com/AnneHan/p/9724688.html)
87 | * [Android Studio 使用ViewPager + Fragment实现滑动菜单Tab效果 --简易版](https://www.cnblogs.com/AnneHan/p/9702365.html)
88 | * [Android Studio列表用法之一:ListView图文列表显示(实例)](https://www.cnblogs.com/AnneHan/p/9726391.html)
89 | * [Android Studio 使用AChartEngine制作饼图](https://www.cnblogs.com/AnneHan/p/9773958.html)
90 | * [Android Studio 使用Intent实现页面的跳转(带参数)](https://www.cnblogs.com/AnneHan/p/9705431.html)
91 | * [Android Studio 点击两次返回键,退出APP](https://www.cnblogs.com/AnneHan/p/9704836.html)
92 |
93 | # 参考:
94 | * 首页的旋转菜单参考该博文:[参考](https://blog.csdn.net/lmj623565791/article/details/43131133)
95 |
96 | # 版本:
97 | 目前的版本为V1.0
98 | APP还有很多功能需要继续完善,希望有兴趣的小伙伴可以一起参与进来,和我一起来开发完善。
99 |
100 | # 一点想说的话
101 | 不论遇到什么困难,都不应该成为我们放弃的理由
102 |
--------------------------------------------------------------------------------
/README_V2.0.md:
--------------------------------------------------------------------------------
1 | # accountBook
2 | 这是我独立做的第一个APP,是一个记账本APP。
3 | This is the first APP, I've ever done on my own. It's a accountbook APP.
4 |
5 | # 关于我
6 | ***
7 | Author | AnneHan
8 | -- | --
9 | E-mail | lilyhyl@163.com
10 | Blog | https://www.cnblogs.com/AnneHan/
11 | ***
12 |
13 | # 效果图
14 | (备注:在把图片制作成gif时,图片的质量受损,所以最终呈现出来的gif图片,背景变得有些模糊)
15 |
16 |
17 | # 开发环境
18 | IDE:Android Studio
19 | Database:SQLite
20 |
21 | # 功能介绍
22 | 该APP共包含6个功能,分别是:
23 | 1、登录&注册功能:
24 | 进入该界面,默认是让用户进行登录操作;
25 | 若用户之前没有注册过,则会提示让用户进行注册;
26 | 若用户忘记登录密码,也有重置密码的功能。
27 |
28 | 2、收入&支出功能:
29 | 该功能分为两个页签:明细、类别报表
30 | 这两个页签内容,都根据月份来统计呈现(开发中,目前是呈现所有收支明细)
31 | 并根据月份,显示当月的收入与支出(开发中,目前是呈现固定值)
32 |
33 | 明细页签:
34 | 在该页签最下方会显示【记一笔】按钮,点击该按钮,会提示让用户选择记录的类型,是收入 or 支出
35 | 然后会进入到记录收支明细的界面
36 | 根据用户的选择类型,来呈现不同的内容
37 | 当用户录入好收支明细,点击保存,会返回到明细页签,此时会刷新明细页签的内容(刷新功能开发中)
38 |
39 | 类别报表页签:
40 | 该页签会根据用户的收支明细的类别来进行统计,呈现方式是圆形饼图(具体的统计逻辑开发中)
41 |
42 | 3、统计功能:
43 | 该功能分为两个页签:明细、类别报表(该功能和收入&支出功能类似)
44 | 这两个页签内容,都根据月份来统计呈现(开发中,目前是呈现所有收支明细)
45 | 并根据月份,显示当月的结余,以及相比上月支出(开发中,目前是呈现固定值)
46 |
47 | 4、特殊设置功能:该功能正在设计中。
48 |
49 | 5、心愿墙功能:该功能正在设计中。
50 |
51 | 6、关于我们功能:该功能主要是对APP进行简要介绍。
52 |
53 | # 数据库设计:
54 | 目前APP共涉及到三个表,分别是:用户信息表、配置表、收支明细表
55 | ```Java
56 | public void onCreate(SQLiteDatabase db){
57 | //user table
58 | db.execSQL("create table if not exists user_tb(_id integer primary key autoincrement," +
59 | "userID text not null," +
60 | "pwd text not null)");
61 |
62 | //Configuration table
63 | db.execSQL("create table if not exists refCode_tb(_id integer primary key autoincrement," +
64 | "CodeType text not null," +
65 | "CodeID text not null," +
66 | "CodeName text null)");
67 |
68 | //costDetail_tb
69 | db.execSQL("create table if not exists basicCode_tb(_id integer primary key autoincrement," +
70 | "userID text not null," +
71 | "Type integer not null," +
72 | "incomeWay text not null," +
73 | "incomeBy text not null," +
74 | "category text not null," +
75 | "item text not null," +
76 | "cost money not null," +
77 | "note text not null," +
78 | "makeDate text not null)");
79 | }
80 | ```
81 |
82 | # 教程
83 | 以下博文是根据APP中涉及到的功能进行整理的,如下:
84 | * [Android Studio 快速实现上传项目到Github(详细步骤)](https://www.cnblogs.com/AnneHan/p/9707232.html)
85 | * [Android Studio 在项目中引用第三方jar包](https://www.cnblogs.com/AnneHan/p/9708051.html)
86 | * [Android Studio 通过一个登录功能介绍SQLite数据库的使用](https://www.cnblogs.com/AnneHan/p/9724688.html)
87 | * [Android Studio 使用ViewPager + Fragment实现滑动菜单Tab效果 --简易版](https://www.cnblogs.com/AnneHan/p/9702365.html)
88 | * [Android Studio列表用法之一:ListView图文列表显示(实例)](https://www.cnblogs.com/AnneHan/p/9726391.html)
89 | * [Android Studio 使用AChartEngine制作饼图](https://www.cnblogs.com/AnneHan/p/9773958.html)
90 | * [Android Studio 使用Intent实现页面的跳转(带参数)](https://www.cnblogs.com/AnneHan/p/9705431.html)
91 | * [Android Studio 点击两次返回键,退出APP](https://www.cnblogs.com/AnneHan/p/9704836.html)
92 |
93 | # 参考:
94 | * 首页的旋转菜单参考该博文:[参考](https://blog.csdn.net/lmj623565791/article/details/43131133)
95 |
96 | # 版本:
97 | 目前的版本为V1.0
98 | APP还有很多功能需要继续完善,希望有兴趣的小伙伴可以一起参与进来,和我一起来开发完善。
99 |
100 | # 一点想说的话
101 | 不论遇到什么困难,都不应该成为我们放弃的理由
102 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/LoginActivity.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import com.hyl.util.pubFun;
4 | import com.hyl.dao.DBOpenHelper;
5 |
6 | import android.app.Activity;
7 | import android.content.Intent;
8 | import android.content.SharedPreferences;
9 | import android.database.Cursor;
10 | import android.database.sqlite.SQLiteDatabase;
11 | import android.os.Bundle;
12 | import android.support.v7.app.AppCompatActivity;
13 | import android.util.Log;
14 | import android.view.View;
15 | import android.widget.Button;
16 | import android.widget.EditText;
17 | import android.widget.Toast;
18 |
19 | /**
20 | * @programName: LoginActivity.java
21 | * @programFunction: the login page
22 | * @createDate: 2018/09/19
23 | * @author: AnneHan
24 | * @version:
25 | * xx. yyyy/mm/dd ver author comments
26 | * 01. 2018/09/19 1.00 AnneHan New Create
27 | */
28 | public class LoginActivity extends AppCompatActivity {
29 |
30 | private EditText editPhone;
31 | private EditText editPwd;
32 | private Button btnLogin;
33 |
34 | protected void onCreate(Bundle savedInstanceState){
35 | super.onCreate(savedInstanceState);
36 | setContentView(R.layout.login);
37 | editPhone = (EditText) findViewById(R.id.editPhone);
38 | editPwd = (EditText) findViewById(R.id.editPwd);
39 | btnLogin = (Button) findViewById(R.id.btnLogin);
40 | }
41 |
42 | /**
43 | * login event
44 | * @param v
45 | */
46 | public void OnMyLoginClick(View v){
47 | if(pubFun.isEmpty(editPhone.getText().toString()) || pubFun.isEmpty(editPwd.getText().toString())){
48 | Toast.makeText(this, "手机号或密码不能为空!", Toast.LENGTH_SHORT).show();
49 | return;
50 | }
51 |
52 | //call DBOpenHelper
53 | DBOpenHelper helper = new DBOpenHelper(this,"qianbao.db",null,1);
54 | SQLiteDatabase db = helper.getWritableDatabase();
55 | Cursor c = db.query("user_tb",null,"userID=? and pwd=?",new String[]{editPhone.getText().toString(),editPwd.getText().toString()},null,null,null);
56 | if(c!=null && c.getCount() >= 1){
57 | String[] cols = c.getColumnNames();
58 | while(c.moveToNext()){
59 | for(String ColumnName:cols){
60 | Log.i("info",ColumnName+":"+c.getString(c.getColumnIndex(ColumnName)));
61 | }
62 | }
63 | c.close();
64 | db.close();
65 |
66 | //将登陆用户信息存储到SharedPreferences中
67 | SharedPreferences mySharedPreferences= getSharedPreferences("setting",Activity.MODE_PRIVATE); //实例化SharedPreferences对象
68 | SharedPreferences.Editor editor = mySharedPreferences.edit();//实例化SharedPreferences.Editor对象
69 | editor.putString("userID", editPhone.getText().toString()); //用putString的方法保存数据
70 | editor.commit(); //提交当前数据
71 |
72 | this.finish();
73 | }
74 | else{
75 | Toast.makeText(this, "手机号或密码输入错误!", Toast.LENGTH_SHORT).show();
76 | }
77 | }
78 |
79 | /**
80 | * Jump to the registration interface
81 | * @param v
82 | */
83 | public void OnMyRegistClick(View v) {
84 | Intent intent=new Intent(LoginActivity.this,RegistActivity.class);
85 | //intent.putExtra("info", "No66778899");
86 | LoginActivity.this.startActivity(intent);
87 | }
88 |
89 | /**
90 | * Jump to reset password interface
91 | * @param v
92 | */
93 | public void OnMyResPwdClick(View v){
94 | Intent intent=new Intent(LoginActivity.this,ResPwdActivity.class);
95 | LoginActivity.this.startActivity(intent);
96 | }
97 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/ResPwdActivity.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import com.hyl.dao.DBOpenHelper;
4 | import com.hyl.util.pubFun;
5 |
6 | import android.app.AlertDialog;
7 | import android.content.ContentValues;
8 | import android.content.DialogInterface;
9 | import android.content.Intent;
10 | import android.database.Cursor;
11 | import android.database.sqlite.SQLiteDatabase;
12 | import android.os.Bundle;
13 | import android.support.v7.app.AppCompatActivity;
14 | import android.view.View;
15 | import android.widget.Button;
16 | import android.widget.EditText;
17 | import android.widget.Toast;
18 |
19 | /**
20 | * @programName: ResPwdActivity.java
21 | * @programFunction: the reset password page
22 | * @createDate: 2018/09/19
23 | * @author: AnneHan
24 | * @version:
25 | * xx. yyyy/mm/dd ver author comments
26 | * 01. 2018/09/19 1.00 AnneHan New Create
27 | */
28 | public class ResPwdActivity extends AppCompatActivity {
29 | private EditText editPhone;
30 | private EditText editPwd;
31 | private EditText editResPwd;
32 | private Button btnConfirm;
33 |
34 | public void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 | setContentView(R.layout.res_password);
37 | editPhone = (EditText) findViewById(R.id.editPhone);
38 | editPwd = (EditText) findViewById(R.id.editPwd);
39 | editResPwd = (EditText) findViewById(R.id.editResPwd);
40 | btnConfirm = (Button) findViewById(R.id.btnConfirm);
41 | }
42 |
43 | /**
44 | * confirm event
45 | * @param v
46 | */
47 | public void OnMyConfirmClick(View v) {
48 | confirmInfo();
49 | }
50 |
51 | /**
52 | * confirm event
53 | */
54 | private void confirmInfo() {
55 | if(pubFun.isEmpty(editPhone.getText().toString()) || pubFun.isEmpty(editPwd.getText().toString()) || pubFun.isEmpty(editResPwd.getText().toString())){
56 | Toast.makeText(this, "手机号或密码不能为空!", Toast.LENGTH_SHORT).show();
57 | return;
58 | }
59 | if(!editPwd.getText().toString().equals(editResPwd.getText().toString())){
60 | Toast.makeText(this, "输入密码不正确!", Toast.LENGTH_SHORT).show();
61 | return;
62 | }
63 |
64 | //调用DBOpenHelper
65 | DBOpenHelper helper = new DBOpenHelper(this,"qianbao.db",null,1);
66 | SQLiteDatabase db = helper.getWritableDatabase();
67 | Cursor c = db.query("user_tb",null,"userID=?",new String[]{editPhone.getText().toString()},null,null,null);
68 | if(c!=null && c.getCount() >= 1){
69 | ContentValues cv = new ContentValues();
70 | cv.put("pwd", editPwd.getText().toString());
71 | String[] args = {String.valueOf(editPhone.getText().toString())};
72 | long rowid = db.update("user_tb", cv, "userID=?",args);
73 | c.close();
74 | db.close();
75 | Toast.makeText(this, "密码重置成功!", Toast.LENGTH_SHORT).show();
76 | this.finish();
77 | }
78 | else{
79 | new AlertDialog.Builder(this)
80 | .setTitle("提示")
81 | .setMessage("该用户不存在,请到注册界面进行注册!")
82 | .setPositiveButton("确定", new DialogInterface.OnClickListener() {
83 | public void onClick(DialogInterface dialog, int whichButton) {
84 | setResult(RESULT_OK);
85 | Intent intent=new Intent(ResPwdActivity.this,RegistActivity.class);
86 | ResPwdActivity.this.startActivity(intent);
87 | }
88 | })
89 | .setNegativeButton("取消", new DialogInterface.OnClickListener() {
90 | public void onClick(DialogInterface dialog, int whichButton) {
91 | return;
92 | }
93 | })
94 | .show();
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/count.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
19 |
27 |
35 |
36 |
37 |
41 |
47 |
48 |
57 |
66 |
67 |
68 |
78 |
79 |
80 |
89 |
90 |
91 |
100 |
101 |
102 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/keypad.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
25 |
27 |
32 |
37 |
42 |
43 |
45 |
50 |
55 |
60 |
61 |
63 |
68 |
73 |
78 |
79 |
81 |
86 |
91 |
95 |
96 |
98 |
102 |
106 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/TwoFragment.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import android.graphics.Color;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.view.ViewGroup.LayoutParams;
10 | import android.widget.LinearLayout;
11 |
12 | import org.achartengine.ChartFactory;
13 | import org.achartengine.GraphicalView;
14 | import org.achartengine.model.CategorySeries;
15 | import org.achartengine.renderer.DefaultRenderer;
16 | import org.achartengine.renderer.SimpleSeriesRenderer;
17 |
18 | /**
19 | * @programName: TwoFragment.java
20 | * @programFunction: Display of category reports
21 | * @createDate: 2018/09/19
22 | * @author: AnneHan
23 | * @version:
24 | * xx. yyyy/mm/dd ver author comments
25 | * 01. 2018/09/19 1.00 AnneHan New Create
26 | */
27 | public class TwoFragment extends Fragment {
28 |
29 | double[] values = {500.00, 800.00, 1000.00, 900.00};
30 | double sumVal = values[0] + values[1] + values[2] + values[3];
31 | int[] colors = {Color.BLUE, Color.GREEN, Color.MAGENTA, Color.RED};
32 |
33 | private LinearLayout ll_expense_piechart;
34 | private GraphicalView graphicalView;
35 |
36 | public TwoFragment() {
37 | // Required empty public constructor
38 | }
39 |
40 | @Override
41 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
42 | // Inflate the layout for this fragment
43 | View v = inflater.inflate(R.layout.fragment_two, container, false);
44 |
45 | initPieChart(v);
46 |
47 | return v;
48 | }
49 |
50 | /**
51 | * 生成饼图
52 | */
53 | private void initPieChart(View v){
54 | CategorySeries dataset = buildCategoryDataset("图文报表", values);
55 | DefaultRenderer renderer = buildCategoryRenderer(colors);
56 |
57 | ll_expense_piechart = (LinearLayout) v.findViewById(R.id.ll_expense_piechart);
58 | ll_expense_piechart.removeAllViews();
59 |
60 | graphicalView = ChartFactory.getPieChartView(getContext()
61 | ,dataset, renderer);//饼状图
62 | graphicalView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
63 |
64 | ll_expense_piechart.addView(graphicalView);
65 | }
66 |
67 | /**
68 | * 构建数据集
69 | * @param title
70 | * @param values
71 | * @return
72 | */
73 | protected CategorySeries buildCategoryDataset(String title, double[] values){
74 | CategorySeries series = new CategorySeries(title);
75 | series.add("房租:"+values[0], values[0]/sumVal);
76 | series.add("伙食费:"+values[1], values[1]/sumVal);
77 | series.add("生活费:"+values[2], values[2]/sumVal);
78 | series.add("其它:"+values[3], values[3]/sumVal);
79 | return series;
80 | }
81 |
82 | /**
83 | * 构建渲染器
84 | * @return
85 | */
86 | private DefaultRenderer getPieRenderer(){
87 | DefaultRenderer renderer = new DefaultRenderer();
88 | renderer.setZoomButtonsVisible(true);//设置显示放大放小缩小按钮
89 | renderer.setZoomEnabled(true);//设置允许放大放小
90 | //设置各个类别分别对应的颜色
91 | SimpleSeriesRenderer yellowRenderer = new SimpleSeriesRenderer();
92 | yellowRenderer.setColor(Color.YELLOW);
93 | SimpleSeriesRenderer blueRenderer = new SimpleSeriesRenderer();
94 | blueRenderer.setColor(Color.BLUE);
95 | SimpleSeriesRenderer redRenderer = new SimpleSeriesRenderer();
96 | redRenderer.setColor(Color.RED);
97 | renderer.addSeriesRenderer(yellowRenderer);
98 | renderer.addSeriesRenderer(blueRenderer);
99 | renderer.addSeriesRenderer(redRenderer);
100 |
101 | renderer.setLabelsTextSize(30);//设置坐标字号
102 | renderer.setLegendTextSize(50);//设置图例字号
103 | renderer.setApplyBackgroundColor(true);//设置是否应用背景色
104 | renderer.setBackgroundColor(Color.BLACK);
105 |
106 | return renderer;
107 | }
108 |
109 | /**
110 | * 构建渲染器
111 | * @param colors
112 | * @return
113 | */
114 | protected DefaultRenderer buildCategoryRenderer(int[] colors){
115 | DefaultRenderer renderer = new DefaultRenderer();
116 | renderer.setLegendTextSize(35);//设置左下角标注文字的大小
117 | renderer.setLabelsTextSize(25);//饼图上标记文字的字体大小
118 | renderer.setLabelsColor(Color.BLACK);//饼图上标记文字的颜色
119 | renderer.setPanEnabled(false);
120 | //renderer.setDisplayValues(true);//显示数据
121 |
122 |
123 | for(int color : colors){
124 | SimpleSeriesRenderer r = new SimpleSeriesRenderer();
125 | r.setColor(color);
126 | //设置百分比
127 | //r.setChartValuesFormat(NumberFormat.getPercentInstance());
128 | renderer.addSeriesRenderer(r);
129 | }
130 | return renderer;
131 | }
132 | }
133 |
134 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import com.hyl.accountbook.CircleMenuLayout.OnMenuItemClickListener;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.view.KeyEvent;
9 | import android.view.View;
10 | import android.widget.Toast;
11 |
12 | /**
13 | * @programName: MainActivity.java
14 | * @programFunction: the home page
15 | * @createDate: 2018/09/19
16 | * @author: AnneHan
17 | * @version:
18 | * xx. yyyy/mm/dd ver author comments
19 | * 01. 2018/09/19 1.00 AnneHan New Create
20 | */
21 | public class MainActivity extends AppCompatActivity {
22 |
23 | //第一次点击事件发生的时间
24 | private long mExitTime;
25 |
26 | private CircleMenuLayout mCircleMenuLayout;
27 |
28 | private String[] mItemTexts = new String[] { "登录&注册", "关于我们", "心愿墙",
29 | "特色设置", "收入&支出", "统计" };
30 | private int[] mItemImgs = new int[] { R.mipmap.home_mbank_1_normal,
31 | R.mipmap.home_mbank_2_normal, R.mipmap.home_mbank_3_normal,
32 | R.mipmap.home_mbank_4_normal, R.mipmap.home_mbank_5_normal,
33 | R.mipmap.home_mbank_6_normal };
34 |
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState){
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.activity_main);
39 |
40 | mCircleMenuLayout = (CircleMenuLayout) findViewById(R.id.id_menulayout);
41 | mCircleMenuLayout.setMenuItemIconsAndTexts(mItemImgs, mItemTexts);
42 |
43 | mCircleMenuLayout.setOnMenuItemClickListener(new OnMenuItemClickListener() {
44 | public void itemClick(View view, int pos) {
45 | if (mItemTexts[pos] == "特色设置") {
46 | openSettingWind(view);
47 | } else if (mItemTexts[pos] == "收入&支出") {
48 | openSpendingWind(view);
49 | } else if (mItemTexts[pos] == "登录&注册") {
50 | openLoginWind(view);
51 | } else if (mItemTexts[pos] == "统计") {
52 | openCountWind(view);
53 | } else if (mItemTexts[pos] == "关于我们") {
54 | openAboutUsAddWind(view);
55 | } else if (mItemTexts[pos] == "心愿墙") {
56 | openWishWind(view);
57 | }
58 | ;
59 | }
60 |
61 | public void itemCenterClick(View view) {
62 | Toast.makeText(MainActivity.this, "you can do something just like login or register", Toast.LENGTH_SHORT).show();
63 | }
64 | });
65 | }
66 |
67 | /**
68 | * 跳转至登录&注册界面
69 | * @param v
70 | */
71 | private void openLoginWind(View v){
72 | Intent intent = new Intent();
73 | intent.setClass(MainActivity.this, LoginActivity.class);
74 | this.startActivity(intent);
75 | }
76 |
77 | /**
78 | * 跳转至开销界面,记录收入与支出
79 | * @param v
80 | */
81 | private void openSpendingWind(View v){
82 | Intent intent = new Intent();
83 | intent.setClass(MainActivity.this, SpendingActivity.class);
84 | this.startActivity(intent);
85 | }
86 |
87 | /**
88 | * 跳转至统计界面
89 | * @param v
90 | */
91 | private void openCountWind(View v){
92 | Intent intent=new Intent();
93 | intent.setClass(MainActivity.this, CountActivity.class);
94 | this.startActivity(intent);
95 | }
96 |
97 | /**
98 | * 跳转至特色设置界面
99 | * @param v
100 | */
101 | private void openSettingWind(View v){
102 | Intent intent = new Intent();
103 | intent.setClass(MainActivity.this, SettingActivity.class);
104 | this.startActivity(intent);
105 | }
106 |
107 | /**
108 | * 跳转至心愿墙界面
109 | * @param v
110 | */
111 | private void openWishWind(View v){
112 | Intent intent = new Intent();
113 | intent.setClass(MainActivity.this, WishActivity.class);
114 | this.startActivity(intent);
115 | }
116 |
117 | /**
118 | * 跳转至关于我们界面
119 | * @param v
120 | */
121 | private void openAboutUsAddWind(View v){
122 | Intent intent=new Intent();
123 | intent.setClass(MainActivity.this, AboutUsActivity.class);
124 | this.startActivity(intent);
125 | }
126 |
127 | /**
128 | * 点击两次返回退出app
129 | */
130 | @Override
131 | public boolean onKeyDown(int keyCode, KeyEvent event) {
132 | if (keyCode == KeyEvent.KEYCODE_BACK) {
133 | if ((System.currentTimeMillis() - mExitTime) > 2000) {
134 | Object mHelperUtils;
135 | Toast.makeText(this, "再按一次退出金金记较", Toast.LENGTH_SHORT).show();
136 | //System.currentTimeMillis()系统当前时间
137 | mExitTime = System.currentTimeMillis();
138 | } else {
139 | finish();
140 | }
141 | return true;
142 | }
143 | return super.onKeyDown(keyCode, event);
144 | }
145 |
146 |
147 | }
148 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/spending.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
21 |
22 |
26 |
34 |
42 |
50 |
51 |
52 |
56 |
62 |
63 |
72 |
81 |
82 |
83 |
93 |
94 |
95 |
104 |
105 |
106 |
115 |
116 |
117 |
122 |
123 |
124 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/KeyPad.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.view.View;
6 | import android.view.View.OnClickListener;
7 | import android.widget.Button;
8 |
9 | /**
10 | * @programName: KeyPad.java
11 | * @programFunction:
12 | * @createDate: 2018/09/19
13 | * @author: AnneHan
14 | * @version:
15 | * xx. yyyy/mm/dd ver author comments
16 | * 01. 2018/09/19 1.00 AnneHan New Create
17 | */
18 | public class KeyPad extends AppCompatActivity implements OnClickListener {
19 | private Button btnDisplay = null;
20 |
21 | private Button btnOne = null;
22 |
23 | private Button btnTwo = null;
24 |
25 | private Button btnThree = null;
26 |
27 | private Button btnFour = null;
28 |
29 | private Button btnFive = null;
30 |
31 | private Button btnSix = null;
32 |
33 | private Button btnSeven = null;
34 |
35 | private Button btnEight = null;
36 |
37 | private Button btnNine = null;
38 |
39 | private Button btnZero = null;
40 |
41 | private Button btnDot = null;
42 |
43 | private Button btnDelete = null;
44 |
45 | private Button btnCancel = null;
46 |
47 | private Button btnClean = null;
48 |
49 | private Button btnDone = null;
50 |
51 | private String value = "0";
52 |
53 | private boolean isValueEmpty = false;
54 |
55 | @Override
56 | public void onCreate(Bundle savedInstanceState) {
57 | super.onCreate(savedInstanceState);
58 | setContentView(R.layout.keypad);
59 | btnDisplay = (Button) findViewById(R.id.display);
60 | btnOne = (Button) findViewById(R.id.one);
61 | btnTwo = (Button) findViewById(R.id.two);
62 | btnThree = (Button) findViewById(R.id.three);
63 | btnFour = (Button) findViewById(R.id.four);
64 | btnFive = (Button) findViewById(R.id.five);
65 | btnSix = (Button) findViewById(R.id.six);
66 | btnSeven = (Button) findViewById(R.id.seven);
67 | btnEight = (Button) findViewById(R.id.eight);
68 | btnNine = (Button) findViewById(R.id.nine);
69 | btnZero = (Button) findViewById(R.id.zero);
70 | btnDot = (Button) findViewById(R.id.dot);
71 | btnDelete = (Button) findViewById(R.id.delete);
72 | btnCancel = (Button) findViewById(R.id.cancel);
73 | btnClean = (Button) findViewById(R.id.clean);
74 | btnDone = (Button) findViewById(R.id.done);
75 | btnDisplay.setOnClickListener(this);
76 | btnOne.setOnClickListener(this);
77 | btnTwo.setOnClickListener(this);
78 | btnThree.setOnClickListener(this);
79 | btnFour.setOnClickListener(this);
80 | btnFive.setOnClickListener(this);
81 | btnSix.setOnClickListener(this);
82 | btnSeven.setOnClickListener(this);
83 | btnEight.setOnClickListener(this);
84 | btnNine.setOnClickListener(this);
85 | btnZero.setOnClickListener(this);
86 | btnDot.setOnClickListener(this);
87 | btnDelete.setOnClickListener(this);
88 | btnCancel.setOnClickListener(this);
89 | btnClean.setOnClickListener(this);
90 | btnDone.setOnClickListener(this);
91 | if(this.getIntent().hasExtra("value"))
92 | {
93 | value=this.getIntent().getStringExtra("value");
94 | }
95 | if(value==null || value.equals(""))
96 | {
97 | value="0";
98 | isValueEmpty = true;
99 | }
100 | btnDisplay.setText(value);
101 |
102 | }
103 |
104 | /*
105 | * (non-Javadoc)
106 | *
107 | * @see android.view.View.OnClickListener#onClick(android.view.View)
108 | */
109 | @Override
110 | public void onClick(View v) {
111 | // TODO Auto-generated method stub
112 | switch (v.getId()) {
113 | case R.id.display:
114 | break;
115 | case R.id.delete:
116 | if (value.length() > 1) {
117 | value = value.substring(0, value.length() - 1);
118 | } else {
119 | value = "0";
120 | }
121 | break;
122 | case R.id.cancel:
123 | this.setResult(RESULT_CANCELED);
124 | this.finish();
125 | break;
126 | case R.id.clean:
127 | value = "0";
128 | break;
129 | case R.id.done:
130 | /*
131 | * Bundle bundle = new Bundle(); bundle.putString("value", value);
132 | * SendSMSActivity.this.setResult(RESULT_CANCELED,
133 | * SendSMSActivity.this.getIntent().putExtras(bundle
134 | */
135 | this.setResult(RESULT_OK, this.getIntent().putExtra("value", value));
136 | this.finish();
137 | break;
138 | default:
139 | int i = 0;
140 | if(!isValueEmpty){
141 | value = "0";
142 | isValueEmpty = true;
143 | }
144 | if (v.getId() == R.id.dot) {
145 | if (value.indexOf(".") > -1) {
146 | break;
147 | }
148 | i = 1;
149 | } else {
150 | if (value.equals("0")) {
151 | value = "";
152 | }
153 | }
154 | if(value.indexOf(".")>-1 || i==1){
155 | if (value.length() < 9) {
156 | value = value + ((Button) v).getText();
157 | }
158 | }else{
159 | if (value.length() < 6) {
160 | value = value + ((Button) v).getText();
161 | }
162 | }
163 |
164 | break;
165 | }
166 | // DecimalFormat df2 = new DecimalFormat("#####,##0.##");
167 | if(value.indexOf(".")>-1 && value.indexOf(".") mFragmentList = new ArrayList();
40 | private FragmentAdapter mFragmentAdapter;
41 |
42 | private Spinner month_spinner;
43 | private ArrayAdapter month_adapter;
44 |
45 | private AlertDialog alertDialog_AddRecord;//点击记一笔按钮时弹出提示框
46 |
47 | String[] titles = new String[]{"明细", "类别报表"};
48 | private static final String[] yearList = {pubFun.getTime("Y") + "年"};
49 | private static final String[] monthList = { "01月", "02月", "03月", "04月", "05月", "06月", "07月", "08月", "09月", "10月", "11月", "12月" };
50 |
51 | protected void onCreate(Bundle savedInstanceState){
52 | super.onCreate(savedInstanceState);
53 | //去除工具栏
54 | getSupportActionBar().hide();
55 | setContentView(R.layout.count);
56 |
57 | initViews();
58 |
59 | initSpinner();
60 |
61 | mFragmentAdapter = new FragmentAdapter(this.getSupportFragmentManager(), mFragmentList);
62 | vp.setOffscreenPageLimit(2);//ViewPager的缓存为2帧
63 | vp.setAdapter(mFragmentAdapter);
64 | vp.setCurrentItem(0);//初始设置ViewPager选中第一帧
65 | item_detail.setTextColor(Color.parseColor("#1ba0e1"));
66 |
67 | //ViewPager的监听事件
68 | vp.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
69 | @Override
70 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
71 |
72 | }
73 |
74 | @Override
75 | public void onPageSelected(int position) {
76 | /*此方法在页面被选中时调用*/
77 | //title.setText(titles[position]);
78 | changeTextColor(position);
79 | }
80 |
81 | @Override
82 | public void onPageScrollStateChanged(int state) {
83 | /*此方法是在状态改变的时候调用,其中arg0这个参数有三种状态(0,1,2)。
84 | arg0==1的时辰默示正在滑动,
85 | arg0==2的时辰默示滑动完毕了,
86 | arg0==0的时辰默示什么都没做。*/
87 | }
88 | });
89 | }
90 |
91 | /**
92 | * 初始化布局View
93 | */
94 | private void initViews() {
95 | //title = (TextView) findViewById(R.id.title);
96 | tv_year = (TextView) findViewById(R.id.tv_year);
97 | tv_year.setText(yearList[0]);
98 |
99 | btnAddRecord = (Button) findViewById(R.id.btnAddRecord);
100 |
101 | item_detail = (TextView) findViewById(R.id.item_detail);
102 | item_category_report = (TextView) findViewById(R.id.item_category_report);
103 |
104 | item_detail.setOnClickListener(this);
105 | item_category_report.setOnClickListener(this);
106 |
107 | vp = (ViewPager) findViewById(R.id.mainViewPager);
108 | oneFragment = new OneFragment();
109 | twoFragment = new TwoFragment();
110 | //给FragmentList添加数据
111 | mFragmentList.add(oneFragment);
112 | mFragmentList.add(twoFragment);
113 | }
114 |
115 | /**
116 | * 初始化spinner
117 | */
118 | private void initSpinner(){
119 | month_spinner = (Spinner) findViewById(R.id.month_spinner);
120 | //将可选内容与ArrayAdapter连接起来
121 | month_adapter = new ArrayAdapter(this,
122 | android.R.layout.simple_spinner_item, monthList);
123 | //设置下拉列表的风格
124 | month_adapter
125 | .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
126 | //将adapter添加到spinner中
127 | month_spinner.setAdapter(month_adapter);
128 | //添加事件Spinner事件监听
129 | month_spinner
130 | .setOnItemSelectedListener(new month_spinnerSelectedListener());
131 | //设置默认值
132 | month_spinner.setSelection(pubFun.getTime("M"), true);
133 | month_spinner.setVisibility(View.VISIBLE);
134 | }
135 |
136 | /**
137 | * 选择 月份 事件 监听器
138 | */
139 | class month_spinnerSelectedListener implements AdapterView.OnItemSelectedListener {
140 | public void onItemSelected(AdapterView> arg0, View arg1, int arg2,
141 | long arg3) {
142 | int pos = month_spinner.getSelectedItemPosition();
143 | }
144 | public void onNothingSelected(AdapterView> arg0) {
145 | }
146 | }
147 |
148 | /**
149 | * 点击底部Text 动态修改ViewPager的内容
150 | */
151 | @Override
152 | public void onClick(View v) {
153 | switch (v.getId()) {
154 | case R.id.item_detail:
155 | vp.setCurrentItem(0, true);
156 | break;
157 | case R.id.item_category_report:
158 | vp.setCurrentItem(1, true);
159 | break;
160 | }
161 | }
162 |
163 | public class FragmentAdapter extends FragmentPagerAdapter {
164 |
165 | List fragmentList = new ArrayList();
166 |
167 | public FragmentAdapter(FragmentManager fm, List fragmentList) {
168 | super(fm);
169 | this.fragmentList = fragmentList;
170 | }
171 |
172 | @Override
173 | public Fragment getItem(int position) {
174 | return fragmentList.get(position);
175 | }
176 |
177 | @Override
178 | public int getCount() {
179 | return fragmentList.size();
180 | }
181 |
182 | }
183 |
184 | /**
185 | * 由ViewPager的滑动修改底部导航Text的颜色
186 | * @param position
187 | */
188 | private void changeTextColor(int position) {
189 | if (position == 0) {
190 | item_detail.setTextColor(Color.parseColor("#1ba0e1"));
191 | item_category_report.setTextColor(Color.parseColor("#000000"));
192 | } else if (position == 1) {
193 | item_category_report.setTextColor(Color.parseColor("#1ba0e1"));
194 | item_detail.setTextColor(Color.parseColor("#000000"));
195 | }
196 | }
197 |
198 | }
199 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hyl/accountbook/OneFragment.java:
--------------------------------------------------------------------------------
1 | package com.hyl.accountbook;
2 |
3 | import android.app.Activity;
4 | import android.app.AlertDialog;
5 | import android.content.DialogInterface;
6 | import android.content.Intent;
7 | import android.content.SharedPreferences;
8 | import android.database.Cursor;
9 | import android.database.sqlite.SQLiteDatabase;
10 | import android.os.Bundle;
11 | import android.os.Handler;
12 | import android.support.v4.app.Fragment;
13 | import android.util.Log;
14 | import android.view.LayoutInflater;
15 | import android.view.View;
16 | import android.view.ViewGroup;
17 | import android.widget.AdapterView;
18 | import android.widget.ListView;
19 | import android.widget.SimpleAdapter;
20 | import android.widget.Toast;
21 |
22 | import com.hyl.dao.DBOpenHelper;
23 |
24 | import java.util.ArrayList;
25 | import java.util.HashMap;
26 | import java.util.List;
27 | import java.util.Map;
28 |
29 | /**
30 | * @programName: OneFragment.java
31 | * @programFunction: Recording details of income and expenditure
32 | * @createDate: 2018/09/19
33 | * @author: AnneHan
34 | * @version:
35 | * xx. yyyy/mm/dd ver author comments
36 | * 01. 2018/09/19 1.00 AnneHan New Create
37 | */
38 | public class OneFragment extends Fragment {
39 |
40 | ListView listView;
41 | SimpleAdapter adapter;
42 |
43 | List