Uses the system theme as default theme (#3813)
Set the "System Design" as the default theme. This ensures that the app's initial behaviour respect's the user's system-wide theme choice, while still allowing the user to adjust it later. This is only done for new installs of Tusky. If the user is upgrading from a previous release and they did not have an explicit theme set then the dark theme is used, and the UX does not change.
This commit is contained in:
parent
dd0cf9c366
commit
85888ac238
6 changed files with 31 additions and 13 deletions
|
|
@ -56,6 +56,8 @@ import java.util.List;
|
|||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static com.keylesspalace.tusky.settings.PrefKeys.APP_THEME;
|
||||
|
||||
public abstract class BaseActivity extends AppCompatActivity implements Injectable {
|
||||
private static final String TAG = "BaseActivity";
|
||||
|
||||
|
|
@ -74,7 +76,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
|
|||
/* There isn't presently a way to globally change the theme of a whole application at
|
||||
* runtime, just individual activities. So, each activity has to set its theme before any
|
||||
* views are created. */
|
||||
String theme = preferences.getString("appTheme", ThemeUtils.APP_THEME_DEFAULT);
|
||||
String theme = preferences.getString(APP_THEME, ThemeUtils.APP_THEME_DEFAULT);
|
||||
Log.d("activeTheme", theme);
|
||||
if (theme.equals("black")) {
|
||||
setTheme(R.style.TuskyBlackTheme);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue