Provide default text sizes in TuskyBaseTheme (#3108)
These aren't necessary for the app, and are overwritten with the actual style in `BaseActivity.onCreate()`. But if they're missing the Android Studio layout preview renderer crashes.
This commit is contained in:
parent
62a8a4a60a
commit
0def7e7230
2 changed files with 8 additions and 1 deletions
|
@ -82,7 +82,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
|
|||
setTaskDescription(new ActivityManager.TaskDescription(appName, appIcon, recentsBackgroundColor));
|
||||
|
||||
int style = textStyle(preferences.getString("statusTextSize", "medium"));
|
||||
getTheme().applyStyle(style, false);
|
||||
getTheme().applyStyle(style, true);
|
||||
|
||||
if(requiresLogin()) {
|
||||
redirectIfNotLoggedIn();
|
||||
|
|
|
@ -41,6 +41,13 @@
|
|||
<style name="TuskyDialogActivityTheme" parent="@style/TuskyTheme" />
|
||||
|
||||
<style name="TuskyBaseTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Provide default text sizes. These are overwritten in BaseActivity, but
|
||||
if they are missing then the Android Studio layout preview crashes
|
||||
with java.lang.reflect.InvocationTargetException -->
|
||||
<item name="status_text_small">14sp</item>
|
||||
<item name="status_text_medium">16sp</item>
|
||||
<item name="status_text_large">18sp</item>
|
||||
|
||||
<item name="colorPrimary">@color/tusky_blue</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
|
||||
|
|
Loading…
Reference in a new issue