mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-21 10:15:23 +12:00
add functions for dynamic color option
This commit is contained in:
parent
7543b04618
commit
c2c713f32c
1 changed files with 16 additions and 0 deletions
|
@ -3,6 +3,7 @@ package com.panda3ds.pandroid.app.preferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.preference.SwitchPreference;
|
||||||
|
|
||||||
import com.panda3ds.pandroid.R;
|
import com.panda3ds.pandroid.R;
|
||||||
import com.panda3ds.pandroid.app.BaseActivity;
|
import com.panda3ds.pandroid.app.BaseActivity;
|
||||||
|
@ -23,5 +24,20 @@ public class AppearancePreferences extends BasePreferenceFragment {
|
||||||
GlobalConfig.set(GlobalConfig.KEY_APP_THEME, (int) value);
|
GlobalConfig.set(GlobalConfig.KEY_APP_THEME, (int) value);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
setItemClick("dynamic_colors", pref -> GlobalConfig.set(GlobalConfig.KEY_DYNAMIC_COLORS, ((SwitchPreference) pref).isChecked()));
|
||||||
|
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refresh() {
|
||||||
|
((SwitchPreference) findPreference("dynamic_colors")).setChecked(GlobalConfig.get(GlobalConfig.KEY_DYNAMIC_COLORS));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue