mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 03:28:52 +01:00
Migrate to AndroidX
This commit is contained in:
+3
-3
@@ -1,15 +1,16 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.androidx_version = '1.0.0-alpha3'
|
||||
ext.autodispose_version = '0.5.1'
|
||||
ext.constraintlayout_version = '1.1.0-beta5'
|
||||
ext.constraintlayout_version = '1.1.0'
|
||||
ext.dagger_version = "2.16"
|
||||
ext.exoplayer_version = "2.8.1"
|
||||
ext.glide_version = "4.8.0-20180619.011009-9"
|
||||
ext.glide_compiler_version = "4.8.0-20180619.011013-9"
|
||||
ext.kotlin_version = '1.2.31'
|
||||
ext.ktx_version = "0.2"
|
||||
ext.lifecycle_version = '1.1.0'
|
||||
ext.lifecycle_version = '2.0.0-alpha1'
|
||||
ext.mockito_version = '2.18.3'
|
||||
ext.realm_version = '4.3.1'
|
||||
ext.realm_adapters_version = '2.1.0'
|
||||
@@ -18,7 +19,6 @@ buildscript {
|
||||
ext.rxjava_version = '2.1.4'
|
||||
ext.rxkotlin_version = '2.1.0'
|
||||
ext.rx_preferences_version = '2.0.0-RC3'
|
||||
ext.support_version = '28.0.0-alpha1'
|
||||
ext.timber_version = '4.5.1'
|
||||
|
||||
ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2]
|
||||
|
||||
+3
-3
@@ -23,9 +23,9 @@ android {
|
||||
|
||||
dependencies {
|
||||
|
||||
// support
|
||||
implementation "com.android.support:appcompat-v7:$support_version"
|
||||
implementation "com.android.support:exifinterface:$support_version"
|
||||
// androidx
|
||||
implementation "androidx.appcompat:appcompat:$androidx_version"
|
||||
implementation "androidx.exifinterface:exifinterface:$androidx_version"
|
||||
|
||||
// dagger
|
||||
implementation "com.google.dagger:dagger:$dagger_version"
|
||||
|
||||
@@ -22,7 +22,7 @@ import android.Manifest
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager.PERMISSION_GRANTED
|
||||
import android.provider.Telephony
|
||||
import android.support.v4.content.ContextCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import javax.inject.Inject
|
||||
|
||||
class PermissionManagerImpl @Inject constructor(private val context: Context) : PermissionManager {
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.provider.Telephony
|
||||
import android.support.annotation.RequiresApi
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.moez.QKSMS.interactor.SyncMessages
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import dagger.android.AndroidInjection
|
||||
|
||||
@@ -21,7 +21,7 @@ package com.moez.QKSMS.receiver
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.support.v4.app.RemoteInput
|
||||
import androidx.core.app.RemoteInput
|
||||
import com.moez.QKSMS.compat.SubscriptionManagerCompat
|
||||
import com.moez.QKSMS.interactor.MarkRead
|
||||
import com.moez.QKSMS.interactor.SendMessage
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.graphics.Matrix
|
||||
import android.net.Uri
|
||||
import android.provider.MediaStore
|
||||
import android.provider.MediaStore.Images
|
||||
import android.support.media.ExifInterface
|
||||
import androidx.exifinterface.media.ExifInterface
|
||||
import com.moez.QKSMS.util.tryOrNull
|
||||
import javax.inject.Inject
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ package com.moez.QKSMS.model
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.support.v13.view.inputmethod.InputContentInfoCompat
|
||||
import androidx.core.view.inputmethod.InputContentInfoCompat
|
||||
|
||||
data class Attachment(private val uri: Uri? = null, private val inputContent: InputContentInfoCompat? = null) {
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ org.gradle.jvmargs=-Xmx1536m
|
||||
|
||||
# https://blog.gradle.org/introducing-gradle-build-cache
|
||||
org.gradle.caching=true
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
|
||||
+10
-10
@@ -15,7 +15,7 @@ android {
|
||||
targetSdkVersion 28
|
||||
versionCode 174
|
||||
versionName "3.3.3"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
buildConfigField "String", "BUGSNAG_API_KEY", "\"${System.getenv("BUGSNAG_API_KEY")}\""
|
||||
}
|
||||
@@ -84,14 +84,14 @@ configurations {
|
||||
|
||||
dependencies {
|
||||
// lifecycle
|
||||
implementation "android.arch.lifecycle:extensions:$lifecycle_version"
|
||||
implementation "android.arch.lifecycle:common-java8:$lifecycle_version"
|
||||
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
|
||||
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
|
||||
|
||||
// support
|
||||
implementation "com.android.support:appcompat-v7:$support_version"
|
||||
implementation "com.android.support.constraint:constraint-layout:$constraintlayout_version"
|
||||
implementation "com.android.support:design:$support_version"
|
||||
implementation "com.android.support:support-emoji-appcompat:$support_version"
|
||||
// androidx
|
||||
implementation "androidx.appcompat:appcompat:$androidx_version"
|
||||
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
|
||||
implementation "com.google.android.material:material:$androidx_version"
|
||||
implementation "androidx.emoji:emoji-appcompat:$androidx_version"
|
||||
|
||||
// glide
|
||||
implementation "com.github.bumptech.glide:glide:$glide_version"
|
||||
@@ -139,11 +139,11 @@ dependencies {
|
||||
implementation "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
|
||||
|
||||
// testing
|
||||
androidTestImplementation("com.android.support.test.espresso:espresso-core:2.2.2", {
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.1.0-alpha3", {
|
||||
exclude group: "com.android.support", module: "support-annotations"
|
||||
})
|
||||
androidTestImplementation "org.mockito:mockito-android:$mockito_version"
|
||||
testImplementation "com.android.support.test:runner:1.0.1"
|
||||
testImplementation "androidx.test:runner:1.1.0-alpha3"
|
||||
testImplementation "junit:junit:4.12"
|
||||
testImplementation "org.mockito:mockito-core:$mockito_version"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.main
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4
|
||||
import androidx.test.runner.AndroidJUnit4
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ package com.moez.QKSMS.common
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.support.annotation.ArrayRes
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.ArrayRes
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.base.QkAdapter
|
||||
|
||||
@@ -22,9 +22,9 @@ import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.app.Service
|
||||
import android.content.BroadcastReceiver
|
||||
import android.support.text.emoji.EmojiCompat
|
||||
import android.support.text.emoji.FontRequestEmojiCompatConfig
|
||||
import android.support.v4.provider.FontRequest
|
||||
import androidx.emoji.text.EmojiCompat
|
||||
import androidx.emoji.text.FontRequestEmojiCompatConfig
|
||||
import androidx.core.provider.FontRequest
|
||||
import com.akaita.java.rxjava2debug.RxJava2Debug
|
||||
import com.bugsnag.android.Bugsnag
|
||||
import com.bugsnag.android.Configuration
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.moez.QKSMS.common
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.support.annotation.StringRes
|
||||
import android.support.v7.app.AlertDialog
|
||||
import android.support.v7.widget.LinearLayoutManager
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.moez.QKSMS.common.util.extensions.dpToPx
|
||||
import com.moez.QKSMS.common.util.extensions.setPadding
|
||||
import com.moez.QKSMS.injection.appComponent
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.moez.QKSMS.common
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Provider
|
||||
|
||||
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.moez.QKSMS.common.androidxcompat;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import com.uber.autodispose.LifecycleEndedException;
|
||||
import com.uber.autodispose.LifecycleScopeProvider;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.functions.Function;
|
||||
|
||||
/**
|
||||
* A {@link LifecycleScopeProvider} that can provide scoping for Android {@link Lifecycle} and
|
||||
* {@link LifecycleOwner} classes.
|
||||
* <p>
|
||||
* <pre><code>
|
||||
* AutoDispose.autoDisposable(AndroidLifecycleScopeProvider.from(lifecycleOwner))
|
||||
* </code></pre>
|
||||
*/
|
||||
public final class AndroidLifecycleScopeProvider
|
||||
implements LifecycleScopeProvider<Lifecycle.Event> {
|
||||
|
||||
private static final Function<Lifecycle.Event, Lifecycle.Event> DEFAULT_CORRESPONDING_EVENTS =
|
||||
new Function<Lifecycle.Event, Lifecycle.Event>() {
|
||||
@Override public Lifecycle.Event apply(Lifecycle.Event lastEvent) throws Exception {
|
||||
switch (lastEvent) {
|
||||
case ON_CREATE:
|
||||
return Lifecycle.Event.ON_DESTROY;
|
||||
case ON_START:
|
||||
return Lifecycle.Event.ON_STOP;
|
||||
case ON_RESUME:
|
||||
return Lifecycle.Event.ON_PAUSE;
|
||||
case ON_PAUSE:
|
||||
return Lifecycle.Event.ON_STOP;
|
||||
case ON_STOP:
|
||||
case ON_DESTROY:
|
||||
default:
|
||||
throw new LifecycleEndedException("Lifecycle has ended! Last event was " + lastEvent);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private final Function<Lifecycle.Event, Lifecycle.Event> boundaryResolver;
|
||||
|
||||
/**
|
||||
* Creates a {@link AndroidLifecycleScopeProvider} for Android LifecycleOwners.
|
||||
*
|
||||
* @param owner the owner to scope for.
|
||||
* @return a {@link AndroidLifecycleScopeProvider} against this owner.
|
||||
*/
|
||||
public static AndroidLifecycleScopeProvider from(LifecycleOwner owner) {
|
||||
return from(owner.getLifecycle());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link AndroidLifecycleScopeProvider} for Android LifecycleOwners.
|
||||
*
|
||||
* @param owner the owner to scope for.
|
||||
* @param untilEvent the event until the scope is valid.
|
||||
* @return a {@link AndroidLifecycleScopeProvider} against this owner.
|
||||
*/
|
||||
public static AndroidLifecycleScopeProvider from(
|
||||
LifecycleOwner owner,
|
||||
Lifecycle.Event untilEvent) {
|
||||
return from(owner.getLifecycle(), untilEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link AndroidLifecycleScopeProvider} for Android Lifecycles.
|
||||
*
|
||||
* @param lifecycle the lifecycle to scope for.
|
||||
* @return a {@link AndroidLifecycleScopeProvider} against this lifecycle.
|
||||
*/
|
||||
public static AndroidLifecycleScopeProvider from(Lifecycle lifecycle) {
|
||||
return from(lifecycle, DEFAULT_CORRESPONDING_EVENTS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link AndroidLifecycleScopeProvider} for Android Lifecycles.
|
||||
*
|
||||
* @param lifecycle the lifecycle to scope for.
|
||||
* @param untilEvent the event until the scope is valid.
|
||||
* @return a {@link AndroidLifecycleScopeProvider} against this lifecycle.
|
||||
*/
|
||||
public static AndroidLifecycleScopeProvider from(
|
||||
Lifecycle lifecycle,
|
||||
Lifecycle.Event untilEvent) {
|
||||
return from(lifecycle, new UntilEventFunction(untilEvent));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link AndroidLifecycleScopeProvider} for Android Lifecycles.
|
||||
*
|
||||
* @param owner the owner to scope for.
|
||||
* @param boundaryResolver function that resolves the event boundary.
|
||||
* @return a {@link AndroidLifecycleScopeProvider} against this owner.
|
||||
*/
|
||||
public static AndroidLifecycleScopeProvider from(
|
||||
LifecycleOwner owner,
|
||||
Function<Lifecycle.Event, Lifecycle.Event> boundaryResolver) {
|
||||
return from(owner.getLifecycle(), boundaryResolver);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link AndroidLifecycleScopeProvider} for Android Lifecycles.
|
||||
*
|
||||
* @param lifecycle the lifecycle to scope for.
|
||||
* @param boundaryResolver function that resolves the event boundary.
|
||||
* @return a {@link AndroidLifecycleScopeProvider} against this lifecycle.
|
||||
*/
|
||||
public static AndroidLifecycleScopeProvider from(
|
||||
Lifecycle lifecycle,
|
||||
Function<Lifecycle.Event, Lifecycle.Event> boundaryResolver) {
|
||||
return new AndroidLifecycleScopeProvider(lifecycle, boundaryResolver);
|
||||
}
|
||||
|
||||
private final LifecycleEventsObservable lifecycleObservable;
|
||||
|
||||
private AndroidLifecycleScopeProvider(Lifecycle lifecycle,
|
||||
Function<Lifecycle.Event, Lifecycle.Event> boundaryResolver) {
|
||||
this.lifecycleObservable = new LifecycleEventsObservable(lifecycle);
|
||||
this.boundaryResolver = boundaryResolver;
|
||||
}
|
||||
|
||||
@Override public Observable<Lifecycle.Event> lifecycle() {
|
||||
return lifecycleObservable;
|
||||
}
|
||||
|
||||
@Override public Function<Lifecycle.Event, Lifecycle.Event> correspondingEvents() {
|
||||
return boundaryResolver;
|
||||
}
|
||||
|
||||
@Override public Lifecycle.Event peekLifecycle() {
|
||||
lifecycleObservable.backfillEvents();
|
||||
return lifecycleObservable.getValue();
|
||||
}
|
||||
|
||||
private static class UntilEventFunction implements Function<Lifecycle.Event, Lifecycle.Event> {
|
||||
private final Lifecycle.Event untilEvent;
|
||||
|
||||
UntilEventFunction(Lifecycle.Event untilEvent) {
|
||||
this.untilEvent = untilEvent;
|
||||
}
|
||||
|
||||
@Override public Lifecycle.Event apply(Lifecycle.Event event) throws Exception {
|
||||
return untilEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.moez.QKSMS.common.androidxcompat
|
||||
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.uber.autodispose.LifecycleScopeProvider
|
||||
import io.reactivex.annotations.CheckReturnValue
|
||||
import io.reactivex.functions.Function
|
||||
|
||||
/**
|
||||
* Extension that returns a [LifecycleScopeProvider] for this [LifecycleOwner].
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun LifecycleOwner.scope(): LifecycleScopeProvider<*> = AndroidLifecycleScopeProvider.from(this)
|
||||
|
||||
/**
|
||||
* Extension that returns a [LifecycleScopeProvider] for this [LifecycleOwner].
|
||||
*
|
||||
* @param untilEvent the event until the scope is valid.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun LifecycleOwner.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, untilEvent)
|
||||
|
||||
/**
|
||||
* Extension that returns a [LifecycleScopeProvider] for this [LifecycleOwner].
|
||||
*
|
||||
* @param boundaryResolver function that resolves the event boundary.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun LifecycleOwner.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, boundaryResolver)
|
||||
|
||||
/**
|
||||
* Extension that returns a [LifecycleScopeProvider] for this [Lifecycle].
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun Lifecycle.scope(): LifecycleScopeProvider<*> = AndroidLifecycleScopeProvider.from(this)
|
||||
|
||||
/**
|
||||
* Extension that returns a [LifecycleScopeProvider] for this [Lifecycle].
|
||||
*
|
||||
* @param untilEvent the event until the scope is valid.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun Lifecycle.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, untilEvent)
|
||||
|
||||
/**
|
||||
* Extension that returns a [LifecycleScopeProvider] for this [Lifecycle].
|
||||
*
|
||||
* @param boundaryResolver function that resolves the event boundary.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun Lifecycle.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, boundaryResolver)
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.moez.QKSMS.common.androidxcompat;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import com.jakewharton.rxbinding2.InitialValueObservable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.MainThreadDisposable;
|
||||
|
||||
import static com.jakewharton.rxbinding2.internal.Preconditions.checkMainThread;
|
||||
|
||||
final class DrawerLayoutDrawerOpenedObservable extends InitialValueObservable<Boolean> {
|
||||
private final DrawerLayout view;
|
||||
private final int gravity;
|
||||
|
||||
DrawerLayoutDrawerOpenedObservable(DrawerLayout view, int gravity) {
|
||||
this.view = view;
|
||||
this.gravity = gravity;
|
||||
}
|
||||
|
||||
@Override protected void subscribeListener(Observer<? super Boolean> observer) {
|
||||
if (!checkMainThread(observer)) {
|
||||
return;
|
||||
}
|
||||
Listener listener = new Listener(view, gravity, observer);
|
||||
observer.onSubscribe(listener);
|
||||
view.addDrawerListener(listener);
|
||||
}
|
||||
|
||||
@Override protected Boolean getInitialValue() {
|
||||
return view.isDrawerOpen(gravity);
|
||||
}
|
||||
|
||||
static final class Listener extends MainThreadDisposable implements DrawerLayout.DrawerListener {
|
||||
private final DrawerLayout view;
|
||||
private final int gravity;
|
||||
private final Observer<? super Boolean> observer;
|
||||
|
||||
Listener(DrawerLayout view, int gravity, Observer<? super Boolean> observer) {
|
||||
this.view = view;
|
||||
this.gravity = gravity;
|
||||
this.observer = observer;
|
||||
}
|
||||
|
||||
@Override public void onDrawerSlide(View drawerView, float slideOffset) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onDrawerOpened(View drawerView) {
|
||||
if (!isDisposed()) {
|
||||
int drawerGravity = ((DrawerLayout.LayoutParams) drawerView.getLayoutParams()).gravity;
|
||||
if (drawerGravity == gravity) {
|
||||
observer.onNext(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onDrawerClosed(View drawerView) {
|
||||
if (!isDisposed()) {
|
||||
int drawerGravity = ((DrawerLayout.LayoutParams) drawerView.getLayoutParams()).gravity;
|
||||
if (drawerGravity == gravity) {
|
||||
observer.onNext(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onDrawerStateChanged(int newState) {
|
||||
|
||||
}
|
||||
|
||||
@Override protected void onDispose() {
|
||||
view.removeDrawerListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.moez.QKSMS.common.androidxcompat;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.Lifecycle.Event;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.OnLifecycleEvent;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.MainThreadDisposable;
|
||||
import io.reactivex.subjects.BehaviorSubject;
|
||||
|
||||
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_CREATE;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_DESTROY;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_RESUME;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_START;
|
||||
import static com.uber.autodispose.android.internal.AutoDisposeAndroidUtil.isMainThread;
|
||||
|
||||
@RestrictTo(LIBRARY) class LifecycleEventsObservable extends Observable<Event> {
|
||||
|
||||
private final Lifecycle lifecycle;
|
||||
private final BehaviorSubject<Event> eventsObservable = BehaviorSubject.create();
|
||||
|
||||
@SuppressWarnings("CheckReturnValue") LifecycleEventsObservable(Lifecycle lifecycle) {
|
||||
this.lifecycle = lifecycle;
|
||||
}
|
||||
|
||||
Event getValue() {
|
||||
return eventsObservable.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Backfill if already created for boundary checking. We do a trick here for corresponding events
|
||||
* where we pretend something is created upon initialized state so that it assumes the
|
||||
* corresponding event is DESTROY.
|
||||
*/
|
||||
void backfillEvents() {
|
||||
@Nullable Lifecycle.Event correspondingEvent;
|
||||
switch (lifecycle.getCurrentState()) {
|
||||
case INITIALIZED:
|
||||
correspondingEvent = ON_CREATE;
|
||||
break;
|
||||
case CREATED:
|
||||
correspondingEvent = ON_START;
|
||||
break;
|
||||
case STARTED:
|
||||
case RESUMED:
|
||||
correspondingEvent = ON_RESUME;
|
||||
break;
|
||||
case DESTROYED:
|
||||
default:
|
||||
correspondingEvent = ON_DESTROY;
|
||||
break;
|
||||
}
|
||||
eventsObservable.onNext(correspondingEvent);
|
||||
}
|
||||
|
||||
@Override protected void subscribeActual(Observer<? super Event> observer) {
|
||||
ArchLifecycleObserver archObserver =
|
||||
new ArchLifecycleObserver(lifecycle, observer, eventsObservable);
|
||||
observer.onSubscribe(archObserver);
|
||||
if (!isMainThread()) {
|
||||
observer.onError(
|
||||
new IllegalStateException("Lifecycles can only be bound to on the main thread!"));
|
||||
return;
|
||||
}
|
||||
lifecycle.addObserver(archObserver);
|
||||
if (archObserver.isDisposed()) {
|
||||
lifecycle.removeObserver(archObserver);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ArchLifecycleObserver extends MainThreadDisposable
|
||||
implements LifecycleObserver {
|
||||
private final Lifecycle lifecycle;
|
||||
private final Observer<? super Event> observer;
|
||||
private final BehaviorSubject<Event> eventsObservable;
|
||||
|
||||
ArchLifecycleObserver(Lifecycle lifecycle, Observer<? super Event> observer,
|
||||
BehaviorSubject<Event> eventsObservable) {
|
||||
this.lifecycle = lifecycle;
|
||||
this.observer = observer;
|
||||
this.eventsObservable = eventsObservable;
|
||||
}
|
||||
|
||||
@Override protected void onDispose() {
|
||||
lifecycle.removeObserver(this);
|
||||
}
|
||||
|
||||
@OnLifecycleEvent(Event.ON_ANY)
|
||||
void onStateChange(@SuppressWarnings("unused") LifecycleOwner owner, Event event) {
|
||||
if (!isDisposed()) {
|
||||
if (!(event == ON_CREATE && eventsObservable.getValue() == event)) {
|
||||
// Due to the INITIALIZED->ON_CREATE mapping trick we do in backfill(),
|
||||
// we fire this conditionally to avoid duplicate CREATE events.
|
||||
eventsObservable.onNext(event);
|
||||
}
|
||||
observer.onNext(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+228
@@ -0,0 +1,228 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.moez.QKSMS.common.androidxcompat;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import io.realm.OrderedCollectionChangeSet;
|
||||
import io.realm.OrderedRealmCollection;
|
||||
import io.realm.OrderedRealmCollectionChangeListener;
|
||||
import io.realm.RealmList;
|
||||
import io.realm.RealmModel;
|
||||
import io.realm.RealmResults;
|
||||
|
||||
/**
|
||||
* The RealmBaseRecyclerAdapter class is an abstract utility class for binding RecyclerView UI elements to Realm data.
|
||||
* <p>
|
||||
* This adapter will automatically handle any updates to its data and call {@code notifyDataSetChanged()},
|
||||
* {@code notifyItemInserted()}, {@code notifyItemRemoved()} or {@code notifyItemRangeChanged(} as appropriate.
|
||||
* <p>
|
||||
* The RealmAdapter will stop receiving updates if the Realm instance providing the {@link OrderedRealmCollection} is
|
||||
* closed.
|
||||
*
|
||||
* @param <T> type of {@link RealmModel} stored in the adapter.
|
||||
* @param <S> type of RecyclerView.ViewHolder used in the adapter.
|
||||
*/
|
||||
public abstract class RealmRecyclerViewAdapter<T extends RealmModel, S extends RecyclerView.ViewHolder>
|
||||
extends RecyclerView.Adapter<S> {
|
||||
|
||||
private final boolean hasAutoUpdates;
|
||||
private final boolean updateOnModification;
|
||||
private final OrderedRealmCollectionChangeListener listener;
|
||||
@Nullable
|
||||
private OrderedRealmCollection<T> adapterData;
|
||||
|
||||
private OrderedRealmCollectionChangeListener createListener() {
|
||||
return new OrderedRealmCollectionChangeListener() {
|
||||
@Override
|
||||
public void onChange(Object collection, OrderedCollectionChangeSet changeSet) {
|
||||
// null Changes means the async query returns the first time.
|
||||
if (changeSet == null) {
|
||||
notifyDataSetChanged();
|
||||
return;
|
||||
}
|
||||
// For deletions, the adapter has to be notified in reverse order.
|
||||
OrderedCollectionChangeSet.Range[] deletions = changeSet.getDeletionRanges();
|
||||
for (int i = deletions.length - 1; i >= 0; i--) {
|
||||
OrderedCollectionChangeSet.Range range = deletions[i];
|
||||
notifyItemRangeRemoved(range.startIndex, range.length);
|
||||
}
|
||||
|
||||
OrderedCollectionChangeSet.Range[] insertions = changeSet.getInsertionRanges();
|
||||
for (OrderedCollectionChangeSet.Range range : insertions) {
|
||||
notifyItemRangeInserted(range.startIndex, range.length);
|
||||
}
|
||||
|
||||
if (!updateOnModification) {
|
||||
return;
|
||||
}
|
||||
|
||||
OrderedCollectionChangeSet.Range[] modifications = changeSet.getChangeRanges();
|
||||
for (OrderedCollectionChangeSet.Range range : modifications) {
|
||||
notifyItemRangeChanged(range.startIndex, range.length);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* This is equivalent to {@code RealmRecyclerViewAdapter(data, autoUpdate, true)}.
|
||||
*
|
||||
* @see #RealmRecyclerViewAdapter(OrderedRealmCollection, boolean, boolean)
|
||||
*/
|
||||
public RealmRecyclerViewAdapter(@Nullable OrderedRealmCollection<T> data, boolean autoUpdate) {
|
||||
this(data, autoUpdate, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param data collection data to be used by this adapter.
|
||||
* @param autoUpdate when it is {@code false}, the adapter won't be automatically updated when collection data
|
||||
* changes.
|
||||
* @param updateOnModification when it is {@code true}, this adapter will be updated when deletions, insertions or
|
||||
* modifications happen to the collection data. When it is {@code false}, only
|
||||
* deletions and insertions will trigger the updates. This param will be ignored if
|
||||
* {@code autoUpdate} is {@code false}.
|
||||
*/
|
||||
public RealmRecyclerViewAdapter(@Nullable OrderedRealmCollection<T> data, boolean autoUpdate,
|
||||
boolean updateOnModification) {
|
||||
if (data != null && !data.isManaged())
|
||||
throw new IllegalStateException("Only use this adapter with managed RealmCollection, " +
|
||||
"for un-managed lists you can just use the BaseRecyclerViewAdapter");
|
||||
this.adapterData = data;
|
||||
this.hasAutoUpdates = autoUpdate;
|
||||
this.listener = hasAutoUpdates ? createListener() : null;
|
||||
this.updateOnModification = updateOnModification;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(final RecyclerView recyclerView) {
|
||||
super.onAttachedToRecyclerView(recyclerView);
|
||||
if (hasAutoUpdates && isDataValid()) {
|
||||
//noinspection ConstantConditions
|
||||
addListener(adapterData);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromRecyclerView(final RecyclerView recyclerView) {
|
||||
super.onDetachedFromRecyclerView(recyclerView);
|
||||
if (hasAutoUpdates && isDataValid()) {
|
||||
//noinspection ConstantConditions
|
||||
removeListener(adapterData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current ID for an item. Note that item IDs are not stable so you cannot rely on the item ID being the
|
||||
* same after notifyDataSetChanged() or {@link #updateData(OrderedRealmCollection)} has been called.
|
||||
*
|
||||
* @param index position of item in the adapter.
|
||||
* @return current item ID.
|
||||
*/
|
||||
@Override
|
||||
public long getItemId(final int index) {
|
||||
return index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
//noinspection ConstantConditions
|
||||
return isDataValid() ? adapterData.size() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the item associated with the specified position.
|
||||
* Can return {@code null} if provided Realm instance by {@link OrderedRealmCollection} is closed.
|
||||
*
|
||||
* @param index index of the item.
|
||||
* @return the item at the specified position, {@code null} if adapter data is not valid.
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Nullable
|
||||
public T getItem(int index) {
|
||||
//noinspection ConstantConditions
|
||||
return isDataValid() ? adapterData.get(index) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns data associated with this adapter.
|
||||
*
|
||||
* @return adapter data.
|
||||
*/
|
||||
@Nullable
|
||||
public OrderedRealmCollection<T> getData() {
|
||||
return adapterData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the data associated to the Adapter. Useful when the query has been changed.
|
||||
* If the query does not change you might consider using the automaticUpdate feature.
|
||||
*
|
||||
* @param data the new {@link OrderedRealmCollection} to display.
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public void updateData(@Nullable OrderedRealmCollection<T> data) {
|
||||
if (hasAutoUpdates) {
|
||||
if (isDataValid()) {
|
||||
//noinspection ConstantConditions
|
||||
removeListener(adapterData);
|
||||
}
|
||||
if (data != null) {
|
||||
addListener(data);
|
||||
}
|
||||
}
|
||||
|
||||
this.adapterData = data;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void addListener(@NonNull OrderedRealmCollection<T> data) {
|
||||
if (data instanceof RealmResults) {
|
||||
RealmResults<T> results = (RealmResults<T>) data;
|
||||
//noinspection unchecked
|
||||
results.addChangeListener(listener);
|
||||
} else if (data instanceof RealmList) {
|
||||
RealmList<T> list = (RealmList<T>) data;
|
||||
//noinspection unchecked
|
||||
list.addChangeListener(listener);
|
||||
} else {
|
||||
throw new IllegalArgumentException("RealmCollection not supported: " + data.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
private void removeListener(@NonNull OrderedRealmCollection<T> data) {
|
||||
if (data instanceof RealmResults) {
|
||||
RealmResults<T> results = (RealmResults<T>) data;
|
||||
//noinspection unchecked
|
||||
results.removeChangeListener(listener);
|
||||
} else if (data instanceof RealmList) {
|
||||
RealmList<T> list = (RealmList<T>) data;
|
||||
//noinspection unchecked
|
||||
list.removeChangeListener(listener);
|
||||
} else {
|
||||
throw new IllegalArgumentException("RealmCollection not supported: " + data.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDataValid() {
|
||||
return adapterData != null && adapterData.isValid();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.moez.QKSMS.common.androidxcompat;
|
||||
|
||||
import androidx.annotation.CheckResult;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import com.jakewharton.rxbinding2.InitialValueObservable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
|
||||
import static com.jakewharton.rxbinding2.internal.Preconditions.checkNotNull;
|
||||
|
||||
public final class RxDrawerLayout {
|
||||
/**
|
||||
* Create an observable of the open state of the drawer of {@code view}.
|
||||
* <p>
|
||||
* <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe
|
||||
* to free this reference.
|
||||
* <p>
|
||||
* <em>Note:</em> A value will be emitted immediately on subscribe.
|
||||
*/
|
||||
@CheckResult
|
||||
@NonNull
|
||||
public static InitialValueObservable<Boolean> drawerOpen(
|
||||
@NonNull DrawerLayout view, int gravity) {
|
||||
checkNotNull(view, "view == null");
|
||||
return new DrawerLayoutDrawerOpenedObservable(view, gravity);
|
||||
}
|
||||
|
||||
/**
|
||||
* An action which sets whether the drawer with {@code gravity} of {@code view} is open.
|
||||
* <p>
|
||||
* <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe
|
||||
* to free this reference.
|
||||
*/
|
||||
@CheckResult @NonNull public static Consumer<? super Boolean> open(
|
||||
@NonNull final DrawerLayout view, final int gravity) {
|
||||
checkNotNull(view, "view == null");
|
||||
return new Consumer<Boolean>() {
|
||||
@Override public void accept(Boolean aBoolean) {
|
||||
if (aBoolean) {
|
||||
view.openDrawer(gravity);
|
||||
} else {
|
||||
view.closeDrawer(gravity);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private RxDrawerLayout() {
|
||||
throw new AssertionError("No instances.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("NOTHING_TO_INLINE")
|
||||
|
||||
package com.moez.QKSMS.common.androidxcompat
|
||||
|
||||
import androidx.annotation.CheckResult
|
||||
import androidx.drawerlayout.widget.DrawerLayout
|
||||
import com.jakewharton.rxbinding2.InitialValueObservable
|
||||
import io.reactivex.functions.Consumer
|
||||
import kotlin.Int
|
||||
import kotlin.Suppress
|
||||
|
||||
/**
|
||||
* Create an observable of the open state of the drawer of `view`.
|
||||
*
|
||||
* *Warning:* The created observable keeps a strong reference to `view`. Unsubscribe
|
||||
* to free this reference.
|
||||
*
|
||||
* *Note:* A value will be emitted immediately on subscribe.
|
||||
*/
|
||||
@CheckResult
|
||||
inline fun DrawerLayout.drawerOpen(gravity: Int): InitialValueObservable<Boolean> = RxDrawerLayout.drawerOpen(this, gravity)
|
||||
|
||||
/**
|
||||
* An action which sets whether the drawer with `gravity` of `view` is open.
|
||||
*
|
||||
* *Warning:* The created observable keeps a strong reference to `view`. Unsubscribe
|
||||
* to free this reference.
|
||||
*/
|
||||
@CheckResult
|
||||
inline fun DrawerLayout.open(gravity: Int): Consumer<in Boolean> = RxDrawerLayout.open(this, gravity)
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common.base
|
||||
|
||||
import android.support.annotation.CallSuper
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import androidx.annotation.CallSuper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ package com.moez.QKSMS.common.base
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import io.reactivex.subjects.BehaviorSubject
|
||||
import io.reactivex.subjects.Subject
|
||||
import kotlinx.android.synthetic.main.toolbar.*
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common.base
|
||||
|
||||
import android.support.v7.util.DiffUtil
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.moez.QKSMS.common.util.extensions.setVisible
|
||||
import io.reactivex.subjects.BehaviorSubject
|
||||
import io.reactivex.subjects.Subject
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.moez.QKSMS.common.base
|
||||
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.moez.QKSMS.common.androidxcompat.RealmRecyclerViewAdapter
|
||||
import com.moez.QKSMS.common.util.extensions.setVisible
|
||||
import io.reactivex.subjects.BehaviorSubject
|
||||
import io.reactivex.subjects.Subject
|
||||
import io.realm.OrderedRealmCollection
|
||||
import io.realm.RealmList
|
||||
import io.realm.RealmModel
|
||||
import io.realm.RealmRecyclerViewAdapter
|
||||
import io.realm.RealmResults
|
||||
|
||||
abstract class QkRealmAdapter<T : RealmModel> : RealmRecyclerViewAdapter<T, QkViewHolder>(null, true) {
|
||||
|
||||
@@ -20,16 +20,16 @@ package com.moez.QKSMS.common.base
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.ActivityManager
|
||||
import android.arch.lifecycle.Lifecycle
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.util.Colors
|
||||
import com.moez.QKSMS.common.util.extensions.resolveThemeColor
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.rxkotlin.Observables
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common.base
|
||||
|
||||
import android.arch.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
|
||||
interface QkView<in State> : LifecycleOwner {
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common.base
|
||||
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
class QkViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common.base
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import android.support.annotation.CallSuper
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import androidx.annotation.CallSuper
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.moez.QKSMS.common.util
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Typeface
|
||||
import android.support.v4.content.res.ResourcesCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import com.moez.QKSMS.R
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common.util
|
||||
|
||||
import android.arch.lifecycle.LiveData
|
||||
import androidx.lifecycle.LiveData
|
||||
import io.realm.RealmChangeListener
|
||||
import io.realm.RealmModel
|
||||
import io.realm.RealmResults
|
||||
|
||||
@@ -28,10 +28,10 @@ import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.support.v4.app.NotificationCompat
|
||||
import android.support.v4.app.NotificationManagerCompat
|
||||
import android.support.v4.app.RemoteInput
|
||||
import android.support.v4.app.TaskStackBuilder
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import androidx.core.app.RemoteInput
|
||||
import androidx.core.app.TaskStackBuilder
|
||||
import android.telephony.PhoneNumberUtils
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.util.extensions.dpToPx
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common.util.extensions
|
||||
|
||||
import android.support.v7.widget.LinearLayoutManager
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
fun RecyclerView.Adapter<*>.autoScrollToStart(recyclerView: RecyclerView) {
|
||||
registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ package com.moez.QKSMS.common.util.extensions
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.support.annotation.StringRes
|
||||
import android.support.v4.content.ContextCompat
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.content.ContextCompat
|
||||
import android.util.TypedValue
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Toast
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.PorterDuff
|
||||
import android.os.Build
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -31,6 +30,7 @@ import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
var ViewGroup.animateLayoutChanges: Boolean
|
||||
get() = layoutTransition != null
|
||||
|
||||
@@ -20,9 +20,9 @@ package com.moez.QKSMS.common.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.support.constraint.ConstraintLayout
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.model.Recipient
|
||||
import kotlinx.android.synthetic.main.group_avatar_view.view.*
|
||||
|
||||
@@ -20,11 +20,11 @@ package com.moez.QKSMS.common.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.support.v4.view.ViewPager
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.util.Colors
|
||||
import com.moez.QKSMS.common.util.extensions.forEach
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.moez.QKSMS.common.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v7.widget.LinearLayoutCompat
|
||||
import androidx.appcompat.widget.LinearLayoutCompat
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
|
||||
@@ -20,9 +20,9 @@ package com.moez.QKSMS.common.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.support.v13.view.inputmethod.EditorInfoCompat
|
||||
import android.support.v13.view.inputmethod.InputConnectionCompat
|
||||
import android.support.v13.view.inputmethod.InputContentInfoCompat
|
||||
import androidx.core.view.inputmethod.EditorInfoCompat
|
||||
import androidx.core.view.inputmethod.InputConnectionCompat
|
||||
import androidx.core.view.inputmethod.InputContentInfoCompat
|
||||
import android.util.AttributeSet
|
||||
import android.view.KeyEvent
|
||||
import android.view.inputmethod.EditorInfo
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.moez.QKSMS.common.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.support.v7.widget.SwitchCompat
|
||||
import androidx.appcompat.widget.SwitchCompat
|
||||
import android.util.AttributeSet
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.util.Colors
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.moez.QKSMS.common.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.support.text.emoji.widget.EmojiAppCompatTextView
|
||||
import androidx.emoji.widget.EmojiAppCompatTextView
|
||||
import android.util.AttributeSet
|
||||
import com.moez.QKSMS.common.util.TextViewStyler
|
||||
import com.moez.QKSMS.injection.appComponent
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package com.moez.QKSMS.feature.blocked
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.os.Bundle
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.R
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.blocked
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
@@ -20,12 +20,12 @@ package com.moez.QKSMS.feature.blocked
|
||||
|
||||
import android.content.Context
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.interactor.MarkUnblocked
|
||||
import com.moez.QKSMS.repository.ConversationRepository
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import com.moez.QKSMS.util.tryOrNull
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
import io.reactivex.rxkotlin.withLatestFrom
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
package com.moez.QKSMS.feature.compose
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.R
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.moez.QKSMS.feature.compose
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
||||
@@ -20,8 +20,8 @@ package com.moez.QKSMS.feature.compose
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Activity
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.content.ContentValues
|
||||
import android.content.Intent
|
||||
import android.graphics.PorterDuff
|
||||
@@ -29,15 +29,16 @@ import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.MediaStore
|
||||
import android.support.v4.app.ActivityCompat
|
||||
import android.support.v7.app.AlertDialog
|
||||
import android.support.v7.widget.LinearLayoutManager
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.jakewharton.rxbinding2.widget.textChanges
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkThemedActivity
|
||||
import com.moez.QKSMS.common.util.extensions.autoScrollToStart
|
||||
import com.moez.QKSMS.common.util.extensions.resolveThemeColor
|
||||
@@ -49,7 +50,6 @@ import com.moez.QKSMS.common.util.extensions.showKeyboard
|
||||
import com.moez.QKSMS.model.Attachment
|
||||
import com.moez.QKSMS.model.Contact
|
||||
import com.moez.QKSMS.model.Message
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import dagger.android.AndroidInjection
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.compose
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.moez.QKSMS.feature.compose
|
||||
|
||||
import android.net.Uri
|
||||
import android.support.v13.view.inputmethod.InputContentInfoCompat
|
||||
import androidx.core.view.inputmethod.InputContentInfoCompat
|
||||
import com.moez.QKSMS.common.base.QkView
|
||||
import com.moez.QKSMS.model.Attachment
|
||||
import com.moez.QKSMS.model.Contact
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.telephony.SmsMessage
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.common.util.ClipboardUtils
|
||||
import com.moez.QKSMS.common.util.MessageDetailsFormatter
|
||||
@@ -52,7 +53,6 @@ import com.moez.QKSMS.repository.ConversationRepository
|
||||
import com.moez.QKSMS.repository.MessageRepository
|
||||
import com.moez.QKSMS.util.ActiveSubscriptionObservable
|
||||
import com.moez.QKSMS.util.tryOrNull
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
|
||||
@@ -21,7 +21,7 @@ package com.moez.QKSMS.feature.compose
|
||||
import android.app.Activity
|
||||
import android.graphics.Rect
|
||||
import android.os.Build
|
||||
import android.support.annotation.RequiresApi
|
||||
import androidx.annotation.RequiresApi
|
||||
import android.view.ActionMode
|
||||
import android.view.KeyEvent
|
||||
import android.view.Menu
|
||||
|
||||
@@ -21,7 +21,6 @@ package com.moez.QKSMS.feature.compose
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.graphics.Typeface
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.telephony.PhoneNumberUtils
|
||||
import android.text.Spannable
|
||||
import android.text.SpannableStringBuilder
|
||||
@@ -31,6 +30,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
|
||||
+4
-4
@@ -18,14 +18,15 @@
|
||||
*/
|
||||
package com.moez.QKSMS.feature.conversationinfo
|
||||
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.os.Bundle
|
||||
import android.support.v7.app.AlertDialog
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import android.text.InputFilter
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkThemedActivity
|
||||
import com.moez.QKSMS.common.util.extensions.animateLayoutChanges
|
||||
import com.moez.QKSMS.common.util.extensions.dpToPx
|
||||
@@ -33,7 +34,6 @@ import com.moez.QKSMS.common.util.extensions.resolveThemeColor
|
||||
import com.moez.QKSMS.common.util.extensions.scrapViews
|
||||
import com.moez.QKSMS.common.util.extensions.setVisible
|
||||
import com.moez.QKSMS.common.widget.QkEditText
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import dagger.android.AndroidInjection
|
||||
import io.reactivex.subjects.PublishSubject
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.conversationinfo
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
+1
-1
@@ -19,6 +19,7 @@
|
||||
package com.moez.QKSMS.feature.conversationinfo
|
||||
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.extensions.asObservable
|
||||
import com.moez.QKSMS.interactor.DeleteConversations
|
||||
@@ -29,7 +30,6 @@ import com.moez.QKSMS.interactor.MarkUnblocked
|
||||
import com.moez.QKSMS.model.Conversation
|
||||
import com.moez.QKSMS.repository.ConversationRepository
|
||||
import com.moez.QKSMS.repository.MessageRepository
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
import io.reactivex.rxkotlin.withLatestFrom
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
package com.moez.QKSMS.feature.conversationinfo
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.moez.QKSMS.feature.conversationinfo
|
||||
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.moez.QKSMS.R
|
||||
|
||||
+1
-1
@@ -20,8 +20,8 @@ package com.moez.QKSMS.feature.conversationinfo
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Rect
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.moez.QKSMS.common.util.extensions.dpToPx
|
||||
import javax.inject.Inject
|
||||
|
||||
|
||||
+2
-2
@@ -22,9 +22,9 @@ import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.support.v7.widget.helper.ItemTouchHelper
|
||||
import androidx.graphics.drawable.toBitmap
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.util.extensions.dpToPx
|
||||
import io.reactivex.subjects.PublishSubject
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
package com.moez.QKSMS.feature.gallery
|
||||
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.transition.ChangeBounds
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.gallery
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import android.content.Intent
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
|
||||
@@ -21,13 +21,13 @@ package com.moez.QKSMS.feature.gallery
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.common.util.extensions.makeToast
|
||||
import com.moez.QKSMS.extensions.mapNotNull
|
||||
import com.moez.QKSMS.interactor.SaveImage
|
||||
import com.moez.QKSMS.repository.ConversationRepository
|
||||
import com.moez.QKSMS.repository.MessageRepository
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
|
||||
@@ -20,24 +20,25 @@ package com.moez.QKSMS.feature.main
|
||||
|
||||
import android.Manifest
|
||||
import android.app.AlertDialog
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import android.content.res.ColorStateList
|
||||
import android.os.Bundle
|
||||
import android.support.design.widget.Snackbar
|
||||
import android.support.v4.app.ActivityCompat
|
||||
import android.support.v7.app.ActionBarDrawerToggle
|
||||
import android.support.v7.widget.LinearLayoutManager
|
||||
import android.support.v7.widget.helper.ItemTouchHelper
|
||||
import android.view.Gravity
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import com.jakewharton.rxbinding2.support.v4.widget.drawerOpen
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.jakewharton.rxbinding2.widget.textChanges
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.drawerOpen
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkThemedActivity
|
||||
import com.moez.QKSMS.common.util.extensions.autoScrollToStart
|
||||
import com.moez.QKSMS.common.util.extensions.dismissKeyboard
|
||||
@@ -49,7 +50,6 @@ import com.moez.QKSMS.common.util.extensions.setVisible
|
||||
import com.moez.QKSMS.feature.conversations.ConversationItemTouchCallback
|
||||
import com.moez.QKSMS.feature.conversations.ConversationsAdapter
|
||||
import com.moez.QKSMS.repository.SyncRepository
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import dagger.android.AndroidInjection
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.main
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
@@ -20,6 +20,7 @@ package com.moez.QKSMS.feature.main
|
||||
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.extensions.removeAccents
|
||||
import com.moez.QKSMS.interactor.DeleteConversations
|
||||
@@ -37,7 +38,6 @@ import com.moez.QKSMS.model.SyncLog
|
||||
import com.moez.QKSMS.repository.ConversationRepository
|
||||
import com.moez.QKSMS.repository.MessageRepository
|
||||
import com.moez.QKSMS.repository.SyncRepository
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@
|
||||
package com.moez.QKSMS.feature.notificationprefs
|
||||
|
||||
import android.app.Activity
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.content.Intent
|
||||
import android.media.RingtoneManager
|
||||
import android.net.Uri
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.notificationprefs
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import android.content.Intent
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
|
||||
+1
-1
@@ -25,11 +25,11 @@ import android.net.Uri
|
||||
import com.f2prateek.rx.preferences2.Preference
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.extensions.mapNotNull
|
||||
import com.moez.QKSMS.repository.ConversationRepository
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
package com.moez.QKSMS.feature.plus
|
||||
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.graphics.Typeface
|
||||
import android.os.Bundle
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.plus
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package com.moez.QKSMS.feature.plus
|
||||
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.common.util.BillingManager
|
||||
import com.moez.QKSMS.manager.AnalyticsManager
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
*/
|
||||
package com.moez.QKSMS.feature.qkreply
|
||||
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.support.v7.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.ViewGroup
|
||||
@@ -31,6 +31,7 @@ import android.view.WindowManager
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.jakewharton.rxbinding2.widget.textChanges
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkThemedActivity
|
||||
import com.moez.QKSMS.common.util.extensions.autoScrollToStart
|
||||
import com.moez.QKSMS.common.util.extensions.resolveThemeColor
|
||||
@@ -38,7 +39,6 @@ import com.moez.QKSMS.common.util.extensions.setBackgroundTint
|
||||
import com.moez.QKSMS.common.util.extensions.setTint
|
||||
import com.moez.QKSMS.common.util.extensions.setVisible
|
||||
import com.moez.QKSMS.feature.compose.MessagesAdapter
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import dagger.android.AndroidInjection
|
||||
import io.reactivex.subjects.PublishSubject
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.qkreply
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
@@ -21,6 +21,7 @@ package com.moez.QKSMS.feature.qkreply
|
||||
import android.telephony.SmsMessage
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.compat.SubscriptionManagerCompat
|
||||
import com.moez.QKSMS.extensions.asObservable
|
||||
@@ -32,7 +33,6 @@ import com.moez.QKSMS.model.Message
|
||||
import com.moez.QKSMS.repository.ConversationRepository
|
||||
import com.moez.QKSMS.repository.MessageRepository
|
||||
import com.moez.QKSMS.util.ActiveSubscriptionObservable
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.rxkotlin.Observables
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
|
||||
@@ -20,22 +20,22 @@ package com.moez.QKSMS.feature.settings
|
||||
|
||||
import android.app.ProgressDialog
|
||||
import android.app.TimePickerDialog
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.os.Bundle
|
||||
import android.support.design.widget.Snackbar
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import android.text.format.DateFormat
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.BuildConfig
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.QkDialog
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkThemedActivity
|
||||
import com.moez.QKSMS.common.util.extensions.animateLayoutChanges
|
||||
import com.moez.QKSMS.common.util.extensions.setBackgroundTint
|
||||
import com.moez.QKSMS.common.util.extensions.setVisible
|
||||
import com.moez.QKSMS.common.widget.PreferenceView
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import dagger.android.AndroidInjection
|
||||
import io.reactivex.subjects.PublishSubject
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.settings
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
@@ -21,6 +21,7 @@ package com.moez.QKSMS.feature.settings
|
||||
import android.content.Context
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.common.util.BillingManager
|
||||
import com.moez.QKSMS.common.util.Colors
|
||||
@@ -28,7 +29,6 @@ import com.moez.QKSMS.common.util.DateFormatter
|
||||
import com.moez.QKSMS.interactor.SyncMessages
|
||||
import com.moez.QKSMS.util.NightModeManager
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
import io.reactivex.rxkotlin.withLatestFrom
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.moez.QKSMS.feature.settings.about
|
||||
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import android.os.Bundle
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.BuildConfig
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.settings.about
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.moez.QKSMS.feature.settings.about
|
||||
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import javax.inject.Inject
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ package com.moez.QKSMS.feature.themepicker
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.support.constraint.ConstraintLayout
|
||||
import android.util.AttributeSet
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.util.extensions.setBackgroundTint
|
||||
import com.moez.QKSMS.common.util.extensions.setTint
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
package com.moez.QKSMS.feature.themepicker
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v4.view.PagerAdapter
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.viewpager.widget.PagerAdapter
|
||||
import com.moez.QKSMS.R
|
||||
import javax.inject.Inject
|
||||
|
||||
|
||||
+4
-4
@@ -18,11 +18,11 @@
|
||||
*/
|
||||
package com.moez.QKSMS.feature.themepicker
|
||||
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import android.arch.lifecycle.ViewModelProviders
|
||||
import android.os.Bundle
|
||||
import android.support.design.widget.Snackbar
|
||||
import android.support.v7.widget.LinearLayoutManager
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.jakewharton.rxbinding2.view.clicks
|
||||
import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.base.QkThemedActivity
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.feature.themepicker
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.moez.QKSMS.injection.ViewModelKey
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
||||
+1
-1
@@ -20,11 +20,11 @@ package com.moez.QKSMS.feature.themepicker
|
||||
|
||||
import com.f2prateek.rx.preferences2.Preference
|
||||
import com.moez.QKSMS.common.Navigator
|
||||
import com.moez.QKSMS.common.androidxcompat.scope
|
||||
import com.moez.QKSMS.common.base.QkViewModel
|
||||
import com.moez.QKSMS.common.util.BillingManager
|
||||
import com.moez.QKSMS.common.util.Colors
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import com.uber.autodispose.android.lifecycle.scope
|
||||
import com.uber.autodispose.kotlin.autoDisposable
|
||||
import io.reactivex.rxkotlin.Observables
|
||||
import io.reactivex.rxkotlin.withLatestFrom
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.moez.QKSMS.injection
|
||||
|
||||
import android.app.Application
|
||||
import android.arch.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.preference.PreferenceManager
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.moez.QKSMS.injection
|
||||
|
||||
import android.arch.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModel
|
||||
import dagger.MapKey
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -33,7 +33,7 @@
|
||||
style="@style/ToolbarText"
|
||||
tools:text="@string/about_title" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
@@ -116,4 +116,4 @@
|
||||
android:background="?android:attr/divider"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
@@ -43,7 +43,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar" />
|
||||
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -70,18 +70,18 @@
|
||||
android:layout_height="1dp"
|
||||
android:background="?android:attr/divider" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/conversations"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/blocked_list_item" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v4.widget.NestedScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -91,4 +91,4 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
@@ -26,7 +26,7 @@
|
||||
android:background="?attr/composeBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/messageList"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
@@ -67,7 +67,7 @@
|
||||
tools:progress="45"
|
||||
tools:progressTint="@color/tools_theme" />
|
||||
|
||||
<android.support.constraint.Group
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/sendAsGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -128,7 +128,7 @@
|
||||
android:background="@drawable/ab_shadow"
|
||||
app:layout_constraintTop_toBottomOf="@id/sendAsGroupBackground" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/contacts"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
@@ -137,7 +137,7 @@
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -145,7 +145,7 @@
|
||||
tools:listitem="@layout/contact_list_item"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<android.support.constraint.Group
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/composeBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -173,7 +173,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/attachments" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/attachments"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -185,7 +185,7 @@
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="8dp"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@id/message"
|
||||
app:layout_constraintEnd_toEndOf="@id/messageBackground"
|
||||
app:layout_constraintStart_toStartOf="@id/messageBackground"
|
||||
@@ -318,7 +318,7 @@
|
||||
tools:backgroundTint="@color/tools_theme"
|
||||
tools:tint="@color/textPrimaryDark" />
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:layout_width="0dp"
|
||||
@@ -348,7 +348,7 @@
|
||||
app:textSize="secondary"
|
||||
tools:text="3 of 9 results" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/chips"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -358,7 +358,7 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -372,4 +372,4 @@
|
||||
android:background="?android:attr/divider"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
@@ -30,7 +30,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
@@ -45,13 +45,13 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recipients"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:layout_height="72dp"
|
||||
tools:listitem="@layout/conversation_recipient_list_item" />
|
||||
|
||||
@@ -111,18 +111,18 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="?android:attr/divider" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/media"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false"
|
||||
app:layoutManager="android.support.v7.widget.GridLayoutManager"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="3"
|
||||
tools:listitem="@layout/conversation_media_list_item" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v4.widget.NestedScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -138,4 +138,4 @@
|
||||
android:background="?android:attr/divider"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
@@ -79,4 +79,4 @@
|
||||
app:layout_constraintHorizontal_bias="100"
|
||||
tools:text="Oct 11" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
@@ -69,4 +69,4 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -141,7 +141,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/rateLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -218,6 +218,6 @@
|
||||
app:textColor="secondary"
|
||||
app:textSize="secondary" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -35,7 +35,7 @@
|
||||
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="match_parent"
|
||||
android:layout_height="56dp"
|
||||
@@ -55,6 +55,6 @@
|
||||
app:textSize="toolbar"
|
||||
tools:text="Conversations" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -17,19 +17,19 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<android.support.v4.widget.DrawerLayout android:id="@+id/drawerLayout"
|
||||
<androidx.drawerlayout.widget.DrawerLayout android:id="@+id/drawerLayout"
|
||||
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.constraint.ConstraintLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:animateLayoutChanges="true"
|
||||
@@ -51,7 +51,7 @@
|
||||
app:textSize="primary"
|
||||
tools:textSize="16sp" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<com.moez.QKSMS.common.widget.QkTextView
|
||||
android:id="@+id/empty"
|
||||
@@ -66,7 +66,7 @@
|
||||
tools:text="Your conversations will appear here"
|
||||
tools:visibility="invisible" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
@@ -78,7 +78,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar"
|
||||
tools:listitem="@layout/conversation_list_item" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/compose"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -107,14 +107,14 @@
|
||||
android:background="?android:attr/divider"
|
||||
app:layout_constraintBottom_toTopOf="@id/bottomDivider" />
|
||||
|
||||
<android.support.constraint.Barrier
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/bottomDivider"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="top"
|
||||
app:constraint_referenced_ids="snackbarTitle, snackbarMessage, syncingLabel, syncingProgress" />
|
||||
|
||||
<android.support.constraint.Group
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/snackbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -122,7 +122,7 @@
|
||||
app:constraint_referenced_ids="snackbarTitle, snackbarMessage, snackbarButton"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<android.support.constraint.Group
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/syncing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -199,7 +199,7 @@
|
||||
android:indeterminate="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/drawer"
|
||||
@@ -208,4 +208,4 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
@@ -61,7 +61,7 @@
|
||||
app:textSize="tertiary"
|
||||
tools:text="1" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/attachments"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -69,7 +69,7 @@
|
||||
android:layout_marginStart="12dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
@@ -125,4 +125,4 @@
|
||||
app:textSize="tertiary"
|
||||
tools:text="Sending..." />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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"
|
||||
@@ -61,7 +61,7 @@
|
||||
app:textSize="tertiary"
|
||||
tools:text="1" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/attachments"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -71,7 +71,7 @@
|
||||
android:gravity="end"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
@@ -149,4 +149,4 @@
|
||||
app:textSize="tertiary"
|
||||
tools:text="Sending..." />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,7 +17,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<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="wrap_content"
|
||||
@@ -69,4 +69,4 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/name"
|
||||
app:textSize="secondary" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user