Merge branch 'feature/androidx' into develop

This commit is contained in:
ganfra 2019-01-17 15:09:03 +01:00
commit 312103a511
61 changed files with 175 additions and 197 deletions

View File

@ -19,7 +19,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
@ -46,18 +46,18 @@ configurations.all { strategy ->
dependencies {
def epoxy_version = "2.19.0"
def arrow_version = "0.8.0"
def epoxy_version = "3.0.0"
def arrow_version = "0.8.2"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":matrix-sdk-android")
implementation project(":matrix-sdk-android-rx")
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// Paging
implementation "android.arch.paging:runtime:1.0.1"
implementation 'androidx.paging:paging-runtime:2.0.0'
implementation 'com.jakewharton.threetenabp:threetenabp:1.1.1'
implementation 'com.jakewharton.timber:timber:4.7.1'
@ -69,7 +69,7 @@ dependencies {
implementation("com.airbnb.android:epoxy:$epoxy_version")
kapt "com.airbnb.android:epoxy-processor:$epoxy_version"
implementation 'com.airbnb.android:mvrx:0.6.0'
implementation 'com.airbnb.android:mvrx:0.7.0'
// FP
implementation "io.arrow-kt:arrow-core:$arrow_version"
@ -85,8 +85,8 @@ dependencies {
// TESTS
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

View File

@ -1,7 +1,7 @@
package im.vector.riotredesign
import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4
import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith

View File

@ -1,7 +1,7 @@
package im.vector.riotredesign.core.epoxy
import android.support.annotation.IdRes
import android.support.annotation.LayoutRes
import androidx.annotation.IdRes
import androidx.annotation.LayoutRes
import android.view.View
import com.airbnb.epoxy.EpoxyModel
import kotlin.properties.ReadOnlyProperty

View File

@ -1,7 +1,7 @@
package im.vector.riotredesign.core.extensions
import android.support.v4.app.Fragment
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
fun AppCompatActivity.addFragment(fragment: Fragment, frameId: Int) {
supportFragmentManager.inTransaction { add(frameId, fragment) }

View File

@ -1,27 +1,27 @@
package im.vector.riotredesign.core.extensions
import android.support.v4.app.Fragment
import androidx.fragment.app.Fragment
fun Fragment.addFragment(fragment: Fragment, frameId: Int) {
fun androidx.fragment.app.Fragment.addFragment(fragment: Fragment, frameId: Int) {
fragmentManager?.inTransaction { add(frameId, fragment) }
}
fun Fragment.replaceFragment(fragment: Fragment, frameId: Int) {
fun androidx.fragment.app.Fragment.replaceFragment(fragment: Fragment, frameId: Int) {
fragmentManager?.inTransaction { replace(frameId, fragment) }
}
fun Fragment.addFragmentToBackstack(fragment: Fragment, frameId: Int, tag: String? = null) {
fun androidx.fragment.app.Fragment.addFragmentToBackstack(fragment: Fragment, frameId: Int, tag: String? = null) {
fragmentManager?.inTransaction { replace(frameId, fragment).addToBackStack(tag) }
}
fun Fragment.addChildFragment(fragment: Fragment, frameId: Int) {
fun androidx.fragment.app.Fragment.addChildFragment(fragment: Fragment, frameId: Int) {
childFragmentManager.inTransaction { add(frameId, fragment) }
}
fun Fragment.replaceChildFragment(fragment: Fragment, frameId: Int) {
fun androidx.fragment.app.Fragment.replaceChildFragment(fragment: Fragment, frameId: Int) {
childFragmentManager.inTransaction { replace(frameId, fragment) }
}
fun Fragment.addChildFragmentToBackstack(fragment: Fragment, frameId: Int, tag: String? = null) {
fun androidx.fragment.app.Fragment.addChildFragmentToBackstack(fragment: Fragment, frameId: Int, tag: String? = null) {
childFragmentManager.inTransaction { replace(frameId, fragment).addToBackStack(tag) }
}

View File

@ -1,8 +1,7 @@
package im.vector.riotredesign.core.extensions
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentTransaction
import androidx.fragment.app.FragmentTransaction
inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) {
inline fun androidx.fragment.app.FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) {
beginTransaction().func().commit()
}

View File

@ -1,8 +1,8 @@
package im.vector.riotredesign.core.extensions
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.Observer
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import im.vector.riotredesign.core.utils.LiveEvent
import im.vector.riotredesign.core.utils.EventObserver

View File

@ -1,6 +1,6 @@
package im.vector.riotredesign.core.platform
import android.support.v7.util.ListUpdateCallback
import androidx.recyclerview.widget.ListUpdateCallback
interface DefaultListUpdateCallback : ListUpdateCallback {

View File

@ -1,6 +1,6 @@
package im.vector.riotredesign.core.platform
import android.support.v7.widget.Toolbar
import androidx.appcompat.widget.Toolbar
interface ToolbarConfigurable {

View File

@ -1,7 +1,7 @@
package im.vector.riotredesign.core.resources
import android.content.res.Resources
import android.support.v4.os.ConfigurationCompat
import androidx.core.os.ConfigurationCompat
import java.util.*
class LocaleProvider(private val resources: Resources) {

View File

@ -1,6 +1,6 @@
package im.vector.riotredesign.core.utils
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
open class LiveEvent<out T>(private val content: T) {

View File

@ -1,6 +1,6 @@
package im.vector.riotredesign.features.home
import android.support.v4.content.ContextCompat
import androidx.core.content.ContextCompat
import android.widget.ImageView
import com.amulyakhare.textdrawable.TextDrawable
import com.bumptech.glide.request.RequestOptions

View File

@ -3,12 +3,12 @@ package im.vector.riotredesign.features.home
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v4.app.FragmentManager
import android.support.v4.view.GravityCompat
import android.support.v7.app.ActionBarDrawerToggle
import android.support.v7.widget.Toolbar
import android.view.Gravity
import android.view.MenuItem
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.widget.Toolbar
import androidx.core.view.GravityCompat
import androidx.fragment.app.FragmentManager
import com.airbnb.mvrx.viewModel
import im.vector.riotredesign.R
import im.vector.riotredesign.core.extensions.observeEvent

View File

@ -1,10 +1,10 @@
package im.vector.riotredesign.features.home
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.MutableLiveData
import android.support.v4.app.FragmentActivity
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import im.vector.matrix.android.api.Matrix
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.rx.rx
@ -21,12 +21,12 @@ class HomeActivityViewModel(state: EmptyState,
roomSelectionRepository: RoomSelectionRepository
) : RiotViewModel<EmptyState>(state) {
companion object : MvRxViewModelFactory<EmptyState> {
companion object : MvRxViewModelFactory<HomeActivityViewModel, EmptyState> {
@JvmStatic
override fun create(activity: FragmentActivity, state: EmptyState): HomeActivityViewModel {
override fun create(viewModelContext: ViewModelContext, state: EmptyState): HomeActivityViewModel? {
val session = Matrix.getInstance().currentSession
val roomSelectionRepository = activity.get<RoomSelectionRepository>()
val roomSelectionRepository = viewModelContext.activity.get<RoomSelectionRepository>()
return HomeActivityViewModel(state, session, roomSelectionRepository)
}
}

View File

@ -1,7 +1,7 @@
package im.vector.riotredesign.features.home
import android.support.v4.app.FragmentManager
import android.view.Gravity
import androidx.fragment.app.FragmentManager
import im.vector.riotredesign.R
import im.vector.riotredesign.core.extensions.addFragmentToBackstack
import im.vector.riotredesign.core.extensions.replaceFragment

View File

@ -1,8 +1,7 @@
package im.vector.riotredesign.features.home.group
import android.support.v4.app.FragmentActivity
import com.airbnb.mvrx.BaseMvRxViewModel
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import im.vector.matrix.android.api.Matrix
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.rx.rx
@ -14,12 +13,12 @@ class GroupListViewModel(initialState: GroupListViewState,
private val session: Session
) : RiotViewModel<GroupListViewState>(initialState) {
companion object : MvRxViewModelFactory<GroupListViewState> {
companion object : MvRxViewModelFactory<GroupListViewModel, GroupListViewState> {
@JvmStatic
override fun create(activity: FragmentActivity, state: GroupListViewState): GroupListViewModel {
override fun create(viewModelContext: ViewModelContext, state: GroupListViewState): GroupListViewModel? {
val currentSession = Matrix.getInstance().currentSession
val selectedGroupHolder = activity.get<SelectedGroupHolder>()
val selectedGroupHolder = viewModelContext.activity.get<SelectedGroupHolder>()
return GroupListViewModel(state, selectedGroupHolder, currentSession)
}
}

View File

@ -2,10 +2,11 @@ package im.vector.riotredesign.features.home.room.detail
import android.os.Bundle
import android.os.Parcelable
import android.support.v7.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.args
import com.airbnb.mvrx.fragmentViewModel
@ -69,7 +70,7 @@ class RoomDetailFragment : RiotFragment(), TimelineEventController.Callback {
}
private fun setupRecyclerView() {
val layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, true)
val layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, true)
scrollOnNewMessageCallback = ScrollOnNewMessageCallback(layoutManager)
recyclerView.layoutManager = layoutManager
recyclerView.setHasFixedSize(true)

View File

@ -1,7 +1,7 @@
package im.vector.riotredesign.features.home.room.detail
import android.support.v4.app.FragmentActivity
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import im.vector.matrix.android.api.Matrix
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.session.Session
@ -20,12 +20,12 @@ class RoomDetailViewModel(initialState: RoomDetailViewState,
private val roomId = initialState.roomId
private val eventId = initialState.eventId
companion object : MvRxViewModelFactory<RoomDetailViewState> {
companion object : MvRxViewModelFactory<RoomDetailViewModel, RoomDetailViewState> {
@JvmStatic
override fun create(activity: FragmentActivity, state: RoomDetailViewState): RoomDetailViewModel {
override fun create(viewModelContext: ViewModelContext, state: RoomDetailViewState): RoomDetailViewModel? {
val currentSession = Matrix.getInstance().currentSession
val visibleRoomHolder = activity.get<VisibleRoomHolder>()
val visibleRoomHolder = viewModelContext.activity.get<VisibleRoomHolder>()
return RoomDetailViewModel(state, currentSession, visibleRoomHolder)
}
}

View File

@ -1,6 +1,6 @@
package im.vector.riotredesign.features.home.room.detail
import android.support.v7.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import im.vector.riotredesign.core.platform.DefaultListUpdateCallback
import java.util.concurrent.atomic.AtomicBoolean

View File

@ -16,9 +16,9 @@
package im.vector.riotredesign.features.home.room.detail.timeline.paging
import android.arch.paging.PagedList
import androidx.paging.PagedList
import android.os.Handler
import android.support.v7.util.DiffUtil
import androidx.recyclerview.widget.DiffUtil
import com.airbnb.epoxy.EpoxyController
import com.airbnb.epoxy.EpoxyModel
import com.airbnb.epoxy.EpoxyViewHolder

View File

@ -17,14 +17,12 @@
package im.vector.riotredesign.features.home.room.detail.timeline.paging
import android.annotation.SuppressLint
import android.arch.paging.AsyncPagedListDiffer
import android.arch.paging.PagedList
import android.os.Handler
import android.support.v7.recyclerview.extensions.AsyncDifferConfig
import android.support.v7.util.DiffUtil
import android.support.v7.util.ListUpdateCallback
import android.util.Log
import com.airbnb.epoxy.EpoxyController
import androidx.paging.AsyncPagedListDiffer
import androidx.paging.PagedList
import androidx.recyclerview.widget.AsyncDifferConfig
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListUpdateCallback
import com.airbnb.epoxy.EpoxyModel
import java.util.concurrent.Executor
import java.util.concurrent.atomic.AtomicBoolean
@ -79,8 +77,8 @@ class PagedListModelCache<T>(
}
}
private val asyncDiffer = @SuppressLint("RestrictedApi")
object : AsyncPagedListDiffer<T>(
@SuppressLint("RestrictedApi")
private val asyncDiffer = AsyncPagedListDiffer<T>(
updateCallback,
AsyncDifferConfig.Builder<T>(
itemDiffCallback
@ -94,27 +92,7 @@ class PagedListModelCache<T>(
modelBuildingHandler.post(runnable)
}
}.build()
) {
init {
if (modelBuildingHandler != EpoxyController.defaultModelBuildingHandler) {
try {
// looks like AsyncPagedListDiffer in 1.x ignores the config.
// Reflection to the rescue.
val mainThreadExecutorField =
AsyncPagedListDiffer::class.java.getDeclaredField("mMainThreadExecutor")
mainThreadExecutorField.isAccessible = true
mainThreadExecutorField.set(this, Executor {
modelBuildingHandler.post(it)
})
} catch (t: Throwable) {
val msg = "Failed to hijack update handler in AsyncPagedListDiffer." +
"You can only build models on the main thread"
Log.e("PagedListModelCache", msg, t)
throw IllegalStateException(msg, t)
}
}
}
}
)
fun submitList(pagedList: PagedList<T>?) {
asyncDiffer.submitList(pagedList)

View File

@ -1,6 +1,6 @@
package im.vector.riotredesign.features.home.room.list
import android.support.v4.content.ContextCompat
import androidx.core.content.ContextCompat
import android.view.ViewGroup
import android.widget.TextView
import im.vector.riotredesign.R

View File

@ -1,8 +1,8 @@
package im.vector.riotredesign.features.home.room.list
import android.support.v4.app.FragmentActivity
import arrow.core.Option
import com.airbnb.mvrx.MvRxViewModelFactory
import com.airbnb.mvrx.ViewModelContext
import im.vector.matrix.android.api.Matrix
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.group.model.GroupSummary
@ -23,14 +23,14 @@ class RoomListViewModel(initialState: RoomListViewState,
private val roomSelectionRepository: RoomSelectionRepository)
: RiotViewModel<RoomListViewState>(initialState) {
companion object : MvRxViewModelFactory<RoomListViewState> {
companion object : MvRxViewModelFactory<RoomListViewModel, RoomListViewState> {
@JvmStatic
override fun create(activity: FragmentActivity, state: RoomListViewState): RoomListViewModel {
override fun create(viewModelContext: ViewModelContext, state: RoomListViewState): RoomListViewModel? {
val currentSession = Matrix.getInstance().currentSession
val roomSelectionRepository = activity.get<RoomSelectionRepository>()
val selectedGroupHolder = activity.get<SelectedGroupHolder>()
val visibleRoomHolder = activity.get<VisibleRoomHolder>()
val roomSelectionRepository = viewModelContext.activity.get<RoomSelectionRepository>()
val selectedGroupHolder = viewModelContext.activity.get<SelectedGroupHolder>()
val visibleRoomHolder = viewModelContext.activity.get<VisibleRoomHolder>()
return RoomListViewModel(state, currentSession, selectedGroupHolder, visibleRoomHolder, roomSelectionRepository)
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
@ -18,4 +18,4 @@
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>

View File

@ -1,4 +1,4 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -67,5 +67,5 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/stateView"
android:layout_width="match_parent"
@ -19,4 +19,4 @@
app:layout_constraintStart_toEndOf="@+id/groupListFragmentContainer"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -26,4 +26,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/animatedLogoImageView" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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="match_parent">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
@ -17,7 +17,7 @@
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -65,9 +65,9 @@
tools:text="@tools:sample/date/day_of_week" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
<com.airbnb.epoxy.EpoxyRecyclerView
android:id="@+id/recyclerView"
@ -122,4 +122,4 @@
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -44,4 +44,4 @@
</im.vector.riotredesign.core.platform.StateView>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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"
@ -49,4 +49,4 @@
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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"
@ -62,4 +62,4 @@
tools:text="Alright finished work, heading there in about 20 mins…Ping me when youre outside" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -14,7 +14,7 @@
android:clickable="true"
android:focusable="true">
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:duplicateParentState="true"
@ -44,6 +44,6 @@
app:layout_constraintTop_toTopOf="parent"
tools:text="@tools:sample/full_names" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</im.vector.riotredesign.core.platform.CheckableFrameLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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:id="@+id/roomCategoryRootView"
@ -44,4 +44,4 @@
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.0'
ext.kotlin_version = '1.3.11'
ext.koin_version = '1.0.2'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "com.airbnb.okreplay:gradle-plugin:1.4.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

View File

@ -6,6 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit

View File

@ -1,6 +1,6 @@
#Fri Sep 28 19:08:12 CEST 2018
#Wed Jan 16 18:28:13 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

View File

@ -13,7 +13,7 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -35,15 +35,14 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":matrix-sdk-android")
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
// Paging
implementation "android.arch.paging:runtime:1.0.1"
implementation 'androidx.paging:paging-runtime:2.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

View File

@ -1,8 +1,8 @@
package im.vector.matrix.rx;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -1,7 +1,7 @@
package im.vector.matrix.rx
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.Observer
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.reactivex.Observable
import io.reactivex.android.MainThreadDisposable

View File

@ -10,7 +10,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:5.7.0"
classpath "io.realm:realm-gradle-plugin:5.8.0"
}
}
@ -28,7 +28,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -47,9 +47,9 @@ android {
dependencies {
def arrow_version = "0.8.0"
def support_version = '28.0.0'
def support_version = '1.1.0-alpha01'
def moshi_version = '1.8.0'
def lifecycle_version = "1.1.1"
def lifecycle_version = '2.0.0'
def coroutines_version = "1.0.1"
implementation fileTree(dir: 'libs', include: ['*.aar'])
@ -57,11 +57,11 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:recyclerview-v7:$support_version"
implementation "androidx.appcompat:appcompat:$support_version"
implementation "androidx.recyclerview:recyclerview:$support_version"
implementation "android.arch.lifecycle:extensions:$lifecycle_version"
kapt "android.arch.lifecycle:compiler:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
// Network
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
@ -77,10 +77,10 @@ dependencies {
kapt 'dk.ilios:realmfieldnameshelper:1.1.1'
// Paging
implementation "android.arch.paging:runtime:1.0.1"
implementation 'androidx.paging:paging-runtime:2.0.0'
// Work
implementation "android.arch.work:work-runtime-ktx:1.0.0-alpha13"
implementation "android.arch.work:work-runtime-ktx:1.0.0-beta02"
// FP
implementation "io.arrow-kt:arrow-core:$arrow_version"
@ -106,16 +106,16 @@ dependencies {
testImplementation 'org.robolectric:shadows-support-v4:3.0'
testImplementation "io.mockk:mockk:1.8.13.kotlin13"
testImplementation 'org.amshove.kluent:kluent-android:1.44'
testImplementation "android.arch.core:core-testing:$lifecycle_version"
testImplementation "androidx.arch.core:core-testing:$lifecycle_version"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
androidTestImplementation "org.koin:koin-test:$koin_version"
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation "com.android.support.test:rules:1.0.2"
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'org.amshove.kluent:kluent-android:1.44'
androidTestImplementation "io.mockk:mockk-android:1.8.13.kotlin13"
androidTestImplementation "android.arch.core:core-testing:$lifecycle_version"
androidTestImplementation "androidx.arch.core:core-testing:$lifecycle_version"
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"

View File

@ -1,7 +1,7 @@
package im.vector.matrix.android
import android.content.Context
import android.support.test.InstrumentationRegistry
import androidx.test.InstrumentationRegistry
import java.io.File
interface InstrumentedTest {

View File

@ -1,9 +1,9 @@
package im.vector.matrix.android;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.Observer;
import android.support.annotation.Nullable;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -1,8 +1,8 @@
package im.vector.matrix.android.auth
import android.support.test.annotation.UiThreadTest
import android.support.test.rule.GrantPermissionRule
import android.support.test.runner.AndroidJUnit4
import androidx.test.annotation.UiThreadTest
import androidx.test.rule.GrantPermissionRule
import androidx.test.runner.AndroidJUnit4
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.OkReplayRuleChainNoActivity

View File

@ -1,7 +1,7 @@
package im.vector.matrix.android.session.room.timeline
import android.arch.core.executor.testing.InstantTaskExecutorRule
import android.support.test.annotation.UiThreadTest
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.test.annotation.UiThreadTest
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.InstrumentedTest
import im.vector.matrix.android.LiveDataTestObserver

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.api
import android.arch.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.ProcessLifecycleOwner
import android.content.Context
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.api.auth.Authenticator

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.api.session
import android.support.annotation.MainThread
import androidx.annotation.MainThread
import im.vector.matrix.android.api.auth.data.SessionParams
import im.vector.matrix.android.api.session.group.GroupService
import im.vector.matrix.android.api.session.room.RoomService

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.api.session.group
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
import im.vector.matrix.android.api.session.group.model.GroupSummary
interface GroupService {

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.api.session.room
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
import im.vector.matrix.android.api.session.room.model.MyMembership
import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.matrix.android.api.session.room.timeline.TimelineService

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.api.session.room
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
import im.vector.matrix.android.api.session.room.model.RoomSummary
interface RoomService {

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.api.session.room.timeline
import android.arch.paging.PagedList
import androidx.paging.PagedList
import im.vector.matrix.android.api.session.events.model.TimelineEvent
data class TimelineData(

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.api.session.room.timeline
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
interface TimelineService {

View File

@ -1,7 +1,7 @@
package im.vector.matrix.android.internal.database
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.Observer
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import com.zhuinden.monarchy.Monarchy
import io.realm.RealmObject
import java.util.concurrent.atomic.AtomicBoolean

View File

@ -1,8 +1,8 @@
package im.vector.matrix.android.internal.session
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
import android.os.Looper
import android.support.annotation.MainThread
import androidx.annotation.MainThread
import im.vector.matrix.android.api.auth.data.SessionParams
import im.vector.matrix.android.api.session.Session
import im.vector.matrix.android.api.session.group.Group

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.internal.session.group
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.api.session.group.Group
import im.vector.matrix.android.api.session.group.GroupService

View File

@ -1,7 +1,7 @@
package im.vector.matrix.android.internal.session.room
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.Transformations
import androidx.lifecycle.LiveData
import androidx.lifecycle.Transformations
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.session.events.model.Event

View File

@ -1,6 +1,6 @@
package im.vector.matrix.android.internal.session.room
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.api.session.room.Room
import im.vector.matrix.android.api.session.room.RoomService

View File

@ -1,8 +1,8 @@
package im.vector.matrix.android.internal.session.room.timeline
import android.arch.lifecycle.LiveData
import android.arch.paging.LivePagedListBuilder
import android.arch.paging.PagedList
import androidx.lifecycle.LiveData
import androidx.paging.LivePagedListBuilder
import androidx.paging.PagedList
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.api.session.events.interceptor.TimelineEventInterceptor
import im.vector.matrix.android.api.session.events.model.TimelineEvent

View File

@ -1,7 +1,7 @@
package im.vector.matrix.android.internal.session.room.timeline
import android.arch.lifecycle.LiveData
import android.arch.paging.PagedList
import androidx.lifecycle.LiveData
import androidx.paging.PagedList
import com.zhuinden.monarchy.Monarchy
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.session.events.model.TimelineEvent

View File

@ -1,8 +1,8 @@
package im.vector.matrix.android.internal.util
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.OnLifecycleEvent
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import timber.log.Timber
/**

View File

@ -1,7 +1,7 @@
package im.vector.matrix.android.internal.util
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.MediatorLiveData
import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
object LiveDataUtils {

View File

@ -16,11 +16,11 @@
*/
package im.vector.matrix.android.internal.util;
import android.support.annotation.AnyThread;
import android.support.annotation.GuardedBy;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import androidx.annotation.AnyThread;
import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import java.util.Arrays;
import java.util.concurrent.CopyOnWriteArrayList;
@ -28,8 +28,8 @@ import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* A helper class for {@link android.arch.paging.PagedList.BoundaryCallback BoundaryCallback}s and
* {@link android.arch.paging.DataSource}s to help with tracking network requests.
* A helper class for {@link androidx.paging.PagedList.BoundaryCallback BoundaryCallback}s and
* {@link androidx.paging.DataSource}s to help with tracking network requests.
* <p>
* It is designed to support 3 types of requests, {@link RequestType#INITIAL INITIAL},
* {@link RequestType#BEFORE BEFORE} and {@link RequestType#AFTER AFTER} and runs only 1 request
@ -493,20 +493,20 @@ public class PagingRequestHelper {
*/
public enum RequestType {
/**
* Corresponds to an initial request made to a {@link android.arch.paging.DataSource} or the empty state for
* a {@link android.arch.paging.PagedList.BoundaryCallback BoundaryCallback}.
* Corresponds to an initial request made to a {@link androidx.paging.DataSource} or the empty state for
* a {@link androidx.paging.PagedList.BoundaryCallback BoundaryCallback}.
*/
INITIAL,
/**
* Corresponds to the {@code loadBefore} calls in {@link android.arch.paging.DataSource} or
* Corresponds to the {@code loadBefore} calls in {@link androidx.paging.DataSource} or
* {@code onItemAtFrontLoaded} in
* {@link android.arch.paging.PagedList.BoundaryCallback BoundaryCallback}.
* {@link androidx.paging.PagedList.BoundaryCallback BoundaryCallback}.
*/
BEFORE,
/**
* Corresponds to the {@code loadAfter} calls in {@link android.arch.paging.DataSource} or
* Corresponds to the {@code loadAfter} calls in {@link androidx.paging.DataSource} or
* {@code onItemAtEndLoaded} in
* {@link android.arch.paging.PagedList.BoundaryCallback BoundaryCallback}.
* {@link androidx.paging.PagedList.BoundaryCallback BoundaryCallback}.
*/
AFTER
}