Improve Epoxy view models
This commit is contained in:
@@ -38,7 +38,7 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class BlackView : RelativeLayout {
|
||||
class BlackListView : RelativeLayout {
|
||||
|
||||
private lateinit var B: ViewBlackBinding
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.aurora.extensions.load
|
||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
|
||||
|
||||
@ModelView(
|
||||
autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT,
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class CategoryView : RelativeLayout {
|
||||
|
||||
@@ -45,7 +45,7 @@ import java.lang.reflect.Modifier
|
||||
import java.util.*
|
||||
|
||||
@ModelView(
|
||||
autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT,
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class DownloadView : RelativeLayout {
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.aurora.store.R
|
||||
import com.aurora.store.databinding.ViewEditorHeadBinding
|
||||
|
||||
@ModelView(
|
||||
autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT,
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class EditorHeadView : RelativeLayout {
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.aurora.store.databinding.ViewHeaderBinding
|
||||
|
||||
|
||||
@ModelView(
|
||||
autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT,
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class HeaderView : RelativeLayout {
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.aurora.store.databinding.ViewActionHeaderBinding
|
||||
|
||||
|
||||
@ModelView(
|
||||
autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT,
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class MinimalHeaderView : RelativeLayout {
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.aurora.store.databinding.ViewHeaderUpdateBinding
|
||||
|
||||
|
||||
@ModelView(
|
||||
autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT,
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class UpdateHeaderView : RelativeLayout {
|
||||
|
||||
@@ -28,18 +28,18 @@ import com.airbnb.epoxy.CallbackProp
|
||||
import com.airbnb.epoxy.ModelProp
|
||||
import com.airbnb.epoxy.ModelView
|
||||
import com.airbnb.epoxy.OnViewRecycled
|
||||
import com.aurora.extensions.clear
|
||||
import com.aurora.extensions.load
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.databinding.ViewAppUpdateBinding
|
||||
import com.aurora.store.util.CommonUtil
|
||||
import com.aurora.extensions.clear
|
||||
import com.aurora.extensions.load
|
||||
import com.aurora.store.view.epoxy.views.BaseView
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade
|
||||
|
||||
@ModelView(
|
||||
autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT,
|
||||
autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
|
||||
baseModelClass = BaseView::class
|
||||
)
|
||||
class AppUpdateView : RelativeLayout {
|
||||
@@ -77,7 +77,7 @@ class AppUpdateView : RelativeLayout {
|
||||
}
|
||||
|
||||
B.txtLine2.text = app.developerName
|
||||
B.txtLine3.text = CommonUtil.addSiPrefix(app.size)
|
||||
B.txtLine3.text = ("${CommonUtil.addSiPrefix(app.size)} • ${app.updatedOn}")
|
||||
B.txtChangelog.text = if (app.changes.isNotEmpty())
|
||||
HtmlCompat.fromHtml(
|
||||
app.changes,
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.aurora.store.data.model.Black
|
||||
import com.aurora.store.data.providers.BlacklistProvider
|
||||
import com.aurora.store.databinding.ActivityGenericRecyclerBinding
|
||||
import com.aurora.extensions.close
|
||||
import com.aurora.store.view.epoxy.views.BlackViewModel_
|
||||
import com.aurora.store.view.epoxy.views.BlackListViewModel_
|
||||
import com.aurora.store.view.epoxy.views.shimmer.AppListViewShimmerModel_
|
||||
import com.aurora.store.viewmodel.all.BlacklistViewModel
|
||||
|
||||
@@ -94,7 +94,7 @@ class BlacklistActivity : BaseActivity() {
|
||||
} else {
|
||||
blackList.forEach {
|
||||
add(
|
||||
BlackViewModel_()
|
||||
BlackListViewModel_()
|
||||
.id(it.packageName.hashCode())
|
||||
.black(it)
|
||||
.markChecked(VM.selected.contains(it.packageName))
|
||||
|
||||
Reference in New Issue
Block a user