├── .idea
├── .name
├── .gitignore
├── compiler.xml
├── vcs.xml
├── misc.xml
├── runConfigurations.xml
├── gradle.xml
├── jarRepositories.xml
└── codeStyles
│ └── Project.xml
├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── edit.png
│ │ │ │ ├── more.png
│ │ │ │ ├── ih_hide.png
│ │ │ │ ├── ih_show.png
│ │ │ │ ├── search.png
│ │ │ │ ├── ic_icon1.png
│ │ │ │ ├── ih_biaoge.png
│ │ │ │ ├── ih_error.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── it_searchtext.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── in_qt.png
│ │ │ │ ├── ic_qita.png
│ │ │ │ ├── ic_yule.png
│ │ │ │ ├── it_back.png
│ │ │ │ ├── it_jilu.png
│ │ │ │ ├── it_rili.png
│ │ │ │ ├── ic_canyin.png
│ │ │ │ ├── ic_fushi.png
│ │ │ │ ├── ic_gouwu.png
│ │ │ │ ├── ic_lingshi.png
│ │ │ │ ├── ic_qita_fs.png
│ │ │ │ ├── ic_shicai.png
│ │ │ │ ├── ic_tongxun.png
│ │ │ │ ├── ic_xuexi.png
│ │ │ │ ├── ic_yanjiu.png
│ │ │ │ ├── ic_yiliao.png
│ │ │ │ ├── ic_yule_fs.png
│ │ │ │ ├── ic_zhufang.png
│ │ │ │ ├── in_jieru.png
│ │ │ │ ├── in_qt_fs.png
│ │ │ │ ├── in_shezhi.png
│ │ │ │ ├── in_touzi.png
│ │ │ │ ├── in_xinzi.png
│ │ │ │ ├── in_yiwai.png
│ │ │ │ ├── it_guanyu.png
│ │ │ │ ├── it_shezhi.png
│ │ │ │ ├── it_xiqing.png
│ │ │ │ ├── ic_canyin_fs.png
│ │ │ │ ├── ic_fushi_fs.png
│ │ │ │ ├── ic_gouwu_fs.png
│ │ │ │ ├── ic_jiaotong.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_riyongpin.png
│ │ │ │ ├── ic_shicai_fs.png
│ │ │ │ ├── ic_xuexi_fs.png
│ │ │ │ ├── ic_yanjiu_fs.png
│ │ │ │ ├── ic_yiliao_fs.png
│ │ │ │ ├── in_jiangjin.png
│ │ │ │ ├── in_jieru_fs.png
│ │ │ │ ├── in_lixifuji.png
│ │ │ │ ├── in_shezhi_fs.png
│ │ │ │ ├── in_shouzhai.png
│ │ │ │ ├── in_touzi_fs.png
│ │ │ │ ├── in_xinzi_fs.png
│ │ │ │ ├── in_yiwai_fs.png
│ │ │ │ ├── ic_jiaotong_fs.png
│ │ │ │ ├── ic_lingshi_fs.png
│ │ │ │ ├── ic_riyongpin_fs.png
│ │ │ │ ├── ic_shuidianfei.png
│ │ │ │ ├── ic_tongxun_fs.png
│ │ │ │ ├── ic_zhufang_fs.png
│ │ │ │ ├── in_ershoushebei.png
│ │ │ │ ├── in_jiangjin_fs.png
│ │ │ │ ├── in_lixifuji_fs.png
│ │ │ │ ├── in_shouzhai_fs.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── ic_renqingwanglai.png
│ │ │ │ ├── ic_shuidianfei_fs.png
│ │ │ │ ├── ic_renqingwanglai_fs.png
│ │ │ │ └── in_ershoushebei_fs.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_icon1.png
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── drawable
│ │ │ │ ├── main_morebtn_bg.xml
│ │ │ │ ├── main_recordbtn_bg.xml
│ │ │ │ ├── dialog_btn_bg.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── strings.xml
│ │ │ ├── layout
│ │ │ │ ├── fragment_incom_chart.xml
│ │ │ │ ├── item_dialogcal_gv.xml
│ │ │ │ ├── item_dialogcal_hsv.xml
│ │ │ │ ├── item_chartfrag_top.xml
│ │ │ │ ├── item_recordfrag_gv.xml
│ │ │ │ ├── dialog_calendar.xml
│ │ │ │ ├── activity_record.xml
│ │ │ │ ├── item_chartfrag_lv.xml
│ │ │ │ ├── activity_setting.xml
│ │ │ │ ├── dialog_more.xml
│ │ │ │ ├── dialog_budget.xml
│ │ │ │ ├── item_mainlv.xml
│ │ │ │ ├── dialog_beizhu.xml
│ │ │ │ ├── activity_history.xml
│ │ │ │ ├── activity_search.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── dialog_time.xml
│ │ │ │ ├── fragment_outcome.xml
│ │ │ │ ├── item_mainlv_top.xml
│ │ │ │ ├── activity_month_chart.xml
│ │ │ │ └── activity_about.xml
│ │ │ ├── xml
│ │ │ │ └── key.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── hui
│ │ │ │ └── tally
│ │ │ │ ├── UniteApp.java
│ │ │ │ ├── AboutActivity.java
│ │ │ │ ├── utils
│ │ │ │ ├── FloatUtils.java
│ │ │ │ ├── BeiZhuDialog.java
│ │ │ │ ├── MoreDialog.java
│ │ │ │ ├── KeyBoardUtils.java
│ │ │ │ ├── BudgetDialog.java
│ │ │ │ ├── SelectTimeDialog.java
│ │ │ │ └── CalendarDialog.java
│ │ │ │ ├── adapter
│ │ │ │ ├── ChartVPAdapter.java
│ │ │ │ ├── RecordPagerAdapter.java
│ │ │ │ ├── CalendarAdapter.java
│ │ │ │ ├── ChartItemAdapter.java
│ │ │ │ └── AccountAdapter.java
│ │ │ │ ├── frag_record
│ │ │ │ ├── IncomeFragment.java
│ │ │ │ ├── OutcomeFragment.java
│ │ │ │ ├── TypeBaseAdapter.java
│ │ │ │ └── BaseRecordFragment.java
│ │ │ │ ├── db
│ │ │ │ ├── BarChartItemBean.java
│ │ │ │ ├── ChartItemBean.java
│ │ │ │ ├── TypeBean.java
│ │ │ │ ├── AccountBean.java
│ │ │ │ └── DBOpenHelper.java
│ │ │ │ ├── SettingActivity.java
│ │ │ │ ├── RecordActivity.java
│ │ │ │ ├── SearchActivity.java
│ │ │ │ ├── HistoryActivity.java
│ │ │ │ ├── frag_chart
│ │ │ │ ├── OutcomChartFragment.java
│ │ │ │ ├── IncomChartFragment.java
│ │ │ │ └── BaseChartFragment.java
│ │ │ │ └── MonthChartActivity.java
│ │ ├── assets
│ │ │ └── 项目介绍.txt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── hui
│ │ │ └── tally
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── hui
│ │ └── tally
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── 小图-m
├── in_qt.png
├── ic_canyin.png
├── ic_fushi.png
├── ic_gouwu.png
├── ic_qita.png
├── ic_shicai.png
├── ic_xuexi.png
├── ic_yanjiu.png
├── ic_yiliao.png
├── ic_yule.png
├── in_jieru.png
├── in_qt_fs.png
├── in_shezhi.png
├── in_touzi.png
├── in_xinzi.png
├── in_yiwai.png
├── it_back.png
├── it_guanyu.png
├── it_jilu.png
├── it_rili.png
├── it_shezhi.png
├── it_xiqing.png
├── ic_fushi_fs.png
├── ic_gouwu_fs.png
├── ic_jiaotong.png
├── ic_lingshi.png
├── ic_qita_fs.png
├── ic_tongxun.png
├── ic_xuexi_fs.png
├── ic_yule_fs.png
├── ic_zhufang.png
├── in_jiangjin.png
├── in_jieru_fs.png
├── in_lixifuji.png
├── in_shouzhai.png
├── in_touzi_fs.png
├── in_xinzi_fs.png
├── in_yiwai_fs.png
├── ic_canyin_fs.png
├── ic_jiaotong_fs.png
├── ic_lingshi_fs.png
├── ic_riyongpin.png
├── ic_shicai_fs.png
├── ic_shuidianfei.png
├── ic_tongxun_fs.png
├── ic_yanjiu_fs.png
├── ic_yiliao_fs.png
├── ic_zhufang_fs.png
├── in_jiangjin_fs.png
├── in_lixifuji_fs.png
├── in_shezhi_fs.png
├── in_shouzhai_fs.png
├── ic_riyongpin_fs.png
├── in_ershoushebei.png
├── ic_renqingwanglai.png
├── ic_shuidianfei_fs.png
├── in_ershoushebei_fs.png
└── ic_renqingwanglai_fs.png
├── 大一点的图-h
├── edit.png
├── more.png
├── search.png
├── ic_icon1.png
├── ih_error.png
├── ih_hide.png
├── ih_show.png
├── ih_biaoge.png
└── it_searchtext.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── README.md
├── gradle.properties
├── gradlew.bat
└── gradlew
/.idea/.name:
--------------------------------------------------------------------------------
1 | tally
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name='tally'
3 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/小图-m/in_qt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_qt.png
--------------------------------------------------------------------------------
/大一点的图-h/edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/edit.png
--------------------------------------------------------------------------------
/大一点的图-h/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/more.png
--------------------------------------------------------------------------------
/大一点的图-h/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/search.png
--------------------------------------------------------------------------------
/小图-m/ic_canyin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_canyin.png
--------------------------------------------------------------------------------
/小图-m/ic_fushi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_fushi.png
--------------------------------------------------------------------------------
/小图-m/ic_gouwu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_gouwu.png
--------------------------------------------------------------------------------
/小图-m/ic_qita.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_qita.png
--------------------------------------------------------------------------------
/小图-m/ic_shicai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_shicai.png
--------------------------------------------------------------------------------
/小图-m/ic_xuexi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_xuexi.png
--------------------------------------------------------------------------------
/小图-m/ic_yanjiu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_yanjiu.png
--------------------------------------------------------------------------------
/小图-m/ic_yiliao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_yiliao.png
--------------------------------------------------------------------------------
/小图-m/ic_yule.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_yule.png
--------------------------------------------------------------------------------
/小图-m/in_jieru.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_jieru.png
--------------------------------------------------------------------------------
/小图-m/in_qt_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_qt_fs.png
--------------------------------------------------------------------------------
/小图-m/in_shezhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_shezhi.png
--------------------------------------------------------------------------------
/小图-m/in_touzi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_touzi.png
--------------------------------------------------------------------------------
/小图-m/in_xinzi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_xinzi.png
--------------------------------------------------------------------------------
/小图-m/in_yiwai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_yiwai.png
--------------------------------------------------------------------------------
/小图-m/it_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/it_back.png
--------------------------------------------------------------------------------
/小图-m/it_guanyu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/it_guanyu.png
--------------------------------------------------------------------------------
/小图-m/it_jilu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/it_jilu.png
--------------------------------------------------------------------------------
/小图-m/it_rili.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/it_rili.png
--------------------------------------------------------------------------------
/小图-m/it_shezhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/it_shezhi.png
--------------------------------------------------------------------------------
/小图-m/it_xiqing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/it_xiqing.png
--------------------------------------------------------------------------------
/大一点的图-h/ic_icon1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/ic_icon1.png
--------------------------------------------------------------------------------
/大一点的图-h/ih_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/ih_error.png
--------------------------------------------------------------------------------
/大一点的图-h/ih_hide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/ih_hide.png
--------------------------------------------------------------------------------
/大一点的图-h/ih_show.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/ih_show.png
--------------------------------------------------------------------------------
/小图-m/ic_fushi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_fushi_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_gouwu_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_gouwu_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_jiaotong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_jiaotong.png
--------------------------------------------------------------------------------
/小图-m/ic_lingshi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_lingshi.png
--------------------------------------------------------------------------------
/小图-m/ic_qita_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_qita_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_tongxun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_tongxun.png
--------------------------------------------------------------------------------
/小图-m/ic_xuexi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_xuexi_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_yule_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_yule_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_zhufang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_zhufang.png
--------------------------------------------------------------------------------
/小图-m/in_jiangjin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_jiangjin.png
--------------------------------------------------------------------------------
/小图-m/in_jieru_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_jieru_fs.png
--------------------------------------------------------------------------------
/小图-m/in_lixifuji.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_lixifuji.png
--------------------------------------------------------------------------------
/小图-m/in_shouzhai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_shouzhai.png
--------------------------------------------------------------------------------
/小图-m/in_touzi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_touzi_fs.png
--------------------------------------------------------------------------------
/小图-m/in_xinzi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_xinzi_fs.png
--------------------------------------------------------------------------------
/小图-m/in_yiwai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_yiwai_fs.png
--------------------------------------------------------------------------------
/大一点的图-h/ih_biaoge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/ih_biaoge.png
--------------------------------------------------------------------------------
/小图-m/ic_canyin_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_canyin_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_jiaotong_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_jiaotong_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_lingshi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_lingshi_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_riyongpin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_riyongpin.png
--------------------------------------------------------------------------------
/小图-m/ic_shicai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_shicai_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_shuidianfei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_shuidianfei.png
--------------------------------------------------------------------------------
/小图-m/ic_tongxun_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_tongxun_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_yanjiu_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_yanjiu_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_yiliao_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_yiliao_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_zhufang_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_zhufang_fs.png
--------------------------------------------------------------------------------
/小图-m/in_jiangjin_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_jiangjin_fs.png
--------------------------------------------------------------------------------
/小图-m/in_lixifuji_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_lixifuji_fs.png
--------------------------------------------------------------------------------
/小图-m/in_shezhi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_shezhi_fs.png
--------------------------------------------------------------------------------
/小图-m/in_shouzhai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_shouzhai_fs.png
--------------------------------------------------------------------------------
/大一点的图-h/it_searchtext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/大一点的图-h/it_searchtext.png
--------------------------------------------------------------------------------
/小图-m/ic_riyongpin_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_riyongpin_fs.png
--------------------------------------------------------------------------------
/小图-m/in_ershoushebei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_ershoushebei.png
--------------------------------------------------------------------------------
/小图-m/ic_renqingwanglai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_renqingwanglai.png
--------------------------------------------------------------------------------
/小图-m/ic_shuidianfei_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_shuidianfei_fs.png
--------------------------------------------------------------------------------
/小图-m/in_ershoushebei_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/in_ershoushebei_fs.png
--------------------------------------------------------------------------------
/小图-m/ic_renqingwanglai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/小图-m/ic_renqingwanglai_fs.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/edit.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/more.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_qt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_qt.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ih_hide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/ih_hide.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ih_show.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/ih_show.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/search.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_qita.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_qita.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_yule.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_yule.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/it_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/it_back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/it_jilu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/it_jilu.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/it_rili.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/it_rili.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_icon1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/ic_icon1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ih_biaoge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/ih_biaoge.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ih_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/ih_error.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_canyin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_canyin.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_fushi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_fushi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_gouwu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_gouwu.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_lingshi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_lingshi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_qita_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_qita_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_shicai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_shicai.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_tongxun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_tongxun.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_xuexi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_xuexi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_yanjiu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_yanjiu.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_yiliao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_yiliao.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_yule_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_yule_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_zhufang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_zhufang.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_jieru.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_jieru.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_qt_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_qt_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_shezhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_shezhi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_touzi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_touzi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_xinzi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_xinzi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_yiwai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_yiwai.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/it_guanyu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/it_guanyu.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/it_shezhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/it_shezhi.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/it_xiqing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/it_xiqing.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_canyin_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_canyin_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_fushi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_fushi_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_gouwu_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_gouwu_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_jiaotong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_jiaotong.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_riyongpin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_riyongpin.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_shicai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_shicai_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_xuexi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_xuexi_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_yanjiu_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_yanjiu_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_yiliao_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_yiliao_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_jiangjin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_jiangjin.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_jieru_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_jieru_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_lixifuji.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_lixifuji.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_shezhi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_shezhi_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_shouzhai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_shouzhai.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_touzi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_touzi_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_xinzi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_xinzi_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_yiwai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_yiwai_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_icon1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-anydpi-v26/ic_icon1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/it_searchtext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/it_searchtext.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_jiaotong_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_jiaotong_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_lingshi_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_lingshi_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_riyongpin_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_riyongpin_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_shuidianfei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_shuidianfei.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_tongxun_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_tongxun_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_zhufang_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_zhufang_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_ershoushebei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_ershoushebei.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_jiangjin_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_jiangjin_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_lixifuji_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_lixifuji_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_shouzhai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_shouzhai_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_renqingwanglai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_renqingwanglai.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_shuidianfei_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_shuidianfei_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_renqingwanglai_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/ic_renqingwanglai_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/in_ershoushebei_fs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-mdpi/in_ershoushebei_fs.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAH01/bookkeeping-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/main_morebtn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Oct 30 17:47:42 CST 2020
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-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/main_recordbtn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dialog_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/UniteApp.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import android.app.Application;
4 |
5 | import com.hui.tally.db.DBManager;
6 |
7 | /* 表示全局应用的类*/
8 | public class UniteApp extends Application {
9 | @Override
10 | public void onCreate() {
11 | super.onCreate();
12 | // 初始化数据库
13 | DBManager.initDB(getApplicationContext());
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/test/java/com/hui/tally/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/assets/项目介绍.txt:
--------------------------------------------------------------------------------
1 | 项目名称: 简约记账
2 | 开发工具:Android Studio
3 | 项目描述:基于安卓基础知识点开发的个人记账工具,其中包括记录当天收支情况,计算当天以及当月共收支总钱数,能查看历史账单,能对于每月收支情况进行图标分析,百分比分析,
4 | 能够搜索用户关于某种记录的全部收支情况等功能。基本上能够解决个人记账的所有问题,界面简约美观,滑动流畅。
5 | 项目重要技术点:
6 | 1-绘制布局,掌握android基本view控件的属性和使用
7 | 2-熟练掌握Activity页面展示,跳转和传值
8 | 3-使用碎片加载界面,滑动视图切换页面
9 | 4-自定义对话框
10 | 5-自定义软键盘绘制和使用
11 | 6-列表视图以及网格视图的适配器使用和页面加载
12 | 7-使用Android自带数据库,熟练创建表,并进行增删改查
13 | 8-定义drawable文件,设定布局以及控件样式
14 | 9-使用MPAndroidChart第三方框架绘制柱状图
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 | #000000
7 | #f3f3f3
8 | #7D7D7D
9 | #ffffff
10 | #006400
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | public class AboutActivity extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_about);
14 | }
15 |
16 | public void onClick(View view) {
17 | finish();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_incom_chart.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # tally
2 | 记账本Android安卓应用
3 |
4 | 
5 |
6 | ---
7 | 
8 |
9 | ---
10 | 
11 |
12 | ---
13 | 
14 |
15 | ---
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_dialogcal_gv.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/utils/FloatUtils.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.utils;
2 |
3 | import java.math.BigDecimal;
4 |
5 | public class FloatUtils {
6 |
7 | /* 进行除法运算,保留4位小数*/
8 | public static float div(float v1,float v2){
9 | float v3 = v1/v2;
10 | BigDecimal b1 = new BigDecimal(v3);
11 | float val = b1.setScale(4, 4).floatValue();
12 | return val;
13 | }
14 |
15 | // 将浮点数类型,转换成百分比显示形式
16 | public static String ratioToPercent(float val){
17 | float v = val*100;
18 | BigDecimal b1 = new BigDecimal(v);
19 | float v1 = b1.setScale(2, 4).floatValue();
20 | String per = v1+"%";
21 | return per;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_dialogcal_hsv.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_chartfrag_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/adapter/ChartVPAdapter.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.adapter;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.fragment.app.Fragment;
5 | import androidx.fragment.app.FragmentManager;
6 | import androidx.fragment.app.FragmentPagerAdapter;
7 |
8 | import java.util.List;
9 |
10 | public class ChartVPAdapter extends FragmentPagerAdapter {
11 | ListfragmentList;
12 | public ChartVPAdapter(@NonNull FragmentManager fm, ListfragmentList) {
13 | super(fm);
14 | this.fragmentList = fragmentList;
15 | }
16 |
17 | @NonNull
18 | @Override
19 | public Fragment getItem(int position) {
20 | return fragmentList.get(position);
21 | }
22 |
23 | @Override
24 | public int getCount() {
25 | return fragmentList.size();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
19 |
20 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/frag_record/IncomeFragment.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.frag_record;
2 | import com.hui.tally.R;
3 | import com.hui.tally.db.DBManager;
4 | import com.hui.tally.db.TypeBean;
5 | import java.util.List;
6 | /**
7 | * 收入记录页面
8 | */
9 | public class IncomeFragment extends BaseRecordFragment {
10 |
11 |
12 | @Override
13 | public void loadDataToGV() {
14 | super.loadDataToGV();
15 | //获取数据库当中的数据源
16 | List inlist = DBManager.getTypeList(1);
17 | typeList.addAll(inlist);
18 | adapter.notifyDataSetChanged();
19 | typeTv.setText("其他");
20 | typeIv.setImageResource(R.mipmap.in_qt_fs);
21 | }
22 |
23 | @Override
24 | public void saveAccountToDB() {
25 | accountBean.setKind(1);
26 | DBManager.insertItemToAccounttb(accountBean);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_recordfrag_gv.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
20 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/hui/tally/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.hui.tally", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/frag_record/OutcomeFragment.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.frag_record;
2 | import androidx.fragment.app.Fragment;
3 | import com.hui.tally.R;
4 | import com.hui.tally.db.DBManager;
5 | import com.hui.tally.db.TypeBean;
6 | import java.util.List;
7 | /**
8 | * A simple {@link Fragment} subclass.
9 | */
10 | public class OutcomeFragment extends BaseRecordFragment {
11 |
12 |
13 | // 重写
14 | @Override
15 | public void loadDataToGV() {
16 | super.loadDataToGV();
17 | //获取数据库当中的数据源
18 | List outlist = DBManager.getTypeList(0);
19 | typeList.addAll(outlist);
20 | adapter.notifyDataSetChanged();
21 | typeTv.setText("其他");
22 | typeIv.setImageResource(R.mipmap.ic_qita_fs);
23 | }
24 |
25 | @Override
26 | public void saveAccountToDB() {
27 | accountBean.setKind(0);
28 | DBManager.insertItemToAccounttb(accountBean);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.idea/gradle.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/hui/tally/adapter/RecordPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.adapter;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.annotation.Nullable;
5 | import androidx.fragment.app.Fragment;
6 | import androidx.fragment.app.FragmentManager;
7 | import androidx.fragment.app.FragmentPagerAdapter;
8 |
9 | import java.util.List;
10 |
11 | public class RecordPagerAdapter extends FragmentPagerAdapter {
12 | ListfragmentList;
13 | String[]titles = {"支出","收入"};
14 | public RecordPagerAdapter(@NonNull FragmentManager fm,ListfragmentList) {
15 | super(fm);
16 | this.fragmentList = fragmentList;
17 | }
18 |
19 | @NonNull
20 | @Override
21 | public Fragment getItem(int position) {
22 | return fragmentList.get(position);
23 | }
24 |
25 | @Override
26 | public int getCount() {
27 | return fragmentList.size();
28 | }
29 |
30 | @Nullable
31 | @Override
32 | public CharSequence getPageTitle(int position) {
33 | return titles[position];
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/db/BarChartItemBean.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.db;
2 | /* 用于描述绘制柱状图时,每一个柱子表示的对象*/
3 | public class BarChartItemBean {
4 | int year;
5 | int month;
6 | int day;
7 | float summoney;
8 |
9 | public BarChartItemBean() {
10 | }
11 |
12 | public int getYear() {
13 | return year;
14 | }
15 |
16 | public void setYear(int year) {
17 | this.year = year;
18 | }
19 |
20 | public int getMonth() {
21 | return month;
22 | }
23 |
24 | public void setMonth(int month) {
25 | this.month = month;
26 | }
27 |
28 | public int getDay() {
29 | return day;
30 | }
31 |
32 | public void setDay(int day) {
33 | this.day = day;
34 | }
35 |
36 | public float getSummoney() {
37 | return summoney;
38 | }
39 |
40 | public void setSummoney(float summoney) {
41 | this.summoney = summoney;
42 | }
43 |
44 | public BarChartItemBean(int year, int month, int day, float summoney) {
45 | this.year = year;
46 | this.month = month;
47 | this.day = day;
48 | this.summoney = summoney;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_calendar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
9 |
14 |
15 |
16 |
17 |
22 |
28 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.3"
6 | defaultConfig {
7 | applicationId "com.hui.tally"
8 | minSdkVersion 21
9 | targetSdkVersion 29
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(dir: 'libs', include: ['*.jar'])
24 | implementation 'androidx.appcompat:appcompat:1.2.0'
25 | implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
26 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
27 | testImplementation 'junit:junit:4.12'
28 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
29 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
30 | implementation 'com.google.android.material:material:1.2.0'
31 | implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/db/ChartItemBean.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.db;
2 |
3 | public class ChartItemBean {
4 | int sImageId;
5 | String type;
6 | float ratio; //所占比例
7 | float totalMoney; //此项的总钱数
8 |
9 | public ChartItemBean() {
10 | }
11 |
12 | public void setsImageId(int sImageId) {
13 | this.sImageId = sImageId;
14 | }
15 |
16 | public void setType(String type) {
17 | this.type = type;
18 | }
19 |
20 | public void setRatio(float ratio) {
21 | this.ratio = ratio;
22 | }
23 |
24 | public void setTotalMoney(float totalMoney) {
25 | this.totalMoney = totalMoney;
26 | }
27 |
28 | public int getsImageId() {
29 | return sImageId;
30 | }
31 |
32 | public String getType() {
33 | return type;
34 | }
35 |
36 | public float getRatio() {
37 | return ratio;
38 | }
39 |
40 | public float getTotalMoney() {
41 | return totalMoney;
42 | }
43 |
44 | public ChartItemBean(int sImageId, String type, float ratio, float totalMoney) {
45 | this.sImageId = sImageId;
46 | this.type = type;
47 | this.ratio = ratio;
48 | this.totalMoney = totalMoney;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/key.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.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 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/db/TypeBean.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.db;
2 | /*
3 | * 表示收入或者支出具体类型的类
4 | * */
5 | public class TypeBean {
6 | int id;
7 | String typename; //类型名称
8 | int imageId; //未被选中图片id
9 | int simageId; //被选中图片id
10 | int kind; //收入-1 支出-0
11 |
12 | public int getId() {
13 | return id;
14 | }
15 |
16 | public void setId(int id) {
17 | this.id = id;
18 | }
19 |
20 | public String getTypename() {
21 | return typename;
22 | }
23 |
24 | public void setTypename(String typename) {
25 | this.typename = typename;
26 | }
27 |
28 | public int getImageId() {
29 | return imageId;
30 | }
31 |
32 | public void setImageId(int imageId) {
33 | this.imageId = imageId;
34 | }
35 |
36 | public int getSimageId() {
37 | return simageId;
38 | }
39 |
40 | public void setSimageId(int simageId) {
41 | this.simageId = simageId;
42 | }
43 |
44 | public int getKind() {
45 | return kind;
46 | }
47 |
48 | public void setKind(int kind) {
49 | this.kind = kind;
50 | }
51 |
52 | public TypeBean() {
53 | }
54 |
55 | public TypeBean(int id, String typename, int imageId, int simageId, int kind) {
56 | this.id = id;
57 | this.typename = typename;
58 | this.imageId = imageId;
59 | this.simageId = simageId;
60 | this.kind = kind;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
18 |
28 |
29 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_chartfrag_lv.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
21 |
28 |
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/SettingActivity.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.app.AlertDialog;
6 | import android.content.DialogInterface;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.Toast;
10 |
11 | import com.hui.tally.db.DBManager;
12 |
13 | public class SettingActivity extends AppCompatActivity {
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_setting);
19 | }
20 |
21 | public void onClick(View view) {
22 | switch (view.getId()) {
23 | case R.id.setting_iv_back:
24 | finish();
25 | break;
26 | case R.id.setting_tv_clear:
27 | showDeleteDialog();
28 | break;
29 | }
30 | }
31 |
32 | private void showDeleteDialog() {
33 | AlertDialog.Builder builder = new AlertDialog.Builder(this);
34 | builder.setTitle("删除提示")
35 | .setMessage("您确定要删除所有记录么?\n注意:删除后无法恢复,请慎重选择!")
36 | .setPositiveButton("取消",null)
37 | .setNegativeButton("确定", new DialogInterface.OnClickListener() {
38 | @Override
39 | public void onClick(DialogInterface dialog, int which) {
40 | DBManager.deleteAllAccount();
41 | Toast.makeText(SettingActivity.this,"删除成功!",Toast.LENGTH_SHORT).show();
42 | }
43 | });
44 | builder.create().show();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
17 |
24 |
25 |
35 |
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/frag_record/TypeBaseAdapter.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.frag_record;
2 | import android.content.Context;
3 | import android.view.LayoutInflater;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 | import android.widget.BaseAdapter;
7 | import android.widget.ImageView;
8 | import android.widget.TextView;
9 | import com.hui.tally.R;
10 | import com.hui.tally.db.TypeBean;
11 | import java.util.List;
12 |
13 | public class TypeBaseAdapter extends BaseAdapter {
14 | Context context;
15 | ListmDatas;
16 | int selectPos = 0; //选中位置
17 | public TypeBaseAdapter(Context context, List mDatas) {
18 | this.context = context;
19 | this.mDatas = mDatas;
20 | }
21 |
22 | @Override
23 | public int getCount() {
24 | return mDatas.size();
25 | }
26 |
27 | @Override
28 | public Object getItem(int position) {
29 | return mDatas.get(position);
30 | }
31 |
32 | @Override
33 | public long getItemId(int position) {
34 | return position;
35 | }
36 | // 此适配器不考虑复用问题,因为所有的item都显示在界面上,不会因为滑动就消失,所有没有剩余的convertView,所以不用复写
37 | @Override
38 | public View getView(int position, View convertView, ViewGroup parent) {
39 | convertView = LayoutInflater.from(context).inflate(R.layout.item_recordfrag_gv,parent,false);
40 | //查找布局当中的控件
41 | ImageView iv = convertView.findViewById(R.id.item_recordfrag_iv);
42 | TextView tv = convertView.findViewById(R.id.item_recordfrag_tv);
43 | //获取指定位置的数据源
44 | TypeBean typeBean = mDatas.get(position);
45 | tv.setText(typeBean.getTypename());
46 | // 判断当前位置是否为选中位置,如果是选中位置,就设置为带颜色的图片,否则为灰色图片
47 | if (selectPos == position) {
48 | iv.setImageResource(typeBean.getSimageId());
49 | }else{
50 | iv.setImageResource(typeBean.getImageId());
51 | }
52 | return convertView;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/RecordActivity.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.fragment.app.Fragment;
5 | import androidx.viewpager.widget.ViewPager;
6 |
7 | import android.os.Bundle;
8 | import android.view.View;
9 |
10 | import com.google.android.material.tabs.TabLayout;
11 | import com.hui.tally.adapter.RecordPagerAdapter;
12 | import com.hui.tally.frag_record.IncomeFragment;
13 | import com.hui.tally.frag_record.BaseRecordFragment;
14 | import com.hui.tally.frag_record.OutcomeFragment;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | public class RecordActivity extends AppCompatActivity {
20 | TabLayout tabLayout;
21 | ViewPager viewPager;
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | setContentView(R.layout.activity_record);
26 | //1.查找控件
27 | tabLayout = findViewById(R.id.record_tabs);
28 | viewPager = findViewById(R.id.record_vp);
29 | //2.设置ViewPager加载页面
30 | initPager();
31 | }
32 |
33 | private void initPager() {
34 | // 初始化ViewPager页面的集合
35 | ListfragmentList = new ArrayList<>();
36 | // 创建收入和支出页面,放置在Fragment当中
37 | OutcomeFragment outFrag = new OutcomeFragment(); //支出
38 | IncomeFragment inFrag = new IncomeFragment(); //收入
39 | fragmentList.add(outFrag);
40 | fragmentList.add(inFrag);
41 |
42 | // 创建适配器
43 | RecordPagerAdapter pagerAdapter = new RecordPagerAdapter(getSupportFragmentManager(), fragmentList);
44 | // 设置适配器
45 | viewPager.setAdapter(pagerAdapter);
46 | //将TabLayout和ViwePager进行关联
47 | tabLayout.setupWithViewPager(viewPager);
48 | }
49 |
50 | /* 点击事件*/
51 | public void onClick(View view) {
52 | switch (view.getId()) {
53 | case R.id.record_iv_back:
54 | finish();
55 | break;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 简约记账
3 | 记一笔...
4 | 本月支出
5 | 支出
6 | 本月收入
7 | 收入
8 | 预算剩余
9 | 设置预算
10 | 查看图表分析
11 | 添加备注
12 | 备注
13 | 确定
14 | 取消
15 | 关于
16 | 设置
17 | 账单记录
18 | 账单详情
19 | 请输入时间(24小时制)
20 | 请输入搜索信息
21 | 数据为空,无此类记录~~
22 | 账单详情
23 |
24 | 应用信息
25 | 版本
26 | 1.0
27 | 关于应用
28 | 学会这个项目,就能够理解Activity,Fragment,数据库等相关内容,好好学习吧!
29 | 开发者
30 | 关于我
31 | 坐标沈阳,Android程序员。
32 | 发送邮箱
33 | 我的邮箱是:liusihui188@126.com,有问题可以找我!
34 | 源代码
35 | 我的代码托管在码云服务器上,地址链接为:\nhttps://gitee.com/happyanimee/simple-bookkeeping
36 | B站地址
37 | 我的个人Bilibili主页地址为:\nhttps://space.bilibili.com/274595492
38 |
39 | 本月账单记录
40 | 清空所有记录
41 |
42 |
43 | 暂无数据
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_more.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
16 |
23 |
28 |
29 |
35 |
41 |
42 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_budget.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
15 |
21 |
29 |
37 |
38 |
39 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_mainlv.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
18 |
25 |
32 |
33 |
39 |
45 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/SearchActivity.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.text.TextUtils;
7 | import android.view.View;
8 | import android.widget.EditText;
9 | import android.widget.ListView;
10 | import android.widget.TextView;
11 | import android.widget.Toast;
12 |
13 | import com.hui.tally.adapter.AccountAdapter;
14 | import com.hui.tally.db.AccountBean;
15 | import com.hui.tally.db.DBManager;
16 |
17 | import java.util.ArrayList;
18 | import java.util.List;
19 |
20 | public class SearchActivity extends AppCompatActivity {
21 | ListView searchLv;
22 | EditText searchEt;
23 | TextView emptyTv;
24 | ListmDatas; //数据源
25 | AccountAdapter adapter; //适配器对象
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_search);
30 | initView();
31 | mDatas = new ArrayList<>();
32 | adapter = new AccountAdapter(this,mDatas);
33 | searchLv.setAdapter(adapter);
34 | searchLv.setEmptyView(emptyTv); //设置无数局时,显示的控件
35 | }
36 |
37 | private void initView() {
38 | searchEt = findViewById(R.id.search_et);
39 | searchLv = findViewById(R.id.search_lv);
40 | emptyTv = findViewById(R.id.search_tv_empty);
41 | }
42 |
43 | public void onClick(View view) {
44 | switch (view.getId()) {
45 | case R.id.search_iv_back:
46 | finish();
47 | break;
48 | case R.id.search_iv_sh: //执行搜索的操作
49 | String msg = searchEt.getText().toString().trim();
50 | // 判断输入内容是否为空,如果为空,就提示不能搜索
51 | if (TextUtils.isEmpty(msg)) {
52 | Toast.makeText(this,"输入内容不能为空!",Toast.LENGTH_SHORT).show();
53 | return;
54 | }
55 | //开始搜索
56 | List list = DBManager.getAccountListByRemarkFromAccounttb(msg);
57 | mDatas.clear();
58 | mDatas.addAll(list);
59 | adapter.notifyDataSetChanged();
60 | break;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/adapter/CalendarAdapter.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.adapter;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.BaseAdapter;
9 | import android.widget.TextView;
10 |
11 | import androidx.core.content.ContextCompat;
12 |
13 | import com.hui.tally.R;
14 |
15 | import java.util.ArrayList;
16 | import java.util.List;
17 |
18 | /*
19 | * 历史账单界面,点击日历表,弹出对话框,当中的GridView对应的适配器
20 | * */
21 | public class CalendarAdapter extends BaseAdapter {
22 | Context context;
23 | ListmDatas;
24 | public int year;
25 | public int selPos = -1;
26 |
27 | public void setYear(int year) {
28 | this.year = year;
29 | mDatas.clear();
30 | loadDatas(year);
31 | notifyDataSetChanged();
32 | }
33 |
34 | public CalendarAdapter(Context context, int year) {
35 | this.context = context;
36 | this.year = year;
37 | mDatas = new ArrayList<>();
38 | loadDatas(year);
39 | }
40 |
41 | private void loadDatas(int year) {
42 | for (int i = 1; i < 13; i++) {
43 | String data = year+"/"+i;
44 | mDatas.add(data);
45 | }
46 | }
47 |
48 | @Override
49 | public int getCount() {
50 | return mDatas.size();
51 | }
52 |
53 | @Override
54 | public Object getItem(int position) {
55 | return mDatas.get(position);
56 | }
57 |
58 | @Override
59 | public long getItemId(int position) {
60 | return position;
61 | }
62 |
63 | @Override
64 | public View getView(int position, View convertView, ViewGroup parent) {
65 | convertView = LayoutInflater.from(context).inflate(R.layout.item_dialogcal_gv,parent,false);
66 | TextView tv = convertView.findViewById(R.id.item_dialogcal_gv_tv);
67 | tv.setText(mDatas.get(position));
68 | tv.setBackgroundResource(R.color.grey_f3f3f3);
69 | tv.setTextColor(Color.BLACK);
70 | if (position == selPos) {
71 | tv.setBackgroundResource(R.color.green_006400);
72 | tv.setTextColor(Color.WHITE);
73 | }
74 | return convertView;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_beizhu.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
13 |
23 |
24 |
25 |
31 |
41 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_history.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
17 |
24 |
32 |
33 |
37 |
42 |
49 |
50 |
57 |
--------------------------------------------------------------------------------
/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 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
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 Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
17 |
30 |
31 |
32 |
41 |
42 |
49 |
58 |
59 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
20 |
27 |
28 |
38 |
39 |
48 |
49 |
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/adapter/ChartItemAdapter.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.ImageView;
9 | import android.widget.ListView;
10 | import android.widget.TextView;
11 |
12 | import com.hui.tally.R;
13 | import com.hui.tally.db.ChartItemBean;
14 | import com.hui.tally.utils.FloatUtils;
15 |
16 | import java.util.List;
17 |
18 | /*
19 | * 账单详情页面,listview的适配器
20 | * */
21 | public class ChartItemAdapter extends BaseAdapter {
22 | Context context;
23 | List mDatas;
24 | LayoutInflater inflater;
25 | public ChartItemAdapter(Context context, List mDatas) {
26 | this.context = context;
27 | this.mDatas = mDatas;
28 | inflater = LayoutInflater.from(context);
29 | }
30 |
31 | @Override
32 | public int getCount() {
33 | return mDatas.size();
34 | }
35 |
36 | @Override
37 | public Object getItem(int position) {
38 | return mDatas.get(position);
39 | }
40 |
41 | @Override
42 | public long getItemId(int position) {
43 | return position;
44 | }
45 |
46 | @Override
47 | public View getView(int position, View convertView, ViewGroup parent) {
48 | ViewHolder holder = null;
49 | if (convertView == null) {
50 | convertView = inflater.inflate(R.layout.item_chartfrag_lv,parent,false);
51 | holder = new ViewHolder(convertView);
52 | convertView.setTag(holder);
53 | }else{
54 | holder = (ViewHolder) convertView.getTag();
55 | }
56 | // 获取显示内容
57 | ChartItemBean bean = mDatas.get(position);
58 | holder.iv.setImageResource(bean.getsImageId());
59 | holder.typeTv.setText(bean.getType());
60 | float ratio = bean.getRatio();
61 | String pert = FloatUtils.ratioToPercent(ratio);
62 | holder.ratioTv.setText(pert);
63 |
64 | holder.totalTv.setText("¥ "+bean.getTotalMoney());
65 | return convertView;
66 | }
67 |
68 | class ViewHolder{
69 | TextView typeTv,ratioTv,totalTv;
70 | ImageView iv;
71 | public ViewHolder(View view){
72 | typeTv = view.findViewById(R.id.item_chartfrag_tv_type);
73 | ratioTv = view.findViewById(R.id.item_chartfrag_tv_pert);
74 | totalTv = view.findViewById(R.id.item_chartfrag_tv_sum);
75 | iv = view.findViewById(R.id.item_chartfrag_iv);
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_time.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
11 |
16 |
21 |
27 |
33 |
39 |
40 |
45 |
53 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/db/AccountBean.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.db;
2 | /** 描述记录一条数据的相关内容类*/
3 | public class AccountBean {
4 | int id;
5 | String typename; //类型
6 | int sImageId; //被选中类型图片
7 | String beizhu; //备注
8 | float money; //价格
9 | String time ; //保存时间字符串
10 | int year;
11 | int month;
12 | int day;
13 | int kind; //类型 收入---1 支出---0
14 |
15 | public int getId() {
16 | return id;
17 | }
18 |
19 | public void setId(int id) {
20 | this.id = id;
21 | }
22 |
23 | public String getTypename() {
24 | return typename;
25 | }
26 |
27 | public void setTypename(String typename) {
28 | this.typename = typename;
29 | }
30 |
31 | public int getsImageId() {
32 | return sImageId;
33 | }
34 |
35 | public void setsImageId(int sImageId) {
36 | this.sImageId = sImageId;
37 | }
38 |
39 | public String getBeizhu() {
40 | return beizhu;
41 | }
42 |
43 | public void setBeizhu(String beizhu) {
44 | this.beizhu = beizhu;
45 | }
46 |
47 | public float getMoney() {
48 | return money;
49 | }
50 |
51 | public void setMoney(float money) {
52 | this.money = money;
53 | }
54 |
55 | public String getTime() {
56 | return time;
57 | }
58 |
59 | public void setTime(String time) {
60 | this.time = time;
61 | }
62 |
63 | public int getYear() {
64 | return year;
65 | }
66 |
67 | public void setYear(int year) {
68 | this.year = year;
69 | }
70 |
71 | public int getMonth() {
72 | return month;
73 | }
74 |
75 | public void setMonth(int month) {
76 | this.month = month;
77 | }
78 |
79 | public int getDay() {
80 | return day;
81 | }
82 |
83 | public void setDay(int day) {
84 | this.day = day;
85 | }
86 |
87 | public int getKind() {
88 | return kind;
89 | }
90 |
91 | public void setKind(int kind) {
92 | this.kind = kind;
93 | }
94 |
95 | public AccountBean() {
96 | }
97 |
98 | public AccountBean(int id, String typename, int sImageId, String beizhu, float money, String time, int year, int month, int day, int kind) {
99 | this.id = id;
100 | this.typename = typename;
101 | this.sImageId = sImageId;
102 | this.beizhu = beizhu;
103 | this.money = money;
104 | this.time = time;
105 | this.year = year;
106 | this.month = month;
107 | this.day = day;
108 | this.kind = kind;
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/adapter/AccountAdapter.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import com.hui.tally.R;
12 | import com.hui.tally.db.AccountBean;
13 |
14 | import java.util.Calendar;
15 | import java.util.List;
16 |
17 | public class AccountAdapter extends BaseAdapter {
18 | Context context;
19 | ListmDatas;
20 | LayoutInflater inflater;
21 | int year,month,day;
22 | public AccountAdapter(Context context, List mDatas) {
23 | this.context = context;
24 | this.mDatas = mDatas;
25 | inflater = LayoutInflater.from(context);
26 | Calendar calendar = Calendar.getInstance();
27 | year = calendar.get(Calendar.YEAR);
28 | month = calendar.get(Calendar.MONTH)+1;
29 | day = calendar.get(Calendar.DAY_OF_MONTH);
30 | }
31 |
32 | @Override
33 | public int getCount() {
34 | return mDatas.size();
35 | }
36 |
37 | @Override
38 | public Object getItem(int position) {
39 | return mDatas.get(position);
40 | }
41 |
42 | @Override
43 | public long getItemId(int position) {
44 | return position;
45 | }
46 |
47 | @Override
48 | public View getView(int position, View convertView, ViewGroup parent) {
49 | ViewHolder holder = null;
50 | if (convertView == null) {
51 | convertView = inflater.inflate(R.layout.item_mainlv,parent,false);
52 | holder = new ViewHolder(convertView);
53 | convertView.setTag(holder);
54 | }else{
55 | holder = (ViewHolder) convertView.getTag();
56 | }
57 | AccountBean bean = mDatas.get(position);
58 | holder.typeIv.setImageResource(bean.getsImageId());
59 | holder.typeTv.setText(bean.getTypename());
60 | holder.beizhuTv.setText(bean.getBeizhu());
61 | holder.moneyTv.setText("¥ "+bean.getMoney());
62 | if (bean.getYear()==year&&bean.getMonth()==month&&bean.getDay()==day) {
63 | String time = bean.getTime().split(" ")[1];
64 | holder.timeTv.setText("今天 "+time);
65 | }else {
66 | holder.timeTv.setText(bean.getTime());
67 | }
68 | return convertView;
69 | }
70 |
71 | class ViewHolder{
72 | ImageView typeIv;
73 | TextView typeTv,beizhuTv,timeTv,moneyTv;
74 | public ViewHolder(View view){
75 | typeIv = view.findViewById(R.id.item_mainlv_iv);
76 | typeTv = view.findViewById(R.id.item_mainlv_tv_title);
77 | timeTv = view.findViewById(R.id.item_mainlv_tv_time);
78 | beizhuTv = view.findViewById(R.id.item_mainlv_tv_beizhu);
79 | moneyTv = view.findViewById(R.id.item_mainlv_tv_money);
80 |
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/utils/BeiZhuDialog.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.utils;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import android.os.Handler;
7 | import android.os.Message;
8 | import android.view.Display;
9 | import android.view.Gravity;
10 | import android.view.View;
11 | import android.view.Window;
12 | import android.view.WindowManager;
13 | import android.view.inputmethod.InputMethodManager;
14 | import android.widget.Button;
15 | import android.widget.EditText;
16 |
17 | import androidx.annotation.NonNull;
18 |
19 | import com.hui.tally.R;
20 |
21 | public class BeiZhuDialog extends Dialog implements View.OnClickListener {
22 | EditText et;
23 | Button cancelBtn,ensureBtn;
24 | OnEnsureListener onEnsureListener;
25 | // 设定回调接口的方法
26 | public void setOnEnsureListener(OnEnsureListener onEnsureListener) {
27 | this.onEnsureListener = onEnsureListener;
28 | }
29 |
30 | public BeiZhuDialog(@NonNull Context context) {
31 | super(context);
32 | }
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.dialog_beizhu);//设置对话框显示布局
38 | et = findViewById(R.id.dialog_beizhu_et);
39 | cancelBtn = findViewById(R.id.dialog_beizhu_btn_cancel);
40 | ensureBtn = findViewById(R.id.dialog_beizhu_btn_ensure);
41 | cancelBtn.setOnClickListener(this);
42 | ensureBtn.setOnClickListener(this);
43 | }
44 | public interface OnEnsureListener{
45 | public void onEnsure();
46 | }
47 |
48 | @Override
49 | public void onClick(View v) {
50 | switch (v.getId()) {
51 | case R.id.dialog_beizhu_btn_cancel:
52 | cancel();
53 | break;
54 | case R.id.dialog_beizhu_btn_ensure:
55 | if (onEnsureListener!=null) {
56 | onEnsureListener.onEnsure();
57 | }
58 | break;
59 | }
60 | }
61 |
62 | // 获取输入数据的方法
63 | public String getEditText(){
64 | return et.getText().toString().trim();
65 | }
66 | /* 设置Dialog的尺寸和屏幕尺寸一致*/
67 | public void setDialogSize(){
68 | // 获取当前窗口对象
69 | Window window = getWindow();
70 | // 获取窗口对象的参数
71 | WindowManager.LayoutParams wlp = window.getAttributes();
72 | // 获取屏幕宽度
73 | Display d = window.getWindowManager().getDefaultDisplay();
74 | wlp.width = (int)(d.getWidth()); //对话框窗口为屏幕窗口
75 | wlp.gravity = Gravity.BOTTOM;
76 | window.setBackgroundDrawableResource(android.R.color.transparent);
77 | window.setAttributes(wlp);
78 | handler.sendEmptyMessageDelayed(1,100);
79 | }
80 |
81 | Handler handler = new Handler(){
82 | @Override
83 | public void handleMessage(@NonNull Message msg) {
84 | //自动弹出软键盘的方法
85 | InputMethodManager inputMethodManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
86 | inputMethodManager.toggleSoftInput(0,InputMethodManager.HIDE_NOT_ALWAYS);
87 | }
88 | };
89 | }
90 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/utils/MoreDialog.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.utils;
2 | import android.app.Dialog;
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.Display;
7 | import android.view.Gravity;
8 | import android.view.View;
9 | import android.view.Window;
10 | import android.view.WindowManager;
11 | import android.widget.Button;
12 | import android.widget.ImageView;
13 | import androidx.annotation.NonNull;
14 | import com.hui.tally.AboutActivity;
15 | import com.hui.tally.HistoryActivity;
16 | import com.hui.tally.MonthChartActivity;
17 | import com.hui.tally.R;
18 | import com.hui.tally.SettingActivity;
19 |
20 | public class MoreDialog extends Dialog implements View.OnClickListener {
21 | Button aboutBtn,settingBtn,historyBtn,infoBtn;
22 | ImageView errorIv;
23 | public MoreDialog(@NonNull Context context) {
24 | super(context);
25 | }
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.dialog_more);
30 | aboutBtn = findViewById(R.id.dialog_more_btn_about);
31 | settingBtn = findViewById(R.id.dialog_more_btn_setting);
32 | historyBtn = findViewById(R.id.dialog_more_btn_record);
33 | infoBtn = findViewById(R.id.dialog_more_btn_info);
34 | errorIv = findViewById(R.id.dialog_more_iv);
35 |
36 | aboutBtn.setOnClickListener(this);
37 | settingBtn.setOnClickListener(this);
38 | historyBtn.setOnClickListener(this);
39 | infoBtn.setOnClickListener(this);
40 | errorIv.setOnClickListener(this);
41 | }
42 |
43 | @Override
44 | public void onClick(View v) {
45 | Intent intent = new Intent();
46 | switch (v.getId()) {
47 | case R.id.dialog_more_btn_about:
48 | intent.setClass(getContext(), AboutActivity.class);
49 | getContext().startActivity(intent);
50 | break;
51 | case R.id.dialog_more_btn_setting:
52 | intent.setClass(getContext(), SettingActivity.class);
53 | getContext().startActivity(intent);
54 | break;
55 | case R.id.dialog_more_btn_record:
56 | intent.setClass(getContext(), HistoryActivity.class);
57 | getContext().startActivity(intent);
58 | break;
59 | case R.id.dialog_more_btn_info:
60 | intent.setClass(getContext(), MonthChartActivity.class);
61 | getContext().startActivity(intent);
62 | break;
63 | case R.id.dialog_more_iv:
64 | break;
65 | }
66 | cancel();
67 | }
68 |
69 | /* 设置Dialog的尺寸和屏幕尺寸一致*/
70 | public void setDialogSize(){
71 | // 获取当前窗口对象
72 | Window window = getWindow();
73 | // 获取窗口对象的参数
74 | WindowManager.LayoutParams wlp = window.getAttributes();
75 | // 获取屏幕宽度
76 | Display d = window.getWindowManager().getDefaultDisplay();
77 | wlp.width = (int)(d.getWidth()); //对话框窗口为屏幕窗口
78 | wlp.gravity = Gravity.BOTTOM;
79 | window.setBackgroundDrawableResource(android.R.color.transparent);
80 | window.setAttributes(wlp);
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/db/DBOpenHelper.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.db;
2 |
3 | import android.content.Context;
4 | import android.database.sqlite.SQLiteDatabase;
5 | import android.database.sqlite.SQLiteOpenHelper;
6 |
7 | import androidx.annotation.Nullable;
8 |
9 | import com.hui.tally.R;
10 |
11 | public class DBOpenHelper extends SQLiteOpenHelper {
12 | public DBOpenHelper(@Nullable Context context) {
13 | super(context,"tally.db" , null, 1);
14 | }
15 |
16 | // 创建数据库的方法,只有项目第一次运行时,会被调用
17 | @Override
18 | public void onCreate(SQLiteDatabase db) {
19 | // 创建表示类型的表
20 | String sql = "create table typetb(id integer primary key autoincrement,typename varchar(10),imageId integer,sImageId integer,kind integer)";
21 | db.execSQL(sql);
22 | insertType(db);
23 | //创建记账表
24 | sql = "create table accounttb(id integer primary key autoincrement,typename varchar(10),sImageId integer,beizhu varchar(80),money float," +
25 | "time varchar(60),year integer,month integer,day integer,kind integer)";
26 | db.execSQL(sql);
27 | }
28 |
29 | private void insertType(SQLiteDatabase db) {
30 | // 向typetb表当中插入元素
31 | String sql = "insert into typetb (typename,imageId,sImageId,kind) values (?,?,?,?)";
32 | db.execSQL(sql,new Object[]{"其他", R.mipmap.ic_qita,R.mipmap.ic_qita_fs,0});
33 | db.execSQL(sql,new Object[]{"餐饮", R.mipmap.ic_canyin,R.mipmap.ic_canyin_fs,0});
34 | db.execSQL(sql,new Object[]{"交通", R.mipmap.ic_jiaotong,R.mipmap.ic_jiaotong_fs,0});
35 | db.execSQL(sql,new Object[]{"购物", R.mipmap.ic_gouwu,R.mipmap.ic_gouwu_fs,0});
36 | db.execSQL(sql,new Object[]{"服饰", R.mipmap.ic_fushi,R.mipmap.ic_fushi_fs,0});
37 | db.execSQL(sql,new Object[]{"日用品", R.mipmap.ic_riyongpin,R.mipmap.ic_riyongpin_fs,0});
38 | db.execSQL(sql,new Object[]{"娱乐", R.mipmap.ic_yule,R.mipmap.ic_yule_fs,0});
39 | db.execSQL(sql,new Object[]{"零食", R.mipmap.ic_lingshi,R.mipmap.ic_lingshi_fs,0});
40 | db.execSQL(sql,new Object[]{"烟酒茶", R.mipmap.ic_yanjiu,R.mipmap.ic_yanjiu_fs,0});
41 | db.execSQL(sql,new Object[]{"学习", R.mipmap.ic_xuexi,R.mipmap.ic_xuexi_fs,0});
42 | db.execSQL(sql,new Object[]{"医疗", R.mipmap.ic_yiliao,R.mipmap.ic_yiliao_fs,0});
43 | db.execSQL(sql,new Object[]{"住宅", R.mipmap.ic_zhufang,R.mipmap.ic_zhufang_fs,0});
44 | db.execSQL(sql,new Object[]{"水电煤", R.mipmap.ic_shuidianfei,R.mipmap.ic_shuidianfei_fs,0});
45 | db.execSQL(sql,new Object[]{"通讯", R.mipmap.ic_tongxun,R.mipmap.ic_tongxun_fs,0});
46 | db.execSQL(sql,new Object[]{"人情往来", R.mipmap.ic_renqingwanglai,R.mipmap.ic_renqingwanglai_fs,0});
47 |
48 | db.execSQL(sql,new Object[]{"其他", R.mipmap.in_qt,R.mipmap.in_qt_fs,1});
49 | db.execSQL(sql,new Object[]{"薪资", R.mipmap.in_xinzi,R.mipmap.in_xinzi_fs,1});
50 | db.execSQL(sql,new Object[]{"奖金", R.mipmap.in_jiangjin,R.mipmap.in_jiangjin_fs,1});
51 | db.execSQL(sql,new Object[]{"借入", R.mipmap.in_jieru,R.mipmap.in_jieru_fs,1});
52 | db.execSQL(sql,new Object[]{"收债", R.mipmap.in_shouzhai,R.mipmap.in_shouzhai_fs,1});
53 | db.execSQL(sql,new Object[]{"利息收入", R.mipmap.in_lixifuji,R.mipmap.in_lixifuji_fs,1});
54 | db.execSQL(sql,new Object[]{"投资回报", R.mipmap.in_touzi,R.mipmap.in_touzi_fs,1});
55 | db.execSQL(sql,new Object[]{"二手交易", R.mipmap.in_ershoushebei,R.mipmap.in_ershoushebei_fs,1});
56 | db.execSQL(sql,new Object[]{"意外所得", R.mipmap.in_yiwai,R.mipmap.in_yiwai_fs,1});
57 | }
58 |
59 | // 数据库版本在更新时发生改变,会调用此方法
60 | @Override
61 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
62 |
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/utils/KeyBoardUtils.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.utils;
2 |
3 | import android.inputmethodservice.Keyboard;
4 | import android.inputmethodservice.KeyboardView;
5 | import android.text.Editable;
6 | import android.text.InputType;
7 | import android.view.View;
8 | import android.widget.EditText;
9 |
10 | import com.hui.tally.R;
11 |
12 | public class KeyBoardUtils {
13 | private final Keyboard k1; //自定义键盘
14 | private KeyboardView keyboardView;
15 | private EditText editText;
16 |
17 | public interface OnEnsureListener{
18 | public void onEnsure();
19 | }
20 | OnEnsureListener onEnsureListener;
21 |
22 | public void setOnEnsureListener(OnEnsureListener onEnsureListener) {
23 | this.onEnsureListener = onEnsureListener;
24 | }
25 |
26 | public KeyBoardUtils(KeyboardView keyboardView, EditText editText) {
27 | this.keyboardView = keyboardView;
28 | this.editText = editText;
29 | this.editText.setInputType(InputType.TYPE_NULL); //取消弹出系统键盘
30 | k1 = new Keyboard(this.editText.getContext(), R.xml.key);
31 |
32 | this.keyboardView.setKeyboard(k1); //设置要显示键盘的样式
33 | this.keyboardView.setEnabled(true);
34 | this.keyboardView.setPreviewEnabled(false);
35 | this.keyboardView.setOnKeyboardActionListener(listener); //设置键盘按钮被点击了的监听
36 | }
37 |
38 | KeyboardView.OnKeyboardActionListener listener = new KeyboardView.OnKeyboardActionListener() {
39 | @Override
40 | public void onPress(int primaryCode) {
41 | }
42 | @Override
43 | public void onRelease(int primaryCode) {
44 | }
45 | @Override
46 | public void onKey(int primaryCode, int[] keyCodes) {
47 | Editable editable = editText.getText();
48 | int start = editText.getSelectionStart();
49 | switch (primaryCode) {
50 | case Keyboard.KEYCODE_DELETE: //点击了删除键
51 | if (editable!=null &&editable.length()>0) {
52 | if (start>0) {
53 | editable.delete(start-1,start);
54 | }
55 | }
56 | break;
57 | case Keyboard.KEYCODE_CANCEL: //点击了清零
58 | editable.clear();
59 | break;
60 | case Keyboard.KEYCODE_DONE: //点击了完成
61 | onEnsureListener.onEnsure(); //通过接口回调的方法,当点击确定时,可以调用这个方法
62 | break;
63 | default: //其他数字直接插入
64 | editable.insert(start,Character.toString((char)primaryCode));
65 | break;
66 | }
67 | }
68 | @Override
69 | public void onText(CharSequence text) {
70 | }
71 | @Override
72 | public void swipeLeft() {
73 | }
74 | @Override
75 | public void swipeRight() {
76 | }
77 | @Override
78 | public void swipeDown() {
79 | }
80 | @Override
81 | public void swipeUp() {
82 | }
83 | };
84 |
85 | // 显示键盘
86 | public void showKeyboard(){
87 | int visibility = keyboardView.getVisibility();
88 | if (visibility == View.INVISIBLE ||visibility==View.GONE) {
89 | keyboardView.setVisibility(View.VISIBLE);
90 | }
91 | }
92 |
93 | // 隐藏键盘
94 | public void hideKeyboard(){
95 | int visibility = keyboardView.getVisibility();
96 | if (visibility== View.VISIBLE||visibility==View.INVISIBLE) {
97 | keyboardView.setVisibility(View.GONE);
98 | }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_outcome.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
19 |
29 |
37 |
38 |
44 |
53 |
54 |
66 |
71 |
78 |
85 |
86 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/utils/BudgetDialog.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.utils;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import android.os.Handler;
7 | import android.os.Message;
8 | import android.text.TextUtils;
9 | import android.view.Display;
10 | import android.view.Gravity;
11 | import android.view.View;
12 | import android.view.Window;
13 | import android.view.WindowManager;
14 | import android.view.inputmethod.InputMethodManager;
15 | import android.widget.Button;
16 | import android.widget.EditText;
17 | import android.widget.ImageView;
18 | import android.widget.Toast;
19 |
20 | import androidx.annotation.NonNull;
21 |
22 | import com.hui.tally.R;
23 |
24 | public class BudgetDialog extends Dialog implements View.OnClickListener {
25 | ImageView cancelIv;
26 | Button ensureBtn;
27 | EditText moneyEt;
28 | public interface OnEnsureListener{
29 | public void onEnsure(float money);
30 | }
31 | OnEnsureListener onEnsureListener;
32 |
33 | public void setOnEnsureListener(OnEnsureListener onEnsureListener) {
34 | this.onEnsureListener = onEnsureListener;
35 | }
36 |
37 | public BudgetDialog(@NonNull Context context) {
38 | super(context);
39 | }
40 |
41 | @Override
42 | protected void onCreate(Bundle savedInstanceState) {
43 | super.onCreate(savedInstanceState);
44 | setContentView(R.layout.dialog_budget);
45 | cancelIv = findViewById(R.id.dialog_budget_iv_error);
46 | ensureBtn = findViewById(R.id.dialog_budget_btn_ensure);
47 | moneyEt = findViewById(R.id.dialog_budget_et);
48 | cancelIv.setOnClickListener(this);
49 | ensureBtn.setOnClickListener(this);
50 | }
51 |
52 | @Override
53 | public void onClick(View v) {
54 | switch (v.getId()) {
55 | case R.id.dialog_budget_iv_error:
56 | cancel(); //取消对话框
57 | break;
58 | case R.id.dialog_budget_btn_ensure:
59 | //获取输入数据数值
60 | String data = moneyEt.getText().toString();
61 | if (TextUtils.isEmpty(data)) {
62 | Toast.makeText(getContext(),"输入数据不能为空!",Toast.LENGTH_SHORT).show();
63 | return;
64 | }
65 | float money = Float.parseFloat(data);
66 | if (money<=0) {
67 | Toast.makeText(getContext(),"预算金额必须大于0",Toast.LENGTH_SHORT).show();
68 | return;
69 | }
70 | if (onEnsureListener!=null) {
71 | onEnsureListener.onEnsure(money);
72 | }
73 | cancel();
74 | break;
75 | }
76 | }
77 |
78 | /* 设置Dialog的尺寸和屏幕尺寸一致*/
79 | public void setDialogSize(){
80 | // 获取当前窗口对象
81 | Window window = getWindow();
82 | // 获取窗口对象的参数
83 | WindowManager.LayoutParams wlp = window.getAttributes();
84 | // 获取屏幕宽度
85 | Display d = window.getWindowManager().getDefaultDisplay();
86 | wlp.width = (int)(d.getWidth()); //对话框窗口为屏幕窗口
87 | wlp.gravity = Gravity.BOTTOM;
88 | window.setBackgroundDrawableResource(android.R.color.transparent);
89 | window.setAttributes(wlp);
90 | handler.sendEmptyMessageDelayed(1,100);
91 | }
92 |
93 | Handler handler = new Handler(){
94 | @Override
95 | public void handleMessage(@NonNull Message msg) {
96 | //自动弹出软键盘的方法
97 | InputMethodManager inputMethodManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
98 | inputMethodManager.toggleSoftInput(0,InputMethodManager.HIDE_NOT_ALWAYS);
99 | }
100 | };
101 | }
102 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_mainlv_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
16 |
27 |
34 |
40 |
49 |
58 |
65 |
76 |
77 |
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_month_chart.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
17 |
24 |
32 |
33 |
40 |
48 |
56 |
64 |
65 |
71 |
81 |
91 |
92 |
96 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/HistoryActivity.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.app.AlertDialog;
6 | import android.content.DialogInterface;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.AdapterView;
10 | import android.widget.ListView;
11 | import android.widget.TextView;
12 |
13 | import com.hui.tally.adapter.AccountAdapter;
14 | import com.hui.tally.db.AccountBean;
15 | import com.hui.tally.db.DBManager;
16 | import com.hui.tally.utils.CalendarDialog;
17 |
18 | import java.util.ArrayList;
19 | import java.util.Calendar;
20 | import java.util.List;
21 |
22 | public class HistoryActivity extends AppCompatActivity {
23 | ListView historyLv;
24 | TextView timeTv;
25 |
26 | ListmDatas;
27 | AccountAdapter adapter;
28 | int year,month;
29 | int dialogSelPos = -1;
30 | int dialogSelMonth = -1;
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.activity_history);
35 | historyLv = findViewById(R.id.history_lv);
36 | timeTv = findViewById(R.id.history_tv_time);
37 | mDatas = new ArrayList<>();
38 | // 设置适配器
39 | adapter = new AccountAdapter(this,mDatas);
40 | historyLv.setAdapter(adapter);
41 | initTime();
42 | timeTv.setText(year+"年"+month+"月");
43 | loadData(year,month);
44 | setLVClickListener();
45 | }
46 | /*设置ListView每一个item的长按事件*/
47 | private void setLVClickListener() {
48 | historyLv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
49 | @Override
50 | public boolean onItemLongClick(AdapterView> parent, View view, int position, long id) {
51 | AccountBean accountBean = mDatas.get(position);
52 | deleteItem(accountBean);
53 | return false;
54 | }
55 | });
56 | }
57 |
58 | private void deleteItem(final AccountBean accountBean) {
59 | final int delId = accountBean.getId();
60 | AlertDialog.Builder builder = new AlertDialog.Builder(this);
61 | builder.setTitle("提示信息").setMessage("您确定要删除这条记录么?")
62 | .setNegativeButton("取消",null)
63 | .setPositiveButton("确定", new DialogInterface.OnClickListener() {
64 | @Override
65 | public void onClick(DialogInterface dialog, int which) {
66 | DBManager.deleteItemFromAccounttbById(delId);
67 | mDatas.remove(accountBean); //实时刷新,从数据源删除
68 | adapter.notifyDataSetChanged();
69 | }
70 | });
71 | builder.create().show();
72 | }
73 |
74 | /* 获取指定年份月份收支情况的列表*/
75 | private void loadData(int year,int month) {
76 | List list = DBManager.getAccountListOneMonthFromAccounttb(year, month);
77 | mDatas.clear();
78 | mDatas.addAll(list);
79 | adapter.notifyDataSetChanged();
80 | }
81 |
82 | private void initTime() {
83 | Calendar calendar = Calendar.getInstance();
84 | year = calendar.get(Calendar.YEAR);
85 | month = calendar.get(Calendar.MONTH)+1;
86 | }
87 |
88 | public void onClick(View view) {
89 | switch (view.getId()) {
90 | case R.id.history_iv_back:
91 | finish();
92 | break;
93 | case R.id.history_iv_rili:
94 | CalendarDialog dialog = new CalendarDialog(this,dialogSelPos,dialogSelMonth);
95 | dialog.show();
96 | dialog.setDialogSize();
97 | dialog.setOnRefreshListener(new CalendarDialog.OnRefreshListener() {
98 | @Override
99 | public void onRefresh(int selPos, int year, int month) {
100 | timeTv.setText(year+"年"+month+"月");
101 | loadData(year,month);
102 | dialogSelPos = selPos;
103 | dialogSelMonth = month;
104 | }
105 | });
106 | break;
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/frag_chart/OutcomChartFragment.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.frag_chart;
2 |
3 |
4 | import android.graphics.Color;
5 | import android.os.Bundle;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import androidx.fragment.app.Fragment;
11 |
12 | import com.github.mikephil.charting.components.Legend;
13 | import com.github.mikephil.charting.components.YAxis;
14 | import com.github.mikephil.charting.data.BarData;
15 | import com.github.mikephil.charting.data.BarDataSet;
16 | import com.github.mikephil.charting.data.BarEntry;
17 | import com.github.mikephil.charting.data.Entry;
18 | import com.github.mikephil.charting.formatter.IValueFormatter;
19 | import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
20 | import com.github.mikephil.charting.utils.ViewPortHandler;
21 | import com.hui.tally.R;
22 | import com.hui.tally.db.BarChartItemBean;
23 | import com.hui.tally.db.DBManager;
24 |
25 | import java.util.ArrayList;
26 | import java.util.List;
27 |
28 | /**
29 | * A simple {@link Fragment} subclass.
30 | */
31 | public class OutcomChartFragment extends BaseChartFragment {
32 | int kind = 0;
33 | @Override
34 | public void onResume() {
35 | super.onResume();
36 | loadData(year,month,kind);
37 | }
38 |
39 |
40 | @Override
41 | protected void setAxisData(int year, int month) {
42 | List sets = new ArrayList<>();
43 | // 获取这个月每天的支出总金额,
44 | List list = DBManager.getSumMoneyOneDayInMonth(year, month, kind);
45 | if (list.size() == 0) {
46 | barChart.setVisibility(View.GONE);
47 | chartTv.setVisibility(View.VISIBLE);
48 | }else{
49 | barChart.setVisibility(View.VISIBLE);
50 | chartTv.setVisibility(View.GONE);
51 | // 设置有多少根柱子
52 | List barEntries1 = new ArrayList<>();
53 | for (int i = 0; i < 31; i++) {
54 | // 初始化每一根柱子,添加到柱状图当中
55 | BarEntry entry = new BarEntry(i, 0.0f);
56 | barEntries1.add(entry);
57 | }
58 | for (int i = 0; i < list.size(); i++) {
59 | BarChartItemBean itemBean = list.get(i);
60 | int day = itemBean.getDay(); //获取日期
61 | // 根据天数,获取x轴的位置
62 | int xIndex = day-1;
63 | BarEntry barEntry = barEntries1.get(xIndex);
64 | barEntry.setY(itemBean.getSummoney());
65 | }
66 | BarDataSet barDataSet1 = new BarDataSet(barEntries1, "");
67 | barDataSet1.setValueTextColor(Color.BLACK); // 值的颜色
68 | barDataSet1.setValueTextSize(8f); // 值的大小
69 | barDataSet1.setColor(Color.RED); // 柱子的颜色
70 |
71 | // 设置柱子上数据显示的格式
72 | barDataSet1.setValueFormatter(new IValueFormatter() {
73 | @Override
74 | public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
75 | // 此处的value默认保存一位小数
76 | if (value==0) {
77 | return "";
78 | }
79 | return value + "";
80 | }
81 | });
82 | sets.add(barDataSet1);
83 |
84 | BarData barData = new BarData(sets);
85 | barData.setBarWidth(0.2f); // 设置柱子的宽度
86 | barChart.setData(barData);
87 | }
88 | }
89 |
90 | @Override
91 | protected void setYAxis(int year, int month) {
92 | // 获取本月收入最高的一天为多少,将他设定为y轴的最大值
93 | float maxMoney = DBManager.getMaxMoneyOneDayInMonth(year, month, kind);
94 | float max = (float) Math.ceil(maxMoney); // 将最大金额向上取整
95 | // 设置y轴
96 | YAxis yAxis_right = barChart.getAxisRight();
97 | yAxis_right.setAxisMaximum(max); // 设置y轴的最大值
98 | yAxis_right.setAxisMinimum(0f); // 设置y轴的最小值
99 | yAxis_right.setEnabled(false); // 不显示右边的y轴
100 |
101 | YAxis yAxis_left = barChart.getAxisLeft();
102 | yAxis_left.setAxisMaximum(max);
103 | yAxis_left.setAxisMinimum(0f);
104 | yAxis_left.setEnabled(false);
105 |
106 | // 设置不显示图例
107 | Legend legend = barChart.getLegend();
108 | legend.setEnabled(false);
109 | }
110 |
111 | @Override
112 | public void setDate(int year, int month) {
113 | super.setDate(year, month);
114 | loadData(year,month,kind);
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/frag_chart/IncomChartFragment.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.frag_chart;
2 |
3 |
4 | import android.graphics.Color;
5 | import android.os.Bundle;
6 |
7 | import androidx.fragment.app.Fragment;
8 |
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.ListView;
13 |
14 | import com.github.mikephil.charting.components.Legend;
15 | import com.github.mikephil.charting.components.YAxis;
16 | import com.github.mikephil.charting.data.BarData;
17 | import com.github.mikephil.charting.data.BarDataSet;
18 | import com.github.mikephil.charting.data.BarEntry;
19 | import com.github.mikephil.charting.data.Entry;
20 | import com.github.mikephil.charting.formatter.IValueFormatter;
21 | import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
22 | import com.github.mikephil.charting.utils.ViewPortHandler;
23 | import com.hui.tally.R;
24 | import com.hui.tally.adapter.ChartItemAdapter;
25 | import com.hui.tally.db.BarChartItemBean;
26 | import com.hui.tally.db.ChartItemBean;
27 | import com.hui.tally.db.DBManager;
28 |
29 | import java.util.ArrayList;
30 | import java.util.List;
31 |
32 | /**
33 | * A simple {@link Fragment} subclass.
34 | */
35 | public class IncomChartFragment extends BaseChartFragment {
36 | int kind = 1;
37 | @Override
38 | public void onResume() {
39 | super.onResume();
40 | loadData(year,month,kind);
41 | }
42 |
43 | @Override
44 | protected void setAxisData(int year, int month) {
45 | List sets = new ArrayList<>();
46 | // 获取这个月每天的支出总金额,
47 | List list = DBManager.getSumMoneyOneDayInMonth(year, month, kind);
48 | if (list.size() == 0) {
49 | barChart.setVisibility(View.GONE);
50 | chartTv.setVisibility(View.VISIBLE);
51 | }else{
52 | barChart.setVisibility(View.VISIBLE);
53 | chartTv.setVisibility(View.GONE);
54 | // 设置有多少根柱子
55 | List barEntries1 = new ArrayList<>();
56 | for (int i = 0; i < 31; i++) {
57 | // 初始化每一根柱子,添加到柱状图当中
58 | BarEntry entry = new BarEntry(i, 0.0f);
59 | barEntries1.add(entry);
60 | }
61 | for (int i = 0; i < list.size(); i++) {
62 | BarChartItemBean itemBean = list.get(i);
63 | int day = itemBean.getDay(); //获取日期
64 | // 根据天数,获取x轴的位置
65 | int xIndex = day-1;
66 | BarEntry barEntry = barEntries1.get(xIndex);
67 | barEntry.setY(itemBean.getSummoney());
68 | }
69 | BarDataSet barDataSet1 = new BarDataSet(barEntries1, "");
70 | barDataSet1.setValueTextColor(Color.BLACK); // 值的颜色
71 | barDataSet1.setValueTextSize(8f); // 值的大小
72 | barDataSet1.setColor(Color.parseColor("#006400")); // 柱子的颜色
73 |
74 | // 设置柱子上数据显示的格式
75 | barDataSet1.setValueFormatter(new IValueFormatter() {
76 | @Override
77 | public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
78 | // 此处的value默认保存一位小数
79 | if (value==0) {
80 | return "";
81 | }
82 | return value + "";
83 | }
84 | });
85 | sets.add(barDataSet1);
86 |
87 | BarData barData = new BarData(sets);
88 | barData.setBarWidth(0.2f); // 设置柱子的宽度
89 | barChart.setData(barData);
90 | }
91 | }
92 |
93 | @Override
94 | protected void setYAxis(int year, int month) {
95 | // 获取本月收入最高的一天为多少,将他设定为y轴的最大值
96 | float maxMoney = DBManager.getMaxMoneyOneDayInMonth(year, month, kind);
97 | float max = (float) Math.ceil(maxMoney); // 将最大金额向上取整
98 | // 设置y轴
99 | YAxis yAxis_right = barChart.getAxisRight();
100 | yAxis_right.setAxisMaximum(max); // 设置y轴的最大值
101 | yAxis_right.setAxisMinimum(0f); // 设置y轴的最小值
102 | yAxis_right.setEnabled(false); // 不显示右边的y轴
103 |
104 | YAxis yAxis_left = barChart.getAxisLeft();
105 | yAxis_left.setAxisMaximum(max);
106 | yAxis_left.setAxisMinimum(0f);
107 | yAxis_left.setEnabled(false);
108 |
109 | // 设置不显示图例
110 | Legend legend = barChart.getLegend();
111 | legend.setEnabled(false);
112 | }
113 |
114 |
115 | @Override
116 | public void setDate(int year, int month) {
117 | super.setDate(year, month);
118 | loadData(year,month,kind);
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
17 |
24 |
25 |
30 |
34 |
41 |
46 |
53 |
58 |
63 |
70 |
75 |
82 |
87 |
94 |
99 |
106 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/frag_chart/BaseChartFragment.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.frag_chart;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ListView;
9 | import android.widget.TextView;
10 |
11 | import androidx.fragment.app.Fragment;
12 |
13 | import com.github.mikephil.charting.charts.BarChart;
14 | import com.github.mikephil.charting.components.AxisBase;
15 | import com.github.mikephil.charting.components.XAxis;
16 | import com.github.mikephil.charting.formatter.IAxisValueFormatter;
17 | import com.hui.tally.R;
18 | import com.hui.tally.adapter.ChartItemAdapter;
19 | import com.hui.tally.db.ChartItemBean;
20 | import com.hui.tally.db.DBManager;
21 |
22 | import java.util.ArrayList;
23 | import java.util.List;
24 |
25 | /**
26 | * A simple {@link Fragment} subclass.
27 | */
28 | abstract public class BaseChartFragment extends Fragment {
29 | ListView chartLv;
30 | int year;
31 | int month;
32 | ListmDatas; //数据源
33 | private ChartItemAdapter itemAdapter;
34 | BarChart barChart; //代表柱状图的控件
35 | TextView chartTv; //如果没有收支情况,显示的TextView
36 | @Override
37 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
38 | Bundle savedInstanceState) {
39 |
40 | View view = inflater.inflate(R.layout.fragment_incom_chart, container, false);
41 | chartLv = view.findViewById(R.id.frag_chart_lv);
42 | //获取Activity传递的数据
43 | Bundle bundle = getArguments();
44 | year = bundle.getInt("year");
45 | month = bundle.getInt("month");
46 | //设置数据源
47 | mDatas = new ArrayList<>();
48 | // 设置适配器
49 | itemAdapter = new ChartItemAdapter(getContext(), mDatas);
50 | chartLv.setAdapter(itemAdapter);
51 | // 添加头布局
52 | addLVHeaderView();
53 | return view;
54 | }
55 |
56 | protected void addLVHeaderView(){
57 | // 将布局转换成View对象
58 | View headerView = getLayoutInflater().inflate(R.layout.item_chartfrag_top,null);
59 | // 将View添加到ListView的头布局上
60 | chartLv.addHeaderView(headerView);
61 | // 查找头布局当中包含的控件
62 | barChart = headerView.findViewById(R.id.item_chartfrag_chart);
63 | chartTv = headerView.findViewById(R.id.item_chartfrag_top_tv);
64 | // 设定柱状图不显示描述
65 | barChart.getDescription().setEnabled(false);
66 | // 设置柱状图的内边距
67 | barChart.setExtraOffsets(20, 20, 20, 20);
68 | setAxis(year,month); // 设置坐标轴
69 | // 设置坐标轴显示的数据
70 | setAxisData(year,month);
71 | }
72 | /** 设置坐标轴显示的数据*/
73 | protected abstract void setAxisData(int year, int month);
74 |
75 | /** 设置柱状图坐标轴的显示 方法必须重新*/
76 | protected void setAxis(int year, final int month){
77 | // 设置X轴
78 | XAxis xAxis = barChart.getXAxis();
79 | xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); //设置x轴显示在下方
80 | xAxis.setDrawGridLines(true); //设置绘制该轴的网格线
81 | // 设置x轴标签的个数
82 | xAxis.setLabelCount(31);
83 | xAxis.setTextSize(12f); //x轴标签的大小
84 | // 设置X轴显示的值的格式
85 | xAxis.setValueFormatter(new IAxisValueFormatter() {
86 | @Override
87 | public String getFormattedValue(float value, AxisBase axis) {
88 | int val = (int) value;
89 | if (val == 0) {
90 | return month+"-1";
91 | }
92 | if (val==14) {
93 | return month+"-15";
94 | }
95 | // 根据不同的月份,显示最后一天的位置
96 | if (month==2) {
97 | if (val == 27) {
98 | return month+"-28";
99 | }
100 | }else if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
101 | if (val == 30) {
102 | return month+"-31";
103 | }
104 | }else if(month==4||month==6||month==9||month==11){
105 | if (val==29) {
106 | return month+"-30";
107 | }
108 | }
109 | return "";
110 | }
111 | });
112 | xAxis.setYOffset(10); // 设置标签对x轴的偏移量,垂直方向
113 |
114 | // y轴在子类的设置
115 | setYAxis(year,month);
116 | }
117 |
118 | /* 设置y轴,因为最高的坐标不确定,所以在子类当中设置*/
119 | protected abstract void setYAxis(int year,int month);
120 |
121 | public void setDate(int year,int month){
122 | this.year = year;
123 | this.month = month;
124 | // 清空柱状图当中的数据
125 | barChart.clear();
126 | barChart.invalidate(); //重新绘制柱状图
127 | setAxis(year,month);
128 | setAxisData(year,month);
129 | }
130 |
131 |
132 | public void loadData(int year,int month,int kind) {
133 | List list = DBManager.getChartListFromAccounttb(year, month, kind);
134 | mDatas.clear();
135 | mDatas.addAll(list);
136 | itemAdapter.notifyDataSetChanged();
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/utils/SelectTimeDialog.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.utils;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import android.text.TextUtils;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.Button;
10 | import android.widget.DatePicker;
11 | import android.widget.EditText;
12 |
13 | import androidx.annotation.NonNull;
14 |
15 | import com.hui.tally.R;
16 |
17 | /*
18 | * 在记录页面弹出时间对话框
19 | * */
20 | public class SelectTimeDialog extends Dialog implements View.OnClickListener {
21 | EditText hourEt,minuteEt;
22 | DatePicker datePicker;
23 | Button ensureBtn,cancelBtn;
24 | public interface OnEnsureListener{
25 | public void onEnsure(String time,int year,int month,int day);
26 | }
27 | OnEnsureListener onEnsureListener;
28 |
29 | public void setOnEnsureListener(OnEnsureListener onEnsureListener) {
30 | this.onEnsureListener = onEnsureListener;
31 | }
32 |
33 | public SelectTimeDialog(@NonNull Context context) {
34 | super(context);
35 | }
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.dialog_time);
41 | hourEt = findViewById(R.id.dialog_time_et_hour);
42 | minuteEt = findViewById(R.id.dialog_time_et_minute);
43 | datePicker = findViewById(R.id.dialog_time_dp);
44 | ensureBtn = findViewById(R.id.dialog_time_btn_ensure);
45 | cancelBtn = findViewById(R.id.dialog_time_btn_cancel);
46 | ensureBtn.setOnClickListener(this); //添加点击监听事件
47 | cancelBtn.setOnClickListener(this);
48 | hideDatePickerHeader();
49 | }
50 |
51 | @Override
52 | public void onClick(View v) {
53 | switch (v.getId()) {
54 | case R.id.dialog_time_btn_cancel:
55 | cancel();
56 | break;
57 | case R.id.dialog_time_btn_ensure:
58 | int year = datePicker.getYear(); //选择年份
59 | int month = datePicker.getMonth()+1;
60 | int dayOfMonth = datePicker.getDayOfMonth();
61 | String monthStr = String.valueOf(month);
62 | if (month<10){
63 | monthStr = "0"+month;
64 | }
65 | String dayStr = String.valueOf(dayOfMonth);
66 | if (dayOfMonth<10){
67 | dayStr="0"+dayOfMonth;
68 | }
69 | // 获取输入的小时和分钟
70 | String hourStr = hourEt.getText().toString();
71 | String minuteStr = minuteEt.getText().toString();
72 | int hour = 0;
73 | if (!TextUtils.isEmpty(hourStr)) {
74 | hour = Integer.parseInt(hourStr);
75 | hour=hour%24;
76 | }
77 | int minute = 0;
78 | if (!TextUtils.isEmpty(minuteStr)) {
79 | minute = Integer.parseInt(minuteStr);
80 | minute=minute%60;
81 | }
82 |
83 | hourStr=String.valueOf(hour);
84 | minuteStr=String.valueOf(minute);
85 | if (hour<10){
86 | hourStr="0"+hour;
87 | }
88 | if (minute<10){
89 | minuteStr="0"+minute;
90 | }
91 | String timeFormat = year+"年"+monthStr+"月"+dayStr+"日 "+hourStr+":"+minuteStr;
92 | if (onEnsureListener!=null) {
93 | onEnsureListener.onEnsure(timeFormat,year,month,dayOfMonth);
94 | }
95 | cancel();
96 | break;
97 | }
98 | }
99 |
100 | //隐藏DatePicker头布局
101 | private void hideDatePickerHeader(){
102 | ViewGroup rootView = (ViewGroup) datePicker.getChildAt(0);
103 | if (rootView == null) {
104 | return;
105 | }
106 | View headerView = rootView.getChildAt(0);
107 | if (headerView == null) {
108 | return;
109 | }
110 | //5.0+
111 | int headerId = getContext().getResources().getIdentifier("day_picker_selector_layout", "id", "android");
112 | if (headerId == headerView.getId()) {
113 | headerView.setVisibility(View.GONE);
114 | ViewGroup.LayoutParams layoutParamsRoot = rootView.getLayoutParams();
115 | layoutParamsRoot.width = ViewGroup.LayoutParams.WRAP_CONTENT;
116 | rootView.setLayoutParams(layoutParamsRoot);
117 |
118 | ViewGroup animator = (ViewGroup) rootView.getChildAt(1);
119 | ViewGroup.LayoutParams layoutParamsAnimator = animator.getLayoutParams();
120 | layoutParamsAnimator.width = ViewGroup.LayoutParams.WRAP_CONTENT;
121 | animator.setLayoutParams(layoutParamsAnimator);
122 |
123 | View child = animator.getChildAt(0);
124 | ViewGroup.LayoutParams layoutParamsChild = child.getLayoutParams();
125 | layoutParamsChild.width = ViewGroup.LayoutParams.WRAP_CONTENT;
126 | child.setLayoutParams(layoutParamsChild);
127 | return;
128 | }
129 |
130 | // 6.0+
131 | headerId = getContext().getResources().getIdentifier("date_picker_header","id","android");
132 | if (headerId == headerView.getId()) {
133 | headerView.setVisibility(View.GONE);
134 | }
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/MonthChartActivity.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.fragment.app.Fragment;
5 | import androidx.viewpager.widget.ViewPager;
6 |
7 | import android.graphics.Color;
8 | import android.os.Bundle;
9 | import android.view.View;
10 | import android.widget.Button;
11 | import android.widget.TextView;
12 |
13 | import com.hui.tally.adapter.ChartVPAdapter;
14 | import com.hui.tally.db.DBManager;
15 | import com.hui.tally.frag_chart.IncomChartFragment;
16 | import com.hui.tally.frag_chart.OutcomChartFragment;
17 | import com.hui.tally.utils.CalendarDialog;
18 |
19 | import java.util.ArrayList;
20 | import java.util.Calendar;
21 | import java.util.List;
22 |
23 | public class MonthChartActivity extends AppCompatActivity {
24 | Button inBtn,outBtn;
25 | TextView dateTv,inTv,outTv;
26 | ViewPager chartVp;
27 | int year;
28 | int month;
29 | int selectPos = -1,selectMonth =-1;
30 | ListchartFragList;
31 | private IncomChartFragment incomChartFragment;
32 | private OutcomChartFragment outcomChartFragment;
33 | private ChartVPAdapter chartVPAdapter;
34 |
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.activity_month_chart);
39 | initView();
40 | initTime();
41 | initStatistics(year,month);
42 | initFrag();
43 | setVPSelectListener();
44 | }
45 |
46 | private void setVPSelectListener() {
47 | chartVp.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
48 | @Override
49 | public void onPageSelected(int position) {
50 | setButtonStyle(position);
51 | }
52 | });
53 | }
54 |
55 | private void initFrag() {
56 | chartFragList = new ArrayList<>();
57 | // 添加Fragment的对象
58 | incomChartFragment = new IncomChartFragment();
59 | outcomChartFragment = new OutcomChartFragment();
60 | // 添加数据到Fragment当中
61 | Bundle bundle = new Bundle();
62 | bundle.putInt("year",year);
63 | bundle.putInt("month",month);
64 | incomChartFragment.setArguments(bundle);
65 | outcomChartFragment.setArguments(bundle);
66 | // 将Fragment添加到数据源当中
67 | chartFragList.add(outcomChartFragment);
68 | chartFragList.add(incomChartFragment);
69 | // 使用适配器
70 | chartVPAdapter = new ChartVPAdapter(getSupportFragmentManager(), chartFragList);
71 | chartVp.setAdapter(chartVPAdapter);
72 | // 将Fragment加载到Acitivy当中
73 | }
74 |
75 | /* 统计某年某月的收支情况数据*/
76 | private void initStatistics(int year, int month) {
77 | float inMoneyOneMonth = DBManager.getSumMoneyOneMonth(year, month, 1); //收入总钱数
78 | float outMoneyOneMonth = DBManager.getSumMoneyOneMonth(year, month, 0); //支出总钱数
79 | int incountItemOneMonth = DBManager.getCountItemOneMonth(year, month, 1); //收入多少笔
80 | int outcountItemOneMonth = DBManager.getCountItemOneMonth(year, month, 0); //支出多少笔
81 | dateTv.setText(year+"年"+month+"月账单");
82 | inTv.setText("共"+incountItemOneMonth+"笔收入, ¥ "+inMoneyOneMonth);
83 | outTv.setText("共"+outcountItemOneMonth+"笔支出, ¥ "+outMoneyOneMonth);
84 |
85 | }
86 |
87 | /** 初始化时间的方法*/
88 | private void initTime() {
89 | Calendar calendar = Calendar.getInstance();
90 | year = calendar.get(Calendar.YEAR);
91 | month = calendar.get(Calendar.MONTH)+1;
92 | }
93 |
94 | /** 初始化控件*/
95 | private void initView() {
96 | inBtn = findViewById(R.id.chart_btn_in);
97 | outBtn = findViewById(R.id.chart_btn_out);
98 | dateTv = findViewById(R.id.chart_tv_date);
99 | inTv = findViewById(R.id.chart_tv_in);
100 | outTv = findViewById(R.id.chart_tv_out);
101 | chartVp = findViewById(R.id.chart_vp);
102 | }
103 |
104 | public void onClick(View view) {
105 | switch (view.getId()) {
106 | case R.id.chart_iv_back:
107 | finish();
108 | break;
109 | case R.id.chart_iv_rili:
110 | showCalendarDialog();
111 | break;
112 | case R.id.chart_btn_in:
113 | setButtonStyle(1);
114 | chartVp.setCurrentItem(1);
115 | break;
116 | case R.id.chart_btn_out:
117 | setButtonStyle(0);
118 | chartVp.setCurrentItem(0);
119 | break;
120 | }
121 | }
122 | /* 显示日历对话框*/
123 | private void showCalendarDialog() {
124 | CalendarDialog dialog = new CalendarDialog(this, selectPos, selectMonth);
125 | dialog.show();
126 | dialog.setDialogSize();
127 | dialog.setOnRefreshListener(new CalendarDialog.OnRefreshListener() {
128 | @Override
129 | public void onRefresh(int selPos, int year, int month) {
130 | MonthChartActivity.this.selectPos = selPos;
131 | MonthChartActivity.this.selectMonth = month;
132 | initStatistics(year,month);
133 | incomChartFragment.setDate(year,month);
134 | outcomChartFragment.setDate(year,month);
135 | }
136 | });
137 | }
138 |
139 | /* 设置按钮样式的改变 支出-0 收入-1*/
140 | private void setButtonStyle(int kind){
141 | if (kind == 0) {
142 | outBtn.setBackgroundResource(R.drawable.main_recordbtn_bg);
143 | outBtn.setTextColor(Color.WHITE);
144 | inBtn.setBackgroundResource(R.drawable.dialog_btn_bg);
145 | inBtn.setTextColor(Color.BLACK);
146 | }else if (kind == 1){
147 | inBtn.setBackgroundResource(R.drawable.main_recordbtn_bg);
148 | inBtn.setTextColor(Color.WHITE);
149 | outBtn.setBackgroundResource(R.drawable.dialog_btn_bg);
150 | outBtn.setTextColor(Color.BLACK);
151 | }
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
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 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/utils/CalendarDialog.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.utils;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.graphics.Color;
6 | import android.os.Bundle;
7 | import android.view.Display;
8 | import android.view.Gravity;
9 | import android.view.View;
10 | import android.view.Window;
11 | import android.view.WindowManager;
12 | import android.widget.AdapterView;
13 | import android.widget.GridView;
14 | import android.widget.ImageView;
15 | import android.widget.LinearLayout;
16 | import android.widget.TextView;
17 |
18 | import com.hui.tally.R;
19 | import com.hui.tally.adapter.CalendarAdapter;
20 | import com.hui.tally.db.DBManager;
21 |
22 | import androidx.annotation.NonNull;
23 |
24 | import java.util.ArrayList;
25 | import java.util.Calendar;
26 | import java.util.List;
27 |
28 | public class CalendarDialog extends Dialog implements View.OnClickListener {
29 | ImageView errorIv;
30 | GridView gv;
31 | LinearLayout hsvLayout;
32 |
33 | ListhsvViewList;
34 | ListyearList;
35 |
36 | int selectPos = -1; //表示正在被点击的年份的位置
37 | private CalendarAdapter adapter;
38 | int selectMonth = -1;
39 |
40 | public interface OnRefreshListener{
41 | public void onRefresh(int selPos,int year,int month);
42 | }
43 | OnRefreshListener onRefreshListener;
44 |
45 | public void setOnRefreshListener(OnRefreshListener onRefreshListener) {
46 | this.onRefreshListener = onRefreshListener;
47 | }
48 |
49 | public CalendarDialog(@NonNull Context context,int selectPos,int selectMonth) {
50 | super(context);
51 | this.selectPos = selectPos;
52 | this.selectMonth = selectMonth;
53 | }
54 |
55 | @Override
56 | protected void onCreate(Bundle savedInstanceState) {
57 | super.onCreate(savedInstanceState);
58 | setContentView(R.layout.dialog_calendar);
59 | gv = findViewById(R.id.dialog_calendar_gv);
60 | errorIv = findViewById(R.id.dialog_calendar_iv);
61 | hsvLayout = findViewById(R.id.dialog_calendar_layout);
62 | errorIv.setOnClickListener(this);
63 | // 向横向的ScrollView当中添加View的方法
64 | addViewToLayout();
65 | initGridView();
66 | //设置GridView当中每一个item的点击事件
67 | setGVListener();
68 | }
69 |
70 | private void setGVListener() {
71 | gv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
72 | @Override
73 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
74 | adapter.selPos = position;
75 | adapter.notifyDataSetInvalidated();
76 | int month = position + 1;
77 | int year = adapter.year;
78 | // 获取到被选中的年份和月份
79 | onRefreshListener.onRefresh(selectPos,year,month);
80 | cancel();
81 | }
82 | });
83 | }
84 |
85 | private void initGridView() {
86 | int selYear = yearList.get(selectPos);
87 | adapter = new CalendarAdapter(getContext(), selYear);
88 | if (selectMonth == -1) {
89 | int month = Calendar.getInstance().get(Calendar.MONTH);
90 | adapter.selPos = month;
91 | }else {
92 | adapter.selPos = selectMonth-1;
93 | }
94 | gv.setAdapter(adapter);
95 | }
96 |
97 | private void addViewToLayout() {
98 | hsvViewList = new ArrayList<>(); //将添加进入线性布局当中的TextView进行统一管理的集合
99 | yearList = DBManager.getYearListFromAccounttb(); //获取数据库当中存储了多少个年份
100 | //如果数据库当中没有记录,就添加今年的记录
101 | if (yearList.size() == 0) {
102 | int year = Calendar.getInstance().get(Calendar.YEAR);
103 | yearList.add(year);
104 | }
105 |
106 | //遍历年份,有几年,就向ScrollView当中添加几个view
107 | for (int i = 0; i < yearList.size(); i++) {
108 | int year = yearList.get(i);
109 | View view = getLayoutInflater().inflate(R.layout.item_dialogcal_hsv, null);
110 | hsvLayout.addView(view); //将view添加到布局当中
111 | TextView hsvTv = view.findViewById(R.id.item_dialogcal_hsv_tv);
112 | hsvTv.setText(year+"");
113 | hsvViewList.add(hsvTv);
114 | }
115 | if (selectPos == -1) {
116 | selectPos = hsvViewList.size()-1; //设置当前被选中的是最近的年份
117 | }
118 | changeTvbg(selectPos); //将最后一个设置为选中状态
119 | setHSVClickListener(); //设置每一个View的监听事件
120 | }
121 | /** 给横向的ScrollView当中每一个TextView设置点击事件*/
122 | private void setHSVClickListener() {
123 | for (int i = 0; i < hsvViewList.size(); i++) {
124 | TextView view = hsvViewList.get(i);
125 | final int pos = i;
126 | view.setOnClickListener(new View.OnClickListener() {
127 | @Override
128 | public void onClick(View v) {
129 | changeTvbg(pos);
130 | selectPos = pos;
131 | // 获取被选中的年份,然后下面的GridView显示数据源会发生变化
132 | int year = yearList.get(selectPos);
133 | adapter.setYear(year);
134 | }
135 | });
136 | }
137 | }
138 |
139 | /** 传入被选中的位置,改变此位置上的背景和文字颜色*/
140 | private void changeTvbg(int selectPos) {
141 | for (int i = 0; i < hsvViewList.size(); i++) {
142 | TextView tv = hsvViewList.get(i);
143 | tv.setBackgroundResource(R.drawable.dialog_btn_bg);
144 | tv.setTextColor(Color.BLACK);
145 | }
146 |
147 | TextView selView = hsvViewList.get(selectPos);
148 | selView.setBackgroundResource(R.drawable.main_recordbtn_bg);
149 | selView.setTextColor(Color.WHITE);
150 | }
151 |
152 | @Override
153 | public void onClick(View v) {
154 | switch (v.getId()) {
155 | case R.id.dialog_calendar_iv:
156 | cancel();
157 | break;
158 | }
159 | }
160 |
161 | /* 设置Dialog的尺寸和屏幕尺寸一致*/
162 | public void setDialogSize(){
163 | // 获取当前窗口对象
164 | Window window = getWindow();
165 | // 获取窗口对象的参数
166 | WindowManager.LayoutParams wlp = window.getAttributes();
167 | // 获取屏幕宽度
168 | Display d = window.getWindowManager().getDefaultDisplay();
169 | wlp.width = (int)(d.getWidth()); //对话框窗口为屏幕窗口
170 | wlp.gravity = Gravity.TOP;
171 | window.setBackgroundDrawableResource(android.R.color.transparent);
172 | window.setAttributes(wlp);
173 | }
174 | }
175 |
--------------------------------------------------------------------------------
/app/src/main/java/com/hui/tally/frag_record/BaseRecordFragment.java:
--------------------------------------------------------------------------------
1 | package com.hui.tally.frag_record;
2 | import android.inputmethodservice.KeyboardView;
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.fragment.app.Fragment;
7 |
8 | import android.text.TextUtils;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.AdapterView;
13 | import android.widget.EditText;
14 | import android.widget.GridView;
15 | import android.widget.ImageView;
16 | import android.widget.TextView;
17 |
18 | import com.hui.tally.R;
19 | import com.hui.tally.db.AccountBean;
20 | import com.hui.tally.db.DBManager;
21 | import com.hui.tally.db.TypeBean;
22 | import com.hui.tally.utils.BeiZhuDialog;
23 | import com.hui.tally.utils.KeyBoardUtils;
24 | import com.hui.tally.utils.SelectTimeDialog;
25 |
26 | import java.text.SimpleDateFormat;
27 | import java.util.ArrayList;
28 | import java.util.Calendar;
29 | import java.util.Date;
30 | import java.util.List;
31 |
32 | /**
33 | * 记录页面当中的支出模块
34 | */
35 | public abstract class BaseRecordFragment extends Fragment implements View.OnClickListener {
36 |
37 | KeyboardView keyboardView;
38 | EditText moneyEt;
39 | ImageView typeIv;
40 | TextView typeTv,beizhuTv,timeTv;
41 | GridView typeGv;
42 | ListtypeList;
43 | TypeBaseAdapter adapter;
44 | AccountBean accountBean; //将需要插入到记账本当中的数据保存成对象的形式
45 |
46 | @Override
47 | public void onCreate(@Nullable Bundle savedInstanceState) {
48 | super.onCreate(savedInstanceState);
49 | accountBean = new AccountBean(); //创建对象
50 | accountBean.setTypename("其他");
51 | accountBean.setsImageId(R.mipmap.ic_qita_fs);
52 | }
53 |
54 | @Override
55 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
56 | Bundle savedInstanceState) {
57 | // Inflate the layout for this fragment
58 | View view = inflater.inflate(R.layout.fragment_outcome, container, false);
59 | initView(view);
60 | setInitTime();
61 | //给GridView填充数据的方法
62 | loadDataToGV();
63 | setGVListener(); //设置GridView每一项的点击事件
64 | return view;
65 | }
66 | /* 获取当前时间,显示在timeTv上*/
67 | private void setInitTime() {
68 | Date date = new Date();
69 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
70 | String time = sdf.format(date);
71 | timeTv.setText(time);
72 | accountBean.setTime(time);
73 |
74 | Calendar calendar = Calendar.getInstance();
75 | int year = calendar.get(Calendar.YEAR);
76 | int month = calendar.get(Calendar.MONTH)+1;
77 | int day = calendar.get(Calendar.DAY_OF_MONTH);
78 | accountBean.setYear(year);
79 | accountBean.setMonth(month);
80 | accountBean.setDay(day);
81 | }
82 |
83 | /* 设置GridView每一项的点击事件*/
84 | private void setGVListener() {
85 | typeGv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
86 | @Override
87 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
88 | adapter.selectPos = position;
89 | adapter.notifyDataSetInvalidated(); //提示绘制发生变化了
90 | TypeBean typeBean = typeList.get(position);
91 | String typename = typeBean.getTypename();
92 | typeTv.setText(typename);
93 | accountBean.setTypename(typename);
94 | int simageId = typeBean.getSimageId();
95 | typeIv.setImageResource(simageId);
96 | accountBean.setsImageId(simageId);
97 | }
98 | });
99 | }
100 |
101 | /* 给GridView填出数据的方法*/
102 | public void loadDataToGV() {
103 | typeList = new ArrayList<>();
104 | adapter = new TypeBaseAdapter(getContext(), typeList);
105 | typeGv.setAdapter(adapter);
106 | }
107 |
108 | private void initView(View view) {
109 | keyboardView = view.findViewById(R.id.frag_record_keyboard);
110 | moneyEt = view.findViewById(R.id.frag_record_et_money);
111 | typeIv = view.findViewById(R.id.frag_record_iv);
112 | typeGv = view.findViewById(R.id.frag_record_gv);
113 | typeTv = view.findViewById(R.id.frag_record_tv_type);
114 | beizhuTv = view.findViewById(R.id.frag_record_tv_beizhu);
115 | timeTv = view.findViewById(R.id.frag_record_tv_time);
116 | beizhuTv.setOnClickListener(this);
117 | timeTv.setOnClickListener(this);
118 | //让自定义软键盘显示出来
119 | KeyBoardUtils boardUtils = new KeyBoardUtils(keyboardView, moneyEt);
120 | boardUtils.showKeyboard();
121 | //设置接口,监听确定按钮按钮被点击了
122 | boardUtils.setOnEnsureListener(new KeyBoardUtils.OnEnsureListener() {
123 | @Override
124 | public void onEnsure() {
125 | //获取输入钱数
126 | String moneyStr = moneyEt.getText().toString();
127 | if (TextUtils.isEmpty(moneyStr)||moneyStr.equals("0")) {
128 | getActivity().finish();
129 | return;
130 | }
131 | float money = Float.parseFloat(moneyStr);
132 | accountBean.setMoney(money);
133 | //获取记录的信息,保存在数据库当中
134 | saveAccountToDB();
135 | // 返回上一级页面
136 | getActivity().finish();
137 | }
138 | });
139 | }
140 | /* 让子类一定要重写这个方法*/
141 | public abstract void saveAccountToDB();
142 |
143 | @Override
144 | public void onClick(View v) {
145 | switch (v.getId()) {
146 | case R.id.frag_record_tv_time:
147 | showTimeDialog();
148 | break;
149 | case R.id.frag_record_tv_beizhu:
150 | showBZDialog();
151 | break;
152 | }
153 | }
154 | /* 弹出显示时间的对话框*/
155 | private void showTimeDialog() {
156 | SelectTimeDialog dialog = new SelectTimeDialog(getContext());
157 | dialog.show();
158 | //设定确定按钮被点击了的监听器
159 | dialog.setOnEnsureListener(new SelectTimeDialog.OnEnsureListener() {
160 | @Override
161 | public void onEnsure(String time, int year, int month, int day) {
162 | timeTv.setText(time);
163 | accountBean.setTime(time);
164 | accountBean.setYear(year);
165 | accountBean.setMonth(month);
166 | accountBean.setDay(day);
167 | }
168 | });
169 | }
170 |
171 | /* 弹出备注对话框*/
172 | public void showBZDialog(){
173 | final BeiZhuDialog dialog = new BeiZhuDialog(getContext());
174 | dialog.show();
175 | dialog.setDialogSize();
176 | dialog.setOnEnsureListener(new BeiZhuDialog.OnEnsureListener() {
177 | @Override
178 | public void onEnsure() {
179 | String msg = dialog.getEditText();
180 | if (!TextUtils.isEmpty(msg)) {
181 | beizhuTv.setText(msg);
182 | accountBean.setBeizhu(msg);
183 | }
184 | dialog.cancel();
185 | }
186 | });
187 | }
188 | }
189 |
--------------------------------------------------------------------------------