A fork of Simple Time Tracker with WearOS support. (Now integrated upstream)
0

Configure Feed

Select the types of activity you want to include in your feed.

add archive title, refactor divider

razeeman (Nov 13, 2022, 2:39 PM +0300) ac2237fa 59208ea6

+109 -32
+1
features/feature_base_adapter/build.gradle.kts
··· 30 30 implementation(project(":feature_views")) 31 31 32 32 implementation(Deps.Androidx.recyclerView) 33 + implementation(Deps.Androidx.constraintLayout) 33 34 implementation(Deps.Androidx.cardView) 34 35 implementation(Deps.Androidx.material) 35 36 implementation(Deps.Google.flexBox)
+33 -4
features/feature_archive/src/main/res/layout/archive_fragment.xml
··· 1 1 <?xml version="1.0" encoding="utf-8"?> 2 - <androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" 2 + <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 + xmlns:app="http://schemas.android.com/apk/res-auto" 3 4 xmlns:tools="http://schemas.android.com/tools" 4 - android:id="@+id/rvArchiveList" 5 5 android:layout_width="match_parent" 6 - android:layout_height="match_parent" 7 - tools:listitem="@layout/item_record_type_layout" /> 6 + android:layout_height="match_parent"> 7 + 8 + <androidx.appcompat.widget.AppCompatTextView 9 + android:id="@+id/tvArchiveTitle" 10 + android:layout_width="match_parent" 11 + android:layout_height="wrap_content" 12 + android:layout_marginHorizontal="12dp" 13 + android:layout_marginTop="12dp" 14 + android:gravity="center" 15 + android:paddingHorizontal="16dp" 16 + android:text="@string/settings_archive" 17 + android:textColor="?appTextPrimaryColor" 18 + android:textSize="22sp" 19 + android:textStyle="bold" 20 + app:layout_constraintTop_toTopOf="parent" /> 21 + 22 + <com.example.util.simpletimetracker.feature_views.DividerView 23 + android:id="@+id/dividerArchive" 24 + android:layout_width="match_parent" 25 + android:layout_height="wrap_content" 26 + app:layout_constraintTop_toBottomOf="@id/tvArchiveTitle" /> 27 + 28 + <androidx.recyclerview.widget.RecyclerView 29 + android:id="@+id/rvArchiveList" 30 + android:layout_width="match_parent" 31 + android:layout_height="0dp" 32 + app:layout_constraintBottom_toBottomOf="parent" 33 + app:layout_constraintTop_toBottomOf="@id/dividerArchive" 34 + tools:listitem="@layout/item_record_type_layout" /> 35 + 36 + </androidx.constraintlayout.widget.ConstraintLayout>
+2 -7
features/feature_base_adapter/src/main/res/layout/item_divider_layout.xml
··· 1 1 <?xml version="1.0" encoding="utf-8"?> 2 - <View xmlns:android="http://schemas.android.com/apk/res/android" 3 - android:id="@+id/viewDividerItem" 2 + <com.example.util.simpletimetracker.feature_views.DividerView xmlns:android="http://schemas.android.com/apk/res/android" 4 3 android:layout_width="match_parent" 5 - android:layout_height="2dp" 6 - android:layout_marginHorizontal="8dp" 7 - android:layout_marginTop="8dp" 8 - android:layout_marginBottom="6dp" 9 - android:background="?appDividerColor" /> 4 + android:layout_height="wrap_content" />
+19 -2
features/feature_categories/src/main/res/layout/categories_fragment.xml
··· 19 19 android:textStyle="bold" 20 20 app:layout_constraintTop_toTopOf="parent" /> 21 21 22 + <androidx.appcompat.widget.AppCompatTextView 23 + android:id="@+id/tvCategoriesHint" 24 + android:layout_width="match_parent" 25 + android:layout_height="wrap_content" 26 + android:layout_marginHorizontal="12dp" 27 + android:gravity="center" 28 + android:text="Hint text" 29 + android:textColor="?appTextHintColor" 30 + android:visibility="gone" 31 + app:layout_constraintTop_toBottomOf="@id/tvCategoriesTitle" 32 + tools:visibility="visible" /> 33 + 34 + <com.example.util.simpletimetracker.feature_views.DividerView 35 + android:id="@+id/dividerCategories" 36 + android:layout_width="match_parent" 37 + android:layout_height="wrap_content" 38 + app:layout_constraintTop_toBottomOf="@id/tvCategoriesHint" /> 39 + 22 40 <androidx.recyclerview.widget.RecyclerView 23 41 android:id="@+id/rvCategoriesList" 24 42 android:layout_width="match_parent" 25 43 android:layout_height="0dp" 26 - android:layout_marginTop="12dp" 27 44 app:layout_constraintBottom_toBottomOf="parent" 28 - app:layout_constraintTop_toBottomOf="@id/tvCategoriesTitle" 45 + app:layout_constraintTop_toBottomOf="@id/dividerCategories" 29 46 tools:listitem="@layout/item_category_layout" /> 30 47 31 48 </androidx.constraintlayout.widget.ConstraintLayout>
+3 -8
features/feature_dialogs/src/main/res/layout/help_dialog_fragment.xml
··· 27 27 android:textStyle="bold" 28 28 tools:text="Help title" /> 29 29 30 - <View 30 + <com.example.util.simpletimetracker.feature_views.DividerView 31 31 android:layout_width="match_parent" 32 - android:layout_height="2dp" 33 - android:layout_marginStart="8dp" 34 - android:layout_marginTop="12dp" 35 - android:layout_marginEnd="8dp" 36 - android:background="?appDividerColor" /> 32 + android:layout_height="wrap_content" /> 37 33 38 34 <androidx.core.widget.NestedScrollView 39 35 android:layout_width="match_parent" 40 36 android:layout_height="wrap_content" 41 - android:layout_marginTop="12dp" 42 - android:paddingVertical="12dp" 43 37 android:scrollbars="vertical"> 44 38 45 39 <androidx.appcompat.widget.AppCompatTextView ··· 47 41 android:layout_width="match_parent" 48 42 android:layout_height="wrap_content" 49 43 android:paddingHorizontal="16dp" 44 + android:paddingVertical="12dp" 50 45 android:textColor="?appTextPrimaryColor" 51 46 android:textSize="16sp" 52 47 tools:text="Help text" />
+18
features/feature_views/src/main/res/layout/divider_view.xml
··· 1 + <?xml version="1.0" encoding="utf-8"?> 2 + <merge xmlns:android="http://schemas.android.com/apk/res/android" 3 + xmlns:app="http://schemas.android.com/apk/res-auto" 4 + xmlns:tools="http://schemas.android.com/tools" 5 + android:layout_width="match_parent" 6 + android:layout_height="wrap_content" 7 + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> 8 + 9 + <View 10 + android:layout_width="match_parent" 11 + android:layout_height="2dp" 12 + android:layout_marginHorizontal="8dp" 13 + android:layout_marginTop="8dp" 14 + android:layout_marginBottom="6dp" 15 + android:background="?appDividerColor" 16 + app:layout_constraintBottom_toBottomOf="parent" 17 + app:layout_constraintTop_toTopOf="parent" /> 18 + </merge>
+22
features/feature_views/src/main/java/com/example/util/simpletimetracker/feature_views/DividerView.kt
··· 1 + package com.example.util.simpletimetracker.feature_views 2 + 3 + import android.content.Context 4 + import android.util.AttributeSet 5 + import android.view.LayoutInflater 6 + import androidx.constraintlayout.widget.ConstraintLayout 7 + import com.example.util.simpletimetracker.feature_views.databinding.DividerViewBinding 8 + 9 + class DividerView @JvmOverloads constructor( 10 + context: Context, 11 + attrs: AttributeSet? = null, 12 + defStyleAttr: Int = 0, 13 + ) : ConstraintLayout( 14 + context, 15 + attrs, 16 + defStyleAttr 17 + ) { 18 + 19 + init { 20 + DividerViewBinding.inflate(LayoutInflater.from(context), this) 21 + } 22 + }
+2 -3
features/feature_categories/src/main/java/com/example/util/simpletimetracker/feature_categories/interactor/CategoriesViewDataInteractor.kt
··· 25 25 val typeTags = async { getRecordTypeTagViewData() } 26 26 val recordTags = async { getRecordTagViewData() } 27 27 28 - listOf(DividerViewData(1)) + 29 - typeTags.await() + 30 - DividerViewData(2) + 28 + typeTags.await() + 29 + DividerViewData(1) + 31 30 recordTags.await() 32 31 } 33 32
+8 -8
features/feature_records/src/main/java/com/example/util/simpletimetracker/feature_records/view/RecordsFragment.kt
··· 1 1 package com.example.util.simpletimetracker.feature_records.view 2 2 3 + import com.example.util.simpletimetracker.feature_records.databinding.RecordsFragmentBinding as Binding 3 4 import android.os.Bundle 4 5 import android.view.LayoutInflater 5 6 import android.view.ViewGroup 6 7 import androidx.appcompat.app.AppCompatActivity 8 + import androidx.core.view.isVisible 7 9 import androidx.fragment.app.viewModels 8 10 import androidx.recyclerview.widget.LinearLayoutManager 11 + import com.example.util.simpletimetracker.core.base.BaseFragment 12 + import com.example.util.simpletimetracker.core.di.BaseViewModelFactory 13 + import com.example.util.simpletimetracker.core.sharedViewModel.RemoveRecordViewModel 14 + import com.example.util.simpletimetracker.domain.extension.orZero 9 15 import com.example.util.simpletimetracker.feature_base_adapter.BaseRecyclerAdapter 10 16 import com.example.util.simpletimetracker.feature_base_adapter.empty.createEmptyAdapterDelegate 11 17 import com.example.util.simpletimetracker.feature_base_adapter.hint.createHintAdapterDelegate 12 18 import com.example.util.simpletimetracker.feature_base_adapter.loader.createLoaderAdapterDelegate 13 19 import com.example.util.simpletimetracker.feature_base_adapter.record.createRecordAdapterDelegate 14 - import com.example.util.simpletimetracker.core.base.BaseFragment 15 - import com.example.util.simpletimetracker.core.di.BaseViewModelFactory 16 - import com.example.util.simpletimetracker.core.sharedViewModel.RemoveRecordViewModel 17 - import com.example.util.simpletimetracker.domain.extension.orZero 18 20 import com.example.util.simpletimetracker.feature_records.extra.RecordsExtra 19 21 import com.example.util.simpletimetracker.feature_records.viewModel.RecordsViewModel 20 - import com.example.util.simpletimetracker.feature_views.extension.visible 21 22 import com.example.util.simpletimetracker.navigation.params.screen.RecordsParams 22 23 import dagger.hilt.android.AndroidEntryPoint 23 24 import javax.inject.Inject 24 - import com.example.util.simpletimetracker.feature_records.databinding.RecordsFragmentBinding as Binding 25 25 26 26 @AndroidEntryPoint 27 27 class RecordsFragment : BaseFragment<Binding>() { ··· 93 93 } 94 94 95 95 private fun switchState(isCalendarView: Boolean) = with(binding) { 96 - groupRecordsList.visible = !isCalendarView 97 - groupRecordsCalendar.visible = isCalendarView 96 + groupRecordsList.isVisible = !isCalendarView 97 + groupRecordsCalendar.isVisible = isCalendarView 98 98 } 99 99 100 100 companion object {
+1
features/feature_views/src/main/java/com/example/util/simpletimetracker/feature_views/extension/ViewExtensions.kt
··· 13 13 import androidx.recyclerview.widget.RecyclerView 14 14 import com.google.android.material.tabs.TabLayout 15 15 16 + @Deprecated("replace with isVisible") 16 17 var View.visible: Boolean 17 18 set(value) { 18 19 visibility = if (value) View.VISIBLE else View.GONE