Some improvements

maths
Thomas 2 years ago
parent 27120026c2
commit 77b6c478d1

@ -397,7 +397,11 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
}
} else {
binding.translate.setVisibility(View.GONE);
binding.originalMessage.setVisibility(View.VISIBLE);
if (status != null) {
binding.originalMessage.setVisibility(View.VISIBLE);
} else {
binding.originalMessage.setVisibility(View.INVISIBLE);
}
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
binding.mediaDescription.setVisibility(View.GONE);
}

@ -31,7 +31,6 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
@ -1913,7 +1912,6 @@ public class Helper {
public static int dialogStyle() {
PackageInfo packageInfo = null;
if (R.style.AppThemeBar == currentThemeId || R.style.AppTheme == currentThemeId) {
return R.style.AppThemeAlertDialog;
} else if (R.style.SolarizedAppThemeBar == currentThemeId || R.style.SolarizedAppTheme == currentThemeId) {

@ -25,6 +25,7 @@ import androidx.preference.SwitchPreferenceCompat;
import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R;
import app.fedilab.android.helper.Helper;
public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -37,6 +38,7 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements
private void createPref() {
SwitchPreferenceCompat SET_WATERMARK = findPreference(getString(R.string.SET_WATERMARK));
if (SET_WATERMARK != null) {
SET_WATERMARK.getContext().setTheme(Helper.dialogStyle());
}
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
EditTextPreference SET_WATERMARK_TEXT = findPreference(getString(R.string.SET_WATERMARK_TEXT));
@ -45,6 +47,9 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements
SET_WATERMARK_TEXT.setText(val);
}
MultiSelectListPreference SET_SELECTED_LANGUAGE = findPreference(getString(R.string.SET_SELECTED_LANGUAGE));
if (SET_SELECTED_LANGUAGE != null) {
SET_SELECTED_LANGUAGE.getContext().setTheme(Helper.dialogStyle());
}
}
@Override

@ -64,6 +64,7 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen
}
ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER));
if (SET_LOGO_LAUNCHER != null) {
SET_LOGO_LAUNCHER.getContext().setTheme(Helper.dialogStyle());
SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue()));
}
recreate = false;

@ -37,7 +37,9 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement
@SuppressLint("ApplySharedPref")
private void createPref() {
ListPreference SET_DEFAULT_LOCALE_NEW = findPreference(getString(R.string.SET_DEFAULT_LOCALE_NEW));
if (SET_DEFAULT_LOCALE_NEW != null) {
SET_DEFAULT_LOCALE_NEW.getContext().setTheme(Helper.dialogStyle());
}
Preference SET_TRANSLATE_VALUES_RESET = findPreference(getString(R.string.SET_TRANSLATE_VALUES_RESET));
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
if (SET_TRANSLATE_VALUES_RESET != null) {

@ -36,6 +36,7 @@ import java.util.ArrayList;
import java.util.List;
import app.fedilab.android.R;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.PushHelper;
import app.fedilab.android.helper.settings.TimePreference;
import app.fedilab.android.helper.settings.TimePreferenceDialogFragment;
@ -79,7 +80,9 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
ListPreference SET_NOTIFICATION_TYPE = findPreference(getString(R.string.SET_NOTIFICATION_TYPE));
if (SET_NOTIFICATION_TYPE != null) {
SET_NOTIFICATION_TYPE.getContext().setTheme(Helper.dialogStyle());
}
String[] notificationValues = getResources().getStringArray(R.array.SET_NOTIFICATION_TYPE_VALUE);
if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) {
PreferenceCategory notification_sounds = findPreference("notification_sounds");
@ -105,7 +108,9 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
return;
} else if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[1])) {
ListPreference SET_NOTIFICATION_DELAY_VALUE = findPreference(getString(R.string.SET_NOTIFICATION_DELAY_VALUE));
if (SET_NOTIFICATION_DELAY_VALUE != null) {
SET_NOTIFICATION_DELAY_VALUE.getContext().setTheme(Helper.dialogStyle());
}
ListPreference SET_PUSH_DISTRIBUTOR = findPreference("SET_PUSH_DISTRIBUTOR");
if (SET_PUSH_DISTRIBUTOR != null) {
preferenceScreen.removePreferenceRecursively("SET_PUSH_DISTRIBUTOR");
@ -117,6 +122,7 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
}
ListPreference SET_PUSH_DISTRIBUTOR = findPreference(getString(R.string.SET_PUSH_DISTRIBUTOR));
if (SET_PUSH_DISTRIBUTOR != null) {
SET_PUSH_DISTRIBUTOR.getContext().setTheme(Helper.dialogStyle());
List<String> distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>());
SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity()));
SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0]));

@ -22,6 +22,7 @@ import androidx.preference.EditTextPreference;
import androidx.preference.PreferenceFragmentCompat;
import app.fedilab.android.R;
import app.fedilab.android.helper.Helper;
public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -33,6 +34,9 @@ public class FragmentPrivacySettings extends PreferenceFragmentCompat implements
private void createPref() {
EditTextPreference SET_INVIDIOUS_HOST = findPreference(getString(R.string.SET_INVIDIOUS_HOST));
if (SET_INVIDIOUS_HOST != null) {
SET_INVIDIOUS_HOST.getContext().setTheme(Helper.dialogStyle());
}
}
@Override

@ -79,7 +79,18 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
if (getPreferenceScreen() == null) {
Toasty.error(requireActivity(), getString(R.string.toast_error), Toasty.LENGTH_SHORT).show();
}
ListPreference SET_THEME_BASE = findPreference(getString(R.string.SET_THEME_BASE));
if (SET_THEME_BASE != null) {
SET_THEME_BASE.getContext().setTheme(Helper.dialogStyle());
}
ListPreference SET_THEME_DEFAULT_LIGHT = findPreference(getString(R.string.SET_THEME_DEFAULT_LIGHT));
if (SET_THEME_DEFAULT_LIGHT != null) {
SET_THEME_DEFAULT_LIGHT.getContext().setTheme(Helper.dialogStyle());
}
ListPreference SET_THEME_DEFAULT_DARK = findPreference(getString(R.string.SET_THEME_DEFAULT_DARK));
if (SET_THEME_DEFAULT_DARK != null) {
SET_THEME_DEFAULT_DARK.getContext().setTheme(Helper.dialogStyle());
}
}
}

@ -22,6 +22,7 @@ import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
import app.fedilab.android.R;
import app.fedilab.android.helper.Helper;
public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -34,6 +35,7 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen
private void createPref() {
ListPreference SET_LOAD_MEDIA_TYPE = findPreference(getString(R.string.SET_LOAD_MEDIA_TYPE));
if (SET_LOAD_MEDIA_TYPE != null) {
SET_LOAD_MEDIA_TYPE.getContext().setTheme(Helper.dialogStyle());
}
}

Loading…
Cancel
Save