Skip to content

Commit

Permalink
Switch to androidx.preference
Browse files Browse the repository at this point in the history
With the exception of wearable's ConfigActivity, which still uses PreferenceActivity to maintain the styling of Wear OS.
  • Loading branch information
ianhanniballake committed Jun 9, 2019
1 parent a219b9d commit 7721b3a
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 14 deletions.
1 change: 1 addition & 0 deletions android-client-common/build.gradle
Expand Up @@ -28,6 +28,7 @@ dependencies {
implementation "androidx.exifinterface:exifinterface:$exifInterfaceVersion"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
api "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation "androidx.preference:preference-ktx:$preferenceVersion"
implementation "androidx.work:work-runtime-ktx:$workManagerVersion"
api "androidx.room:room-ktx:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"
Expand Down
Expand Up @@ -7,11 +7,11 @@ import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.os.Build
import android.preference.PreferenceManager
import android.util.Log
import androidx.core.content.edit
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.preference.PreferenceManager
import androidx.work.Configuration
import androidx.work.WorkManager
import net.nurik.roman.muzei.androidclientcommon.BuildConfig
Expand Down
Expand Up @@ -21,12 +21,12 @@ import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.os.Build
import android.preference.PreferenceManager
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.core.content.edit
import androidx.core.net.toUri
import androidx.lifecycle.Observer
import androidx.preference.PreferenceManager
import androidx.work.Constraints
import androidx.work.CoroutineWorker
import androidx.work.ExistingWorkPolicy
Expand Down
Expand Up @@ -29,11 +29,11 @@ import android.os.Build
import android.os.Handler
import android.os.Looper
import android.os.RemoteException
import android.preference.PreferenceManager
import android.util.Log
import androidx.core.content.edit
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import androidx.preference.PreferenceManager
import com.google.android.apps.muzei.api.internal.ProtocolConstants
import com.google.android.apps.muzei.api.provider.ProviderContract
import com.google.android.apps.muzei.room.Artwork
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -38,6 +38,7 @@ buildscript {
okhttpVersion = '3.12.1'
pagingVersion = '2.1.0'
playServicesWearableVersion = '16.0.1'
preferenceVersion = '1.1.0-beta01'
recyclerViewVersion = '1.1.0-alpha06'
roomVersion = '2.1.0-rc01'
wearableVersion = '2.4.0'
Expand Down
1 change: 1 addition & 0 deletions main/build.gradle
Expand Up @@ -124,6 +124,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
implementation "androidx.preference:preference-ktx:$preferenceVersion"
implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"

Expand Down
Expand Up @@ -20,7 +20,6 @@ import android.app.Application
import android.app.Notification
import android.content.SharedPreferences
import android.os.Bundle
import android.preference.PreferenceManager
import android.view.View
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
Expand All @@ -32,6 +31,7 @@ import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.observe
import androidx.preference.PreferenceManager
import com.google.android.apps.muzei.notifications.NotificationSettingsDialogFragment
import com.google.android.apps.muzei.wallpaper.WallpaperActiveState
import com.google.firebase.analytics.FirebaseAnalytics
Expand Down
Expand Up @@ -21,7 +21,6 @@ import android.animation.ObjectAnimator
import android.graphics.drawable.AnimatedVectorDrawable
import android.os.Build
import android.os.Bundle
import android.preference.PreferenceManager
import android.util.TypedValue
import android.view.View
import android.view.animation.OvershootInterpolator
Expand All @@ -31,6 +30,7 @@ import androidx.core.content.edit
import androidx.core.content.res.ResourcesCompat
import androidx.core.view.ViewCompat
import androidx.fragment.app.Fragment
import androidx.preference.PreferenceManager
import com.google.firebase.analytics.FirebaseAnalytics
import net.nurik.roman.muzei.R

Expand Down
Expand Up @@ -24,7 +24,6 @@ import android.content.Context
import android.content.Intent
import android.content.res.Resources
import android.os.Build
import android.preference.PreferenceManager
import android.provider.Settings
import android.util.Log
import androidx.annotation.RequiresApi
Expand All @@ -34,6 +33,7 @@ import androidx.core.app.RemoteInput
import androidx.core.content.ContextCompat
import androidx.core.content.edit
import androidx.core.os.bundleOf
import androidx.preference.PreferenceManager
import com.google.android.apps.muzei.ArtDetailOpenLiveData
import com.google.android.apps.muzei.ArtworkInfoRedirectActivity
import com.google.android.apps.muzei.render.ContentUriImageLoader
Expand Down
Expand Up @@ -21,12 +21,12 @@ import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.preference.PreferenceManager
import android.provider.Settings
import android.widget.Toast
import androidx.core.content.edit
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentManager
import androidx.preference.PreferenceManager
import com.google.android.apps.muzei.util.toast
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import net.nurik.roman.muzei.R
Expand Down
Expand Up @@ -18,10 +18,10 @@ package com.google.android.apps.muzei.settings

import android.content.Context
import android.content.SharedPreferences
import android.preference.PreferenceManager
import androidx.core.content.ContextCompat
import androidx.core.content.edit
import androidx.core.os.UserManagerCompat
import androidx.preference.PreferenceManager

/**
* Preference constants/helpers.
Expand Down
1 change: 1 addition & 0 deletions source-featured-art/build.gradle
Expand Up @@ -23,6 +23,7 @@ dependencies {
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
implementation "androidx.core:core-ktx:$coreVersion"
implementation "androidx.preference:preference-ktx:$preferenceVersion"
implementation ("androidx.work:work-runtime-ktx:$workManagerVersion") {
exclude module: 'fragment'
}
Expand Down
Expand Up @@ -17,11 +17,11 @@
package com.google.android.apps.muzei.featuredart

import android.content.Context
import android.preference.PreferenceManager
import android.text.format.DateUtils
import android.util.Log
import androidx.core.content.edit
import androidx.core.net.toUri
import androidx.preference.PreferenceManager
import androidx.work.Constraints
import androidx.work.CoroutineWorker
import androidx.work.ExistingWorkPolicy
Expand Down
1 change: 1 addition & 0 deletions wearable/build.gradle
Expand Up @@ -93,6 +93,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-livedata-core-ktx:$lifecycleVersion"
implementation "androidx.fragment:fragment-ktx:$fragmentVersion"
implementation "androidx.exifinterface:exifinterface:$exifInterfaceVersion"
implementation "androidx.preference:preference-ktx:$preferenceVersion"
implementation "androidx.wear:wear:$wearVersion"
compileOnly "com.google.android.wearable:wearable:$wearableVersion"
implementation ("com.google.android.support:wearable:$wearableVersion") {
Expand Down
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.android.apps.muzei

import android.app.Activity
Expand All @@ -23,13 +25,13 @@ import android.os.Build
import android.os.Bundle
import android.preference.Preference
import android.preference.PreferenceActivity
import android.preference.PreferenceManager
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationHelperActivity
import android.support.wearable.complications.ComplicationProviderInfo
import android.support.wearable.complications.ProviderChooserIntent
import android.support.wearable.complications.ProviderInfoRetriever
import androidx.core.content.ContextCompat
import androidx.preference.PreferenceManager
import net.nurik.roman.muzei.R
import java.util.concurrent.Executor
import java.util.concurrent.Executors
Expand Down
Expand Up @@ -33,7 +33,6 @@ import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Message
import android.preference.PreferenceManager
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.SystemProviders
import android.support.wearable.complications.rendering.ComplicationDrawable
Expand All @@ -52,6 +51,7 @@ import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.Observer
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.observe
import androidx.preference.PreferenceManager
import com.google.android.apps.muzei.complications.ArtworkComplicationProviderService
import com.google.android.apps.muzei.datalayer.ActivateMuzeiIntentService
import com.google.android.apps.muzei.featuredart.BuildConfig.FEATURED_ART_AUTHORITY
Expand Down
Expand Up @@ -19,7 +19,6 @@ package com.google.android.apps.muzei.complications
import android.content.Intent
import android.graphics.drawable.Icon
import android.os.Build
import android.preference.PreferenceManager
import android.support.wearable.complications.ComplicationData
import android.support.wearable.complications.ComplicationManager
import android.support.wearable.complications.ComplicationProviderService
Expand All @@ -29,6 +28,7 @@ import androidx.annotation.RequiresApi
import androidx.core.app.TaskStackBuilder
import androidx.core.content.edit
import androidx.core.os.bundleOf
import androidx.preference.PreferenceManager
import com.google.android.apps.muzei.FullScreenActivity
import com.google.android.apps.muzei.ProviderChangedReceiver
import com.google.android.apps.muzei.datalayer.ActivateMuzeiIntentService
Expand Down
Expand Up @@ -19,10 +19,10 @@ package com.google.android.apps.muzei.complications
import android.content.ComponentName
import android.content.Context
import android.os.Build
import android.preference.PreferenceManager
import android.support.wearable.complications.ProviderUpdateRequester
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.preference.PreferenceManager
import androidx.work.Constraints
import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequestBuilder
Expand Down
Expand Up @@ -30,14 +30,14 @@ import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.ResultReceiver
import android.preference.PreferenceManager
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.app.TaskStackBuilder
import androidx.core.content.ContextCompat
import androidx.core.content.edit
import androidx.preference.PreferenceManager
import com.google.android.apps.muzei.ChooseProviderActivity
import com.google.android.apps.muzei.util.toast
import com.google.android.gms.wearable.CapabilityClient
Expand Down

0 comments on commit 7721b3a

Please sign in to comment.