From 2b87aceed974db8b5b67f898a08903f73f64ae7d Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:46:58 +0300 Subject: [PATCH] Update MusicFragment.java --- .../ru/vtosters/lite/ui/fragments/MusicFragment.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ru/vtosters/lite/ui/fragments/MusicFragment.java b/app/src/main/java/ru/vtosters/lite/ui/fragments/MusicFragment.java index eb4e70bc2..96ef4ca82 100644 --- a/app/src/main/java/ru/vtosters/lite/ui/fragments/MusicFragment.java +++ b/app/src/main/java/ru/vtosters/lite/ui/fragments/MusicFragment.java @@ -3,6 +3,7 @@ import android.annotation.SuppressLint; import android.content.Context; import android.os.Bundle; +import android.view.MotionEvent; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.EditText; @@ -100,7 +101,7 @@ public void onCreate(Bundle bundle) { getPreferenceScreen(), "autocache_params", getString(com.vtosters.lite.R.string.autocache_title), - getString(com.vtosters.lite.R.string.autocache_summ), + getAutocacheSumm(), null, preference -> { List items = Arrays.asList( @@ -350,6 +351,15 @@ private void lastfmAuth(Context ctx) { .show(); } + private static String getAutocacheSumm() { + int autocache = Preferences.autocache(); + return switch (autocache) { + case 1 -> "Только для своих"; + case 2 -> "Кешировать всё"; + default -> "Отключено"; + }; + } + public void updateLastFmPref() { if (LastFMScrobbler.isLoggedIn()) { findPreference("lastfm_auth").setSummary(getString(com.vtosters.lite.R.string.lastfm_authorized_as) + " " + LastFMScrobbler.getUserName());