-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
327 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...il/simpletimetracker/feature_base_adapter/recordWithHint/RecordWithHintAdapterDelegate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.example.util.simpletimetracker.feature_base_adapter.recordWithHint | ||
|
||
import com.example.util.simpletimetracker.feature_base_adapter.createRecyclerBindingAdapterDelegate | ||
import com.example.util.simpletimetracker.feature_base_adapter.databinding.ItemRecordWithHintLayoutBinding as Binding | ||
import com.example.util.simpletimetracker.feature_base_adapter.recordWithHint.RecordWithHintViewData as ViewData | ||
|
||
fun createRecordWithHintAdapterDelegate() = createRecyclerBindingAdapterDelegate<ViewData, Binding>( | ||
Binding::inflate, | ||
) { binding, item, _ -> | ||
|
||
with(binding.viewRecordItem) { | ||
item as ViewData | ||
|
||
item.record.let { item -> | ||
itemColor = item.color | ||
itemIcon = item.iconId | ||
itemName = item.name | ||
itemTagName = item.tagName | ||
itemTimeStarted = item.timeStarted | ||
itemTimeEnded = item.timeFinished | ||
itemDuration = item.duration | ||
itemComment = item.comment | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...mple/util/simpletimetracker/feature_base_adapter/recordWithHint/RecordWithHintViewData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.example.util.simpletimetracker.feature_base_adapter.recordWithHint | ||
|
||
import com.example.util.simpletimetracker.feature_base_adapter.ViewHolderType | ||
import com.example.util.simpletimetracker.feature_base_adapter.record.RecordViewData | ||
|
||
data class RecordWithHintViewData( | ||
val record: RecordViewData.Tracked, | ||
) : ViewHolderType { | ||
|
||
override fun getUniqueId(): Long = record.id | ||
|
||
override fun isValidType(other: ViewHolderType): Boolean = | ||
other is RecordWithHintViewData | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
features/feature_base_adapter/src/main/res/layout/item_record_with_hint_layout.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<com.example.util.simpletimetracker.feature_views.RecordView | ||
android:id="@+id/viewRecordItem" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="4dp" | ||
android:layout_marginEnd="4dp" | ||
app:cardElevation="@dimen/record_type_card_elevation" | ||
app:itemTagColor="@color/white_alpha_60" | ||
app:layout_constraintTop_toTopOf="parent" | ||
tools:itemColor="@color/blue_800" | ||
tools:itemDuration="5h 23m 3s" | ||
tools:itemName="Record" | ||
tools:itemTagName="Tag" | ||
tools:itemTimeEnded="11:58" | ||
tools:itemTimeStarted="07:35" /> | ||
|
||
<Space | ||
android:id="@+id/spaceRecordItem" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="4dp" | ||
android:layout_marginBottom="10dp" | ||
app:layout_constraintBottom_toTopOf="@id/viewRecordItem" | ||
app:layout_constraintStart_toStartOf="@id/viewRecordItem" /> | ||
|
||
<androidx.cardview.widget.CardView | ||
android:id="@+id/btnRecordItemHint" | ||
style="@style/InputFieldCard" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:cardElevation="@dimen/record_type_card_elevation" | ||
app:layout_constraintStart_toStartOf="@id/spaceRecordItem" | ||
app:layout_constraintTop_toTopOf="@id/spaceRecordItem"> | ||
|
||
<androidx.appcompat.widget.AppCompatTextView | ||
android:id="@+id/tvRecordItemHint" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:background="?appInputFieldBorder" | ||
android:paddingHorizontal="10dp" | ||
android:paddingVertical="2dp" | ||
android:text="@string/statistics_detail_last_record" | ||
android:textColor="?appTextHintColor" | ||
android:textSize="11sp" | ||
app:autoSizeTextType="none" /> | ||
|
||
</androidx.cardview.widget.CardView> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.