mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-09 08:18:44 +01:00
removed useless window overlay on compose dialog
fixed action button in host mappings list
This commit is contained in:
parent
05d367388a
commit
72aaf3a887
@ -136,7 +136,6 @@ import static android.os.Environment.getExternalStorageState;
|
||||
import static android.text.TextUtils.isEmpty;
|
||||
import static org.mariotaku.twidere.util.ParseUtils.parseString;
|
||||
import static org.mariotaku.twidere.util.ThemeUtils.getComposeThemeResource;
|
||||
import static org.mariotaku.twidere.util.ThemeUtils.getWindowContentOverlayForCompose;
|
||||
import static org.mariotaku.twidere.util.Utils.addIntentToMenu;
|
||||
import static org.mariotaku.twidere.util.Utils.copyStream;
|
||||
import static org.mariotaku.twidere.util.Utils.getAccountIds;
|
||||
@ -590,7 +589,6 @@ public class ComposeActivity extends ThemedFragmentActivity implements TextWatch
|
||||
mLocationContainer = findViewById(R.id.location_container);
|
||||
mLocationIcon = (ActionIconView) findViewById(R.id.location_icon);
|
||||
mLocationText = (TextView) findViewById(R.id.location_text);
|
||||
ViewAccessor.setBackground(findViewById(R.id.compose_content), getWindowContentOverlayForCompose(this));
|
||||
}
|
||||
|
||||
public void removeAllMedia(final List<ParcelableMediaUpdate> list) {
|
||||
|
@ -399,20 +399,6 @@ public class ThemeUtils implements Constants {
|
||||
return applyActionBarDrawable(context, d, isTransparentBackground(themeRes));
|
||||
}
|
||||
|
||||
public static int getActionBarThemeResource(final Context context) {
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{R.attr.actionBarTheme,
|
||||
R.attr.actionBarWidgetTheme, android.R.attr.actionBarTheme,
|
||||
android.R.attr.actionBarWidgetTheme});
|
||||
final int resId;
|
||||
if (a.hasValue(0) || a.hasValue(1)) {
|
||||
resId = a.hasValue(0) ? a.getResourceId(0, 0) : a.getResourceId(1, 0);
|
||||
} else {
|
||||
resId = a.hasValue(2) ? a.getResourceId(2, 0) : a.getResourceId(3, 0);
|
||||
}
|
||||
a.recycle();
|
||||
return resId;
|
||||
}
|
||||
|
||||
public static Context getActionBarContext(final Context context) {
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{R.attr.actionBarTheme,
|
||||
R.attr.actionBarWidgetTheme, android.R.attr.actionBarTheme,
|
||||
@ -462,10 +448,6 @@ public class ThemeUtils implements Constants {
|
||||
return applyActionBarDrawable(context, d, isTransparentBackground(themeRes));
|
||||
}
|
||||
|
||||
public static int getActionIconColor(final Context context) {
|
||||
return getActionIconColor(getThemeResource(context));
|
||||
}
|
||||
|
||||
public static int getActionIconColor(final int themeRes) {
|
||||
switch (themeRes) {
|
||||
case R.style.Theme_Twidere_Light:
|
||||
@ -878,11 +860,6 @@ public class ThemeUtils implements Constants {
|
||||
return d;
|
||||
}
|
||||
|
||||
public static Drawable getWindowContentOverlayForCompose(final Context context) {
|
||||
final int themeRes = getThemeResource(context);
|
||||
return getWindowContentOverlay(new ContextThemeWrapper(context, themeRes));
|
||||
}
|
||||
|
||||
public static boolean isDarkTheme(final Context context) {
|
||||
return isDarkTheme(getThemeResource(context));
|
||||
}
|
||||
@ -902,18 +879,6 @@ public class ThemeUtils implements Constants {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isFloatingWindow(final Context context) {
|
||||
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{android.R.attr.windowIsFloating});
|
||||
final boolean b = a.getBoolean(0, false);
|
||||
a.recycle();
|
||||
return b;
|
||||
}
|
||||
|
||||
public static boolean isSolidBackground(final Context context) {
|
||||
return VALUE_THEME_BACKGROUND_SOLID.equals(getThemeBackgroundOption(context));
|
||||
}
|
||||
|
||||
public static boolean isTransparentBackground(final Context context) {
|
||||
return isTransparentBackground(getThemeResource(context));
|
||||
}
|
||||
@ -968,14 +933,6 @@ public class ThemeUtils implements Constants {
|
||||
}
|
||||
|
||||
|
||||
public static boolean shouldApplyColorFilterToActionIcons(final Context context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean shouldApplyColorFilterToActionIcons(final int res) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static Drawable applyActionBarDrawable(final Context context, final Drawable d, final boolean applyAlpha) {
|
||||
if (d == null) return null;
|
||||
d.mutate();
|
||||
@ -994,14 +951,6 @@ public class ThemeUtils implements Constants {
|
||||
return (View) constructor.newInstance(context, attrs);
|
||||
}
|
||||
|
||||
public static int findAttributeResourceValue(AttributeSet attrs, String name, int defaultValue) {
|
||||
for (int i = 0, j = attrs.getAttributeCount(); i < j; i++) {
|
||||
if (attrs.getAttributeName(i).equals(name))
|
||||
return attrs.getAttributeResourceValue(i, defaultValue);
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static int getThemeColor(Context context, int themeResourceId) {
|
||||
final Context appContext = context.getApplicationContext();
|
||||
final Resources res = appContext.getResources();
|
||||
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<menu xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/add"
|
||||
android:icon="@drawable/ic_action_add"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/add_host_mapping"/>
|
||||
android:showAsAction="always"
|
||||
android:title="@string/add_host_mapping"
|
||||
tools:ignore="AppCompatResource"/>
|
||||
|
||||
</menu>
|
Loading…
x
Reference in New Issue
Block a user