-
Notifications
You must be signed in to change notification settings - Fork 19
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
1 parent
a51aaf3
commit c1c9766
Showing
7 changed files
with
80 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":19,"versionName":"1.0.0","enabled":true,"outputFile":"sample-release.apk","fullName":"release","baseName":"release"},"path":"sample-release.apk","properties":{}}] | ||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":20,"versionName":"1.1.0","enabled":true,"outputFile":"sample-release.apk","fullName":"release","baseName":"release"},"path":"sample-release.apk","properties":{}}] |
Binary file not shown.
32 changes: 32 additions & 0 deletions
32
sample/src/main/java/com/arthurivanets/sample/adapters/adapster/TextItem.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,32 @@ | ||
package com.arthurivanets.sample.adapters.adapster | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.arthurivanets.adapster.Adapter | ||
import com.arthurivanets.adapster.markers.ItemResources | ||
import com.arthurivanets.adapster.model.BaseItem | ||
import com.arthurivanets.adapster.model.Item | ||
import com.arthurivanets.sample.R | ||
|
||
class TextItem(itemModel : String) : BaseItem<String, TextItemViewHolder, ItemResources>(itemModel) { | ||
|
||
|
||
override fun init(adapter : Adapter<out Item<RecyclerView.ViewHolder, ItemResources>>?, | ||
parent : ViewGroup, | ||
inflater : LayoutInflater, | ||
resources : ItemResources?) : TextItemViewHolder { | ||
return TextItemViewHolder(inflater.inflate( | ||
layout, | ||
parent, | ||
false | ||
)) | ||
} | ||
|
||
|
||
override fun getLayout() : Int { | ||
return R.layout.item_text | ||
} | ||
|
||
|
||
} |
28 changes: 28 additions & 0 deletions
28
sample/src/main/java/com/arthurivanets/sample/adapters/adapster/TextItemViewHolder.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,28 @@ | ||
package com.arthurivanets.sample.adapters.adapster | ||
|
||
import android.view.View | ||
import android.widget.TextView | ||
import com.arthurivanets.adapster.model.BaseItem | ||
import com.arthurivanets.sample.R | ||
|
||
class TextItemViewHolder( | ||
itemView : View | ||
) : BaseItem.ViewHolder<String>(itemView) { | ||
|
||
|
||
val textTv = itemView.findViewById<TextView>(R.id.textTv) | ||
|
||
|
||
override fun bindData(data : String?) { | ||
super.bindData(data) | ||
|
||
data?.let(::handleData) | ||
} | ||
|
||
|
||
private fun handleData(data : String) { | ||
textTv.text = data | ||
} | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/textTv" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:padding="50dp"/> | ||
|
||
</LinearLayout> |