Showing preview only (1,276K chars total). Download the full file or copy to clipboard to get everything.
Repository: Crazy-Marvin/ToDont
Branch: development
Commit: 4a35a8759f14
Files: 539
Total size: 64.1 MB
Directory structure:
gitextract_f40de0sl/
├── .devcontainer/
│ └── devcontainer.json
├── .github/
│ ├── CODEOWNERS
│ ├── CODE_OF_CONDUCT.md
│ ├── CONTRIBUTING.md
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── SECURITY.md
│ ├── SUPPORT.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── build.yml
│ ├── ci.yml
│ ├── codacy-analysis.yml
│ ├── codeql-analysis.yml
│ └── windows.yml
├── .gitignore
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── rocks/
│ │ └── poopjournal/
│ │ └── todont/
│ │ └── ExampleInstrumentedTest.kt
│ ├── debug/
│ │ └── res/
│ │ ├── drawable/
│ │ │ └── ic_launcher_foreground.xml
│ │ ├── drawable-v24/
│ │ │ └── ic_launcher_background.xml
│ │ └── mipmap-anydpi-v26/
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── rocks/
│ │ └── poopjournal/
│ │ └── todont/
│ │ ├── About.kt
│ │ ├── Helper.kt
│ │ ├── LabelsActivity.kt
│ │ ├── MainActivity.kt
│ │ ├── MyApp.kt
│ │ ├── NotificationReceiver.kt
│ │ ├── OnBoardingActivity.kt
│ │ ├── Settings.kt
│ │ ├── SplashScreenActivity.kt
│ │ ├── adapters/
│ │ │ ├── AvoidedOrDoneAdapter.kt
│ │ │ ├── AvoidedOrDoneLogAdapter.kt
│ │ │ ├── HabitsAdapter.kt
│ │ │ ├── HabitsLogAdapter.kt
│ │ │ └── LabelsAdapter.kt
│ │ ├── fragments/
│ │ │ ├── AvoidedOrDoneFragment.kt
│ │ │ ├── AvoidedOrDoneLogFragment.kt
│ │ │ ├── DailyFragment.kt
│ │ │ ├── FragmentLog.kt
│ │ │ ├── FragmentToday.kt
│ │ │ ├── HabitsFragment.kt
│ │ │ ├── HabitsLogFragment.kt
│ │ │ ├── MonthlyFragment.kt
│ │ │ ├── WeeklyFragment.kt
│ │ │ ├── YearlyFragment.kt
│ │ │ └── menuFragment.kt
│ │ ├── model/
│ │ │ ├── Alarm.kt
│ │ │ ├── Habit.kt
│ │ │ ├── HabitRecord.kt
│ │ │ └── Label.kt
│ │ ├── showcaseview/
│ │ │ ├── RippleBackground.kt
│ │ │ └── ShowcaseViewBuilder.kt
│ │ ├── utils/
│ │ │ ├── Constants.kt
│ │ │ ├── DatabaseUtils.kt
│ │ │ ├── HabitsBottomSheetDialog.kt
│ │ │ ├── NotificationActionReceiver.kt
│ │ │ ├── NotificationReceiver.kt
│ │ │ ├── SharedPrefUtils.kt
│ │ │ └── Utils.kt
│ │ └── widgets/
│ │ ├── MyAppNoButtonsWidgetProvider.kt
│ │ ├── MyAppSmallWidgetProvider.kt
│ │ ├── NobuttonsWidgetService.kt
│ │ └── WidgetService.kt
│ ├── res/
│ │ ├── anim/
│ │ │ ├── fade_in.xml
│ │ │ └── fade_out.xml
│ │ ├── drawable/
│ │ │ ├── _cross.xml
│ │ │ ├── _tick.xml
│ │ │ ├── about.xml
│ │ │ ├── backgorundinner.xml
│ │ │ ├── bell.xml
│ │ │ ├── bottom_nav_color.xml
│ │ │ ├── bottom_sheet.xml
│ │ │ ├── continuebutton2.xml
│ │ │ ├── continuebuttontrans.xml
│ │ │ ├── dis.xml
│ │ │ ├── email.xml
│ │ │ ├── fix_cross.xml
│ │ │ ├── fix_fab.xml
│ │ │ ├── fix_rounded_rectangle.xml
│ │ │ ├── fix_tick.xml
│ │ │ ├── frame__4_.xml
│ │ │ ├── frame__5_.xml
│ │ │ ├── frame__6_.xml
│ │ │ ├── git.xml
│ │ │ ├── grad_tab_back.xml
│ │ │ ├── grad_window_backgrond.xml
│ │ │ ├── gradient_background.xml
│ │ │ ├── gradient_fab.xml
│ │ │ ├── habitlogcheck.xml
│ │ │ ├── ic_about.xml
│ │ │ ├── ic_add.xml
│ │ │ ├── ic_appearance.xml
│ │ │ ├── ic_avoided.xml
│ │ │ ├── ic_back.xml
│ │ │ ├── ic_backarrow.xml
│ │ │ ├── ic_backarrowpressed.xml
│ │ │ ├── ic_background.xml
│ │ │ ├── ic_cross.xml
│ │ │ ├── ic_delete.xml
│ │ │ ├── ic_done.xml
│ │ │ ├── ic_downarrow.xml
│ │ │ ├── ic_facebook.xml
│ │ │ ├── ic_foreground.xml
│ │ │ ├── ic_habitscircle.xml
│ │ │ ├── ic_label_light.xml
│ │ │ ├── ic_log.xml
│ │ │ ├── ic_menu.xml
│ │ │ ├── ic_monochrome.xml
│ │ │ ├── ic_nextarrow.xml
│ │ │ ├── ic_nextpressed.xml
│ │ │ ├── ic_sad.xml
│ │ │ ├── ic_spinner.xml
│ │ │ ├── ic_today.xml
│ │ │ ├── info.xml
│ │ │ ├── log_frag_selected.xml
│ │ │ ├── monitor.xml
│ │ │ ├── mygradient.xml
│ │ │ ├── mygradient1.xml
│ │ │ ├── myinnergradient.xml
│ │ │ ├── myinnergradientlog.xml
│ │ │ ├── myinnergradientlogs.xml
│ │ │ ├── notification_logo.xml
│ │ │ ├── onboard.xml
│ │ │ ├── reportproblem.xml
│ │ │ ├── roundbutton.xml
│ │ │ ├── rounded_button.xml
│ │ │ ├── rounded_corners.xml
│ │ │ ├── rounded_dialog_bg.xml
│ │ │ ├── selectedround.xml
│ │ │ ├── spinner_background.xml
│ │ │ ├── tabcolor.xml
│ │ │ ├── translate.xml
│ │ │ ├── trash.xml
│ │ │ ├── twitter.xml
│ │ │ └── viewsrc.xml
│ │ ├── layout/
│ │ │ ├── activity_about.xml
│ │ │ ├── activity_labels.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── activity_on_boarding.xml
│ │ │ ├── activity_settings.xml
│ │ │ ├── activity_splash__screen.xml
│ │ │ ├── dialog_info.xml
│ │ │ ├── dialogbox.xml
│ │ │ ├── dialogbox_add_new_habit.xml
│ │ │ ├── dialogbox_labels.xml
│ │ │ ├── fragment_avoided.xml
│ │ │ ├── fragment_daily.xml
│ │ │ ├── fragment_done.xml
│ │ │ ├── fragment_habits.xml
│ │ │ ├── fragment_log2.xml
│ │ │ ├── fragment_log_habits.xml
│ │ │ ├── fragment_monthly.xml
│ │ │ ├── fragment_today2.xml
│ │ │ ├── fragment_weekly.xml
│ │ │ ├── fragment_yearly.xml
│ │ │ ├── initial_no_buttons_widget_view.xml
│ │ │ ├── initial_widget_view.xml
│ │ │ ├── labels_recyclerview_layout.xml
│ │ │ ├── layout_habit_bottom_sheet.xml
│ │ │ ├── menu_fragment.xml
│ │ │ ├── no_buttons_widget_preview.xml
│ │ │ ├── recyclerview_layout.xml
│ │ │ ├── recyclerview_layout_habits.xml
│ │ │ ├── recyclerview_layout_log_habits.xml
│ │ │ ├── widget_item.xml
│ │ │ ├── widget_item_no_buttons.xml
│ │ │ ├── widget_layout.xml
│ │ │ ├── widget_layout_no_buttons.xml
│ │ │ └── widget_preview.xml
│ │ ├── menu/
│ │ │ ├── navigation.xml
│ │ │ └── topmenu.xml
│ │ ├── resources.properties
│ │ ├── values/
│ │ │ ├── attrs.xml
│ │ │ ├── colors.xml
│ │ │ ├── dimen.xml
│ │ │ ├── ids.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ ├── values-ar/
│ │ │ └── strings.xml
│ │ ├── values-az/
│ │ │ └── strings.xml
│ │ ├── values-b+art/
│ │ │ └── strings.xml
│ │ ├── values-be/
│ │ │ └── strings.xml
│ │ ├── values-bg/
│ │ │ └── strings.xml
│ │ ├── values-bs/
│ │ │ └── strings.xml
│ │ ├── values-ca/
│ │ │ └── strings.xml
│ │ ├── values-cs/
│ │ │ └── strings.xml
│ │ ├── values-da/
│ │ │ └── strings.xml
│ │ ├── values-de/
│ │ │ └── strings.xml
│ │ ├── values-dum/
│ │ │ └── strings.xml
│ │ ├── values-el/
│ │ │ └── strings.xml
│ │ ├── values-eo/
│ │ │ └── strings.xml
│ │ ├── values-es/
│ │ │ └── strings.xml
│ │ ├── values-et/
│ │ │ └── strings.xml
│ │ ├── values-fa/
│ │ │ └── strings.xml
│ │ ├── values-fi/
│ │ │ └── strings.xml
│ │ ├── values-fil/
│ │ │ └── strings.xml
│ │ ├── values-fr/
│ │ │ └── strings.xml
│ │ ├── values-ga/
│ │ │ └── strings.xml
│ │ ├── values-he/
│ │ │ └── strings.xml
│ │ ├── values-hi/
│ │ │ └── strings.xml
│ │ ├── values-hr/
│ │ │ └── strings.xml
│ │ ├── values-hu/
│ │ │ └── strings.xml
│ │ ├── values-hy/
│ │ │ └── strings.xml
│ │ ├── values-ia/
│ │ │ └── strings.xml
│ │ ├── values-id/
│ │ │ └── strings.xml
│ │ ├── values-is/
│ │ │ └── strings.xml
│ │ ├── values-it/
│ │ │ └── strings.xml
│ │ ├── values-ja/
│ │ │ └── strings.xml
│ │ ├── values-ka/
│ │ │ └── strings.xml
│ │ ├── values-kk/
│ │ │ └── strings.xml
│ │ ├── values-ko/
│ │ │ └── strings.xml
│ │ ├── values-la/
│ │ │ └── strings.xml
│ │ ├── values-lb/
│ │ │ └── strings.xml
│ │ ├── values-lt/
│ │ │ └── strings.xml
│ │ ├── values-mk/
│ │ │ └── strings.xml
│ │ ├── values-ms/
│ │ │ └── strings.xml
│ │ ├── values-mt/
│ │ │ └── strings.xml
│ │ ├── values-nb-rNO/
│ │ │ └── strings.xml
│ │ ├── values-ne/
│ │ │ └── strings.xml
│ │ ├── values-night/
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ ├── values-night-v35/
│ │ │ └── styles.xml
│ │ ├── values-nl/
│ │ │ └── strings.xml
│ │ ├── values-pl/
│ │ │ └── strings.xml
│ │ ├── values-pt/
│ │ │ └── strings.xml
│ │ ├── values-pt-rBR/
│ │ │ └── strings.xml
│ │ ├── values-ro/
│ │ │ └── strings.xml
│ │ ├── values-ru/
│ │ │ └── strings.xml
│ │ ├── values-sk/
│ │ │ └── strings.xml
│ │ ├── values-sl/
│ │ │ └── strings.xml
│ │ ├── values-sr/
│ │ │ └── strings.xml
│ │ ├── values-sv/
│ │ │ └── strings.xml
│ │ ├── values-ta/
│ │ │ └── strings.xml
│ │ ├── values-th/
│ │ │ └── strings.xml
│ │ ├── values-tl/
│ │ │ └── strings.xml
│ │ ├── values-tr/
│ │ │ └── strings.xml
│ │ ├── values-uk/
│ │ │ └── strings.xml
│ │ ├── values-ur/
│ │ │ └── strings.xml
│ │ ├── values-uz/
│ │ │ └── strings.xml
│ │ ├── values-v35/
│ │ │ └── styles.xml
│ │ ├── values-vi/
│ │ │ └── strings.xml
│ │ ├── values-zh-rCN/
│ │ │ └── strings.xml
│ │ ├── values-zh-rTW/
│ │ │ └── strings.xml
│ │ ├── xml/
│ │ │ ├── backup_rules.xml
│ │ │ ├── data_extraction_rules.xml
│ │ │ ├── locales_config.xml
│ │ │ ├── no_buttons_widget_info.xml
│ │ │ └── widget_info.xml
│ │ └── xml-v31/
│ │ ├── no_buttons_widget_info.xml
│ │ └── widget_info.xml
│ └── test/
│ └── java/
│ └── rocks/
│ └── poopjournal/
│ └── todont/
│ └── ExampleUnitTest.kt
├── build.gradle
├── fastlane/
│ └── metadata/
│ └── android/
│ ├── cs/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ └── short_description.txt
│ ├── de-DE/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ └── 2.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── en-US/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 210.txt
│ │ │ ├── 3.txt
│ │ │ ├── 300.txt
│ │ │ ├── 4.txt
│ │ │ ├── 400.txt
│ │ │ ├── 410.txt
│ │ │ ├── 420.txt
│ │ │ ├── 430.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ ├── title.txt
│ │ └── video.txt
│ ├── eo/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ └── short_description.txt
│ ├── es/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 210.txt
│ │ │ ├── 3.txt
│ │ │ ├── 30.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── fi/
│ │ └── changelogs/
│ │ └── 410.txt
│ ├── fr/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── ga/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 210.txt
│ │ │ ├── 3.txt
│ │ │ ├── 300.txt
│ │ │ ├── 4.txt
│ │ │ ├── 400.txt
│ │ │ ├── 410.txt
│ │ │ ├── 420.txt
│ │ │ ├── 430.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── he/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 3.txt
│ │ │ ├── 30.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── hy/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ └── short_description.txt
│ ├── id/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 3.txt
│ │ │ ├── 30.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── it/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ ├── 3.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── ko/
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── nb-NO/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ ├── 3.txt
│ │ │ └── 4.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── nl/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── pl-PL/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 3.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── pt/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ └── 7.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── pt-BR/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── ro/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ └── short_description.txt
│ ├── ru/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 210.txt
│ │ │ ├── 3.txt
│ │ │ ├── 300.txt
│ │ │ ├── 4.txt
│ │ │ ├── 400.txt
│ │ │ ├── 410.txt
│ │ │ ├── 420.txt
│ │ │ ├── 430.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── ta-IN/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 210.txt
│ │ │ ├── 3.txt
│ │ │ ├── 300.txt
│ │ │ ├── 4.txt
│ │ │ ├── 400.txt
│ │ │ ├── 410.txt
│ │ │ ├── 420.txt
│ │ │ ├── 430.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── tr/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 210.txt
│ │ │ ├── 3.txt
│ │ │ ├── 30.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── uk/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 3.txt
│ │ │ ├── 30.txt
│ │ │ ├── 4.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── ur/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ └── 3.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ ├── zh-CN/
│ │ ├── changelogs/
│ │ │ ├── 1.txt
│ │ │ ├── 10.txt
│ │ │ ├── 2.txt
│ │ │ ├── 210.txt
│ │ │ ├── 3.txt
│ │ │ ├── 300.txt
│ │ │ ├── 4.txt
│ │ │ ├── 400.txt
│ │ │ ├── 410.txt
│ │ │ ├── 420.txt
│ │ │ ├── 430.txt
│ │ │ ├── 5.txt
│ │ │ ├── 6.txt
│ │ │ ├── 7.txt
│ │ │ ├── 8.txt
│ │ │ └── 9.txt
│ │ ├── full_description.txt
│ │ ├── short_description.txt
│ │ └── title.txt
│ └── zh-TW/
│ ├── changelogs/
│ │ ├── 1.txt
│ │ ├── 10.txt
│ │ ├── 2.txt
│ │ ├── 3.txt
│ │ ├── 30.txt
│ │ ├── 4.txt
│ │ ├── 5.txt
│ │ ├── 6.txt
│ │ ├── 7.txt
│ │ └── 9.txt
│ ├── full_description.txt
│ ├── short_description.txt
│ └── title.txt
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── sentry-wizard
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .devcontainer/devcontainer.json
================================================
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/java
{
"name": "Java",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Java version: 8, 11, 17
// Append -bullseye or -buster to pin to an OS version.
// Use the -bullseye variants on local arm64/Apple Silicon.
"VARIANT": "17-bullseye",
// Options
"INSTALL_MAVEN": "true",
"MAVEN_VERSION": "3.8.5",
"INSTALL_GRADLE": "false",
"NODE_VERSION": "lts/*"
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"maven.executable.path": "/usr/local/sdkman/candidates/maven/current/bin/mvn"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vscjava.vscode-java-pack"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
================================================
FILE: .github/CODEOWNERS
================================================
/app/ @arafaatqureshi
================================================
FILE: .github/CODE_OF_CONDUCT.md
================================================
Welcome to the To Don't community.
Within desired privacy, accept and grant criticism constructively.
Finding yourself unable to do so e-mail [marvin@poopjournal.rocks](mailto:marvin@poopjournal.rocks) answered by Crazy Marvin, the project maintainer.
================================================
FILE: .github/CONTRIBUTING.md
================================================
================================================
FILE: .github/FUNDING.yml
================================================
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
---
## :writing_hand: Describe the bug
<!-- A clear and concise description of what the bug is. -->
## :bomb: Steps to reproduce
<!-- How we can reproduce the behavior: -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
## :wrench: Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
## :camera: Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
## :iphone: Tech info
- Device: <!-- e.g. Nexus 6P -->
- OS: <!-- e.g. 7.1.1 -->
- App Version: <!-- e.g. 3.1.2 -->
## :page_facing_up: Additional context
<!-- Add any other context about the problem here. -->
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
---
## :warning: Is your feature request related to a problem? Please describe
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
## :bulb: Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->
## :bar_chart: Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
## :page_facing_up: Additional context
<!-- Add any other context or screenshots about the feature request here. -->
## :raising_hand: Do you want to develop this feature yourself?
<!-- Put an `x` symbol into braces of desired choice. -->
- [ ] Yes
- [ ] No
================================================
FILE: .github/SECURITY.md
================================================
Please report (suspected) security vulnerabilities to [marvin@poopjournal.rocks](mailto:marvin@poopjournal.rocks). It would be great if you could prepare a patch too. Thanks!
================================================
FILE: .github/SUPPORT.md
================================================
Hi! 👋
We’re excited that you’re using **To Dont't** and we’d love to help.
To help us help you, please read through the following guidelines.
Please understand that people involved with this project often do so for fun,
next to their day job; you are not entitled to free customer service.
## Help us help you!
Spending time framing a question and adding support links or resources makes it
much easier for us to help.
It’s easy to fall into the trap of asking something too specific when you’re
close to a problem.
Then, those trying to help you out have to spend a lot of time asking additional
questions to understand what you are hoping to achieve.
Spending the extra time up front can help save everyone time in the long run.
* Try to define what you need help with:
* Is there something in particular you want to do?
* What problem are you encountering and what steps have you taken to try
and fix it?
* Is there a concept you’re not understanding?
* Learn about the [rubber duck debugging method](https://rubberduckdebugging.com/)
* Avoid falling for the [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem/66378#66378)
* Search on GitHub to see if a similar question has been asked
* If possible, provide sample code, a [CodeSandbox](https://codesandbox.io/), or a video/GIF
* The more time you put into asking your question, the better we can help you
## Contributions
See [`contributing.md`](https://github.com/Crazy-Marvin/ToDont/blob/trunk/.github/CONTRIBUTING.md) on how to contribute. Quality PRs are really appreaciated!
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
================================================
FILE: .github/workflows/build.yml
================================================
name: Android Build
on: push
jobs:
build:
name: "Assemble artifacts"
runs-on: ubuntu-latest
steps:
# Checkout
- name: SCM
uses: actions/checkout@v6
- name: "Make gradlew executable"
run: chmod +x ./gradlew
# Assemble artifacts
- name: Assemble
uses: vgaidarji/android-github-actions-build@v1.0.1
with:
args: "./gradlew assemble"
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "📥 Check-out"
uses: actions/checkout@v6
# - name: "🧪 Gradle Wrapper Validation"
# uses: gradle/wrapper-validation-action@v1
- name: "🧰 Install JDK"
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: 8
java-package: jdk
- name: "🧰 Setup Android SDK"
uses: android-actions/setup-android@v4
- name: "🦸 Make gradlew executable"
run: chmod +x ./gradlew
- name: "🏗 Build"
run: ./gradlew assembleDebug
- name: "🧪 Code coverage"
run: ./gradlew test
- name: "📤 Upload code coverage"
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: "🧪 Android LINT"
run: ./gradlew lint
- name: "🧪 Unit test"
run: ./gradlew test
================================================
FILE: .github/workflows/codacy-analysis.yml
================================================
# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.
name: Codacy Security Scan
on:
push:
branches: [ development, master, trunk ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ development ]
schedule:
- cron: '25 8 * * 3'
jobs:
codacy-security-scan:
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v6
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@v4.4.7
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: results.sarif
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: "CodeQL"
on:
push:
branches: [development]
pull_request:
# The branches below must be a subset of the branches above
branches: [trunk]
schedule:
- cron: '0 9 * * 4'
jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
================================================
FILE: .github/workflows/windows.yml
================================================
name: CI
on: push
jobs:
build:
runs-on: windows-latest
steps:
- name: "📥 Check-out"
uses: actions/checkout@v6
# - name: "🧪 Gradle Wrapper Validation"
# uses: gradle/wrapper-validation-action@v1
- name: "🧰 Install JDK"
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: 8
java-package: jdk
- name: "🧰 Setup Android SDK"
uses: android-actions/setup-android@v4
- name: "🦸 Make gradlew executable"
run: chmod +x ./gradlew
- name: "🏗 Build"
run: ./gradlew assembleDebug
- name: "🧪 Code coverage"
run: ./gradlew jacocoTestReport
- name: "📤 Upload code coverage"
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
yml: .codecov.yml
- name: "🧪 Android LINT"
run: ./gradlew lint
- name: "🧪 Unit test"
run: ./gradlew test
================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.aar
*.ap_
*.aab
app/release
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
# Gradle files
.gradle/
build/
.idea/gradle.xml
.idea/libraries
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries/
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
*.jks
*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (e.g. APIs or Firebase)
google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
# Android Profiling
*.hprof
*.dm
# Kotlin
.kotlin/sessions/
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
[](https://github.com/Crazy-Marvin/ToDont/actions)
[](https://github.com/Crazy-Marvin/ToDont/blob/development/LICENSE)
[](https://www.figma.com/file/RoX4IQYdduFH1TxXV3fxla/To-Don%E2%80%99t?node-id=0%3A1)
[](https://github.com/Crazy-Marvin/ToDont/commits)
[](https://github.com/Crazy-Marvin/ToDont/releases)
[](https://github.com/Crazy-Marvin/ToDont/tags)
[](https://github.com/Crazy-Marvin/ToDont/issues)
[](https://github.com/Crazy-Marvin/ToDont/pulls)
[](https://app.codacy.com/gh/Crazy-Marvin/ToDont/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://hosted.weblate.org/engage/todont/)
[](https://sentry.com)
[](https://snyk.io/test/github/Crazy-Marvin/ToDont?targetFile=app%2Fbuild.gradle)
[](https://android-arsenal.com/api?level=19)
[](https://f-droid.org/en/packages/rocks.poopjournal.todont/)
[](https://play.google.com/store/apps/details?id=rocks.poopjournal.todont)
# To Don't
This libre software app keeps track of things you do __NOT__ want to do.
<b>A good look at bad habits.</b> Jot down your vices, right from the home page. Use notes to add details — like a healthy alternative to that chocolate bar you cannot resist. And organise your input with labels.
<b>Faster than you can grab a pen.</b> Find and cross out the bad habits you give into on the home page. These will move to "Done" for the day. The next morning fresh, with a full list of things to avoid.
<b>Stay on top of your progress.</b> The log grants insight into your overall success rates, pinpointing bad habits you have grown most attached to — over a week, a month, or a year. _Your better you can easily work toward an even better you_.
<a href="https://f-droid.org/packages/rocks.poopjournal.todont/">
<img alt="Get it on F-Droid"
height="80"
src="https://f-droid.org/badge/get-it-on.png" />
</a>
<a href="https://play.google.com/store/apps/details?id=rocks.poopjournal.todont">
<img alt="Get it on Google Play"
height="80"
src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" />
</a>
# Contributing
The ```development``` or a feature branch is used while developing the code, and pushed into the master branch ```trunk``` afterwards for releases.
PRs to the ```trunk``` need at least one approving review before getting merged.
Help translate the app at [Hosted Weblate](https://hosted.weblate.org/engage/todont/).
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Check out the [contribution guidelines](https://github.com/Crazy-Marvin/ToDont/blob/trunk/.github/CONTRIBUTING.md) for details please.
# License
[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
plugins {
id 'com.android.application'
// id 'kotlin-android-extensions'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-kapt'
id "io.sentry.android.gradle" version "6.3.0"
// id 'com.google.gms.google-services'
// id 'kotlin-parcelize'
}
android {
namespace 'rocks.poopjournal.todont'
compileSdk 36
defaultConfig {
applicationId "rocks.poopjournal.todont"
minSdkVersion 26
targetSdkVersion 36
versionCode 420
versionName "4.2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
setProperty("archivesBaseName", "ToDont-$versionName")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
buildFeatures {
buildConfig = true
dataBinding true
viewBinding true
// for view binding:
// viewBinding true
}
/*
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}*/
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.16.0'
implementation 'androidx.core:core:1.16.0' // Check for the latest version
implementation 'com.google.android.material:material:1.13.0'
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.13.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.leanback:leanback:1.2.0'
implementation 'androidx.activity:activity:1.13.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.jaredrummler:material-spinner:1.3.1'
implementation 'com.google.android.material:material:1.13.0'
// implementation 'com.ornach.nobobutton:nobobutton:1.5'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
//noinspection GradleCompatible
implementation 'com.android.support:cardview-v7:28.0.0'
implementation("com.github.mreram:showcaseview:1.4.1")
implementation 'com.github.bumptech.glide:glide:5.0.5'
annotationProcessor 'com.github.bumptech.glide:compiler:5.0.5'
implementation 'jp.wasabeef:glide-transformations:4.3.0'
}
================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
================================================
FILE: app/src/androidTest/java/rocks/poopjournal/todont/ExampleInstrumentedTest.kt
================================================
package rocks.poopjournal.todont
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("rocks.poopjournal.todont", appContext.packageName)
}
}
================================================
FILE: app/src/debug/res/drawable/ic_launcher_foreground.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="M71,67L45,41"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="square"/>
</vector>
================================================
FILE: app/src/debug/res/drawable-v24/ic_launcher_background.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="M0,0h108v108h-108z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="54"
android:startY="0"
android:endX="54"
android:endY="108"
android:type="linear">
<item android:offset="0" android:color="#FFFFD500"/>
<item android:offset="1" android:color="#FFFFAA00"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M29,51L45,67L74,38"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#ff7701"/>
</vector>
================================================
FILE: app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_monochrome"/>
</adaptive-icon>
================================================
FILE: app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_monochrome"/>
</adaptive-icon>
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name=".MyApp"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:localeConfig="@xml/locales_config"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Todon.Light"
tools:ignore="ExtraText"
tools:replace="android:allowBackup"
tools:targetApi="tiramisu">
<activity android:name=".About"
/>
<activity android:name=".Settings" />
<activity android:name=".OnBoardingActivity" />
<activity android:name=".LabelsActivity" />
<receiver android:name=".utils.NotificationReceiver" />
<receiver android:name=".utils.NotificationActionReceiver" />
<activity android:name=".MainActivity"
/>
<activity
android:name=".SplashScreenActivity"
android:exported="true">
<intent-filter>
<action
android:name="android.intent.action.MAIN"
android:exported="true" />
<category
android:name="android.intent.category.LAUNCHER"
android:exported="true" />
</intent-filter>
</activity>
<receiver
android:name=".widgets.MyAppSmallWidgetProvider"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_info" />
</receiver>
<service
android:name=".widgets.WidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS" />
<receiver
android:name=".widgets.MyAppNoButtonsWidgetProvider"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/no_buttons_widget_info" />
</receiver>
<service
android:name=".widgets.NoButtonsWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS" />
<meta-data
android:name="io.sentry.dsn"
android:value="https://57ed9cffc2c8b91a85db1dbde5bccc12@o282785.ingest.us.sentry.io/4510467467116544"
/>
<meta-data
android:name="io.sentry.auto-init"
android:value="false" />
<!-- Add data like request headers, user ip address and device name, see https://docs.sentry.io/platforms/android/data-management/data-collected/ for more info -->
<meta-data
android:name="io.sentry.send-default-pii"
android:value="true"
/>
<!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->
<meta-data
android:name="io.sentry.traces.user-interaction.enable"
android:value="true"
/>
<!-- enable screenshot for crashes -->
<meta-data
android:name="io.sentry.attach-screenshot"
android:value="true"
/>
<!-- enable view hierarchy for crashes -->
<meta-data
android:name="io.sentry.attach-view-hierarchy"
android:value="true"
/>
</application>
</manifest>
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/About.kt
================================================
package rocks.poopjournal.todont
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.res.Configuration
import android.graphics.Color
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.View.OnTouchListener
import android.view.WindowManager
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import rocks.poopjournal.todont.utils.SharedPrefUtils
import rocks.poopjournal.todont.utils.setAppTheme
import smartdevelop.ir.eram.showcaseviewlib.GuideView
import smartdevelop.ir.eram.showcaseviewlib.config.DismissType
import smartdevelop.ir.eram.showcaseviewlib.config.Gravity
import smartdevelop.ir.eram.showcaseviewlib.config.PointerType
class About : AppCompatActivity() {
var version: TextView? = null
lateinit var mainRelative : RelativeLayout
private var contributionView: LinearLayout? = null
private var prefUtils: SharedPrefUtils? = null
@SuppressLint("SetTextI18n")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setAppTheme(this)
setContentView(R.layout.activity_about)
//actionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.mygradient))
WindowCompat.setDecorFitsSystemWindows(window, false);
mainRelative = findViewById<RelativeLayout>(R.id.main_relative)
// Apply insets padding to avoid notch / status bar / nav bar overlap
ViewCompat.setOnApplyWindowInsetsListener(mainRelative) { view, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
view.updatePadding(
left = systemBars.left,
top = systemBars.top,
right = systemBars.right,
)
insets
}
window.statusBarColor = Color.TRANSPARENT
WindowCompat.getInsetsController(window, window.decorView).apply {
val isDark =
(resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) ==
Configuration.UI_MODE_NIGHT_YES
isAppearanceLightStatusBars = !isDark
}
contributionView = findViewById(R.id.contributionView)
version = findViewById(R.id.versiontext)
version?.setText(BuildConfig.VERSION_NAME + " Beta ")
prefUtils = SharedPrefUtils(this)
contributionView?.setOnTouchListener(OnTouchListener { view, motionEvent ->
if (!prefUtils!!.getBool(SharedPrefUtils.KEY_CONTRIBUTION_VIEW)) {
val guideView = GuideView.Builder(this@About)
.setContentText(this@About.resources.getString(R.string.help_make_to_don_t_better))
.setTargetView(contributionView)
.setDismissType(DismissType.anywhere)
.setPointerType(PointerType.arrow)
.setGravity(Gravity.center)
.setGuideListener {
prefUtils!!.setBool(
SharedPrefUtils.KEY_CONTRIBUTION_VIEW,
true
)
}
guideView.build().show()
return@OnTouchListener true
}
false
})
}
fun contact_codeaquaria(view: View) {
when (view.id) {
R.id.btnmail_codeaquaria -> {
val mailto = "mailto:codeaquaria20@gmail.com"
val emailIntent = Intent(Intent.ACTION_SENDTO)
emailIntent.setData(Uri.parse(mailto))
try {
startActivity(emailIntent)
} catch (e: ActivityNotFoundException) {
Toast.makeText(this, " Error to open Email ", Toast.LENGTH_SHORT).show()
}
}
R.id.btngit_codeaquaria -> {
val uri =
Uri.parse("https://github.com/arafaatqureshi") // missing 'http://' will cause crashed
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
}
R.id.btntwitter_codeaquaria -> {
val ui =
Uri.parse("https://www.facebook.com/Code-Aquaria-109834144196326") // missing 'http://' will cause crashed
val it = Intent(Intent.ACTION_VIEW, ui)
startActivity(it)
}
}
}
fun contact_codeaquariatar(view: View) {
when (view.id) {
R.id.btnmail_tarik -> {
val mailto = "mailto:imamtariq7@gmail.com"
val emailIntent = Intent(Intent.ACTION_SENDTO)
emailIntent.setData(Uri.parse(mailto))
try {
startActivity(emailIntent)
} catch (e: ActivityNotFoundException) {
Toast.makeText(this, " Error to open Email ", Toast.LENGTH_SHORT).show()
}
}
R.id.btngit_tarik -> {
val uri =
Uri.parse("https://github.com/theftzoku") // missing 'http://' will cause crashed
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
}
R.id.btntwitter_tarik -> {
val ui =
Uri.parse("https://www.facebook.com/Code-Aquaria-109834144196326") // missing 'http://' will cause crashed
val it = Intent(Intent.ACTION_VIEW, ui)
startActivity(it)
}
}
}
fun contact_marvin(view: View) {
when (view.id) {
R.id.btnmail_crazymarvin -> {
val mailto = "mailto:marvin@poopjournal.rocks"
val emailIntent = Intent(Intent.ACTION_SENDTO)
emailIntent.setData(Uri.parse(mailto))
try {
startActivity(emailIntent)
} catch (e: ActivityNotFoundException) {
Toast.makeText(this, " Error to open Email ", Toast.LENGTH_SHORT).show()
}
}
R.id.btngit_crazymarvin -> {
val uri =
Uri.parse("https://github.com/Crazy-Marvin") // missing 'http://' will cause crashed
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
}
R.id.btntwitter_crazymarvin -> {
val u =
Uri.parse("https://twitter.com/CrazyMarvinApps") // missing 'http://' will cause crashed
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
}
}
fun translate(view: View?) {
val u = Uri.parse("https://hosted.weblate.org/projects/todont/")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun report(view: View?) {
val u = Uri.parse("https://github.com/Crazy-Marvin/ToDont/issues")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun viewsource(view: View?) {
val u = Uri.parse("https://github.com/Crazy-Marvin/ToDont")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun back(view: View?) {
// val i = Intent(this@About, Settings::class.java)
// finishAffinity()
// startActivity(i)
finish()
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
}
fun jetpack(view: View?) {
val u = Uri.parse("https://developer.android.com/jetpack")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun logoclicked(view: View?) {
val u = Uri.parse("https://crazymarvin.com/todont")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun feather(view: View?) {
val u = Uri.parse("https://feathericons.com/")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun apacheee(view: View?) {
val u = Uri.parse("https://github.com/Crazy-Marvin/ToDont/blob/development/LICENSE")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun spinner(view: View?) {
val u = Uri.parse("https://github.com/jaredrummler/MaterialSpinner/blob/master/LICENSE")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun nobobutton(view: View?) {
val u = Uri.parse("https://github.com/alex31n/NoboButton/blob/master/LICENSE")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun cImgButton(view: View?) {
val u = Uri.parse("https://github.com/hdodenhof/CircleImageView/blob/master/LICENSE.txt")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun MPAndroidChart(view: View?) {
val u = Uri.parse("https://github.com/PhilJay/MPAndroidChart/blob/master/LICENSE")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun JUnit(view: View?) {
val u = Uri.parse("https://junit.org/junit4/license.html")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun Kotlin(view: View?) {
val u = Uri.parse("https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun Java(view: View?) {
val u = Uri.parse("http://openjdk.java.net/legal/gplv2+ce.html")
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
fun showCaseView(view: View?) {
val u = Uri.parse(resources.getString(R.string.showCaseViewLink))
val i = Intent(Intent.ACTION_VIEW, u)
startActivity(i)
}
override fun onBackPressed() {
super.onBackPressed()
// val i = Intent(this@About, Settings::class.java)
// finishAffinity()
// startActivity(i)
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/Helper.kt
================================================
package rocks.poopjournal.todont
object Helper {
//@JvmField
//var labels_array: ArrayList<String> = ArrayList()
// @JvmField
// var avoidedData: ArrayList<Array<String>> = ArrayList()
// @JvmField
// var avoidedlogdata: ArrayList<Array<String>> = ArrayList()
// @JvmField
// var donedata: ArrayList<Array<String>> = ArrayList()
// @JvmField
// var donelogdata: ArrayList<Array<String>> = ArrayList()
// @JvmField
// var avoidedweeklydata: ArrayList<String> = ArrayList()
// @JvmField
// var avoidedmonthlydata: ArrayList<String> = ArrayList()
// @JvmField
// var donemonthlydata: ArrayList<String> = ArrayList()
// @JvmField
// var doneweeklydata: ArrayList<String> = ArrayList()
// @JvmField
// var doneyearlydata: ArrayList<String> = ArrayList()
// @JvmField
// var avoidedyearlydata: ArrayList<String> = ArrayList()
@JvmField
var SelectedButtonOfTodayTab: Int = 0
@JvmField
var SelectedButtonOfLogTab: Int = 0
@JvmField
var SelectedButtonOfLogDailyTab: Int = 0
@JvmField
var isTodaySelected: Boolean = true
// @JvmField
// var getSelecteddate: String = ""
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/LabelsActivity.kt
================================================
package rocks.poopjournal.todont
import android.app.Dialog
import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.Window
import android.view.WindowManager
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.floatingactionbutton.FloatingActionButton
import rocks.poopjournal.todont.adapters.LabelsAdapter
import rocks.poopjournal.todont.databinding.ActivityLabelsBinding
import rocks.poopjournal.todont.databinding.DialogboxLabelsBinding
import rocks.poopjournal.todont.model.Label
import rocks.poopjournal.todont.showcaseview.RippleBackground
import rocks.poopjournal.todont.showcaseview.ShowcaseViewBuilder
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.SharedPrefUtils
import rocks.poopjournal.todont.utils.setAppTheme
import smartdevelop.ir.eram.showcaseviewlib.GuideView
import smartdevelop.ir.eram.showcaseviewlib.config.DismissType
import smartdevelop.ir.eram.showcaseviewlib.config.Gravity
import smartdevelop.ir.eram.showcaseviewlib.config.PointerType
class LabelsActivity : AppCompatActivity() {
private var rvLabels: RecyclerView? = null
private var dbHelper: DatabaseUtils? = null
private var adapter: LabelsAdapter? = null
private var labels = ArrayList<Label>()
private var labelsFloatingButton: FloatingActionButton? = null
private var showcaseViewBuilder: ShowcaseViewBuilder? = null
private var prefUtils: SharedPrefUtils? = null
private var fabHighlighter: RippleBackground? = null
private lateinit var binding: ActivityLabelsBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setAppTheme(this)
binding = ActivityLabelsBinding.inflate(layoutInflater)
setContentView(binding.root)
//actionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.mygradient))
rvLabels = binding.rvLabels
prefUtils = SharedPrefUtils(this)
showcaseViewBuilder = ShowcaseViewBuilder.init(this)
fabHighlighter = binding.fabHighlighter
dbHelper = DatabaseUtils(this)
labelsFloatingButton = binding.labelFloatingbtn
loadLabel()
rvLabels?.setLayoutManager(LinearLayoutManager(this))
ItemTouchHelper(itemTouchHelper).attachToRecyclerView(rvLabels)
adapter = LabelsAdapter(this, dbHelper!!, labels)
rvLabels?.setAdapter(adapter)
rvLabels?.setLayoutManager(LinearLayoutManager(this))
labelsFloatingButton?.setOnClickListener(View.OnClickListener {
if (!prefUtils!!.getBool("plus1")) {
showcaseFab()
} else {
showLabelAddingDialog()
}
})
}
private fun showLabelAddingDialog() {
val dialog = Dialog(this@LabelsActivity,R.style.Dialog_Theme)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
// Inflate the custom layout
val dialogView = DialogboxLabelsBinding.inflate(layoutInflater)
dialog.setContentView(dialogView.root)
// Set the dialog background to transparent to support rounded corners from CardView
dialog.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
// Set the layout parameters for the dialog
val lp = dialog.window?.attributes
lp?.width = WindowManager.LayoutParams.MATCH_PARENT
lp?.height = WindowManager.LayoutParams.WRAP_CONTENT
//lp?.dimAmount = 0.8f // Adjust the dimming amount for background
// dialog.window?.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) // Ensure the dim effect is enabled
dialog.window?.attributes = lp
// Handle the Save button click
dialogView.saveLabelButton.setOnClickListener {
val enteredText = dialogView.label.text.toString().replace("'", "''")
if (enteredText.trim().isNotEmpty()) {
dbHelper?.insertLabel(Label(name = enteredText))
loadLabel() // Refresh the label list
adapter?.updateData(labels) // Update the adapter data
dialog.dismiss() // Dismiss the dialog
} else {
dialogView.label.error = "Please enter a label" // Show error for empty input
}
}
// Show the dialog
dialog.show()
}
private fun loadLabel() {
dbHelper?.getAllLabels()?.let {
labels.clear()
labels.addAll(it)
}
}
private var itemTouchHelper: ItemTouchHelper.SimpleCallback =
object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
override fun onMove(
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder
): Boolean {
return false
}
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
if (direction == 8) {
val dialog = AlertDialog.Builder(this@LabelsActivity)
dialog.setMessage(getString(R.string.do_you_really_want_to_delete_this_this_will_also_delete_all_habits_related_to_this_label))
dialog.setCancelable(true)
dialog.setPositiveButton(
"Yes"
) { dialog, id ->
val i = viewHolder.adapterPosition
val habits=dbHelper?.getHabitsWithLabelId(labels[i].labelId)
for(habit in habits!!){
dbHelper?.deleteAllHabitRecords(habit.id)
dbHelper?.deleteHabit(habit.id)
}
dbHelper?.deleteLabel(labels[i].labelId)
labels.removeAt(i)
adapter?.notifyItemRemoved(i)
overridePendingTransition(0, 0)
dialog.cancel()
}
dialog.setNegativeButton(
"No"
) { dialog, id ->
// val intent = Intent(applicationContext, LabelsActivity::class.java)
// startActivity(intent)
adapter?.notifyDataSetChanged()
overridePendingTransition(0, 0)
dialog.dismiss()
}
val alert11 = dialog.create()
alert11.show()
}
}
}
fun backBtnClicked(view: View?) {
// val i = Intent(this, MainActivity::class.java)
// startActivity(i)
finish()
}
private fun showcaseFab() {
val guideView = GuideView.Builder(this@LabelsActivity)
.setContentText(getString(R.string.add_label))
.setTargetView(labelsFloatingButton)
.setDismissType(DismissType.anywhere)
.setPointerType(PointerType.arrow)
.setGravity(Gravity.center)
.setGuideListener {
prefUtils!!.setBool(
"plus1",
true
)
}
guideView.build().show()
}
override fun onBackPressed() {
super.onBackPressed()
// val i = Intent(this, MainActivity::class.java)
// startActivity(i)
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/MainActivity.kt
================================================
package rocks.poopjournal.todont
import android.content.Intent
import android.content.res.Configuration
import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updateLayoutParams
import androidx.core.view.updatePadding
import androidx.databinding.DataBindingUtil
import rocks.poopjournal.todont.databinding.ActivityMainBinding
import rocks.poopjournal.todont.fragments.FragmentLog
import rocks.poopjournal.todont.fragments.FragmentToday
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.SharedPrefUtils
import rocks.poopjournal.todont.utils.setAppTheme
import smartdevelop.ir.eram.showcaseviewlib.GuideView
import smartdevelop.ir.eram.showcaseviewlib.config.DismissType
import smartdevelop.ir.eram.showcaseviewlib.config.Gravity
import smartdevelop.ir.eram.showcaseviewlib.config.PointerType
class MainActivity : AppCompatActivity() {
// Database controller instance
private var dbHelper: DatabaseUtils? = null
private lateinit var binding: ActivityMainBinding
private var prefUtils: SharedPrefUtils? = null
private lateinit var fragmentToday: FragmentToday
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//setTheme(R.style.Theme_Todon_Dracula)
setAppTheme(this)
binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
WindowCompat.setDecorFitsSystemWindows(window, false);
// Apply insets padding to avoid notch / status bar / nav bar overlap
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
view.updatePadding(
left = systemBars.left,
top = systemBars.top,
right = systemBars.right,
)
insets
}
window.statusBarColor = Color.TRANSPARENT
WindowCompat.getInsetsController(window, window.decorView).apply {
val isDark =
(resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) ==
Configuration.UI_MODE_NIGHT_YES
isAppearanceLightStatusBars = !isDark
}
// Initialize the database controller
prefUtils = SharedPrefUtils(this)
dbHelper = DatabaseUtils(this)
// Set toolbar text to "Today"
binding.toolbartext.setText(R.string.today)
// Make the label and settings views visible
binding.label.visibility = View.VISIBLE
binding.settings.visibility = View.VISIBLE
// Retrieve and apply the night mode setting from the database
//db?.getNightMode()
binding.floatingbtn.setOnClickListener {
if (!prefUtils!!.getBool("plus")) {
showcaseFab(it)
}else{
fragmentToday.addNewHabit()
}
}
// Customize the action bar background
//actionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.mygradient))
// Define a listener for the bottom navigation view
binding.navigationView.setOnNavigationItemSelectedListener { item ->
when (item.itemId) {
R.id.navigation_today -> {
// Switch to the 'FragmentToday' when "Today" is selected
replaceFragment(fragmentToday)
showFAB()
binding.toolbartext.setText(R.string.today)
binding.label.visibility = View.VISIBLE
binding.settings.visibility = View.VISIBLE
true
}
R.id.navigation_log -> {
// Show tutorial guide for first-time usage
if (prefUtils?.getBool(SharedPrefUtils.KEY_LOG) != true && !intent.getBooleanExtra(
"openLog",
false
)
) {
showLogGuide()
} else {
// Switch to the 'FragmentLog' when "Log" is selected
replaceFragment(FragmentLog())
hideFAB()
binding.toolbartext.setText(R.string.log)
binding.label.visibility = View.INVISIBLE
binding.settings.visibility = View.INVISIBLE
}
true
}
else -> false
}
}
// Initialize the default fragment
if (intent.getBooleanExtra("openLog", false)) {
binding.navigationView.selectedItemId = R.id.navigation_log
} else if (intent.getBooleanExtra(Constants.ADD_NEW_HABIT, false)) {
fragmentToday=FragmentToday.newInstance(true)
replaceFragment(fragmentToday)
} else {
fragmentToday=FragmentToday.newInstance(false)
replaceFragment(fragmentToday)
}
// Set label click action
binding.label.setOnClickListener {
val intent = Intent(this, LabelsActivity::class.java)
startActivity(intent)
//finish()
}
}
private fun showLogGuide() {
GuideView.Builder(this@MainActivity)
.setContentText(getString(R.string.view_your_stats))
.setTargetView(binding.navigationView.findViewById(R.id.navigation_log))
.setDismissType(DismissType.anywhere)
.setPointerType(PointerType.arrow)
.setGravity(Gravity.center)
.setGuideListener {
prefUtils?.setBool(SharedPrefUtils.KEY_LOG, true)
}
.build()
.show()
}
private fun showcaseFab(view:View) {
val guideView = GuideView.Builder(this)
.setContentText(getString(R.string.to_start_off_put_down_a_bad_habit))
.setTargetView(view)
.setDismissType(DismissType.anywhere)
.setPointerType(PointerType.arrow)
.setGravity(Gravity.center)
.setGuideListener {
prefUtils!!.setBool(
"plus",
true
)
}
guideView.build().show()
}
fun hideFAB() {
binding.floatingbtn.visibility = View.INVISIBLE
}
fun showFAB() {
binding.floatingbtn.visibility = View.VISIBLE
}
private fun replaceFragment(fragment: androidx.fragment.app.Fragment) {
val fragmentTag = fragment.javaClass.simpleName
// Replace the fragment and add it to the back stack
supportFragmentManager.beginTransaction()
.replace(R.id.container, fragment, fragmentTag)
.commit()
}
private val settingsLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode == RESULT_OK) {
recreate() // Recreate the activity if the result is OK
}
}
// Handle the "Settings" action when a view is clicked
fun mySettings(view: View) {
val intent = Intent(this, Settings::class.java)
settingsLauncher.launch(intent)
overridePendingTransition(0, 0)
//finish()
}
// Handle the back button press
override fun onBackPressed() {
// // Customize the back button behavior
// if (supportFragmentManager.backStackEntryCount > 0) {
// // If fragments are in the back stack, pop the latest one
// supportFragmentManager.popBackStack()
// } else {
// If no fragments are in the back stack, exit the activity
super.onBackPressed()
//finish()
// }
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/MyApp.kt
================================================
package rocks.poopjournal.todont
import android.app.Application
import io.sentry.android.core.SentryAndroid
import rocks.poopjournal.todont.utils.SharedPrefUtils
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
val pref = SharedPrefUtils(this)
if (pref.isMonitorEnabled()) {
enableSentry()
} else {
disableSentry()
}
}
private fun enableSentry() {
SentryAndroid.init(this) { options ->
// DSN will be read automatically from manifest
options.isEnableUserInteractionTracing = true
options.isAttachScreenshot = true
options.isAttachViewHierarchy = true
}
}
private fun disableSentry() {
io.sentry.Sentry.close()
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/NotificationReceiver.kt
================================================
package rocks.poopjournal.todont
import android.Manifest
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
class NotificationReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val channel =
NotificationChannel("Tasks", "tasks reminder", NotificationManager.IMPORTANCE_HIGH)
val manager = ContextCompat.getSystemService(
context,
NotificationManager::class.java
)
manager!!.createNotificationChannel(channel)
val task = intent.getStringExtra("task")
// Create notification when the alarm is triggered
val pendingIntent = Intent(context, MainActivity::class.java)
pendingIntent.putExtra("openLog", true)
val builder = NotificationCompat.Builder(context, "Tasks")
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(context.getString(R.string.todon_t_reminder))
.setContentText(context.getString(R.string.mark_your_todon_t_task)+task)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setAutoCancel(true)
.setContentIntent(
PendingIntent.getActivity(
context,
0,
pendingIntent,
PendingIntent.FLAG_IMMUTABLE
)
) // Pass the pending intent here
val notificationManager = NotificationManagerCompat.from(context)
if (ActivityCompat.checkSelfPermission(
context,
Manifest.permission.POST_NOTIFICATIONS
) != PackageManager.PERMISSION_GRANTED
) {
return
}
notificationManager.notify(1, builder.build())
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/OnBoardingActivity.kt
================================================
package rocks.poopjournal.todont
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.util.TypedValue
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import rocks.poopjournal.todont.databinding.ActivityOnBoardingBinding
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.SharedPrefUtils
import rocks.poopjournal.todont.utils.ThemeMode
import rocks.poopjournal.todont.utils.setAppTheme
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
class OnBoardingActivity : AppCompatActivity() {
private lateinit var binding: ActivityOnBoardingBinding
private lateinit var sharedPrefUtils: SharedPrefUtils
private val calendar: Calendar = Calendar.getInstance()
private val dateFormat = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setAppTheme(this)
// Use ViewBinding to inflate the layout
binding = ActivityOnBoardingBinding.inflate(layoutInflater)
setContentView(binding.root)
//actionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.mygradient))
// Change the status bar color for devices with Lollipop or higher
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val typedValue = TypedValue()
theme.resolveAttribute(com.google.android.material.R.attr.backgroundColor, typedValue, true)
window.statusBarColor = typedValue.data
}
// Initialize SharedPrefUtils
sharedPrefUtils = SharedPrefUtils(this)
// Set the button click listener using coroutines for better handling of async tasks
binding.btncontinue.setOnClickListener {
MainScope().launch {
handleOnBoardingCompletion()
}
}
}
/**
* Handle the on-boarding completion, save necessary data to SharedPreferences and navigate to MainActivity.
*/
private fun handleOnBoardingCompletion() {
// Save settings in SharedPreferences
sharedPrefUtils.apply {
putString(SharedPrefUtils.KEY_NIGHT_MODE, ThemeMode.LIGHT_MODE.value)
putString(SharedPrefUtils.KEY_FIRST_TIME, Constants.NO)
putString(Constants.INITIAL_DATE_KEY, dateFormat.format(calendar.time))
}
// Start MainActivity
val intent = Intent(this@OnBoardingActivity, MainActivity::class.java)
startActivity(intent)
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/Settings.kt
================================================
package rocks.poopjournal.todont;
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.app.Dialog;
import android.app.LocaleManager;
import android.content.ContentValues
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration
import android.content.res.Resources.Theme
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.LocaleList;
import android.provider.DocumentsContract;
import android.provider.MediaStore
import android.util.Log;
import android.view.View;
import android.view.ViewGroup
import android.view.Window;
import android.view.WindowManager
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView
import android.widget.Toast;
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import rocks.poopjournal.todont.databinding.ActivitySettingsBinding
import rocks.poopjournal.todont.databinding.DialogInfoBinding
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import java.io.FileOutputStream;
import java.util.Locale;
import rocks.poopjournal.todont.utils.SharedPrefUtils;
import rocks.poopjournal.todont.utils.ThemeMode
import rocks.poopjournal.todont.utils.getAppTheme
import rocks.poopjournal.todont.utils.setAppTheme
import smartdevelop.ir.eram.showcaseviewlib.GuideView;
import smartdevelop.ir.eram.showcaseviewlib.config.DismissType;
import smartdevelop.ir.eram.showcaseviewlib.config.Gravity;
import smartdevelop.ir.eram.showcaseviewlib.config.PointerType;
import java.io.File
import java.io.FileInputStream
import java.io.IOException
class Settings : AppCompatActivity() {
private lateinit var binding: ActivitySettingsBinding
private lateinit var prefUtils: SharedPrefUtils
private lateinit var dbHelper: DatabaseUtils
private val REQUEST_CODE_WRITE_EXTERNAL_STORAGE = 100
private val REQUEST_CODE_PICK_DB_FILE = 200
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setAppTheme(this)
binding = ActivitySettingsBinding.inflate(layoutInflater)
setContentView(binding.root)
//actionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.mygradient))
WindowCompat.setDecorFitsSystemWindows(window, false);
// Apply insets padding to avoid notch / status bar / nav bar overlap
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
view.updatePadding(
left = systemBars.left,
top = systemBars.top,
right = systemBars.right,
bottom = systemBars.bottom
)
insets
}
window.statusBarColor = Color.TRANSPARENT
WindowCompat.getInsetsController(window, window.decorView).apply {
val isDark =
(resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) ==
Configuration.UI_MODE_NIGHT_YES
isAppearanceLightStatusBars = !isDark
}
prefUtils = SharedPrefUtils(this)
dbHelper = DatabaseUtils(this)
// Handle back press
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
finishMYActivity()
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
}
})
binding.btnBack.setOnClickListener {
finishMYActivity()
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
}
binding.modetitle.text = getThemeMode(this.getAppTheme())
binding.backUpButton.setOnClickListener {
if (checkStoragePermission()) {
backupDatabase()
}
}
binding.restoreButton.setOnClickListener {
if (checkStoragePermission()) {
openFilePicker()
}
}
binding.monitorInfoBtn.setOnClickListener {
showMaterialInfoDialog()
}
binding.monitorSwitch.isChecked = prefUtils.isMonitorEnabled()
binding.monitorSwitch.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
// switch turned ON
prefUtils.setMonitorEnabled(true)
} else {
// switch turned OFF
prefUtils.setMonitorEnabled(false)
}
}
}
// Check and request storage permission
private fun checkStoragePermission(): Boolean {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q || ContextCompat.checkSelfPermission(
this,
android.Manifest.permission.WRITE_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED
) {
true
} else {
ActivityCompat.requestPermissions(
this,
arrayOf(android.Manifest.permission.WRITE_EXTERNAL_STORAGE),
REQUEST_CODE_WRITE_EXTERNAL_STORAGE
)
false
}
}
// Backup the database to the Downloads folder
private fun backupDatabase() {
try {
val dbFile = dbHelper.getDatabaseFile()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
saveFileToDownloadsUsingMediaStore(dbFile)
} else {
val downloadsDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
val destFile = File(downloadsDir, dbFile.name)
copyFile(dbFile, destFile)
Toast.makeText(this, "Database backed up to Downloads", Toast.LENGTH_LONG).show()
}
} catch (e: Exception) {
e.printStackTrace()
Toast.makeText(this, "Failed to backup database: ${e.message}", Toast.LENGTH_LONG).show()
}
}
// Save file to Downloads using MediaStore (Android 10+)
@RequiresApi(Build.VERSION_CODES.Q)
private fun saveFileToDownloadsUsingMediaStore(sourceFile: File) {
val contentResolver = contentResolver
val values = ContentValues().apply {
put(MediaStore.MediaColumns.DISPLAY_NAME, sourceFile.name)
put(MediaStore.MediaColumns.MIME_TYPE, "application/octet-stream")
put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS)
}
val fileUri = contentResolver.insert(MediaStore.Downloads.EXTERNAL_CONTENT_URI, values)
if (fileUri != null) {
try {
contentResolver.openOutputStream(fileUri)?.use { outputStream ->
FileInputStream(sourceFile).use { inputStream ->
inputStream.copyTo(outputStream)
}
}
Toast.makeText(this, "Database backed up to Downloads", Toast.LENGTH_LONG).show()
} catch (e: Exception) {
e.printStackTrace()
Toast.makeText(this, "Failed to save file: ${e.message}", Toast.LENGTH_LONG).show()
}
}
}
// Open file picker to select a backup file
private fun openFilePicker() {
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
addCategory(Intent.CATEGORY_OPENABLE)
type = "application/octet-stream"
}
startActivityForResult(intent, REQUEST_CODE_PICK_DB_FILE)
}
// Handle file picker result
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_PICK_DB_FILE && resultCode == RESULT_OK && data != null) {
val fileUri = data.data
if (fileUri != null) {
restoreDatabase(fileUri)
}
}
}
// Restore the database from the selected file
private fun restoreDatabase(fileUri: Uri) {
try {
dbHelper.close()
val dbFile = dbHelper.getDatabaseFile()
contentResolver.openInputStream(fileUri)?.use { inputStream ->
FileOutputStream(dbFile).use { outputStream ->
inputStream.copyTo(outputStream)
}
}
Toast.makeText(this, "Database restored successfully", Toast.LENGTH_LONG).show()
} catch (e: Exception) {
e.printStackTrace()
Toast.makeText(this, "Failed to restore database: ${e.message}", Toast.LENGTH_LONG).show()
} finally {
dbHelper = DatabaseUtils(this) // Reinitialize the database helper
}
}
// Copy file from source to destination
@Throws(IOException::class)
private fun copyFile(sourceFile: File, destFile: File) {
FileInputStream(sourceFile).use { inputStream ->
FileOutputStream(destFile).use { outputStream ->
inputStream.copyTo(outputStream)
}
}
}
// Handle permission request result
override fun onRequestPermissionsResult(
requestCode: Int,
permissions: Array<out String>,
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
if (requestCode == REQUEST_CODE_WRITE_EXTERNAL_STORAGE) {
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
backupDatabase()
} else {
Toast.makeText(this, "Permission denied", Toast.LENGTH_LONG).show()
}
}
}
fun changeMode(view: View) {
if (prefUtils.getBool(SharedPrefUtils.KEY_APPEAR_VIEW)) {
val guideView = GuideView.Builder(this)
.setContentText(getString(R.string.help_make_to_don_t_better))
.setTargetView(view)
.setDismissType(DismissType.anywhere)
.setPointerType(PointerType.arrow)
.setGravity(Gravity.center)
.setGuideListener { prefUtils.setBool(SharedPrefUtils.KEY_APPEAR_VIEW, true) }
.build()
guideView.show()
} else {
val dialog = Dialog(this).apply {
requestWindowFeature(Window.FEATURE_NO_TITLE)
setContentView(R.layout.dialogbox)
setCancelable(false)
window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
}
val lp = dialog.window!!.attributes
lp.dimAmount = 0.9f
val window = dialog.window
window!!.setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
dialog.window!!.attributes = lp
val btndone = dialog.findViewById<TextView>(R.id.btndone)
val light = dialog.findViewById<RadioButton>(R.id.light)
val dark = dialog.findViewById<RadioButton>(R.id.dark)
val dracula = dialog.findViewById<RadioButton>(R.id.dracula)
val fsys = dialog.findViewById<RadioButton>(R.id.followsys)
val draculaPro= dialog.findViewById<RadioButton>(R.id.dracula_pro)
val draculaProAlucard= dialog.findViewById<RadioButton>(R.id.dracula_pro_alucard)
val draculaProBuffy= dialog.findViewById<RadioButton>(R.id.dracula_pro_buffy)
val draculaProBlade= dialog.findViewById<RadioButton>(R.id.dracula_pro_blade)
when (binding.modetitle.text.toString()) {
resources.getString(R.string.followsys) -> fsys.isChecked = true
resources.getString(R.string.light) -> light.isChecked = true
resources.getString(R.string.dark) -> dark.isChecked = true
resources.getString(R.string.dracula) -> dracula.isChecked = true
resources.getString(R.string.dracula_pro) -> draculaPro.isChecked = true
resources.getString(R.string.dracula_pro_alucard) -> draculaProAlucard.isChecked = true
resources.getString(R.string.dracula_pro_buffy) -> draculaProBuffy.isChecked = true
resources.getString(R.string.dracula_pro_blade) -> draculaProBlade.isChecked = true
}
dialog.window?.attributes = dialog.window?.attributes?.apply {
dimAmount = 0.9f
}
btndone.setOnClickListener {
setNewThemeMode()
dialog.dismiss()
}
dialog.show()
}
}
private fun setNewThemeMode() {
// Usage in when block
val theme=prefUtils.getThemeMode()
when (theme) {
ThemeMode.FOLLOW_SYS.value -> {
applyThemeMode(
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.FOLLOW_SYS.value
)
}
ThemeMode.LIGHT_MODE.value-> {
applyThemeMode(
//AppCompatDelegate.MODE_NIGHT_NO,
R.style.Theme_Todon_Light,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.LIGHT_MODE.value
)
}
ThemeMode.DARK_MODE.value -> {
applyThemeMode(
// AppCompatDelegate.MODE_NIGHT_YES,
R.style.Theme_Todon_Dark,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.DARK_MODE.value
)
}
ThemeMode.DRACULA.value -> {
applyThemeMode(
//AppCompatDelegate.MODE_NIGHT_YES,
R.style.Theme_Todon_Dracula,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.DRACULA.value
)
}
ThemeMode.DRACULA_PRO.value -> {
applyThemeMode(
//AppCompatDelegate.MODE_NIGHT_YES,
R.style.Theme_Todon_Dracula_Pro,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.DRACULA_PRO.value
)
}
ThemeMode.DRACULA_PRO_ALUCARD.value -> {
applyThemeMode(
//AppCompatDelegate.MODE_NIGHT_YES,
R.style.Theme_Todon_Dracula_Alucard,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.DRACULA_PRO_ALUCARD.value
)
}
ThemeMode.DRACULA_PRO_BUFFY.value -> {
applyThemeMode(
//AppCompatDelegate.MODE_NIGHT_YES,
R.style.Theme_Todon_DraculaBlade_Buffy,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.DRACULA_PRO_BUFFY.value
)
}
ThemeMode.DRACULA_PRO_BLADE.value -> {
applyThemeMode(
//AppCompatDelegate.MODE_NIGHT_YES,
R.style.Theme_Todon_DraculaBlade,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.DRACULA_PRO_BLADE.value
)
}
else -> {
applyThemeMode(
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM,
String.format("To Don't is using the %s now",getThemeMode(theme)),
ThemeMode.FOLLOW_SYS.value
)
}
}
}
private fun applyThemeMode(mode: Int, toastMessageRes: String, modeTitle: String) {
Log.d("checkmode", "Mode set to: $mode")
//binding.modetitle.text = getThemeMode(modeTitle)
//prefUtils.setThemeMode(modeTitle)
//AppCompatDelegate.setDefaultNightMode(mode)
//setTheme(mode)
Constants.CURRENT_THEME=prefUtils.getThemeMode()
if(Constants.IS_OK){
Toast.makeText(applicationContext, toastMessageRes, Toast.LENGTH_SHORT).show()
recreate()
}
}
private fun getThemeMode(modeTitle: String): String {
return when (modeTitle) {
ThemeMode.FOLLOW_SYS.value -> {
resources.getString(R.string.followsys)
}
ThemeMode.LIGHT_MODE.value -> {
resources.getString(R.string.light)
}
ThemeMode.DARK_MODE.value -> {
resources.getString(R.string.dark)
}
ThemeMode.DRACULA.value -> {
resources.getString(R.string.dracula)
}
ThemeMode.DRACULA_PRO.value ->{
resources.getString(R.string.dracula_pro)
}
ThemeMode.DRACULA_PRO_ALUCARD.value ->{
resources.getString(R.string.dracula_pro_alucard)
}
ThemeMode.DRACULA_PRO_BUFFY.value ->{
resources.getString(R.string.dracula_pro_buffy)
}
ThemeMode.DRACULA_PRO_BLADE.value ->{
resources.getString(R.string.dracula_pro_blade)
}
else -> {
modeTitle
}
}
}
fun onRadioButtonClicked(view: View) {
// Check if the button is now checked
val checked = (view as RadioButton).isChecked
// Determine which radio button was clicked
when (view.id) {
R.id.followsys -> {
if (checked) {
updateThemeMode(ThemeMode.FOLLOW_SYS.value)
}
}
R.id.light -> {
if (checked) {
updateThemeMode(ThemeMode.LIGHT_MODE.value)
}
}
R.id.dark -> {
if (checked) {
updateThemeMode(ThemeMode.DARK_MODE.value)
}
}
R.id.dracula -> {
if (checked) {
updateThemeMode(ThemeMode.DRACULA.value)
}
}
R.id.dracula_pro -> {
if (checked) {
updateThemeMode(ThemeMode.DRACULA_PRO.value)
}
}
R.id.dracula_pro_alucard -> {
if (checked) {
updateThemeMode(ThemeMode.DRACULA_PRO_ALUCARD.value)
}
}
R.id.dracula_pro_buffy -> {
if (checked) {
updateThemeMode(ThemeMode.DRACULA_PRO_BUFFY.value)
}
}
R.id.dracula_pro_blade -> {
if (checked) {
updateThemeMode(ThemeMode.DRACULA_PRO_BLADE.value)
}
}
}
Constants.IS_OK= Constants.CURRENT_THEME != prefUtils.getThemeMode()
}
private fun updateThemeMode(value: String) {
binding.modetitle.text =getThemeMode(value)
prefUtils.setThemeMode(value)
}
private fun backBtn(view: View) {
finishMYActivity()
}
fun aboutus(view: View) {
Intent(this, About::class.java).also { intent ->
//finishAffinity()
startActivity(intent)
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
}
}
fun restore(view: View) {
openFilePicker()
}
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
private fun setAppLocale(locale: Locale) {
val localeManager = getSystemService(LocaleManager::class.java)
localeManager?.applicationLocales = LocaleList(locale)
}
private fun showPermissionDeniedDialog() {
AlertDialog.Builder(this)
.setTitle(getString(R.string.permission_required))
.setMessage(getString(R.string.this_app_requires_access_to_your_external_storage_to_restore_the_database_please_enable_this_permission_in_the_app_settings))
.setPositiveButton(getString(R.string.open_settings)) { _, _ ->
val intent =
Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
data = Uri.fromParts("package", packageName, null)
}
startActivity(intent)
}
.setNegativeButton("Cancel") { dialog, _ ->
dialog.dismiss()
}
.show()
}
private fun showMaterialInfoDialog() {
val dialogBinding = DialogInfoBinding.inflate(layoutInflater)
val dialog = MaterialAlertDialogBuilder(this)
.setView(dialogBinding.root)
.setCancelable(true)
.create()
dialog.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
dialogBinding.btnOk.setOnClickListener {
dialog.dismiss()
}
dialog.show()
}
fun finishMYActivity(){
if(Constants.IS_OK){
setResult(RESULT_OK)
}else{
setResult(RESULT_CANCELED)
}
finish()
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/SplashScreenActivity.kt
================================================
package rocks.poopjournal.todont
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import rocks.poopjournal.todont.databinding.ActivitySplashScreenBinding
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.SharedPrefUtils
import rocks.poopjournal.todont.utils.ThemeMode
import rocks.poopjournal.todont.utils.setAppTheme
class SplashScreenActivity : AppCompatActivity() {
private lateinit var sharedPrefUtils: SharedPrefUtils
private val splashScope = CoroutineScope(Dispatchers.Main)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setAppTheme(this)
// Use viewBinding to inflate the layout
val binding = ActivitySplashScreenBinding.inflate(layoutInflater)
setContentView(binding.root)
//actionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.mygradient))
// Initialize SharedPrefUtils
sharedPrefUtils = SharedPrefUtils(this)
// Retrieve first-time check and apply theme if necessary
val isFirstTime = sharedPrefUtils.getString(SharedPrefUtils.KEY_FIRST_TIME, Constants.NO)
splashScope.launch {
delay(2000) // 2-second delay before launching the next activity
checkStatus(isFirstTime) // Pass the actual value from SharedPreferences or logic
}
}
private fun checkStatus(isFirstTime: String?) {
val nextActivity = if (isFirstTime == Constants.NO) {
MainActivity::class.java
} else {
OnBoardingActivity::class.java
}
startActivity(Intent(this@SplashScreenActivity, nextActivity))
finishAffinity() // Ensures the splash screen is properly closed
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
}
override fun onDestroy() {
super.onDestroy()
splashScope.cancel() // Cancel coroutine to prevent memory leaks
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/adapters/AvoidedOrDoneAdapter.kt
================================================
package rocks.poopjournal.todont.adapters
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.databinding.RecyclerviewLayoutBinding
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.utils.DatabaseUtils
class AvoidedOrDoneAdapter(
val context: Context,
val dbHelper: DatabaseUtils,
val habits:ArrayList<Habit>,
val isAvoided:Boolean,
val resIcon:Int
) :
RecyclerView.Adapter<AvoidedOrDoneAdapter.RecyclerViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): RecyclerViewHolder {
val inflater = LayoutInflater.from(viewGroup.context)
val binding=RecyclerviewLayoutBinding.inflate(inflater,viewGroup,false)
return RecyclerViewHolder(binding)
}
override fun onBindViewHolder(holder: RecyclerViewHolder, position: Int) {
val habit = habits[position]
with(holder.binding){
tvAvoidedCount.text=if(isAvoided){
habit.countAvoided.toString()
}else{
habit.countDone.toString()
}
tvHabitName.text=habit.name
tvLabelName.text=habit.label?.name
}
}
override fun getItemCount()=habits.size
inner class RecyclerViewHolder(val binding: RecyclerviewLayoutBinding) : RecyclerView.ViewHolder(binding.root) {
init {
binding.btnAddToAvoided.setBackgroundResource(resIcon)
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/adapters/AvoidedOrDoneLogAdapter.kt
================================================
package rocks.poopjournal.todont.adapters
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.databinding.RecyclerviewLayoutBinding
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.HabitsBottomSheetDialog
class AvoidedOrDoneLogAdapter(
val context: Context,
val dbHelper: DatabaseUtils,
val habits: ArrayList<Habit>,
val isAvoided: Boolean,
val resIcon: Int
) :
RecyclerView.Adapter<AvoidedOrDoneLogAdapter.RecyclerViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): RecyclerViewHolder {
val inflater = LayoutInflater.from(viewGroup.context)
val binding= RecyclerviewLayoutBinding.inflate(inflater,viewGroup,false)
return RecyclerViewHolder(binding)
}
override fun onBindViewHolder(holder: RecyclerViewHolder, position: Int) {
val habit = habits[position]
with(holder.binding){
tvAvoidedCount.text=if(isAvoided){
habit.countAvoided.toString()
}else{
habit.countDone.toString()
}
tvHabitName.text=habit.name
tvLabelName.text=habit.label?.name
llRootView.setOnClickListener{
val bottomSheet=HabitsBottomSheetDialog(
context,
habit,
position,
dbHelper,
object :HabitsBottomSheetDialog.HabitSheetListener{
override fun updateCount(_habit: Habit, _position: Int) {
habits[_position].countDone=_habit.countDone
habits[_position].countAvoided=_habit.countAvoided
}
override fun deleted(_habit: Habit, _position: Int) {
habits.removeAt(_position)
notifyItemRemoved(_position)
notifyItemRangeChanged(_position,habits.size)
}
override fun dismissed() {
notifyDataSetChanged()
}
}
)
}
}
}
override fun getItemCount()=habits.size
inner class RecyclerViewHolder(val binding: RecyclerviewLayoutBinding) : RecyclerView.ViewHolder(binding.root) {
init {
binding.btnAddToAvoided.setBackgroundResource(resIcon)
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/adapters/HabitsAdapter.kt
================================================
package rocks.poopjournal.todont.adapters
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.Helper
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.databinding.RecyclerviewLayoutHabitsBinding
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.model.HabitRecord
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.HabitStatus
import rocks.poopjournal.todont.utils.HabitsBottomSheetDialog
import rocks.poopjournal.todont.utils.SharedPrefUtils
import smartdevelop.ir.eram.showcaseviewlib.GuideView
import smartdevelop.ir.eram.showcaseviewlib.config.DismissType
import smartdevelop.ir.eram.showcaseviewlib.config.Gravity
import smartdevelop.ir.eram.showcaseviewlib.config.PointerType
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
class HabitsAdapter(
var context: Context,
private var dbHelper: DatabaseUtils,
var habits: ArrayList<Habit>,
) :
RecyclerView.Adapter<HabitsAdapter.RecyclerViewHolder>() {
private val prefUtils: SharedPrefUtils = SharedPrefUtils(context)
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): RecyclerViewHolder {
val inflater = LayoutInflater.from(viewGroup.context)
val binding=RecyclerviewLayoutHabitsBinding.inflate(inflater,viewGroup,false)
return RecyclerViewHolder(binding)
}
override fun onBindViewHolder(holder: RecyclerViewHolder, position: Int) {
val habit=habits[position]
with(holder.binding){
tvHabitName.text=habit.name
tvLabelOfHabit.text=habit.label?.name
tvAvoided.text=habit.countAvoided.toString()
tvDone.text=habit.countDone.toString()
llRootView.setOnClickListener {
val bottomSheet=HabitsBottomSheetDialog(
context,habit,position,dbHelper,
object :HabitsBottomSheetDialog.HabitSheetListener{
override fun updateCount(_habit: Habit, _position: Int) {
habits[_position].countDone=_habit.countDone
habits[_position].countAvoided=_habit.countAvoided
tvAvoided.text=_habit.countAvoided.toString()
tvDone.text=_habit.countDone.toString()
}
override fun deleted(_habit: Habit, _position: Int) {
habits.removeAt(_position)
notifyItemRemoved(_position)
notifyItemRangeChanged(_position,habits.size)
}
override fun dismissed() {
notifyDataSetChanged()
}
}
)
bottomSheet.show()
}
btnAddToDone.setOnClickListener {
if (!prefUtils.getBool(SharedPrefUtils.KEY_ADD_OR_AVOIDED)) {
showGuidedView(viewDoneOrAvoided)
} else if (Helper.isTodaySelected) {
habit.countDone++
dbHelper.updateHabit(habit)
dbHelper.insertRecord(
HabitRecord(
date = getTodayDate(),
status = HabitStatus.DONE.value,
habitId = habit.id
)
)
tvDone.text=habit.countDone.toString()
}
}
btnAddToAvoided.setOnClickListener {
if (!prefUtils.getBool(SharedPrefUtils.KEY_ADD_OR_AVOIDED)) {
showGuidedView(viewDoneOrAvoided)
} else if (Helper.isTodaySelected) {
habit.countAvoided++
dbHelper.updateHabit(habit)
dbHelper.insertRecord(
HabitRecord(
date = getTodayDate(),
status = HabitStatus.AVOIDED.value,
habitId = habit.id
)
)
tvAvoided.text=habit.countAvoided.toString()
}
}
}
}
private fun showGuidedView(view: View){
val guideView = GuideView.Builder(context)
.setContentText(context.getString(R.string.mark_as_done_or_avoided))
.setTargetView(view)
.setDismissType(DismissType.anywhere)
.setPointerType(PointerType.arrow)
.setGravity(Gravity.center)
.setGuideListener {
prefUtils.setBool(
SharedPrefUtils.KEY_ADD_OR_AVOIDED,
true
)
}
guideView.build().show()
}
private fun getTodayDate(): String {
var date: Date = Calendar.getInstance().time
val dateFormat: SimpleDateFormat = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
var formattedDate: String = dateFormat.format(date)
//Calendar.getInstance().timeInMillis.toString()
return formattedDate
}
override fun getItemCount()=habits.size
inner class RecyclerViewHolder(val binding: RecyclerviewLayoutHabitsBinding) : RecyclerView.ViewHolder(binding.root){
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/adapters/HabitsLogAdapter.kt
================================================
package rocks.poopjournal.todont.adapters
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.databinding.RecyclerviewLayoutLogHabitsBinding
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.HabitsBottomSheetDialog
class HabitsLogAdapter(
val context: Context,
val dbHelper: DatabaseUtils,
val habits:ArrayList<Habit>
) :
RecyclerView.Adapter<HabitsLogAdapter.RecyclerViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): RecyclerViewHolder {
val inflater = LayoutInflater.from(viewGroup.context)
val binding=RecyclerviewLayoutLogHabitsBinding.inflate(inflater)
return RecyclerViewHolder(binding)
}
override fun onBindViewHolder(holder: RecyclerViewHolder, position: Int) {
val habit = habits[position]
with(holder.binding){
tvHabitName.text=habit.name
tvLabelName.text=habit.label?.name
llRootView.setOnClickListener{
val bottomSheet=HabitsBottomSheetDialog(
context,
habit,
position,
dbHelper,
object : HabitsBottomSheetDialog.HabitSheetListener{
override fun updateCount(_habit: Habit, _position: Int) {
habits[_position].countDone=_habit.countDone
habits[_position].countAvoided=_habit.countAvoided
}
override fun deleted(_habit: Habit, _position: Int) {
habits.removeAt(_position)
notifyItemRemoved(_position)
notifyItemRangeChanged(_position,habits.size)
}
override fun dismissed() {
notifyDataSetChanged()
}
}
)
}
}
}
override fun getItemCount()=habits.size
inner class RecyclerViewHolder(val binding: RecyclerviewLayoutLogHabitsBinding) : RecyclerView.ViewHolder(binding.root) {
init {
binding.habitsbutton.setBackgroundResource(R.drawable.ic_habitscircle)
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/adapters/LabelsAdapter.kt
================================================
package rocks.poopjournal.todont.adapters
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.databinding.LabelsRecyclerviewLayoutBinding
import rocks.poopjournal.todont.model.Label
import rocks.poopjournal.todont.utils.DatabaseUtils
class LabelsAdapter(var context: Context, var dbHelper: DatabaseUtils, var labels: ArrayList<Label>) :
RecyclerView.Adapter<LabelsAdapter.RecyclerViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): RecyclerViewHolder {
val inflater = LayoutInflater.from(viewGroup.context)
val binding = LabelsRecyclerviewLayoutBinding.inflate(inflater, viewGroup, false)
return RecyclerViewHolder(binding)
}
override fun onBindViewHolder(holder: RecyclerViewHolder, position: Int) {
val label = labels[position]
with(holder.binding) {
tvLabel.text = label.name
tvSum.text = label.habitCount.toString() + " " + context.resources.getString(R.string.habits)
}
}
fun updateData(newLabels: List<Label>) {
//labels.clear()
// labels.addAll(newLabels)
notifyDataSetChanged()
}
override fun getItemCount() = labels.size
inner class RecyclerViewHolder(val binding: LabelsRecyclerviewLayoutBinding) :
RecyclerView.ViewHolder(binding.root)
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/AvoidedOrDoneFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.app.AlertDialog
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.adapters.AvoidedOrDoneAdapter
import rocks.poopjournal.todont.Helper
import rocks.poopjournal.todont.MainActivity
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.utils.DatabaseUtils
class AvoidedOrDoneFragment() : Fragment() {
var rv: RecyclerView? = null
var habits=ArrayList<Habit>()
var dbHelper: DatabaseUtils? = null
var adapter: AvoidedOrDoneAdapter? = null
var isAvoided:Boolean=false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.getBoolean("ARG_DATA")?.let {
isAvoided=it
}
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_avoided, container, false)
//Helper.SelectedButtonOfTodayTab=true;
rv = view.findViewById(R.id.rv)
dbHelper = DatabaseUtils(requireContext())
return view
}
override fun onResume() {
super.onResume()
setDataInList()
}
private fun setDataInList() {
getData()?.let {
habits=it
rv!!.layoutManager = LinearLayoutManager(activity)
ItemTouchHelper(itemtouchhelper).attachToRecyclerView(rv)
val resIcon=if(isAvoided) R.drawable.ic_avoided else R.drawable.ic_done
adapter = context?.let {
AvoidedOrDoneAdapter(
requireContext(), dbHelper!!,habits,isAvoided,resIcon
)
}
rv!!.adapter = adapter
rv!!.layoutManager = LinearLayoutManager(activity)
}
}
private fun getData(): ArrayList<Habit>? {
return if(isAvoided){
dbHelper?.getAvoidedHabits()
}else{
dbHelper?.getDoneHabits()
}
}
private var itemtouchhelper: ItemTouchHelper.SimpleCallback =
object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
override fun onMove(
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder
): Boolean {
return false
}
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
if (direction == 8) {
val builder1 = AlertDialog.Builder(
context
)
builder1.setMessage(R.string.delete_habit)
builder1.setCancelable(true)
builder1.setPositiveButton(
"Yes"
) { dialog, id ->
val i = viewHolder.adapterPosition
dbHelper?.deleteHabit(habits[i].id)
Helper.SelectedButtonOfTodayTab = 1
habits.removeAt(i)
adapter?.notifyItemRemoved(i)
adapter?.notifyItemRangeChanged(i, habits.size)
// val intent = Intent(activity, MainActivity::class.java)
// startActivity(intent)
activity!!.overridePendingTransition(0, 0)
dialog.cancel()
}
builder1.setNegativeButton(
R.string.no
) { dialog, id ->
// val i = Intent(activity, MainActivity::class.java)
// startActivity(i)
adapter?.notifyDataSetChanged()
activity!!.overridePendingTransition(0, 0)
dialog.cancel()
}
val alert11 = builder1.create()
alert11.show()
}
}
}
companion object {
fun newInstance(someData: Boolean): AvoidedOrDoneFragment {
val fragment = AvoidedOrDoneFragment()
val args = Bundle()
args.putBoolean("ARG_DATA", someData)
fragment.arguments = args
return fragment
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/AvoidedOrDoneLogFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.adapters.AvoidedOrDoneLogAdapter
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.utils.DatabaseUtils
class AvoidedOrDoneLogFragment() : Fragment() {
private var rv: RecyclerView? = null
private var habits = ArrayList<Habit>()
private var dbHelper: DatabaseUtils? = null
private var adapter: AvoidedOrDoneLogAdapter? = null
private var isAvoided: Boolean=false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.getBoolean("ARG_DATA")?.let {
isAvoided=it
}
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_avoided, container, false)
//Helper.SelectedButtonOfTodayTab=true;
rv = view.findViewById(R.id.rv)
dbHelper = DatabaseUtils(requireContext())
setDataInList()
return view
}
fun setDataInList() {
getData()?.let {
habits = it
rv!!.layoutManager = LinearLayoutManager(activity)
val resIcon = if (isAvoided) R.drawable.ic_avoided else R.drawable.ic_done
adapter = AvoidedOrDoneLogAdapter(
requireContext(), dbHelper!!, habits, isAvoided, resIcon
)
rv!!.adapter = adapter
rv!!.layoutManager = LinearLayoutManager(activity)
}
}
private fun getData(): ArrayList<Habit>? {
return if (isAvoided) {
dbHelper?.getAvoidedHabits()
} else {
dbHelper?.getDoneHabits()
}
}
companion object {
fun newInstance(someData: Boolean): AvoidedOrDoneLogFragment {
val fragment = AvoidedOrDoneLogFragment()
val args = Bundle()
args.putBoolean("ARG_DATA", someData)
fragment.arguments = args
return fragment
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/DailyFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.graphics.Color
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.github.mikephil.charting.components.Description
import com.github.mikephil.charting.data.PieData
import com.github.mikephil.charting.data.PieDataSet
import com.github.mikephil.charting.data.PieEntry
import rocks.poopjournal.todont.Helper
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.databinding.FragmentDailyBinding
import rocks.poopjournal.todont.model.HabitRecord
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.HabitStatus
import rocks.poopjournal.todont.utils.SharedPrefUtils
import rocks.poopjournal.todont.fragments.HabitsLogFragment
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
class DailyFragment() : Fragment() {
private var binding: FragmentDailyBinding? = null
private val calendar: Calendar = Calendar.getInstance()
private val currentDayCalendar: Calendar = Calendar.getInstance()
private var formattedDate: String = ""
private var databaseUtils: DatabaseUtils? = null
private var habitsTotalCount: Double = 0.0
private var avoidedCount: Double = 0.0
private var avoidedPercentage: Int = 0
private var sharedPreferences: SharedPrefUtils? = null
private var initialDate: String? = null
private var avoidedHabitRecords: List<String>? = null
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
binding = FragmentDailyBinding.inflate(inflater, container, false)
sharedPreferences = SharedPrefUtils(requireContext())
initialDate = sharedPreferences?.getString("InitialDate", "")
Helper.SelectedButtonOfLogTab = 1
databaseUtils = DatabaseUtils(requireContext())
val dateFormatter = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
formattedDate = dateFormatter.format(calendar.time)
binding?.apply {
date.text = formattedDate
updateHabitStatistics(formattedDate)
before.setOnClickListener { handleDateChange(-1, dateFormatter) }
after.setOnClickListener { handleDateChange(1, dateFormatter) }
}
return binding?.root
}
private fun handleDateChange(dayOffset: Int, dateFormatter: SimpleDateFormat) {
calendar.add(Calendar.DATE, dayOffset)
formattedDate = dateFormatter.format(calendar.time)
binding?.apply {
date.text = formattedDate
// before.isEnabled = formattedDate != initialDate
// after.isEnabled = formattedDate != dateFormatter.format(currentDayCalendar.time)
updateHabitStatistics(formattedDate)
}
}
private fun updateHabitStatistics(date: String) {
avoidedHabitRecords = databaseUtils?.getRecordsByDateAndStatus(date, HabitStatus.AVOIDED.value)
habitsTotalCount = databaseUtils?.getHabitsCount()?.toDouble() ?: 0.0
avoidedCount = avoidedHabitRecords?.size?.toDouble() ?: 0.0
avoidedPercentage = if (habitsTotalCount > 0) ((avoidedCount / habitsTotalCount) * 100).toInt() else 0
binding?.apply {
percentage.text = "$avoidedPercentage% "+getString(R.string.avoided)
progressText.text = getString(
if (avoidedPercentage == 100) R.string.habits_are_avoided else R.string.habits_are_avoided_way_to_go,
avoidedCount.toInt(), habitsTotalCount.toInt()
)
updatePieChart(avoidedPercentage)
}
}
private fun updatePieChart(avoidedPercentage: Int) {
binding?.pieChart?.apply {
setUsePercentValues(true)
val entries = listOf(
PieEntry(avoidedPercentage.toFloat(), getString(R.string.avoided)),
PieEntry((100 - avoidedPercentage).toFloat(), getString(R.string.habits))
)
val dataSet = PieDataSet(entries, "").apply {
valueTextColor = Color.WHITE
val lightSurface=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorOnBackground3,lightSurface,true)
val primaryColor=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorAccent,primaryColor,true)
setColors(primaryColor.data, lightSurface.data)
}
data = PieData(dataSet)
legend.isEnabled = false
description = Description().apply { text = "" }
holeRadius = 50f
val typedValue = TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorBackground, typedValue, true)
setHoleColor(typedValue.data)
transparentCircleRadius = 50f
animateXY(1000, 1000)
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/FragmentLog.kt
================================================
package rocks.poopjournal.todont.fragments
import android.os.Build
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.fragment.app.Fragment
import rocks.poopjournal.todont.Helper
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.databinding.FragmentLog2Binding
import rocks.poopjournal.todont.utils.DatabaseUtils
class FragmentLog() : Fragment() {
private var db: DatabaseUtils? = null
private var binding: FragmentLog2Binding? = null
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
binding = FragmentLog2Binding.inflate(inflater, container, false)
val view = inflater.inflate(R.layout.fragment_log2, container, false)
db = DatabaseUtils(requireContext())
Helper.isTodaySelected = false
Helper.SelectedButtonOfLogTab = 0
binding?.dhabits?.setOnClickListener {
updateTabSelection(0, HabitsLogFragment())
}
binding?.davoided?.setOnClickListener {
val frag=AvoidedOrDoneLogFragment.newInstance(true)
updateTabSelection(1, frag)
}
binding?.ddone?.setOnClickListener {
val frag=AvoidedOrDoneLogFragment.newInstance(false)
updateTabSelection(2, frag)
}
binding!!.day.setOnClickListener {
binding!!.day.setBackgroundResource(R.drawable.continuebutton2)
binding!!.day.backgroundTintList=null
binding!!.week.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.month.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.year.setBackgroundResource(R.drawable.continuebuttontrans)
Helper.SelectedButtonOfLogTab = 0
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, DailyFragment())
ft.commit()
}
binding!!.week.setOnClickListener {
binding!!.day.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.week.setBackgroundResource(R.drawable.continuebutton2)
binding!!.week.backgroundTintList=null
binding!!.month.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.year.setBackgroundResource(R.drawable.continuebuttontrans)
Helper.SelectedButtonOfLogTab = 1
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, WeeklyFragment())
ft.commit()
}
binding!!.month.setOnClickListener {
binding!!.day.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.week.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.month.setBackgroundResource(R.drawable.continuebutton2)
binding!!.month.backgroundTintList=null
binding!!.year.setBackgroundResource(R.drawable.continuebuttontrans)
Helper.SelectedButtonOfLogTab = 2
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, MonthlyFragment())
ft.commit()
}
binding!!.year.setOnClickListener {
binding!!.day.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.week.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.month.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.year.setBackgroundResource(R.drawable.continuebutton2)
binding!!.year.backgroundTintList=null
Helper.SelectedButtonOfLogTab = 3
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, YearlyFragment())
ft.commit()
}
updateTabSelection(0, HabitsLogFragment())
when (Helper.SelectedButtonOfLogTab) {
0 -> {
binding!!.day.setBackgroundResource(R.drawable.continuebutton2)
binding!!.day.backgroundTintList=null
binding!!.week.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.month.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.year.setBackgroundResource(R.drawable.continuebuttontrans)
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, DailyFragment())
ft.commit()
}
1 -> {
binding!!.day.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.week.backgroundTintList=null
binding!!.week.setBackgroundResource(R.drawable.continuebutton2)
binding!!.month.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.year.setBackgroundResource(R.drawable.continuebuttontrans)
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, WeeklyFragment())
ft.commit()
}
2 -> {
binding!!.day.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.week.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.month.setBackgroundResource(R.drawable.continuebutton2)
binding!!.month.backgroundTintList=null
binding!!.year.setBackgroundResource(R.drawable.continuebuttontrans)
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, MonthlyFragment())
ft.commit()
}
3 -> {
binding!!.day.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.week.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.month.setBackgroundResource(R.drawable.continuebuttontrans)
binding!!.year.setBackgroundResource(R.drawable.continuebutton2)
binding!!.year.backgroundTintList=null
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerLogFragment, YearlyFragment())
ft.commit()
}
}
return binding!!.root
}
private fun updateTabSelection(selectedTab: Int, fragment: Fragment) {
Helper.SelectedButtonOfLogDailyTab = selectedTab
binding?.apply {
when(selectedTab) {
0->{
dhabits?.setBackgroundResource(R.drawable.continuebutton2)
dhabits?.backgroundTintList=null
davoided?.setBackgroundResource(R.drawable.continuebuttontrans)
ddone?.setBackgroundResource(R.drawable.continuebuttontrans)
}
1->{
dhabits?.setBackgroundResource(R.drawable.continuebuttontrans)
davoided?.setBackgroundResource(R.drawable.continuebutton2)
davoided?.backgroundTintList=null
ddone?.setBackgroundResource(R.drawable.continuebuttontrans)
}
2->{
dhabits?.setBackgroundResource(R.drawable.continuebuttontrans)
davoided?.setBackgroundResource(R.drawable.continuebuttontrans)
ddone?.setBackgroundResource(R.drawable.continuebutton2)
ddone?.backgroundTintList=null
}
else-> {
dhabits?.setBackgroundResource(R.drawable.continuebutton2)
dhabits?.backgroundTintList=null
davoided?.setBackgroundResource(R.drawable.continuebuttontrans)
ddone?.setBackgroundResource(R.drawable.continuebuttontrans)
}
}
}
activity?.supportFragmentManager?.beginTransaction()?.replace(R.id.containerLogDailyFragment, fragment)?.commit()
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/FragmentToday.kt
================================================
package rocks.poopjournal.todont.fragments
import android.content.res.ColorStateList
import android.graphics.Color
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.google.android.material.button.MaterialButton
import rocks.poopjournal.todont.Helper
import rocks.poopjournal.todont.MainActivity
import rocks.poopjournal.todont.R
class FragmentToday : Fragment() {
var avoided: MaterialButton? = null
var done: Button? = null
var habits: Button? = null
private lateinit var habitsFrags: HabitsFragment
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.getBoolean("ARG_DATA")?.let {
habitsFrags = HabitsFragment.newInstance(it)
}
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_today2, container, false)
Helper.isTodaySelected = true
avoided = view.findViewById(R.id.avoided)
done = view.findViewById(R.id.done)
habits = view.findViewById(R.id.habits)
if (Helper.SelectedButtonOfTodayTab == 0) {
habits?.setBackgroundResource(R.drawable.continuebutton2)
habits?.backgroundTintList = null
(requireActivity() as MainActivity)?.showFAB()
avoided?.setBackgroundResource(R.drawable.continuebuttontrans)
done?.setBackgroundResource(R.drawable.continuebuttontrans)
replaceFragment(habitsFrags)
} else if (Helper.SelectedButtonOfTodayTab == 1) {
habits?.setBackgroundResource(R.drawable.continuebuttontrans)
avoided?.setBackgroundResource(R.drawable.continuebutton2)
avoided?.backgroundTintList = null
(requireActivity() as MainActivity)?.hideFAB()
done?.setBackgroundResource(R.drawable.continuebuttontrans)
val frag = AvoidedOrDoneFragment.newInstance(true)
replaceFragment(frag)
} else if (Helper.SelectedButtonOfTodayTab == 2) {
habits?.setBackgroundResource(R.drawable.continuebuttontrans)
avoided?.setBackgroundResource(R.drawable.continuebuttontrans)
done?.setBackgroundResource(R.drawable.continuebutton2)
(requireActivity() as MainActivity)?.hideFAB()
done?.backgroundTintList = null
val frag = AvoidedOrDoneFragment.newInstance(false)
replaceFragment(frag)
}
habits?.setOnClickListener(View.OnClickListener {
habits?.setBackgroundResource(R.drawable.continuebutton2)
habits?.backgroundTintList = null
(requireActivity() as MainActivity)?.showFAB()
avoided?.setBackgroundResource(R.drawable.continuebuttontrans)
done?.setBackgroundResource(R.drawable.continuebuttontrans)
replaceFragment(habitsFrags)
})
avoided?.setOnClickListener(View.OnClickListener {
habits?.setBackgroundResource(R.drawable.continuebuttontrans)
avoided?.setBackgroundResource(R.drawable.continuebutton2)
avoided?.backgroundTintList = null
(requireActivity() as MainActivity)?.hideFAB()
done?.setBackgroundResource(R.drawable.continuebuttontrans)
val frag = AvoidedOrDoneFragment.newInstance(true)
replaceFragment(frag)
})
done?.setOnClickListener(View.OnClickListener {
habits?.setBackgroundResource(R.drawable.continuebuttontrans)
avoided?.setBackgroundResource(R.drawable.continuebuttontrans)
done?.setBackgroundResource(R.drawable.continuebutton2)
(requireActivity() as MainActivity)?.hideFAB()
done?.backgroundTintList = null
val frag = AvoidedOrDoneFragment.newInstance(false)
replaceFragment(frag)
})
return view
}
fun addNewHabit() {
habitsFrags.addNewHabit()
}
fun replaceFragment(fragment: Fragment) {
val ft = requireActivity().supportFragmentManager.beginTransaction()
ft.replace(R.id.containerTodayFragment, fragment)
ft.commit()
}
companion object {
fun newInstance(someData: Boolean): FragmentToday {
val fragment = FragmentToday()
val args = Bundle()
args.putBoolean("ARG_DATA", someData)
fragment.arguments = args
return fragment
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/HabitsFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.app.Activity
import android.app.AlertDialog
import android.app.Dialog
import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.net.Uri
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.Window
import android.view.WindowManager
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.TextView
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.google.android.material.floatingactionbutton.FloatingActionButton
import jp.wasabeef.glide.transformations.BlurTransformation
import rocks.poopjournal.todont.adapters.HabitsAdapter
import rocks.poopjournal.todont.Helper
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.databinding.DialogboxAddNewHabitBinding
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.model.Label
import rocks.poopjournal.todont.showcaseview.ShowcaseViewBuilder
import rocks.poopjournal.todont.showcaseview.ShowcaseViewBuilder.Companion.init
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.SharedPrefUtils
import smartdevelop.ir.eram.showcaseviewlib.GuideView
import smartdevelop.ir.eram.showcaseviewlib.config.DismissType
import smartdevelop.ir.eram.showcaseviewlib.config.Gravity
import smartdevelop.ir.eram.showcaseviewlib.config.PointerType
import java.io.File
import java.io.FileOutputStream
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
class HabitsFragment() : Fragment() {
private var rv: RecyclerView? = null
private var habitsList = ArrayList<Habit>()
private var date: Date = Calendar.getInstance().time
private var selectedLabel: Label? = null
private var dbHelper: DatabaseUtils? = null
private var adapter: HabitsAdapter? = null
private var tvNoHabits: TextView? = null
private var showcaseViewBuilder: ShowcaseViewBuilder? = null
private var prefUtils: SharedPrefUtils? = null
private val PICK_IMAGE_REQUEST = 1001
private var selectedImageUri: Uri? = null
private var addNewHabit=false;
private var dialogView: DialogboxAddNewHabitBinding? = null;
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.getBoolean("ARG_DATA")?.let {
addNewHabit=it
}
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_habits, container, false)
Helper.SelectedButtonOfTodayTab = 0
rv = view.findViewById(R.id.rv)
dbHelper = DatabaseUtils(requireContext())
showcaseViewBuilder = init(requireActivity())
prefUtils = SharedPrefUtils(requireActivity())
// tv1 = view.findViewById(R.id.a);
tvNoHabits = view.findViewById(R.id.b)
if(addNewHabit){
addNewHabit()
addNewHabit=false
}
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
override fun onResume() {
super.onResume()
setDataInList()
}
fun addNewHabit() {
val labelCount = dbHelper?.getLabelsCount()
if (labelCount == 0) {
Toast.makeText(activity, R.string.please_add_a_label_first, Toast.LENGTH_LONG)
.show()
} else {
val dateFormat = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
val formattedDate = dateFormat.format(date)
val dialog = Dialog(requireActivity())
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialogView = DialogboxAddNewHabitBinding.inflate(layoutInflater)
dialog.setContentView(dialogView!!.root)
val lp = dialog.window!!.attributes
lp.dimAmount = 0.9f
dialog.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
val window = dialog.window
window!!.setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
dialog.window!!.attributes = lp
if (labelCount == 0) {
dialogView!!.txt.visibility = View.VISIBLE
dialogView!!.spinner.visibility = View.GONE
} else {
dialogView!!.txt.visibility = View.GONE
dialogView!!.spinner.visibility = View.VISIBLE
}
val labels = dbHelper?.getAllLabels()!!
labels.add(0, Label(-1, "Select a label"))
val arrayAdapter = ArrayAdapter(
requireActivity(),
android.R.layout.simple_spinner_item,
labels
)
arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
dialogView!!.spinner.adapter = arrayAdapter
dialogView!!.spinner.onItemSelectedListener =
object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(
adapterView: AdapterView<*>,
view: View,
i: Int,
l: Long
) {
if (i != 0) {
selectedLabel = labels[i]
val typedValue = TypedValue()
requireContext().theme.resolveAttribute(
R.attr.colorOnBackground2,
typedValue,
true
)
(adapterView.getChildAt(0) as TextView).setTextColor(
typedValue.data
)
}
}
override fun onNothingSelected(adapterView: AdapterView<*>?) {
}
}
dialogView!!.btnSelectImg.setOnClickListener {
openImagePicker()
}
dialogView!!.saveTaskButton.setOnClickListener {
val habit_text = dialogView?.habit?.text.toString()
val detail_text = dialogView?.detail?.text.toString()
val imageUriString = selectedImageUri?.toString()
dbHelper?.insertHabit(
Habit(
date = formattedDate,
name = habit_text,
description = detail_text,
countAvoided = 0,
countDone = 0,
labelId = selectedLabel?.labelId!!,
coverImageUri = imageUriString // Add this line
)
)
// Reset image selection
selectedImageUri = null
dialogView?.frameSelectedImage?.visibility = View.GONE
Helper.SelectedButtonOfTodayTab = 0
// val i = Intent(activity, MainActivity::class.java)
// startActivity(i)
setDataInList()
requireActivity().overridePendingTransition(0, 0)
dialog.dismiss()
}
dialogView!!.spinner.adapter = arrayAdapter
dialog.show()
}
}
// Function to load image with blur effect
private fun loadImageWithBlur(imageUri: Uri) {
// Show both ImageViews
dialogView?.frameSelectedImage?.visibility = View.VISIBLE
// Load blurred image into background ImageView
dialogView?.ivBlurredBackground?.let {
Glide.with(requireContext())
.load(imageUri)
.apply(RequestOptions.bitmapTransform(BlurTransformation(25, 3)))
.into(it)
}
// Load normal image into foreground ImageView
dialogView?.ivSelectedImage?.let {
Glide.with(requireContext())
.load(imageUri)
.into(it)
}
}
// Add this function to handle image selection
private fun openImagePicker() {
val intent = Intent(Intent.ACTION_PICK).apply {
type = "image/*"
putExtra(Intent.EXTRA_MIME_TYPES, arrayOf("image/jpeg", "image/png"))
}
startActivityForResult(intent, PICK_IMAGE_REQUEST)
}
// Handle the result
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == PICK_IMAGE_REQUEST && resultCode == Activity.RESULT_OK) {
val inputUri = data?.data
inputUri?.let { uri ->
// Save the image to internal storage and get the new URI
val savedImageUri = saveImageToInternalStorage(uri)
savedImageUri?.let {
// Set the selectedImageUri to the URI of the saved image
selectedImageUri = it
// Load the image (e.g., with blur)
loadImageWithBlur(it)
}
}
}
}
private fun saveImageToInternalStorage(uri: Uri): Uri? {
return try {
// Open an input stream from the original URI
val inputStream = requireContext().contentResolver.openInputStream(uri)
inputStream?.use { stream ->
// Get the internal storage directory for the app
val directory = File(requireContext().filesDir, "Cover_Images")
if (!directory.exists()) {
directory.mkdirs() // Create the directory if it doesn't exist
}
// Create a file in the app's internal storage
val fileName = "image_${System.currentTimeMillis()}.jpg"
val file = File(directory, fileName)
// Write the image data to the file
val outputStream = FileOutputStream(file)
outputStream.use { out ->
stream.copyTo(out)
}
// Return the URI of the saved file
Uri.fromFile(file)
}
} catch (e: Exception) {
e.printStackTrace()
null
}
}
private fun setDataInList() {
dbHelper?.getAllHabits()?.let {
habitsList = it
if (habitsList.isNotEmpty()) {
tvNoHabits?.visibility = View.INVISIBLE
rv?.layoutManager = LinearLayoutManager(activity)
ItemTouchHelper(itemtouchhelper).attachToRecyclerView(rv)
adapter =
HabitsAdapter(
requireContext(),
dbHelper!!, habitsList
)
rv!!.adapter = adapter
rv!!.layoutManager = LinearLayoutManager(activity)
} else {
tvNoHabits?.visibility = View.VISIBLE
}
} ?: run { tvNoHabits?.setVisibility(View.VISIBLE) }
}
var itemtouchhelper: ItemTouchHelper.SimpleCallback =
object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
override fun onMove(
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder,
target: RecyclerView.ViewHolder
): Boolean {
return false
}
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
if (direction == 8) {
val builder1 = AlertDialog.Builder(
context
)
builder1.setMessage(R.string.do_you_really_want_to_delete_this)
builder1.setCancelable(true)
builder1.setPositiveButton(
R.string.yes
) { dialog, id ->
val i = viewHolder.adapterPosition
habitsList[i].coverImageUri?.let { it1 -> deleteImageFromInternalStorage(it1) }
dbHelper?.deleteHabit(habitsList[i].id)
dbHelper?.deleteAllHabitRecords(habitsList[i].id)
Helper.SelectedButtonOfTodayTab = 0
habitsList.removeAt(i)
adapter?.notifyItemRemoved(i)
adapter?.notifyItemRangeChanged(0, habitsList.size)
// val intent = Intent(activity, MainActivity::class.java)
// startActivity(intent)
activity!!.overridePendingTransition(0, 0)
dialog.cancel()
}
builder1.setNegativeButton(
R.string.no
) { dialog, id ->
Helper.SelectedButtonOfTodayTab = 0
// val i = Intent(activity, MainActivity::class.java)
// startActivity(i)
adapter?.notifyDataSetChanged()
activity!!.overridePendingTransition(0, 0)
dialog.cancel()
}
val alert11 = builder1.create()
alert11.show()
}
}
private fun deleteImageFromInternalStorage(uriString: String): Boolean {
val uri = Uri.parse(uriString)
return try {
// Convert the URI to a File object
val file = File(uri.path)
// Check if the file exists and delete it
if (file.exists()) {
file.delete()
} else {
false // File does not exist
}
} catch (e: Exception) {
e.printStackTrace()
false
}
}
}
companion object {
fun newInstance(someData: Boolean): HabitsFragment {
val fragment = HabitsFragment()
val args = Bundle()
args.putBoolean("ARG_DATA", someData)
fragment.arguments = args
return fragment
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/HabitsLogFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import rocks.poopjournal.todont.adapters.HabitsLogAdapter
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.model.Habit
import rocks.poopjournal.todont.utils.DatabaseUtils
class HabitsLogFragment : Fragment() {
var rv: RecyclerView? = null
var habitsList = ArrayList<Habit>()
private var dbHelper: DatabaseUtils? = null
private var adapter: HabitsLogAdapter? = null
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_log_habits, container, false)
rv = view.findViewById(R.id.rv)
dbHelper = DatabaseUtils(requireContext())
setDataInList()
return view
}
private fun setDataInList() {
dbHelper?.getAllHabits()?.let {
habitsList = it
if (habitsList.isNotEmpty()) {
rv?.layoutManager = LinearLayoutManager(activity)
adapter =
HabitsLogAdapter(
requireContext(),
dbHelper!!, habitsList
)
rv!!.adapter = adapter
rv!!.layoutManager = LinearLayoutManager(activity)
}
}
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/MonthlyFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.graphics.Color
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.IntegerRes
import androidx.fragment.app.Fragment
import com.github.mikephil.charting.charts.PieChart
import com.github.mikephil.charting.components.Description
import com.github.mikephil.charting.data.PieData
import com.github.mikephil.charting.data.PieDataSet
import com.github.mikephil.charting.data.PieEntry
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.SharedPrefUtils
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
class MonthlyFragment : Fragment() {
private lateinit var calendar: Calendar
private lateinit var dbHelper: DatabaseUtils
private lateinit var dateFormatter: SimpleDateFormat
private lateinit var pieChart: PieChart
private lateinit var dateText: TextView
private lateinit var yearText: TextView
private lateinit var mostAvoidedText: TextView
private lateinit var leastAvoidedText: TextView
private lateinit var dateRangeText: TextView
private lateinit var btnBefore: ImageView
private lateinit var btnAfter: ImageView
private var currentMonth: String = ""
private var habitsSize: Double = 0.0
private var avoidedSize: Double = 0.0
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_monthly, container, false)
initViews(view)
setupInitialData()
setupListeners()
return view
}
private fun initViews(view: View) {
dbHelper = DatabaseUtils(requireContext())
dateFormatter = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
pieChart = view.findViewById(R.id.pieChart)
dateText = view.findViewById(R.id.date)
yearText = view.findViewById(R.id.year)
mostAvoidedText = view.findViewById(R.id.mostavoided)
leastAvoidedText = view.findViewById(R.id.leastavoided)
dateRangeText = view.findViewById(R.id.daterange)
btnBefore = view.findViewById(R.id.before)
btnAfter = view.findViewById(R.id.after)
btnBefore.setBackgroundResource(R.drawable.ic_backarrow)
btnAfter.setBackgroundResource(R.drawable.ic_nextarrow)
}
private fun setupInitialData() {
calendar = Calendar.getInstance()
val currentDate = dateFormatter.format(calendar.time).split("-")
currentMonth = getMonthName(currentDate[1])
val currentYear = currentDate[0]
dateText.text = currentMonth
yearText.text = currentYear
val monthStart = "${currentYear}-${currentDate[1]}-01"
val monthEnd = "${currentYear}-${currentDate[1]}-31"
habitsSize = (dbHelper.getHabitsCount() * 30).toDouble()
avoidedSize = dbHelper.getMonthlyAvoidedDataList(monthStart, monthEnd).size.toDouble()
val percentageAvoided = (avoidedSize / habitsSize) * 100
dbHelper.getMonthlyAvoidedData(monthStart, monthEnd).apply {
if(this.isNotEmpty()){
mostAvoidedText.text = dbHelper.getHabitById(this.toInt())?.name
mostAvoidedText.visibility = View.VISIBLE
}else{
mostAvoidedText.visibility = View.GONE
}
}
dbHelper.getMonthlyDoneData(monthStart, monthEnd).apply {
if(this.isNotEmpty()){
leastAvoidedText.text =dbHelper.getHabitById(this.toInt())?.name
leastAvoidedText.visibility = View.VISIBLE
}else{
leastAvoidedText.visibility = View.GONE
}
}
setupPieChart(percentageAvoided.toInt())
}
private fun setupListeners() {
btnBefore.setOnClickListener {
updateMonthData(isNext = false)
}
btnAfter.setOnClickListener {
updateMonthData(isNext = true)
}
}
private fun updateMonthData(isNext: Boolean) {
val currentMonthIndex = calendar.get(Calendar.MONTH)
calendar.set(Calendar.MONTH, if (isNext) currentMonthIndex + 1 else currentMonthIndex - 1)
val newMonth = calendar.get(Calendar.MONTH) + 1 // 0-based index
val newYear = calendar.get(Calendar.YEAR)
currentMonth = getMonthName(newMonth.toString().padStart(2, '0'))
dateText.text = currentMonth
yearText.text = newYear.toString()
val monthStart = "${newYear}-${newMonth.toString().padStart(2, '0')}-01"
val monthEnd = "${newYear}-${newMonth.toString().padStart(2, '0')}-31"
dbHelper.getMonthlyAvoidedData(monthStart, monthEnd).apply {
if(this.isNotEmpty()){
mostAvoidedText.text = dbHelper.getHabitById(this.toInt())?.name
mostAvoidedText.visibility = View.VISIBLE
}else{
mostAvoidedText.visibility = View.GONE
}
}
dbHelper.getMonthlyDoneData(monthStart, monthEnd).apply {
if(this.isNotEmpty()){
leastAvoidedText.text =dbHelper.getHabitById(this.toInt())?.name
leastAvoidedText.visibility = View.VISIBLE
}else{
leastAvoidedText.visibility = View.GONE
}
}
avoidedSize = dbHelper.getMonthlyAvoidedDataList(monthStart, monthEnd).size.toDouble()
val percentageAvoided = (avoidedSize / habitsSize) * 100
setupPieChart(percentageAvoided.toInt())
}
private fun setupPieChart(avoidedPercentage: Int) {
val pieEntries = listOf(
PieEntry(avoidedPercentage.toFloat(), getString(R.string.avoided)),
PieEntry((100 - avoidedPercentage).toFloat(), getString(R.string.habits))
)
val pieDataSet = PieDataSet(pieEntries, "").apply {
val lightSurface=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorOnBackground3,lightSurface,true)
val primaryColor=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorAccent,primaryColor,true)
setColors(primaryColor.data, lightSurface.data)
valueTextColor = Color.WHITE
}
pieChart.data = PieData(pieDataSet).apply {
setValueTextColor(Color.WHITE)
}
pieChart.apply {
legend.isEnabled = false
description = Description().apply { text = "" }
holeRadius = 50f
val typedValue = TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorBackground, typedValue, true)
setHoleColor(typedValue.data)
transparentCircleRadius = 50f
animateXY(1000, 1000)
}
}
private fun getMonthName(monthNumber: String): String {
return resources.getStringArray(R.array.month_names)[monthNumber.toInt() - 1]
}
private fun getTodayDate(): String {
var date: Date = Calendar.getInstance().time
val dateFormat: SimpleDateFormat = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
var formattedDate: String = dateFormat.format(date)
//Calendar.getInstance().timeInMillis.toString()
return formattedDate
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/WeeklyFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.graphics.Color
import android.os.Bundle
import android.os.Handler
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.IntegerRes
import androidx.fragment.app.Fragment
import com.github.mikephil.charting.charts.PieChart
import com.github.mikephil.charting.components.Description
import com.github.mikephil.charting.data.PieData
import com.github.mikephil.charting.data.PieDataSet
import com.github.mikephil.charting.data.PieEntry
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.SharedPrefUtils
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
class WeeklyFragment : Fragment() {
private lateinit var calendar: Calendar
private lateinit var dateFormatter: SimpleDateFormat
private lateinit var dbHelper: DatabaseUtils
private var dateTextView: TextView? = null
private var mostAvoidedTextView: TextView? = null
private var leastAvoidedTextView: TextView? = null
private var dateRangeTextView: TextView? = null
private var previousButton: ImageView? = null
private var nextButton: ImageView? = null
private var pieChart: PieChart? = null
private var startDate: String = ""
private var endDate: String = ""
private var habitCount: Double = 0.0
private var avoidedCount: Double = 0.0
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_weekly, container, false)
// Initialize components
initializeComponents(view)
updateDateRangeAndRecords()
// Set button listeners
setupButtonListeners()
return view
}
private fun initializeComponents(view: View) {
dbHelper = DatabaseUtils(requireContext())
dateFormatter = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
calendar = Calendar.getInstance()
getDates()
dateTextView = view.findViewById(R.id.date)
mostAvoidedTextView = view.findViewById(R.id.mostavoided)
leastAvoidedTextView = view.findViewById(R.id.leastavoided)
dateRangeTextView = view.findViewById(R.id.daterange)
previousButton = view.findViewById(R.id.before)
nextButton = view.findViewById(R.id.after)
pieChart = view.findViewById(R.id.pieChart)
previousButton?.setBackgroundResource(R.drawable.ic_backarrow)
nextButton?.setBackgroundResource(R.drawable.ic_nextarrow)
dateTextView?.text = dateFormatter.format(calendar.time)
}
private fun getDates() {
startDate = getTodayDate()
calendar.add(Calendar.DATE, 7)
endDate = dateFormatter.format(calendar.time)
}
private fun setupButtonListeners() {
previousButton?.setOnClickListener {
handlePreviousButtonClick()
}
nextButton?.setOnClickListener {
handleNextButtonClick()
}
}
private fun handlePreviousButtonClick() {
previousButton?.setBackgroundResource(R.drawable.ic_backarrowpressed)
Handler().postDelayed({
previousButton?.setBackgroundResource(R.drawable.ic_backarrow)
}, 100)
adjustDateBy(-7)
updateDateRangeAndRecords()
}
private fun handleNextButtonClick() {
nextButton?.setBackgroundResource(R.drawable.ic_nextpressed)
Handler().postDelayed({
nextButton?.setBackgroundResource(R.drawable.ic_nextarrow)
}, 100)
adjustDateBy(7)
updateDateRangeAndRecords()
}
private fun adjustDateBy(days: Int) {
if (days < 0) {
calendar = getCalendarFromFormattedDate(startDate)
endDate = startDate
calendar.add(Calendar.DATE, days)
startDate = dateFormatter.format(calendar.time)
} else {
calendar = getCalendarFromFormattedDate(endDate)
startDate = endDate
calendar.add(Calendar.DATE, days)
endDate = dateFormatter.format(calendar.time)
}
dateTextView?.text = "$startDate To $endDate"
}
private fun updateDateRangeAndRecords() {
dateRangeTextView?.text = "$startDate To $endDate"
val mostAvoided = dbHelper.getWeeklyAvoidedRecord(startDate, endDate)
val leastAvoided = dbHelper.getWeeklyDoneRecord(startDate, endDate)
if (mostAvoided.isNotEmpty()) {
mostAvoidedTextView?.text =
dbHelper.getHabitById(Integer.parseInt(mostAvoided))?.name
mostAvoidedTextView?.visibility = View.VISIBLE
} else {
mostAvoidedTextView?.visibility = View.GONE
}
if (leastAvoided.isNotEmpty()) {
leastAvoidedTextView?.visibility = View.VISIBLE
leastAvoidedTextView?.text =
dbHelper.getHabitById(Integer.parseInt(leastAvoided))?.name
} else {
leastAvoidedTextView?.visibility = View.GONE
}
habitCount = dbHelper.getHabitsCount() * 7.0
avoidedCount = dbHelper.getWeeklyAvoidedRecordList(startDate, endDate).size.toDouble()
val avoidedPercentage = calculateAvoidedPercentage()
updatePieChart(avoidedPercentage)
}
private fun calculateAvoidedPercentage(): Int {
return if (habitCount == 0.0) 0 else ((avoidedCount / habitCount) * 100).toInt()
}
private fun updatePieChart(avoidedPercentage: Int) {
pieChart?.apply {
setUsePercentValues(true)
data = PieData(PieDataSet(
listOf(
PieEntry(avoidedPercentage.toFloat(), getString(R.string.avoided)),
PieEntry((100 - avoidedPercentage).toFloat(), getString(R.string.habits))
),
""
).apply {
val lightSurface=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorOnBackground3,lightSurface,true)
val primaryColor=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorAccent,primaryColor,true)
setColors(primaryColor.data, lightSurface.data)
valueTextColor = Color.WHITE
})
legend.isEnabled = false
description = Description().apply { text = "" }
holeRadius = 50f
val typedValue = TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorBackground, typedValue, true)
setHoleColor(typedValue.data)
transparentCircleRadius = 50f
animateXY(1000, 1000)
}
}
private fun getTodayDate(): String {
var date: Date = Calendar.getInstance().time
val dateFormat: SimpleDateFormat =
SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
var formattedDate: String = dateFormat.format(date)
calendar.timeInMillis = Calendar.getInstance().timeInMillis
return formattedDate
}
fun getCalendarFromFormattedDate(formattedDate: String): Calendar {
val dateFormat = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
val date =
dateFormat.parse(formattedDate) // Parse the formatted date string into a Date object
val calendar = Calendar.getInstance()
calendar.time = date // Set the Calendar time to the parsed date
return calendar
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/YearlyFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.content.Context
import android.content.SharedPreferences
import android.graphics.Color
import android.os.Bundle
import android.os.Handler
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.github.mikephil.charting.charts.PieChart
import com.github.mikephil.charting.components.Description
import com.github.mikephil.charting.data.PieData
import com.github.mikephil.charting.data.PieDataSet
import com.github.mikephil.charting.data.PieEntry
import rocks.poopjournal.todont.Helper
import rocks.poopjournal.todont.R
import rocks.poopjournal.todont.utils.Constants
import rocks.poopjournal.todont.utils.DatabaseUtils
import rocks.poopjournal.todont.utils.SharedPrefUtils
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
class YearlyFragment : Fragment() {
private lateinit var calendar: Calendar
private lateinit var dbHelper: DatabaseUtils
private lateinit var dateFormat: SimpleDateFormat
private lateinit var preferences: SharedPrefUtils
private var pieChart: PieChart? = null
private var currentYear: Int = 0
private var initialDate: String? = null
private lateinit var yearText: TextView
private lateinit var mostAvoidedText: TextView
private lateinit var leastAvoidedText: TextView
private lateinit var dateRangeText: TextView
private lateinit var btnPrevious: ImageView
private lateinit var btnNext: ImageView
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
val view = inflater.inflate(R.layout.fragment_yearly, container, false)
initializeComponents(view)
setupInitialData()
updateYearData()
btnPrevious.setOnClickListener {
updateYear(-1)
}
btnNext.setOnClickListener {
updateYear(1)
}
return view
}
private fun initializeComponents(view: View) {
dbHelper = DatabaseUtils(requireContext())
dateFormat = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
preferences = SharedPrefUtils(requireContext())
yearText = view.findViewById(R.id.year)
mostAvoidedText = view.findViewById(R.id.mostavoided)
leastAvoidedText = view.findViewById(R.id.leastavoided)
dateRangeText = view.findViewById(R.id.daterange)
btnPrevious = view.findViewById(R.id.before)
btnNext = view.findViewById(R.id.after)
pieChart = view.findViewById(R.id.pieChart)
btnPrevious.setBackgroundResource(R.drawable.ic_backarrow)
btnNext.setBackgroundResource(R.drawable.ic_nextarrow)
}
private fun setupInitialData() {
calendar = Calendar.getInstance()
currentYear = calendar.get(Calendar.YEAR)
yearText.text = currentYear.toString()
initialDate = preferences.getString("InitialDate", getTodayDate())
Helper.SelectedButtonOfLogTab = 3
}
private fun updateYear(offset: Int) {
currentYear += offset
yearText.text = currentYear.toString()
Handler().postDelayed({
btnPrevious.setBackgroundResource(R.drawable.ic_backarrow)
}, 100)
updateYearData()
// btnPrevious.isEnabled = initialDate?.split("-")?.get(0)?.toInt() != currentYear
// btnNext.isEnabled = currentYear != Calendar.getInstance().get(Calendar.YEAR)
}
private fun updateYearData() {
val startDate = "$currentYear-01-01"
val endDate = "$currentYear-12-31"
val avoided = dbHelper.getYearlyAvoidedData(startDate, endDate)
val done = dbHelper.getYearlyDoneData(startDate, endDate)
if(avoided.isNotEmpty()){
mostAvoidedText.text = dbHelper?.getHabitById(avoided.toInt())?.name
mostAvoidedText.visibility=View.VISIBLE
}else{
mostAvoidedText.visibility=View.GONE
}
if(done.isNotEmpty()){
leastAvoidedText.text = dbHelper?.getHabitById(done.toInt())?.name
leastAvoidedText.visibility=View.VISIBLE
}else{
leastAvoidedText.visibility=View.GONE
}
val totalHabits = dbHelper.getHabitsCount() * 365.0
val avoidedCount = dbHelper.getYearlyAvoidedDataList(startDate, endDate).size.toDouble()
val percentage = (avoidedCount / totalHabits) * 100
setupPieChart(percentage.toInt())
}
private fun setupPieChart(avoidedPercentage: Int) {
pieChart?.apply {
setUsePercentValues(true)
val entries = listOf(
PieEntry(avoidedPercentage.toFloat(), getString(R.string.avoided)),
PieEntry((100 - avoidedPercentage).toFloat(), getString(R.string.habits))
)
val dataSet = PieDataSet(entries, "").apply {
valueTextColor = Color.WHITE
val lightSurface=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorOnBackground3,lightSurface,true)
val primaryColor=TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorAccent,primaryColor,true)
setColors(primaryColor.data, lightSurface.data)
}
data = PieData(dataSet)
description = Description().apply { text = "" }
holeRadius = 50f
transparentCircleRadius = 50f
val typedValue = TypedValue()
requireContext().theme.resolveAttribute(R.attr.colorBackground, typedValue, true)
setHoleColor(typedValue.data)
animateXY(1000, 1000)
}
}
private fun getTodayDate(): String {
var date: Date = Calendar.getInstance().time
val dateFormat: SimpleDateFormat = SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault())
var formattedDate: String = dateFormat.format(date)
//Calendar.getInstance().timeInMillis.toString()
return formattedDate
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/fragments/menuFragment.kt
================================================
package rocks.poopjournal.todont.fragments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import rocks.poopjournal.todont.R
class menuFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.menu_fragment, container, false)
return view
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/model/Alarm.kt
================================================
package rocks.poopjournal.todont.model
import rocks.poopjournal.todont.utils.Constants
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
class Alarm // Constructor
(// Getters and setters
var habitId:Int?,var alarmTime: Long, var frequency: String
) {
val formattedAlarmTime: String
// Optional: Convert alarm time to readable format (for display purposes)
get() {
val sdf =
SimpleDateFormat(Constants.DATE_TIME_FORMAT, Locale.getDefault())
return sdf.format(Date(alarmTime))
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/model/Habit.kt
================================================
package rocks.poopjournal.todont.model
data class Habit(
val id: Int? = null,
val date: String,
val name: String,
val description: String?,
var countAvoided: Int,
var countDone: Int,
val labelId: Int,
val coverImageUri: String? = null // Add this line
) {
var label: Label? = null
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/model/HabitRecord.kt
================================================
package rocks.poopjournal.todont.model
import rocks.poopjournal.todont.utils.HabitStatus
data class HabitRecord (
val id: Int? = null,
val date: String,
val status: String,
val habitId: Int?,
)
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/model/Label.kt
================================================
package rocks.poopjournal.todont.model
data class Label (
var labelId: Int? = null,
var name: String? = null,
){
var habitCount: Int = 0
override fun toString(): String {
return name!!
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/showcaseview/RippleBackground.kt
================================================
package rocks.poopjournal.todont.showcaseview
import android.animation.Animator
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.annotation.TargetApi
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.os.Build
import android.util.AttributeSet
import android.view.View
import android.view.animation.AccelerateDecelerateInterpolator
import android.widget.RelativeLayout
import rocks.poopjournal.todont.R
import kotlin.math.min
class RippleBackground : RelativeLayout {
private var rippleColor = 0
private var rippleStrokeWidth = 0f
private var rippleRadius = 0f
private var rippleDurationTime = 0
private var rippleAmount = 0
private var rippleDelay = 0
private var rippleScale = 0f
private var rippleType = 0
private var paint: Paint? = null
var isRippleAnimationRunning: Boolean = false
private set
private var animatorSet: AnimatorSet? = null
private var animatorList: ArrayList<Animator>? = null
private var rippleParams: LayoutParams? = null
private val rippleViewList = ArrayList<RippleView>()
constructor(context: Context?) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context, attrs)
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
) {
init(context, attrs)
}
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private fun init(context: Context, attrs: AttributeSet) {
if (isInEditMode) return
requireNotNull(attrs) { "Attributes should be provided to this view," }
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleBackground)
rippleColor = typedArray.getColor(
R.styleable.RippleBackground_rb_color,
resources.getColor(android.R.color.holo_red_light)
)
rippleStrokeWidth = typedArray.getDimension(R.styleable.RippleBackground_rb_strokeWidth, 4f)
rippleRadius = typedArray.getDimension(R.styleable.RippleBackground_rb_radius, 4f)
rippleDurationTime =
typedArray.getInt(R.styleable.RippleBackground_rb_duration, DEFAULT_DURATION_TIME)
rippleAmount =
typedArray.getInt(R.styleable.RippleBackground_rb_rippleAmount, DEFAULT_RIPPLE_COUNT)
rippleScale = typedArray.getFloat(R.styleable.RippleBackground_rb_scale, DEFAULT_SCALE)
rippleType = typedArray.getInt(R.styleable.RippleBackground_rb_type, DEFAULT_FILL_TYPE)
typedArray.recycle()
rippleDelay = rippleDurationTime / rippleAmount
paint = Paint()
paint!!.isAntiAlias = true
if (rippleType == DEFAULT_FILL_TYPE) {
rippleStrokeWidth = 0f
paint!!.style = Paint.Style.FILL
} else paint!!.style = Paint.Style.STROKE
paint!!.color = rippleColor
rippleParams = LayoutParams(
(2 * (rippleRadius + rippleStrokeWidth)).toInt(),
(2 * (rippleRadius + rippleStrokeWidth)).toInt()
)
rippleParams!!.addRule(CENTER_IN_PARENT, TRUE)
animatorSet = AnimatorSet()
animatorSet!!.interpolator = AccelerateDecelerateInterpolator()
animatorList = ArrayList()
for (i in 0 until rippleAmount) {
val rippleView = RippleView(getContext())
addView(rippleView, rippleParams)
rippleViewList.add(rippleView)
val scaleXAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleX", 1.0f, rippleScale)
scaleXAnimator.repeatCount = ObjectAnimator.INFINITE
scaleXAnimator.repeatMode = ObjectAnimator.RESTART
scaleXAnimator.startDelay = (i * rippleDelay).toLong()
scaleXAnimator.setDuration(rippleDurationTime.toLong())
animatorList!!.add(scaleXAnimator)
val scaleYAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleY", 1.0f, rippleScale)
scaleYAnimator.repeatCount = ObjectAnimator.INFINITE
scaleYAnimator.repeatMode = ObjectAnimator.RESTART
scaleYAnimator.startDelay = (i * rippleDelay).toLong()
scaleYAnimator.setDuration(rippleDurationTime.toLong())
animatorList!!.add(scaleYAnimator)
val alphaAnimator = ObjectAnimator.ofFloat(rippleView, "Alpha", 1.0f, 0f)
alphaAnimator.repeatCount = ObjectAnimator.INFINITE
alphaAnimator.repeatMode = ObjectAnimator.RESTART
alphaAnimator.startDelay = (i * rippleDelay).toLong()
alphaAnimator.setDuration(rippleDurationTime.toLong())
animatorList!!.add(alphaAnimator)
}
animatorSet!!.playTogether(animatorList)
}
private inner class RippleView(context: Context?) : View(context) {
init {
this.visibility = INVISIBLE
}
override fun onDraw(canvas: Canvas) {
val radius = ((min(
width.toDouble(),
height.toDouble()
)) / 2).toInt()
canvas.drawCircle(
radius.toFloat(), radius.toFloat(), radius - rippleStrokeWidth,
paint!!
)
}
}
fun startRippleAnimation() {
if (!isRippleAnimationRunning) {
for (rippleView in rippleViewList) {
rippleView.visibility = VISIBLE
}
animatorSet!!.start()
isRippleAnimationRunning = true
}
}
fun stopRippleAnimation() {
if (isRippleAnimationRunning) {
animatorSet!!.end()
isRippleAnimationRunning = false
}
}
companion object {
private const val DEFAULT_RIPPLE_COUNT = 6
private const val DEFAULT_DURATION_TIME = 3000
private const val DEFAULT_SCALE = 6.0f
private const val DEFAULT_FILL_TYPE = 0
}
}
================================================
FILE: app/src/main/java/rocks/poopjournal/todont/showcaseview/ShowcaseViewBuilder.kt
================================================
package rocks.poopjournal.todont.showcaseview
import android.app.Activity
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
import android.graphics.Rect
import android.graphics.RectF
import android.graphics.drawable.Drawable
import android.util.AttributeSet
import android.util.DisplayMetrics
import android.util.Log
import android.view.Gravity
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.View.OnTouchListener
import android.view.ViewGroup
import android.view.ViewTreeObserver.OnGlobalLayoutListener
import android.widget.LinearLayout
class ShowcaseViewBuilder : View, OnTouchListener {
private var mActivity: Activity? = null
private var mTargetView: View? = null
private val mCustomView: MutableList<View> = ArrayList()
private val mCustomViewLeftMargins: MutableList<Float> = ArrayList()
private val mCustomViewTopMargins: MutableList<Float> = ArrayList()
private val mCustomViewRightMargins: MutableList<Float> = ArrayList()
private val mCustomViewBottomMargins: MutableList<Float> = ArrayList()
private val mCustomViewGravity: MutableList<Int> = ArrayList()
private var mCenterX = 0f
private var mCenterY = 0f
private var mRadius = 0f
private var mMarkerDrawable: Drawable? = null
private var mMarkerDrawableGravity = 0
private var ringColor = 0
private var backgroundOverlayColor = 0
private var mCustomViewMargin = 0
private var mShape = SHAPE_CIRCLE
private var mBgOverlayShape = FULL_SCREEN
private var mRoundRectCorner = 0
private val idsRectMap = HashMap<Rect, Int>()
private val idsClickListenerMap = HashMap<Int, OnClickListener?>()
private var mHideOnTouchOutside = false
private var mRingWidth = 10f
private var mShowcaseMargin = 12f
private var mRoundRectOffset = 170f
private var mMarkerDrawableLeftMargin = 0f
private var mMarkerDrawableRightMargin = 0f
private var mMarkerDrawableTopMargin = 0f
private var mMarkerDrawableBottomMargin = 0f
private var tempCanvas: Canvas? = null
private var backgroundPaint: Paint? = null
private var transparentPaint: Paint? = null
private var ringPaint: Paint? = null
private var mTargetViewGlobalRect: Rect? = null
private constructor(context: Context) : super(context)
private constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
fun setTargetView(view: View?): ShowcaseViewBuilder {
mTargetView = view
return this
}
private fun calculateRadiusAndCenter() {
val width = mTargetView!!.measuredWidth
val height = mTargetView!!.measuredHeight
val xy = intArrayOf(0, 0)
mTargetView!!.getLocationInWindow(xy)
mCenterX = (xy[0] + (width / 2)).toFloat()
mCenterY = (xy[1] + (height / 2)).toFloat()
mRadius = if (width > height) {
(7 * (width) / 12).toFloat()
} else {
(7 * (height) / 12).toFloat()
}
}
fun setHideOnTouchOutside(value: Boolean): ShowcaseViewBuilder {
this.mHideOnTouchOutside = value
return this
}
fun setMarkerDrawable(drawable: Drawable?, gravity: Int): ShowcaseViewBuilder {
this.mMarkerDrawable = drawable
this.mMarkerDrawableGravity = gravity
return this
}
fun setDrawableLeftMargin(margin: Float): ShowcaseViewBuilder {
this.mMarkerDrawableLeftMargin = margin
return this
}
fun setRoundRectOffset(roundRectOffset: Float): ShowcaseViewBuilder {
this.mRoundRectOffset = roundRectOffset
return this
}
fun setDrawableRightMargin(margin: Float): ShowcaseViewBuilder {
this.mMarkerDrawableRightMargin = margin
return this
}
fun setDrawableTopMargin(margin: Float): ShowcaseViewBuilder {
this.mMarkerDrawableTopMargin = margin
return this
}
fun setDrawableBottomMargin(margin: Float): ShowcaseViewBuilder {
this.mMarkerDrawableBottomMargin = margin
return this
}
fun setShowcaseShape(shape: Int): ShowcaseViewBuilder {
this.mShape = shape
return this
}
fun setBgOverlayShape(bgOverlayShape: Int): ShowcaseViewBuilder {
this.mBgOverlayShape = bgOverlayShape
return this
}
fun setRoundRectCornerDirection(roundRectCornerDirection: Int): ShowcaseViewBuilder {
this.mRoundRectCorner = roundRectCornerDirection
return this
}
fun addCustomView(layoutId: Int, gravity: Int): ShowcaseViewBuilder {
val view = LayoutInflater.from(mActivity).inflate(layoutId, null)
val linearLayout = LinearLayout(mActivity)
linearLayout.addView(view)
linearLayout.gravity = Gravity.CENTER
val metrics = DisplayMetrics()
mActivity!!.windowManager.defaultDisplay.getMetrics(metrics)
val rect = Rect()
rect[0, 0, metrics.widthPixels] = metrics.heightPixels
val widthSpec = MeasureSpec.makeMeasureSpec(rect.width(), MeasureSpec.EXACTLY)
val heightSpec = MeasureSpec.makeMeasureSpec(rect.height(), MeasureSpec.EXACTLY)
linearLayout.measure(widthSpec, heightSpec)
mCustomView.add(linearLayout)
mCustomViewGravity.add(gravity)
mCustomViewLeftMargins.add(0f)
mCustomViewTopMargins.add(0f)
mCustomViewRightMargins.add(0f)
mCustomViewBottomMargins.add(0f)
return this
}
fun addCustomView(view: View?, gravity: Int): ShowcaseViewBuilder {
val linearLayout = LinearLayout(mActivity)
linearLayout.addView(view)
linearLayout.gravity = Gravity.CENTER
val metrics = DisplayMetrics()
mActivity!!.windowManager.defaultDisplay.getMetrics(metrics)
val rect = Rect()
rect[0, 0, metrics.widthPixels] = metrics.heightPixels
val widthSpec = MeasureSpec.makeMeasureSpec(rect.width(), MeasureSpec.EXACTLY)
val heightSpec = MeasureSpec.makeMeasureSpec(rect.height(), MeasureSpec.EXACTLY)
linearLayout.measure(widthSpec, heightSpec)
mCustomView.add(linearLayout)
mCustomViewGravity.add(gravity)
mCustomViewLeftMargins.add(0f)
mCustomViewTopMargins.add(0f)
mCustomViewRightMargins.add(0f)
mCustomViewBottomMargins.add(0f)
return this
}
fun addCustomView(
layoutId: Int,
gravity: Int,
leftMargin: Float,
topMargin: Float,
rightMargin: Float,
bottomMargin: Float
): ShowcaseViewBuilder {
val view = LayoutInflater.from(mActivity).inflate(layoutId, null)
val linearLayout = LinearLayout(mActivity)
linearLayout.addView(view)
linearLayout.gravity = Gravity.CENTER
val metrics = DisplayMetrics()
mActivity!!.windowManager.defaultDisplay.getMetrics(metrics)
val rect = Rect()
rect[0, 0, metrics.widthPixels] = metrics.heightPixels
val widthSpec = MeasureSpec.makeMeasureSpec(rect.width(), MeasureSpec.EXACTLY)
val heightSpec = MeasureSpec.makeMeasureSpec(rect.height(), MeasureSpec.EXACTLY)
linearLayout.measure(widthSpec, heightSpec)
mCustomView.add(linearLayout)
mCustomViewGravity.add(gravity)
mCustomViewLeftMargins.add(leftMargin)
mCustomViewTopMargins.add(topMargin)
mCustomViewRightMargins.add(rightMargin)
mCustomViewBottomMargins.add(bottomMargin)
return this
}
fun addCustomView(
view: View?,
gravity: Int,
leftMargin: Float,
topMargin: Float,
rightMargin: Float,
bottomMargin: Float
): ShowcaseViewBuilder {
val linearLayout = LinearLayout(mActivity)
linearLayout.addView(view)
linearLayout.gravity = Gravity.CENTER
val metrics = DisplayMetrics()
mActivity!!.windowManager.defaultDisplay.getMetrics(metrics)
val rect = Rect()
rect[0, 0, metrics.widthPixels] = metrics.heightPixels
val widthSpec = MeasureSpec.makeMeasureSpec(rect.width(), MeasureSpec.EXACTLY)
val heightSpec = MeasureSpec.makeMeasureSpec(rect.height(), MeasureSpec.EXACTLY)
linearLayout.measure(widthSpec, heightSpec)
mCustomView.add(linearLayout)
mCustomViewGravity.add(gravity)
mCustomViewLeftMargins.add(leftMargin)
mCustomViewTopMargins.add(topMargin)
mCustomViewRightMargins.add(rightMargin)
mCustomView
gitextract_f40de0sl/ ├── .devcontainer/ │ └── devcontainer.json ├── .github/ │ ├── CODEOWNERS │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── SECURITY.md │ ├── SUPPORT.md │ ├── dependabot.yml │ └── workflows/ │ ├── build.yml │ ├── ci.yml │ ├── codacy-analysis.yml │ ├── codeql-analysis.yml │ └── windows.yml ├── .gitignore ├── LICENSE ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── rocks/ │ │ └── poopjournal/ │ │ └── todont/ │ │ └── ExampleInstrumentedTest.kt │ ├── debug/ │ │ └── res/ │ │ ├── drawable/ │ │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-v24/ │ │ │ └── ic_launcher_background.xml │ │ └── mipmap-anydpi-v26/ │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ └── main/ │ ├── AndroidManifest.xml │ ├── java/ │ │ └── rocks/ │ │ └── poopjournal/ │ │ └── todont/ │ │ ├── About.kt │ │ ├── Helper.kt │ │ ├── LabelsActivity.kt │ │ ├── MainActivity.kt │ │ ├── MyApp.kt │ │ ├── NotificationReceiver.kt │ │ ├── OnBoardingActivity.kt │ │ ├── Settings.kt │ │ ├── SplashScreenActivity.kt │ │ ├── adapters/ │ │ │ ├── AvoidedOrDoneAdapter.kt │ │ │ ├── AvoidedOrDoneLogAdapter.kt │ │ │ ├── HabitsAdapter.kt │ │ │ ├── HabitsLogAdapter.kt │ │ │ └── LabelsAdapter.kt │ │ ├── fragments/ │ │ │ ├── AvoidedOrDoneFragment.kt │ │ │ ├── AvoidedOrDoneLogFragment.kt │ │ │ ├── DailyFragment.kt │ │ │ ├── FragmentLog.kt │ │ │ ├── FragmentToday.kt │ │ │ ├── HabitsFragment.kt │ │ │ ├── HabitsLogFragment.kt │ │ │ ├── MonthlyFragment.kt │ │ │ ├── WeeklyFragment.kt │ │ │ ├── YearlyFragment.kt │ │ │ └── menuFragment.kt │ │ ├── model/ │ │ │ ├── Alarm.kt │ │ │ ├── Habit.kt │ │ │ ├── HabitRecord.kt │ │ │ └── Label.kt │ │ ├── showcaseview/ │ │ │ ├── RippleBackground.kt │ │ │ └── ShowcaseViewBuilder.kt │ │ ├── utils/ │ │ │ ├── Constants.kt │ │ │ ├── DatabaseUtils.kt │ │ │ ├── HabitsBottomSheetDialog.kt │ │ │ ├── NotificationActionReceiver.kt │ │ │ ├── NotificationReceiver.kt │ │ │ ├── SharedPrefUtils.kt │ │ │ └── Utils.kt │ │ └── widgets/ │ │ ├── MyAppNoButtonsWidgetProvider.kt │ │ ├── MyAppSmallWidgetProvider.kt │ │ ├── NobuttonsWidgetService.kt │ │ └── WidgetService.kt │ ├── res/ │ │ ├── anim/ │ │ │ ├── fade_in.xml │ │ │ └── fade_out.xml │ │ ├── drawable/ │ │ │ ├── _cross.xml │ │ │ ├── _tick.xml │ │ │ ├── about.xml │ │ │ ├── backgorundinner.xml │ │ │ ├── bell.xml │ │ │ ├── bottom_nav_color.xml │ │ │ ├── bottom_sheet.xml │ │ │ ├── continuebutton2.xml │ │ │ ├── continuebuttontrans.xml │ │ │ ├── dis.xml │ │ │ ├── email.xml │ │ │ ├── fix_cross.xml │ │ │ ├── fix_fab.xml │ │ │ ├── fix_rounded_rectangle.xml │ │ │ ├── fix_tick.xml │ │ │ ├── frame__4_.xml │ │ │ ├── frame__5_.xml │ │ │ ├── frame__6_.xml │ │ │ ├── git.xml │ │ │ ├── grad_tab_back.xml │ │ │ ├── grad_window_backgrond.xml │ │ │ ├── gradient_background.xml │ │ │ ├── gradient_fab.xml │ │ │ ├── habitlogcheck.xml │ │ │ ├── ic_about.xml │ │ │ ├── ic_add.xml │ │ │ ├── ic_appearance.xml │ │ │ ├── ic_avoided.xml │ │ │ ├── ic_back.xml │ │ │ ├── ic_backarrow.xml │ │ │ ├── ic_backarrowpressed.xml │ │ │ ├── ic_background.xml │ │ │ ├── ic_cross.xml │ │ │ ├── ic_delete.xml │ │ │ ├── ic_done.xml │ │ │ ├── ic_downarrow.xml │ │ │ ├── ic_facebook.xml │ │ │ ├── ic_foreground.xml │ │ │ ├── ic_habitscircle.xml │ │ │ ├── ic_label_light.xml │ │ │ ├── ic_log.xml │ │ │ ├── ic_menu.xml │ │ │ ├── ic_monochrome.xml │ │ │ ├── ic_nextarrow.xml │ │ │ ├── ic_nextpressed.xml │ │ │ ├── ic_sad.xml │ │ │ ├── ic_spinner.xml │ │ │ ├── ic_today.xml │ │ │ ├── info.xml │ │ │ ├── log_frag_selected.xml │ │ │ ├── monitor.xml │ │ │ ├── mygradient.xml │ │ │ ├── mygradient1.xml │ │ │ ├── myinnergradient.xml │ │ │ ├── myinnergradientlog.xml │ │ │ ├── myinnergradientlogs.xml │ │ │ ├── notification_logo.xml │ │ │ ├── onboard.xml │ │ │ ├── reportproblem.xml │ │ │ ├── roundbutton.xml │ │ │ ├── rounded_button.xml │ │ │ ├── rounded_corners.xml │ │ │ ├── rounded_dialog_bg.xml │ │ │ ├── selectedround.xml │ │ │ ├── spinner_background.xml │ │ │ ├── tabcolor.xml │ │ │ ├── translate.xml │ │ │ ├── trash.xml │ │ │ ├── twitter.xml │ │ │ └── viewsrc.xml │ │ ├── layout/ │ │ │ ├── activity_about.xml │ │ │ ├── activity_labels.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_on_boarding.xml │ │ │ ├── activity_settings.xml │ │ │ ├── activity_splash__screen.xml │ │ │ ├── dialog_info.xml │ │ │ ├── dialogbox.xml │ │ │ ├── dialogbox_add_new_habit.xml │ │ │ ├── dialogbox_labels.xml │ │ │ ├── fragment_avoided.xml │ │ │ ├── fragment_daily.xml │ │ │ ├── fragment_done.xml │ │ │ ├── fragment_habits.xml │ │ │ ├── fragment_log2.xml │ │ │ ├── fragment_log_habits.xml │ │ │ ├── fragment_monthly.xml │ │ │ ├── fragment_today2.xml │ │ │ ├── fragment_weekly.xml │ │ │ ├── fragment_yearly.xml │ │ │ ├── initial_no_buttons_widget_view.xml │ │ │ ├── initial_widget_view.xml │ │ │ ├── labels_recyclerview_layout.xml │ │ │ ├── layout_habit_bottom_sheet.xml │ │ │ ├── menu_fragment.xml │ │ │ ├── no_buttons_widget_preview.xml │ │ │ ├── recyclerview_layout.xml │ │ │ ├── recyclerview_layout_habits.xml │ │ │ ├── recyclerview_layout_log_habits.xml │ │ │ ├── widget_item.xml │ │ │ ├── widget_item_no_buttons.xml │ │ │ ├── widget_layout.xml │ │ │ ├── widget_layout_no_buttons.xml │ │ │ └── widget_preview.xml │ │ ├── menu/ │ │ │ ├── navigation.xml │ │ │ └── topmenu.xml │ │ ├── resources.properties │ │ ├── values/ │ │ │ ├── attrs.xml │ │ │ ├── colors.xml │ │ │ ├── dimen.xml │ │ │ ├── ids.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-ar/ │ │ │ └── strings.xml │ │ ├── values-az/ │ │ │ └── strings.xml │ │ ├── values-b+art/ │ │ │ └── strings.xml │ │ ├── values-be/ │ │ │ └── strings.xml │ │ ├── values-bg/ │ │ │ └── strings.xml │ │ ├── values-bs/ │ │ │ └── strings.xml │ │ ├── values-ca/ │ │ │ └── strings.xml │ │ ├── values-cs/ │ │ │ └── strings.xml │ │ ├── values-da/ │ │ │ └── strings.xml │ │ ├── values-de/ │ │ │ └── strings.xml │ │ ├── values-dum/ │ │ │ └── strings.xml │ │ ├── values-el/ │ │ │ └── strings.xml │ │ ├── values-eo/ │ │ │ └── strings.xml │ │ ├── values-es/ │ │ │ └── strings.xml │ │ ├── values-et/ │ │ │ └── strings.xml │ │ ├── values-fa/ │ │ │ └── strings.xml │ │ ├── values-fi/ │ │ │ └── strings.xml │ │ ├── values-fil/ │ │ │ └── strings.xml │ │ ├── values-fr/ │ │ │ └── strings.xml │ │ ├── values-ga/ │ │ │ └── strings.xml │ │ ├── values-he/ │ │ │ └── strings.xml │ │ ├── values-hi/ │ │ │ └── strings.xml │ │ ├── values-hr/ │ │ │ └── strings.xml │ │ ├── values-hu/ │ │ │ └── strings.xml │ │ ├── values-hy/ │ │ │ └── strings.xml │ │ ├── values-ia/ │ │ │ └── strings.xml │ │ ├── values-id/ │ │ │ └── strings.xml │ │ ├── values-is/ │ │ │ └── strings.xml │ │ ├── values-it/ │ │ │ └── strings.xml │ │ ├── values-ja/ │ │ │ └── strings.xml │ │ ├── values-ka/ │ │ │ └── strings.xml │ │ ├── values-kk/ │ │ │ └── strings.xml │ │ ├── values-ko/ │ │ │ └── strings.xml │ │ ├── values-la/ │ │ │ └── strings.xml │ │ ├── values-lb/ │ │ │ └── strings.xml │ │ ├── values-lt/ │ │ │ └── strings.xml │ │ ├── values-mk/ │ │ │ └── strings.xml │ │ ├── values-ms/ │ │ │ └── strings.xml │ │ ├── values-mt/ │ │ │ └── strings.xml │ │ ├── values-nb-rNO/ │ │ │ └── strings.xml │ │ ├── values-ne/ │ │ │ └── strings.xml │ │ ├── values-night/ │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-night-v35/ │ │ │ └── styles.xml │ │ ├── values-nl/ │ │ │ └── strings.xml │ │ ├── values-pl/ │ │ │ └── strings.xml │ │ ├── values-pt/ │ │ │ └── strings.xml │ │ ├── values-pt-rBR/ │ │ │ └── strings.xml │ │ ├── values-ro/ │ │ │ └── strings.xml │ │ ├── values-ru/ │ │ │ └── strings.xml │ │ ├── values-sk/ │ │ │ └── strings.xml │ │ ├── values-sl/ │ │ │ └── strings.xml │ │ ├── values-sr/ │ │ │ └── strings.xml │ │ ├── values-sv/ │ │ │ └── strings.xml │ │ ├── values-ta/ │ │ │ └── strings.xml │ │ ├── values-th/ │ │ │ └── strings.xml │ │ ├── values-tl/ │ │ │ └── strings.xml │ │ ├── values-tr/ │ │ │ └── strings.xml │ │ ├── values-uk/ │ │ │ └── strings.xml │ │ ├── values-ur/ │ │ │ └── strings.xml │ │ ├── values-uz/ │ │ │ └── strings.xml │ │ ├── values-v35/ │ │ │ └── styles.xml │ │ ├── values-vi/ │ │ │ └── strings.xml │ │ ├── values-zh-rCN/ │ │ │ └── strings.xml │ │ ├── values-zh-rTW/ │ │ │ └── strings.xml │ │ ├── xml/ │ │ │ ├── backup_rules.xml │ │ │ ├── data_extraction_rules.xml │ │ │ ├── locales_config.xml │ │ │ ├── no_buttons_widget_info.xml │ │ │ └── widget_info.xml │ │ └── xml-v31/ │ │ ├── no_buttons_widget_info.xml │ │ └── widget_info.xml │ └── test/ │ └── java/ │ └── rocks/ │ └── poopjournal/ │ └── todont/ │ └── ExampleUnitTest.kt ├── build.gradle ├── fastlane/ │ └── metadata/ │ └── android/ │ ├── cs/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ └── short_description.txt │ ├── de-DE/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ └── 2.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── en-US/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 210.txt │ │ │ ├── 3.txt │ │ │ ├── 300.txt │ │ │ ├── 4.txt │ │ │ ├── 400.txt │ │ │ ├── 410.txt │ │ │ ├── 420.txt │ │ │ ├── 430.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ ├── title.txt │ │ └── video.txt │ ├── eo/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ └── short_description.txt │ ├── es/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 210.txt │ │ │ ├── 3.txt │ │ │ ├── 30.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── fi/ │ │ └── changelogs/ │ │ └── 410.txt │ ├── fr/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── ga/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 210.txt │ │ │ ├── 3.txt │ │ │ ├── 300.txt │ │ │ ├── 4.txt │ │ │ ├── 400.txt │ │ │ ├── 410.txt │ │ │ ├── 420.txt │ │ │ ├── 430.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── he/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 3.txt │ │ │ ├── 30.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── hy/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ └── short_description.txt │ ├── id/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 3.txt │ │ │ ├── 30.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── it/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ ├── 3.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── ko/ │ │ ├── short_description.txt │ │ └── title.txt │ ├── nb-NO/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ ├── 3.txt │ │ │ └── 4.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── nl/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── pl-PL/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 3.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── pt/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ └── 7.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── pt-BR/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── ro/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ └── short_description.txt │ ├── ru/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 210.txt │ │ │ ├── 3.txt │ │ │ ├── 300.txt │ │ │ ├── 4.txt │ │ │ ├── 400.txt │ │ │ ├── 410.txt │ │ │ ├── 420.txt │ │ │ ├── 430.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── ta-IN/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 210.txt │ │ │ ├── 3.txt │ │ │ ├── 300.txt │ │ │ ├── 4.txt │ │ │ ├── 400.txt │ │ │ ├── 410.txt │ │ │ ├── 420.txt │ │ │ ├── 430.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── tr/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 210.txt │ │ │ ├── 3.txt │ │ │ ├── 30.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── uk/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 3.txt │ │ │ ├── 30.txt │ │ │ ├── 4.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── ur/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 2.txt │ │ │ └── 3.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ ├── zh-CN/ │ │ ├── changelogs/ │ │ │ ├── 1.txt │ │ │ ├── 10.txt │ │ │ ├── 2.txt │ │ │ ├── 210.txt │ │ │ ├── 3.txt │ │ │ ├── 300.txt │ │ │ ├── 4.txt │ │ │ ├── 400.txt │ │ │ ├── 410.txt │ │ │ ├── 420.txt │ │ │ ├── 430.txt │ │ │ ├── 5.txt │ │ │ ├── 6.txt │ │ │ ├── 7.txt │ │ │ ├── 8.txt │ │ │ └── 9.txt │ │ ├── full_description.txt │ │ ├── short_description.txt │ │ └── title.txt │ └── zh-TW/ │ ├── changelogs/ │ │ ├── 1.txt │ │ ├── 10.txt │ │ ├── 2.txt │ │ ├── 3.txt │ │ ├── 30.txt │ │ ├── 4.txt │ │ ├── 5.txt │ │ ├── 6.txt │ │ ├── 7.txt │ │ └── 9.txt │ ├── full_description.txt │ ├── short_description.txt │ └── title.txt ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── sentry-wizard └── settings.gradle
Condensed preview — 539 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,253K chars).
[
{
"path": ".devcontainer/devcontainer.json",
"chars": 1425,
"preview": "// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:\n// https://github.co"
},
{
"path": ".github/CODEOWNERS",
"chars": 22,
"preview": "/app/ @arafaatqureshi\n"
},
{
"path": ".github/CODE_OF_CONDUCT.md",
"chars": 254,
"preview": "Welcome to the To Don't community.\n\nWithin desired privacy, accept and grant criticism constructively.\n\nFinding yourself"
},
{
"path": ".github/CONTRIBUTING.md",
"chars": 1,
"preview": "\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 1,
"preview": "\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 722,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\n\n---\n\n## :writing_hand: Describe the bug\n<!-- A clear and"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 779,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\n\n---\n\n## :warning: Is your feature request related to "
},
{
"path": ".github/SECURITY.md",
"chars": 175,
"preview": "Please report (suspected) security vulnerabilities to [marvin@poopjournal.rocks](mailto:marvin@poopjournal.rocks). It wo"
},
{
"path": ".github/SUPPORT.md",
"chars": 1614,
"preview": "Hi! 👋\n\nWe’re excited that you’re using **To Dont't** and we’d love to help.\nTo help us help you, please read through th"
},
{
"path": ".github/dependabot.yml",
"chars": 612,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/workflows/build.yml",
"chars": 418,
"preview": "name: Android Build\n\non: push\n\njobs:\n build:\n name: \"Assemble artifacts\"\n runs-on: ubuntu-latest\n steps:\n "
},
{
"path": ".github/workflows/ci.yml",
"chars": 927,
"preview": "name: CI\non: push\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - name: \"📥 Check-out\"\n uses: actions"
},
{
"path": ".github/workflows/codacy-analysis.yml",
"chars": 1929,
"preview": "# This workflow checks out code, performs a Codacy security scan\n# and integrates the results with the\n# GitHub Advanced"
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 1447,
"preview": "name: \"CodeQL\"\n\non:\n push:\n branches: [development]\n pull_request:\n # The branches below must be a subset of the"
},
{
"path": ".github/workflows/windows.yml",
"chars": 968,
"preview": "name: CI\non: push\njobs:\n build:\n runs-on: windows-latest\n steps:\n - name: \"📥 Check-out\"\n uses: action"
},
{
"path": ".gitignore",
"chars": 1609,
"preview": "# Built application files\n*.apk\n*.aar\n*.ap_\n*.aab\napp/release\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 4114,
"preview": "[](h"
},
{
"path": "app/.gitignore",
"chars": 6,
"preview": "/build"
},
{
"path": "app/build.gradle",
"chars": 3304,
"preview": "plugins {\n id 'com.android.application'\n// id 'kotlin-android-extensions'\n id 'org.jetbrains.kotlin.android'\n "
},
{
"path": "app/proguard-rules.pro",
"chars": 750,
"preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
},
{
"path": "app/src/androidTest/java/rocks/poopjournal/todont/ExampleInstrumentedTest.kt",
"chars": 675,
"preview": "package rocks.poopjournal.todont\n\nimport androidx.test.platform.app.InstrumentationRegistry\nimport androidx.test.ext.jun"
},
{
"path": "app/src/debug/res/drawable/ic_launcher_foreground.xml",
"chars": 383,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"108dp\"\n android:height=\"108dp\"\n"
},
{
"path": "app/src/debug/res/drawable-v24/ic_launcher_background.xml",
"chars": 828,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:aapt=\"http://schemas.android.com/aapt\"\n "
},
{
"path": "app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml",
"chars": 331,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml",
"chars": 331,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 4225,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:to"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/About.kt",
"chars": 10387,
"preview": "package rocks.poopjournal.todont\n\nimport android.annotation.SuppressLint\nimport android.content.ActivityNotFoundExceptio"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/Helper.kt",
"chars": 1170,
"preview": "package rocks.poopjournal.todont\n\nobject Helper {\n //@JvmField\n //var labels_array: ArrayList<String> = ArrayList("
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/LabelsActivity.kt",
"chars": 7761,
"preview": "package rocks.poopjournal.todont\n\nimport android.app.Dialog\nimport android.content.Intent\nimport android.graphics.Color\n"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/MainActivity.kt",
"chars": 8248,
"preview": "package rocks.poopjournal.todont\n\nimport android.content.Intent\nimport android.content.res.Configuration\nimport android."
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/MyApp.kt",
"chars": 802,
"preview": "package rocks.poopjournal.todont\n\nimport android.app.Application\nimport io.sentry.android.core.SentryAndroid\nimport rock"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/NotificationReceiver.kt",
"chars": 2132,
"preview": "package rocks.poopjournal.todont\n\nimport android.Manifest\nimport android.app.NotificationChannel\nimport android.app.Noti"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/OnBoardingActivity.kt",
"chars": 2679,
"preview": "package rocks.poopjournal.todont\n\nimport android.content.Intent\nimport android.os.Build\nimport android.os.Bundle\nimport "
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/Settings.kt",
"chars": 21992,
"preview": "package rocks.poopjournal.todont;\n\nimport androidx.activity.OnBackPressedCallback;\nimport androidx.annotation.RequiresAp"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/SplashScreenActivity.kt",
"chars": 2326,
"preview": "package rocks.poopjournal.todont\n\nimport android.content.Intent\nimport android.os.Build\nimport android.os.Bundle\nimport "
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/adapters/AvoidedOrDoneAdapter.kt",
"chars": 1567,
"preview": "package rocks.poopjournal.todont.adapters\n\nimport android.content.Context\nimport android.view.LayoutInflater\nimport andr"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/adapters/AvoidedOrDoneLogAdapter.kt",
"chars": 2664,
"preview": "package rocks.poopjournal.todont.adapters\n\nimport android.content.Context\nimport android.view.LayoutInflater\nimport andr"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/adapters/HabitsAdapter.kt",
"chars": 5620,
"preview": "package rocks.poopjournal.todont.adapters\n\nimport android.content.Context\nimport android.view.LayoutInflater\nimport andr"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/adapters/HabitsLogAdapter.kt",
"chars": 2495,
"preview": "package rocks.poopjournal.todont.adapters\n\nimport android.content.Context\nimport android.view.LayoutInflater\nimport andr"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/adapters/LabelsAdapter.kt",
"chars": 1489,
"preview": "package rocks.poopjournal.todont.adapters\n\nimport android.content.Context\nimport android.view.LayoutInflater\nimport andr"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/AvoidedOrDoneFragment.kt",
"chars": 4751,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.app.AlertDialog\nimport android.content.Intent\nimport android."
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/AvoidedOrDoneLogFragment.kt",
"chars": 2422,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.os.Bundle\nimport android.view.LayoutInflater\nimport android.v"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/DailyFragment.kt",
"chars": 5094,
"preview": "package rocks.poopjournal.todont.fragments\n\n\nimport android.graphics.Color\nimport android.os.Bundle\nimport android.util."
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/FragmentLog.kt",
"chars": 8361,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.os.Build\nimport android.os.Bundle\nimport android.util.TypedVa"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/FragmentToday.kt",
"chars": 4748,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.content.res.ColorStateList\nimport android.graphics.Color\nimpo"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/HabitsFragment.kt",
"chars": 15051,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.app.Activity\nimport android.app.AlertDialog\nimport android.ap"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/HabitsLogFragment.kt",
"chars": 1643,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.os.Bundle\nimport android.view.LayoutInflater\nimport android.v"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/MonthlyFragment.kt",
"chars": 7623,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.graphics.Color\nimport android.os.Bundle\nimport android.util.T"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/WeeklyFragment.kt",
"chars": 7920,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.content.Context\nimport android.content.Intent\nimport android."
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/YearlyFragment.kt",
"chars": 6269,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.content.Context\nimport android.content.SharedPreferences\nimpo"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/fragments/menuFragment.kt",
"chars": 515,
"preview": "package rocks.poopjournal.todont.fragments\n\nimport android.os.Bundle\nimport android.view.LayoutInflater\nimport android.v"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/model/Alarm.kt",
"chars": 589,
"preview": "package rocks.poopjournal.todont.model\n\nimport rocks.poopjournal.todont.utils.Constants\nimport java.text.SimpleDateForma"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/model/Habit.kt",
"chars": 323,
"preview": "package rocks.poopjournal.todont.model\n\ndata class Habit(\n val id: Int? = null,\n val date: String,\n val name: S"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/model/HabitRecord.kt",
"chars": 213,
"preview": "package rocks.poopjournal.todont.model\n\nimport rocks.poopjournal.todont.utils.HabitStatus\n\ndata class HabitRecord (\n "
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/model/Label.kt",
"chars": 219,
"preview": "package rocks.poopjournal.todont.model\n\ndata class Label (\n var labelId: Int? = null,\n var name: String? = null,\n)"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/showcaseview/RippleBackground.kt",
"chars": 5978,
"preview": "package rocks.poopjournal.todont.showcaseview\n\nimport android.animation.Animator\nimport android.animation.AnimatorSet\nim"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/showcaseview/ShowcaseViewBuilder.kt",
"chars": 25258,
"preview": "package rocks.poopjournal.todont.showcaseview\n\nimport android.app.Activity\nimport android.content.Context\nimport android"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/utils/Constants.kt",
"chars": 2012,
"preview": "package rocks.poopjournal.todont.utils;\n\nimport android.content.Context\nimport rocks.poopjournal.todont.R\n\n\npublic class"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/utils/DatabaseUtils.kt",
"chars": 30688,
"preview": "package rocks.poopjournal.todont.utils\n\nimport android.content.ContentValues\nimport android.content.Context\nimport andro"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/utils/HabitsBottomSheetDialog.kt",
"chars": 15129,
"preview": "package rocks.poopjournal.todont.utils\n\nimport android.Manifest\nimport android.annotation.SuppressLint\nimport android.ap"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/utils/NotificationActionReceiver.kt",
"chars": 1979,
"preview": "package rocks.poopjournal.todont.utils\n\nimport android.app.NotificationManager\nimport android.content.BroadcastReceiver\n"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/utils/NotificationReceiver.kt",
"chars": 4541,
"preview": "package rocks.poopjournal.todont.utils\n\nimport android.Manifest\nimport android.app.ActivityManager\nimport android.app.No"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/utils/SharedPrefUtils.kt",
"chars": 4936,
"preview": "package rocks.poopjournal.todont.utils\n\nimport android.content.Context\nimport android.content.SharedPreferences\nimport a"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/utils/Utils.kt",
"chars": 3892,
"preview": "package rocks.poopjournal.todont.utils\n\nimport android.content.Context\nimport android.graphics.Color\nimport android.grap"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/widgets/MyAppNoButtonsWidgetProvider.kt",
"chars": 3135,
"preview": "package rocks.poopjournal.todont.widgets\n\nimport android.app.PendingIntent\nimport android.app.TaskStackBuilder\nimport an"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/widgets/MyAppSmallWidgetProvider.kt",
"chars": 3111,
"preview": "package rocks.poopjournal.todont.widgets\n\nimport android.app.PendingIntent\nimport android.app.TaskStackBuilder\nimport an"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/widgets/NobuttonsWidgetService.kt",
"chars": 1766,
"preview": "package rocks.poopjournal.todont.widgets\n\nimport android.content.Intent\nimport android.widget.RemoteViewsService\n\nimport"
},
{
"path": "app/src/main/java/rocks/poopjournal/todont/widgets/WidgetService.kt",
"chars": 2521,
"preview": "package rocks.poopjournal.todont.widgets\n\nimport android.content.Intent\nimport android.widget.RemoteViewsService\n\nimport"
},
{
"path": "app/src/main/res/anim/fade_in.xml",
"chars": 265,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<alpha xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:dur"
},
{
"path": "app/src/main/res/anim/fade_out.xml",
"chars": 295,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<alpha xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:dur"
},
{
"path": "app/src/main/res/drawable/_cross.xml",
"chars": 672,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/_tick.xml",
"chars": 437,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/about.xml",
"chars": 1003,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/backgorundinner.xml",
"chars": 475,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape android:shape=\"rectangle\"\n xmlns:android=\"http://schemas.android.com/ap"
},
{
"path": "app/src/main/res/drawable/bell.xml",
"chars": 978,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/bottom_nav_color.xml",
"chars": 280,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item a"
},
{
"path": "app/src/main/res/drawable/bottom_sheet.xml",
"chars": 291,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/continuebutton2.xml",
"chars": 367,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/continuebuttontrans.xml",
"chars": 428,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/dis.xml",
"chars": 764,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/email.xml",
"chars": 755,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/fix_cross.xml",
"chars": 674,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/fix_fab.xml",
"chars": 993,
"preview": "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item>\n <shape android:shape=\"oval\">\n"
},
{
"path": "app/src/main/res/drawable/fix_rounded_rectangle.xml",
"chars": 398,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/fix_tick.xml",
"chars": 438,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/frame__4_.xml",
"chars": 1107,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/frame__5_.xml",
"chars": 984,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/frame__6_.xml",
"chars": 924,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/git.xml",
"chars": 728,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/grad_tab_back.xml",
"chars": 415,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/grad_window_backgrond.xml",
"chars": 387,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/gradient_background.xml",
"chars": 383,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:shape=\""
},
{
"path": "app/src/main/res/drawable/gradient_fab.xml",
"chars": 1001,
"preview": "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item>\n <shape android:shape=\"oval\">\n"
},
{
"path": "app/src/main/res/drawable/habitlogcheck.xml",
"chars": 408,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/ic_about.xml",
"chars": 733,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_add.xml",
"chars": 670,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_appearance.xml",
"chars": 458,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_avoided.xml",
"chars": 948,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_back.xml",
"chars": 666,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_backarrow.xml",
"chars": 368,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_backarrowpressed.xml",
"chars": 361,
"preview": "<vector android:height=\"24dp\" android:tint=\"?attr/colorOnBackground2\"\n android:viewportHeight=\"24\" android:viewportWi"
},
{
"path": "app/src/main/res/drawable/ic_background.xml",
"chars": 876,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:aapt=\"http://schemas.android.com/aapt\"\n "
},
{
"path": "app/src/main/res/drawable/ic_cross.xml",
"chars": 389,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "app/src/main/res/drawable/ic_delete.xml",
"chars": 444,
"preview": "<vector android:height=\"24dp\" android:tint=\"?attr/colorAccent\"\n android:viewportHeight=\"24\" android:viewportWidth=\"24"
},
{
"path": "app/src/main/res/drawable/ic_done.xml",
"chars": 706,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_downarrow.xml",
"chars": 378,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_facebook.xml",
"chars": 488,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_foreground.xml",
"chars": 400,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"108dp\"\n android:height=\"108dp\"\n"
},
{
"path": "app/src/main/res/drawable/ic_habitscircle.xml",
"chars": 520,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_label_light.xml",
"chars": 728,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_log.xml",
"chars": 708,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_menu.xml",
"chars": 980,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_monochrome.xml",
"chars": 572,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"108dp\"\n android:height=\"108dp\"\n"
},
{
"path": "app/src/main/res/drawable/ic_nextarrow.xml",
"chars": 337,
"preview": "<vector android:height=\"24dp\" android:tint=\"?attr/colorAccent\"\n android:viewportHeight=\"24\" android:viewportWidth=\"24"
},
{
"path": "app/src/main/res/drawable/ic_nextpressed.xml",
"chars": 344,
"preview": "<vector android:height=\"24dp\" android:tint=\"?attr/colorOnBackground2\"\n android:viewportHeight=\"24\" android:viewportWi"
},
{
"path": "app/src/main/res/drawable/ic_sad.xml",
"chars": 864,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/ic_spinner.xml",
"chars": 312,
"preview": "<vector android:height=\"8dp\" android:tint=\"?attr/colorButtonGradStart\"\n android:viewportHeight=\"24\" android:viewportW"
},
{
"path": "app/src/main/res/drawable/ic_today.xml",
"chars": 522,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/info.xml",
"chars": 952,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/log_frag_selected.xml",
"chars": 371,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/monitor.xml",
"chars": 1350,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/mygradient.xml",
"chars": 546,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/mygradient1.xml",
"chars": 405,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/myinnergradient.xml",
"chars": 404,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/myinnergradientlog.xml",
"chars": 496,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools"
},
{
"path": "app/src/main/res/drawable/myinnergradientlogs.xml",
"chars": 507,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools"
},
{
"path": "app/src/main/res/drawable/notification_logo.xml",
"chars": 549,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"108dp\"\n android:height=\"108dp\"\n"
},
{
"path": "app/src/main/res/drawable/onboard.xml",
"chars": 10931,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"264dp\"\n android:height=\"256dp\"\n"
},
{
"path": "app/src/main/res/drawable/reportproblem.xml",
"chars": 949,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/roundbutton.xml",
"chars": 517,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/rounded_button.xml",
"chars": 190,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <solid and"
},
{
"path": "app/src/main/res/drawable/rounded_corners.xml",
"chars": 231,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/rounded_dialog_bg.xml",
"chars": 363,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/selectedround.xml",
"chars": 424,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "app/src/main/res/drawable/spinner_background.xml",
"chars": 734,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item><"
},
{
"path": "app/src/main/res/drawable/tabcolor.xml",
"chars": 289,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item a"
},
{
"path": "app/src/main/res/drawable/translate.xml",
"chars": 1028,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/trash.xml",
"chars": 1407,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/twitter.xml",
"chars": 599,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/drawable/viewsrc.xml",
"chars": 678,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n "
},
{
"path": "app/src/main/res/layout/activity_about.xml",
"chars": 37551,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "app/src/main/res/layout/activity_labels.xml",
"chars": 3525,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "app/src/main/res/layout/activity_main.xml",
"chars": 5075,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layout xmlns:tools=\"http://schemas.android.com/tools\"\n xmlns:android=\"http://"
},
{
"path": "app/src/main/res/layout/activity_on_boarding.xml",
"chars": 2730,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "app/src/main/res/layout/activity_settings.xml",
"chars": 13569,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/activity_splash__screen.xml",
"chars": 1274,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layout>\n\n <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"h"
},
{
"path": "app/src/main/res/layout/dialog_info.xml",
"chars": 1297,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "app/src/main/res/layout/dialogbox.xml",
"chars": 6195,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/dialogbox_add_new_habit.xml",
"chars": 7614,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/dialogbox_labels.xml",
"chars": 2564,
"preview": "<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:"
},
{
"path": "app/src/main/res/layout/fragment_avoided.xml",
"chars": 823,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_daily.xml",
"chars": 4380,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layout xmlns:tools=\"http://schemas.android.com/tools\"\n xmlns:android=\"http://"
},
{
"path": "app/src/main/res/layout/fragment_done.xml",
"chars": 1026,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_habits.xml",
"chars": 1725,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_log2.xml",
"chars": 5752,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_log_habits.xml",
"chars": 713,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_monthly.xml",
"chars": 6118,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_today2.xml",
"chars": 4001,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_weekly.xml",
"chars": 5874,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/fragment_yearly.xml",
"chars": 5810,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/initial_no_buttons_widget_view.xml",
"chars": 4686,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/initial_widget_view.xml",
"chars": 11857,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/labels_recyclerview_layout.xml",
"chars": 2503,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/layout_habit_bottom_sheet.xml",
"chars": 10451,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "app/src/main/res/layout/menu_fragment.xml",
"chars": 700,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/layout/no_buttons_widget_preview.xml",
"chars": 4691,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/recyclerview_layout.xml",
"chars": 2758,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/recyclerview_layout_habits.xml",
"chars": 4952,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/recyclerview_layout_log_habits.xml",
"chars": 2753,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/widget_item.xml",
"chars": 5434,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/widget_item_no_buttons.xml",
"chars": 1888,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/widget_layout.xml",
"chars": 1442,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/layout/widget_layout_no_buttons.xml",
"chars": 1453,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/layout/widget_preview.xml",
"chars": 11923,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/menu/navigation.xml",
"chars": 378,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item\n "
},
{
"path": "app/src/main/res/menu/topmenu.xml",
"chars": 284,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item\n "
},
{
"path": "app/src/main/res/resources.properties",
"chars": 27,
"preview": "unqualifiedResLocale=en-US\n"
},
{
"path": "app/src/main/res/values/attrs.xml",
"chars": 2384,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <declare-styleable name=\"RippleBackground\">\n <attr name=\"r"
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 7789,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <!-- <!– Base Colors –>-->\n <!-- <colo"
},
{
"path": "app/src/main/res/values/dimen.xml",
"chars": 193,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources xmlns:tools=\"http://schemas.android.com/tools\">\n <dimen name=\"desig"
},
{
"path": "app/src/main/res/values/ids.xml",
"chars": 107,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <item name=\"restoreButton\" type=\"id\" />\n</resources>"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 8329,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string name=\"app_name\">To Don\\'t</string>\n <string-array name"
},
{
"path": "app/src/main/res/values/styles.xml",
"chars": 23677,
"preview": "<resources>\n <!-- Base Application Theme -->\n <style name=\"Base.Theme.Todon\" parent=\"Theme.MaterialComponents.DayN"
},
{
"path": "app/src/main/res/values-ar/strings.xml",
"chars": 6664,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>حدد اللغة</item>\n "
},
{
"path": "app/src/main/res/values-az/strings.xml",
"chars": 6900,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Dil Seçin</item>\n "
},
{
"path": "app/src/main/res/values-b+art/strings.xml",
"chars": 62,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources></resources>"
},
{
"path": "app/src/main/res/values-be/strings.xml",
"chars": 6907,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Выберыце Мову</item"
},
{
"path": "app/src/main/res/values-bg/strings.xml",
"chars": 6917,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Изберете Език</item"
},
{
"path": "app/src/main/res/values-bs/strings.xml",
"chars": 6792,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Odaberite Jezik</it"
},
{
"path": "app/src/main/res/values-ca/strings.xml",
"chars": 6781,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Seleccioneu El Llen"
},
{
"path": "app/src/main/res/values-cs/strings.xml",
"chars": 6738,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Vyberte jazyk</item"
},
{
"path": "app/src/main/res/values-da/strings.xml",
"chars": 6663,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Vælg Sprog</item>\n "
},
{
"path": "app/src/main/res/values-de/strings.xml",
"chars": 7565,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Sprache auswählen</"
},
{
"path": "app/src/main/res/values-dum/strings.xml",
"chars": 63,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n</resources>"
},
{
"path": "app/src/main/res/values-el/strings.xml",
"chars": 7000,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Επιλέξτε Τη Γλώσσα<"
},
{
"path": "app/src/main/res/values-eo/strings.xml",
"chars": 63,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n</resources>"
},
{
"path": "app/src/main/res/values-es/strings.xml",
"chars": 6835,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Seleccionar idioma<"
},
{
"path": "app/src/main/res/values-et/strings.xml",
"chars": 6796,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>Vali Keel</item>\n "
},
{
"path": "app/src/main/res/values-fa/strings.xml",
"chars": 6840,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"languages\">\n <item>زبان را انتخاب کنید"
}
]
// ... and 339 more files (download for full content)
About this extraction
This page contains the full source code of the Crazy-Marvin/ToDont GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 539 files (64.1 MB), approximately 302.7k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.