diff --git a/CHANGES.md b/CHANGES.md index 2b666e88..d1e84259 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,12 +10,13 @@ Improvements: - Improve edit of replies Other changes: - - + - migrate from rxbinding 2 to rxbinding 3 Bugfix: - Fix regression on permalink click - Fix crash reported by the PlayStore (#341) - Fix Chat composer separator color in dark/black theme + - Fix bad layout for room directory filter (#349) Translations: - diff --git a/build.gradle b/build.gradle index 4fa468ab..b52707d5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import javax.tools.JavaCompiler + // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { @@ -52,6 +54,19 @@ allprojects { } } } + + tasks.withType(JavaCompile).all { + options.compilerArgs += [ + '-Adagger.gradle.incremental=enabled' + ] + } + + afterEvaluate { + extensions.findByName("kapt")?.arguments { + arg("dagger.gradle.incremental", "enabled") + } + } + } task clean(type: Delete) { diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/events/model/RelationType.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/events/model/RelationType.kt index 56d4801c..0f5421a0 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/events/model/RelationType.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/events/model/RelationType.kt @@ -17,7 +17,7 @@ package im.vector.matrix.android.api.session.events.model /** - * Constants defining known event relation types from Matrix specifications. + * Constants defining known event relation types from Matrix specifications */ object RelationType { @@ -25,7 +25,7 @@ object RelationType { const val ANNOTATION = "m.annotation" /** Lets you define an event which replaces an existing event.*/ const val REPLACE = "m.replace" - /** ets you define an event which references an existing event.*/ + /** Lets you define an event which references an existing event.*/ const val REFERENCE = "m.reference" } \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationContent.kt index 9bbdf5ab..5f89a482 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationContent.kt @@ -16,7 +16,10 @@ package im.vector.matrix.android.api.session.room.model.relation +import im.vector.matrix.android.api.session.events.model.RelationType + interface RelationContent { + /** See [RelationType] for known possible values */ val type: String? val eventId: String? val inReplyTo: ReplyToContent? diff --git a/vector/build.gradle b/vector/build.gradle index d7332c47..5fdb240a 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -187,8 +187,9 @@ dependencies { implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.0' - // TODO RxBindings3 exists - implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0' + // RXBinding + implementation 'com.jakewharton.rxbinding3:rxbinding:3.0.0-alpha2' + implementation 'com.jakewharton.rxbinding3:rxbinding-appcompat:3.0.0-alpha2' implementation("com.airbnb.android:epoxy:$epoxy_version") kapt "com.airbnb.android:epoxy-processor:$epoxy_version" diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt index 5c91b4bc..53519fc4 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginActivity.kt @@ -22,7 +22,7 @@ import android.os.Bundle import android.widget.Toast import androidx.core.view.isVisible import arrow.core.Try -import com.jakewharton.rxbinding2.widget.RxTextView +import com.jakewharton.rxbinding3.widget.textChanges import im.vector.matrix.android.api.MatrixCallback import im.vector.matrix.android.api.auth.Authenticator import im.vector.matrix.android.api.auth.data.HomeServerConnectionConfig @@ -127,9 +127,9 @@ class LoginActivity : VectorBaseActivity() { private fun setupAuthButton() { Observable .combineLatest( - RxTextView.textChanges(loginField).map { it.trim().isNotEmpty() }, - RxTextView.textChanges(passwordField).map { it.trim().isNotEmpty() }, - RxTextView.textChanges(homeServerField).map { it.trim().isNotEmpty() }, + loginField.textChanges().map { it.trim().isNotEmpty() }, + passwordField.textChanges().map { it.trim().isNotEmpty() }, + homeServerField.textChanges().map { it.trim().isNotEmpty() }, Function3 { isLoginNotEmpty, isPasswordNotEmpty, isHomeServerNotEmpty -> isLoginNotEmpty && isPasswordNotEmpty && isHomeServerNotEmpty } diff --git a/vector/src/main/java/im/vector/riotx/features/roomdirectory/PublicRoomsFragment.kt b/vector/src/main/java/im/vector/riotx/features/roomdirectory/PublicRoomsFragment.kt index 873f8b8b..9888463e 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomdirectory/PublicRoomsFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomdirectory/PublicRoomsFragment.kt @@ -25,14 +25,13 @@ import com.airbnb.epoxy.EpoxyVisibilityTracker import com.airbnb.mvrx.activityViewModel import com.airbnb.mvrx.withState import com.google.android.material.snackbar.Snackbar -import com.jakewharton.rxbinding2.widget.RxTextView +import com.jakewharton.rxbinding3.appcompat.queryTextChanges import im.vector.matrix.android.api.session.room.model.roomdirectory.PublicRoom import im.vector.riotx.R import im.vector.riotx.core.di.ScreenComponent import im.vector.riotx.core.error.ErrorFormatter import im.vector.riotx.core.extensions.observeEvent import im.vector.riotx.core.platform.VectorBaseFragment -import im.vector.riotx.features.themes.ThemeUtils import io.reactivex.rxkotlin.subscribeBy import kotlinx.android.synthetic.main.fragment_public_rooms.* import timber.log.Timber @@ -70,9 +69,7 @@ class PublicRoomsFragment : VectorBaseFragment(), PublicRoomsController.Callback it.setDisplayHomeAsUpEnabled(true) } - publicRoomsFilter.setBackgroundResource(ThemeUtils.getResourceId(requireContext(), R.drawable.bg_search_edit_text_light)) - - RxTextView.textChanges(publicRoomsFilter) + publicRoomsFilter.queryTextChanges() .debounce(500, TimeUnit.MILLISECONDS) .subscribeBy { viewModel.filterWith(it.toString()) diff --git a/vector/src/main/res/drawable/ic_search.xml b/vector/src/main/res/drawable/ic_search.xml new file mode 100644 index 00000000..e2a66c77 --- /dev/null +++ b/vector/src/main/res/drawable/ic_search.xml @@ -0,0 +1,22 @@ + + + + diff --git a/vector/src/main/res/layout/activity_filtered_rooms.xml b/vector/src/main/res/layout/activity_filtered_rooms.xml index 4d3e7036..9cced167 100644 --- a/vector/src/main/res/layout/activity_filtered_rooms.xml +++ b/vector/src/main/res/layout/activity_filtered_rooms.xml @@ -20,10 +20,9 @@ diff --git a/vector/src/main/res/layout/fragment_public_rooms.xml b/vector/src/main/res/layout/fragment_public_rooms.xml index de6fa436..2ba74a75 100644 --- a/vector/src/main/res/layout/fragment_public_rooms.xml +++ b/vector/src/main/res/layout/fragment_public_rooms.xml @@ -33,26 +33,12 @@ app:layout_constraintTop_toTopOf="parent" app:layout_scrollFlags="scroll|exitUntilCollapsed|snap|enterAlways"> - - + android:layout_height="wrap_content" + app:queryHint="@string/room_directory_search_hint" /> diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 06f495a8..aa24261e 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -32,5 +32,7 @@ Send a new direct message View the room directory + Name or ID (#example:matrix.org) + \ No newline at end of file diff --git a/vector/src/main/res/values/styles_riot.xml b/vector/src/main/res/values/styles_riot.xml index 78907193..59d87ec7 100644 --- a/vector/src/main/res/values/styles_riot.xml +++ b/vector/src/main/res/values/styles_riot.xml @@ -160,6 +160,12 @@ @android:color/white + +