kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix quote text sizing.
rodzic
7bf2ae3d5e
commit
28edd18e55
|
@ -1482,7 +1482,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||||
|
|
||||||
quoteView.setWallpaperEnabled(hasWallpaper);
|
quoteView.setWallpaperEnabled(hasWallpaper);
|
||||||
quoteView.setVisibility(View.VISIBLE);
|
quoteView.setVisibility(View.VISIBLE);
|
||||||
quoteView.setTextSize(TypedValue.COMPLEX_UNIT_SP, SignalStore.settings().getMessageFontSize());
|
quoteView.setTextSize(TypedValue.COMPLEX_UNIT_SP, SignalStore.settings().getMessageQuoteFontSize(context));
|
||||||
quoteView.getLayoutParams().width = ViewGroup.LayoutParams.WRAP_CONTENT;
|
quoteView.getLayoutParams().width = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||||
|
|
||||||
quoteView.setOnClickListener(view -> {
|
quoteView.setOnClickListener(view -> {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import androidx.lifecycle.LiveData;
|
||||||
|
|
||||||
import org.signal.core.util.concurrent.SignalExecutors;
|
import org.signal.core.util.concurrent.SignalExecutors;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.mms.SentMediaQuality;
|
import org.thoughtcrime.securesms.mms.SentMediaQuality;
|
||||||
|
@ -194,6 +195,15 @@ public final class SettingsValues extends SignalStoreValues {
|
||||||
return getInteger(MESSAGE_FONT_SIZE, TextSecurePreferences.getMessageBodyTextSize(ApplicationDependencies.getApplication()));
|
return getInteger(MESSAGE_FONT_SIZE, TextSecurePreferences.getMessageBodyTextSize(ApplicationDependencies.getApplication()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMessageQuoteFontSize(@NonNull Context context) {
|
||||||
|
String messageFontSize = String.valueOf(getMessageFontSize());
|
||||||
|
String[] messageSizes = context.getResources().getStringArray(R.array.pref_message_font_size_values);
|
||||||
|
String[] quoteSizes = context.getResources().getStringArray(R.array.pref_message_font_quote_size_values);
|
||||||
|
int index = Arrays.binarySearch(messageSizes, messageFontSize);
|
||||||
|
|
||||||
|
return Integer.parseInt(quoteSizes[index]);
|
||||||
|
}
|
||||||
|
|
||||||
public void setMessageFontSize(int messageFontSize) {
|
public void setMessageFontSize(int messageFontSize) {
|
||||||
putInteger(MESSAGE_FONT_SIZE, messageFontSize);
|
putInteger(MESSAGE_FONT_SIZE, messageFontSize);
|
||||||
}
|
}
|
||||||
|
@ -421,10 +431,14 @@ public final class SettingsValues extends SignalStoreValues {
|
||||||
|
|
||||||
public static CensorshipCircumventionEnabled deserialize(int value) {
|
public static CensorshipCircumventionEnabled deserialize(int value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 0: return DEFAULT;
|
case 0:
|
||||||
case 1: return ENABLED;
|
return DEFAULT;
|
||||||
case 2: return DISABLED;
|
case 1:
|
||||||
default: throw new IllegalArgumentException("Bad value: " + value);
|
return ENABLED;
|
||||||
|
case 2:
|
||||||
|
return DISABLED;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Bad value: " + value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,10 +462,14 @@ public final class SettingsValues extends SignalStoreValues {
|
||||||
|
|
||||||
public static @NonNull Theme deserialize(@NonNull String value) {
|
public static @NonNull Theme deserialize(@NonNull String value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case "system": return SYSTEM;
|
case "system":
|
||||||
case "light": return LIGHT;
|
return SYSTEM;
|
||||||
case "dark": return DARK;
|
case "light":
|
||||||
default: throw new IllegalArgumentException("Unrecognized value " + value);
|
return LIGHT;
|
||||||
|
case "dark":
|
||||||
|
return DARK;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unrecognized value " + value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -344,10 +344,17 @@
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="pref_message_font_size_values">
|
<string-array name="pref_message_font_size_values">
|
||||||
<item>13</item>
|
<item>14</item>
|
||||||
<item>16</item>
|
<item>16</item>
|
||||||
<item>20</item>
|
<item>22</item>
|
||||||
<item>30</item>
|
<item>28</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="pref_message_font_quote_size_values">
|
||||||
|
<item>12</item>
|
||||||
|
<item>14</item>
|
||||||
|
<item>18</item>
|
||||||
|
<item>22</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="pref_notification_priority_entries">
|
<string-array name="pref_notification_priority_entries">
|
||||||
|
|
Ładowanie…
Reference in New Issue