parent
8aec4a2717
commit
a74c285f77
|
@ -23,11 +23,13 @@ import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import org.joinmastodon.android.GlobalUserPreferences;
|
||||||
import org.joinmastodon.android.R;
|
import org.joinmastodon.android.R;
|
||||||
import org.joinmastodon.android.api.MastodonAPIController;
|
import org.joinmastodon.android.api.MastodonAPIController;
|
||||||
import org.joinmastodon.android.model.Attachment;
|
import org.joinmastodon.android.model.Attachment;
|
||||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||||
import org.joinmastodon.android.ui.photoviewer.PhotoViewer;
|
import org.joinmastodon.android.ui.photoviewer.PhotoViewer;
|
||||||
|
import org.joinmastodon.android.ui.utils.ColorPalette;
|
||||||
import org.joinmastodon.android.ui.utils.UiUtils;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
import org.joinmastodon.android.ui.views.FixedAspectRatioImageView;
|
import org.joinmastodon.android.ui.views.FixedAspectRatioImageView;
|
||||||
|
|
||||||
|
@ -61,6 +63,7 @@ public class ComposeImageDescriptionFragment extends MastodonToolbarFragment imp
|
||||||
public void onAttach(Activity activity){
|
public void onAttach(Activity activity){
|
||||||
super.onAttach(activity);
|
super.onAttach(activity);
|
||||||
themeWrapper=new ContextThemeWrapper(activity, R.style.Theme_Mastodon_Dark);
|
themeWrapper=new ContextThemeWrapper(activity, R.style.Theme_Mastodon_Dark);
|
||||||
|
ColorPalette.palettes.get(GlobalUserPreferences.color).apply(themeWrapper, GlobalUserPreferences.ThemePreference.DARK);
|
||||||
setTitle(R.string.add_alt_text);
|
setTitle(R.string.add_alt_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package org.joinmastodon.android.ui.utils;
|
||||||
|
|
||||||
import static org.joinmastodon.android.GlobalUserPreferences.ColorPreference;
|
import static org.joinmastodon.android.GlobalUserPreferences.ColorPreference;
|
||||||
import static org.joinmastodon.android.GlobalUserPreferences.ThemePreference;
|
import static org.joinmastodon.android.GlobalUserPreferences.ThemePreference;
|
||||||
import static org.joinmastodon.android.GlobalUserPreferences.theme;
|
|
||||||
import static org.joinmastodon.android.GlobalUserPreferences.trueBlackTheme;
|
import static org.joinmastodon.android.GlobalUserPreferences.trueBlackTheme;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -50,6 +49,10 @@ public class ColorPalette {
|
||||||
public ColorPalette black(@StyleRes int res, @StyleRes int auto) { dark = res; autoBlack = auto; return this; }
|
public ColorPalette black(@StyleRes int res, @StyleRes int auto) { dark = res; autoBlack = auto; return this; }
|
||||||
|
|
||||||
public void apply(Context context) {
|
public void apply(Context context) {
|
||||||
|
apply(context, GlobalUserPreferences.theme);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void apply(Context context, ThemePreference theme) {
|
||||||
if (!((dark != 0 && autoDark != 0) || (black != 0 && autoBlack != 0) || light != 0 || base != 0)) {
|
if (!((dark != 0 && autoDark != 0) || (black != 0 && autoBlack != 0) || light != 0 || base != 0)) {
|
||||||
throw new IllegalStateException("Invalid color scheme definition");
|
throw new IllegalStateException("Invalid color scheme definition");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue