update deps

main
Conny Duck 6 years ago
parent 65d7c9ff4c
commit 079c792d0c
  1. 12
      app/build.gradle
  2. 13
      app/src/main/java/com/keylesspalace/tusky/fragment/preference/PreferencesFragment.kt
  3. 75
      app/src/main/java/com/keylesspalace/tusky/fragment/preference/TabFilterPreferencesFragment.kt
  4. 2
      build.gradle

@ -75,10 +75,10 @@ dependencies {
implementation 'androidx.browser:browser:1.0.0' implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0' implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha01' implementation 'com.google.android.material:material:1.1.0-alpha02'
implementation 'androidx.exifinterface:exifinterface:1.0.0' implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference:1.1.0-alpha01' implementation 'androidx.preference:preference:1.1.0-alpha02'
implementation 'com.squareup.retrofit2:retrofit:2.5.0' implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.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'
@ -109,8 +109,8 @@ dependencies {
implementation "com.google.dagger:dagger-android:$daggerVersion" implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion" implementation "com.google.dagger:dagger-android-support:$daggerVersion"
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.1'
testImplementation 'org.mockito:mockito-inline:2.23.0' testImplementation 'org.mockito:mockito-inline:2.23.4'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 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'
}) })
@ -119,6 +119,6 @@ dependencies {
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.5.0' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.0.0' implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.1.0'
implementation 'com.uber.autodispose:autodispose-ktx:1.0.0' implementation 'com.uber.autodispose:autodispose-ktx:1.1.0'
} }

@ -16,6 +16,7 @@
package com.keylesspalace.tusky.fragment.preference package com.keylesspalace.tusky.fragment.preference
import android.os.Bundle import android.os.Bundle
import androidx.preference.Preference
import androidx.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
@ -32,16 +33,16 @@ class PreferencesFragment : PreferenceFragmentCompat() {
addPreferencesFromResource(R.xml.preferences) addPreferencesFromResource(R.xml.preferences)
val themePreference = findPreference("appTheme") val themePreference: Preference = findPreference("appTheme")
themePreference.icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_palette).sizePx(iconSize).color(ThemeUtils.getColor(context, R.attr.toolbar_icon_tint)) themePreference.icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_palette).sizePx(iconSize).color(ThemeUtils.getColor(context, R.attr.toolbar_icon_tint))
val emojiPreference = findPreference("emojiCompat") val emojiPreference: Preference = findPreference("emojiCompat")
emojiPreference.icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_sentiment_satisfied).sizePx(iconSize).color(ThemeUtils.getColor(context, R.attr.toolbar_icon_tint)) emojiPreference.icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_sentiment_satisfied).sizePx(iconSize).color(ThemeUtils.getColor(context, R.attr.toolbar_icon_tint))
val textSizePreference = findPreference("statusTextSize") val textSizePreference: Preference = findPreference("statusTextSize")
textSizePreference.icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_format_size).sizePx(iconSize).color(ThemeUtils.getColor(context, R.attr.toolbar_icon_tint)) textSizePreference.icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_format_size).sizePx(iconSize).color(ThemeUtils.getColor(context, R.attr.toolbar_icon_tint))
val timelineFilterPreferences = findPreference("timelineFilterPreferences") val timelineFilterPreferences: Preference = findPreference("timelineFilterPreferences")
timelineFilterPreferences.setOnPreferenceClickListener { timelineFilterPreferences.setOnPreferenceClickListener {
activity?.let { activity -> activity?.let { activity ->
val intent = PreferencesActivity.newIntent(activity, PreferencesActivity.TAB_FILTER_PREFERENCES) val intent = PreferencesActivity.newIntent(activity, PreferencesActivity.TAB_FILTER_PREFERENCES)
@ -51,7 +52,7 @@ class PreferencesFragment : PreferenceFragmentCompat() {
true true
} }
val httpProxyPreferences = findPreference("httpProxyPreferences") val httpProxyPreferences: Preference = findPreference("httpProxyPreferences")
httpProxyPreferences.setOnPreferenceClickListener { httpProxyPreferences.setOnPreferenceClickListener {
activity?.let { activity -> activity?.let { activity ->
val intent = PreferencesActivity.newIntent(activity, PreferencesActivity.PROXY_PREFERENCES) val intent = PreferencesActivity.newIntent(activity, PreferencesActivity.PROXY_PREFERENCES)
@ -70,7 +71,7 @@ class PreferencesFragment : PreferenceFragmentCompat() {
private fun updateHttpProxySummary() { private fun updateHttpProxySummary() {
val httpProxyPref = findPreference("httpProxyPreferences") val httpProxyPref: Preference = findPreference("httpProxyPreferences")
val sharedPreferences = preferenceManager.sharedPreferences val sharedPreferences = preferenceManager.sharedPreferences

@ -22,6 +22,7 @@ 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
import androidx.preference.Preference
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
import java.util.regex.Pattern import java.util.regex.Pattern
@ -34,47 +35,45 @@ class TabFilterPreferencesFragment : PreferenceFragmentCompat() {
sharedPreferences = preferenceManager.sharedPreferences sharedPreferences = preferenceManager.sharedPreferences
val regexPref = findPreference("tabFilterRegex") val regexPref: Preference = findPreference("tabFilterRegex")
if (regexPref != null) {
regexPref.summary = sharedPreferences.getString("tabFilterRegex", "")
regexPref.summary = sharedPreferences.getString("tabFilterRegex", "") regexPref.setOnPreferenceClickListener {
regexPref.setOnPreferenceClickListener {
val editText = EditText(requireContext())
val editText = EditText(requireContext()) editText.setText(sharedPreferences.getString("tabFilterRegex", ""))
editText.setText(sharedPreferences.getString("tabFilterRegex", ""))
val dialog = AlertDialog.Builder(requireContext())
val dialog = AlertDialog.Builder(requireContext()) .setTitle(R.string.pref_title_filter_regex)
.setTitle(R.string.pref_title_filter_regex) .setView(editText)
.setView(editText) .setPositiveButton(android.R.string.ok) { _, _ ->
.setPositiveButton(android.R.string.ok) { _, _ -> sharedPreferences
sharedPreferences .edit()
.edit() .putString("tabFilterRegex", editText.text.toString())
.putString("tabFilterRegex", editText.text.toString()) .apply()
.apply() regexPref.summary = editText.text.toString()
regexPref.summary = editText.text.toString() }
} .setNegativeButton(android.R.string.cancel, null)
.setNegativeButton(android.R.string.cancel, null) .create()
.create()
editText.addTextChangedListener(object : TextWatcher {
editText.addTextChangedListener(object : TextWatcher { override fun afterTextChanged(newRegex: Editable) {
override fun afterTextChanged(newRegex: Editable) { try {
try { Pattern.compile(newRegex.toString())
Pattern.compile(newRegex.toString()) editText.error = null
editText.error = null dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true } catch (e: IllegalArgumentException) {
} catch (e: IllegalArgumentException) { editText.error = getString(R.string.error_invalid_regex)
editText.error = getString(R.string.error_invalid_regex) dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
}
} }
}
override fun beforeTextChanged(s1: CharSequence, start: Int, count: Int, after: Int) {} override fun beforeTextChanged(s1: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s1: CharSequence, start: Int, before: Int, count: Int) {} override fun onTextChanged(s1: CharSequence, start: Int, before: Int, count: Int) {}
}) })
dialog.show() dialog.show()
true true
}
} }
} }

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.3.10' ext.kotlin_version = '1.3.11'
repositories { repositories {
jcenter() jcenter()
google() google()

Loading…
Cancel
Save