├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── README_en.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── copasso │ │ └── cocobill │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── copasso │ │ │ └── cocobill │ │ │ ├── MyApplication.java │ │ │ ├── base │ │ │ ├── BaseActivity.java │ │ │ ├── BaseContract.java │ │ │ ├── BaseFragment.java │ │ │ ├── BaseMVPActivity.java │ │ │ ├── BaseMVPFragment.java │ │ │ ├── BaseObserver.java │ │ │ ├── BaseService.java │ │ │ └── RxPresenter.java │ │ │ ├── common │ │ │ └── Constants.java │ │ │ ├── model │ │ │ ├── bean │ │ │ │ ├── BaseBean.java │ │ │ │ ├── local │ │ │ │ │ ├── BBill.java │ │ │ │ │ ├── BPay.java │ │ │ │ │ ├── BSort.java │ │ │ │ │ ├── MonthAccountBean.java │ │ │ │ │ ├── MonthChartBean.java │ │ │ │ │ ├── MonthListBean.java │ │ │ │ │ └── NoteBean.java │ │ │ │ └── remote │ │ │ │ │ ├── CoBill.java │ │ │ │ │ └── MyUser.java │ │ │ ├── event │ │ │ │ └── SyncEvent.java │ │ │ ├── gen │ │ │ │ ├── BBillDao.java │ │ │ │ ├── BPayDao.java │ │ │ │ ├── BSortDao.java │ │ │ │ ├── DaoMaster.java │ │ │ │ └── DaoSession.java │ │ │ └── repository │ │ │ │ ├── BmobRepository.java │ │ │ │ ├── DaoDbHelper.java │ │ │ │ └── LocalRepository.java │ │ │ ├── presenter │ │ │ ├── BillNotePresenter.java │ │ │ ├── BillPresenter.java │ │ │ ├── LandPresenter.java │ │ │ ├── MonthChartPresenter.java │ │ │ ├── MonthListPresenter.java │ │ │ ├── UserInfoPresenter.java │ │ │ └── contract │ │ │ │ ├── BillContract.java │ │ │ │ ├── BillNoteContract.java │ │ │ │ ├── LandContract.java │ │ │ │ ├── MonthChartContract.java │ │ │ │ ├── MonthListContract.java │ │ │ │ └── UserInfoContract.java │ │ │ ├── ui │ │ │ ├── activity │ │ │ │ ├── AboutActivity.java │ │ │ │ ├── BillAddActivity.java │ │ │ │ ├── BillSortActivity.java │ │ │ │ ├── LandActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── SettingActivity.java │ │ │ │ └── UserInfoActivity.java │ │ │ ├── adapter │ │ │ │ ├── BillSortAdapter.java │ │ │ │ ├── BookNoteAdapter.java │ │ │ │ ├── MainFragmentPagerAdapter.java │ │ │ │ ├── MonthAccountAdapter.java │ │ │ │ ├── MonthListAdapter.java │ │ │ │ └── binder │ │ │ │ │ └── MonthChartBillViewBinder.java │ │ │ └── fragment │ │ │ │ ├── MonthChartFragment.java │ │ │ │ └── MonthListFragment.java │ │ │ ├── utils │ │ │ ├── ActivityManagerUtils.java │ │ │ ├── BillUtils.java │ │ │ ├── DateUtils.java │ │ │ ├── DimenUtils.java │ │ │ ├── FormatUtils.java │ │ │ ├── GlideCacheUtil.java │ │ │ ├── HttpUtils.java │ │ │ ├── ImageUtils.java │ │ │ ├── OkHttpUtils.java │ │ │ ├── PieChartUtils.java │ │ │ ├── ProgressUtils.java │ │ │ ├── RegexUtils.java │ │ │ ├── SharedPUtils.java │ │ │ ├── SnackbarUtils.java │ │ │ ├── StringUtils.java │ │ │ ├── ThemeManager.java │ │ │ ├── ToastUtils.java │ │ │ └── UiUtils.java │ │ │ └── widget │ │ │ ├── CircleImageView.java │ │ │ ├── CommonItemLayout.java │ │ │ ├── OwlView.java │ │ │ ├── ScrollAwareBehavior.java │ │ │ ├── SwipeMenuView.java │ │ │ └── stickyheader │ │ │ ├── StickyHeaderGridAdapter.java │ │ │ └── StickyHeaderGridLayoutManager.java │ └── res │ │ ├── anim │ │ ├── fab_in.xml │ │ ├── fab_out.xml │ │ ├── slide_in_left.xml │ │ ├── slide_in_right.xml │ │ ├── slide_out_left.xml │ │ └── slide_out_right.xml │ │ ├── drawable-v21 │ │ ├── ic_menu_camera.xml │ │ ├── ic_menu_gallery.xml │ │ ├── ic_menu_manage.xml │ │ ├── ic_menu_send.xml │ │ ├── ic_menu_share.xml │ │ ├── ic_menu_slideshow.xml │ │ ├── round_corner_bg.9.png │ │ └── selector_edittext_bg.xml │ │ ├── drawable-xhdpi │ │ ├── icon_banner_point1.png │ │ └── icon_banner_point2.png │ │ ├── drawable │ │ ├── bg_button_code_normal.xml │ │ ├── bg_button_default.xml │ │ ├── bg_button_default_normal.xml │ │ ├── bg_button_default_pressed.xml │ │ ├── bg_click.xml │ │ ├── bg_radius_click.xml │ │ ├── card.xml │ │ ├── rb_main_first_selector.xml │ │ ├── rb_main_four_selector.xml │ │ ├── rb_main_second_selector.xml │ │ ├── rb_main_third_selector.xml │ │ ├── shape_tb_calc.xml │ │ ├── shape_tb_cash.xml │ │ ├── side_nav_bar.xml │ │ ├── tabbar_text_color.xml │ │ ├── tb_income_selector.xml │ │ ├── tb_outcome_selector.xml │ │ ├── tb_text_selector.xml │ │ └── toast_radius.xml │ │ ├── layout │ │ ├── activity_add.xml │ │ ├── activity_base_list.xml │ │ ├── activity_main.xml │ │ ├── activity_setting.xml │ │ ├── activity_user_info.xml │ │ ├── activity_user_land.xml │ │ ├── app_main.xml │ │ ├── app_toolbar.xml │ │ ├── app_top_date.xml │ │ ├── dialog_change_password.xml │ │ ├── drawer_header.xml │ │ ├── fragment_month_chart.xml │ │ ├── fragment_month_list.xml │ │ ├── item_recycler_monthchart_rank.xml │ │ ├── item_recycler_monthlist_header.xml │ │ ├── item_recycler_monthlist_item.xml │ │ ├── item_recycler_note_sort.xml │ │ ├── item_tb_type.xml │ │ ├── item_tb_type_page.xml │ │ └── view_common_layout.xml │ │ ├── menu │ │ ├── activity_main_drawer.xml │ │ └── menu_main_toolbar.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── edittext_bg_focused.9.png │ │ ├── edittext_bg_normal.9.png │ │ ├── ic_def_icon.png │ │ ├── ic_default_icon.png │ │ ├── ic_drag.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── owl_login.png │ │ ├── owl_login_arm_left.png │ │ ├── owl_login_arm_right.png │ │ ├── sort_bangong.png │ │ ├── sort_canyin.png │ │ ├── sort_chongwu.png │ │ ├── sort_fanxian.png │ │ ├── sort_gouwu.png │ │ ├── sort_haizi.png │ │ ├── sort_huankuan.png │ │ ├── sort_jiangjin.png │ │ ├── sort_jianzhi.png │ │ ├── sort_jiaotong.png │ │ ├── sort_jiushui.png │ │ ├── sort_juanzeng.png │ │ ├── sort_jujia.png │ │ ├── sort_lijin.png │ │ ├── sort_lingqian.png │ │ ├── sort_lingshi.png │ │ ├── sort_liwu.png │ │ ├── sort_lixi.png │ │ ├── sort_lvxing.png │ │ ├── sort_meirong.png │ │ ├── sort_shouxufei.png │ │ ├── sort_shuiguo.png │ │ ├── sort_shuma.png │ │ ├── sort_tianjia.png │ │ ├── sort_tianjiade.png │ │ ├── sort_tongxun.png │ │ ├── sort_weixiu.png │ │ ├── sort_weiyuejin.png │ │ ├── sort_xuexi.png │ │ ├── sort_yiban.png │ │ ├── sort_yiliao.png │ │ ├── sort_yongjin.png │ │ ├── sort_yule.png │ │ ├── sort_yundong.png │ │ ├── sort_zhangbei.png │ │ └── sort_zhufang.png │ │ ├── mipmap-xhdpi │ │ ├── arrow_right.png │ │ ├── avatar_zhouas666.png │ │ ├── card_account.png │ │ ├── card_bank.png │ │ ├── card_cash.png │ │ ├── ic_back.png │ │ ├── ic_color_lens_black_24dp.png │ │ ├── ic_drawer_about.png │ │ ├── ic_drawer_assignment_grey600_36dp.png │ │ ├── ic_drawer_chat.png │ │ ├── ic_drawer_exit.png │ │ ├── ic_drawer_friends.png │ │ ├── ic_drawer_guide.png │ │ ├── ic_drawer_settings.png │ │ ├── ic_drawer_share.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── ic_tb_calc_del.png │ │ ├── ic_tb_note_delete.png │ │ ├── ic_tb_note_remark.png │ │ ├── ic_toolbar_date.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_manager.png │ │ ├── tallybook_note.png │ │ ├── tallybook_other.png │ │ ├── tallybook_output.png │ │ ├── type_bangong.png │ │ ├── type_canyin.png │ │ ├── type_changhuanfeiyong.png │ │ ├── type_chongwu.png │ │ ├── type_ewaishouyi.png │ │ ├── type_fanxian.png │ │ ├── type_fuzhuang.png │ │ ├── type_haizi.png │ │ ├── type_jianzhi.png │ │ ├── type_jiaotong.png │ │ ├── type_jiaxi.png │ │ ├── type_jiushuiyinliao.png │ │ ├── type_juanzeng.png │ │ ├── type_jujia.png │ │ ├── type_lijin.png │ │ ├── type_lingshi.png │ │ ├── type_liwu.png │ │ ├── type_lixi.png │ │ ├── type_lvxing.png │ │ ├── type_meirong.png │ │ ├── type_qita.png │ │ ├── type_shangchengxiaofei.png │ │ ├── type_shouxufei.png │ │ ├── type_shuiguo.png │ │ ├── type_shuma.png │ │ ├── type_tianjiade.png │ │ ├── type_tongxun.png │ │ ├── type_weixiu.png │ │ ├── type_weiyuejin.png │ │ ├── type_xuexi.png │ │ ├── type_yiliao.png │ │ ├── type_yongjinjiangli.png │ │ ├── type_yule.png │ │ ├── type_yundong.png │ │ ├── type_zaxiang.png │ │ ├── type_zhangbei.png │ │ ├── type_zhufang.png │ │ └── type_zijinbuchang.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_btn_add.png │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── ic_pwd_look.png │ │ ├── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── file_paths.xml │ └── test │ └── java │ └── com │ └── copasso │ └── cocobill │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── imgs ├── 1532613405094.jpg ├── Screenshot_2017-12-30-18-12-11-686_com.copasso.co.png ├── Screenshot_2017-12-30-18-12-18-721_com.copasso.co.png ├── Screenshot_2017-12-30-18-12-25-810_com.copasso.co.png ├── Screenshot_2017-12-30-18-12-33-936_com.copasso.co.png ├── Screenshot_2017-12-30-18-13-09-779_com.copasso.co.png ├── Screenshot_2017-12-30-18-13-16-119_com.copasso.co.png ├── Screenshot_2017-12-30-18-16-39-866_com.copasso.co.png ├── Screenshot_2017-12-31-15-33-07-015_com.copasso.co.png ├── Screenshot_2017-12-31-15-42-42-824_com.copasso.co.png ├── Screenshot_2017-12-31-15-59-05-109_com.miui.galle.png ├── Screenshot_2017-12-31-16-11-54-534_com.copasso.co.png ├── Screenshot_2019-01-11-15-51-35-185_com.copasso.co.png ├── Screenshot_2019-01-11-15-51-44-801_com.copasso.co.png ├── Screenshot_2019-01-11-15-51-51-359_com.copasso.co.png ├── Screenshot_2019-01-11-15-54-08-048_com.copasso.co.png └── mm_facetoface_collect_qrcode_1532613439482.png ├── market ├── bmob │ ├── QQ截图20180529170850.png │ ├── timg_gaitubao_com_120x120.png │ ├── 基于Bmob平台记账助手客户端.docx │ └── 基于Bmob平台记账助手客户端.zip └── icon │ ├── android │ ├── ic_launcher.png │ ├── ic_launcher_round.png │ ├── mipmap-ldpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ │ ├── 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 │ ├── icons.zip │ ├── icons_round.zip │ └── timg.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches/build_file_checksums.ser 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CocoBill 2 | [English Version](https://github.com/zas023/CocoBill/blob/master/README_en.md) | 中文版 3 | 4 | :closed_book:一个数据存储使用的Bmob,采用MVP架构的Android记账本APP 5 | 6 | 在我们生活中经常不知道钱花在什么地方,但是我们自己又不是很想写在记账本上进行管理,因为关于记账,我们每个人都有自己的需求,虽然市面上有许多优秀的记账app,所以对于自己来说,开发一个属于自己的软件来记账是个非常有趣的事情,但一直因为时间安排的原因未能实现。 7 | 所以趁着本学期程序实践的机会,顺便做一个项目,后台采用ssm框架,如果有不足的地方,希望看到的大神给予指点建议,不胜感激! 8 | 9 | 博客地址:http://blog.csdn.net/adminpd/article/details/78942212 10 | 11 | PS:最近很多人问我有关后台的问题,后台数据服务使用的是bmob后端云,如果没用过,请先到 https://www.bmob.cn/?invite_code=@qcg 注册或自行百度,很好上手的,很适合个人开发者及小公司。若想写自己的后端,可以查看第一版代码。 12 | 13 | 整体项目(源码及数据库结构)我发布在 https://www.bmob.cn/shop/detail/448 上,购买后可以一键迁移我的数据库结构到你的账号里。创建bmob账号选择免费版的就完全够用,除非你用户量过10万了。 14 | 15 | ## 下载资源 16 | 17 | 发布在以下平台: 18 | 19 | | 平台 | 下载地址 | 20 | | ---- | ---- | 21 | | 酷安 | 去酷安下载 | 22 | 23 | ## 版本日志 24 | 25 | v2:后台使用Bmob后端云 26 | 27 | v1:后台地址(采用ssm框架):https://github.com/zas023/ssmBillBook 28 | 29 | 30 | v0.5.1: 2019.01.11 31 | - 更新依赖; 32 | - 重构项目,优化结构; 33 | 34 | v0.4.1: 2018.03.31 35 | - 添加本地账单; 36 | - 实现账单同步; 37 | 38 | v0.3.1: 2017.12.28 39 | - 添加上传头像功能; 40 | - 添加修改主题功能; 41 | - 添加账单分类管理; 42 | - 添加侧滑删除编辑; 43 | 44 | ## 程序效果 45 |

46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |

56 | 57 | ##### 注:本程序素材来源网络,如有影响你的权益,请及时联系本人 58 | 59 | 60 | ## TODO 61 | - [x] 帐薄总支出、收入显示。 62 | - [x] 账目数据增加编辑功能。 63 | - [x] 账目数据增加归类功能。 64 | - [x] 账目数据增加同步功能。 65 | - [x] 自定义分类、支付方式。 66 | - [x] 统计功能。 67 | - [x] 换肤功能。 68 | - [ ] 检测更新。 69 | - [ ] 应用瘦身。 70 | - [ ] 密码锁功能。 71 | 72 | ## Thanks 73 | - butterknife: https://github.com/JakeWharton/butterknife 74 | - glide: https://github.com/bumptech/glide 75 | - okhttp: https://github.com/square/okhttp 76 | - MPAndroidChart: https://github.com/PhilJay/MPAndroidChart 77 | - Android-PickerView: https://github.com/Bigkoo/Android-PickerView 78 | - Material-dialogs: https://github.com/afollestad/material-dialogs 79 | - About: https://github.com/drakeet/about-page 80 | - Multitype: https://github.com/drakeet/MultiType 81 | - Greendao: https://github.com/greenrobot/greenDAO 82 | - Eventbus: https://github.com/greenrobot/eventbus 83 | - Bmob: https://bmob.cn 84 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'org.greenrobot.greendao' 3 | 4 | android { 5 | compileSdkVersion 28 6 | useLibrary 'org.apache.http.legacy' 7 | defaultConfig { 8 | applicationId "com.copasso.cocobill" 9 | minSdkVersion 16 10 | targetSdkVersion 28 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | compileOptions { 22 | sourceCompatibility = '1.8' 23 | targetCompatibility = '1.8' 24 | } 25 | } 26 | 27 | greendao { 28 | schemaVersion 1 29 | daoPackage 'com.copasso.cocobill.model.gen' 30 | targetGenDir 'src/main/java' 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(dir: 'libs', include: ['*.jar']) 35 | implementation 'androidx.appcompat:appcompat:1.1.0-alpha01' 36 | implementation 'com.google.android.material:material:1.1.0-alpha02' 37 | implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3' 38 | 39 | //Glide 40 | implementation 'com.github.bumptech.glide:glide:4.8.0' 41 | annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0' 42 | 43 | //MPAndroidChart 44 | implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha' 45 | 46 | //Dialogs 47 | implementation 'com.afollestad.material-dialogs:core:0.9.6.0' 48 | 49 | //PickerView 50 | implementation 'com.contrarywind:Android-PickerView:4.1.6' 51 | 52 | //About 53 | implementation 'me.drakeet.support:about:2.2.0' 54 | 55 | //Multitype 56 | implementation 'me.drakeet.multitype:multitype-ktx:3.5.0' 57 | 58 | //Greendao 59 | implementation 'org.greenrobot:greendao:3.2.2' 60 | 61 | //Eventbus 62 | implementation 'org.greenrobot:eventbus:3.1.1' 63 | 64 | //Bmob 65 | implementation 'cn.bmob.android:bmob-sdk:3.6.8-rc7' 66 | 67 | //Rx 68 | implementation "io.reactivex.rxjava2:rxjava:2.2.2" 69 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' 70 | 71 | //OkHttp 72 | implementation 'com.squareup.okio:okio:2.1.0' 73 | implementation 'com.squareup.okhttp3:okhttp:3.12.0' 74 | 75 | //Gson 76 | implementation 'com.google.code.gson:gson:2.8.5' 77 | 78 | testImplementation 'junit:junit:4.12' 79 | androidTestImplementation 'androidx.test:runner:1.1.1' 80 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 81 | } 82 | -------------------------------------------------------------------------------- /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/androidTest/java/com/copasso/cocobill/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill; 2 | 3 | import android.content.Context; 4 | import androidx.test.InstrumentationRegistry; 5 | import androidx.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 | * Instrumented 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() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.copasso.cocobill", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 40 | 43 | 46 | 49 | 52 | 53 | 56 | 57 | 62 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.copasso.cocobill.model.bean.remote.MyUser; 7 | 8 | import cn.bmob.v3.Bmob; 9 | import cn.bmob.v3.BmobUser; 10 | 11 | /** 12 | * Created by Zhouas666 on AndroidStudio 13 | * Date: 2019-01-08 14 | * Github: https://github.com/zas023 15 | */ 16 | public class MyApplication extends Application { 17 | 18 | public static MyApplication application; 19 | private static Context context; 20 | private static MyUser currentUser; 21 | 22 | @Override 23 | public void onCreate() { 24 | super.onCreate(); 25 | application = this; 26 | context = getApplicationContext(); 27 | //初始化Bmob后端云 28 | Bmob.initialize(this, "941f4add6503358048b02b83fcb605f6"); 29 | currentUser = BmobUser.getCurrentUser(MyUser.class); 30 | } 31 | 32 | /** 33 | * 获取上下文 34 | * 35 | * @return 36 | */ 37 | public static Context getContext() { 38 | return context; 39 | } 40 | 41 | /** 42 | * 获取用户id 43 | * @return 44 | */ 45 | public static String getCurrentUserId() { 46 | currentUser = BmobUser.getCurrentUser(MyUser.class); 47 | if (currentUser == null) 48 | return null; 49 | return BmobUser.getCurrentUser(MyUser.class).getObjectId(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/base/BaseContract.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.base; 2 | 3 | /** 4 | * Created by Zhouas666 on AndroidStudio 5 | * Date: 2019-01-08 6 | * Github: https://github.com/zas023 7 | */ 8 | public interface BaseContract { 9 | 10 | interface BasePresenter { 11 | 12 | void attachView(T view); 13 | 14 | void detachView(); 15 | } 16 | 17 | interface BaseView { 18 | 19 | void onSuccess(); 20 | 21 | void onFailure(Throwable e); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/base/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.base; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.Bundle; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | 10 | import androidx.annotation.LayoutRes; 11 | import androidx.annotation.Nullable; 12 | import androidx.fragment.app.Fragment; 13 | import io.reactivex.disposables.CompositeDisposable; 14 | import io.reactivex.disposables.Disposable; 15 | 16 | /** 17 | * Created by Zhouas666 on AndroidStudio 18 | * Date: 2019-01-08 19 | * Github: https://github.com/zas023 20 | */ 21 | public abstract class BaseFragment extends Fragment { 22 | 23 | protected String TAG; 24 | 25 | protected CompositeDisposable mDisposable; 26 | 27 | protected Activity mActivity; 28 | protected Context mContext; 29 | 30 | private View root = null; 31 | 32 | @Override 33 | public void onAttach(Context context) { 34 | mActivity = (Activity) context; 35 | mContext = context; 36 | super.onAttach(context); 37 | } 38 | 39 | @LayoutRes 40 | protected abstract int getLayoutId(); 41 | 42 | /*******************************init area*********************************/ 43 | protected void addDisposable(Disposable d){ 44 | if (mDisposable == null){ 45 | mDisposable = new CompositeDisposable(); 46 | } 47 | mDisposable.add(d); 48 | } 49 | 50 | 51 | protected void initData(Bundle savedInstanceState){ 52 | } 53 | 54 | /** 55 | * 初始化点击事件 56 | */ 57 | protected void initClick(){ 58 | } 59 | 60 | /** 61 | * 逻辑使用区 62 | */ 63 | protected void processLogic(){ 64 | } 65 | 66 | /** 67 | * 初始化零件 68 | */ 69 | protected void initWidget(Bundle savedInstanceState){ 70 | } 71 | 72 | protected void beforeDestroy(){ 73 | 74 | } 75 | 76 | /******************************lifecycle area*****************************************/ 77 | @Nullable 78 | @Override 79 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 80 | int resId = getLayoutId(); 81 | root = inflater.inflate(resId,container,false); 82 | return root; 83 | } 84 | 85 | @Override 86 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 87 | super.onViewCreated(view, savedInstanceState); 88 | initData(savedInstanceState); 89 | TAG=getName(); 90 | initWidget(savedInstanceState); 91 | initClick(); 92 | processLogic(); 93 | } 94 | 95 | @Override 96 | public void onDetach() { 97 | super.onDetach(); 98 | beforeDestroy(); 99 | if (mDisposable != null){ 100 | mDisposable.clear(); 101 | } 102 | } 103 | 104 | /**************************公共类*******************************************/ 105 | public String getName(){ 106 | return getClass().getName(); 107 | } 108 | 109 | protected VT getViewById(int id){ 110 | if (root == null){ 111 | return null; 112 | } 113 | return (VT) root.findViewById(id); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/base/BaseMVPActivity.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.base; 2 | 3 | /** 4 | * Created by Zhouas666 on AndroidStudio 5 | * Date: 2019-01-08 6 | * Github: https://github.com/zas023 7 | */ 8 | public abstract class BaseMVPActivity extends BaseActivity{ 9 | 10 | protected T mPresenter; 11 | 12 | protected abstract T bindPresenter(); 13 | 14 | @Override 15 | protected void processLogic() { 16 | attachView(bindPresenter()); 17 | } 18 | 19 | private void attachView(T presenter){ 20 | mPresenter = presenter; 21 | mPresenter.attachView(this); 22 | } 23 | 24 | @Override 25 | protected void onDestroy() { 26 | super.onDestroy(); 27 | mPresenter.detachView(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/base/BaseMVPFragment.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.base; 2 | 3 | /** 4 | * Created by Zhouas666 on AndroidStudio 5 | * Date: 2019-01-08 6 | * Github: https://github.com/zas023 7 | */ 8 | public abstract class BaseMVPFragment extends BaseFragment 9 | implements BaseContract.BaseView{ 10 | 11 | protected T mPresenter; 12 | 13 | protected abstract T bindPresenter(); 14 | 15 | @Override 16 | protected void processLogic(){ 17 | mPresenter = bindPresenter(); 18 | mPresenter.attachView(this); 19 | } 20 | 21 | @Override 22 | public void onDestroy() { 23 | super.onDestroy(); 24 | mPresenter.detachView(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/base/BaseObserver.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.base; 2 | 3 | import android.accounts.NetworkErrorException; 4 | import android.content.Context; 5 | 6 | import com.copasso.cocobill.model.bean.BaseBean; 7 | 8 | import java.net.ConnectException; 9 | import java.net.UnknownHostException; 10 | import java.util.concurrent.TimeoutException; 11 | 12 | import io.reactivex.Observer; 13 | import io.reactivex.disposables.Disposable; 14 | 15 | /** 16 | * Created by zhouas666 on 2018/1/19. 17 | */ 18 | public abstract class BaseObserver implements Observer { 19 | protected Context mContext; 20 | 21 | public BaseObserver(Context context) { 22 | this.mContext = context; 23 | } 24 | 25 | public BaseObserver() { 26 | 27 | } 28 | 29 | @Override 30 | public void onSubscribe(Disposable d) { 31 | onRequestStart(); 32 | 33 | } 34 | 35 | @Override 36 | public void onNext(T t) { 37 | onRequestEnd(); 38 | try { 39 | onSuccees(t); 40 | } catch (Exception e) { 41 | e.printStackTrace(); 42 | } 43 | } 44 | 45 | @Override 46 | public void onError(Throwable e) { 47 | onRequestEnd(); 48 | try { 49 | if (e instanceof ConnectException 50 | || e instanceof TimeoutException 51 | || e instanceof NetworkErrorException 52 | || e instanceof UnknownHostException) { 53 | onFailure(e, true); 54 | } else { 55 | onFailure(e, false); 56 | } 57 | } catch (Exception e1) { 58 | e1.printStackTrace(); 59 | } 60 | } 61 | 62 | @Override 63 | public void onComplete() { 64 | } 65 | 66 | /** 67 | * 返回成功 68 | * 69 | * @param t 70 | * @throws Exception 71 | */ 72 | protected abstract void onSuccees(T t) throws Exception; 73 | 74 | /** 75 | * 返回成功了,但是code错误 76 | * 77 | * @param t 78 | * @throws Exception 79 | */ 80 | protected void onCodeError(T t) throws Exception { 81 | onFailure(new Throwable(((BaseBean)t).getMessage()),false); 82 | } 83 | 84 | /** 85 | * 返回失败 86 | * 87 | * @param e 88 | * @param isNetWorkError 是否是网络错误 89 | * @throws Exception 90 | */ 91 | protected abstract void onFailure(Throwable e, boolean isNetWorkError) throws Exception; 92 | 93 | protected void onRequestStart() { 94 | } 95 | 96 | protected void onRequestEnd() { 97 | } 98 | 99 | 100 | } 101 | 102 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/base/BaseService.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.base; 2 | 3 | import android.app.Service; 4 | 5 | import io.reactivex.disposables.CompositeDisposable; 6 | import io.reactivex.disposables.Disposable; 7 | 8 | /** 9 | * Created by Zhouas666 on AndroidStudio 10 | * Date: 2019-01-08 11 | * Github: https://github.com/zas023 12 | */ 13 | public abstract class BaseService extends Service { 14 | 15 | private CompositeDisposable mDisposable; 16 | 17 | @Override 18 | public void onCreate() { 19 | super.onCreate(); 20 | } 21 | 22 | protected void addDisposable(Disposable disposable){ 23 | if (mDisposable == null){ 24 | mDisposable = new CompositeDisposable(); 25 | } 26 | mDisposable.add(disposable); 27 | } 28 | 29 | @Override 30 | public void onDestroy() { 31 | super.onDestroy(); 32 | if (mDisposable != null){ 33 | mDisposable.dispose(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/base/RxPresenter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.base; 2 | 3 | import io.reactivex.disposables.CompositeDisposable; 4 | import io.reactivex.disposables.Disposable; 5 | 6 | /** 7 | * Created by Zhouas666 on AndroidStudio 8 | * Date: 2019-01-08 9 | * Github: https://github.com/zas023 10 | */ 11 | public class RxPresenter implements BaseContract.BasePresenter { 12 | 13 | protected T mView; 14 | protected CompositeDisposable mDisposable; 15 | 16 | protected void unSubscribe() { 17 | if (mDisposable != null) mDisposable.dispose(); 18 | } 19 | 20 | protected void addDisposable(Disposable subscription) { 21 | if (mDisposable == null) mDisposable = new CompositeDisposable(); 22 | mDisposable.add(subscription); 23 | } 24 | 25 | @Override 26 | public void attachView(T view) { 27 | this.mView = view; 28 | } 29 | 30 | @Override 31 | public void detachView() { 32 | this.mView = null; 33 | unSubscribe(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/BaseBean.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean; 2 | 3 | /** 4 | * Created by zhouas666 on 2017/10/16 0016. 5 | * 通用javabean 6 | */ 7 | 8 | public class BaseBean { 9 | /** 10 | * status : 100 11 | * message : 成功! 12 | */ 13 | 14 | private int status; 15 | private String message; 16 | 17 | public int getStatus() { 18 | return status; 19 | } 20 | 21 | public void setStatus(int status) { 22 | this.status = status; 23 | } 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | 29 | public void setMessage(String message) { 30 | this.message = message; 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/local/BPay.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean.local; 2 | 3 | import org.greenrobot.greendao.annotation.Entity; 4 | import org.greenrobot.greendao.annotation.Generated; 5 | import org.greenrobot.greendao.annotation.Id; 6 | 7 | /** 8 | * 支付方式bean 9 | */ 10 | @Entity 11 | public class BPay { 12 | 13 | @Id 14 | private Long id; 15 | private String payName; 16 | private String payImg; 17 | 18 | private float income; 19 | private float outcome; 20 | 21 | @Generated(hash = 48271616) 22 | public BPay() { 23 | } 24 | 25 | @Generated(hash = 572465971) 26 | public BPay(Long id, String payName, String payImg, float income, 27 | float outcome) { 28 | this.id = id; 29 | this.payName = payName; 30 | this.payImg = payImg; 31 | this.income = income; 32 | this.outcome = outcome; 33 | } 34 | 35 | public String getPayName() { 36 | return payName; 37 | } 38 | 39 | public void setPayName(String payName) { 40 | this.payName = payName; 41 | } 42 | 43 | public String getPayImg() { 44 | return payImg; 45 | } 46 | 47 | public void setPayImg(String payImg) { 48 | this.payImg = payImg; 49 | } 50 | 51 | public float getIncome() { 52 | return income; 53 | } 54 | 55 | public void setIncome(float income) { 56 | this.income = income; 57 | } 58 | 59 | public float getOutcome() { 60 | return outcome; 61 | } 62 | 63 | public void setOutcome(float outcome) { 64 | this.outcome = outcome; 65 | } 66 | 67 | public Long getId() { 68 | return this.id; 69 | } 70 | 71 | public void setId(Long id) { 72 | this.id = id; 73 | } 74 | } -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/local/BSort.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean.local; 2 | 3 | import org.greenrobot.greendao.annotation.Entity; 4 | import org.greenrobot.greendao.annotation.Generated; 5 | import org.greenrobot.greendao.annotation.Id; 6 | 7 | /** 8 | * 账单分类bean 9 | */ 10 | @Entity 11 | public class BSort { 12 | 13 | @Id 14 | private Long id; 15 | private String sortName; 16 | private String sortImg; 17 | 18 | private int priority; 19 | 20 | private float cost; 21 | private Boolean income; 22 | 23 | @Generated(hash = 2092983496) 24 | public BSort() { 25 | } 26 | 27 | @Generated(hash = 442114462) 28 | public BSort(Long id, String sortName, String sortImg, int priority, float cost, 29 | Boolean income) { 30 | this.id = id; 31 | this.sortName = sortName; 32 | this.sortImg = sortImg; 33 | this.priority = priority; 34 | this.cost = cost; 35 | this.income = income; 36 | } 37 | 38 | public String getSortName() { 39 | return sortName; 40 | } 41 | 42 | public void setSortName(String sortName) { 43 | this.sortName = sortName; 44 | } 45 | 46 | public String getSortImg() { 47 | return sortImg; 48 | } 49 | 50 | public void setSortImg(String sortImg) { 51 | this.sortImg = sortImg; 52 | } 53 | 54 | public Boolean getIncome() { 55 | return income; 56 | } 57 | 58 | public void setIncome(Boolean income) { 59 | this.income = income; 60 | } 61 | 62 | public int getPriority() { 63 | return priority; 64 | } 65 | 66 | public void setPriority(int order) { 67 | this.priority = order; 68 | } 69 | 70 | public float getCost() { 71 | return cost; 72 | } 73 | 74 | public void setCost(float cost) { 75 | this.cost = cost; 76 | } 77 | 78 | public Long getId() { 79 | return this.id; 80 | } 81 | 82 | public void setId(Long id) { 83 | this.id = id; 84 | } 85 | } -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/local/MonthAccountBean.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean.local; 2 | 3 | import com.copasso.cocobill.model.bean.BaseBean; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 月账单报表信息 9 | */ 10 | public class MonthAccountBean extends BaseBean { 11 | 12 | float totalOut; //总支出 13 | float totalIn; //总收入 14 | List list; //账单分类统计支出 15 | 16 | public float getTotalOut() { 17 | return totalOut; 18 | } 19 | 20 | public void setTotalOut(float totalOut) { 21 | this.totalOut = totalOut; 22 | } 23 | 24 | public float getTotalIn() { 25 | return totalIn; 26 | } 27 | 28 | public void setTotalIn(float totalIn) { 29 | this.totalIn = totalIn; 30 | } 31 | 32 | public List getList() { 33 | return list; 34 | } 35 | 36 | public void setList(List list) { 37 | this.list = list; 38 | } 39 | 40 | public static class PayTypeListBean { 41 | String payName; 42 | String payImg; 43 | float outcome; 44 | float income; 45 | List Bills; 46 | 47 | public String getPayName() { 48 | return payName; 49 | } 50 | 51 | public void setPayName(String payName) { 52 | this.payName = payName; 53 | } 54 | 55 | public String getPayImg() { 56 | return payImg; 57 | } 58 | 59 | public void setPayImg(String payImg) { 60 | this.payImg = payImg; 61 | } 62 | 63 | public float getOutcome() { 64 | return outcome; 65 | } 66 | 67 | public void setOutcome(float outcome) { 68 | this.outcome = outcome; 69 | } 70 | 71 | public float getIncome() { 72 | return income; 73 | } 74 | 75 | public void setIncome(float income) { 76 | this.income = income; 77 | } 78 | 79 | public List getBills() { 80 | return Bills; 81 | } 82 | 83 | public void setBills(List bills) { 84 | Bills = bills; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/local/MonthChartBean.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean.local; 2 | 3 | import com.copasso.cocobill.model.bean.BaseBean; 4 | 5 | import java.util.List; 6 | 7 | public class MonthChartBean extends BaseBean { 8 | float totalOut; //总支出 9 | float totalIn; //总收入 10 | List outSortlist; //账单分类统计支出 11 | List inSortlist; //账单分类统计收入 12 | 13 | public float getTotalOut() { 14 | return totalOut; 15 | } 16 | 17 | public void setTotalOut(float totalOut) { 18 | this.totalOut = totalOut; 19 | } 20 | 21 | public float getTotalIn() { 22 | return totalIn; 23 | } 24 | 25 | public void setTotalIn(float totalIn) { 26 | this.totalIn = totalIn; 27 | } 28 | 29 | public List getOutSortlist() { 30 | return outSortlist; 31 | } 32 | 33 | public void setOutSortlist(List outSortlist) { 34 | this.outSortlist = outSortlist; 35 | } 36 | 37 | public List getInSortlist() { 38 | return inSortlist; 39 | } 40 | 41 | public void setInSortlist(List inSortlist) { 42 | this.inSortlist = inSortlist; 43 | } 44 | 45 | public static class SortTypeList { 46 | private String back_color; 47 | private float money; //此分类下的当月总收支 48 | private String sortName; //此分类 49 | private String sortImg; 50 | private List list; //此分类下的当月账单 51 | 52 | public String getBack_color() { 53 | return back_color; 54 | } 55 | 56 | public void setBack_color(String back_color) { 57 | this.back_color = back_color; 58 | } 59 | 60 | public float getMoney() { 61 | return money; 62 | } 63 | 64 | public void setMoney(float money) { 65 | this.money = money; 66 | } 67 | 68 | public List getList() { 69 | return list; 70 | } 71 | 72 | public void setList(List list) { 73 | this.list = list; 74 | } 75 | 76 | public String getSortName() { 77 | return sortName; 78 | } 79 | 80 | public void setSortName(String sortName) { 81 | this.sortName = sortName; 82 | } 83 | 84 | public String getSortImg() { 85 | return sortImg; 86 | } 87 | 88 | public void setSortImg(String sortImg) { 89 | this.sortImg = sortImg; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/local/MonthListBean.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean.local; 2 | 3 | import com.copasso.cocobill.model.bean.BaseBean; 4 | 5 | import java.util.List; 6 | 7 | public class MonthListBean extends BaseBean { 8 | 9 | private String t_income; 10 | private String t_outcome; 11 | private String t_total; 12 | private List daylist; 13 | 14 | public String getT_income() { 15 | return t_income; 16 | } 17 | 18 | public void setT_income(String t_income) { 19 | this.t_income = t_income; 20 | } 21 | 22 | public String getT_outcome() { 23 | return t_outcome; 24 | } 25 | 26 | public void setT_outcome(String t_outcome) { 27 | this.t_outcome = t_outcome; 28 | } 29 | 30 | public String getT_total() { 31 | return t_total; 32 | } 33 | 34 | public void setT_total(String t_total) { 35 | this.t_total = t_total; 36 | } 37 | 38 | public List getDaylist() { 39 | return daylist; 40 | } 41 | 42 | public void setDaylist(List daylist) { 43 | this.daylist = daylist; 44 | } 45 | 46 | public static class DaylistBean { 47 | 48 | private String time; 49 | private String money; 50 | private List list; 51 | 52 | public String getTime() { 53 | return time; 54 | } 55 | 56 | public void setTime(String time) { 57 | this.time = time; 58 | } 59 | 60 | public String getMoney() { 61 | return money; 62 | } 63 | 64 | public void setMoney(String money) { 65 | this.money = money; 66 | } 67 | 68 | public List getList() { 69 | return list; 70 | } 71 | 72 | public void setList(List list) { 73 | this.list = list; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/local/NoteBean.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean.local; 2 | 3 | import com.copasso.cocobill.model.bean.BaseBean; 4 | 5 | import java.util.List; 6 | 7 | public class NoteBean extends BaseBean { 8 | 9 | private List outSortlis; 10 | private List inSortlis; 11 | private List payinfo; 12 | 13 | public List getOutSortlis() { 14 | return outSortlis; 15 | } 16 | 17 | public void setOutSortlis(List outSortlis) { 18 | this.outSortlis = outSortlis; 19 | } 20 | 21 | public List getInSortlis() { 22 | return inSortlis; 23 | } 24 | 25 | public void setInSortlis(List inSortlis) { 26 | this.inSortlis = inSortlis; 27 | } 28 | 29 | public List getPayinfo() { 30 | return payinfo; 31 | } 32 | 33 | public void setPayinfo(List payinfo) { 34 | this.payinfo = payinfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/bean/remote/MyUser.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.bean.remote; 2 | 3 | import cn.bmob.v3.BmobUser; 4 | 5 | public class MyUser extends BmobUser { 6 | 7 | private String image; 8 | 9 | private String gender; 10 | 11 | private String age; 12 | 13 | public String getImage() { 14 | return image; 15 | } 16 | 17 | public void setImage(String image) { 18 | this.image = image; 19 | } 20 | 21 | public String getGender() { 22 | return gender; 23 | } 24 | 25 | public void setGender(String gender) { 26 | this.gender = gender; 27 | } 28 | 29 | public String getAge() { 30 | return age; 31 | } 32 | 33 | public void setAge(String age) { 34 | this.age = age; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/event/SyncEvent.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.event; 2 | 3 | public class SyncEvent { 4 | 5 | /** 6 | * state : 100 7 | * message : 成功! 8 | */ 9 | 10 | private int state; 11 | private String message; 12 | 13 | SyncEvent(){ 14 | 15 | } 16 | 17 | public SyncEvent(int state) { 18 | this.state = state; 19 | } 20 | 21 | public SyncEvent(int state, String message) { 22 | this.state = state; 23 | this.message = message; 24 | } 25 | 26 | public int getState() { 27 | return state; 28 | } 29 | 30 | public void setState(int state) { 31 | this.state = state; 32 | } 33 | 34 | public String getMessage() { 35 | return message; 36 | } 37 | 38 | public void setMessage(String message) { 39 | this.message = message; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/gen/DaoSession.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.gen; 2 | 3 | import java.util.Map; 4 | 5 | import org.greenrobot.greendao.AbstractDao; 6 | import org.greenrobot.greendao.AbstractDaoSession; 7 | import org.greenrobot.greendao.database.Database; 8 | import org.greenrobot.greendao.identityscope.IdentityScopeType; 9 | import org.greenrobot.greendao.internal.DaoConfig; 10 | 11 | import com.copasso.cocobill.model.bean.local.BBill; 12 | import com.copasso.cocobill.model.bean.local.BPay; 13 | import com.copasso.cocobill.model.bean.local.BSort; 14 | 15 | import com.copasso.cocobill.model.gen.BBillDao; 16 | import com.copasso.cocobill.model.gen.BPayDao; 17 | import com.copasso.cocobill.model.gen.BSortDao; 18 | 19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 20 | 21 | /** 22 | * {@inheritDoc} 23 | * 24 | * @see org.greenrobot.greendao.AbstractDaoSession 25 | */ 26 | public class DaoSession extends AbstractDaoSession { 27 | 28 | private final DaoConfig bBillDaoConfig; 29 | private final DaoConfig bPayDaoConfig; 30 | private final DaoConfig bSortDaoConfig; 31 | 32 | private final BBillDao bBillDao; 33 | private final BPayDao bPayDao; 34 | private final BSortDao bSortDao; 35 | 36 | public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> 37 | daoConfigMap) { 38 | super(db); 39 | 40 | bBillDaoConfig = daoConfigMap.get(BBillDao.class).clone(); 41 | bBillDaoConfig.initIdentityScope(type); 42 | 43 | bPayDaoConfig = daoConfigMap.get(BPayDao.class).clone(); 44 | bPayDaoConfig.initIdentityScope(type); 45 | 46 | bSortDaoConfig = daoConfigMap.get(BSortDao.class).clone(); 47 | bSortDaoConfig.initIdentityScope(type); 48 | 49 | bBillDao = new BBillDao(bBillDaoConfig, this); 50 | bPayDao = new BPayDao(bPayDaoConfig, this); 51 | bSortDao = new BSortDao(bSortDaoConfig, this); 52 | 53 | registerDao(BBill.class, bBillDao); 54 | registerDao(BPay.class, bPayDao); 55 | registerDao(BSort.class, bSortDao); 56 | } 57 | 58 | public void clear() { 59 | bBillDaoConfig.clearIdentityScope(); 60 | bPayDaoConfig.clearIdentityScope(); 61 | bSortDaoConfig.clearIdentityScope(); 62 | } 63 | 64 | public BBillDao getBBillDao() { 65 | return bBillDao; 66 | } 67 | 68 | public BPayDao getBPayDao() { 69 | return bPayDao; 70 | } 71 | 72 | public BSortDao getBSortDao() { 73 | return bSortDao; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/model/repository/DaoDbHelper.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.model.repository; 2 | 3 | import android.database.sqlite.SQLiteDatabase; 4 | 5 | import com.copasso.cocobill.MyApplication; 6 | import com.copasso.cocobill.model.gen.DaoMaster; 7 | import com.copasso.cocobill.model.gen.DaoSession; 8 | 9 | public class DaoDbHelper { 10 | private static final String DB_NAME = "CocoBill_DB"; 11 | 12 | private static volatile DaoDbHelper sInstance; 13 | private SQLiteDatabase mDb; 14 | private DaoMaster mDaoMaster; 15 | private DaoSession mSession; 16 | 17 | private DaoDbHelper(){ 18 | //封装数据库的创建、更新、删除 19 | DaoMaster.DevOpenHelper openHelper = new DaoMaster.DevOpenHelper(MyApplication.getContext(),DB_NAME,null); 20 | //获取数据库 21 | mDb = openHelper.getWritableDatabase(); 22 | //封装数据库中表的创建、更新、删除 23 | mDaoMaster = new DaoMaster(mDb); //合起来就是对数据库的操作 24 | //对表操作的对象。 25 | mSession = mDaoMaster.newSession(); //可以认为是对数据的操作 26 | } 27 | 28 | 29 | public static DaoDbHelper getInstance(){ 30 | if (sInstance == null){ 31 | synchronized (DaoDbHelper.class){ 32 | if (sInstance == null){ 33 | sInstance = new DaoDbHelper(); 34 | } 35 | } 36 | } 37 | return sInstance; 38 | } 39 | 40 | public DaoSession getSession(){ 41 | return mSession; 42 | } 43 | 44 | public SQLiteDatabase getDatabase(){ 45 | return mDb; 46 | } 47 | 48 | public DaoSession getNewSession(){ 49 | return mDaoMaster.newSession(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/BillNotePresenter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter; 2 | 3 | import com.copasso.cocobill.base.RxPresenter; 4 | import com.copasso.cocobill.model.bean.local.BSort; 5 | import com.copasso.cocobill.model.repository.LocalRepository; 6 | import com.copasso.cocobill.presenter.contract.BillNoteContract; 7 | 8 | import java.util.List; 9 | 10 | 11 | /** 12 | * Created by Zhouas666 on 2019-01-08 13 | * Github: https://github.com/zas023 14 | */ 15 | public class BillNotePresenter extends RxPresenter implements BillNoteContract.Presenter { 16 | 17 | private String TAG = "BillNotePresenter"; 18 | 19 | @Override 20 | public void getBillNote() { 21 | //此处采用同步的方式,防止账单分类出现白块 22 | mView.loadDataSuccess(LocalRepository.getInstance().getBillNote()); 23 | } 24 | 25 | @Override 26 | public void updateBBsorts(List items) { 27 | LocalRepository.getInstance().updateBSoers(items); 28 | mView.onSuccess(); 29 | } 30 | 31 | @Override 32 | public void addBSort(BSort bSort) { 33 | LocalRepository.getInstance().saveBSort(bSort); 34 | mView.onSuccess(); 35 | } 36 | 37 | @Override 38 | public void deleteBSortByID(Long id) { 39 | LocalRepository.getInstance().deleteBSortById(id); 40 | mView.onSuccess(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/BillPresenter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter; 2 | 3 | 4 | import com.copasso.cocobill.base.BaseObserver; 5 | import com.copasso.cocobill.base.RxPresenter; 6 | import com.copasso.cocobill.model.bean.local.BBill; 7 | import com.copasso.cocobill.model.repository.LocalRepository; 8 | import com.copasso.cocobill.presenter.contract.BillContract; 9 | 10 | import io.reactivex.android.schedulers.AndroidSchedulers; 11 | import io.reactivex.schedulers.Schedulers; 12 | 13 | /** 14 | * Created by Zhouas666 on 2019-01-08 15 | * Github: https://github.com/zas023 16 | */ 17 | public class BillPresenter extends RxPresenter implements BillContract.Presenter { 18 | 19 | private String TAG = "BillPresenter"; 20 | 21 | @Override 22 | public void getBillNote() { 23 | //此处采用同步的方式,防止账单分类出现白块 24 | mView.loadDataSuccess(LocalRepository.getInstance().getBillNote()); 25 | } 26 | 27 | @Override 28 | public void addBill(BBill bBill) { 29 | LocalRepository.getInstance().saveBBill(bBill) 30 | .subscribeOn(Schedulers.io()) 31 | .observeOn(AndroidSchedulers.mainThread()) 32 | .subscribe(new BaseObserver() { 33 | @Override 34 | protected void onSuccees(BBill bBill) throws Exception { 35 | mView.onSuccess(); 36 | } 37 | 38 | @Override 39 | protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception { 40 | mView.onFailure(e); 41 | } 42 | }); 43 | } 44 | 45 | @Override 46 | public void updateBill(BBill bBill) { 47 | LocalRepository.getInstance() 48 | .updateBBill(bBill) 49 | .subscribeOn(Schedulers.io()) 50 | .observeOn(AndroidSchedulers.mainThread()) 51 | .subscribe(new BaseObserver() { 52 | @Override 53 | protected void onSuccees(BBill bBill) throws Exception { 54 | mView.onSuccess(); 55 | } 56 | 57 | @Override 58 | protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception { 59 | mView.onFailure(e); 60 | } 61 | }); 62 | } 63 | 64 | @Override 65 | public void deleteBillById(Long id) { 66 | LocalRepository.getInstance() 67 | .deleteBBillById(id); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/LandPresenter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter; 2 | 3 | 4 | import android.util.Log; 5 | 6 | import com.copasso.cocobill.base.RxPresenter; 7 | import com.copasso.cocobill.model.bean.remote.MyUser; 8 | import com.copasso.cocobill.presenter.contract.LandContract; 9 | 10 | import cn.bmob.v3.exception.BmobException; 11 | import cn.bmob.v3.listener.LogInListener; 12 | import cn.bmob.v3.listener.SaveListener; 13 | 14 | /** 15 | * Created by Zhouas666 on 2019-01-08 16 | * Github: https://github.com/zas023 17 | */ 18 | public class LandPresenter extends RxPresenter implements LandContract.Presenter{ 19 | 20 | private String TAG="LandPresenter"; 21 | 22 | @Override 23 | public void login(String username, String password) { 24 | MyUser.loginByAccount(username, password, new LogInListener() { 25 | @Override 26 | public void done(MyUser myUser, BmobException e) { 27 | if(e==null) 28 | mView.landSuccess(myUser); 29 | else 30 | mView.onFailure(e); 31 | } 32 | }); 33 | } 34 | 35 | @Override 36 | public void signup(String username, String password, String mail) { 37 | MyUser myUser =new MyUser(); 38 | myUser.setUsername(username); 39 | myUser.setPassword(password); 40 | myUser.setEmail(mail); 41 | 42 | myUser.signUp(new SaveListener() { 43 | @Override 44 | public void done(MyUser myUser, BmobException e) { 45 | if(e==null) 46 | mView.landSuccess(myUser); 47 | else 48 | mView.onFailure(e); 49 | } 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/MonthChartPresenter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter; 2 | 3 | import com.copasso.cocobill.base.BaseObserver; 4 | import com.copasso.cocobill.base.RxPresenter; 5 | import com.copasso.cocobill.model.bean.local.BBill; 6 | import com.copasso.cocobill.model.repository.LocalRepository; 7 | import com.copasso.cocobill.presenter.contract.MonthChartContract; 8 | import com.copasso.cocobill.utils.BillUtils; 9 | 10 | import java.util.List; 11 | 12 | import io.reactivex.android.schedulers.AndroidSchedulers; 13 | import io.reactivex.schedulers.Schedulers; 14 | 15 | /** 16 | * Created by Zhouas666 on 2019-01-08 17 | * Github: https://github.com/zas023 18 | */ 19 | public class MonthChartPresenter extends RxPresenter implements MonthChartContract.Presenter{ 20 | 21 | private String TAG="MonthChartPresenter"; 22 | 23 | @Override 24 | public void getMonthChart(String id, String year, String month) { 25 | LocalRepository.getInstance().getBBillByUserIdWithYM(id, year, month) 26 | .subscribeOn(Schedulers.io()) 27 | .observeOn(AndroidSchedulers.mainThread()) 28 | .subscribe(new BaseObserver>() { 29 | @Override 30 | protected void onSuccees(List bBills) throws Exception { 31 | mView.loadDataSuccess(BillUtils.packageChartList(bBills)); 32 | } 33 | 34 | @Override 35 | protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception { 36 | mView.onFailure(e); 37 | } 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/MonthListPresenter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter; 2 | 3 | 4 | import com.copasso.cocobill.base.BaseObserver; 5 | import com.copasso.cocobill.base.RxPresenter; 6 | import com.copasso.cocobill.model.bean.BaseBean; 7 | import com.copasso.cocobill.model.bean.local.BBill; 8 | import com.copasso.cocobill.model.bean.remote.MyUser; 9 | import com.copasso.cocobill.model.repository.LocalRepository; 10 | import com.copasso.cocobill.presenter.contract.LandContract; 11 | import com.copasso.cocobill.presenter.contract.MonthListContract; 12 | import com.copasso.cocobill.utils.BillUtils; 13 | 14 | import java.util.List; 15 | 16 | import cn.bmob.v3.exception.BmobException; 17 | import cn.bmob.v3.listener.LogInListener; 18 | import cn.bmob.v3.listener.SaveListener; 19 | import io.reactivex.android.schedulers.AndroidSchedulers; 20 | import io.reactivex.schedulers.Schedulers; 21 | 22 | /** 23 | * Created by Zhouas666 on 2019-01-08 24 | * Github: https://github.com/zas023 25 | */ 26 | public class MonthListPresenter extends RxPresenter implements MonthListContract.Presenter{ 27 | 28 | private String TAG="MonthListPresenter"; 29 | 30 | @Override 31 | public void getMonthList(String id, String year, String month) { 32 | LocalRepository.getInstance().getBBillByUserIdWithYM(id, year, month) 33 | .subscribeOn(Schedulers.io()) 34 | .observeOn(AndroidSchedulers.mainThread()) 35 | .subscribe(new BaseObserver>() { 36 | @Override 37 | protected void onSuccees(List bBills) throws Exception { 38 | mView.loadDataSuccess(BillUtils.packageDetailList(bBills)); 39 | } 40 | 41 | @Override 42 | protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception { 43 | mView.onFailure(e); 44 | } 45 | }); 46 | } 47 | 48 | @Override 49 | public void deleteBill(Long id) { 50 | LocalRepository.getInstance().deleteBBillById(id) 51 | .subscribeOn(Schedulers.io()) 52 | .observeOn(AndroidSchedulers.mainThread()) 53 | .subscribe(new BaseObserver() { 54 | @Override 55 | protected void onSuccees(Long l) throws Exception { 56 | mView.onSuccess(); 57 | } 58 | 59 | @Override 60 | protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception { 61 | mView.onFailure(e); 62 | } 63 | }); 64 | } 65 | 66 | @Override 67 | public void updateBill(BBill bBill) { 68 | LocalRepository.getInstance() 69 | .updateBBill(bBill) 70 | .subscribeOn(Schedulers.io()) 71 | .observeOn(AndroidSchedulers.mainThread()) 72 | .subscribe(new BaseObserver() { 73 | @Override 74 | protected void onSuccees(BBill bBill) throws Exception { 75 | mView.onSuccess(); 76 | } 77 | 78 | @Override 79 | protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception { 80 | mView.onFailure(e); 81 | } 82 | }); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/UserInfoPresenter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter; 2 | 3 | 4 | import com.copasso.cocobill.base.RxPresenter; 5 | import com.copasso.cocobill.model.bean.remote.MyUser; 6 | import com.copasso.cocobill.presenter.contract.UserInfoContract; 7 | 8 | import cn.bmob.v3.exception.BmobException; 9 | import cn.bmob.v3.listener.UpdateListener; 10 | 11 | /** 12 | * Created by Zhouas666 on 2019-01-08 13 | * Github: https://github.com/zas023 14 | */ 15 | public class UserInfoPresenter extends RxPresenter 16 | implements UserInfoContract.Presenter { 17 | 18 | private String TAG = "UserInfoPresenter"; 19 | 20 | @Override 21 | public void updateUser(MyUser user) { 22 | user.update(user.getObjectId(), new UpdateListener() { 23 | @Override 24 | public void done(BmobException e) { 25 | if (e == null) 26 | mView.onSuccess(); 27 | else 28 | mView.onFailure(e); 29 | } 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/contract/BillContract.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter.contract; 2 | 3 | import com.copasso.cocobill.base.BaseContract; 4 | import com.copasso.cocobill.model.bean.local.BBill; 5 | import com.copasso.cocobill.model.bean.local.NoteBean; 6 | 7 | /** 8 | * Created by Zhouas666 on 2019-01-08 9 | * Github: https://github.com/zas023 10 | */ 11 | public interface BillContract extends BaseContract { 12 | 13 | interface View extends BaseView { 14 | 15 | void loadDataSuccess(NoteBean bean); 16 | 17 | } 18 | 19 | interface Presenter extends BasePresenter{ 20 | /** 21 | * 获取信息 22 | */ 23 | void getBillNote(); 24 | 25 | /** 26 | * 添加账单 27 | */ 28 | void addBill(BBill bBill); 29 | 30 | /** 31 | * 修改账单 32 | */ 33 | void updateBill(BBill bBill); 34 | 35 | 36 | /** 37 | * 删除账单 38 | */ 39 | void deleteBillById(Long id); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/contract/BillNoteContract.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter.contract; 2 | 3 | import com.copasso.cocobill.base.BaseContract; 4 | import com.copasso.cocobill.model.bean.local.BSort; 5 | import com.copasso.cocobill.model.bean.local.NoteBean; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Zhouas666 on 2019-01-08 11 | * Github: https://github.com/zas023 12 | */ 13 | public interface BillNoteContract extends BaseContract { 14 | 15 | interface View extends BaseView { 16 | 17 | void loadDataSuccess(NoteBean bean); 18 | 19 | } 20 | 21 | interface Presenter extends BasePresenter{ 22 | /** 23 | * 获取信息 24 | */ 25 | void getBillNote(); 26 | 27 | void updateBBsorts(List items); 28 | 29 | void addBSort(BSort bSort); 30 | void deleteBSortByID(Long id); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/contract/LandContract.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter.contract; 2 | 3 | import com.copasso.cocobill.base.BaseContract; 4 | import com.copasso.cocobill.model.bean.remote.MyUser; 5 | 6 | /** 7 | * Created by Zhouas666 on 2019-01-08 8 | * Github: https://github.com/zas023 9 | */ 10 | public interface LandContract extends BaseContract { 11 | 12 | interface View extends BaseContract.BaseView { 13 | 14 | void landSuccess(MyUser user); 15 | 16 | } 17 | 18 | interface Presenter extends BaseContract.BasePresenter{ 19 | /** 20 | * 用户登陆 21 | */ 22 | void login(String username, String password); 23 | 24 | /** 25 | * 用户注册 26 | */ 27 | void signup(String username, String password, String mail); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/contract/MonthChartContract.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter.contract; 2 | 3 | import com.copasso.cocobill.base.BaseContract; 4 | import com.copasso.cocobill.model.bean.local.MonthChartBean; 5 | 6 | /** 7 | * Created by Zhouas666 on 2019-01-08 8 | * Github: https://github.com/zas023 9 | */ 10 | public interface MonthChartContract extends BaseContract { 11 | 12 | interface View extends BaseView { 13 | 14 | void loadDataSuccess(MonthChartBean bean); 15 | 16 | } 17 | 18 | interface Presenter extends BasePresenter { 19 | 20 | void getMonthChart(String id, String year, String month); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/contract/MonthListContract.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter.contract; 2 | 3 | import com.copasso.cocobill.base.BaseContract; 4 | import com.copasso.cocobill.model.bean.local.BBill; 5 | import com.copasso.cocobill.model.bean.local.MonthListBean; 6 | 7 | /** 8 | * Created by Zhouas666 on 2019-01-08 9 | * Github: https://github.com/zas023 10 | */ 11 | public interface MonthListContract extends BaseContract { 12 | 13 | interface View extends BaseContract.BaseView { 14 | 15 | void loadDataSuccess(MonthListBean list); 16 | 17 | } 18 | 19 | interface Presenter extends BaseContract.BasePresenter { 20 | 21 | void getMonthList(String id, String year, String month); 22 | 23 | void deleteBill(Long id); 24 | 25 | void updateBill(BBill bBill); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/presenter/contract/UserInfoContract.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.presenter.contract; 2 | 3 | import com.copasso.cocobill.base.BaseContract; 4 | import com.copasso.cocobill.model.bean.remote.MyUser; 5 | 6 | /** 7 | * Created by Zhouas666 on 2019-01-08 8 | * Github: https://github.com/zas023 9 | */ 10 | public interface UserInfoContract extends BaseContract { 11 | 12 | interface View extends BaseView { 13 | 14 | } 15 | 16 | interface Presenter extends BasePresenter{ 17 | /** 18 | * 更新用户信息 19 | */ 20 | void updateUser(MyUser user); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/ui/activity/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.ui.activity; 2 | 3 | import android.widget.ImageView; 4 | import android.widget.TextView; 5 | 6 | import com.copasso.cocobill.BuildConfig; 7 | import com.copasso.cocobill.R; 8 | 9 | import androidx.annotation.NonNull; 10 | import me.drakeet.multitype.Items; 11 | import me.drakeet.support.about.AbsAboutActivity; 12 | import me.drakeet.support.about.Card; 13 | import me.drakeet.support.about.Category; 14 | import me.drakeet.support.about.Contributor; 15 | import me.drakeet.support.about.License; 16 | 17 | /** 18 | * Created by Zhouas666 on 2019-01-10 19 | * Github: https://github.com/zas023 20 | *

21 | * 关于activity 22 | */ 23 | public class AboutActivity extends AbsAboutActivity { 24 | @Override 25 | protected void onCreateHeader(@NonNull ImageView icon, @NonNull TextView slogan, @NonNull TextView version) { 26 | icon.setImageResource(R.mipmap.ic_launcher); 27 | slogan.setText("CocoBill"); 28 | version.setText("v " + BuildConfig.VERSION_NAME); 29 | } 30 | 31 | @Override 32 | protected void onItemsCreated(@NonNull Items items) { 33 | items.add(new Category("About and Help")); 34 | items.add(new Card(getString(R.string.about_introduce))); 35 | 36 | items.add(new Category("Developers")); 37 | items.add(new Contributor(R.mipmap.avatar_zhouas666, "zhouas666", "Developer & designer", "https://github.com/zas023")); 38 | 39 | items.add(new Category("Open Source Licenses")); 40 | items.add(new License("Glide", "bumptech", License.APACHE_2, "com.github.bumptech.glide:glide:4.8.0")); 41 | items.add(new License("MPAndroidChart", "PhilJay", License.APACHE_2, "com.github.PhilJay:MPAndroidChart:v3.1.0-alpha")); 42 | items.add(new License("MultiType", "drakeet", License.APACHE_2, "https://github.com/drakeet/MultiType")); 43 | items.add(new License("About-page", "drakeet", License.APACHE_2, "https://github.com/drakeet/about-page")); 44 | items.add(new License("Dialogs", "afollestad", License.APACHE_2, "com.afollestad.material-dialogs:core:0.9.6.0")); 45 | items.add(new License("PickerView", "contrarywind", License.APACHE_2, "com.contrarywind:Android-PickerView:4.1.6")); 46 | items.add(new License("Greenrobot", "greenrobot", License.APACHE_2, "org.greenrobot:greendao:3.2.2")); 47 | items.add(new License("Greenrobot", "greenrobot", License.APACHE_2, "org.greenrobot:eventbus:3.1.1")); 48 | items.add(new License("Bmob", "bmob", License.APACHE_2, "cn.bmob.android:bmob-sdk:3.6.8-rc7")); 49 | items.add(new License("RxJava", "reactivex", License.APACHE_2, "io.reactivex.rxjava2:rxjava:2.2.2")); 50 | items.add(new License("RxAndroid", "reactivex", License.APACHE_2, "io.reactivex.rxjava2:rxandroid:2.1.0")); 51 | items.add(new License("OkIO", "squareup", License.APACHE_2, "com.squareup.okio:okio:2.1.0")); 52 | items.add(new License("OkHttp", "squareup", License.APACHE_2, "com.squareup.okhttp3:okhttp:3.12.0")); 53 | items.add(new License("Gson", "google", License.APACHE_2, "com.google.code.gson:gson:2.8.5")); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/ui/adapter/BillSortAdapter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.ui.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.ImageView; 8 | import android.widget.TextView; 9 | 10 | import com.bumptech.glide.Glide; 11 | import com.copasso.cocobill.R; 12 | import com.copasso.cocobill.common.Constants; 13 | import com.copasso.cocobill.model.bean.local.BSort; 14 | import com.copasso.cocobill.utils.ImageUtils; 15 | 16 | import java.util.List; 17 | 18 | import androidx.recyclerview.widget.RecyclerView; 19 | 20 | /** 21 | * Created by zhouas666 on 2017/12/30. 22 | */ 23 | public class BillSortAdapter extends RecyclerView.Adapter { 24 | 25 | private Context mContext; 26 | private List mData; 27 | 28 | public BillSortAdapter(Context mContext, List mData) { 29 | this.mContext = mContext; 30 | this.mData = mData; 31 | } 32 | 33 | public void setItems(List items){ 34 | this.mData=items; 35 | } 36 | 37 | @Override 38 | public MyItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 39 | View view = LayoutInflater.from(mContext).inflate(R.layout.item_recycler_note_sort, parent, false); 40 | return new MyItemViewHolder(view); 41 | } 42 | 43 | @Override 44 | public void onBindViewHolder(MyItemViewHolder holder, int position) { 45 | holder.item_name.setText(mData.get(position).getSortName()); 46 | holder.item_img.setImageDrawable(ImageUtils.getDrawable(mData.get(position).getSortImg())); 47 | } 48 | 49 | @Override 50 | public int getItemCount() { 51 | if (mData == null) 52 | return 0; 53 | return mData.size(); 54 | } 55 | 56 | public static class MyItemViewHolder extends RecyclerView.ViewHolder { 57 | TextView item_name; 58 | ImageView item_img; 59 | 60 | MyItemViewHolder(View view) { 61 | super(view); 62 | item_img = view.findViewById(R.id.item_note_edit_iv); 63 | item_name = view.findViewById(R.id.item_note_edit_tv); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/ui/adapter/BookNoteAdapter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.ui.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.ImageView; 7 | import android.widget.TextView; 8 | 9 | import com.copasso.cocobill.R; 10 | import com.copasso.cocobill.model.bean.local.BSort; 11 | import com.copasso.cocobill.ui.activity.BillAddActivity; 12 | import com.copasso.cocobill.utils.ImageUtils; 13 | 14 | import java.util.List; 15 | 16 | import androidx.recyclerview.widget.RecyclerView; 17 | 18 | /** 19 | * 账单分类Adapter(AddBillAdapter) 20 | */ 21 | public class BookNoteAdapter extends RecyclerView.Adapter { 22 | 23 | private BillAddActivity mContext; 24 | private LayoutInflater mInflater; 25 | private List mDatas; 26 | 27 | private OnBookNoteClickListener onBookNoteClickListener; 28 | 29 | public void setmDatas(List mDatas) { 30 | this.mDatas = mDatas; 31 | } 32 | 33 | public BookNoteAdapter(BillAddActivity context, List datas) { 34 | this.mContext = context; 35 | this.mInflater = LayoutInflater.from(context); 36 | this.mDatas = datas; 37 | 38 | } 39 | 40 | public void setOnBookNoteClickListener(OnBookNoteClickListener listener) { 41 | if (onBookNoteClickListener == null) 42 | this.onBookNoteClickListener = listener; 43 | } 44 | 45 | @Override 46 | public int getItemCount() { 47 | return (mDatas == null) ? 0 : mDatas.size(); 48 | } 49 | 50 | @Override 51 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 52 | View view = mInflater.inflate(R.layout.item_tb_type, parent, false); 53 | return new ViewHolder(view); 54 | } 55 | 56 | @Override 57 | public void onBindViewHolder(ViewHolder holder, final int position) { 58 | holder.title.setText(mDatas.get(position).getSortName()); 59 | holder.img.setImageDrawable(ImageUtils.getDrawable(mDatas.get(position).getSortImg())); 60 | } 61 | 62 | class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { 63 | 64 | private TextView title; 65 | private ImageView img; 66 | 67 | public ViewHolder(View view) { 68 | super(view); 69 | 70 | title = (TextView) view.findViewById(R.id.item_tb_type_tv); 71 | img = (ImageView) view.findViewById(R.id.item_tb_type_img); 72 | itemView.setOnClickListener(this); 73 | itemView.setOnLongClickListener(this); 74 | } 75 | 76 | @Override 77 | public void onClick(View view) { 78 | onBookNoteClickListener.OnClick(getAdapterPosition()); 79 | } 80 | 81 | @Override 82 | public boolean onLongClick(View view) { 83 | onBookNoteClickListener.OnLongClick(getAdapterPosition()); 84 | return false; 85 | } 86 | } 87 | 88 | /** 89 | * 自定义分类选择接口 90 | */ 91 | public interface OnBookNoteClickListener { 92 | void OnClick(int index); 93 | 94 | void OnLongClick(int index); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/ui/adapter/MainFragmentPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.ui.adapter; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import androidx.fragment.app.Fragment; 7 | import androidx.fragment.app.FragmentManager; 8 | import androidx.fragment.app.FragmentPagerAdapter; 9 | 10 | /** 11 | * Created by Zhouas666 on 2019-01-08 12 | * Github: https://github.com/zas023 13 | * 14 | * 主布局中FragmentPagerAdapter 15 | */ 16 | public class MainFragmentPagerAdapter extends FragmentPagerAdapter { 17 | 18 | private List mFragments ;//添加的Fragment的集合 19 | private List mFragmentsTitles ;//每个Fragment对应的title的集合 20 | 21 | public MainFragmentPagerAdapter(FragmentManager fm) { 22 | super(fm); 23 | mFragments = new ArrayList<>(); 24 | mFragmentsTitles = new ArrayList<>(); 25 | } 26 | /** 27 | * @param fragment 添加Fragment 28 | * @param fragmentTitle Fragment的标题,即TabLayout中对应Tab的标题 29 | */ 30 | public void addFragment(Fragment fragment, String fragmentTitle) { 31 | mFragments.add(fragment); 32 | mFragmentsTitles.add(fragmentTitle); 33 | } 34 | 35 | /** 36 | * 更新 37 | * @param index 38 | * @param fragment 39 | * @param fragmentTitle 40 | */ 41 | public void updateFragment(int index,Fragment fragment, String fragmentTitle) { 42 | mFragments.remove(index); 43 | mFragments.add(index,fragment); 44 | mFragmentsTitles.add(fragmentTitle); 45 | 46 | notifyDataSetChanged(); 47 | } 48 | 49 | @Override 50 | public Fragment getItem(int position) { 51 | //得到对应position的Fragment 52 | return mFragments.get(position); 53 | } 54 | 55 | @Override 56 | public int getCount() { 57 | //返回Fragment的数量 58 | return mFragments.size(); 59 | } 60 | 61 | @Override 62 | public CharSequence getPageTitle(int position) { 63 | //得到对应position的Fragment的title 64 | return mFragmentsTitles.get(position); 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/ui/adapter/MonthAccountAdapter.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.ui.adapter; 2 | 3 | import android.view.View; 4 | import android.view.ViewGroup; 5 | 6 | import java.util.List; 7 | 8 | import androidx.viewpager.widget.PagerAdapter; 9 | 10 | /** 11 | * AccountFragment 12 | */ 13 | public class MonthAccountAdapter extends PagerAdapter { 14 | private List imageViews ; 15 | private String[] mTitles ; 16 | public MonthAccountAdapter(List imageViews){ 17 | this.imageViews = imageViews; 18 | } 19 | public MonthAccountAdapter(List imageViews, String[] mTitles){ 20 | this.imageViews = imageViews; 21 | this.mTitles= mTitles; 22 | } 23 | @Override 24 | public int getCount() { 25 | return imageViews.size(); 26 | } 27 | 28 | @Override 29 | public CharSequence getPageTitle(int position) { 30 | return mTitles[position]; 31 | } 32 | @Override 33 | public Object instantiateItem(ViewGroup container, int position) { 34 | container.addView(imageViews.get(position)); 35 | return imageViews.get(position); 36 | } 37 | @Override 38 | public void destroyItem(ViewGroup container, int position, Object object) { 39 | container.removeView(imageViews.get(position)); 40 | } 41 | @Override 42 | public boolean isViewFromObject(View arg0, Object arg1) { 43 | return arg0==arg1; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/ui/adapter/binder/MonthChartBillViewBinder.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.ui.adapter.binder; 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.TextView; 8 | 9 | import com.afollestad.materialdialogs.MaterialDialog; 10 | import com.copasso.cocobill.R; 11 | import com.copasso.cocobill.model.bean.local.BBill; 12 | import com.copasso.cocobill.utils.DateUtils; 13 | import com.copasso.cocobill.utils.ImageUtils; 14 | 15 | import androidx.annotation.NonNull; 16 | import androidx.recyclerview.widget.RecyclerView; 17 | import me.drakeet.multitype.ItemViewBinder; 18 | 19 | import static com.copasso.cocobill.utils.DateUtils.FORMAT_HMS_CN; 20 | import static com.copasso.cocobill.utils.DateUtils.FORMAT_YMD_CN; 21 | 22 | /** 23 | * Created by Zhouas666 on 2019-01-10 24 | * Github: https://github.com/zas023 25 | * ChartFragment中分类目录下账单排序列表 26 | */ 27 | public class MonthChartBillViewBinder extends ItemViewBinder { 28 | 29 | private Context mContext; 30 | 31 | public MonthChartBillViewBinder(Context context){ 32 | this.mContext=context; 33 | } 34 | 35 | @NonNull 36 | @Override 37 | protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) { 38 | View root = inflater.inflate(R.layout.item_recycler_monthchart_rank, parent, false); 39 | return new ViewHolder(root); 40 | } 41 | 42 | @Override 43 | protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull BBill item) { 44 | 45 | holder.rank.setText(holder.getAdapterPosition() + 1 + ""); 46 | holder.title.setText(item.getSortName()); 47 | if (item.isIncome()) 48 | holder.money.setText("+" + item.getCost()); 49 | else 50 | holder.money.setText("-" + item.getCost()); 51 | holder.root.setOnClickListener(v -> { 52 | new MaterialDialog.Builder(mContext) 53 | .title(item.getSortName()) 54 | .content("\t\t" + Math.abs(item.getCost()) + "元\n\t\t" + item.getContent() 55 | +"\n\n\t\t"+DateUtils.long2Str(item.getCrdate(), FORMAT_YMD_CN) 56 | +"\n\t\t"+DateUtils.long2Str(item.getCrdate(), FORMAT_HMS_CN)) 57 | .positiveText("朕知道了") 58 | .icon(ImageUtils.getDrawable(item.getSortImg())) 59 | .limitIconToDefaultSize() 60 | .show(); 61 | }); 62 | } 63 | 64 | static class ViewHolder extends RecyclerView.ViewHolder { 65 | 66 | private View root; 67 | private TextView title; 68 | private TextView money; 69 | private TextView rank; 70 | 71 | public ViewHolder(View view) { 72 | super(view); 73 | root = view; 74 | title = view.findViewById(R.id.title); 75 | money = view.findViewById(R.id.money); 76 | rank = view.findViewById(R.id.rank); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/ActivityManagerUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.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 ActivityManagerUtils { 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/copasso/cocobill/utils/DimenUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import android.util.TypedValue; 4 | 5 | /** 6 | * Created by zhouas666 on 2017/12/24. 7 | * @desc 尺寸相关操作工具类。 8 | */ 9 | public class DimenUtils { 10 | 11 | private DimenUtils() { 12 | throw new UnsupportedOperationException("cannot be instantiated"); 13 | } 14 | 15 | /** 16 | * dp 单位转换为 px 17 | */ 18 | public static int dp2px(float dpValue){ 19 | return (int)(dpValue * (UiUtils.getContext().getResources().getDisplayMetrics().density) + 0.5f); 20 | } 21 | 22 | /** 23 | * px 单位转换为 dp 24 | */ 25 | public static int px2dp(float pxValue){ 26 | return (int)(pxValue / (UiUtils.getContext().getResources().getDisplayMetrics().density) + 0.5f); 27 | } 28 | 29 | /** 30 | * sp 单位转换为 px 31 | */ 32 | public static int sp2Px(float spVal) { 33 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 34 | spVal, UiUtils.getContext().getResources().getDisplayMetrics()); 35 | } 36 | 37 | /** 38 | * px 单位转换为 sp 39 | */ 40 | public static float px2Sp(float pxVal) { 41 | return (pxVal / UiUtils.getContext().getResources().getDisplayMetrics().scaledDensity); 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/FormatUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.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 zhouas666 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 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/ProgressUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Context; 5 | 6 | import com.copasso.cocobill.R; 7 | 8 | /** 9 | * Created by zhouas666 on 2017/12/28. 10 | * ProgressDialog封装工具类 11 | */ 12 | public class ProgressUtils { 13 | 14 | private static ProgressDialog dialog = null; 15 | 16 | public static void show(Context context){ 17 | show(context, null); 18 | } 19 | 20 | public static void show(Context context, String msg){ 21 | dialog = new ProgressDialog(context); 22 | dialog.setMessage(msg == null ? UiUtils.getString(R.string.load_msg) : msg); 23 | dialog.setCancelable(false); 24 | dialog.show(); 25 | } 26 | 27 | public static void dismiss(){ 28 | if(dialog != null && dialog.isShowing()){ 29 | dialog.dismiss(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/SharedPUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | import com.copasso.cocobill.model.bean.local.NoteBean; 7 | import com.google.gson.Gson; 8 | 9 | /** 10 | * Created by zhouas666 on 2017/12/25. 11 | */ 12 | public class SharedPUtils { 13 | 14 | public final static String USER_INFOR = "userInfo"; 15 | public final static String USER_SETTING = "userSetting"; 16 | 17 | 18 | /** 19 | * 获取当前用户账单分类信息 20 | */ 21 | public static NoteBean getUserNoteBean(Context context) { 22 | SharedPreferences sp = context.getSharedPreferences(USER_INFOR, Context.MODE_PRIVATE); 23 | if (sp != null) { 24 | String jsonStr = sp.getString("noteBean", null); 25 | if (jsonStr != null) { 26 | Gson gson = new Gson(); 27 | return gson.fromJson(jsonStr, NoteBean.class); 28 | } 29 | } 30 | return null; 31 | } 32 | 33 | /** 34 | * 设置当前用户账单分类信息 35 | */ 36 | public static void setUserNoteBean(Context context, String jsonStr) { 37 | SharedPreferences sp = context.getSharedPreferences(USER_INFOR, Context.MODE_PRIVATE); 38 | SharedPreferences.Editor editor = sp.edit(); 39 | editor.putString("noteBean", jsonStr); 40 | editor.commit(); 41 | } 42 | 43 | /** 44 | * 设置当前用户账单分类信息 45 | */ 46 | public static void setUserNoteBean(Context context, NoteBean noteBean) { 47 | Gson gson = new Gson(); 48 | String jsonStr = gson.toJson(noteBean); 49 | SharedPreferences sp = context.getSharedPreferences(USER_INFOR, Context.MODE_PRIVATE); 50 | SharedPreferences.Editor editor = sp.edit(); 51 | editor.putString("noteBean", jsonStr); 52 | editor.commit(); 53 | } 54 | 55 | /** 56 | * 获取当前用户主题 57 | */ 58 | public static String getCurrentTheme(Context context) { 59 | SharedPreferences sp = context.getSharedPreferences(USER_SETTING, Context.MODE_PRIVATE); 60 | if (sp != null) 61 | return sp.getString("theme", "原谅绿"); 62 | return null; 63 | } 64 | 65 | /** 66 | * 获取当前用户主题 67 | */ 68 | public static void setCurrentTheme(Context context, String theme) { 69 | SharedPreferences sp = context.getSharedPreferences(USER_SETTING, Context.MODE_PRIVATE); 70 | SharedPreferences.Editor editor = sp.edit(); 71 | if (editor != null) { 72 | editor.putString("theme", theme); 73 | editor.commit(); 74 | } 75 | } 76 | 77 | /** 78 | * 判断是否第一次进入APP 79 | * @param context 80 | * @return 81 | */ 82 | public static boolean isFirstStart(Context context) { 83 | SharedPreferences sp = context.getSharedPreferences(USER_SETTING, Context.MODE_PRIVATE); 84 | boolean isFirst= sp.getBoolean("first", true); 85 | //第一次则修改记录 86 | if(isFirst) 87 | sp.edit().putBoolean("first", false).commit(); 88 | return isFirst; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/SnackbarUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.view.View; 6 | 7 | import com.google.android.material.snackbar.Snackbar; 8 | 9 | /** 10 | * Created by zhouas666 on 2017/12/28. 11 | * ProgressDialog封装工具类 12 | */ 13 | public class SnackbarUtils { 14 | 15 | 16 | public static void show(View view) { 17 | show(view, null); 18 | } 19 | 20 | public static void show(Context context, String msg) { 21 | show(((Activity) context), msg); 22 | } 23 | 24 | public static void show(Activity activity, String msg) { 25 | show(activity.getWindow().getDecorView(), msg); 26 | } 27 | 28 | 29 | public static void show(View view, String msg) { 30 | Snackbar.make(view, msg, Snackbar.LENGTH_SHORT).show(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import java.util.Random; 4 | import java.util.regex.Matcher; 5 | import java.util.regex.Pattern; 6 | 7 | /** 8 | * Created by zhouas666 on 2017/12/12. 9 | */ 10 | public class StringUtils { 11 | 12 | /** 13 | * 验证邮箱的正则表达式 14 | * @param email 15 | * @return 16 | */ 17 | public static boolean checkEmail(String email) 18 | { 19 | boolean flag = false; 20 | try { 21 | String check = "^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; 22 | Pattern regex = Pattern.compile(check); 23 | Matcher matcher = regex.matcher(email); 24 | flag = matcher.matches(); 25 | } catch (Exception e) { 26 | flag = false; 27 | } 28 | return flag; 29 | } 30 | 31 | /** 32 | * 验证手机号码,11位数字,1开通,第二位数必须是3456789这些数字之一 * 33 | * @param mobileNumber 34 | * @return 35 | */ 36 | public static boolean checkPhoneNumber(String mobileNumber) { 37 | boolean flag = false; 38 | try { 39 | // Pattern regex = Pattern.compile("^(((13[0-9])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8})|(0\\d{2}-\\d{8})|(0\\d{3}-\\d{7})$"); 40 | Pattern regex = Pattern.compile("^1[345789]\\d{9}$"); 41 | Matcher matcher = regex.matcher(mobileNumber); 42 | flag = matcher.matches(); 43 | } catch (Exception e) { 44 | e.printStackTrace(); 45 | flag = false; 46 | 47 | } 48 | return flag; 49 | } 50 | 51 | /** 52 | * 随机返回颜色Color十六进制字符串 53 | * @return 54 | */ 55 | public static String randomColor(){ 56 | //红色 57 | String red; 58 | //绿色 59 | String green; 60 | //蓝色 61 | String blue; 62 | //生成随机对象 63 | Random random = new Random(); 64 | //生成红色颜色代码 65 | red = Integer.toHexString(random.nextInt(256)).toUpperCase(); 66 | //生成绿色颜色代码 67 | green = Integer.toHexString(random.nextInt(256)).toUpperCase(); 68 | //生成蓝色颜色代码 69 | blue = Integer.toHexString(random.nextInt(256)).toUpperCase(); 70 | 71 | //判断红色代码的位数 72 | red = red.length()==1 ? "0" + red : red ; 73 | //判断绿色代码的位数 74 | green = green.length()==1 ? "0" + green : green ; 75 | //判断蓝色代码的位数 76 | blue = blue.length()==1 ? "0" + blue : blue ; 77 | //生成十六进制颜色值 78 | return "#"+red+green+blue; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/ThemeManager.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.copasso.cocobill.R; 8 | import com.copasso.cocobill.common.Constants; 9 | 10 | /** 11 | * Created by zhouas666 on 2017/12/27. 12 | */ 13 | public class ThemeManager { 14 | 15 | private String[] mThemes = {"原谅绿", "酷炫黑", "少女红", "胖次蓝", "基佬紫", "活力橙", "大地棕"}; 16 | 17 | private static ThemeManager instance; 18 | 19 | public static ThemeManager getInstance() { 20 | if (instance == null) { 21 | instance = new ThemeManager(); 22 | } 23 | return instance; 24 | } 25 | 26 | public String[] getThemes(){ 27 | return mThemes; 28 | } 29 | 30 | /** 31 | * 设置主题色 32 | * @param context activity 33 | * @param theme 主题名称 34 | */ 35 | public void setTheme(Activity context, String theme){ 36 | String curTheme = SharedPUtils.getCurrentTheme(context); 37 | if(curTheme != null && curTheme.equals(theme)){ 38 | return; 39 | } 40 | 41 | SharedPUtils.setCurrentTheme(context,theme); 42 | 43 | context.finish(); 44 | Intent intent = context.getIntent(); 45 | intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); 46 | intent.putExtra(Constants.EXTRA_IS_UPDATE_THEME, true); 47 | context.startActivity(intent); 48 | } 49 | 50 | /** 51 | * 获取当前主题名 52 | * @param context 上下文 53 | * @return 如: 少女粉 54 | */ 55 | public String getCurThemeName(Context context){ 56 | return SharedPUtils.getCurrentTheme(context); 57 | } 58 | 59 | 60 | 61 | public void init(Context context) { 62 | String theme = SharedPUtils.getCurrentTheme(context); 63 | if(theme.equals(mThemes[0])){ 64 | context.setTheme(R.style.AppTheme); 65 | }else if(theme.equals(mThemes[1])){ 66 | context.setTheme(R.style.AppTheme_Black); 67 | }else if(theme.equals(mThemes[2])){ 68 | context.setTheme(R.style.AppTheme_Green); 69 | }else if(theme.equals(mThemes[3])){ 70 | context.setTheme(R.style.AppTheme_Blue); 71 | }else if(theme.equals(mThemes[4])){ 72 | context.setTheme(R.style.AppTheme_Purple); 73 | }else if(theme.equals(mThemes[5])){ 74 | context.setTheme(R.style.AppTheme_Orange); 75 | }else if(theme.equals(mThemes[6])){ 76 | context.setTheme(R.style.AppTheme_Brown); 77 | } 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/ToastUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | /** 7 | * Created by zhouyou on 2016/6/28. 8 | * Class desc: 单例土司 9 | */ 10 | public class ToastUtils { 11 | 12 | public static Toast mToast; 13 | 14 | /** 15 | * 显示吐司 16 | * @param context 17 | * @param message 18 | */ 19 | public static void show(final Context context, final String message){ 20 | if (mToast == null){ 21 | mToast = Toast.makeText(context, message, Toast.LENGTH_SHORT); 22 | }else{ 23 | mToast.setText(message); 24 | mToast.setDuration(Toast.LENGTH_SHORT); 25 | } 26 | mToast.show(); 27 | } 28 | 29 | /** 30 | * 显示吐司 31 | * @param context 32 | * @param messageResId 33 | */ 34 | public static void show(final Context context, final int messageResId){ 35 | if (mToast == null){ 36 | mToast = Toast.makeText(context, messageResId, Toast.LENGTH_SHORT); 37 | }else{ 38 | mToast.setText(messageResId); 39 | mToast.setDuration(Toast.LENGTH_SHORT); 40 | } 41 | mToast.show(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/copasso/cocobill/utils/UiUtils.java: -------------------------------------------------------------------------------- 1 | package com.copasso.cocobill.utils; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | import android.graphics.drawable.Drawable; 6 | import android.os.Build; 7 | import android.view.View; 8 | 9 | import com.copasso.cocobill.MyApplication; 10 | 11 | import androidx.core.content.ContextCompat; 12 | 13 | /** 14 | * Created by zhouas666 on 2017/12/24. 15 | * Class desc: ui 操作相关封装 16 | */ 17 | public class UiUtils { 18 | 19 | /** 20 | * 获取上下文 21 | */ 22 | public static Context getContext() { 23 | return MyApplication.getContext(); 24 | } 25 | 26 | /** 27 | * 获取资源操作类 28 | */ 29 | public static Resources getResources() { 30 | return getContext().getResources(); 31 | } 32 | 33 | /** 34 | * 获取字符串资源 35 | * 36 | * @param id 资源id 37 | * @return 字符串 38 | */ 39 | public static String getString(int id) { 40 | return getResources().getString(id); 41 | } 42 | 43 | /** 44 | * 获取字符串数组资源 45 | * 46 | * @param id 资源id 47 | * @return 字符串数组 48 | */ 49 | public static String[] getStringArray(int id) { 50 | return getResources().getStringArray(id); 51 | } 52 | 53 | /** 54 | * 获取颜色资源 55 | */ 56 | public static int getColor(int id) { 57 | return ContextCompat.getColor(getContext(), id); 58 | } 59 | 60 | /** 61 | * 获取颜色资源 62 | * 63 | * @param id 资源id 64 | * @param theme 样式 65 | * @return 66 | */ 67 | public static int getColor(int id, Resources.Theme theme) { 68 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 69 | return getResources().getColor(id, theme); 70 | } 71 | return getResources().getColor(id); 72 | } 73 | 74 | /** 75 | * 获取drawable资源 76 | * 77 | * @param id 资源id 78 | * @return 79 | */ 80 | public static Drawable getDrawable(int id) { 81 | return ContextCompat.getDrawable(getContext(), id); 82 | } 83 | 84 | /** 85 | * 加载布局(使用View方式) 86 | * 87 | * @param resource 布局资源id 88 | * @return View 89 | */ 90 | public static View inflate(int resource) { 91 | return View.inflate(getContext(), resource, null); 92 | } 93 | 94 | /** 显示不带 null 的字符 */ 95 | public static String show(String text){ 96 | return text != null ? text : ""; 97 | } 98 | 99 | } 100 | 101 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fab_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fab_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.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 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_manage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_send.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_slideshow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/round_corner_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zas023/CocoBill/05bf408bdec14847b41f2de9f6aa45b7b2a02411/app/src/main/res/drawable-v21/round_corner_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/selector_edittext_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_banner_point1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zas023/CocoBill/05bf408bdec14847b41f2de9f6aa45b7b2a02411/app/src/main/res/drawable-xhdpi/icon_banner_point1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_banner_point2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zas023/CocoBill/05bf408bdec14847b41f2de9f6aa45b7b2a02411/app/src/main/res/drawable-xhdpi/icon_banner_point2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_button_code_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_button_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_button_default_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_button_default_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/drawable/card.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rb_main_first_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 | -------------------------------------------------------------------------------- /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/shape_tb_calc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_tb_cash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tabbar_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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/res/drawable/tb_text_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/toast_radius.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_base_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 20 | 21 | 29 | 30 | 43 | 44 | 45 | 50 | 51 | 59 | 60 | 69 | 70 | 71 | 81 | 82 | 83 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 15 | 16 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_user_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 19 | 20 | 27 | 28 | 32 | 33 | 40 | 41 | 42 | 43 | 44 | 52 | 53 | 54 | 55 | 63 | 64 | 65 | 66 | 74 | 75 | 76 | 77 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 29 | 34 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_top_date.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 26 | 35 | 36 | 37 | 38 | 46 | 53 | 62 | 63 | 64 | 65 | 68 | 69 | 70 | 78 | 85 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_change_password.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 24 | 25 | 26 | 27 | 36 | 37 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/layout/drawer_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 23 | 24 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_month_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 15 | 16 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_recycler_monthchart_rank.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 19 | 28 | 29 | 39 | 40 | 41 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_recycler_monthlist_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_recycler_monthlist_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 14 | 15 | 21 | 22 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 56 | 57 |