Skip to content

Commit

Permalink
- we still require jetifier for some super old sample showcase depend…
Browse files Browse the repository at this point in the history
…encies
  • Loading branch information
mikepenz committed Apr 9, 2021
1 parent 97b9f1f commit 2882eb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions app/src/main/java/com/mikepenz/fastadapter/app/PagedActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package com.mikepenz.fastadapter.app
import android.os.Bundle
import android.os.Handler
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import androidx.paging.PagedList
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.AsyncDifferConfig
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.LinearLayoutManager
Expand Down Expand Up @@ -69,12 +67,11 @@ class PagedActivity : AppCompatActivity() {
binding.rv.layoutManager = LinearLayoutManager(this)
binding.rv.adapter = mFastAdapter

val viewModel = ViewModelProviders.of(this,
DemoEntityViewModel.DemoEntityViewModelFactory(this.application))
.get(DemoEntityViewModel::class.java)
val viewModel = ViewModelProvider(this, DemoEntityViewModel.DemoEntityViewModelFactory(this.application))
.get(DemoEntityViewModel::class.java)

//listen to data changes and pass it to adapter for displaying in recycler view
viewModel.demoEntitiesList.observe(this, Observer<PagedList<DemoEntity>> { t -> mItemAdapter.submitList(t!!) })
viewModel.demoEntitiesList.observe(this, { t -> mItemAdapter.submitList(t!!) })

//if we do this. the first added items will be animated :D
Handler().postDelayed({
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ POM_DEVELOPER_ID=mikepenz
POM_DEVELOPER_NAME=Mike Penz

android.useAndroidX=true
android.enableJetifier=false
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4G

0 comments on commit 2882eb1

Please sign in to comment.