├── .all-contributorsrc ├── .gitignore ├── Gemfile ├── Gemfile.lock ├── LICENSE.txt ├── Makefile ├── README.md ├── app ├── .gitignore ├── build.gradle ├── gradle │ └── lua-tasks.gradle.kts ├── proguard-rules.pro └── src │ ├── debug │ └── res │ │ └── xml │ │ └── shortcuts.xml │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ │ └── com │ │ │ └── samco │ │ │ └── trackandgraph │ │ │ ├── Constants.kt │ │ │ ├── IntentActions.kt │ │ │ ├── TrackAndGraphApplication.kt │ │ │ ├── aboutpage │ │ │ ├── AboutPageFragment.kt │ │ │ └── AboutPageView.kt │ │ │ ├── adddatapoint │ │ │ ├── AddDataPointTutorialView.kt │ │ │ ├── AddDataPointTutorialViewModel.kt │ │ │ ├── AddDataPointsView.kt │ │ │ ├── AddDataPointsViewModel.kt │ │ │ └── SuggestedValueHelper.kt │ │ │ ├── addgroup │ │ │ ├── AddGroupDialog.kt │ │ │ └── AddGroupDialogViewModel.kt │ │ │ ├── addtracker │ │ │ ├── AddTrackerFragment.kt │ │ │ ├── AddTrackerView.kt │ │ │ ├── AddTrackerViewModel.kt │ │ │ ├── ExportFeaturesDialog.kt │ │ │ └── ImportFeaturesDialog.kt │ │ │ ├── assetreader │ │ │ ├── AssetReader.kt │ │ │ └── AssetReaderImpl.kt │ │ │ ├── backupandrestore │ │ │ ├── AutoBackupViewModel.kt │ │ │ ├── BackupAndRestoreFragment.kt │ │ │ ├── BackupAndRestoreView.kt │ │ │ ├── BackupAndRestoreViewModel.kt │ │ │ ├── BackupRestoreInteractor.kt │ │ │ ├── BackupRestoreInteractorImpl.kt │ │ │ ├── PeriodicBackupWorker.kt │ │ │ └── dto │ │ │ │ ├── AutoBackupInfo.kt │ │ │ │ ├── BackupConfig.kt │ │ │ │ ├── BackupResult.kt │ │ │ │ └── RestoreResult.kt │ │ │ ├── deeplinkhandler │ │ │ ├── DeepLinkHandler.kt │ │ │ └── DeepLinkHandlerImpl.kt │ │ │ ├── di │ │ │ ├── AppModule.kt │ │ │ ├── LuaEngineSettingsModule.kt │ │ │ └── ViewModelModule.kt │ │ │ ├── downloader │ │ │ ├── FileDownloader.kt │ │ │ └── FileDownloaderImpl.kt │ │ │ ├── featurehistory │ │ │ ├── FeatureHistoryView.kt │ │ │ ├── FeatureHistoryViewModel.kt │ │ │ ├── FragmentFeatureHistory.kt │ │ │ └── UpdateDialogViewModel.kt │ │ │ ├── graphstatinput │ │ │ ├── GraphStatInputFragment.kt │ │ │ ├── GraphStatInputView.kt │ │ │ ├── GraphStatInputViewModel.kt │ │ │ ├── configviews │ │ │ │ ├── behaviour │ │ │ │ │ ├── FilterableFeatureConfigBehaviour.kt │ │ │ │ │ ├── SingleFeatureConfigBehaviour.kt │ │ │ │ │ ├── TimeRangeConfigBehaviour.kt │ │ │ │ │ └── YRangeConfigBehaviour.kt │ │ │ │ ├── ui │ │ │ │ │ ├── AverageTimeBetweenConfigView.kt │ │ │ │ │ ├── BarChartConfigView.kt │ │ │ │ │ ├── LastValueConfigView.kt │ │ │ │ │ ├── LineGraphConfigView.kt │ │ │ │ │ ├── LuaGraphConfigView.kt │ │ │ │ │ ├── PieChartConfigView.kt │ │ │ │ │ └── TimeHistogramConfigView.kt │ │ │ │ └── viewmodel │ │ │ │ │ ├── AverageTimeBetweenConfigViewModel.kt │ │ │ │ │ ├── BarChartConfigViewModel.kt │ │ │ │ │ ├── GraphStatConfigViewModelBase.kt │ │ │ │ │ ├── LastValueConfigViewModel.kt │ │ │ │ │ ├── LineGraphConfigViewModel.kt │ │ │ │ │ ├── LuaGraphConfigViewModel.kt │ │ │ │ │ ├── PieChartConfigViewModel.kt │ │ │ │ │ └── TimeHistogramConfigViewModel.kt │ │ │ └── customviews │ │ │ │ ├── FilterByLabelSection.kt │ │ │ │ ├── FilterByValueSection.kt │ │ │ │ ├── GraphStatDurationSpinner.kt │ │ │ │ ├── GraphStatEndingAtSpinner.kt │ │ │ │ ├── GraphStatYRangeTypeSpinner.kt │ │ │ │ └── YRangeFromToInputs.kt │ │ │ ├── graphstatproviders │ │ │ ├── GraphStatInteractorProvider.kt │ │ │ └── datasourceadapters │ │ │ │ ├── AverageTimeBetweenDataSourceAdapter.kt │ │ │ │ ├── BarChartDataSourceAdapter.kt │ │ │ │ ├── GraphStatDataSourceAdapter.kt │ │ │ │ ├── LastValueDataSourceAdapter.kt │ │ │ │ ├── LineGraphDataSourceAdapter.kt │ │ │ │ ├── LuaGraphDataSourceAdapter.kt │ │ │ │ ├── PieChartDataSourceAdapter.kt │ │ │ │ └── TimeHistogramDataSourceAdapter.kt │ │ │ ├── graphstatview │ │ │ ├── GraphStatInitException.kt │ │ │ ├── exceptions │ │ │ │ └── GraphNotFoundException.kt │ │ │ ├── factories │ │ │ │ ├── AverageTimeBetweenDataFactory.kt │ │ │ │ ├── BarChartDataFactory.kt │ │ │ │ ├── LastValueDataFactory.kt │ │ │ │ ├── LineGraphDataFactory.kt │ │ │ │ ├── LuaGraphDataFactory.kt │ │ │ │ ├── PieChartDataFactory.kt │ │ │ │ ├── TimeHistogramDataFactory.kt │ │ │ │ ├── TimeHistogramDataHelper.kt │ │ │ │ ├── ViewDataFactory.kt │ │ │ │ ├── helpers │ │ │ │ │ ├── AndroidPlotSeriesHelper.kt │ │ │ │ │ ├── DataDisplayIntervalHelper.kt │ │ │ │ │ ├── DataPointLuaHelper.kt │ │ │ │ │ ├── ErrorLuaHelper.kt │ │ │ │ │ ├── LineGraphLuaHelper.kt │ │ │ │ │ ├── LuaResultHelpersCommon.kt │ │ │ │ │ ├── PieChartLuaHelper.kt │ │ │ │ │ ├── TextLuaHelper.kt │ │ │ │ │ └── TimeBarchartLuaHelper.kt │ │ │ │ └── viewdto │ │ │ │ │ ├── ColorSpec.kt │ │ │ │ │ ├── IAverageTimeBetweenViewData.kt │ │ │ │ │ ├── IBarChartViewData.kt │ │ │ │ │ ├── IGraphStatViewData.kt │ │ │ │ │ ├── ILastValueViewData.kt │ │ │ │ │ ├── ILineGraphViewData.kt │ │ │ │ │ ├── ILuaGraphViewData.kt │ │ │ │ │ ├── IPieChartViewData.kt │ │ │ │ │ ├── ITextViewData.kt │ │ │ │ │ └── ITimeHistogramViewData.kt │ │ │ └── ui │ │ │ │ ├── AverageTimeBetweenView.kt │ │ │ │ ├── BarChartView.kt │ │ │ │ ├── GraphStatCardView.kt │ │ │ │ ├── GraphStatUICommon.kt │ │ │ │ ├── GraphStatView.kt │ │ │ │ ├── LastValueView.kt │ │ │ │ ├── LineGraphView.kt │ │ │ │ ├── LuaTextView.kt │ │ │ │ ├── PieChartView.kt │ │ │ │ └── TimeHistogramView.kt │ │ │ ├── group │ │ │ ├── CalculatedGraphViewData.kt │ │ │ ├── DragTouchHelperCallback.kt │ │ │ ├── GraphStatViewHolder.kt │ │ │ ├── GraphWithViewData.kt │ │ │ ├── GroupAdapter.kt │ │ │ ├── GroupChild.kt │ │ │ ├── GroupFragment.kt │ │ │ ├── GroupViewHolder.kt │ │ │ ├── GroupViewModel.kt │ │ │ └── TrackerViewHolder.kt │ │ │ ├── lua │ │ │ ├── Constants.kt │ │ │ ├── GlobalsProvider.kt │ │ │ ├── LuaEngine.kt │ │ │ ├── LuaEngineImpl.kt │ │ │ ├── LuaEngineSettings.kt │ │ │ ├── LuaEngineSettingsProvider.kt │ │ │ ├── LuaScriptResolver.kt │ │ │ ├── apiimpl │ │ │ │ ├── ColorParser.kt │ │ │ │ ├── CoreApiImpl.kt │ │ │ │ ├── DataPointParser.kt │ │ │ │ ├── DateTimeParser.kt │ │ │ │ ├── LuaApiHelpers.kt │ │ │ │ ├── LuaDataSourceProviderImpl.kt │ │ │ │ └── RequireApiImpl.kt │ │ │ ├── dto │ │ │ │ ├── ColorSpec.kt │ │ │ │ ├── Line.kt │ │ │ │ ├── LinePoint.kt │ │ │ │ ├── LinePointStyle.kt │ │ │ │ ├── LuaGraphResult.kt │ │ │ │ ├── LuaGraphResultData.kt │ │ │ │ ├── PieChartSegment.kt │ │ │ │ ├── TextAlignment.kt │ │ │ │ ├── TextSize.kt │ │ │ │ ├── TimeBar.kt │ │ │ │ └── TimeBarSegment.kt │ │ │ └── graphadapters │ │ │ │ ├── DataPointLuaGraphAdapter.kt │ │ │ │ ├── LineGraphLuaGraphAdapter.kt │ │ │ │ ├── LuaGraphAdaptor.kt │ │ │ │ ├── PieChartLuaGraphAdapter.kt │ │ │ │ ├── TextLuaGraphAdapter.kt │ │ │ │ └── TimeBarChartLuaGraphAdapter.kt │ │ │ ├── main │ │ │ ├── AppBarViewModel.kt │ │ │ ├── DrawerMenu.kt │ │ │ ├── MainActivity.kt │ │ │ └── MainScreen.kt │ │ │ ├── navigation │ │ │ └── PendingIntentProviderImpl.kt │ │ │ ├── notes │ │ │ ├── GlobalNoteInputDialogView.kt │ │ │ ├── GlobalNoteInputViewModel.kt │ │ │ ├── NotesFragment.kt │ │ │ ├── NotesView.kt │ │ │ └── NotesViewModel.kt │ │ │ ├── permissions │ │ │ └── PermissionRequesterUseCase.kt │ │ │ ├── reminders │ │ │ ├── ReminderListAdapter.kt │ │ │ └── RemindersFragment.kt │ │ │ ├── remoteconfig │ │ │ ├── RemoteConfigProvider.kt │ │ │ ├── RemoteConfigProviderImpl.kt │ │ │ ├── UrlNavigator.kt │ │ │ └── UrlNavigatorImpl.kt │ │ │ ├── settings │ │ │ ├── TngSettings.kt │ │ │ └── TngSettingsImpl.kt │ │ │ ├── timers │ │ │ └── AddDataPointFromTimerActivity.kt │ │ │ ├── tutorial │ │ │ └── TutorialScreen.kt │ │ │ ├── ui │ │ │ ├── DataVisColorList.kt │ │ │ ├── DescriptionDialogs.kt │ │ │ ├── ExtendedSpinner.kt │ │ │ ├── GraphLegendItemView.kt │ │ │ ├── MoveToDialogFragment.kt │ │ │ ├── OrderedListAdapter.kt │ │ │ ├── YesCancelDialogFragment.kt │ │ │ ├── compose │ │ │ │ ├── compositionlocals │ │ │ │ │ └── CompositionLocalProviders.kt │ │ │ │ ├── theming │ │ │ │ │ └── TnGComposeTheme.kt │ │ │ │ └── ui │ │ │ │ │ ├── AddCreateBar.kt │ │ │ │ │ ├── BottomButtons.kt │ │ │ │ │ ├── Buttons.kt │ │ │ │ │ ├── CheckboxLabeledExpandingSection.kt │ │ │ │ │ ├── CustomDialogs.kt │ │ │ │ │ ├── DateScrollLazyColumn.kt │ │ │ │ │ ├── DateTimeSelectorButtons.kt │ │ │ │ │ ├── Dividers.kt │ │ │ │ │ ├── DurationInput.kt │ │ │ │ │ ├── EmptyScreenText.kt │ │ │ │ │ ├── FadingLazyRow.kt │ │ │ │ │ ├── FadingScrollColumn.kt │ │ │ │ │ ├── FullWidthTextField.kt │ │ │ │ │ ├── InfoDialogs.kt │ │ │ │ │ ├── LabeledRow.kt │ │ │ │ │ ├── LoadingOverlay.kt │ │ │ │ │ ├── LuaCodeVisualTransformation.kt │ │ │ │ │ ├── LuaScriptEditDialog.kt │ │ │ │ │ ├── MiniNumericTextField.kt │ │ │ │ │ ├── RowCheckbox.kt │ │ │ │ │ ├── Shape.kt │ │ │ │ │ ├── SlimOutlinedTextField.kt │ │ │ │ │ ├── Spacing.kt │ │ │ │ │ ├── Spinners.kt │ │ │ │ │ ├── Text.kt │ │ │ │ │ ├── TextChip.kt │ │ │ │ │ ├── TextMapSpinner.kt │ │ │ │ │ └── ValueInputTextField.kt │ │ │ └── viewmodels │ │ │ │ ├── DurationInputViewModel.kt │ │ │ │ └── Helpers.kt │ │ │ ├── util │ │ │ ├── BindingForViewLifecycle.kt │ │ │ ├── FeatureDataProvider.kt │ │ │ ├── FeaturePathProvider.kt │ │ │ ├── FlowExtensions.kt │ │ │ ├── GroupPathProvider.kt │ │ │ ├── ImportExportFeatureUtils.kt │ │ │ ├── ResumeScope.kt │ │ │ ├── Stopwatch.kt │ │ │ └── UtilFuncs.kt │ │ │ ├── viewgraphstat │ │ │ ├── GraphNote.kt │ │ │ ├── NotesAdapter.kt │ │ │ ├── ViewGraphStatFragment.kt │ │ │ └── ViewGraphStatViewModel.kt │ │ │ └── widgets │ │ │ ├── TrackWidgetConfigureActivity.kt │ │ │ ├── TrackWidgetConfigureDialog.kt │ │ │ └── TrackWidgetInputDataPointActivity.kt │ └── res │ │ ├── anim │ │ ├── slide_in_left.xml │ │ ├── slide_in_right.xml │ │ ├── slide_out_left.xml │ │ └── slide_out_right.xml │ │ ├── drawable │ │ ├── about_icon.xml │ │ ├── add_icon.xml │ │ ├── app_icon.xml │ │ ├── backup_restore_icon.xml │ │ ├── bg_hold_to_preview.xml │ │ ├── content_paste.xml │ │ ├── delete_icon.xml │ │ ├── discrete_value_button.xml │ │ ├── down_arrow.xml │ │ ├── edit_icon.xml │ │ ├── export_icon.xml │ │ ├── faq_icon.xml │ │ ├── filled_circle.xml │ │ ├── folder_open.xml │ │ ├── github_mark.xml │ │ ├── group_tab_corner.xml │ │ ├── history.xml │ │ ├── home_menu_icon.xml │ │ ├── ic_graph_example.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_pie_chart_example.xml │ │ ├── ic_scroll_grabber.xml │ │ ├── import_icon.xml │ │ ├── left_to_right_gradient.xml │ │ ├── list_menu_icon.xml │ │ ├── lua_icon.xml │ │ ├── point_style_circles_and_numbers_icon.xml │ │ ├── point_style_circles_icon.xml │ │ ├── point_style_circles_only_icon.xml │ │ ├── point_style_none_icon.xml │ │ ├── popup_tab_background.xml │ │ ├── queue_add_box.xml │ │ ├── rate_icon.xml │ │ ├── reminders_icon.xml │ │ ├── track_widget_preview.xml │ │ ├── tutorial_image_1.jpeg │ │ ├── tutorial_image_2.jpeg │ │ ├── tutorial_image_3.jpeg │ │ └── up_arrow.xml │ │ ├── font │ │ └── roboto_mono.ttf │ │ ├── layout │ │ ├── description_body_text.xml │ │ ├── export_features_dialog.xml │ │ ├── feature_description_layout.xml │ │ ├── fragment_group.xml │ │ ├── fragment_view_graph_stat.xml │ │ ├── graph_pie_chart.xml │ │ ├── graph_xy_plot.xml │ │ ├── import_features_dialog.xml │ │ ├── layout_loading_overlay.xml │ │ ├── list_item_feature_checkbox.xml │ │ ├── list_item_graph_legend.xml │ │ ├── list_item_group.xml │ │ ├── list_item_move_to_group.xml │ │ ├── list_item_note.xml │ │ ├── list_item_reminder.xml │ │ ├── list_item_tracker.xml │ │ ├── move_to_group_dialog.xml │ │ ├── nav_header.xml │ │ ├── nav_host_fragment.xml │ │ ├── navigation_menu_spinner.xml │ │ ├── reminders_fragment.xml │ │ ├── show_note_dialog_header.xml │ │ ├── track_widget_configure_dialog.xml │ │ └── validate_add_footer.xml │ │ ├── menu │ │ ├── edit_graph_stat_context_menu.xml │ │ ├── edit_group_context_menu.xml │ │ ├── edit_note_context_menu.xml │ │ └── edit_tracker_context_menu.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── navigation │ │ └── navigation.xml │ │ └── xml │ │ ├── debug_network_security_config.xml │ │ ├── production_network_security_config.xml │ │ ├── shortcuts.xml │ │ └── track_widget_info.xml │ └── test │ └── java │ └── com │ └── samco │ └── trackandgraph │ ├── RandomCsvDataGenerator.kt │ ├── adddatapoint │ └── SuggestedValueHelperImplTest.kt │ ├── graphstatview │ ├── DataDisplayIntervalHelperTest.kt │ └── factories │ │ ├── AverageTimeBetweenDataFactoryTest.kt │ │ ├── BarChartDataFactoryTest.kt │ │ ├── LineGraphDataFactoryTest.kt │ │ ├── LineGraphDataFactoryTestComponentDagger.kt │ │ ├── LuaDataFactoryTestComponentDagger.kt │ │ ├── LuaGraphDataFactoryTest.kt │ │ ├── PieChartDataFactoryTest.kt │ │ └── TimeHistogramDataHelperTests.kt │ ├── group │ └── GroupViewModelTest.kt │ ├── lua │ ├── CommunityTestRunner.kt │ ├── DataPointLuaGraphTests.kt │ ├── GraphApiLuaGraphTests.kt │ ├── LineGraphLuaGraphTests.kt │ ├── LuaEngineImplTest.kt │ ├── LuaEngineTestComponentDagger.kt │ ├── PieChartLuaGraphTests.kt │ ├── TextLuaGraphTests.kt │ ├── TimeBarchartLuaGraphTests.kt │ └── TimeLuaApiTests.kt │ ├── ui │ └── compose │ │ └── viewmodels │ │ └── HelpersKtTest.kt │ └── util │ ├── FeaturePathProviderTest.kt │ ├── GroupPathProviderTest.kt │ └── TestUtils.kt ├── base ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro ├── schemas │ └── com.samco.trackandgraph.base.database.TrackAndGraphDatabase │ │ ├── 29.json │ │ ├── 30.json │ │ ├── 31.json │ │ ├── 32.json │ │ ├── 33.json │ │ ├── 34.json │ │ ├── 35.json │ │ ├── 36.json │ │ ├── 37.json │ │ ├── 38.json │ │ ├── 39.json │ │ ├── 40.json │ │ ├── 41.json │ │ ├── 42.json │ │ ├── 43.json │ │ ├── 44.json │ │ ├── 45.json │ │ ├── 46.json │ │ ├── 47.json │ │ ├── 48.json │ │ ├── 49.json │ │ ├── 50.json │ │ ├── 51.json │ │ ├── 52.json │ │ ├── 53.json │ │ ├── 54.json │ │ ├── 55.json │ │ └── 56.json └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── samco │ │ └── trackandgraph │ │ ├── DemoDBGenerator.kt │ │ ├── Faq1DemoData.kt │ │ ├── FirstOpenTutorialDemoData.kt │ │ ├── MigrationTests.kt │ │ └── PlaystoreScreenshotsDemoData.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── samco │ │ │ └── trackandgraph │ │ │ └── base │ │ │ ├── database │ │ │ ├── TrackAndGraphDatabase.kt │ │ │ ├── TrackAndGraphDatabaseDao.kt │ │ │ ├── dto │ │ │ │ ├── AverageTimeBetweenStat.kt │ │ │ │ ├── BarChart.kt │ │ │ │ ├── BarChartBarPeriod.kt │ │ │ │ ├── CheckedDays.kt │ │ │ │ ├── DataPoint.kt │ │ │ │ ├── DataType.kt │ │ │ │ ├── DisplayNote.kt │ │ │ │ ├── DisplayTracker.kt │ │ │ │ ├── DurationPlottingMode.kt │ │ │ │ ├── Feature.kt │ │ │ │ ├── GlobalNote.kt │ │ │ │ ├── GraphEndDate.kt │ │ │ │ ├── GraphOrStat.kt │ │ │ │ ├── GraphStatType.kt │ │ │ │ ├── Group.kt │ │ │ │ ├── GroupChild.kt │ │ │ │ ├── IDataPoint.kt │ │ │ │ ├── LastValueStat.kt │ │ │ │ ├── LineGraph.kt │ │ │ │ ├── LineGraphAveraginModes.kt │ │ │ │ ├── LineGraphFeature.kt │ │ │ │ ├── LineGraphPlottingModes.kt │ │ │ │ ├── LineGraphPointStyle.kt │ │ │ │ ├── LineGraphWithFeatures.kt │ │ │ │ ├── LuaGraph.kt │ │ │ │ ├── LuaGraphFeature.kt │ │ │ │ ├── LuaGraphWithFeatures.kt │ │ │ │ ├── PieChart.kt │ │ │ │ ├── Reminder.kt │ │ │ │ ├── TimeHistogram.kt │ │ │ │ ├── TimeHistogramWindow.kt │ │ │ │ ├── Tracker.kt │ │ │ │ ├── TrackerSuggestionOrder.kt │ │ │ │ ├── TrackerSuggestionType.kt │ │ │ │ └── YRangeType.kt │ │ │ ├── entity │ │ │ │ ├── AverageTimeBetweenStat.kt │ │ │ │ ├── BarChart.kt │ │ │ │ ├── DataPoint.kt │ │ │ │ ├── Feature.kt │ │ │ │ ├── FeatureTimer.kt │ │ │ │ ├── GlobalNote.kt │ │ │ │ ├── GraphOrStat.kt │ │ │ │ ├── Group.kt │ │ │ │ ├── LastValueStat.kt │ │ │ │ ├── LineGraph.kt │ │ │ │ ├── LineGraphFeature.kt │ │ │ │ ├── LuaGraph.kt │ │ │ │ ├── LuaGraphFeature.kt │ │ │ │ ├── PieChart.kt │ │ │ │ ├── Reminder.kt │ │ │ │ ├── TimeHistogram.kt │ │ │ │ ├── Tracker.kt │ │ │ │ └── queryresponse │ │ │ │ │ ├── DisplayNote.kt │ │ │ │ │ ├── DisplayTracker.kt │ │ │ │ │ ├── LineGraphWithFeatures.kt │ │ │ │ │ ├── LuaGraphWithFeatures.kt │ │ │ │ │ └── TrackerWithFeature.kt │ │ │ ├── migrations │ │ │ │ ├── DatabaseMigrations.kt │ │ │ │ ├── Migration29to30.kt │ │ │ │ ├── Migration30to31.kt │ │ │ │ ├── Migration31to32.kt │ │ │ │ ├── Migration32to33.kt │ │ │ │ ├── Migration33to34.kt │ │ │ │ ├── Migration34to35.kt │ │ │ │ ├── Migration35to36.kt │ │ │ │ ├── Migration36to37.kt │ │ │ │ ├── Migration37to38.kt │ │ │ │ ├── Migration38to39.kt │ │ │ │ ├── Migration39to40.kt │ │ │ │ ├── Migration40to41.kt │ │ │ │ ├── Migration41to42.kt │ │ │ │ ├── Migration42to43.kt │ │ │ │ ├── Migration43to44.kt │ │ │ │ ├── Migration44to45.kt │ │ │ │ ├── Migration45to46.kt │ │ │ │ ├── Migration46to47.kt │ │ │ │ ├── Migration47to48.kt │ │ │ │ ├── Migration48to49.kt │ │ │ │ ├── Migration49to50.kt │ │ │ │ ├── Migration50to51.kt │ │ │ │ ├── Migration51to52.kt │ │ │ │ ├── Migration52to53.kt │ │ │ │ ├── Migration53to54.kt │ │ │ │ ├── Migration54to55.kt │ │ │ │ ├── Migration55to56.kt │ │ │ │ └── MigrationHelpers.kt │ │ │ └── sampling │ │ │ │ ├── DataPointCursorSequence.kt │ │ │ │ ├── DataSample.kt │ │ │ │ ├── DataSampleProperties.kt │ │ │ │ ├── DataSampler.kt │ │ │ │ └── RawDataSample.kt │ │ │ ├── helpers │ │ │ ├── DateTimeFormatters.kt │ │ │ └── PrefHelper.kt │ │ │ ├── model │ │ │ ├── CSVReadWriter.kt │ │ │ ├── CSVReadWriterImpl.kt │ │ │ ├── DataInteractor.kt │ │ │ ├── DataInteractorImpl.kt │ │ │ ├── DataPointUpdateHelper.kt │ │ │ ├── DataUpdateType.kt │ │ │ ├── DatabaseTransactionHelper.kt │ │ │ ├── RemindersHelper.kt │ │ │ ├── TrackerHelper.kt │ │ │ ├── TrackerHelperImpl.kt │ │ │ └── di │ │ │ │ ├── DispatchersModule.kt │ │ │ │ └── ModelModule.kt │ │ │ ├── navigation │ │ │ └── PendingIntentProvider.kt │ │ │ ├── service │ │ │ ├── AlarmReceiver.kt │ │ │ ├── TimerNotificationService.kt │ │ │ ├── TimerServiceInteractor.kt │ │ │ ├── TrackWidgetJobIntentService.kt │ │ │ └── TrackWidgetProvider.kt │ │ │ └── system │ │ │ ├── AlarmManagerWrapper.kt │ │ │ ├── ReminderPrefWrapper.kt │ │ │ └── SystemInfoProvider.kt │ └── res │ │ ├── color │ │ └── checkbox_color.xml │ │ ├── drawable-hdpi │ │ ├── notification_icon.png │ │ └── timer_notification_icon.png │ │ ├── drawable-mdpi │ │ ├── notification_icon.png │ │ └── timer_notification_icon.png │ │ ├── drawable-night │ │ └── track_widget_card.xml │ │ ├── drawable-xhdpi │ │ └── notification_icon.png │ │ ├── drawable-xxhdpi │ │ └── notification_icon.png │ │ ├── drawable-xxxhdpi │ │ └── notification_icon.png │ │ ├── drawable │ │ ├── expansive_text_box_background.xml │ │ ├── ic_add_record.xml │ │ ├── ic_play_timer.xml │ │ ├── ic_stop_timer.xml │ │ ├── track_widget_card.xml │ │ └── warning_icon.xml │ │ ├── layout │ │ └── track_widget.xml │ │ ├── values-de-rDE │ │ └── strings.xml │ │ ├── values-es │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-night │ │ └── themes.xml │ │ ├── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── integer.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ ├── themes.xml │ │ └── type.xml │ │ └── xml │ │ └── backup_rules.xml │ └── test │ └── java │ └── com │ └── samco │ └── trackandgraph │ └── base │ ├── database │ └── sampling │ │ └── DataPointCursorSequenceTest.kt │ └── model │ ├── CSVReadWriterImplTest.kt │ ├── DataInteractorImplTest.kt │ ├── RemindersHelperImplTest.kt │ └── TrackerHelperImpl_UpdateDataPoints_Test.kt ├── build.gradle ├── configuration ├── remote-configuration.json ├── remote-configuration.schema.json └── validate-config.py ├── database-extract └── extract ├── docs ├── .gitignore ├── docs │ ├── img │ │ └── logo.png │ ├── index.md │ ├── lua │ │ ├── community │ │ │ ├── bar-charts │ │ │ │ ├── cumulative │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ │ └── merge-inputs │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ ├── datapoint │ │ │ │ ├── last-value-above-threshold │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ │ └── last-value-below-threshold │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ ├── index.md │ │ │ ├── line-graphs │ │ │ │ ├── cumulative │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test_cumulative_values.lua │ │ │ │ ├── difference │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ │ └── merge-inputs │ │ │ │ │ ├── README.md │ │ │ │ │ ├── merge-inputs.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ ├── pie-charts │ │ │ │ ├── moving-pie-chart │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ │ └── periodic-pie-chart │ │ │ │ │ ├── README.md │ │ │ │ │ ├── image.jpg │ │ │ │ │ ├── script.lua │ │ │ │ │ └── test.lua │ │ │ └── text │ │ │ │ ├── fraction │ │ │ │ ├── README.md │ │ │ │ ├── image.jpg │ │ │ │ ├── script.lua │ │ │ │ └── test.lua │ │ │ │ └── total-this-period │ │ │ │ ├── README.md │ │ │ │ ├── image.jpg │ │ │ │ ├── script.lua │ │ │ │ └── test.lua │ │ └── developer-guide │ │ │ ├── data_source_configuration.jpg │ │ │ ├── hello_world_card.jpg │ │ │ └── intro.md │ ├── policies │ │ └── privacy-policy.md │ ├── stylesheets │ │ └── extra.css │ └── tutorial │ │ ├── graphs │ │ ├── bar-charts.md │ │ ├── histograms.md │ │ ├── images │ │ │ ├── faq_3_1_1.gif │ │ │ ├── faq_3_1_1.png │ │ │ ├── faq_3_1_2.gif │ │ │ ├── faq_3_1_2.png │ │ │ ├── faq_3_1_3.png │ │ │ ├── faq_3_1_4.png │ │ │ ├── faq_3_1_5.png │ │ │ ├── faq_3_1_6.png │ │ │ ├── faq_3_1_7.png │ │ │ ├── faq_3_2_1.png │ │ │ ├── faq_3_3_1.png │ │ │ ├── faq_3_3_2.png │ │ │ ├── faq_3_3_3.png │ │ │ ├── faq_3_4_1.jpg │ │ │ ├── faq_3_4_2.jpg │ │ │ ├── faq_3_4_3.jpg │ │ │ ├── faq_3_4_4.jpg │ │ │ ├── faq_3_4_5.jpg │ │ │ ├── faq_3_4_6.jpg │ │ │ ├── faq_3_4_7.jpg │ │ │ ├── faq_3_5_1.png │ │ │ ├── faq_3_5_2.png │ │ │ └── faq_3_5_3.png │ │ ├── index.md │ │ ├── line.md │ │ ├── lua-graphs │ │ │ ├── lua-graphs.md │ │ │ ├── video.gif │ │ │ └── video.mp4 │ │ ├── pie.md │ │ └── statistics.md │ │ ├── images │ │ ├── faq_1_1.gif │ │ ├── faq_1_1.jpg │ │ ├── faq_1_2.gif │ │ ├── faq_1_2.png │ │ ├── faq_1_3.gif │ │ ├── faq_1_3.png │ │ ├── faq_1_4.gif │ │ ├── faq_1_5.gif │ │ ├── faq_1_6.gif │ │ ├── faq_1_7.gif │ │ ├── faq_1_8.png │ │ ├── faq_2_1.png │ │ ├── faq_2_2.png │ │ ├── faq_2_3.png │ │ ├── faq_4_1.png │ │ ├── faq_4_2.jpg │ │ ├── faq_4_3.jpg │ │ ├── faq_4_4.jpg │ │ └── faq_5_1.png │ │ ├── import-export.md │ │ ├── index.md │ │ ├── notes.md │ │ ├── timestamps.md │ │ └── tracking.md ├── mkdocs.yml └── requirements.txt ├── fastlane ├── Appfile ├── Fastfile ├── README.md └── metadata │ └── android │ └── en-GB │ ├── changelogs │ ├── 1.3.3.txt │ ├── 101000.txt │ ├── 101001.txt │ ├── 101002.txt │ ├── 101003.txt │ ├── 101004.txt │ ├── 101100.txt │ ├── 101101.txt │ ├── 101200.txt │ ├── 101201.txt │ ├── 101300.txt │ ├── 101301.txt │ ├── 101400.txt │ ├── 10402.txt │ ├── 10403.txt │ ├── 10404.txt │ ├── 10500.txt │ ├── 10501.txt │ ├── 10502.txt │ ├── 10600.txt │ ├── 10601.txt │ ├── 10602.txt │ ├── 10700.txt │ ├── 10701.txt │ ├── 10702.txt │ ├── 10800.txt │ ├── 10801.txt │ ├── 10900.txt │ ├── 200000.txt │ ├── 200001.txt │ ├── 200002.txt │ ├── 200003.txt │ ├── 200004.txt │ ├── 200100.txt │ ├── 200101.txt │ ├── 200200.txt │ ├── 200201.txt │ ├── 200300.txt │ ├── 200301.txt │ ├── 200302.txt │ ├── 200303.txt │ ├── 200304.txt │ ├── 200305.txt │ ├── 200400.txt │ ├── 200401.txt │ ├── 200402.txt │ ├── 300000.txt │ ├── 300001.txt │ ├── 300002.txt │ ├── 300100.txt │ ├── 300200.txt │ ├── 300201.txt │ ├── 300300.txt │ ├── 300301.txt │ ├── 300400.txt │ ├── 300401.txt │ ├── 300500.txt │ ├── 300501.txt │ ├── 300600.txt │ ├── 300601.txt │ ├── 300602.txt │ ├── 300603.txt │ ├── 300604.txt │ ├── 300700.txt │ ├── 300701.txt │ ├── 300702.txt │ ├── 300800.txt │ ├── 300801.txt │ ├── 300802.txt │ ├── 300803.txt │ ├── 400000.txt │ ├── 400001.txt │ ├── 400002.txt │ ├── 400003.txt │ ├── 500000.txt │ ├── 500100.txt │ ├── 500101.txt │ ├── 500102.txt │ ├── 500103.txt │ └── 600000.txt │ ├── full_description.txt │ ├── images │ ├── icon.png │ └── phoneScreenshots │ │ ├── 1_en-GB.jpg │ │ ├── 2_en-GB.jpg │ │ ├── 3_en-GB.jpg │ │ ├── 4_en-GB.jpg │ │ ├── 5_en-GB.jpg │ │ ├── 6_en-GB.jpg │ │ └── 7_en-GB.jpg │ ├── short_description.txt │ ├── title.txt │ └── video.txt ├── functions ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── samco │ │ └── trackandgraph │ │ └── functions │ │ ├── aggregation │ │ ├── AggregationCommon.kt │ │ ├── AggregationPreferences.kt │ │ ├── FixedBinAggregator.kt │ │ └── MovingAggregator.kt │ │ ├── exceptions │ │ └── InvalidRegularityException.kt │ │ ├── functions │ │ ├── CompositeFunction.kt │ │ ├── DataClippingFunction.kt │ │ ├── DataPaddingFunction.kt │ │ ├── DataSampleFunction.kt │ │ ├── DurationAggregationFunction.kt │ │ ├── FilterLabelFunction.kt │ │ ├── FilterValueFunction.kt │ │ ├── IdentityFunction.kt │ │ └── MovingAverageFunction.kt │ │ └── helpers │ │ └── TimeHelper.kt │ └── test │ └── java │ └── com │ └── samco │ └── trackandgraph │ └── functions │ ├── DataClippingFunctionTest.kt │ ├── DataPaddingFunctionTest.kt │ ├── DurationAggregationFunctionTest.kt │ ├── FilterValueFunctionTest.kt │ ├── MovingAverageFunctionTest.kt │ ├── TestCommon.kt │ └── TimeHelperTests.kt ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── image-assets ├── PointStyles.svg ├── app_icon.svg ├── app_icon.svg.png ├── bitcoin-cash.jpeg ├── bitcoin.jpeg ├── dash.svg ├── ethereum.jpeg ├── graph_example.svg ├── graph_icon.svg ├── group_tab_corner.svg ├── home_menu_icon.svg ├── ic_launcher_background.svg ├── ic_launcher_foreground.svg ├── litecoin.jpeg ├── notification_icon.png ├── pie_chart_example.svg └── track_widget_preview.svg ├── lua └── src │ ├── test │ └── core.lua │ └── tng │ ├── core.lua │ ├── graph.lua │ └── graphext.lua ├── release-checklist.txt ├── scripts └── serve-and-deep-link-lua.py └── settings.gradle /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | # gem "rails" 6 | gem "fastlane" 7 | gem 'logger' 8 | gem 'mutex_m' 9 | gem 'abbrev' 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: deep-link-inject 2 | 3 | deep-link-serve-local: 4 | ifndef FILE 5 | @echo "Error: FILE parameter is required" 6 | @echo "Usage: make deep-link-inject FILE=" 7 | @exit 1 8 | endif 9 | @echo "Injecting deep link for file: $(FILE)" 10 | python3 scripts/serve-and-deep-link-lua.py $(FILE) 11 | 12 | 13 | deep-link-inject: 14 | ifndef FILE 15 | @echo "Error: FILE parameter is required" 16 | @echo "Usage: make deep-link-inject FILE=" 17 | @exit 1 18 | endif 19 | @echo "Injecting deep link for file: $(FILE)" 20 | # Copy the file over adb to the devices tmp directory 21 | adb push $(FILE) /data/local/tmp/tmp.lua 22 | adb shell am start -a android.intent.action.VIEW -d "trackandgraph://lua_inject_file?path=/data/local/tmp/tmp.lua" 23 | 24 | validate-remote-config: 25 | cd ./configuration; source bin/activate; python3 ./validate-config.py; deactivate 26 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class com.androidplot.** { *; } 24 | -keepnames class androidx.navigation.fragment.NavHostFragment 25 | -keepattributes LineNumberTable,SourceFile 26 | -renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/debug/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/IntentActions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph 19 | 20 | object IntentActions { 21 | const val DISABLE_LUA_ENGINE = "com.samco.trackandgraph.action.DISABLE_LUA_ENGINE" 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/assetreader/AssetReader.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.assetreader 18 | 19 | interface AssetReader { 20 | fun readAssetToString(assetPath: String): String 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/assetreader/AssetReaderImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.assetreader 18 | 19 | import android.content.Context 20 | import com.samco.trackandgraph.assetreader.AssetReader 21 | import dagger.hilt.android.qualifiers.ApplicationContext 22 | import javax.inject.Inject 23 | 24 | class AssetReaderImpl @Inject constructor( 25 | @ApplicationContext private val context: Context 26 | ) : AssetReader { 27 | override fun readAssetToString(assetPath: String): String { 28 | return context.assets.open(assetPath).bufferedReader().use { it.readText() } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/backupandrestore/dto/AutoBackupInfo.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.backupandrestore.dto 2 | 3 | import android.net.Uri 4 | import org.threeten.bp.OffsetDateTime 5 | import org.threeten.bp.temporal.ChronoUnit 6 | 7 | data class AutoBackupInfo( 8 | val uri: Uri, 9 | val nextScheduled: OffsetDateTime, 10 | val interval: Int, 11 | val units: ChronoUnit, 12 | val lastSuccessful: OffsetDateTime? 13 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/backupandrestore/dto/BackupResult.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.backupandrestore.dto 2 | 3 | enum class BackupResult { 4 | SUCCESS, 5 | FAIL_COULD_NOT_WRITE_TO_FILE, 6 | FAIL_COULD_NOT_FIND_DATABASE, 7 | FAIL_COULD_NOT_COPY 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/backupandrestore/dto/RestoreResult.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.backupandrestore.dto 2 | 3 | enum class RestoreResult { 4 | SUCCESS, 5 | FAIL_INVALID_DATABASE, 6 | FAIL_COULD_NOT_FIND_OR_READ_DATABASE_FILE, 7 | FAIL_COULD_NOT_COPY 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/deeplinkhandler/DeepLinkHandler.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.deeplinkhandler 2 | 3 | import kotlinx.coroutines.flow.SharedFlow 4 | import java.net.URI 5 | 6 | interface DeepLinkHandler { 7 | val onLuaDeepLink: SharedFlow 8 | val onLuaScript: SharedFlow 9 | 10 | fun handleUri(uri: String) 11 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/di/LuaEngineSettingsModule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.di 18 | 19 | import com.samco.trackandgraph.lua.LuaEngineSettingsProvider 20 | import dagger.Module 21 | import dagger.Provides 22 | import dagger.hilt.InstallIn 23 | import dagger.hilt.components.SingletonComponent 24 | import javax.inject.Singleton 25 | 26 | @Module 27 | @InstallIn(SingletonComponent::class) 28 | class LuaEngineSettingsModule { 29 | @Provides 30 | @Singleton 31 | fun provideLuaEngineSettingsProvider(): LuaEngineSettingsProvider = LuaEngineSettingsProvider() 32 | } 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/downloader/FileDownloader.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.downloader 2 | 3 | import java.net.URI 4 | 5 | interface FileDownloader { 6 | suspend fun downloadFileToString(url: URI): String? 7 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/downloader/FileDownloaderImpl.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.downloader 2 | 3 | import com.samco.trackandgraph.base.model.di.IODispatcher 4 | import kotlinx.coroutines.CoroutineDispatcher 5 | import kotlinx.coroutines.withContext 6 | import timber.log.Timber 7 | import java.io.BufferedReader 8 | import java.io.InputStreamReader 9 | import java.net.URI 10 | import javax.inject.Inject 11 | 12 | class FileDownloaderImpl @Inject constructor( 13 | @IODispatcher private val ioDispatcher: CoroutineDispatcher 14 | ) : FileDownloader { 15 | override suspend fun downloadFileToString(url: URI): String? = withContext(ioDispatcher) { 16 | try { 17 | val connection = url.toURL().openConnection() 18 | BufferedReader(InputStreamReader(connection.getInputStream())).use { reader -> 19 | reader.readText() 20 | } 21 | } catch (e: Exception) { 22 | Timber.e(e, "Failed to download file from $url") 23 | null 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/graphstatview/GraphStatInitException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.graphstatview 19 | 20 | import java.lang.Exception 21 | 22 | class GraphStatInitException(val errorTextId: Int) : Exception() 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/graphstatview/exceptions/GraphNotFoundException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.graphstatview.exceptions 19 | 20 | class GraphNotFoundException : Exception() -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/graphstatview/factories/helpers/AndroidPlotSeriesHelper.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.graphstatview.factories.helpers 2 | 3 | import com.androidplot.Region 4 | import com.androidplot.util.SeriesUtils 5 | import com.androidplot.xy.FastXYSeries 6 | import com.androidplot.xy.RectRegion 7 | import javax.inject.Inject 8 | import kotlin.math.abs 9 | 10 | class AndroidPlotSeriesHelper @Inject constructor() { 11 | internal fun getFastXYSeries(name: String, xValues: List, yValues: List): FastXYSeries { 12 | 13 | var yRegion = SeriesUtils.minMax(yValues) 14 | if (abs(yRegion.min.toDouble() - yRegion.max.toDouble()) < 0.1) 15 | yRegion = Region(yRegion.min, yRegion.min.toDouble() + 0.1) 16 | 17 | val xRegion = SeriesUtils.minMax(xValues) 18 | val rectRegion = RectRegion(xRegion.min, xRegion.max, yRegion.min, yRegion.max) 19 | 20 | return object : FastXYSeries { 21 | override fun minMax() = rectRegion 22 | override fun getX(index: Int): Number = xValues[index] 23 | override fun getY(index: Int): Number = yValues[index] 24 | override fun getTitle() = name 25 | override fun size() = xValues.size 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/graphstatview/factories/helpers/LuaResultHelpersCommon.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.graphstatview.factories.helpers 2 | 3 | import androidx.annotation.ColorInt 4 | import com.samco.trackandgraph.lua.dto.ColorSpec 5 | import com.samco.trackandgraph.ui.dataVisColorGenerator 6 | import com.samco.trackandgraph.ui.dataVisColorList 7 | import com.samco.trackandgraph.graphstatview.factories.viewdto.ColorSpec as ViewColorSpec 8 | 9 | internal fun ColorSpec.toColorSpec(): ViewColorSpec = when (this) { 10 | is ColorSpec.ColorIndex -> ViewColorSpec.ColorIndex(index) 11 | is ColorSpec.HexColor -> ViewColorSpec.ColorValue(parseHexColor(hexString)) 12 | } 13 | 14 | internal fun indexColorSpec(index: Int): ColorSpec = 15 | ColorSpec.ColorIndex((index * dataVisColorGenerator) % dataVisColorList.size) 16 | 17 | @ColorInt 18 | internal fun parseHexColor(hex: String): Int { 19 | val cleanHex = hex.removePrefix("#") 20 | val color = cleanHex.toLong(16) 21 | return when (cleanHex.length) { 22 | 6 -> (0xFF000000 or color).toInt() // Add alpha if missing 23 | 8 -> color.toInt() 24 | else -> throw IllegalArgumentException("Invalid hex color: $hex") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/graphstatview/factories/viewdto/ColorSpec.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.graphstatview.factories.viewdto 2 | 3 | import androidx.annotation.ColorInt 4 | 5 | sealed class ColorSpec { 6 | data class ColorIndex(val index: Int) : ColorSpec() 7 | data class ColorValue(@ColorInt val value: Int) : ColorSpec() 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/graphstatview/factories/viewdto/ILastValueViewData.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.graphstatview.factories.viewdto 2 | 3 | import com.samco.trackandgraph.base.database.dto.DataPoint 4 | import com.samco.trackandgraph.base.database.dto.GraphOrStat 5 | 6 | interface ILastValueViewData : IGraphStatViewData { 7 | val isDuration: Boolean 8 | val lastDataPoint: DataPoint? 9 | get() = null 10 | 11 | companion object { 12 | fun loading(graphOrStat: GraphOrStat) = object : ILastValueViewData { 13 | override val isDuration: Boolean 14 | get() = false 15 | override val state: IGraphStatViewData.State 16 | get() = IGraphStatViewData.State.LOADING 17 | override val graphOrStat: GraphOrStat 18 | get() = graphOrStat 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/graphstatview/factories/viewdto/ITextViewData.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.graphstatview.factories.viewdto 2 | 3 | import com.samco.trackandgraph.base.database.dto.GraphOrStat 4 | import com.samco.trackandgraph.graphstatview.factories.viewdto.IGraphStatViewData.State 5 | 6 | interface ITextViewData : IGraphStatViewData { 7 | 8 | enum class TextSize { 9 | SMALL, MEDIUM, LARGE 10 | } 11 | 12 | enum class TextAlignment { 13 | START, CENTER, END 14 | } 15 | 16 | val text: String? 17 | get() = null 18 | 19 | val textSize: TextSize 20 | get() = TextSize.MEDIUM 21 | 22 | val textAlignment: TextAlignment 23 | get() = TextAlignment.CENTER 24 | 25 | companion object { 26 | fun loading(graphOrStat: GraphOrStat) = object : ITextViewData { 27 | override val state: State 28 | get() = State.LOADING 29 | override val graphOrStat: GraphOrStat 30 | get() = graphOrStat 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/group/CalculatedGraphViewData.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.group 2 | 3 | import com.samco.trackandgraph.graphstatview.factories.viewdto.IGraphStatViewData 4 | 5 | class CalculatedGraphViewData( 6 | val time: Long, 7 | val viewData: IGraphStatViewData 8 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/group/GraphWithViewData.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.group 2 | 3 | import com.samco.trackandgraph.base.database.dto.GraphOrStat 4 | 5 | class GraphWithViewData( 6 | val graph: GraphOrStat, 7 | val viewData: CalculatedGraphViewData 8 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.lua 2 | 3 | class Constants { 4 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/LuaEngine.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua 18 | 19 | import com.samco.trackandgraph.base.database.sampling.RawDataSample 20 | import com.samco.trackandgraph.lua.dto.LuaGraphResult 21 | 22 | interface LuaEngine { 23 | data class LuaGraphEngineParams( 24 | val dataSources: Map 25 | ) 26 | 27 | fun runLuaGraphScript( 28 | script: String, 29 | params: LuaGraphEngineParams 30 | ): LuaGraphResult 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/LuaEngineSettings.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.lua 19 | 20 | data class LuaEngineSettings( 21 | val enabled: Boolean 22 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/LuaEngineSettingsProvider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua 18 | 19 | class LuaEngineSettingsProvider { 20 | var settings: LuaEngineSettings = LuaEngineSettings(enabled = true) 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/apiimpl/ColorParser.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.lua.apiimpl 2 | 3 | import com.samco.trackandgraph.lua.dto.ColorSpec 4 | import org.luaj.vm2.LuaValue 5 | import javax.inject.Inject 6 | 7 | class ColorParser @Inject constructor() { 8 | fun parseColorOrNull(value: LuaValue): ColorSpec? = when { 9 | value.isint() -> ColorSpec.ColorIndex(value.toint()) 10 | value.isstring() -> ColorSpec.HexColor(value.tojstring()) 11 | else -> null 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/ColorSpec.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | sealed class ColorSpec { 20 | data class HexColor(val hexString: String) : ColorSpec() 21 | data class ColorIndex(val index: Int) : ColorSpec() 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/Line.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | data class Line( 20 | val lineColor: ColorSpec?, 21 | val pointStyle: LinePointStyle?, 22 | val linePoints: List, 23 | val label: String?, 24 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/LinePoint.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | import org.threeten.bp.OffsetDateTime 20 | 21 | data class LinePoint( 22 | val timestamp: OffsetDateTime, 23 | val value: Double, 24 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/LinePointStyle.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | enum class LinePointStyle(val luaValue: String) { 20 | NONE("none"), 21 | CIRCLE("circle"), 22 | CIRCLE_VALUE("circle_value"), 23 | CIRCLES_ONLY("circles_only") 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/LuaGraphResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | data class LuaGraphResult( 20 | val data: LuaGraphResultData? = null, 21 | val error: Throwable? = null, 22 | ) 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/PieChartSegment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | data class PieChartSegment( 20 | val value: Double, 21 | val label: String, 22 | val color: ColorSpec? 23 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/TextAlignment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | enum class TextAlignment { 20 | START, CENTER, END 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/TextSize.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | enum class TextSize { 20 | SMALL, MEDIUM, LARGE 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/TimeBar.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | data class TimeBar( 20 | val segments: List 21 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/dto/TimeBarSegment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.lua.dto 18 | 19 | data class TimeBarSegment( 20 | val value: Double, 21 | val label: String? = null, 22 | val color: ColorSpec? = null, 23 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/lua/graphadapters/LuaGraphAdaptor.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.lua.graphadapters 2 | 3 | import com.samco.trackandgraph.lua.dto.LuaGraphResultData 4 | import org.luaj.vm2.LuaValue 5 | 6 | interface LuaGraphAdaptor { 7 | fun process(data: LuaValue): T? 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/remoteconfig/RemoteConfigProvider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.remoteconfig 18 | 19 | import org.json.JSONArray 20 | import org.json.JSONObject 21 | 22 | interface RemoteConfigProvider { 23 | enum class RemoteConfig(val urlId: String) { 24 | ENDPOINTS("endpoints"), 25 | TRUSTED_LUA_GRAPH_SOURCES("trusted-lua-script-sources"), 26 | } 27 | 28 | suspend fun getRemoteConfigObject(remoteConfig: RemoteConfig): JSONObject? 29 | 30 | suspend fun getRemoteConfigArray(remoteConfig: RemoteConfig): JSONArray? 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/settings/TngSettings.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.settings 2 | 3 | import org.threeten.bp.DayOfWeek 4 | import org.threeten.bp.Duration 5 | 6 | interface TngSettings { 7 | val firstDayOfWeek: DayOfWeek 8 | val startTimeOfDay: Duration 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/settings/TngSettingsImpl.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.settings 2 | 3 | import android.content.Context 4 | import android.os.Build 5 | import dagger.hilt.android.qualifiers.ApplicationContext 6 | import org.threeten.bp.DayOfWeek 7 | import org.threeten.bp.Duration 8 | import org.threeten.bp.temporal.WeekFields 9 | import java.util.Locale 10 | import javax.inject.Inject 11 | 12 | //TODO this is a copy paste of the AggregationPreferences .. Need to align this so it's all 13 | // in one place. I think that place is here, but we need to be able to inject this where it's 14 | // needed in the factories which might require some refactoring, so there's a duplicate for now. 15 | class TngSettingsImpl @Inject constructor( 16 | @ApplicationContext private val context: Context 17 | ) : TngSettings { 18 | override val firstDayOfWeek: DayOfWeek 19 | get() = WeekFields.of(getLocale()).firstDayOfWeek 20 | override val startTimeOfDay: Duration 21 | get() = Duration.ofSeconds(0) 22 | 23 | private fun getLocale(): Locale = 24 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 25 | context.resources.configuration.locales.get(0) 26 | } else { 27 | @Suppress("DEPRECATION") 28 | context.resources.configuration.locale 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/ui/compose/compositionlocals/CompositionLocalProviders.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.ui.compose.compositionlocals 2 | 3 | import androidx.compose.runtime.staticCompositionLocalOf 4 | import com.samco.trackandgraph.settings.TngSettings 5 | 6 | val LocalSettings = staticCompositionLocalOf { 7 | error("CompositionLocal LocalSettings not provided") 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/ui/compose/ui/Shape.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.ui.compose.ui 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.material.Shapes 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.ui.res.dimensionResource 7 | import androidx.compose.ui.unit.Dp 8 | import androidx.compose.ui.unit.dp 9 | import com.samco.trackandgraph.R 10 | 11 | val cardCornerRadius: Dp 12 | @Composable 13 | get() = dimensionResource(id = R.dimen.card_corner_radius) 14 | 15 | val shapeMedium = 8.dp 16 | 17 | val shapeLarge = 16.dp 18 | 19 | val shapes: Shapes 20 | @Composable 21 | get() = Shapes( 22 | small = RoundedCornerShape(cardCornerRadius), 23 | medium = RoundedCornerShape(shapeMedium), 24 | large = RoundedCornerShape(shapeLarge) 25 | ) 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/ui/viewmodels/Helpers.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.ui.viewmodels 2 | 3 | import androidx.compose.ui.text.TextRange 4 | import androidx.compose.ui.text.input.TextFieldValue 5 | 6 | fun String.asValidatedInt() = 7 | this.take(1).filter { it.isDigit() || it == '-' } + this.drop(1).takeWhile { it.isDigit() } 8 | 9 | fun String.asValidatedDouble(): String { 10 | val firstChar = this.take(1).filter { it.isDigit() || it == '-' || it == '.' } 11 | val remainingChars = this.drop(1).filter { it.isDigit() || it == '.' } 12 | if (remainingChars.count { it == '.' } > 1) { 13 | val remainingCharsFiltered = remainingChars 14 | .takeWhile { it != '.' } + '.' + remainingChars 15 | .dropWhile { it != '.' } 16 | .filter { it != '.' } 17 | return firstChar + remainingCharsFiltered 18 | } 19 | return firstChar + remainingChars 20 | } 21 | 22 | fun TextFieldValue.asValidatedInt() = this.copy(text = this.text.asValidatedInt()) 23 | 24 | fun TextFieldValue.asValidatedDouble() = this.copy(text = this.text.asValidatedDouble()) 25 | 26 | fun Double.asTextFieldValue() = TextFieldValue(this.toString(), TextRange(this.toString().length)) 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/samco/trackandgraph/util/Stopwatch.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.util 2 | 3 | class Stopwatch { 4 | private var startTime: Long = 0 5 | private var endTime: Long = 0 6 | private var isRunning = false 7 | 8 | fun start() { 9 | startTime = System.nanoTime() 10 | isRunning = true 11 | } 12 | 13 | fun stop() { 14 | endTime = System.nanoTime() 15 | isRunning = false 16 | } 17 | 18 | val elapsedMillis: Long 19 | get() = getElapsedTimeMillis() 20 | 21 | private fun getElapsedNanos(): Long { 22 | return if (isRunning) System.nanoTime() - startTime 23 | else endTime -startTime 24 | } 25 | 26 | private fun getElapsedTimeMillis(): Long { 27 | return getElapsedNanos() / 1000000 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/about_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/add_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/backup_restore_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/content_paste.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/delete_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/discrete_value_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/down_arrow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edit_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/export_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/faq_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/filled_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/folder_open.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/github_mark.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/group_tab_corner.xml: -------------------------------------------------------------------------------- 1 | 6 | 14 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/history.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/home_menu_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 15 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 16 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pie_chart_example.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 20 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_scroll_grabber.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/import_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/left_to_right_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/list_menu_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/point_style_circles_only_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 9 | 10 | 19 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/point_style_none_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 9 | 17 | 18 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/queue_add_box.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rate_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tutorial_image_1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/drawable/tutorial_image_1.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/tutorial_image_2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/drawable/tutorial_image_2.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/tutorial_image_3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/drawable/tutorial_image_3.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/up_arrow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/font/roboto_mono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/font/roboto_mono.ttf -------------------------------------------------------------------------------- /app/src/main/res/layout/description_body_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/graph_pie_chart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/graph_xy_plot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_feature_checkbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_graph_legend.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 19 | 20 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_host_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/navigation_menu_spinner.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/track_widget_configure_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 18 | 19 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/menu/edit_graph_stat_context_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 21 | 23 | 25 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/menu/edit_group_context_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 21 | 23 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/menu/edit_note_context_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 22 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/menu/edit_tracker_context_menu.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 21 | 24 | 27 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/xml/debug_network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10.0.2.2 6 | localhost 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/xml/production_network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/xml/track_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /app/src/test/java/com/samco/trackandgraph/graphstatview/factories/LineGraphDataFactoryTestComponentDagger.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.graphstatview.factories 2 | 3 | import com.samco.trackandgraph.base.model.DataInteractor 4 | import com.samco.trackandgraph.base.model.di.DefaultDispatcher 5 | import com.samco.trackandgraph.base.model.di.IODispatcher 6 | import com.samco.trackandgraph.functions.helpers.TimeHelper 7 | import dagger.BindsInstance 8 | import dagger.Component 9 | import kotlinx.coroutines.CoroutineDispatcher 10 | 11 | @Component 12 | interface LineGraphDataFactoryTestComponent { 13 | 14 | fun provideTimeHelper(): TimeHelper 15 | 16 | fun provideLineGraphDataFactory(): LineGraphDataFactory 17 | 18 | @Component.Builder 19 | interface Builder { 20 | 21 | @BindsInstance 22 | fun dataInteractor(dataInteractor: DataInteractor): Builder 23 | 24 | @BindsInstance 25 | fun ioDispatcher(@IODispatcher ioDispatcher: CoroutineDispatcher): Builder 26 | 27 | @BindsInstance 28 | fun defaultDispatcher(@DefaultDispatcher defaultDispatcher: CoroutineDispatcher): Builder 29 | 30 | @BindsInstance 31 | fun timeHelper(timeHelper: TimeHelper): Builder 32 | 33 | fun build(): LineGraphDataFactoryTestComponent 34 | } 35 | } -------------------------------------------------------------------------------- /base/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /base/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/consumer-rules.pro -------------------------------------------------------------------------------- /base/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep class com.samco.trackandgraph.base.** { *; } 23 | -------------------------------------------------------------------------------- /base/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/BarChart.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.base.database.dto 2 | 3 | import com.samco.trackandgraph.base.database.entity.BarChart 4 | import org.threeten.bp.temporal.TemporalAmount 5 | 6 | data class BarChart( 7 | val id: Long, 8 | val graphStatId: Long, 9 | val featureId: Long, 10 | val endDate: GraphEndDate, 11 | val sampleSize: TemporalAmount?, 12 | val yRangeType: YRangeType, 13 | val yTo: Double, 14 | val scale: Double, 15 | val barPeriod: BarChartBarPeriod, 16 | val sumByCount: Boolean 17 | ) { 18 | internal fun toEntity() = BarChart( 19 | id = id, 20 | graphStatId = graphStatId, 21 | featureId = featureId, 22 | endDate = endDate, 23 | sampleSize = sampleSize, 24 | yRangeType = yRangeType, 25 | yTo = yTo, 26 | scale = scale, 27 | barPeriod = barPeriod, 28 | sumByCount = sumByCount 29 | ) 30 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/BarChartBarPeriod.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.base.database.dto 18 | 19 | enum class BarChartBarPeriod { 20 | HOUR, 21 | DAY, 22 | WEEK, 23 | MONTH, 24 | THREE_MONTHS, 25 | SIX_MONTHS, 26 | YEAR 27 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/DataType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class DataType { 21 | 22 | CONTINUOUS, 23 | DURATION; 24 | 25 | fun isDuration() = this == DURATION 26 | } 27 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/DisplayNote.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | import org.threeten.bp.OffsetDateTime 21 | 22 | data class DisplayNote( 23 | val timestamp: OffsetDateTime = OffsetDateTime.now(), 24 | val trackerId: Long?, 25 | val featureId: Long?, 26 | val featureName: String?, 27 | val groupId: Long?, 28 | val note: String 29 | ) -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/DurationPlottingMode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class DurationPlottingMode { 21 | NONE, 22 | DURATION_IF_POSSIBLE, 23 | HOURS, 24 | MINUTES, 25 | SECONDS 26 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/GlobalNote.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | import com.samco.trackandgraph.base.database.entity.GlobalNote 21 | import org.threeten.bp.OffsetDateTime 22 | 23 | data class GlobalNote( 24 | val timestamp: OffsetDateTime = OffsetDateTime.now(), 25 | val note: String = "" 26 | ) { 27 | internal fun toEntity() = GlobalNote( 28 | epochMilli = timestamp.toInstant().toEpochMilli(), 29 | utcOffsetSec = timestamp.offset.totalSeconds, 30 | note = note 31 | ) 32 | } 33 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/GraphOrStat.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.base.database.dto 18 | 19 | import com.samco.trackandgraph.base.database.entity.GraphOrStat 20 | 21 | data class GraphOrStat( 22 | val id: Long, 23 | val groupId: Long, 24 | val name: String, 25 | val type: GraphStatType, 26 | val displayIndex: Int 27 | ) { 28 | internal fun toEntity() = GraphOrStat( 29 | id, 30 | groupId, 31 | name, 32 | type, 33 | displayIndex 34 | ) 35 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/GraphStatType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class GraphStatType { 21 | LINE_GRAPH, 22 | PIE_CHART, 23 | AVERAGE_TIME_BETWEEN, 24 | LAST_VALUE, 25 | TIME_HISTOGRAM, 26 | BAR_CHART, 27 | LUA_SCRIPT, 28 | } 29 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/Group.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | data class Group ( 21 | val id: Long, 22 | val name: String, 23 | val displayIndex: Int, 24 | val parentGroupId: Long?, 25 | val colorIndex: Int, 26 | ) { 27 | internal fun toEntity() = com.samco.trackandgraph.base.database.entity.Group( 28 | id, 29 | name, 30 | displayIndex, 31 | parentGroupId, 32 | colorIndex, 33 | ) 34 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/LineGraphAveraginModes.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class LineGraphAveraginModes { 21 | NO_AVERAGING, 22 | DAILY_MOVING_AVERAGE, 23 | THREE_DAY_MOVING_AVERAGE, 24 | WEEKLY_MOVING_AVERAGE, 25 | MONTHLY_MOVING_AVERAGE, 26 | THREE_MONTH_MOVING_AVERAGE, 27 | SIX_MONTH_MOVING_AVERAGE, 28 | YEARLY_MOVING_AVERAGE 29 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/LineGraphPlottingModes.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class LineGraphPlottingModes { 21 | WHEN_TRACKED, 22 | GENERATE_HOURLY_TOTALS, 23 | GENERATE_DAILY_TOTALS, 24 | GENERATE_WEEKLY_TOTALS, 25 | GENERATE_MONTHLY_TOTALS, 26 | GENERATE_YEARLY_TOTALS 27 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/LineGraphPointStyle.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class LineGraphPointStyle { 21 | NONE, 22 | CIRCLES, 23 | CIRCLES_AND_NUMBERS, 24 | CIRCLES_ONLY 25 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/LineGraphWithFeatures.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.base.database.dto 18 | 19 | import org.threeten.bp.temporal.TemporalAmount 20 | 21 | data class LineGraphWithFeatures( 22 | val id: Long, 23 | val graphStatId: Long, 24 | val features: List, 25 | val sampleSize: TemporalAmount?, 26 | val yRangeType: YRangeType, 27 | val yFrom: Double, 28 | val yTo: Double, 29 | val endDate: GraphEndDate 30 | ) { 31 | fun toLineGraph() = LineGraph(id, graphStatId, sampleSize, yRangeType, yFrom, yTo, endDate) 32 | } 33 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/LuaGraph.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | import com.samco.trackandgraph.base.database.entity.LuaGraph 21 | 22 | data class LuaGraph( 23 | val id: Long, 24 | val graphStatId: Long, 25 | val script: String 26 | ) { 27 | internal fun toEntity() = LuaGraph( 28 | id, 29 | graphStatId, 30 | script 31 | ) 32 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/LuaGraphFeature.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | import com.samco.trackandgraph.base.database.entity.LuaGraphFeature 21 | 22 | data class LuaGraphFeature( 23 | val id: Long, 24 | val luaGraphId: Long, 25 | val featureId: Long, 26 | val name: String 27 | ) { 28 | internal fun toEntity() = LuaGraphFeature( 29 | id, 30 | luaGraphId, 31 | featureId, 32 | name 33 | ) 34 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/LuaGraphWithFeatures.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | data class LuaGraphWithFeatures( 21 | val id: Long, 22 | val graphStatId: Long, 23 | val features: List, 24 | val script: String 25 | ) { 26 | fun toLuaGraph() = LuaGraph(id, graphStatId, script) 27 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/Reminder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | import com.samco.trackandgraph.base.database.entity.Reminder 21 | import org.threeten.bp.LocalTime 22 | 23 | data class Reminder( 24 | val id: Long, 25 | val displayIndex: Int, 26 | val alarmName: String, 27 | val time: LocalTime, 28 | val checkedDays: CheckedDays 29 | ) { 30 | internal fun toEntity() = Reminder( 31 | id, 32 | displayIndex, 33 | alarmName, 34 | time, 35 | checkedDays 36 | ) 37 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/TimeHistogramWindow.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class TimeHistogramWindow { 21 | HOUR, 22 | DAY, 23 | WEEK, 24 | MONTH, 25 | THREE_MONTHS, 26 | SIX_MONTHS, 27 | YEAR 28 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/dto/YRangeType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.dto 19 | 20 | enum class YRangeType { 21 | DYNAMIC, 22 | FIXED 23 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/migrations/Migration35to36.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.migrations 19 | 20 | 21 | import androidx.room.migration.Migration 22 | import androidx.sqlite.db.SupportSQLiteDatabase 23 | 24 | 25 | val MIGRATION_35_36 = object : Migration(35, 36) { 26 | override fun migrate(database: SupportSQLiteDatabase) { 27 | database.execSQL("ALTER TABLE features_table ADD feature_description TEXT NOT NULL DEFAULT ''") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/migrations/Migration36to37.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.migrations 19 | 20 | 21 | import androidx.room.migration.Migration 22 | import androidx.sqlite.db.SupportSQLiteDatabase 23 | 24 | 25 | val MIGRATION_36_37 = object : Migration(36, 37) { 26 | override fun migrate(database: SupportSQLiteDatabase) { 27 | database.execSQL("ALTER TABLE data_points_table ADD note TEXT NOT NULL DEFAULT ''") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/migrations/Migration37to38.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.base.database.migrations 19 | 20 | 21 | import androidx.room.migration.Migration 22 | import androidx.sqlite.db.SupportSQLiteDatabase 23 | 24 | 25 | val MIGRATION_37_38 = object : Migration(37, 38) { 26 | override fun migrate(database: SupportSQLiteDatabase) { 27 | database.execSQL("ALTER TABLE graphs_and_stats_table ADD end_date TEXT") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/migrations/Migration52to53.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | package com.samco.trackandgraph.base.database.migrations 18 | 19 | import androidx.room.migration.Migration 20 | import androidx.sqlite.db.SupportSQLiteDatabase 21 | 22 | val MIGRATION_52_53 = object : Migration(52, 53) { 23 | override fun migrate(database: SupportSQLiteDatabase) { 24 | database.execSQL("CREATE INDEX IF NOT EXISTS `index_data_points_table_timestamp` ON `data_points_table` (`timestamp`)") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/migrations/Migration54to55.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.base.database.migrations 2 | 3 | import androidx.room.migration.Migration 4 | import androidx.sqlite.db.SupportSQLiteDatabase 5 | 6 | val MIGRATION_54_55 = object : Migration(54, 55) { 7 | override fun migrate(database: SupportSQLiteDatabase) { 8 | //Nothing actually required here, but we need a migration or Room will fall back to 9 | // destructive migration. Although the schema didn't change in this version, I bumped the 10 | // database version because it is not backwards compatible with the previous version. 11 | // This version added "now" as a possible value for a graph end time. 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/database/sampling/DataSampleProperties.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.base.database.sampling 2 | 3 | import org.threeten.bp.temporal.TemporalAmount 4 | 5 | data class DataSampleProperties( 6 | val regularity: TemporalAmount? = null, 7 | val isDuration: Boolean = false 8 | ) -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/model/DataUpdateType.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.base.model 2 | 3 | sealed class DataUpdateType { 4 | /**Data point(s) were created/updated/deleted for a given feature**/ 5 | data class DataPoint(val featureId: Long) : DataUpdateType() 6 | 7 | object GroupCreated : DataUpdateType() 8 | object GroupUpdated : DataUpdateType() 9 | object GroupDeleted : DataUpdateType() 10 | 11 | object TrackerCreated : DataUpdateType() 12 | object TrackerUpdated : DataUpdateType() 13 | object TrackerDeleted : DataUpdateType() 14 | 15 | data class GraphOrStatCreated(val graphStatId: Long) : DataUpdateType() 16 | data class GraphOrStatUpdated(val graphStatId: Long) : DataUpdateType() 17 | object GraphOrStatDeleted : DataUpdateType() 18 | 19 | /**A reminder was created/updated/deleted **/ 20 | object Reminder : DataUpdateType() 21 | 22 | /**A global note was created/updated/deleted **/ 23 | object GlobalNote : DataUpdateType() 24 | 25 | /**Display indices were updated **/ 26 | object DisplayIndex : DataUpdateType() 27 | 28 | /**A global note was created/updated/deleted **/ 29 | //TODO split out function into separate CRUD events 30 | object Function : DataUpdateType() 31 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/model/DatabaseTransactionHelper.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.base.model 2 | 3 | import androidx.room.withTransaction 4 | import com.samco.trackandgraph.base.database.TrackAndGraphDatabase 5 | import javax.inject.Inject 6 | 7 | internal interface DatabaseTransactionHelper { 8 | suspend fun withTransaction(block: suspend () -> R): R 9 | } 10 | 11 | internal class DatabaseTransactionHelperImpl @Inject constructor( 12 | private val database: TrackAndGraphDatabase 13 | ) : DatabaseTransactionHelper { 14 | override suspend fun withTransaction(block: suspend () -> R): R = 15 | database.withTransaction(block) 16 | } -------------------------------------------------------------------------------- /base/src/main/java/com/samco/trackandgraph/base/system/SystemInfoProvider.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.base.system 2 | 3 | import android.os.Build 4 | import javax.inject.Inject 5 | 6 | interface SystemInfoProvider { 7 | val buildVersionSdkInt: Int 8 | } 9 | 10 | class SystemInfoProviderImpl @Inject constructor(): SystemInfoProvider { 11 | override val buildVersionSdkInt: Int 12 | get() = Build.VERSION.SDK_INT 13 | } -------------------------------------------------------------------------------- /base/src/main/res/color/checkbox_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /base/src/main/res/drawable-hdpi/notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/src/main/res/drawable-hdpi/notification_icon.png -------------------------------------------------------------------------------- /base/src/main/res/drawable-hdpi/timer_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/src/main/res/drawable-hdpi/timer_notification_icon.png -------------------------------------------------------------------------------- /base/src/main/res/drawable-mdpi/notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/src/main/res/drawable-mdpi/notification_icon.png -------------------------------------------------------------------------------- /base/src/main/res/drawable-mdpi/timer_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/src/main/res/drawable-mdpi/timer_notification_icon.png -------------------------------------------------------------------------------- /base/src/main/res/drawable-night/track_widget_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /base/src/main/res/drawable-xhdpi/notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/src/main/res/drawable-xhdpi/notification_icon.png -------------------------------------------------------------------------------- /base/src/main/res/drawable-xxhdpi/notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/src/main/res/drawable-xxhdpi/notification_icon.png -------------------------------------------------------------------------------- /base/src/main/res/drawable-xxxhdpi/notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/base/src/main/res/drawable-xxxhdpi/notification_icon.png -------------------------------------------------------------------------------- /base/src/main/res/drawable/expansive_text_box_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /base/src/main/res/drawable/ic_add_record.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /base/src/main/res/drawable/ic_play_timer.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /base/src/main/res/drawable/ic_stop_timer.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /base/src/main/res/drawable/track_widget_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /base/src/main/res/drawable/warning_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /base/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /base/src/main/res/values/integer.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 200 20 | -------------------------------------------------------------------------------- /base/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | dependencies { 5 | classpath libs.kotlin.gradle.plugin 6 | classpath libs.navigation.safe.args.gradle.plugin 7 | } 8 | } 9 | 10 | plugins { 11 | alias libs.plugins.org.jetbrains.kotlin.android apply false 12 | alias(libs.plugins.compose.compiler) apply false 13 | alias libs.plugins.com.android.library apply false 14 | alias libs.plugins.com.android.application apply false 15 | alias libs.plugins.com.google.ksp apply false 16 | alias libs.plugins.hilt.android.gradle.plugin apply false 17 | } 18 | 19 | tasks.register('clean', Delete) { 20 | delete rootProject.buildDir 21 | } -------------------------------------------------------------------------------- /configuration/remote-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "endpoints": { 3 | "github": "https://github.com/SamAmco/track-and-graph", 4 | "tutorial-root": "https://samamco.github.io/track-and-graph/tutorial/", 5 | "tutorial-tracking": "https://samamco.github.io/track-and-graph/tutorial/tracking/", 6 | "tutorial-lua": "https://samamco.github.io/track-and-graph/tutorial/graphs/lua-graphs/lua-graphs/", 7 | "tutorial-graphs": "https://samamco.github.io/track-and-graph/tutorial/graphs/", 8 | "lua-community-scripts-root": "https://samamco.github.io/track-and-graph/lua/community/", 9 | "play-store-page": "https://play.google.com/store/apps/details?id=com.samco.trackandgraph" 10 | }, 11 | "trusted-lua-script-sources": [ 12 | "https://raw.githubusercontent.com/SamAmco/track-and-graph/refs/heads" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /database-extract/extract: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | #extract db files 5 | adb -d shell "run-as com.samco.trackandgraph.debug cat databases/trackandgraph_database" > ge_database.db 6 | adb -d shell "run-as com.samco.trackandgraph.debug cat databases/trackandgraph_database-wal" > ge_database.db-wal 7 | adb -d shell "run-as com.samco.trackandgraph.debug cat databases/trackandgraph_database-shm" > ge_database.db-shm 8 | 9 | #commit changes from write ahead logging 10 | sqlite3 ge_database.db "PRAGMA wal_checkpoint" 11 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by venv; see https://docs.python.org/3/library/venv.html 2 | # Ignore Python virtual environment 3 | venv/ 4 | lib/ 5 | pyvenv.cfg 6 | .env/ 7 | **/__pycache__/ 8 | **/*.pyc 9 | **/*.pyo 10 | 11 | # Ignore common Python environment files 12 | pip-log.txt 13 | pip-delete-this-directory.txt 14 | *.log 15 | 16 | # Ignore environment-related files 17 | .envrc 18 | .venv/ 19 | 20 | # Ignore mkdocs build directory 21 | site/ 22 | -------------------------------------------------------------------------------- /docs/docs/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/img/logo.png -------------------------------------------------------------------------------- /docs/docs/index.md: -------------------------------------------------------------------------------- 1 | # Track & Graph 2 | Welcome to the Track & Graph docs site. 3 | 4 | To get started learning about Track & Graph take a look at the [tutorial](./tutorial/index.md). 5 | 6 | You can also check out the project on [GitHub](https://www.github.com/SamAmco/track-and-graph) or the [Google Play Store](https://play.google.com/store/apps/details?id=com.samco.trackandgraph). 7 | -------------------------------------------------------------------------------- /docs/docs/lua/community/bar-charts/cumulative/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/bar-charts/cumulative/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/bar-charts/merge-inputs/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/bar-charts/merge-inputs/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/datapoint/last-value-above-threshold/README.md: -------------------------------------------------------------------------------- 1 | # Last Value Above Threshold 2 | 3 | This script returns the last datapoint with a value above a given threshold. It can accept multiple data sources. 4 | 5 |
6 | Total this period 7 |
8 | 9 | ## Configuration 10 | 11 | This script accepts the following configuration parameters: 12 | 13 | ```lua 14 | -- The threshold above which the last value is returned 15 | local threshold = 0 16 | ``` 17 | 18 | [Install via deeplink](trackandgraph://lua_inject_url?url=https://raw.githubusercontent.com/SamAmco/track-and-graph/refs/heads/master/docs/docs/lua/community/datapoint/last-value-above-threshold/script.lua) 19 | 20 | [Read the full script](./script.lua) 21 | 22 | Author: [SamAmco](https://github.com/SamAmco) 23 | -------------------------------------------------------------------------------- /docs/docs/lua/community/datapoint/last-value-above-threshold/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/datapoint/last-value-above-threshold/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/datapoint/last-value-below-threshold/README.md: -------------------------------------------------------------------------------- 1 | # Last Value Below Threshold 2 | 3 | This script returns the last datapoint with a value below a given threshold. It can accept multiple data sources. 4 | 5 |
6 | Total this period 7 |
8 | 9 | ## Configuration 10 | 11 | This script accepts the following configuration parameters: 12 | 13 | ```lua 14 | -- The threshold below which the last value is returned 15 | local threshold = 0 16 | ``` 17 | 18 | [Install via deeplink](trackandgraph://lua_inject_url?url=https://raw.githubusercontent.com/SamAmco/track-and-graph/refs/heads/master/docs/docs/lua/community/datapoint/last-value-below-threshold/script.lua) 19 | 20 | [Read the full script](./script.lua) 21 | 22 | Author: [SamAmco](https://github.com/SamAmco) 23 | -------------------------------------------------------------------------------- /docs/docs/lua/community/datapoint/last-value-below-threshold/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/datapoint/last-value-below-threshold/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/line-graphs/cumulative/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/line-graphs/cumulative/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/line-graphs/difference/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/line-graphs/difference/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/line-graphs/merge-inputs/merge-inputs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/line-graphs/merge-inputs/merge-inputs.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/pie-charts/moving-pie-chart/README.md: -------------------------------------------------------------------------------- 1 | # Moving Pie Chart 2 | 3 | A pie chart that merges all given data sources into one pie chart including all data, or all data in the given period prior to now. 4 | 5 |
6 | Moving Pie Chart 7 |
8 | 9 | ## Configuration 10 | 11 | This script accepts the following configuration parameters: 12 | 13 | ```lua 14 | local period = nil 15 | -- Optional integer value used with period e.g. 5 16 | local period_multiplier = nil 17 | -- Optional colors list, e.g. { label: "#FF00FF", label2: "#0000FF", label3: core.COLOR.BLUE_SKY } 18 | local label_colors = nil 19 | -- Boolean to count by label. If true, each datapoint counts as 1, and the value is ignored 20 | local count_by_label = false 21 | ``` 22 | 23 | [Install via deeplink](trackandgraph://lua_inject_url?url=https://raw.githubusercontent.com/SamAmco/track-and-graph/refs/heads/master/docs/docs/lua/community/pie-charts/moving-pie-chart/script.lua) 24 | 25 | [Read the full script](./script.lua) 26 | 27 | Author: [SamAmco](https://github.com/SamAmco) 28 | -------------------------------------------------------------------------------- /docs/docs/lua/community/pie-charts/moving-pie-chart/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/pie-charts/moving-pie-chart/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/pie-charts/moving-pie-chart/script.lua: -------------------------------------------------------------------------------- 1 | local core = require("tng.core") 2 | local graph = require("tng.graph") 3 | local graphext = require("tng.graphext") 4 | 5 | --- PREVIEW_START 6 | -- Script: Pie Charts - Moving Pie Chart 7 | -- Optional period of data to be displayed e.g. core.PERIOD.WEEK to show data for this week 8 | local period = nil 9 | -- Optional integer value used with period e.g. 5 10 | local period_multiplier = nil 11 | -- Optional colors list, e.g. { label="#FF00FF", label2="#0000FF", label3=core.COLOR.BLUE_SKY } 12 | local label_colors = nil 13 | -- Boolean to count by label. If true, each datapoint counts as 1, and the value is ignored 14 | local count_by_label = false 15 | --- PREVIEW_END 16 | 17 | return function(sources) 18 | 19 | local cutoff_params = { 20 | period = period, 21 | period_multiplier = period_multiplier 22 | } 23 | 24 | local datapoints = graphext.merge_sources(sources, cutoff_params, true) 25 | 26 | local segments = graphext.collect_to_segments(datapoints, count_by_label, label_colors) 27 | 28 | return graph.pie_chart({ 29 | segments = segments 30 | }) 31 | end 32 | -------------------------------------------------------------------------------- /docs/docs/lua/community/pie-charts/periodic-pie-chart/README.md: -------------------------------------------------------------------------------- 1 | # Periodic Pie Chart 2 | 3 | A pie chart that displays data for a specific time period such as the current day, week, month, etc. The pie chart resets at the beginning of each new period and accumulates data throughout that period. This script can accept multiple data sources and merges them all into one pie chart. 4 | 5 |
6 | Periodic Pie Chart 7 |
8 | 9 | ## Configuration 10 | 11 | This script accepts the following configuration parameters: 12 | 13 | ```lua 14 | -- Period of data to be displayed e.g. core.PERIOD.WEEK to show data for this week 15 | local period = core.PERIOD.WEEK 16 | -- Optional colors list, e.g. { label="#FF00FF", label2="#0000FF", label3=core.COLOR.BLUE_SKY } 17 | local label_colors = nil 18 | -- Boolean to count by label. If true, each datapoint counts as 1, and the value is ignored 19 | local count_by_label = false 20 | ``` 21 | 22 | [Install via deeplink](trackandgraph://lua_inject_url?url=https://raw.githubusercontent.com/SamAmco/track-and-graph/refs/heads/master/docs/docs/lua/community/pie-charts/periodic-pie-chart/script.lua) 23 | 24 | [Read the full script](./script.lua) 25 | 26 | Author: [SamAmco](https://github.com/SamAmco) 27 | -------------------------------------------------------------------------------- /docs/docs/lua/community/pie-charts/periodic-pie-chart/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/pie-charts/periodic-pie-chart/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/pie-charts/periodic-pie-chart/script.lua: -------------------------------------------------------------------------------- 1 | local core = require("tng.core") 2 | local graph = require("tng.graph") 3 | local graphext = require("tng.graphext") 4 | 5 | --- PREVIEW_START 6 | -- Script: Pie Charts - Periodic Pie Chart 7 | -- Period of data to be displayed e.g. core.PERIOD.WEEK to show data for this week 8 | local period = core.PERIOD.WEEK 9 | -- Optional colors list, e.g. { label="#FF00FF", label2="#0000FF", label3=core.COLOR.BLUE_SKY } 10 | local label_colors = nil 11 | -- Boolean to count by label. If true, each datapoint counts as 1, and the value is ignored 12 | local count_by_label = false 13 | --- PREVIEW_END 14 | 15 | return function(sources) 16 | local end_time = core.get_end_of_period(period, core.time().timestamp) 17 | local cutoff = core.shift(end_time, period, -1).timestamp 18 | 19 | local datapoints = graphext.merge_sources(sources, cutoff) 20 | 21 | local segments = graphext.collect_to_segments(datapoints, count_by_label, label_colors) 22 | 23 | return graph.pie_chart({ 24 | segments = segments, 25 | }) 26 | end 27 | -------------------------------------------------------------------------------- /docs/docs/lua/community/text/fraction/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/text/fraction/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/community/text/total-this-period/README.md: -------------------------------------------------------------------------------- 1 | # Total this period 2 | 3 | Shows the total of a given input over a specified period of time. For example, the total this week (Monday to Sunday) or the total this month. If multiple data sources are given then the total of each data source is shown separately, as well as the overall total. 4 | 5 |
6 | Total this period 7 |
8 | 9 | ## Configuration 10 | 11 | This script accepts the following configuration parameters: 12 | 13 | ```lua 14 | -- Period of data to be displayed e.g. core.PERIOD.WEEK to show data for this week 15 | local period = core.PERIOD.WEEK 16 | ``` 17 | 18 | [Install via deeplink](trackandgraph://lua_inject_url?url=https://raw.githubusercontent.com/SamAmco/track-and-graph/refs/heads/master/docs/docs/lua/community/text/total-this-period/script.lua) 19 | 20 | [Read the full script](./script.lua) 21 | 22 | Author: [SamAmco](https://github.com/SamAmco) 23 | -------------------------------------------------------------------------------- /docs/docs/lua/community/text/total-this-period/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/community/text/total-this-period/image.jpg -------------------------------------------------------------------------------- /docs/docs/lua/developer-guide/data_source_configuration.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/developer-guide/data_source_configuration.jpg -------------------------------------------------------------------------------- /docs/docs/lua/developer-guide/hello_world_card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/lua/developer-guide/hello_world_card.jpg -------------------------------------------------------------------------------- /docs/docs/policies/privacy-policy.md: -------------------------------------------------------------------------------- 1 | # Privacy Policy 2 | This app does not record any of your personal information, anything you track or anything you do in the app. Nothing is recorded or stored anywhere online by this app or any third party library used by this app. You can however easily backup your data at any time to your own device or cloud storage service from within the app. 3 | -------------------------------------------------------------------------------- /docs/docs/stylesheets/extra.css: -------------------------------------------------------------------------------- 1 | :root > * { 2 | --md-primary-fg-color: #f46d43; 3 | } 4 | -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_1.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_1.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_2.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_2.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_3.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_4.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_5.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_6.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_1_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_1_7.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_2_1.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_3_1.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_3_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_3_2.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_3_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_3_3.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_4_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_4_1.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_4_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_4_2.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_4_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_4_3.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_4_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_4_4.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_4_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_4_5.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_4_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_4_6.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_4_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_4_7.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_5_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_5_1.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_5_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_5_2.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/images/faq_3_5_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/images/faq_3_5_3.png -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/index.md: -------------------------------------------------------------------------------- 1 | # Track & Graph - Graphs and Statistics 2 | 3 | For help setting graphs please see the tutorial on each graph type below. 4 | 5 | - [Line Graphs](./line.md) 6 | - [Bar Charts](./bar-charts.md) 7 | - [Pie Charts](./pie.md) 8 | - [Average Time Between and Last Tracked/Time Since](./statistics.md) 9 | - [Time Histograms](./histograms.md) 10 | - [Lua Scripts](./lua-graphs/lua-graphs.md) 11 | 12 | -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/lua-graphs/video.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/lua-graphs/video.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/lua-graphs/video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/graphs/lua-graphs/video.mp4 -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/pie.md: -------------------------------------------------------------------------------- 1 | # Pie charts 2 | 3 | Pie charts can be set up from the create graph or stat menu. The segments are simply one per label in the selected feature. 4 | 5 | The size of the segment is proportional to the number of data points with that label. 6 | 7 | By default the size of each segment is proportional to the sum of the values tracked for that label. You can change this behaviour by checking the box to count the number of data points rather than the total of their values. 8 | 9 | !["faq_3_2_1"](images/faq_3_2_1.png){ width="400" } 10 | -------------------------------------------------------------------------------- /docs/docs/tutorial/graphs/statistics.md: -------------------------------------------------------------------------------- 1 | # Statistics 2 | 3 | Currently there are only a couple of built in supported statistics: "Average time between" and "Last Tracked/Time since". For more powerful statistics see [Lua graphs](./lua-graphs/lua-graphs.md) 4 | 5 | --- 6 | 7 | Both present you with the following interface: 8 | 9 | !["faq_3_3_1"](images/faq_3_3_1.png){ width="400" } 10 | 11 | First select a data set and then optionally add filters for label and value range. For example if you want to know the average time between tracking "Yes" for /Daily/Rest you can add the label filter and select "Yes". 12 | 13 | !["faq_3_3_2"](images/faq_3_3_2.png){ width="400" } 14 | 15 | The statistics are calculated in the following ways: 16 | 17 | - Average time between shows the duration between the first and last data point matching all filters in the feature divided by the number of data points matching all features minus 1 `(last-first)/(size - 1)` 18 | - Last Tracked/Time since last shows the last data point matching all filters and also the time since that data point was tracked 19 | 20 | --- 21 | 22 | !["faq_3_3_3"](images/faq_3_3_3.png){ width="400" } 23 | -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_1.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_1.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_2.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_2.png -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_3.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_3.png -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_4.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_5.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_6.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_7.gif -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_1_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_1_8.png -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_2_1.png -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_2_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_2_2.png -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_2_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_2_3.png -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_4_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_4_1.png -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_4_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_4_2.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_4_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_4_3.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_4_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_4_4.jpg -------------------------------------------------------------------------------- /docs/docs/tutorial/images/faq_5_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/docs/docs/tutorial/images/faq_5_1.png -------------------------------------------------------------------------------- /docs/docs/tutorial/import-export.md: -------------------------------------------------------------------------------- 1 | # Importing and exporting 2 | 3 | ### CSV Import & Export 4 | 5 | To import/export only the tracked data in a group to a CSV use the menu buttons at the top: 6 | 7 | !["faq_2_1"](images/faq_2_1.png){ width="300" } 8 | 9 | !["faq_2_2"](images/faq_2_2.png) 10 | 11 | Use this button to import a csv into this group. 12 | 13 | !["faq_2_3"](images/faq_2_3.png) 14 | 15 | Use this button to export this groups tracked data to a csv. 16 | 17 | ### Backup & Restore 18 | 19 | The Backup & Restore option in the menu is slightly different. This will export and restore the entire database file containing all tracked data, graphs, reminders and notes. 20 | 21 | **It is recommended that you backup your data regularly or configure the auto-backup option.** 22 | 23 | The backup file is an un-encrypted Sqlite3 database file which can also be opened and modified using freely available software. However this is not recommended for non-technical users as you could break the integrity of the database. 24 | -------------------------------------------------------------------------------- /docs/docs/tutorial/index.md: -------------------------------------------------------------------------------- 1 | # Tutorial 2 | 3 | The tutorials will guide you on how to use Track & Graph step by step. 4 | 5 | - [Get started with tracking](tracking.md) 6 | - [Importing and exporting data](import-export.md) 7 | - Creating graphs 8 | - [Line graphs](graphs/line.md) 9 | - [Pie charts](graphs/pie.md) 10 | - [Statistics](graphs/statistics.md) 11 | - [Time histograms](graphs/histograms.md) 12 | - [Bar charts](graphs/bar-charts.md) 13 | - [Lua graphs](graphs/lua-graphs/lua-graphs.md) 14 | - [Notes](notes.md) 15 | - [Timestamps](timestamps.md) 16 | -------------------------------------------------------------------------------- /docs/docs/tutorial/notes.md: -------------------------------------------------------------------------------- 1 | # Notes 2 | 3 | Notes allow you to keep track of qualitative data alongside your quantitative data. There are two types of notes: 4 | 5 | - Global notes (added directly in the notes menu) 6 | - Data point notes (attached to specific data points) 7 | 8 | ### Data point notes 9 | 10 | When adding a data point you may wish to track an important piece of information specific to that data set. For example: 11 | 12 | ![faq_4_1](images/faq_4_1.png){ width="400" } 13 | 14 | After adding this note you will notice it shows up in a list underneath any graph of that data set. If you tap the note it will open in a dialog window and a marker will be added to the graph. 15 | 16 | ![faq_4_2](images/faq_4_2.jpg){ width="400" } 17 | 18 | ### Global notes 19 | 20 | However some pieces of information might be relevant to all your data. In this case you can add a global note by tapping the plus button in the global notes menu: 21 | 22 | ![faq_4_3](images/faq_4_3.jpg){ width="400" } 23 | 24 | You will notice this note now shows up underneath all graphs. 25 | 26 | ![faq_4_4](images/faq_4_4.jpg){ width="400" } 27 | 28 | ### The notes menu 29 | 30 | You can edit or delete any note from the notes menu. Deleting a data point note from the notes menu will not delete the data point its self, just the attached note. 31 | -------------------------------------------------------------------------------- /docs/docs/tutorial/timestamps.md: -------------------------------------------------------------------------------- 1 | # Timestamps 2 | 3 | Sometimes you may notice that a + or - number is appended to your timestamp as in the following: 4 | 5 | ![faq_5_1](images/faq_5_1.png) 6 | 7 | This means that this data point was tracked in a different time zone to your current time zone. One common reason for this is that your clock went forward/back for daylight savings. Another reason this might happen is if you tracked the data point in a different country. 8 | 9 | Essentially what is shown is the time that the clock would have said on your device at the moment you tracked the data point, and then the number of hours you must add or subtract to put it in your current timezone. So if you track a data point in a zone which is 3 hours ahead and then you change your time zone back you will see a (-3) after your data point. 10 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | babel==2.17.0 2 | backrefs==5.8 3 | certifi==2025.1.31 4 | charset-normalizer==3.4.1 5 | click==8.1.8 6 | colorama==0.4.6 7 | ghp-import==2.1.0 8 | idna==3.10 9 | Jinja2==3.1.6 10 | Markdown==3.7 11 | MarkupSafe==3.0.2 12 | mergedeep==1.3.4 13 | mkdocs==1.6.1 14 | mkdocs-get-deps==0.2.0 15 | mkdocs-material==9.6.8 16 | mkdocs-material-extensions==1.3.1 17 | packaging==24.2 18 | paginate==0.5.7 19 | pathspec==0.12.1 20 | platformdirs==4.3.6 21 | Pygments==2.19.1 22 | pymdown-extensions==10.14.3 23 | python-dateutil==2.9.0.post0 24 | PyYAML==6.0.2 25 | pyyaml_env_tag==0.1 26 | requests==2.32.3 27 | six==1.17.0 28 | urllib3==2.3.0 29 | watchdog==6.0.0 30 | -------------------------------------------------------------------------------- /fastlane/Appfile: -------------------------------------------------------------------------------- 1 | json_key_file("~/Documents/keystores/tng-fastlane-upload-key.json") 2 | package_name("com.samco.trackandgraph") 3 | -------------------------------------------------------------------------------- /fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # This file contains the fastlane.tools configuration 2 | # You can find the documentation at https://docs.fastlane.tools 3 | # 4 | # For a list of all available actions, check out 5 | # 6 | # https://docs.fastlane.tools/actions 7 | # 8 | # For a list of all available plugins, check out 9 | # 10 | # https://docs.fastlane.tools/plugins/available-plugins 11 | # 12 | 13 | # Uncomment the line if you want fastlane to automatically update itself 14 | # update_fastlane 15 | 16 | default_platform(:android) 17 | 18 | platform :android do 19 | desc "Runs all the tests" 20 | lane :test do 21 | gradle(task: "test") 22 | end 23 | 24 | desc "Submit a new Beta Build to Crashlytics Beta" 25 | lane :beta do 26 | gradle(task: "clean assembleRelease") 27 | crashlytics 28 | 29 | # sh "your_script.sh" 30 | # You can also use other beta testing services here 31 | end 32 | 33 | desc "Deploy a new version to the Google Play" 34 | lane :deploy do 35 | gradle(task: "clean assembleRelease") 36 | upload_to_play_store 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | Install _fastlane_ using 12 | ``` 13 | [sudo] gem install fastlane -NV 14 | ``` 15 | or alternatively using `brew cask install fastlane` 16 | 17 | # Available Actions 18 | ## Android 19 | ### android test 20 | ``` 21 | fastlane android test 22 | ``` 23 | Runs all the tests 24 | ### android beta 25 | ``` 26 | fastlane android beta 27 | ``` 28 | Submit a new Beta Build to Crashlytics Beta 29 | ### android deploy 30 | ``` 31 | fastlane android deploy 32 | ``` 33 | Deploy a new version to the Google Play 34 | 35 | ---- 36 | 37 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. 38 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 39 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 40 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/1.3.3.txt: -------------------------------------------------------------------------------- 1 | Added reminders feature. 2 | Minor bug fixes and improvements. -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101000.txt: -------------------------------------------------------------------------------- 1 | - Fixed average time between algorithm to include time between last tracked and now 2 | 3 | - Fixed plot totals bugs 4 | 5 | - Added german version 6 | 7 | - Time histograms 8 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101001.txt: -------------------------------------------------------------------------------- 1 | - Fixed average time between algorithm to include time between last tracked and now 2 | 3 | - Fixed plot totals bugs 4 | 5 | - Added german version 6 | 7 | - Time histograms 8 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101002.txt: -------------------------------------------------------------------------------- 1 | - Allow any characters in tracker multi-choice answers 2 | 3 | - Allow for 12 lines on a graph not 10 4 | 5 | - Various minor bug fixes 6 | 7 | - Fix wrong date/times over daylight savings 8 | 9 | - Fix bad backup file names 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101003.txt: -------------------------------------------------------------------------------- 1 | - Allow any characters in tracker multi-choice answers 2 | 3 | - Allow for 12 lines on a graph not 10 4 | 5 | - Various minor bug fixes 6 | 7 | - Fix wrong date/times over daylight savings 8 | 9 | - Fix bad backup file names 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101004.txt: -------------------------------------------------------------------------------- 1 | Fix bug Time histograms showing incorrect X-axis numbers 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101100.txt: -------------------------------------------------------------------------------- 1 | Fix reminders names not changing 2 | Fix CSV export file names wrong 3 | Improve line graph Y intervals 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101101.txt: -------------------------------------------------------------------------------- 1 | Fix reminders names not changing 2 | Fix CSV export file names wrong 3 | Improve line graph Y intervals 4 | Fix crash when creating graph with no data 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101200.txt: -------------------------------------------------------------------------------- 1 | - Fix incorrect graph bounds in preview mode 2 | - Adaptive graph card size 3 | - Fix cancel button invisible 4 | - Fix German input dialog overlapping text 5 | - Add vibration when tracking with default values 6 | - Remove limit on maximum lines on a graph 7 | - Remove limit on maximum multiple choice name lengths 8 | - Remove limit on maximum graph name length 9 | - Remove limit on maximum graph line name length 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101201.txt: -------------------------------------------------------------------------------- 1 | - Fix incorrect graph bounds in preview mode 2 | - Adaptive graph card size 3 | - Fix cancel button invisible 4 | - Fix German input dialog overlapping text 5 | - Add vibration when tracking with default values 6 | - Remove limit on maximum lines on a graph 7 | - Remove limit on maximum multiple choice name lengths 8 | - Remove limit on maximum graph name length 9 | - Remove limit on maximum graph line name length 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101300.txt: -------------------------------------------------------------------------------- 1 | - Add Spanish translation 2 | - Remove limit on group name length 3 | - Add week days to timestamps on notes and history 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101301.txt: -------------------------------------------------------------------------------- 1 | - Add Spanish translation 2 | - Remove limit on group name length 3 | - Add week days to timestamps on notes and history 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/101400.txt: -------------------------------------------------------------------------------- 1 | Add French translation 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10402.txt: -------------------------------------------------------------------------------- 1 | New input type for quicker tracking where you only need a date/time 2 | Usability improvements 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10403.txt: -------------------------------------------------------------------------------- 1 | New input type for quicker tracking where you only need a date/time 2 | Usability improvements 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10404.txt: -------------------------------------------------------------------------------- 1 | Bug fixes: 2 | - Y padding on line graphs improved 3 | - Crash on creating graph using plot totals from empty data fixed 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10500.txt: -------------------------------------------------------------------------------- 1 | - You now have the option of fixed Y ranges on line graphs. 2 | 3 | - Various bug fixes. 4 | 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10501.txt: -------------------------------------------------------------------------------- 1 | - You now have the option of fixed Y ranges on line graphs. 2 | 3 | - Various bug fixes. 4 | 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10502.txt: -------------------------------------------------------------------------------- 1 | - Better parsing of numeric inputs 2 | 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10600.txt: -------------------------------------------------------------------------------- 1 | - Added basic home screen tracking widget 2 | 3 | - Added line point label options to line graphs 4 | 5 | - Added hourly plot totals option to line graph 6 | 7 | - Removed timestamp only data type but added a more general default value option 8 | 9 | - You can now select more than one of the multiple choice answers when creating an "Average time between" or "Time since last" statistic 10 | 11 | - Added a backup and restore page to allow quick backing up of all app data 12 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10601.txt: -------------------------------------------------------------------------------- 1 | - Added basic home screen tracking widget 2 | 3 | - Added line point label options to line graphs 4 | 5 | - Added hourly plot totals option to line graph 6 | 7 | - Removed timestamp only data type but added a more general default value option 8 | 9 | - You can now select more than one of the multiple choice answers when creating an "Average time between" or "Time since last" statistic 10 | 11 | - Added a backup and restore page to allow quick backing up of all app data 12 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10602.txt: -------------------------------------------------------------------------------- 1 | - Added basic home screen tracking widget 2 | 3 | - Added line point label options to line graphs 4 | 5 | - Added hourly plot totals option to line graph 6 | 7 | - Removed timestamp only data type but added a more general default value option 8 | 9 | - You can now select more than one of the multiple choice answers when creating an "Average time between" or "Time since last" statistic 10 | 11 | - Added a backup and restore page to allow quick backing up of all app data 12 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10700.txt: -------------------------------------------------------------------------------- 1 | - Data points can now have notes that show up under any graph they are a part of 2 | 3 | - Tracked data can now have optional more detailed descriptions 4 | 5 | - Swapped order of default tracking input types 6 | 7 | - Two more data visualisation colors to use 8 | 9 | - Various minor bug fixes 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10701.txt: -------------------------------------------------------------------------------- 1 | - Data points can now have notes that show up under any graph they are a part of 2 | 3 | - Tracked data can now have optional more detailed descriptions 4 | 5 | - Swapped order of default tracking input types 6 | 7 | - Two more data visualisation colors to use 8 | 9 | - Various minor bug fixes 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10702.txt: -------------------------------------------------------------------------------- 1 | - Data points can now have notes that show up under any graph they are a part of 2 | 3 | - Tracked data can now have optional more detailed descriptions 4 | 5 | - Swapped order of default tracking input types 6 | 7 | - Two more data visualisation colors to use 8 | 9 | - Various minor bug fixes 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10800.txt: -------------------------------------------------------------------------------- 1 | - Dark theme 2 | 3 | - Customizable date formats 4 | 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10801.txt: -------------------------------------------------------------------------------- 1 | - Dark theme 2 | 3 | - Customizable date formats 4 | 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/10900.txt: -------------------------------------------------------------------------------- 1 | - Added time duration input option 2 | 3 | - Graphs can have end times 4 | 5 | - Added duplicate graph button 6 | 7 | - Notes show markers on line graphs 8 | 9 | - Added global notes menu 10 | 11 | - Various minor bug fixes 12 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200000.txt: -------------------------------------------------------------------------------- 1 | - Track groups and graph groups are now just groups 2 | - Create trackers anywhere 3 | - Create graphs anywhere 4 | - Create groups anywhere 5 | - Create nested groups 6 | - Long press on default value + to enter value manually 7 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200001.txt: -------------------------------------------------------------------------------- 1 | - Track groups and graph groups are now just groups 2 | - Create trackers anywhere 3 | - Create graphs anywhere 4 | - Create groups anywhere 5 | - Create nested groups 6 | - Long press on default value + to enter value manually 7 | - Fix can't see cancel buttons on import/export dialogs 8 | - Hide FAB on scroll 9 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200002.txt: -------------------------------------------------------------------------------- 1 | - Track groups and graph groups are now just groups 2 | - Create trackers anywhere 3 | - Create graphs anywhere 4 | - Create groups anywhere 5 | - Create nested groups 6 | - Long press on default value + to enter value manually 7 | - Fix can't see cancel buttons on import/export dialogs 8 | - Hide FAB on scroll 9 | - Fix crashing on tutorial with OOM 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200003.txt: -------------------------------------------------------------------------------- 1 | - Track groups and graph groups are now just groups 2 | - Create trackers anywhere 3 | - Create graphs anywhere 4 | - Create groups anywhere 5 | - Create nested groups 6 | - Long press on default value + to enter value manually 7 | - Fix can't see cancel buttons on import/export dialogs 8 | - Hide FAB on scroll 9 | - Fix crashing on tutorial with OOM 10 | - Fix layout crashing on small screens 11 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200004.txt: -------------------------------------------------------------------------------- 1 | Fix bug import/export dialogs not working 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200100.txt: -------------------------------------------------------------------------------- 1 | Minor UX improvement for graph loading 2 | Enable auto backup 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200101.txt: -------------------------------------------------------------------------------- 1 | Bug fix for plot totals wrong in some time zones 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200200.txt: -------------------------------------------------------------------------------- 1 | Handle larger number of labels in pie charts 2 | Remove max multiple choice answers 3 | Add checkboxes for filter by label/value to: 4 | - Time since last stat 5 | - Average time between stat 6 | Filter Time since and av time between on both label and value 7 | sort feature name lists alphabetically 8 | Better error resolution for graphs 9 | Average time between stat no longer contains the time since the last data point 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200201.txt: -------------------------------------------------------------------------------- 1 | Fix bug update data point removes data point 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200300.txt: -------------------------------------------------------------------------------- 1 | - Stability improvements to reminders 2 | - Adds timer functionality to tracker cards and widgets including notifications 3 | - Global notes under graphs are filtered by date range 4 | - Fix for graphs stuck loading and duplicate graph not working 5 | - Keyboard fixes 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200301.txt: -------------------------------------------------------------------------------- 1 | Performance and memory improvements 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200302.txt: -------------------------------------------------------------------------------- 1 | Fix bug reminders crashing when first created 2 | Fix bug graphs missing first data point 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200303.txt: -------------------------------------------------------------------------------- 1 | Fix bug notifications don't work on Android 13 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200304.txt: -------------------------------------------------------------------------------- 1 | Implement schedule exact alarm for reminders 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200305.txt: -------------------------------------------------------------------------------- 1 | Fix bug duplicate notifications 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200400.txt: -------------------------------------------------------------------------------- 1 | - New UX for adding trackers 2 | - New update all tool for updating tracked data 3 | - Suggested values and suggestion ordering/types 4 | - Various UI changes 5 | 6 | 7 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200401.txt: -------------------------------------------------------------------------------- 1 | - New UX for adding trackers 2 | - New update all tool for updating tracked data 3 | - Suggested values and suggestion ordering/types 4 | - Various UI changes 5 | 6 | 7 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/200402.txt: -------------------------------------------------------------------------------- 1 | - New UX for adding trackers 2 | - New update all tool for updating tracked data 3 | - Suggested values and suggestion ordering/types 4 | - Various UI changes 5 | - Documentation and FAQ moved to GitHub 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300000.txt: -------------------------------------------------------------------------------- 1 | - New UX for adding trackers 2 | - New update all tool for updating tracked data 3 | - Suggested values and suggestion ordering/types 4 | - Various UI changes 5 | - Documentation and FAQ moved to GitHub 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300001.txt: -------------------------------------------------------------------------------- 1 | - Fix bug negative durations not shown properly 2 | - Auto focus value field if there are no suggested values 3 | - Revert to 24 hour time input format 4 | - Revert to previous parse double implementation for value 5 | - Fix bug crash app on double click timer button 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300002.txt: -------------------------------------------------------------------------------- 1 | - Bugfix for wrong date selected in different time zones 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300100.txt: -------------------------------------------------------------------------------- 1 | - Fix bug daylight savings not accounted for on line graphs 2 | - Disable close add note or input data point dialog on click outside and add confirm cancel dialog if you have notes 3 | - Fix translation errors 4 | - Fix bug suggestion type and order ignored on create tracker 5 | - Add checkbox for pie charts (sum by count) 6 | - Fix bug double negative on durations 7 | - Convert histograms to show percentage on the y axis 8 | 9 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300200.txt: -------------------------------------------------------------------------------- 1 | - New UI for data point input 2 | - New behaviour for suggested values 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300201.txt: -------------------------------------------------------------------------------- 1 | - Fix bug graph durations wrong on updating graph 2 | - Add scroll to note view dialog 3 | - Auto-scroll to note and label inputs when they are focused 4 | - Fix bug track vibrate not working 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300300.txt: -------------------------------------------------------------------------------- 1 | - Fix crash on edit some text fields 2 | - Add last data point data to time since 3 | 4 | 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300301.txt: -------------------------------------------------------------------------------- 1 | - Fix average time between not showing "no data" 2 | - Fix duration options not showing when adding lines to line graph 3 | - Increase time since text size 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300400.txt: -------------------------------------------------------------------------------- 1 | - Add Bar charts 2 | - Fix bug graphs not updating and wrong graph showing on scroll 3 | 4 | 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300401.txt: -------------------------------------------------------------------------------- 1 | - Fix bug crash on click empty bar in bar chart 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300500.txt: -------------------------------------------------------------------------------- 1 | - Significant performance improvements for graph loading 2 | - Improved tracker input dialog behaviour (next button adds data point or goes to next) 3 | - Fix bug labels lost when updating from duration to continuous 4 | - Slimmer outlined text fields and buttons 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300501.txt: -------------------------------------------------------------------------------- 1 | - Add loading state while database migrating 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300600.txt: -------------------------------------------------------------------------------- 1 | - Add option for custom sample size durations/periods 2 | - Improve Y-Axis label choices for line/bar graphs 3 | - Fix bugs: 4 | - line graphs should clip from last data point in the graph to sample size prior 5 | - time durations not formatted correctly for bar chart details view 6 | - bar charts showing blank when no data 7 | - notes not scrolling 8 | - calendar should use correct first day of week 9 | - time button should prefer clock face to text input 10 | - global note input dialog not working 11 | 12 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300601.txt: -------------------------------------------------------------------------------- 1 | - Fix bug tracker widget data point input dialog crashing 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300602.txt: -------------------------------------------------------------------------------- 1 | - Fix bug showing wrong date for old tracker 2 | - Fix bug global note dialog looks wrong in dark mode 3 | - Fix bug blank feature selected in line graph config view 4 | - Fix bug empty line graph showing unkown error occurred 5 | - Fix bug y range max wrong input type for duration data 6 | 7 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300603.txt: -------------------------------------------------------------------------------- 1 | - Fix bug reminders not working after device reboot 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300604.txt: -------------------------------------------------------------------------------- 1 | - Fix bug silent crash on locked boot (can't re-create alarms until unlock) 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300700.txt: -------------------------------------------------------------------------------- 1 | - Auto-Backup feature now available 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300701.txt: -------------------------------------------------------------------------------- 1 | - Fix bug auto-backup config crash 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300702.txt: -------------------------------------------------------------------------------- 1 | - Fix bug google drive auto-backup locations not working 2 | - Fix bug auto-backup location text pushing controls off screen 3 | - Improve auto-backup first date/time controls behaviour 4 | 5 | 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300800.txt: -------------------------------------------------------------------------------- 1 | - Change Tracker card design 2 | - Translation fixes 3 | - Fix cyclical groups bug 4 | 5 | 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300801.txt: -------------------------------------------------------------------------------- 1 | - Minor efficiency improvements 2 | - Remove divider from tracker card 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300802.txt: -------------------------------------------------------------------------------- 1 | - Fix minor tracker card layout issue 2 | 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/300803.txt: -------------------------------------------------------------------------------- 1 | - Fix group dialog crashing the app 2 | - Fix copy in group dialog wrong for update group 3 | 4 | 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/400000.txt: -------------------------------------------------------------------------------- 1 | - Added date scroll bar for long lists 2 | - Add "Now" as a graph end date option 3 | - Tracker cards show greater precision for times less than 24 hours 4 | - Fix bug default duration not showing when updating a tracker 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/400001.txt: -------------------------------------------------------------------------------- 1 | Fix bug date scroll text wrong colour in dark mode 2 | Upgrade library dependencies 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/400002.txt: -------------------------------------------------------------------------------- 1 | - Fix bug auto backup failing and configuration getting lost 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/400003.txt: -------------------------------------------------------------------------------- 1 | - Fix bug auto backup failing and configuration getting lost on API 34 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/500000.txt: -------------------------------------------------------------------------------- 1 | - Experimental lua graph support for datapoint graph type 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/500100.txt: -------------------------------------------------------------------------------- 1 | - Introduced the Lua graphs scripting API (currently only for graphs) 2 | - Introduced new docs website 3 | - Fix bug navigation not working after returning from adding a new track or graph 4 | - Fix bug showing empty group text when loading 5 | - Fix bug spinners should clear focus when tapped 6 | - Align graph input UI 7 | 8 | 9 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/500101.txt: -------------------------------------------------------------------------------- 1 | - Fix bug missing lua core api assets 2 | 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/500102.txt: -------------------------------------------------------------------------------- 1 | - Fix broken disable lua shortcut 2 | - Fix broken loading state and empty group text 3 | - Fix incorrect move to group path ordering 4 | - Fix incorrect feature paths in feature select spinner 5 | 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/500103.txt: -------------------------------------------------------------------------------- 1 | - Fix bug crashing on start up with tracker widgets on API >= 35 2 | - Fix bug crashing with graph containing one empty line and one non-empty line 3 | 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/changelogs/600000.txt: -------------------------------------------------------------------------------- 1 | - Change CSV output to put label in a separate column (importing legacy format is still supported) 2 | - Fix bug line graph ending at latest should end at latest even with plot totalling 3 | - Enable predictive back 4 | - Make the app bar edge to edge 5 | - Fix bug tutorial end button behind navigation bars 6 | - Fix bug back button should close the app from the root group 7 | - Allow open app from timer notification 8 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/full_description.txt: -------------------------------------------------------------------------------- 1 | Track & Graph: Dashboards for life 2 | 3 | Track & Graph helps you record, visualize, and understand patterns in your daily life. Record numerical values or simple occurrences to build personal dashboards that provide insights into your habits, behaviors, and activities. 4 | 5 | Visualize your data through line graphs, pie charts, and statistical reports that show trends, moving averages, and intervals between events. Organize tracking items into customizable groups that make sense for your needs. 6 | 7 | Track & Graph now embeds a Lua scripting API, allowing you to create custom calculations (like cumulative totals, differentials, or financial metrics). 8 | 9 | Track & Graph is completely free and open source with no ads, accounts, or in-app purchases. Your data remains private—stored only on your device—and can be easily backed up at any time. 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/icon.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/phoneScreenshots/4_en-GB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/phoneScreenshots/4_en-GB.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/phoneScreenshots/5_en-GB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/phoneScreenshots/5_en-GB.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/phoneScreenshots/6_en-GB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/phoneScreenshots/6_en-GB.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/images/phoneScreenshots/7_en-GB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/images/phoneScreenshots/7_en-GB.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/short_description.txt: -------------------------------------------------------------------------------- 1 | Dashboards for life! 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/title.txt: -------------------------------------------------------------------------------- 1 | Track & Graph -------------------------------------------------------------------------------- /fastlane/metadata/android/en-GB/video.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/fastlane/metadata/android/en-GB/video.txt -------------------------------------------------------------------------------- /functions/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /functions/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/functions/consumer-rules.pro -------------------------------------------------------------------------------- /functions/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep class com.samco.trackandgraph.functions.** { *; } 23 | -------------------------------------------------------------------------------- /functions/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /functions/src/main/java/com/samco/trackandgraph/functions/aggregation/AggregationCommon.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.functions.aggregation 2 | 3 | import com.samco.trackandgraph.base.database.dto.IDataPoint 4 | 5 | 6 | internal fun sumDataPoints(points: List): Double = points.sumOf { it.value } 7 | 8 | internal fun averageDataPoints(points: List): Double = points.map { it.value }.average() 9 | 10 | internal fun dataPointsLabel(points: List) = when { 11 | points.isEmpty() -> "" 12 | points.all { it.label == points[0].label } -> points[0].label 13 | else -> "" 14 | } -------------------------------------------------------------------------------- /functions/src/main/java/com/samco/trackandgraph/functions/exceptions/InvalidRegularityException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.functions.exceptions 19 | 20 | class InvalidRegularityException : Exception() { } -------------------------------------------------------------------------------- /functions/src/main/java/com/samco/trackandgraph/functions/functions/IdentityFunction.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Track & Graph 3 | * 4 | * Track & Graph is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * Track & Graph is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Track & Graph. If not, see . 16 | */ 17 | 18 | package com.samco.trackandgraph.functions.functions 19 | 20 | import com.samco.trackandgraph.base.database.sampling.DataSample 21 | 22 | /** A calculator that just returns the data passed to it **/ 23 | class IdentityFunction : DataSampleFunction { 24 | override suspend fun mapSample(dataSample: DataSample): DataSample = dataSample 25 | } -------------------------------------------------------------------------------- /functions/src/test/java/com/samco/trackandgraph/functions/TestCommon.kt: -------------------------------------------------------------------------------- 1 | package com.samco.trackandgraph.functions 2 | 3 | import com.samco.trackandgraph.base.database.dto.IDataPoint 4 | import com.samco.trackandgraph.base.database.sampling.DataSample 5 | import com.samco.trackandgraph.base.database.sampling.DataSampleProperties 6 | 7 | fun fromSequence( 8 | sequence: Sequence, 9 | dataSampleProperties: DataSampleProperties = DataSampleProperties(), 10 | ) = DataSample.fromSequence( 11 | sequence, 12 | dataSampleProperties = dataSampleProperties, 13 | onDispose = {} 14 | ) -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## For more details on how to configure your build environment visit 2 | # http://www.gradle.org/docs/current/userguide/build_environment.html 3 | # 4 | # Specifies the JVM arguments used for the daemon process. 5 | # The setting is particularly useful for tweaking memory settings. 6 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 7 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 8 | # 9 | # When configured, Gradle will run in incubating parallel mode. 10 | # This option should only be used with decoupled projects. For more details, visit 11 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects 12 | # org.gradle.parallel=true 13 | #Mon May 20 20:46:48 BST 2024 14 | android.enableJetifier=true 15 | android.nonFinalResIds=false 16 | android.nonTransitiveRClass=false 17 | android.useAndroidX=true 18 | kotlin.code.style=official 19 | org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" 20 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 04 17:54:39 GMT 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /image-assets/app_icon.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/image-assets/app_icon.svg.png -------------------------------------------------------------------------------- /image-assets/bitcoin-cash.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/image-assets/bitcoin-cash.jpeg -------------------------------------------------------------------------------- /image-assets/bitcoin.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/image-assets/bitcoin.jpeg -------------------------------------------------------------------------------- /image-assets/ethereum.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/image-assets/ethereum.jpeg -------------------------------------------------------------------------------- /image-assets/litecoin.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/image-assets/litecoin.jpeg -------------------------------------------------------------------------------- /image-assets/notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamAmco/track-and-graph/2eca83499dc2b9fd1c244b0befcd264b412d6914/image-assets/notification_icon.png -------------------------------------------------------------------------------- /lua/src/test/core.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.assertEquals = function(a, b) 4 | if not (tostring(a) == tostring(b)) then 5 | error("Assertion failed, expected: " .. tostring(a) .. " got: " .. tostring(b)) 6 | end 7 | end 8 | 9 | M.assert = function(message, cond) 10 | if not cond then 11 | error("Assertion failed: " .. message) 12 | end 13 | end 14 | 15 | return M 16 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "track-and-graph" 16 | include ':app' 17 | include ':base' 18 | include ':functions' 19 | --------------------------------------------------------------------------------