├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_back.png │ │ │ │ ├── arrow_right.png │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── type_canyin.png │ │ │ │ ├── type_haizi.png │ │ │ │ ├── type_jiaxi.png │ │ │ │ ├── type_jujia.png │ │ │ │ ├── type_lijin.png │ │ │ │ ├── type_liwu.png │ │ │ │ ├── type_lixi.png │ │ │ │ ├── type_lvxing.png │ │ │ │ ├── type_qita.png │ │ │ │ ├── type_shuma.png │ │ │ │ ├── type_weixiu.png │ │ │ │ ├── type_xuexi.png │ │ │ │ ├── type_yiliao.png │ │ │ │ ├── type_yule.png │ │ │ │ ├── type_bangong.png │ │ │ │ ├── type_chongwu.png │ │ │ │ ├── type_fanxian.png │ │ │ │ ├── type_fuzhuang.png │ │ │ │ ├── type_jianzhi.png │ │ │ │ ├── type_jiaotong.png │ │ │ │ ├── type_juanzeng.png │ │ │ │ ├── type_lingshi.png │ │ │ │ ├── type_meirong.png │ │ │ │ ├── type_shuiguo.png │ │ │ │ ├── type_tongxun.png │ │ │ │ ├── type_yundong.png │ │ │ │ ├── type_zaxiang.png │ │ │ │ ├── type_zhangbei.png │ │ │ │ ├── type_zhufang.png │ │ │ │ ├── ic_tb_calc_del.png │ │ │ │ ├── tabbar_icon1_0.png │ │ │ │ ├── tabbar_icon1_1.png │ │ │ │ ├── tabbar_icon2_0.png │ │ │ │ ├── tabbar_icon2_1.png │ │ │ │ ├── tabbar_icon3_0.png │ │ │ │ ├── tabbar_icon3_1.png │ │ │ │ ├── tabbar_icon4_0.png │ │ │ │ ├── tabbar_icon4_1.png │ │ │ │ ├── tally_pie_center.png │ │ │ │ ├── tallybook_down.png │ │ │ │ ├── tallybook_input.png │ │ │ │ ├── tallybook_note.png │ │ │ │ ├── tallybook_other.png │ │ │ │ ├── tallybook_output.png │ │ │ │ ├── type_ewaishouyi.png │ │ │ │ ├── type_shouxufei.png │ │ │ │ ├── type_tianjiade.png │ │ │ │ ├── type_weiyuejin.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ ├── ic_tb_note_delete.png │ │ │ │ ├── ic_tb_note_remark.png │ │ │ │ ├── tallybook_manager.png │ │ │ │ ├── type_zijinbuchang.png │ │ │ │ ├── type_changhuanfeiyong.png │ │ │ │ ├── type_jiushuiyinliao.png │ │ │ │ ├── type_yongjinjiangli.png │ │ │ │ └── type_shangchengxiaofei.png │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── icon_banner_point1.png │ │ │ │ └── icon_banner_point2.png │ │ │ ├── values │ │ │ │ ├── ids.xml │ │ │ │ ├── attrs.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── drawable │ │ │ │ ├── shape_tb_calc.xml │ │ │ │ ├── tabbar_text_color.xml │ │ │ │ ├── shape_tb_cash.xml │ │ │ │ ├── tb_text_selector.xml │ │ │ │ ├── rb_main_first_selector.xml │ │ │ │ ├── rb_main_second_selector.xml │ │ │ │ ├── rb_main_third_selector.xml │ │ │ │ ├── rb_main_four_selector.xml │ │ │ │ ├── bg_click.xml │ │ │ │ ├── bg_radius_click.xml │ │ │ │ ├── tb_income_selector.xml │ │ │ │ └── tb_outcome_selector.xml │ │ │ ├── anim │ │ │ │ ├── slide_in_left.xml │ │ │ │ ├── slide_out_right.xml │ │ │ │ ├── slide_in_right.xml │ │ │ │ └── slide_out_left.xml │ │ │ └── layout │ │ │ │ ├── pager_item_tb_type.xml │ │ │ │ ├── item_tb_type.xml │ │ │ │ ├── fragment_menu_my.xml │ │ │ │ ├── item_recycler_header.xml │ │ │ │ ├── fragment_menu_first.xml │ │ │ │ ├── item_tallytype_rank.xml │ │ │ │ ├── item_tally_account.xml │ │ │ │ ├── item_recycler_item.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── top_date.xml │ │ │ │ ├── fragment_menu_type.xml │ │ │ │ └── activity_tallybook_note.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── cocoon │ │ │ │ └── jay │ │ │ │ └── tallybook │ │ │ │ ├── MyApplication.java │ │ │ │ ├── bean │ │ │ │ ├── BaseBean.java │ │ │ │ ├── TallyTypeBean.java │ │ │ │ ├── TallyAccountBean.java │ │ │ │ ├── TallyNoteBean.java │ │ │ │ └── TallyDetailBean.java │ │ │ │ ├── adapter │ │ │ │ ├── MyPagerAdapter.java │ │ │ │ ├── TallyTypeRankAdapter.java │ │ │ │ ├── TallyAccountAdapter.java │ │ │ │ ├── TallyBookNoteAdapter.java │ │ │ │ └── TallyDetailAdapter.java │ │ │ │ ├── activity │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── TallyBookNoteActivity.java │ │ │ │ ├── utils │ │ │ │ ├── ActivityManagerUtil.java │ │ │ │ ├── FormatUtils.java │ │ │ │ └── PieChartUtil.java │ │ │ │ ├── fragment │ │ │ │ ├── BaseFragment.java │ │ │ │ ├── MenuMyFragment.java │ │ │ │ ├── MenuFirstFragment.java │ │ │ │ └── MenuTypeFragment.java │ │ │ │ └── view │ │ │ │ ├── BaseBottomBar.java │ │ │ │ └── CircleImageView.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── cocoon │ │ │ └── jay │ │ │ └── tallybook │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── cocoon │ │ └── jay │ │ └── tallybook │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gif ├── GIF1.gif ├── GIF2.gif └── GIF3.gif ├── .idea ├── copyright │ └── profiles_settings.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /gif/GIF1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/gif/GIF1.gif -------------------------------------------------------------------------------- /gif/GIF2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/gif/GIF2.gif -------------------------------------------------------------------------------- /gif/GIF3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/gif/GIF3.gif -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/ic_back.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/arrow_right.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_canyin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_canyin.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_haizi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_haizi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_jiaxi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_jiaxi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_jujia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_jujia.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_lijin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_lijin.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_liwu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_liwu.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_lixi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_lixi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_lvxing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_lvxing.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_qita.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_qita.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_shuma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_shuma.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_weixiu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_weixiu.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_xuexi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_xuexi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_yiliao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_yiliao.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_yule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_yule.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_bangong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_bangong.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_chongwu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_chongwu.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_fanxian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_fanxian.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_fuzhuang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_fuzhuang.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_jianzhi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_jianzhi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_jiaotong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_jiaotong.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_juanzeng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_juanzeng.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_lingshi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_lingshi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_meirong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_meirong.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_shuiguo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_shuiguo.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_tongxun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_tongxun.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_yundong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_yundong.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_zaxiang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_zaxiang.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_zhangbei.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_zhangbei.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_zhufang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_zhufang.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/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/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_tb_calc_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/ic_tb_calc_del.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon1_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon1_0.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon1_1.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon2_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon2_0.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon2_1.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon3_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon3_0.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon3_1.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon4_0.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tabbar_icon4_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tabbar_icon4_1.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tally_pie_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tally_pie_center.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tallybook_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tallybook_down.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tallybook_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tallybook_input.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tallybook_note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tallybook_note.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tallybook_other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tallybook_other.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tallybook_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tallybook_output.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_ewaishouyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_ewaishouyi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_shouxufei.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_shouxufei.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_tianjiade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_tianjiade.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_weiyuejin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_weiyuejin.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_tb_note_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/ic_tb_note_delete.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_tb_note_remark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/ic_tb_note_remark.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/tallybook_manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/tallybook_manager.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_zijinbuchang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_zijinbuchang.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_banner_point1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/drawable-xhdpi/icon_banner_point1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_banner_point2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/drawable-xhdpi/icon_banner_point2.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_changhuanfeiyong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_changhuanfeiyong.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_jiushuiyinliao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_jiushuiyinliao.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_yongjinjiangli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_yongjinjiangli.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/type_shangchengxiaofei.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjjj/TallyBook/HEAD/app/src/main/res/mipmap-xhdpi/type_shangchengxiaofei.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_tb_calc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tabbar_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_tb_cash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 10 15:17:20 GMT+08:00 2017 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-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tb_text_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TallyBook 2 | 仿支付宝记账本功能,饼状图;数字键盘;轻量级recycleview头部悬浮侧滑删除等; 3 | 4 | ![image](https://raw.githubusercontent.com/wangjjj/TallyBook/master/gif/GIF1.gif) 5 | ![image](https://raw.githubusercontent.com/wangjjj/TallyBook/master/gif/GIF2.gif) 6 | ![image](https://raw.githubusercontent.com/wangjjj/TallyBook/master/gif/GIF2.gif) 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_main_first_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_main_second_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_main_third_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_main_four_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/test/java/com/cocoon/jay/tallybook/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook; 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() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/pager_item_tb_type.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | /** 7 | * Created by Administrator on 2017/10/23 0023. 8 | */ 9 | 10 | public class MyApplication extends Application { 11 | 12 | public static MyApplication application; 13 | private static Context context; 14 | 15 | @Override 16 | public void onCreate() { 17 | super.onCreate(); 18 | application = this; 19 | context = getApplicationContext(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_click.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_tb_type.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 18 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/bean/BaseBean.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by Administrator on 2017/10/16 0016. 7 | */ 8 | 9 | public class BaseBean implements Serializable { 10 | 11 | 12 | private static final long serialVersionUID = 1L; 13 | /** 14 | * status : 1 15 | * message : 成功! 16 | */ 17 | 18 | private int status; 19 | private String message; 20 | 21 | public int getStatus() { 22 | return status; 23 | } 24 | 25 | public void setStatus(int status) { 26 | this.status = status; 27 | } 28 | 29 | public String getMessage() { 30 | return message; 31 | } 32 | 33 | public void setMessage(String message) { 34 | this.message = message; 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_radius_click.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | #FF5050 8 | #FA3232 9 | #FF5050 10 | 11 | #f7f7f7 12 | #00000000 13 | #ffffff 14 | #000000 15 | #333333 16 | #666666 17 | #999999 18 | 19 | #FF5050 20 | #ff0000 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/cocoon/jay/tallybook/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.cocoon.jay.tallybook", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_menu_my.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Administrator\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tb_income_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tb_outcome_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/adapter/MyPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.adapter; 2 | 3 | import android.support.v4.view.PagerAdapter; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | 7 | import java.util.List; 8 | 9 | public class MyPagerAdapter extends PagerAdapter { 10 | private List imageViews ; 11 | private String[] mTitles ; 12 | public MyPagerAdapter(List imageViews){ 13 | this.imageViews = imageViews; 14 | } 15 | public MyPagerAdapter(List imageViews, String[] mTitles){ 16 | this.imageViews = imageViews; 17 | this.mTitles= mTitles; 18 | } 19 | @Override 20 | public int getCount() { 21 | return imageViews.size(); 22 | } 23 | 24 | @Override 25 | public CharSequence getPageTitle(int position) { 26 | return mTitles[position]; 27 | } 28 | @Override 29 | public Object instantiateItem(ViewGroup container, int position) { 30 | container.addView(imageViews.get(position)); 31 | return imageViews.get(position); 32 | } 33 | @Override 34 | public void destroyItem(ViewGroup container, int position, Object object) { 35 | container.removeView(imageViews.get(position)); 36 | } 37 | @Override 38 | public boolean isViewFromObject(View arg0, Object arg1) { 39 | return arg0==arg1; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_recycler_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/activity/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.activity; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.FragmentActivity; 7 | 8 | 9 | import com.cocoon.jay.tallybook.R; 10 | import com.cocoon.jay.tallybook.utils.ActivityManagerUtil; 11 | import com.cocoon.jay.tallybook.utils.StatusBarUtil; 12 | 13 | import butterknife.ButterKnife; 14 | import butterknife.Unbinder; 15 | 16 | 17 | public abstract class BaseActivity extends FragmentActivity { 18 | 19 | protected Activity mContext; 20 | private Unbinder mUnBinder; 21 | 22 | @Override 23 | protected void onCreate(@Nullable Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(getLayout()); 26 | ActivityManagerUtil.mActivities.add(this); 27 | mUnBinder = ButterKnife.bind(this); 28 | mContext = this; 29 | initEventAndData(); 30 | setStatusBar(); 31 | } 32 | 33 | protected void setStatusBar() { 34 | StatusBarUtil.setColor(this, getResources().getColor(R.color.colorPrimary)); 35 | } 36 | 37 | 38 | @Override 39 | protected void onDestroy() { 40 | super.onDestroy(); 41 | mUnBinder.unbind(); 42 | ActivityManagerUtil.mActivities.remove(this); 43 | } 44 | 45 | protected abstract int getLayout(); 46 | protected abstract void initEventAndData(); 47 | } 48 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'android-apt' 3 | 4 | android { 5 | compileSdkVersion 25 6 | buildToolsVersion "26.0.1" 7 | defaultConfig { 8 | applicationId "com.cocoon.jay.tallybook" 9 | minSdkVersion 15 10 | targetSdkVersion 25 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 26 | exclude group: 'com.android.support', module: 'support-annotations' 27 | }) 28 | compile 'com.android.support:appcompat-v7:25.3.1' 29 | compile 'com.android.support.constraint:constraint-layout:1.0.1' 30 | testCompile 'junit:junit:4.12' 31 | 32 | compile 'com.android.support:design:25.3.1' 33 | 34 | compile 'com.jakewharton:butterknife:8.2.1' 35 | apt 'com.jakewharton:butterknife-compiler:8.2.1' 36 | 37 | compile 'com.google.code.gson:gson:2.8.0' 38 | compile 'com.github.bumptech.glide:glide:3.7.0' 39 | 40 | compile 'com.github.PhilJay:MPAndroidChart:v3.0.2' 41 | compile 'com.contrarywind:Android-PickerView:3.2.5' 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_menu_first.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 13 | 14 | 21 | 22 | 28 | 29 | 30 | 31 | 32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | TallyBook 3 | 4 | 5 | 6 | 明细 7 | 记一笔 8 | 类别报表 9 | 账户 10 | 11 | 12 | 13 | { 14 | "status": 1, 15 | "total": 8882.4, 16 | "surplus": "-1,590.60", 17 | "scale": "-", 18 | "t_money": [ 19 | { 20 | "affect_money": 4616.86, 21 | "type": 28, 22 | "typename": "投标成功待收利息", 23 | "back_color": "#6783fd" 24 | }, 25 | { 26 | "affect_money": 1481.89, 27 | "type": "331", 28 | "typename": "额外收益", 29 | "back_color": "#8da3fd" 30 | }, 31 | { 32 | "affect_money": 830, 33 | "type": "335", 34 | "typename": "兼职", 35 | "back_color": "#6884f9" 36 | }, 37 | { 38 | "affect_money": 800, 39 | "type": "332", 40 | "typename": "资金补偿", 41 | "back_color": "#8096f5" 42 | }, 43 | { 44 | "affect_money": 600, 45 | "type": "328", 46 | "typename": "礼金", 47 | "back_color": "#6e82db" 48 | }, 49 | { 50 | "affect_money": 553.65, 51 | "type": "0", 52 | "typename": "杂项", 53 | "back_color": "#6783fd" 54 | } 55 | ] 56 | } 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_tallytype_rank.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | 18 | 27 | 28 | 38 | 39 | 40 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/utils/ActivityManagerUtil.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.utils; 2 | 3 | import android.app.Activity; 4 | 5 | import java.util.ArrayList; 6 | import java.util.LinkedList; 7 | import java.util.List; 8 | 9 | public class ActivityManagerUtil { 10 | 11 | /** 记录处于前台的Activity */ 12 | public static Activity mForegroundActivity = null; 13 | /** 记录所有活动的Activity */ 14 | public static final List mActivities = new LinkedList(); 15 | 16 | 17 | /** 获取当前处于栈顶的activity,无论其是否处于前台 */ 18 | public static Activity getCurrentActivity() { 19 | List copy; 20 | synchronized (mActivities) { 21 | copy = new ArrayList(mActivities); 22 | } 23 | if (copy.size() > 0) { 24 | return copy.get(copy.size() - 1); 25 | } 26 | return null; 27 | } 28 | 29 | /** 是否有启动的Activity */ 30 | public static boolean hasActivity() { 31 | return mActivities.size() > 0; 32 | } 33 | 34 | /** 获取当前处于前台的activity */ 35 | public static Activity getForegroundActivity() { 36 | return mForegroundActivity; 37 | } 38 | 39 | /** 关闭所有Activity,除了参数传递的Activity */ 40 | public static void finishAll(Class except) { 41 | List copy; 42 | synchronized (mActivities) { 43 | copy = new ArrayList(mActivities); 44 | } 45 | for (Activity activity : copy) { 46 | if (activity.getClass() != except) 47 | activity.finish(); 48 | } 49 | } 50 | 51 | /** 关闭所有Activity */ 52 | public static void finishAll() { 53 | List copy; 54 | synchronized (mActivities) { 55 | copy = new ArrayList(mActivities); 56 | } 57 | for (Activity activity : copy) { 58 | activity.finish(); 59 | } 60 | } 61 | 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/fragment/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.fragment; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.Bundle; 6 | import android.support.annotation.Nullable; 7 | import android.support.v4.app.Fragment; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | 12 | import butterknife.ButterKnife; 13 | import butterknife.Unbinder; 14 | 15 | 16 | /** 17 | * Created by codeest on 16/8/11. 18 | * 无MVP的Fragment基类 19 | */ 20 | 21 | public abstract class BaseFragment extends Fragment { 22 | 23 | protected View mView; 24 | protected Activity mActivity; 25 | protected Context mContext; 26 | private Unbinder mUnBinder; 27 | 28 | @Override 29 | public void onAttach(Context context) { 30 | mActivity = (Activity) context; 31 | mContext = context; 32 | super.onAttach(context); 33 | } 34 | 35 | @Nullable 36 | @Override 37 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 38 | mView = inflater.inflate(getLayoutId(), null); 39 | return mView; 40 | } 41 | 42 | @Override 43 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 44 | super.onViewCreated(view, savedInstanceState); 45 | mUnBinder = ButterKnife.bind(this, view); 46 | initEventAndData(); 47 | } 48 | 49 | @Override 50 | public void onDestroyView() { 51 | super.onDestroyView(); 52 | mUnBinder.unbind(); 53 | } 54 | 55 | protected abstract int getLayoutId(); 56 | protected abstract void initEventAndData(); 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/adapter/TallyTypeRankAdapter.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.cocoon.jay.tallybook.R; 11 | 12 | import java.util.List; 13 | 14 | 15 | public class TallyTypeRankAdapter extends RecyclerView.Adapter{ 16 | 17 | private Context mContext; 18 | private LayoutInflater mInflater; 19 | private List mDatas; 20 | 21 | public void setmDatas(List mDatas) { 22 | this.mDatas = mDatas; 23 | } 24 | 25 | public TallyTypeRankAdapter(Context context, List datas){ 26 | this.mContext = context; 27 | this.mInflater = LayoutInflater.from(context); 28 | this. mDatas = datas; 29 | } 30 | 31 | 32 | @Override 33 | public int getItemCount() { 34 | return (mDatas== null) ? 0 : mDatas.size(); 35 | } 36 | 37 | 38 | 39 | @Override 40 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 41 | View view = mInflater.inflate(R.layout.item_tallytype_rank, parent, false); 42 | return new ViewHolder(view); 43 | } 44 | 45 | 46 | @Override 47 | public void onBindViewHolder(ViewHolder holder, final int position) { 48 | holder.rank.setText(position+1+""); 49 | holder.title.setText(mDatas.get(position).toString()); 50 | holder.money.setText(String.valueOf(Math.ceil(Math.random() * 100))); 51 | 52 | } 53 | 54 | class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ 55 | 56 | private TextView title; 57 | private TextView money; 58 | private TextView rank; 59 | 60 | public ViewHolder(View view){ 61 | super(view); 62 | 63 | title = (TextView) view.findViewById(R.id.title); 64 | money = (TextView) view.findViewById(R.id.money); 65 | rank = (TextView) view.findViewById(R.id.rank); 66 | 67 | } 68 | 69 | 70 | @Override 71 | public void onClick(View view) { 72 | switch (view.getId()) { 73 | } 74 | } 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/utils/FormatUtils.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.utils; 2 | 3 | import java.text.DecimalFormat; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | import java.util.Locale; 7 | 8 | /** 9 | * Created by 42147 on 2017/2/22. 10 | */ 11 | 12 | public class FormatUtils { 13 | 14 | /** 15 | * @param money 16 | * @return 17 | * @Method : moneyFormat 18 | * @Description: 对金额的格式调整到分 19 | */ 20 | public static String moneyFormat(String money) {// 23->23.00 21 | StringBuffer sb = new StringBuffer(); 22 | if (money == null) { 23 | return "0.00"; 24 | } 25 | while (money.startsWith("0")) { 26 | money = money.substring(1); 27 | } 28 | 29 | int index = money.indexOf("."); 30 | if (index == -1) { 31 | return money + ".00"; 32 | } else { 33 | String s0 = money.substring(0, index);// 整数部分 34 | String s1 = money.substring(index + 1);// 小数部分 35 | if (s1.length() == 1) {// 小数点后一位 36 | s1 = s1 + "0"; 37 | } else if (s1.length() > 2) {// 如果超过3位小数,截取2位就可以了 38 | s1 = s1.substring(0, 2); 39 | } 40 | sb.append(s0); 41 | sb.append("."); 42 | sb.append(s1); 43 | } 44 | return sb.toString(); 45 | } 46 | 47 | public static String MyDecimalFormat(String pattern, double value) { 48 | DecimalFormat myFormat = new DecimalFormat(); 49 | myFormat.applyPattern(pattern); 50 | String str = myFormat.format(value); 51 | return str; 52 | } 53 | 54 | public static String getMoneyStr(double money) { 55 | return MyDecimalFormat("##,###,###.##", money); 56 | } 57 | 58 | 59 | /** 60 | * 时间格式转换 61 | * @param timestamp 62 | * @return 63 | */ 64 | public static String format1(long timestamp) { 65 | SimpleDateFormat formate = new SimpleDateFormat("y-M-d", Locale.CHINA); 66 | return formate.format(new Date(timestamp* 1000)); 67 | } 68 | 69 | public static String format2(long timestamp) { 70 | SimpleDateFormat formate = new SimpleDateFormat("y-M-d HH:mm", Locale.CHINA); 71 | return formate.format(new Date(timestamp* 1000)); 72 | } 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | C:\Users\Administrator\AppData\Roaming\Subversion 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/bean/TallyTypeBean.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.bean; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by Administrator on 2017/10/17 0017. 7 | */ 8 | 9 | public class TallyTypeBean extends BaseBean { 10 | 11 | 12 | /** 13 | * total : 4.31 14 | * surplus : +2.31 15 | * scale : -99.90% 16 | * t_money : [{"affect_money":4.31,"type":"78","typename":"vip额外收益","back_color":"#6783fd"}] 17 | */ 18 | 19 | private float total; 20 | private String surplus; 21 | private String scale; 22 | private List t_money; 23 | 24 | public float getTotal() { 25 | return total; 26 | } 27 | 28 | public void setTotal(float total) { 29 | this.total = total; 30 | } 31 | 32 | public String getSurplus() { 33 | return surplus; 34 | } 35 | 36 | public void setSurplus(String surplus) { 37 | this.surplus = surplus; 38 | } 39 | 40 | public String getScale() { 41 | return scale; 42 | } 43 | 44 | public void setScale(String scale) { 45 | this.scale = scale; 46 | } 47 | 48 | public List getT_money() { 49 | return t_money; 50 | } 51 | 52 | public void setT_money(List t_money) { 53 | this.t_money = t_money; 54 | } 55 | 56 | public static class TMoneyBean { 57 | /** 58 | * affect_money : 4.31 59 | * type : 78 60 | * typename : vip额外收益 61 | * back_color : #6783fd 62 | */ 63 | 64 | private float affect_money; 65 | private int type; 66 | private String typename; 67 | private String back_color; 68 | 69 | public float getAffect_money() { 70 | return affect_money; 71 | } 72 | 73 | public void setAffect_money(float affect_money) { 74 | this.affect_money = affect_money; 75 | } 76 | 77 | public int getType() { 78 | return type; 79 | } 80 | 81 | public void setType(int type) { 82 | this.type = type; 83 | } 84 | 85 | public String getTypename() { 86 | return typename; 87 | } 88 | 89 | public void setTypename(String typename) { 90 | this.typename = typename; 91 | } 92 | 93 | public String getBack_color() { 94 | return back_color; 95 | } 96 | 97 | public void setBack_color(String back_color) { 98 | this.back_color = back_color; 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_tally_account.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 17 | 18 | 19 | 27 | 28 | 35 | 36 | 45 | 46 | 47 | 48 | 49 | 57 | 58 | 64 | 65 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/fragment/MenuMyFragment.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.fragment; 2 | 3 | import android.support.v4.widget.SwipeRefreshLayout; 4 | import android.support.v7.widget.LinearLayoutManager; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.widget.LinearLayout; 7 | import android.widget.TextView; 8 | 9 | import com.cocoon.jay.tallybook.R; 10 | import com.cocoon.jay.tallybook.adapter.TallyAccountAdapter; 11 | import com.cocoon.jay.tallybook.bean.TallyAccountBean; 12 | import com.cocoon.jay.tallybook.utils.DateUtils; 13 | import com.cocoon.jay.tallybook.utils.TestDataUtil; 14 | 15 | import java.util.Date; 16 | import java.util.List; 17 | 18 | import butterknife.BindView; 19 | 20 | /** 21 | * 记账本--我的账户 22 | */ 23 | public class MenuMyFragment extends BaseFragment { 24 | 25 | 26 | @BindView(R.id.data_year) 27 | TextView dataYear; 28 | @BindView(R.id.data_month) 29 | TextView dataMonth; 30 | @BindView(R.id.layout_data) 31 | LinearLayout layoutData; 32 | @BindView(R.id.cash_surplus) 33 | TextView cashSurplus; 34 | @BindView(R.id.cash_compared) 35 | TextView cashCompared; 36 | @BindView(R.id.rv_list) 37 | RecyclerView rvList; 38 | @BindView(R.id.swipe) 39 | SwipeRefreshLayout swipe; 40 | 41 | 42 | private TallyAccountAdapter adapter; 43 | private List list; 44 | 45 | 46 | @Override 47 | protected int getLayoutId() { 48 | return R.layout.fragment_menu_my; 49 | } 50 | 51 | 52 | @Override 53 | protected void initEventAndData() { 54 | 55 | dataYear.setText(DateUtils.getCurYear("yyyy 年")); 56 | dataMonth.setText(DateUtils.date2Str(new Date(), "MM")); 57 | //改变加载显示的颜色 58 | swipe.setColorSchemeColors(getResources().getColor(R.color.text_red), getResources().getColor(R.color.text_red)); 59 | //设置向下拉多少出现刷新 60 | swipe.setDistanceToTriggerSync(200); 61 | //设置刷新出现的位置 62 | swipe.setProgressViewEndTarget(false, 200); 63 | swipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { 64 | @Override 65 | public void onRefresh() { 66 | swipe.setRefreshing(false); 67 | } 68 | }); 69 | 70 | rvList.setLayoutManager(new LinearLayoutManager(getActivity())); 71 | adapter = new TallyAccountAdapter(getActivity(), list); 72 | adapter.setmListener(new TallyAccountAdapter.OnItemClickListener() { 73 | @Override 74 | public void onItemClick(int position) { 75 | } 76 | }); 77 | rvList.setAdapter(adapter); 78 | //test data--------------- 79 | setTestData(); 80 | } 81 | 82 | 83 | private void setTestData() { 84 | TallyAccountBean data = TestDataUtil.getTallyAccountBean(); 85 | list = data.getList(); 86 | adapter.setmDatas(list); 87 | adapter.notifyDataSetChanged(); 88 | } 89 | 90 | 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/bean/TallyAccountBean.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.bean; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * Created by Administrator on 2017/10/16 0016. 8 | */ 9 | 10 | public class TallyAccountBean extends BaseBean{ 11 | 12 | 13 | /** 14 | * total_in : 0.00 15 | * total_out : .00 16 | * list : [{"type":"1","img":"/UF/Uploads/Noteimg/cash@2x.png","name":"现金","num":"","income":"+0.00","outcome":"-0.00"},{"type":"3_17","img":"/UF/Uploads/Noteimg/bank@2x.png","name":"银行卡","num":"尾号3333","income":"+0.00","outcome":"-0.00"},{"type":"4","img":"/UF/Uploads/Noteimg/other@2x.png","name":"未分类","num":"","income":"+0.00","outcome":"-0.00"}] 17 | */ 18 | 19 | private String total_in; 20 | private String total_out; 21 | private List list; 22 | 23 | public String getTotal_in() { 24 | return total_in; 25 | } 26 | 27 | public void setTotal_in(String total_in) { 28 | this.total_in = total_in; 29 | } 30 | 31 | public String getTotal_out() { 32 | return total_out; 33 | } 34 | 35 | public void setTotal_out(String total_out) { 36 | this.total_out = total_out; 37 | } 38 | 39 | public List getList() { 40 | return list; 41 | } 42 | 43 | public void setList(List list) { 44 | this.list = list; 45 | } 46 | 47 | public static class ListBean implements Serializable{ 48 | /** 49 | * type : 1 50 | * img : /UF/Uploads/Noteimg/cash@2x.png 51 | * name : 现金 52 | * num : 53 | * income : +0.00 54 | * outcome : -0.00 55 | */ 56 | 57 | private String type; 58 | private String img; 59 | private String name; 60 | private String num; 61 | private String income; 62 | private String outcome; 63 | 64 | public String getType() { 65 | return type; 66 | } 67 | 68 | public void setType(String type) { 69 | this.type = type; 70 | } 71 | 72 | public String getImg() { 73 | return img; 74 | } 75 | 76 | public void setImg(String img) { 77 | this.img = img; 78 | } 79 | 80 | public String getName() { 81 | return name; 82 | } 83 | 84 | public void setName(String name) { 85 | this.name = name; 86 | } 87 | 88 | public String getNum() { 89 | return num; 90 | } 91 | 92 | public void setNum(String num) { 93 | this.num = num; 94 | } 95 | 96 | public String getIncome() { 97 | return income; 98 | } 99 | 100 | public void setIncome(String income) { 101 | this.income = income; 102 | } 103 | 104 | public String getOutcome() { 105 | return outcome; 106 | } 107 | 108 | public void setOutcome(String outcome) { 109 | this.outcome = outcome; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /app/src/main/java/com/cocoon/jay/tallybook/view/BaseBottomBar.java: -------------------------------------------------------------------------------- 1 | package com.cocoon.jay.tallybook.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.View; 6 | import android.widget.LinearLayout; 7 | 8 | /** 9 | * 封装的底部导航栏。 10 | * n个tab按钮 11 | */ 12 | public class BaseBottomBar extends LinearLayout implements 13 | View.OnClickListener { 14 | 15 | private static final String TAG = BaseBottomBar.class.getSimpleName(); 16 | 17 | private View currentView; 18 | 19 | private View[] views; 20 | 21 | private OnBottomBarListener onBottomBarListener; 22 | 23 | public BaseBottomBar(Context context) { 24 | super(context); 25 | } 26 | 27 | public BaseBottomBar(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | } 30 | 31 | @Override 32 | protected void onFinishInflate() { 33 | super.onFinishInflate(); 34 | views = new View[getChildCount()]; 35 | for (int i = 0; i < views.length; i++) { 36 | views[i] = getChildAt(i); 37 | views[i].setOnClickListener(this); 38 | views[i].setTag(i); 39 | } 40 | } 41 | 42 | /** 43 | * 显示某一个tab 44 | * 45 | * @param index 46 | */ 47 | public void showTab(int index) { 48 | if (index < 0) 49 | return; 50 | if (views != null && views.length > 0 && views.length > index) { 51 | for (int i = 0; i < views.length; i++) { 52 | if (i != index) { 53 | onBottomBarListener.hideFragment(i, index); 54 | } else { 55 | setCurrentView(views[index]); 56 | } 57 | } 58 | } 59 | 60 | } 61 | 62 | public void setCurrentView(View view) { 63 | if (view == null) { 64 | return; 65 | } 66 | 67 | if (onBottomBarListener == null) { 68 | return; 69 | } 70 | 71 | 72 | // 当前view = 点击view则调用刷新接口 73 | if (view == currentView) { 74 | onBottomBarListener.refreshView((Integer)currentView.getTag()); 75 | return; 76 | } 77 | 78 | // 将之前的tab置灰 隐藏fragment 79 | if (currentView != null) { 80 | currentView.setSelected(false); 81 | onBottomBarListener.hideFragment((Integer)currentView.getTag(), (Integer)view.getTag()); 82 | } 83 | 84 | // 刷新当前view引用 显示当前fragment 85 | currentView = view; 86 | currentView.setSelected(true); 87 | onBottomBarListener.showFragment((Integer)view.getTag()); 88 | } 89 | 90 | @Override 91 | public void onClick(View view) { 92 | if (onBottomBarListener != null) { 93 | onBottomBarListener.onTabClick(view); 94 | } 95 | } 96 | 97 | public void setOnBottomBarListener(OnBottomBarListener listener) { 98 | this.onBottomBarListener = listener; 99 | } 100 | 101 | public int getCount() { 102 | return views.length; 103 | } 104 | 105 | public static interface OnBottomBarListener { 106 | 107 | /** 108 | * 显示新tab页 109 | * 110 | * @param 111 | */ 112 | public void showFragment(int index); 113 | 114 | /** 115 | * 隐藏新tab页 116 | * 117 | * @param 118 | */ 119 | public void hideFragment(int lastIndex, int curIndex); 120 | 121 | /** 122 | * 刷新当前tab页 123 | */ 124 | public void refreshView(int index); 125 | 126 | /** 127 | * tab点击 128 | * 129 | * @param view 130 | */ 131 | public void onTabClick(View view); 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_recycler_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 49 | 50 | 51 | 61 | 62 | 72 | 73 | 74 | 80 | 81 | 82 | 83 | 86 | 87 |