Small improvements

This commit is contained in:
M66B 2020-07-02 12:48:24 +02:00
parent aa05caf488
commit 89a1e0c5d4
4 changed files with 16 additions and 5 deletions

View File

@ -755,7 +755,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
scale = scale * factor;
String perc = Math.round(scale * 100) + " %";
String perc = Math.round(scale * message_zoom) + " %";
if (toast != null)
toast.cancel();
toast = ToastEx.makeText(context, perc, Toast.LENGTH_SHORT);

View File

@ -624,11 +624,11 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
try {
int timeout = (s.length() > 0 ? Integer.parseInt(s.toString()) : 0);
if (timeout == 0)
int zoom = (s.length() > 0 ? Integer.parseInt(s.toString()) : 0);
if (zoom == 0)
prefs.edit().remove("message_zoom").apply();
else
prefs.edit().putInt("message_zoom", timeout).apply();
prefs.edit().putInt("message_zoom", zoom).apply();
} catch (NumberFormatException ex) {
Log.e(ex);
}

View File

@ -846,6 +846,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessageZoom" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvMessageZoomPercentage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="%"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintBottom_toBottomOf="@id/etMessageZoom"
app:layout_constraintStart_toEndOf="@id/etMessageZoom"
app:layout_constraintTop_toTopOf="@id/etMessageZoom" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swContrast"
android:layout_width="0dp"

View File

@ -358,7 +358,7 @@
<string name="title_advanced_addresses">Expand address details by default</string>
<string name="title_advanced_attachments_alt">Show attachments after the message text</string>
<string name="title_advanced_thumbnails">Show image thumbnails after the message text</string>
<string name="title_advanced_message_text_zoom">Default message text zoom (%)</string>
<string name="title_advanced_message_text_zoom">Default message text zoom</string>
<string name="title_advanced_contrast">Use high contrast for message text</string>
<string name="title_advanced_monospaced">Use monospaced font for message text by default</string>
<string name="title_advanced_text_color">Use text colors</string>