Skip to content

Commit

Permalink
Update MusicFragment.java
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlbo committed Mar 26, 2024
1 parent 3db483a commit 2b87ace
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ImagineArrayAdapter.ImagineArrayAdapterItem> items = Arrays.asList(
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 2b87ace

Please sign in to comment.