Upgrade to AndroidX, move to MaterialComponents theme (#953)

* upgrade to AndroidX, upgrade libraries

* move to MaterialComponents theme

* make sure the compose button looks good everywhere

* fix tollbar title/button alignment on tablet

* move to new material color theming, consolidate colors and themes

* fix build, fix imports

* set error on TextInputLayout instead of EditText

* fix imports, TootButton when

* improve snackbar style

* fix task description color
This commit is contained in:
Konrad Pozniak 2018-12-17 15:25:35 +01:00 committed by GitHub
parent 1c34d21a23
commit a445c12094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
179 changed files with 862 additions and 866 deletions

View file

@ -20,7 +20,7 @@ android {
targetSdkVersion 28 targetSdkVersion 28
versionCode 52 versionCode 52
versionName "4.1" versionName "4.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
buildTypes { buildTypes {
@ -58,46 +58,44 @@ android {
} }
} }
ext.supportLibraryVersion = '28.0.0'
ext.daggerVersion = '2.19' ext.daggerVersion = '2.19'
// if libraries are changed here, they should also be changed in LicenseActivity // if libraries are changed here, they should also be changed in LicenseActivity
dependencies { dependencies {
implementation('com.mikepenz:materialdrawer:6.0.9@aar') { implementation('com.mikepenz:materialdrawer:6.1.1@aar') {
transitive = true transitive = true
} }
implementation "com.android.support:appcompat-v7:$supportLibraryVersion" implementation 'androidx.appcompat:appcompat:1.0.2'
implementation "com.android.support:customtabs:$supportLibraryVersion" implementation 'androidx.browser:browser:1.0.0'
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion" implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation "com.android.support:support-v13:$supportLibraryVersion" implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation "com.android.support:design:$supportLibraryVersion" implementation 'com.google.android.material:material:1.1.0-alpha01'
implementation "com.android.support:exifinterface:$supportLibraryVersion" implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation "com.android.support:cardview-v7:$supportLibraryVersion" implementation 'androidx.cardview:cardview:1.0.0'
implementation "com.android.support:preference-v7:$supportLibraryVersion" implementation 'androidx.preference:preference:1.1.0-alpha01'
implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0' implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.github.connyduck:sparkbutton:1.0.1' implementation 'com.github.connyduck:sparkbutton:2.0.0'
implementation 'com.github.chrisbanes:PhotoView:2.1.4' implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar' implementation 'com.mikepenz:google-material-typeface:3.0.1.3.original@aar'
implementation('com.theartofdev.edmodo:android-image-cropper:2.7.0') { implementation('com.theartofdev.edmodo:android-image-cropper:2.8.0') {
exclude group: 'com.android.support' exclude group: 'com.android.support'
} }
implementation 'com.evernote:android-job:1.2.6' implementation 'com.evernote:android-job:1.2.6'
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// EmojiCompat // EmojiCompat
implementation "com.android.support:support-emoji:$supportLibraryVersion" implementation 'androidx.emoji:emoji:1.0.0'
implementation "com.android.support:support-emoji-appcompat:$supportLibraryVersion" implementation 'androidx.emoji:emoji-appcompat:1.0.0'
implementation 'de.c1710:filemojicompat:1.0.14' implementation 'de.c1710:filemojicompat:1.0.14'
// architecture components // architecture components
implementation 'android.arch.lifecycle:extensions:1.1.1' implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
//room //room
implementation 'android.arch.persistence.room:runtime:1.1.1' implementation 'androidx.room:room-runtime:2.0.0'
kapt 'android.arch.persistence.room:compiler:1.1.1' kapt 'androidx.room:room-compiler:2.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
implementation "com.google.dagger:dagger:$daggerVersion" implementation "com.google.dagger:dagger:$daggerVersion"
@ -107,14 +105,14 @@ dependencies {
kapt "com.google.dagger:dagger-android-processor:$daggerVersion" kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
testImplementation 'org.robolectric:robolectric:4.0.2' testImplementation 'org.robolectric:robolectric:4.0.2'
testImplementation 'org.mockito:mockito-inline:2.23.0' testImplementation 'org.mockito:mockito-inline:2.23.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
debugImplementation 'im.dino:dbinspector:3.4.1@aar' debugImplementation 'im.dino:dbinspector:3.4.1@aar'
implementation 'io.reactivex.rxjava2:rxjava:2.2.3' implementation 'io.reactivex.rxjava2:rxjava:2.2.4'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0' implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.0.0-RC3' implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.0.0'
implementation 'com.uber.autodispose:autodispose-ktx:1.0.0-RC3' implementation 'com.uber.autodispose:autodispose-ktx:1.0.0'
} }

View file

@ -1,8 +1,8 @@
package com.keylesspalace.tusky; package com.keylesspalace.tusky;
import android.content.Context; import android.content.Context;
import android.support.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4; import androidx.test.runner.AndroidJUnit4;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View file

@ -131,7 +131,7 @@
<service android:name=".service.SendTootService" /> <service android:name=".service.SendTootService" />
<provider <provider
android:name="android.support.v4.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider" android:authorities="${applicationId}.fileprovider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">

View file

@ -2,7 +2,7 @@ package com.keylesspalace.tusky
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.support.annotation.StringRes import androidx.annotation.StringRes
import android.text.SpannableString import android.text.SpannableString
import android.text.SpannableStringBuilder import android.text.SpannableStringBuilder
import android.text.method.LinkMovementMethod import android.text.method.LinkMovementMethod

View file

@ -16,28 +16,31 @@
package com.keylesspalace.tusky package com.keylesspalace.tusky
import android.animation.ArgbEvaluator import android.animation.ArgbEvaluator
import android.arch.lifecycle.Observer import androidx.lifecycle.Observer
import android.arch.lifecycle.ViewModelProviders import androidx.lifecycle.ViewModelProviders
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.os.Bundle import android.os.Bundle
import android.preference.PreferenceManager import android.preference.PreferenceManager
import android.support.annotation.AttrRes import androidx.annotation.AttrRes
import android.support.annotation.ColorInt import androidx.annotation.ColorInt
import android.support.annotation.Px import androidx.annotation.Px
import android.support.design.widget.* import androidx.emoji.text.EmojiCompat
import android.support.text.emoji.EmojiCompat import androidx.core.app.ActivityOptionsCompat
import android.support.v4.app.ActivityOptionsCompat import androidx.fragment.app.Fragment
import android.support.v4.app.Fragment import androidx.core.content.ContextCompat
import android.support.v4.content.ContextCompat import androidx.appcompat.app.AlertDialog
import android.support.v7.app.AlertDialog import androidx.recyclerview.widget.LinearLayoutManager
import android.support.v7.widget.LinearLayoutManager
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.appbar.CollapsingToolbarLayout
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.android.material.snackbar.Snackbar
import com.keylesspalace.tusky.adapter.AccountFieldAdapter import com.keylesspalace.tusky.adapter.AccountFieldAdapter
import com.keylesspalace.tusky.di.ViewModelFactory import com.keylesspalace.tusky.di.ViewModelFactory
import com.keylesspalace.tusky.entity.Account import com.keylesspalace.tusky.entity.Account
@ -59,7 +62,7 @@ import javax.inject.Inject
class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportFragmentInjector, LinkListener { class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportFragmentInjector, LinkListener {
@Inject @Inject
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Fragment> lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<androidx.fragment.app.Fragment>
@Inject @Inject
lateinit var viewModelFactory: ViewModelFactory lateinit var viewModelFactory: ViewModelFactory

View file

@ -18,12 +18,12 @@ package com.keylesspalace.tusky;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import com.keylesspalace.tusky.fragment.AccountListFragment; import com.keylesspalace.tusky.fragment.AccountListFragment;

View file

@ -15,22 +15,22 @@
package com.keylesspalace.tusky; package com.keylesspalace.tusky;
import android.app.ActivityManager;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.util.Log; import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.Menu; import android.view.Menu;
import android.view.View; import android.view.View;
import com.google.android.material.snackbar.Snackbar;
import com.keylesspalace.tusky.db.AccountEntity; import com.keylesspalace.tusky.db.AccountEntity;
import com.keylesspalace.tusky.db.AccountManager; import com.keylesspalace.tusky.db.AccountManager;
import com.keylesspalace.tusky.di.Injectable; import com.keylesspalace.tusky.di.Injectable;
@ -41,6 +41,9 @@ import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AppCompatActivity;
import retrofit2.Call; import retrofit2.Call;
public abstract class BaseActivity extends AppCompatActivity implements Injectable { public abstract class BaseActivity extends AppCompatActivity implements Injectable {
@ -68,6 +71,13 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
} }
ThemeUtils.setAppNightMode(theme, this); ThemeUtils.setAppNightMode(theme, this);
/* set the taskdescription programmatically, the theme would turn it blue */
String appName = getString(R.string.app_name);
Bitmap appIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
int recentsBackgroundColor = ThemeUtils.getColor(this, R.attr.recents_background_color);
setTaskDescription(new ActivityManager.TaskDescription(appName, appIcon, recentsBackgroundColor));
long accountId = getIntent().getLongExtra("account", -1); long accountId = getIntent().getLongExtra("account", -1);
if (accountId != -1) { if (accountId != -1) {
accountManager.setActiveAccount(accountId); accountManager.setActiveAccount(accountId);
@ -76,11 +86,17 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
int style = textStyle(preferences.getString("statusTextSize", "medium")); int style = textStyle(preferences.getString("statusTextSize", "medium"));
getTheme().applyStyle(style, false); getTheme().applyStyle(style, false);
if(requiresLogin()) {
redirectIfNotLoggedIn(); redirectIfNotLoggedIn();
}
callList = new ArrayList<>(); callList = new ArrayList<>();
} }
protected boolean requiresLogin() {
return true;
}
private int textStyle(String name) { private int textStyle(String name) {
int style; int style;
switch (name) { switch (name) {

View file

@ -17,8 +17,8 @@ package com.keylesspalace.tusky
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.support.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting
import android.support.design.widget.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetBehavior
import android.view.View import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import com.keylesspalace.tusky.entity.SearchResults import com.keylesspalace.tusky.entity.SearchResults

View file

@ -18,7 +18,7 @@ package com.keylesspalace.tusky;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.arch.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
@ -39,25 +39,25 @@ import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.annotation.ColorInt; import androidx.annotation.ColorInt;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.annotation.Px; import androidx.annotation.Px;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import android.support.design.widget.BottomSheetBehavior; import com.google.android.material.bottomsheet.BottomSheetBehavior;
import android.support.design.widget.Snackbar; import com.google.android.material.snackbar.Snackbar;
import android.support.transition.TransitionManager; import androidx.transition.TransitionManager;
import android.support.v13.view.inputmethod.InputConnectionCompat; import androidx.core.view.inputmethod.InputConnectionCompat;
import android.support.v13.view.inputmethod.InputContentInfoCompat; import androidx.core.view.inputmethod.InputContentInfoCompat;
import android.support.v4.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.support.v4.content.FileProvider; import androidx.core.content.FileProvider;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.support.v7.content.res.AppCompatResources; import androidx.appcompat.content.res.AppCompatResources;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.text.Editable; import android.text.Editable;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.InputType; import android.text.InputType;
@ -692,7 +692,7 @@ public final class ComposeActivity
color = ContextCompat.getColor(this, R.color.compose_media_visible_button_disabled_blue); color = ContextCompat.getColor(this, R.color.compose_media_visible_button_disabled_blue);
} else { } else {
hideMediaToggle.setClickable(true); hideMediaToggle.setClickable(true);
color = ContextCompat.getColor(this, R.color.primary); color = ContextCompat.getColor(this, R.color.tusky_blue);
} }
} else { } else {
hideMediaToggle.setClickable(true); hideMediaToggle.setClickable(true);
@ -1452,7 +1452,7 @@ public final class ComposeActivity
if (show) { if (show) {
statusMarkSensitive = true; statusMarkSensitive = true;
contentWarningBar.setVisibility(View.VISIBLE); contentWarningBar.setVisibility(View.VISIBLE);
contentWarningButton.setTextColor(ContextCompat.getColor(this, R.color.primary)); contentWarningButton.setTextColor(ContextCompat.getColor(this, R.color.tusky_blue));
contentWarningEditor.setSelection(contentWarningEditor.getText().length()); contentWarningEditor.setSelection(contentWarningEditor.getText().length());
contentWarningEditor.requestFocus(); contentWarningEditor.requestFocus();
} else { } else {

View file

@ -17,19 +17,19 @@ package com.keylesspalace.tusky
import android.Manifest import android.Manifest
import android.app.Activity import android.app.Activity
import android.arch.lifecycle.LiveData import androidx.lifecycle.LiveData
import android.arch.lifecycle.Observer import androidx.lifecycle.Observer
import android.arch.lifecycle.ViewModelProviders import androidx.lifecycle.ViewModelProviders
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.Color import android.graphics.Color
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.support.design.widget.Snackbar import com.google.android.material.snackbar.Snackbar
import android.support.v4.app.ActivityCompat import androidx.core.app.ActivityCompat
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import android.support.v7.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View

View file

@ -1,14 +1,14 @@
package com.keylesspalace.tusky; package com.keylesspalace.tusky;
import android.app.AlarmManager; import android.app.AlarmManager;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.support.v7.preference.Preference; import androidx.preference.Preference;
import android.support.v7.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;

View file

@ -16,11 +16,11 @@
package com.keylesspalace.tusky; package com.keylesspalace.tusky;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import com.keylesspalace.tusky.fragment.TimelineFragment; import com.keylesspalace.tusky.fragment.TimelineFragment;

View file

@ -16,7 +16,7 @@
package com.keylesspalace.tusky package com.keylesspalace.tusky
import android.os.Bundle import android.os.Bundle
import android.support.annotation.RawRes import androidx.annotation.RawRes
import android.util.Log import android.util.Log
import android.view.MenuItem import android.view.MenuItem
import android.widget.TextView import android.widget.TextView

View file

@ -3,10 +3,10 @@ package com.keylesspalace.tusky
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.support.v7.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import android.support.v7.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.support.v7.widget.Toolbar import androidx.appcompat.widget.Toolbar
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View

View file

@ -22,16 +22,13 @@ import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.preference.PreferenceManager import androidx.browser.customtabs.CustomTabsIntent
import android.support.customtabs.CustomTabsIntent
import android.support.v7.app.AppCompatActivity
import android.text.method.LinkMovementMethod import android.text.method.LinkMovementMethod
import android.util.Log import android.util.Log
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import android.widget.EditText import android.widget.EditText
import android.widget.TextView import android.widget.TextView
import com.keylesspalace.tusky.db.AccountManager
import com.keylesspalace.tusky.di.Injectable import com.keylesspalace.tusky.di.Injectable
import com.keylesspalace.tusky.entity.AccessToken import com.keylesspalace.tusky.entity.AccessToken
import com.keylesspalace.tusky.entity.AppCredentials import com.keylesspalace.tusky.entity.AppCredentials
@ -46,12 +43,10 @@ import retrofit2.Response
import javax.inject.Inject import javax.inject.Inject
class LoginActivity : AppCompatActivity(), Injectable { class LoginActivity : BaseActivity(), Injectable {
@Inject @Inject
lateinit var mastodonApi: MastodonApi lateinit var mastodonApi: MastodonApi
@Inject
lateinit var accountManager: AccountManager
private lateinit var preferences: SharedPreferences private lateinit var preferences: SharedPreferences
private var domain: String = "" private var domain: String = ""
@ -68,13 +63,6 @@ class LoginActivity : AppCompatActivity(), Injectable {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
preferences = PreferenceManager.getDefaultSharedPreferences(this)
val theme = preferences.getString("appTheme", ThemeUtils.APP_THEME_DEFAULT)
if (theme == "black") {
setTheme(R.style.TuskyBlackTheme)
}
ThemeUtils.setAppNightMode(theme, this)
setContentView(R.layout.activity_login) setContentView(R.layout.activity_login)
if (savedInstanceState != null) { if (savedInstanceState != null) {
@ -107,6 +95,10 @@ class LoginActivity : AppCompatActivity(), Injectable {
} }
override fun requiresLogin(): Boolean {
return false
}
override fun finish() { override fun finish() {
super.finish() super.finish()
if(isAdditionalLogin()) { if(isAdditionalLogin()) {
@ -144,7 +136,7 @@ class LoginActivity : AppCompatActivity(), Injectable {
HttpUrl.Builder().host(domain).scheme("https").build() HttpUrl.Builder().host(domain).scheme("https").build()
} catch (e: IllegalArgumentException) { } catch (e: IllegalArgumentException) {
setLoading(false) setLoading(false)
domainEditText.error = getString(R.string.error_invalid_domain) domainTextInputLayout.error = getString(R.string.error_invalid_domain)
return return
} }
@ -153,7 +145,7 @@ class LoginActivity : AppCompatActivity(), Injectable {
response: Response<AppCredentials>) { response: Response<AppCredentials>) {
if (!response.isSuccessful) { if (!response.isSuccessful) {
loginButton.isEnabled = true loginButton.isEnabled = true
domainEditText.error = getString(R.string.error_failed_app_registration) domainTextInputLayout.error = getString(R.string.error_failed_app_registration)
setLoading(false) setLoading(false)
Log.e(TAG, "App authentication failed. " + response.message()) Log.e(TAG, "App authentication failed. " + response.message())
return return
@ -167,7 +159,7 @@ class LoginActivity : AppCompatActivity(), Injectable {
override fun onFailure(call: Call<AppCredentials>, t: Throwable) { override fun onFailure(call: Call<AppCredentials>, t: Throwable) {
loginButton.isEnabled = true loginButton.isEnabled = true
domainEditText.error = getString(R.string.error_failed_app_registration) domainTextInputLayout.error = getString(R.string.error_failed_app_registration)
setLoading(false) setLoading(false)
Log.e(TAG, Log.getStackTraceString(t)) Log.e(TAG, Log.getStackTraceString(t))
} }
@ -243,7 +235,7 @@ class LoginActivity : AppCompatActivity(), Injectable {
onLoginSuccess(response.body()!!.accessToken) onLoginSuccess(response.body()!!.accessToken)
} else { } else {
setLoading(false) setLoading(false)
domainEditText.error = getString(R.string.error_retrieving_oauth_token) domainTextInputLayout.error = getString(R.string.error_retrieving_oauth_token)
Log.e(TAG, String.format("%s %s", Log.e(TAG, String.format("%s %s",
getString(R.string.error_retrieving_oauth_token), getString(R.string.error_retrieving_oauth_token),
response.message())) response.message()))
@ -252,7 +244,7 @@ class LoginActivity : AppCompatActivity(), Injectable {
override fun onFailure(call: Call<AccessToken>, t: Throwable) { override fun onFailure(call: Call<AccessToken>, t: Throwable) {
setLoading(false) setLoading(false)
domainEditText.error = getString(R.string.error_retrieving_oauth_token) domainTextInputLayout.error = getString(R.string.error_retrieving_oauth_token)
Log.e(TAG, String.format("%s %s", Log.e(TAG, String.format("%s %s",
getString(R.string.error_retrieving_oauth_token), getString(R.string.error_retrieving_oauth_token),
t.message)) t.message))
@ -265,14 +257,14 @@ class LoginActivity : AppCompatActivity(), Injectable {
/* Authorization failed. Put the error response where the user can read it and they /* Authorization failed. Put the error response where the user can read it and they
* can try again. */ * can try again. */
setLoading(false) setLoading(false)
domainEditText.error = getString(R.string.error_authorization_denied) domainTextInputLayout.error = getString(R.string.error_authorization_denied)
Log.e(TAG, String.format("%s %s", Log.e(TAG, String.format("%s %s",
getString(R.string.error_authorization_denied), getString(R.string.error_authorization_denied),
error)) error))
} else { } else {
// This case means a junk response was received somehow. // This case means a junk response was received somehow.
setLoading(false) setLoading(false)
domainEditText.error = getString(R.string.error_authorization_unknown) domainTextInputLayout.error = getString(R.string.error_authorization_unknown)
} }
} else { } else {
// first show or user cancelled login // first show or user cancelled login

View file

@ -15,22 +15,22 @@
package com.keylesspalace.tusky; package com.keylesspalace.tusky;
import android.arch.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.tabs.TabLayout;
import androidx.emoji.text.EmojiCompat;
import androidx.fragment.app.Fragment;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AlertDialog;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TabLayout;
import android.support.text.emoji.EmojiCompat;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.widget.ImageButton; import android.widget.ImageButton;

View file

@ -3,8 +3,8 @@ package com.keylesspalace.tusky
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.support.design.widget.FloatingActionButton import com.google.android.material.floatingactionbutton.FloatingActionButton
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import android.view.MenuItem import android.view.MenuItem
import com.keylesspalace.tusky.fragment.TimelineFragment import com.keylesspalace.tusky.fragment.TimelineFragment
import com.keylesspalace.tusky.interfaces.ActionButtonActivity import com.keylesspalace.tusky.interfaces.ActionButtonActivity

View file

@ -20,7 +20,7 @@ import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Bundle import android.os.Bundle
import android.preference.PreferenceManager import android.preference.PreferenceManager
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import android.util.Log import android.util.Log
import android.view.MenuItem import android.view.MenuItem
import com.keylesspalace.tusky.appstore.EventHub import com.keylesspalace.tusky.appstore.EventHub

View file

@ -18,13 +18,13 @@ package com.keylesspalace.tusky;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.Snackbar; import com.google.android.material.snackbar.Snackbar;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;

View file

@ -15,17 +15,17 @@
package com.keylesspalace.tusky; package com.keylesspalace.tusky;
import android.arch.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;

View file

@ -20,12 +20,12 @@ import android.app.SearchableInfo;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.SearchView; import androidx.appcompat.widget.SearchView;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;

View file

@ -17,7 +17,7 @@ package com.keylesspalace.tusky
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.support.v7.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.keylesspalace.tusky.db.AccountManager import com.keylesspalace.tusky.db.AccountManager
import com.keylesspalace.tusky.di.Injectable import com.keylesspalace.tusky.di.Injectable

View file

@ -18,10 +18,10 @@ package com.keylesspalace.tusky;
import android.app.Activity; import android.app.Activity;
import android.app.Application; import android.app.Application;
import android.app.Service; import android.app.Service;
import android.arch.persistence.room.Room; import androidx.room.Room;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.text.emoji.EmojiCompat; import androidx.emoji.text.EmojiCompat;
import com.evernote.android.job.JobManager; import com.evernote.android.job.JobManager;
import com.jakewharton.picasso.OkHttp3Downloader; import com.jakewharton.picasso.OkHttp3Downloader;

View file

@ -31,10 +31,10 @@ import android.net.Uri
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Environment import android.os.Environment
import android.support.v4.app.ActivityCompat import androidx.core.app.ActivityCompat
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import android.support.v4.content.FileProvider import androidx.core.content.FileProvider
import android.support.v4.view.ViewPager import androidx.viewpager.widget.ViewPager
import android.util.Log import android.util.Log
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem

View file

@ -16,11 +16,11 @@
package com.keylesspalace.tusky; package com.keylesspalace.tusky;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import com.keylesspalace.tusky.fragment.TimelineFragment; import com.keylesspalace.tusky.fragment.TimelineFragment;

View file

@ -18,11 +18,11 @@ package com.keylesspalace.tusky;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import android.support.v7.app.ActionBar; import androidx.appcompat.app.ActionBar;
import android.support.v7.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;

View file

@ -15,9 +15,9 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.keylesspalace.tusky.entity.Account; import com.keylesspalace.tusky.entity.Account;
import com.keylesspalace.tusky.interfaces.AccountActionListener; import com.keylesspalace.tusky.interfaces.AccountActionListener;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.adapter package com.keylesspalace.tusky.adapter
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import android.view.View import android.view.View

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.adapter package com.keylesspalace.tusky.adapter
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.LayoutInflater import android.view.LayoutInflater

View file

@ -1,7 +1,7 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.content.Context; import android.content.Context;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;

View file

@ -15,8 +15,8 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.adapter package com.keylesspalace.tusky.adapter
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView

View file

@ -15,8 +15,8 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -15,8 +15,8 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.adapter package com.keylesspalace.tusky.adapter
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.View import android.view.View
class LoadingFooterViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) class LoadingFooterViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)

View file

@ -16,9 +16,9 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.content.Context; import android.content.Context;
import android.support.annotation.LayoutRes; import androidx.annotation.LayoutRes;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -1,7 +1,7 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -20,11 +20,11 @@ import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.support.v4.text.BidiFormatter; import androidx.core.text.BidiFormatter;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
@ -427,7 +427,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
icon = ContextCompat.getDrawable(context, R.drawable.ic_star_24dp); icon = ContextCompat.getDrawable(context, R.drawable.ic_star_24dp);
if (icon != null) { if (icon != null) {
icon.setColorFilter(ContextCompat.getColor(context, icon.setColorFilter(ContextCompat.getColor(context,
R.color.status_favourite_button_marked_dark), PorterDuff.Mode.SRC_ATOP); R.color.tusky_orange), PorterDuff.Mode.SRC_ATOP);
} }
format = context.getString(R.string.notification_favourite_format); format = context.getString(R.string.notification_favourite_format);
@ -437,7 +437,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
icon = ContextCompat.getDrawable(context, R.drawable.ic_repeat_24dp); icon = ContextCompat.getDrawable(context, R.drawable.ic_repeat_24dp);
if (icon != null) { if (icon != null) {
icon.setColorFilter(ContextCompat.getColor(context, icon.setColorFilter(ContextCompat.getColor(context,
R.color.color_accent_dark), PorterDuff.Mode.SRC_ATOP); R.color.tusky_blue), PorterDuff.Mode.SRC_ATOP);
} }
format = context.getString(R.string.notification_reblog_format); format = context.getString(R.string.notification_reblog_format);

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.ProgressBar; import android.widget.ProgressBar;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.text.Spanned; import android.text.Spanned;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;

View file

@ -16,8 +16,8 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.content.Context; import android.content.Context;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -15,9 +15,9 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -2,11 +2,11 @@ package com.keylesspalace.tusky.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.content.res.AppCompatResources; import androidx.appcompat.content.res.AppCompatResources;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;

View file

@ -4,7 +4,7 @@ import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;

View file

@ -16,7 +16,7 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.content.Context; import android.content.Context;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;

View file

@ -15,9 +15,9 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -15,8 +15,8 @@
package com.keylesspalace.tusky.adapter; package com.keylesspalace.tusky.adapter;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.db package com.keylesspalace.tusky.db
import android.arch.persistence.room.* import androidx.room.*
@Dao @Dao
interface AccountDao { interface AccountDao {

View file

@ -15,10 +15,10 @@
package com.keylesspalace.tusky.db package com.keylesspalace.tusky.db
import android.arch.persistence.room.Entity import androidx.room.Entity
import android.arch.persistence.room.Index import androidx.room.Index
import android.arch.persistence.room.PrimaryKey import androidx.room.PrimaryKey
import android.arch.persistence.room.TypeConverters import androidx.room.TypeConverters
import com.keylesspalace.tusky.entity.Emoji import com.keylesspalace.tusky.entity.Emoji
import com.keylesspalace.tusky.entity.Status import com.keylesspalace.tusky.entity.Status

View file

@ -15,11 +15,11 @@
package com.keylesspalace.tusky.db; package com.keylesspalace.tusky.db;
import android.arch.persistence.db.SupportSQLiteDatabase; import androidx.sqlite.db.SupportSQLiteDatabase;
import android.arch.persistence.room.Database; import androidx.room.Database;
import android.arch.persistence.room.RoomDatabase; import androidx.room.RoomDatabase;
import android.arch.persistence.room.migration.Migration; import androidx.room.migration.Migration;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
/** /**
* DB version & declare DAO * DB version & declare DAO

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.db package com.keylesspalace.tusky.db
import android.arch.persistence.room.TypeConverter import androidx.room.TypeConverter
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.keylesspalace.tusky.entity.Emoji import com.keylesspalace.tusky.entity.Emoji

View file

@ -15,10 +15,10 @@
package com.keylesspalace.tusky.db package com.keylesspalace.tusky.db
import android.arch.persistence.room.Dao import androidx.room.Dao
import android.arch.persistence.room.Insert import androidx.room.Insert
import android.arch.persistence.room.OnConflictStrategy import androidx.room.OnConflictStrategy
import android.arch.persistence.room.Query import androidx.room.Query
@Dao @Dao
interface InstanceDao { interface InstanceDao {

View file

@ -15,9 +15,9 @@
package com.keylesspalace.tusky.db package com.keylesspalace.tusky.db
import android.arch.persistence.room.Entity import androidx.room.Entity
import android.arch.persistence.room.PrimaryKey import androidx.room.PrimaryKey
import android.arch.persistence.room.TypeConverters import androidx.room.TypeConverters
import com.keylesspalace.tusky.entity.Emoji import com.keylesspalace.tusky.entity.Emoji
@Entity @Entity

View file

@ -15,10 +15,10 @@
package com.keylesspalace.tusky.db; package com.keylesspalace.tusky.db;
import android.arch.persistence.room.Dao; import androidx.room.Dao;
import android.arch.persistence.room.Insert; import androidx.room.Insert;
import android.arch.persistence.room.OnConflictStrategy; import androidx.room.OnConflictStrategy;
import android.arch.persistence.room.Query; import androidx.room.Query;
import java.util.List; import java.util.List;

View file

@ -15,12 +15,12 @@
package com.keylesspalace.tusky.db; package com.keylesspalace.tusky.db;
import android.arch.persistence.room.ColumnInfo; import androidx.room.ColumnInfo;
import android.arch.persistence.room.Entity; import androidx.room.Entity;
import android.arch.persistence.room.PrimaryKey; import androidx.room.PrimaryKey;
import android.arch.persistence.room.TypeConverter; import androidx.room.TypeConverter;
import android.arch.persistence.room.TypeConverters; import androidx.room.TypeConverters;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import com.keylesspalace.tusky.entity.Status; import com.keylesspalace.tusky.entity.Status;

View file

@ -18,9 +18,9 @@ package com.keylesspalace.tusky.di
import android.app.Activity import android.app.Activity
import android.app.Application import android.app.Application
import android.os.Bundle import android.os.Bundle
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import android.support.v4.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import android.support.v4.app.FragmentManager import androidx.fragment.app.FragmentManager
import com.keylesspalace.tusky.TuskyApplication import com.keylesspalace.tusky.TuskyApplication
import dagger.android.AndroidInjection import dagger.android.AndroidInjection
import dagger.android.support.AndroidSupportInjection import dagger.android.support.AndroidSupportInjection

View file

@ -20,7 +20,7 @@ import android.app.Application
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.preference.PreferenceManager import android.preference.PreferenceManager
import android.support.v4.content.LocalBroadcastManager import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.keylesspalace.tusky.TuskyApplication import com.keylesspalace.tusky.TuskyApplication
import com.keylesspalace.tusky.appstore.EventHub import com.keylesspalace.tusky.appstore.EventHub
import com.keylesspalace.tusky.appstore.EventHubImpl import com.keylesspalace.tusky.appstore.EventHubImpl

View file

@ -2,8 +2,8 @@
package com.keylesspalace.tusky.di package com.keylesspalace.tusky.di
import android.arch.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.keylesspalace.tusky.viewmodel.AccountViewModel import com.keylesspalace.tusky.viewmodel.AccountViewModel
import com.keylesspalace.tusky.viewmodel.EditProfileViewModel import com.keylesspalace.tusky.viewmodel.EditProfileViewModel
import dagger.Binds import dagger.Binds

View file

@ -19,12 +19,12 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.Snackbar; import com.google.android.material.snackbar.Snackbar;
import android.support.v7.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;

View file

@ -15,19 +15,18 @@
package com.keylesspalace.tusky.fragment package com.keylesspalace.tusky.fragment
import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.support.v4.app.ActivityOptionsCompat import androidx.core.app.ActivityOptionsCompat
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import android.support.v4.view.ViewCompat import androidx.core.view.ViewCompat
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.RecyclerView
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.ViewMediaActivity import com.keylesspalace.tusky.ViewMediaActivity
import com.keylesspalace.tusky.di.Injectable import com.keylesspalace.tusky.di.Injectable
@ -166,7 +165,7 @@ class AccountMediaFragment : BaseFragment(), Injectable {
currentCall?.enqueue(callback) currentCall?.enqueue(callback)
} }
swipe_refresh_layout.setColorSchemeResources(R.color.primary) swipe_refresh_layout.setColorSchemeResources(R.color.tusky_blue)
swipe_refresh_layout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground)) swipe_refresh_layout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground))
nothing_message.visibility = View.GONE nothing_message.visibility = View.GONE
@ -231,8 +230,8 @@ class AccountMediaFragment : BaseFragment(), Injectable {
NOT_FETCHING, INITIAL_FETCHING, FETCHING_BOTTOM, REFRESHING NOT_FETCHING, INITIAL_FETCHING, FETCHING_BOTTOM, REFRESHING
} }
inner class MediaGridAdapter inner class MediaGridAdapter:
: RecyclerView.Adapter<MediaGridAdapter.MediaViewHolder>() { RecyclerView.Adapter<MediaGridAdapter.MediaViewHolder>() {
var baseItemColor = Color.BLACK var baseItemColor = Color.BLACK

View file

@ -16,8 +16,8 @@
package com.keylesspalace.tusky.fragment; package com.keylesspalace.tusky.fragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View file

@ -16,24 +16,24 @@
package com.keylesspalace.tusky.fragment; package com.keylesspalace.tusky.fragment;
import android.app.Activity; import android.app.Activity;
import android.arch.core.util.Function; import androidx.arch.core.util.Function;
import android.arch.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import android.support.design.widget.TabLayout; import com.google.android.material.tabs.TabLayout;
import android.support.v4.util.Pair; import androidx.core.util.Pair;
import android.support.v4.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.support.v7.content.res.AppCompatResources; import androidx.appcompat.content.res.AppCompatResources;
import android.support.v7.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.SimpleItemAnimator; import androidx.recyclerview.widget.SimpleItemAnimator;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -180,7 +180,7 @@ public class NotificationsFragment extends SFragment implements
nothingMessageView = rootView.findViewById(R.id.nothing_message); nothingMessageView = rootView.findViewById(R.id.nothing_message);
swipeRefreshLayout.setOnRefreshListener(this); swipeRefreshLayout.setOnRefreshListener(this);
swipeRefreshLayout.setColorSchemeResources(R.color.primary); swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground)); swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground));
// Setup the RecyclerView. // Setup the RecyclerView.
recyclerView.setHasFixedSize(true); recyclerView.setHasFixedSize(true);

View file

@ -20,12 +20,12 @@ import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.ActivityOptionsCompat; import androidx.core.app.ActivityOptionsCompat;
import android.support.v4.view.ViewCompat; import androidx.core.view.ViewCompat;
import android.support.v7.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import android.support.v7.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import android.text.Spanned; import android.text.Spanned;
import android.view.Menu; import android.view.Menu;
import android.view.View; import android.view.View;

View file

@ -18,8 +18,8 @@ package com.keylesspalace.tusky.fragment
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.preference.PreferenceManager import android.preference.PreferenceManager
import android.support.v7.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import android.support.v7.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View

View file

@ -15,28 +15,28 @@
package com.keylesspalace.tusky.fragment; package com.keylesspalace.tusky.fragment;
import android.arch.core.util.Function; import androidx.arch.core.util.Function;
import android.arch.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import android.support.design.widget.TabLayout; import com.google.android.material.tabs.TabLayout;
import android.support.v4.util.Pair; import androidx.core.util.Pair;
import android.support.v4.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.support.v7.content.res.AppCompatResources; import androidx.appcompat.content.res.AppCompatResources;
import android.support.v7.recyclerview.extensions.AsyncDifferConfig; import androidx.recyclerview.widget.AsyncDifferConfig;
import android.support.v7.recyclerview.extensions.AsyncListDiffer; import androidx.recyclerview.widget.AsyncListDiffer;
import android.support.v7.util.DiffUtil; import androidx.recyclerview.widget.DiffUtil;
import android.support.v7.util.ListUpdateCallback; import androidx.recyclerview.widget.ListUpdateCallback;
import android.support.v7.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.SimpleItemAnimator; import androidx.recyclerview.widget.SimpleItemAnimator;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -275,7 +275,7 @@ public class TimelineFragment extends SFragment implements
private void setupSwipeRefreshLayout() { private void setupSwipeRefreshLayout() {
Context context = swipeRefreshLayout.getContext(); Context context = swipeRefreshLayout.getContext();
swipeRefreshLayout.setOnRefreshListener(this); swipeRefreshLayout.setOnRefreshListener(this);
swipeRefreshLayout.setColorSchemeResources(R.color.primary); swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context,
android.R.attr.colorBackground)); android.R.attr.colorBackground));
} }

View file

@ -19,7 +19,6 @@ import android.animation.Animator
import android.animation.AnimatorListenerAdapter import android.animation.AnimatorListenerAdapter
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.support.v4.view.ViewCompat
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -56,7 +55,7 @@ class ViewImageFragment : ViewMediaFragment() {
override fun setupMediaView(url: String) { override fun setupMediaView(url: String) {
descriptionView = mediaDescription descriptionView = mediaDescription
ViewCompat.setTransitionName(photoView, url) photoView.transitionName = url
attacher = PhotoViewAttacher(photoView) attacher = PhotoViewAttacher(photoView)
// Clicking outside the photo closes the viewer. // Clicking outside the photo closes the viewer.

View file

@ -15,22 +15,22 @@
package com.keylesspalace.tusky.fragment; package com.keylesspalace.tusky.fragment;
import android.arch.core.util.Function; import androidx.arch.core.util.Function;
import android.arch.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.Snackbar; import com.google.android.material.snackbar.Snackbar;
import android.support.v4.util.Pair; import androidx.core.util.Pair;
import android.support.v4.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.support.v7.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.SimpleItemAnimator; import androidx.recyclerview.widget.SimpleItemAnimator;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -72,8 +72,8 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
import static com.uber.autodispose.AutoDispose.*; import static com.uber.autodispose.AutoDispose.autoDisposable;
import static com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.*; import static com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from;
public final class ViewThreadFragment extends SFragment implements public final class ViewThreadFragment extends SFragment implements
SwipeRefreshLayout.OnRefreshListener, StatusActionListener, Injectable { SwipeRefreshLayout.OnRefreshListener, StatusActionListener, Injectable {
@ -136,7 +136,7 @@ public final class ViewThreadFragment extends SFragment implements
Context context = getContext(); Context context = getContext();
swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout);
swipeRefreshLayout.setOnRefreshListener(this); swipeRefreshLayout.setOnRefreshListener(this);
swipeRefreshLayout.setColorSchemeResources(R.color.primary); swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor( swipeRefreshLayout.setProgressBackgroundColorSchemeColor(
ThemeUtils.getColor(context, android.R.attr.colorBackground)); ThemeUtils.getColor(context, android.R.attr.colorBackground));

View file

@ -19,11 +19,11 @@ import android.content.Intent
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.support.design.widget.Snackbar import com.google.android.material.snackbar.Snackbar
import android.support.v14.preference.SwitchPreference import androidx.preference.SwitchPreference
import android.support.v7.preference.ListPreference import androidx.preference.ListPreference
import android.support.v7.preference.Preference import androidx.preference.Preference
import android.support.v7.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import com.keylesspalace.tusky.AccountListActivity import com.keylesspalace.tusky.AccountListActivity

View file

@ -16,9 +16,9 @@
package com.keylesspalace.tusky.fragment.preference package com.keylesspalace.tusky.fragment.preference
import android.os.Bundle import android.os.Bundle
import android.support.v14.preference.SwitchPreference import androidx.preference.SwitchPreference
import android.support.v7.preference.Preference import androidx.preference.Preference
import android.support.v7.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import android.view.View import android.view.View
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.db.AccountManager import com.keylesspalace.tusky.db.AccountManager

View file

@ -16,7 +16,7 @@
package com.keylesspalace.tusky.fragment.preference package com.keylesspalace.tusky.fragment.preference
import android.os.Bundle import android.os.Bundle
import android.support.v7.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import com.keylesspalace.tusky.PreferencesActivity import com.keylesspalace.tusky.PreferencesActivity
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.util.ThemeUtils import com.keylesspalace.tusky.util.ThemeUtils

View file

@ -17,8 +17,8 @@ package com.keylesspalace.tusky.fragment.preference
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Bundle import android.os.Bundle
import android.support.v7.preference.EditTextPreference import androidx.preference.EditTextPreference
import android.support.v7.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
class ProxyPreferencesFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedPreferenceChangeListener { class ProxyPreferencesFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedPreferenceChangeListener {

View file

@ -17,8 +17,8 @@ package com.keylesspalace.tusky.fragment.preference
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Bundle import android.os.Bundle
import android.support.v7.app.AlertDialog import androidx.appcompat.app.AlertDialog
import android.support.v7.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.widget.EditText import android.widget.EditText

View file

@ -15,8 +15,8 @@
package com.keylesspalace.tusky.interfaces; package com.keylesspalace.tusky.interfaces;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.design.widget.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
public interface ActionButtonActivity { public interface ActionButtonActivity {

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.network; package com.keylesspalace.tusky.network;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import com.keylesspalace.tusky.db.AccountEntity; import com.keylesspalace.tusky.db.AccountEntity;
import com.keylesspalace.tusky.db.AccountManager; import com.keylesspalace.tusky.db.AccountManager;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.network; package com.keylesspalace.tusky.network;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import com.keylesspalace.tusky.entity.AccessToken; import com.keylesspalace.tusky.entity.AccessToken;
import com.keylesspalace.tusky.entity.Account; import com.keylesspalace.tusky.entity.Account;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.network; package com.keylesspalace.tusky.network;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;

View file

@ -15,9 +15,9 @@
package com.keylesspalace.tusky.pager; package com.keylesspalace.tusky.pager;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentPagerAdapter;
import com.keylesspalace.tusky.fragment.AccountMediaFragment; import com.keylesspalace.tusky.fragment.AccountMediaFragment;
import com.keylesspalace.tusky.fragment.TimelineFragment; import com.keylesspalace.tusky.fragment.TimelineFragment;

View file

@ -1,18 +1,19 @@
package com.keylesspalace.tusky.pager package com.keylesspalace.tusky.pager
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import android.support.v4.app.FragmentManager import androidx.fragment.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter import androidx.fragment.app.FragmentPagerAdapter
import com.keylesspalace.tusky.fragment.ViewMediaFragment import com.keylesspalace.tusky.fragment.ViewMediaFragment
import java.lang.IllegalStateException
class AvatarImagePagerAdapter(fragmentManager: FragmentManager, private val avatarUrl: String) : FragmentPagerAdapter(fragmentManager) { class AvatarImagePagerAdapter(fragmentManager: FragmentManager, private val avatarUrl: String) : FragmentPagerAdapter(fragmentManager) {
override fun getItem(position: Int): Fragment? { override fun getItem(position: Int): Fragment {
return if (position == 0) { return if (position == 0) {
ViewMediaFragment.newAvatarInstance(avatarUrl) ViewMediaFragment.newAvatarInstance(avatarUrl)
} else { } else {
null throw IllegalStateException()
} }
} }

View file

@ -1,11 +1,12 @@
package com.keylesspalace.tusky.pager package com.keylesspalace.tusky.pager
import android.support.v4.app.Fragment import androidx.fragment.app.Fragment
import android.support.v4.app.FragmentManager import androidx.fragment.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter import androidx.fragment.app.FragmentStatePagerAdapter
import com.keylesspalace.tusky.entity.Attachment import com.keylesspalace.tusky.entity.Attachment
import com.keylesspalace.tusky.fragment.ViewMediaFragment import com.keylesspalace.tusky.fragment.ViewMediaFragment
import java.lang.IllegalStateException
import java.util.Locale import java.util.Locale
@ -15,11 +16,11 @@ class ImagePagerAdapter(
private val initialPosition: Int private val initialPosition: Int
) : FragmentStatePagerAdapter(fragmentManager) { ) : FragmentStatePagerAdapter(fragmentManager) {
override fun getItem(position: Int): Fragment? { override fun getItem(position: Int): Fragment {
return if (position >= 0 && position < attachments.size) { return if (position >= 0 && position < attachments.size) {
ViewMediaFragment.newInstance(attachments[position], position == initialPosition) ViewMediaFragment.newInstance(attachments[position], position == initialPosition)
} else { } else {
null throw IllegalStateException()
} }
} }

View file

@ -15,9 +15,9 @@
package com.keylesspalace.tusky.pager; package com.keylesspalace.tusky.pager;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentPagerAdapter;
import com.keylesspalace.tusky.fragment.NotificationsFragment; import com.keylesspalace.tusky.fragment.NotificationsFragment;
import com.keylesspalace.tusky.fragment.TimelineFragment; import com.keylesspalace.tusky.fragment.TimelineFragment;

View file

@ -18,10 +18,10 @@ package com.keylesspalace.tusky.receiver
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.support.v4.app.NotificationCompat import androidx.core.app.NotificationCompat
import android.support.v4.app.NotificationManagerCompat import androidx.core.app.NotificationManagerCompat
import android.support.v4.app.RemoteInput import androidx.core.app.RemoteInput
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import android.util.Log import android.util.Log
import com.keylesspalace.tusky.ComposeActivity import com.keylesspalace.tusky.ComposeActivity
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
@ -68,7 +68,7 @@ class SendStatusBroadcastReceiver : BroadcastReceiver() {
val builder = NotificationCompat.Builder(context, NotificationHelper.CHANNEL_MENTION + senderIdentifier) val builder = NotificationCompat.Builder(context, NotificationHelper.CHANNEL_MENTION + senderIdentifier)
.setSmallIcon(R.drawable.ic_notify) .setSmallIcon(R.drawable.ic_notify)
.setColor(ContextCompat.getColor(context, (R.color.primary))) .setColor(ContextCompat.getColor(context, (R.color.tusky_blue)))
.setGroup(senderFullName) .setGroup(senderFullName)
.setDefaults(0) // So it doesn't ring twice, notify only in Target callback .setDefaults(0) // So it doesn't ring twice, notify only in Target callback
@ -102,7 +102,7 @@ class SendStatusBroadcastReceiver : BroadcastReceiver() {
val builder = NotificationCompat.Builder(context, NotificationHelper.CHANNEL_MENTION + senderIdentifier) val builder = NotificationCompat.Builder(context, NotificationHelper.CHANNEL_MENTION + senderIdentifier)
.setSmallIcon(R.drawable.ic_notify) .setSmallIcon(R.drawable.ic_notify)
.setColor(ContextCompat.getColor(context, (R.color.primary))) .setColor(ContextCompat.getColor(context, (R.color.tusky_blue)))
.setGroup(senderFullName) .setGroup(senderFullName)
.setDefaults(0) // So it doesn't ring twice, notify only in Target callback .setDefaults(0) // So it doesn't ring twice, notify only in Target callback

View file

@ -12,9 +12,9 @@ import android.net.Uri
import android.os.Build import android.os.Build
import android.os.IBinder import android.os.IBinder
import android.os.Parcelable import android.os.Parcelable
import android.support.v4.app.NotificationCompat import androidx.core.app.NotificationCompat
import android.support.v4.app.ServiceCompat import androidx.core.app.ServiceCompat
import android.support.v4.content.ContextCompat import androidx.core.content.ContextCompat
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.appstore.EventHub import com.keylesspalace.tusky.appstore.EventHub
import com.keylesspalace.tusky.appstore.StatusComposedEvent import com.keylesspalace.tusky.appstore.StatusComposedEvent
@ -89,7 +89,7 @@ class SendTootService : Service(), Injectable {
.setContentText(notificationText) .setContentText(notificationText)
.setProgress(1, 0, true) .setProgress(1, 0, true)
.setOngoing(true) .setOngoing(true)
.setColor(ContextCompat.getColor(this, R.color.primary)) .setColor(ContextCompat.getColor(this, R.color.tusky_blue))
.addAction(0, getString(android.R.string.cancel), cancelSendingIntent(sendingNotificationId)) .addAction(0, getString(android.R.string.cancel), cancelSendingIntent(sendingNotificationId))
if (tootsToSend.size == 0 || Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (tootsToSend.size == 0 || Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@ -169,7 +169,7 @@ class SendTootService : Service(), Injectable {
.setSmallIcon(R.drawable.ic_notify) .setSmallIcon(R.drawable.ic_notify)
.setContentTitle(getString(R.string.send_toot_notification_error_title)) .setContentTitle(getString(R.string.send_toot_notification_error_title))
.setContentText(getString(R.string.send_toot_notification_saved_content)) .setContentText(getString(R.string.send_toot_notification_saved_content))
.setColor(ContextCompat.getColor(this@SendTootService, R.color.primary)) .setColor(ContextCompat.getColor(this@SendTootService, R.color.tusky_blue))
notificationManager.cancel(tootId) notificationManager.cancel(tootId)
notificationManager.notify(errorNotificationId--, builder.build()) notificationManager.notify(errorNotificationId--, builder.build())
@ -218,7 +218,7 @@ class SendTootService : Service(), Injectable {
.setSmallIcon(R.drawable.ic_notify) .setSmallIcon(R.drawable.ic_notify)
.setContentTitle(getString(R.string.send_toot_notification_cancel_title)) .setContentTitle(getString(R.string.send_toot_notification_cancel_title))
.setContentText(getString(R.string.send_toot_notification_saved_content)) .setContentText(getString(R.string.send_toot_notification_saved_content))
.setColor(ContextCompat.getColor(this@SendTootService, R.color.primary)) .setColor(ContextCompat.getColor(this@SendTootService, R.color.tusky_blue))
notificationManager.notify(tootId, builder.build()) notificationManager.notify(tootId, builder.build())

View file

@ -14,7 +14,7 @@
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.arch.core.util.Function; import androidx.arch.core.util.Function;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View file

@ -20,8 +20,8 @@ import android.graphics.Canvas;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
import android.text.SpannedString; import android.text.SpannedString;

View file

@ -14,8 +14,8 @@
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
/** /**
* Created by charlag on 05/11/17. * Created by charlag on 05/11/17.

View file

@ -3,7 +3,7 @@ package com.keylesspalace.tusky.util;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.util.Log; import android.util.Log;
import com.keylesspalace.tusky.R; import com.keylesspalace.tusky.R;

View file

@ -10,7 +10,7 @@
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.net.Uri; import android.net.Uri;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View file

@ -17,7 +17,7 @@ package com.keylesspalace.tusky.util;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.net.Uri; import android.net.Uri;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import java.io.Closeable; import java.io.Closeable;
import java.io.File; import java.io.File;

View file

@ -20,8 +20,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.customtabs.CustomTabsIntent; import androidx.browser.customtabs.CustomTabsIntent;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;

View file

@ -25,8 +25,8 @@ import android.media.MediaMetadataRetriever
import android.media.ThumbnailUtils import android.media.ThumbnailUtils
import android.net.Uri import android.net.Uri
import android.provider.OpenableColumns import android.provider.OpenableColumns
import android.support.annotation.Px import androidx.annotation.Px
import android.support.media.ExifInterface import androidx.exifinterface.media.ExifInterface
import android.util.Log import android.util.Log
import java.io.* import java.io.*

View file

@ -27,14 +27,14 @@ import android.graphics.BitmapFactory;
import android.graphics.Color; import android.graphics.Color;
import android.os.Build; import android.os.Build;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat; import androidx.core.app.NotificationManagerCompat;
import android.support.v4.app.RemoteInput; import androidx.core.app.RemoteInput;
import android.support.v4.app.TaskStackBuilder; import androidx.core.app.TaskStackBuilder;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.support.v4.text.BidiFormatter; import androidx.core.text.BidiFormatter;
import android.util.Log; import android.util.Log;
import com.evernote.android.job.JobManager; import com.evernote.android.job.JobManager;
@ -278,7 +278,7 @@ public class NotificationHelper {
.setSmallIcon(R.drawable.ic_notify) .setSmallIcon(R.drawable.ic_notify)
.setContentIntent(summary ? summaryResultPendingIntent : eventResultPendingIntent) .setContentIntent(summary ? summaryResultPendingIntent : eventResultPendingIntent)
.setDeleteIntent(deletePendingIntent) .setDeleteIntent(deletePendingIntent)
.setColor(BuildConfig.DEBUG ? Color.parseColor("#19A341") : ContextCompat.getColor(context, R.color.primary)) .setColor(BuildConfig.DEBUG ? Color.parseColor("#19A341") : ContextCompat.getColor(context, R.color.tusky_blue))
.setGroup(account.getAccountId()) .setGroup(account.getAccountId())
.setAutoCancel(true) .setAutoCancel(true)
.setDefaults(0); // So it doesn't ring twice, notify only in Target callback .setDefaults(0); // So it doesn't ring twice, notify only in Target callback

View file

@ -16,8 +16,8 @@
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.util.Log; import android.util.Log;
import com.evernote.android.job.Job; import com.evernote.android.job.Job;

View file

@ -19,7 +19,7 @@ import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.util.Log; import android.util.Log;
import com.keylesspalace.tusky.BuildConfig; import com.keylesspalace.tusky.BuildConfig;

View file

@ -1,6 +1,6 @@
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.arch.core.util.Function; import androidx.arch.core.util.Function;
import java.util.AbstractList; import java.util.AbstractList;
import java.util.ArrayList; import java.util.ArrayList;

View file

@ -16,7 +16,7 @@
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.content.Context; import android.content.Context;
import android.support.annotation.AnyRes; import androidx.annotation.AnyRes;
/** /**
* Created by remi on 1/14/18. * Created by remi on 1/14/18.

View file

@ -5,9 +5,9 @@ import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.content.FileProvider; import androidx.core.content.FileProvider;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.webkit.MimeTypeMap; import android.webkit.MimeTypeMap;

View file

@ -21,12 +21,12 @@ import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.support.annotation.AttrRes; import androidx.annotation.AttrRes;
import android.support.annotation.ColorInt; import androidx.annotation.ColorInt;
import android.support.annotation.ColorRes; import androidx.annotation.ColorRes;
import android.support.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.support.v7.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import android.util.TypedValue; import android.util.TypedValue;
import android.widget.ImageView; import android.widget.ImageView;

View file

@ -15,7 +15,7 @@
package com.keylesspalace.tusky.util; package com.keylesspalace.tusky.util;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import com.keylesspalace.tusky.entity.Notification; import com.keylesspalace.tusky.entity.Notification;
import com.keylesspalace.tusky.entity.Status; import com.keylesspalace.tusky.entity.Status;

View file

@ -18,7 +18,7 @@ package com.keylesspalace.tusky.view
import android.content.Context import android.content.Context
import android.graphics.Canvas import android.graphics.Canvas
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.support.v7.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.view.View import android.view.View
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R

Some files were not shown because too many files have changed in this diff Show more