diff --git a/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java b/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java
index 5d1c9196..cc9e29c2 100644
--- a/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java
@@ -15,8 +15,6 @@
package com.keylesspalace.tusky;
-import android.annotation.SuppressLint;
-import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -46,9 +44,7 @@ import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
-@SuppressLint("Registered")
-public class BaseActivity extends AppCompatActivity {
- protected static final int SERVICE_REQUEST_CODE = 8574603; // This number is arbitrary.
+public abstract class BaseActivity extends AppCompatActivity {
public MastodonApi mastodonApi;
protected Dispatcher mastodonApiDispatcher;
@@ -60,12 +56,30 @@ public class BaseActivity extends AppCompatActivity {
redirectIfNotLoggedIn();
createMastodonApi();
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+
/* 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. */
- if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("lightTheme", false)) {
+ if (preferences.getBoolean("lightTheme", false)) {
setTheme(R.style.AppTheme_Light);
}
+
+ int style;
+ switch(preferences.getString("statusTextSize", "small")) {
+ case "large":
+ style = R.style.TextSizeLarge;
+ break;
+ case "medium":
+ style = R.style.TextSizeMedium;
+ break;
+ case "small":
+ default:
+ style = R.style.TextSizeSmall;
+ break;
+ }
+ getTheme().applyStyle(style, false);
+
}
@Override
diff --git a/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.java b/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.java
index 80704422..4ff4590d 100644
--- a/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.java
+++ b/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.java
@@ -31,7 +31,7 @@ import com.keylesspalace.tusky.fragment.PreferencesFragment;
public class PreferencesActivity extends BaseActivity
implements SharedPreferences.OnSharedPreferenceChangeListener {
- private boolean themeSwitched;
+ private boolean restartActivitiesOnExit;
private @XmlRes int currentPreferences;
private @StringRes int currentTitle;
@@ -39,10 +39,10 @@ public class PreferencesActivity extends BaseActivity
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
- themeSwitched = savedInstanceState.getBoolean("themeSwitched");
+ restartActivitiesOnExit = savedInstanceState.getBoolean("restart");
} else {
Bundle extras = getIntent().getExtras();
- themeSwitched = extras != null && extras.getBoolean("themeSwitched");
+ restartActivitiesOnExit = extras != null && extras.getBoolean("restart");
}
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
@@ -91,7 +91,7 @@ public class PreferencesActivity extends BaseActivity
}
private void saveInstanceState(Bundle outState) {
- outState.putBoolean("themeSwitched", themeSwitched);
+ outState.putBoolean("restart", restartActivitiesOnExit);
outState.putInt("preferences", currentPreferences);
outState.putInt("title", currentTitle);
}
@@ -105,7 +105,7 @@ public class PreferencesActivity extends BaseActivity
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
switch (key) {
case "lightTheme": {
- themeSwitched = true;
+ restartActivitiesOnExit = true;
// recreate() could be used instead, but it doesn't have an animation B).
Intent intent = getIntent();
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -117,6 +117,10 @@ public class PreferencesActivity extends BaseActivity
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
break;
}
+ case "statusTextSize": {
+ restartActivitiesOnExit = true;
+ break;
+ }
case "notificationsEnabled": {
boolean enabled = sharedPreferences.getBoolean("notificationsEnabled", true);
if (enabled) {
@@ -146,7 +150,7 @@ public class PreferencesActivity extends BaseActivity
* Either the back stack activities need to all be recreated, or do the easier thing, which
* is hijack the back button press and use it to launch a new MainActivity and clear the
* back stack. */
- if (themeSwitched) {
+ if (restartActivitiesOnExit) {
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
diff --git a/app/src/main/res/drawable/compose_button_colors.xml b/app/src/main/res/drawable/compose_button_colors.xml
index 195d0894..2487c7a3 100644
--- a/app/src/main/res/drawable/compose_button_colors.xml
+++ b/app/src/main/res/drawable/compose_button_colors.xml
@@ -2,21 +2,31 @@
-
+
-
-
+
+
+
+
-
+
-
-
+
+
+
+
diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml
index 1e111e4f..3b4d7c24 100644
--- a/app/src/main/res/layout/activity_account.xml
+++ b/app/src/main/res/layout/activity_account.xml
@@ -66,6 +66,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
+ android:textSize="?attr/status_text_large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -75,6 +76,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
+ android:textSize="?attr/status_text_medium"
android:text="@string/follows_you"
android:textColor="?android:textColorPrimary"
app:layout_constraintEnd_toEndOf="@id/follow_btn"
@@ -87,7 +89,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
- android:textSize="18sp"
+ android:textSize="?attr/status_text_large"
android:textStyle="normal|bold"
app:layout_constraintTop_toBottomOf="@id/account_avatar"
tools:text="Tusky Mastodon Client" />
@@ -98,6 +100,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
+ android:textSize="?attr/status_text_medium"
android:textColor="?android:textColorSecondary"
app:layout_constraintTop_toBottomOf="@id/account_display_name"
tools:text="\@Tusky" />
@@ -123,6 +126,7 @@
android:layout_below="@id/account_username"
android:paddingBottom="16dp"
android:paddingTop="10dp"
+ android:textSize="?attr/status_text_medium"
android:textColor="?android:textColorTertiary"
app:layout_constraintTop_toBottomOf="@id/account_username"
tools:text="This is a test description" />
@@ -137,6 +141,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
+ android:textSize="?attr/status_text_medium"
app:layout_constraintTop_toBottomOf="@id/account_note"
tools:text="3000 Followers" />
@@ -149,6 +154,7 @@
app:layout_constraintEnd_toStartOf="@id/statuses_btn"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@id/followers_tv"
+ android:textSize="?attr/status_text_medium"
app:layout_constraintTop_toTopOf="@id/followers_tv"
tools:text="500 Following" />
@@ -158,6 +164,7 @@
android:layout_height="wrap_content"
android:textColor="@color/account_tab_font_color"
app:layout_constraintEnd_toEndOf="parent"
+ android:textSize="?attr/status_text_medium"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@id/following_tv"
app:layout_constraintTop_toTopOf="@id/followers_tv"
@@ -194,6 +201,7 @@
android:background="?android:colorBackground"
app:tabGravity="fill"
app:tabMaxWidth="0dp"
+ app:tabTextAppearance="@style/TuskyTabAppearance"
app:tabSelectedTextColor="?attr/colorAccent">
+ android:textSize="?attr/status_text_large" />
diff --git a/app/src/main/res/layout/item_account.xml b/app/src/main/res/layout/item_account.xml
index c08b9e7f..775892a4 100644
--- a/app/src/main/res/layout/item_account.xml
+++ b/app/src/main/res/layout/item_account.xml
@@ -31,7 +31,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
- android:textSize="16sp"
+ android:textSize="?attr/status_text_large"
android:textStyle="normal|bold"
tools:text="Display name" />
@@ -42,7 +42,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
- android:textSize="14sp"
+ android:textSize="?attr/status_text_medium"
tools:text="\@username" />
diff --git a/app/src/main/res/layout/item_autocomplete.xml b/app/src/main/res/layout/item_autocomplete.xml
index f2674615..cf8e3d89 100644
--- a/app/src/main/res/layout/item_autocomplete.xml
+++ b/app/src/main/res/layout/item_autocomplete.xml
@@ -2,49 +2,45 @@
+ android:gravity="center_vertical"
+ android:padding="8dp">
+ android:contentDescription="@null"
+ android:src="@drawable/avatar_default" />
+ android:gravity="center_vertical"
+ android:orientation="vertical">
-
-
+ android:maxLines="1"
+ android:textColor="?android:textColorSecondary"
+ android:textSize="?attr/status_text_medium" />
diff --git a/app/src/main/res/layout/item_blocked_user.xml b/app/src/main/res/layout/item_blocked_user.xml
index 93c6c7a1..81ba686c 100644
--- a/app/src/main/res/layout/item_blocked_user.xml
+++ b/app/src/main/res/layout/item_blocked_user.xml
@@ -51,7 +51,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
- android:textSize="16sp"
+ android:textSize="?attr/status_text_large"
android:textStyle="normal|bold"
tools:text="Display name" />
@@ -62,7 +62,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
- android:textSize="14sp"
+ android:textSize="?attr/status_text_medium"
tools:text="\@username" />
diff --git a/app/src/main/res/layout/item_follow.xml b/app/src/main/res/layout/item_follow.xml
index 1598ccbb..cb9faab9 100644
--- a/app/src/main/res/layout/item_follow.xml
+++ b/app/src/main/res/layout/item_follow.xml
@@ -26,6 +26,7 @@
android:paddingLeft="28dp"
android:paddingStart="28dp"
android:textColor="?android:textColorTertiary"
+ android:textSize="?attr/status_text_medium"
tools:text="Someone followed you" />
+ android:scaleType="fitCenter"
+ android:textSize="?attr/status_text_medium" />
@@ -65,6 +68,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
+ android:textSize="?attr/status_text_medium"
tools:text="\@testuser" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_follow_request.xml b/app/src/main/res/layout/item_follow_request.xml
index 441f2f7c..a91be264 100644
--- a/app/src/main/res/layout/item_follow_request.xml
+++ b/app/src/main/res/layout/item_follow_request.xml
@@ -36,7 +36,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
- android:textSize="16sp"
+ android:textSize="?attr/status_text_large"
android:textStyle="normal|bold"
tools:text="Display name" />
@@ -47,7 +47,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
- android:textSize="14sp"
+ android:textSize="?attr/status_text_medium"
tools:text="\@username" />
diff --git a/app/src/main/res/layout/item_footer.xml b/app/src/main/res/layout/item_footer.xml
index a1aa501e..92d5ff73 100644
--- a/app/src/main/res/layout/item_footer.xml
+++ b/app/src/main/res/layout/item_footer.xml
@@ -1,8 +1,8 @@
+ android:layout_height="match_parent">
+ android:textSize="?attr/status_text_medium" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_hashtag.xml b/app/src/main/res/layout/item_hashtag.xml
index baf4bd4c..7f206641 100644
--- a/app/src/main/res/layout/item_hashtag.xml
+++ b/app/src/main/res/layout/item_hashtag.xml
@@ -1,7 +1,7 @@
-
+ android:padding="16dp"
+ android:textSize="?attr/status_text_medium" />
diff --git a/app/src/main/res/layout/item_muted_user.xml b/app/src/main/res/layout/item_muted_user.xml
index 65f26a22..0f6918d6 100644
--- a/app/src/main/res/layout/item_muted_user.xml
+++ b/app/src/main/res/layout/item_muted_user.xml
@@ -52,7 +52,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
- android:textSize="16sp"
+ android:textSize="?attr/status_text_large"
android:textStyle="normal|bold"
tools:text="Display name" />
@@ -63,7 +63,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
- android:textSize="14sp"
+ android:textSize="?attr/status_text_medium"
tools:text="\@username" />
diff --git a/app/src/main/res/layout/item_report_status.xml b/app/src/main/res/layout/item_report_status.xml
index 8a0e4249..5c5f5899 100644
--- a/app/src/main/res/layout/item_report_status.xml
+++ b/app/src/main/res/layout/item_report_status.xml
@@ -5,16 +5,17 @@
android:orientation="horizontal">
+ android:padding="8dp"
+ android:textSize="?attr/status_text_medium" />
diff --git a/app/src/main/res/layout/item_saved_toot.xml b/app/src/main/res/layout/item_saved_toot.xml
index 0d2b9d11..4b02f110 100644
--- a/app/src/main/res/layout/item_saved_toot.xml
+++ b/app/src/main/res/layout/item_saved_toot.xml
@@ -10,7 +10,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.91"
- android:padding="8dp" />
+ android:padding="8dp"
+ android:textSize="?attr/status_text_medium" />
@@ -83,6 +85,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
+ android:textSize="?attr/status_text_medium"
tools:text="\@Entenhausen" />
@@ -115,7 +119,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingMultiplier="1.1"
- android:textColor="?android:textColorPrimary" />
+ android:textColor="?android:textColorPrimary"
+ android:textSize="?attr/status_text_medium" />
+ android:textSize="?attr/status_text_medium" />
@@ -149,6 +154,7 @@
android:focusable="true"
android:lineSpacingMultiplier="1.1"
android:textColor="?android:textColorPrimary"
+ android:textSize="?attr/status_text_medium"
tools:text="This is a status" />
diff --git a/app/src/main/res/layout/item_status_detailed.xml b/app/src/main/res/layout/item_status_detailed.xml
index f76b854d..c174cf92 100644
--- a/app/src/main/res/layout/item_status_detailed.xml
+++ b/app/src/main/res/layout/item_status_detailed.xml
@@ -37,6 +37,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
+ android:textSize="?attr/status_text_medium"
android:textStyle="normal|bold"
tools:text="Display Name" />
@@ -48,6 +49,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
+ android:textSize="?attr/status_text_medium"
tools:text="\@ConnyDuck\@mastodon.social" />
@@ -67,7 +69,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingMultiplier="1.1"
- android:textColor="?android:textColorPrimary" />
+ android:textColor="?android:textColorPrimary"
+ android:textSize="?attr/status_text_medium" />
+ android:textOn="@string/status_content_warning_show_less"
+ android:textSize="?attr/status_text_medium" />
@@ -94,7 +98,8 @@
android:layout_marginBottom="4dp"
android:focusable="true"
android:lineSpacingMultiplier="1.1"
- android:textColor="?android:textColorPrimary" />
+ android:textColor="?android:textColorPrimary"
+ android:textSize="?attr/status_text_medium" />
+ android:textColor="?android:textColorPrimary"
+ android:textSize="?attr/status_text_medium" />
+ android:textColor="?android:textColorSecondary"
+ android:textSize="?attr/status_text_medium" />
+ android:textColor="?android:textColorTertiary"
+ android:textSize="?attr/status_text_medium" />
@@ -278,6 +286,7 @@
android:padding="8dp"
android:textAlignment="center"
android:textColor="@android:color/white"
+ android:textSize="?attr/status_text_medium"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -291,6 +300,7 @@
android:background="?attr/selectableItemBackground"
android:drawablePadding="4dp"
android:gravity="center_vertical"
+ android:textSize="?attr/status_text_medium"
android:visibility="gone" />
@@ -302,7 +312,8 @@
android:layout_below="@id/status_media_preview_container"
android:layout_marginBottom="6dp"
android:layout_marginTop="10dp"
- android:textColor="?android:textColorTertiary" />
+ android:textColor="?android:textColorTertiary"
+ android:textSize="?attr/status_text_medium" />
+ android:layout_height="wrap_content"
+ android:textSize="?attr/status_text_medium" />
+ android:layout_height="wrap_content"
+ android:textSize="?attr/status_text_medium" />
@@ -62,6 +64,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorTertiary"
+ android:textSize="?attr/status_text_medium"
tools:text="\@Entenhausen" />
@@ -96,8 +100,10 @@
android:layout_height="wrap_content"
android:lineSpacingMultiplier="1.1"
android:textColor="?android:textColorTertiary"
+ android:textSize="?attr/status_text_medium"
tools:text="Example CW text" />
+
+ android:textSize="?attr/status_text_medium" />
@@ -127,6 +133,7 @@
android:lineSpacingMultiplier="1.1"
android:paddingBottom="10dp"
android:textColor="?android:textColorTertiary"
+ android:textSize="?attr/status_text_medium"
tools:text="Example status here" />
\ No newline at end of file
+ android:textColor="?attr/colorAccent"
+ android:textSize="?attr/status_text_medium" />
\ No newline at end of file
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 1647c1bf..d0aa9d89 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -151,12 +151,20 @@
- 2 Stunden
-
+
- Öffentlich
- Nicht gelistet
- Nur Folgende
+ Schriftgröße
+
+
+ - Klein
+ - Normal
+ - Groß
+
+
%s hat dich erwähnt
%1$s, %2$s, %3$s und %4$d andere
%1$s, %2$s, und %3$s
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
index a5184b55..0e56c526 100644
--- a/app/src/main/res/values/attrs.xml
+++ b/app/src/main/res/values/attrs.xml
@@ -46,5 +46,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml
index a290bae5..f964ce9d 100644
--- a/app/src/main/res/values/donottranslate.xml
+++ b/app/src/main/res/values/donottranslate.xml
@@ -19,9 +19,15 @@
- 120
-
+
- public
- unlisted
- private
+
+
+ - small
+ - medium
+ - large
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index bde69c8b..d90719fc 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -191,12 +191,20 @@
Default post privacy
Publishing
-
+
- Public
- Unlisted
- Followers-only
+ Status text size
+
+
+ - Small
+ - Medium
+ - Large
+
+
New Mentions
Notifications about new mentions
New Followers
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 829d8778..f534b970 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,5 +1,21 @@
+
+
+
+
@@ -19,7 +35,6 @@
+
+
+
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 40b4be60..d9429214 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -9,6 +9,14 @@
android:key="lightTheme"
android:title="@string/pref_title_light_theme" />
+
+