mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-07 03:53:25 +01:00
improved window background
This commit is contained in:
parent
507f9c6188
commit
411ebf8e26
@ -249,8 +249,10 @@ public abstract class BasePreferenceActivity extends AppCompatPreferenceActivity
|
||||
mCurrentThemeBackgroundOption = getThemeBackgroundOption();
|
||||
mCurrentThemeFontFamily = getThemeFontFamily();
|
||||
super.onApplyThemeResource(theme, resid, first);
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), mCurrentThemeResource,
|
||||
mCurrentThemeBackgroundOption, mCurrentThemeBackgroundAlpha);
|
||||
if (shouldApplyWindowBackground()) {
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), mCurrentThemeResource,
|
||||
mCurrentThemeBackgroundOption, mCurrentThemeBackgroundAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -264,6 +266,10 @@ public abstract class BasePreferenceActivity extends AppCompatPreferenceActivity
|
||||
setupActionBar();
|
||||
}
|
||||
|
||||
protected boolean shouldApplyWindowBackground() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setupActionBar() {
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar == null) return;
|
||||
|
@ -119,8 +119,14 @@ public abstract class BaseThemedActivity extends Activity implements IThemedActi
|
||||
mCurrentThemeBackgroundOption = getThemeBackgroundOption();
|
||||
mProfileImageStyle = Utils.getProfileImageStyle(this);
|
||||
super.onApplyThemeResource(theme, resId, first);
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), mCurrentThemeResource,
|
||||
mCurrentThemeBackgroundOption, mCurrentThemeBackgroundAlpha);
|
||||
if (shouldApplyWindowBackground()) {
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), mCurrentThemeResource,
|
||||
mCurrentThemeBackgroundOption, mCurrentThemeBackgroundAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean shouldApplyWindowBackground() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -873,9 +873,8 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
||||
mRightDrawerContainer.setScrollScale(mSlidingMenu.getBehindScrollScale());
|
||||
mSlidingMenu.setBehindCanvasTransformer(new ListenerCanvasTransformer(this));
|
||||
final Window window = getWindow();
|
||||
ThemeUtils.applyWindowBackground(this, mSlidingMenu.getContent(),
|
||||
getCurrentThemeResourceId(), getThemeBackgroundOption(),
|
||||
getCurrentThemeBackgroundAlpha());
|
||||
ThemeUtils.applyWindowBackground(this, mSlidingMenu.getContent(), getCurrentThemeResourceId(),
|
||||
getThemeBackgroundOption(), getCurrentThemeBackgroundAlpha());
|
||||
window.setBackgroundDrawable(new EmptyDrawable());
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,11 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
return super.handleKeyboardShortcutSingle(handler, keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldApplyWindowBackground() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private ParcelableStatus getStatus() {
|
||||
return getIntent().getParcelableExtra(EXTRA_STATUS);
|
||||
}
|
||||
@ -821,6 +826,5 @@ public final class MediaViewerActivity extends BaseAppCompatActivity implements
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -132,8 +132,10 @@ public abstract class ThemedAppCompatActivity extends AppCompatActivity implemen
|
||||
mCurrentThemeBackgroundOption = getThemeBackgroundOption();
|
||||
mCurrentThemeFontFamily = getThemeFontFamily();
|
||||
super.onApplyThemeResource(theme, resid, first);
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), resid,
|
||||
mCurrentThemeBackgroundOption, mCurrentThemeBackgroundAlpha);
|
||||
if (shouldApplyWindowBackground()) {
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), resid, mCurrentThemeBackgroundOption,
|
||||
mCurrentThemeBackgroundAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,4 +159,8 @@ public abstract class ThemedAppCompatActivity extends AppCompatActivity implemen
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean shouldApplyWindowBackground() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -144,8 +144,10 @@ public abstract class ThemedFragmentActivity extends FragmentActivity implements
|
||||
mCurrentThemeBackgroundOption = getThemeBackgroundOption();
|
||||
mProfileImageStyle = Utils.getProfileImageStyle(this);
|
||||
super.onApplyThemeResource(theme, resId, first);
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), mCurrentThemeResource,
|
||||
mCurrentThemeBackgroundOption, mCurrentThemeBackgroundAlpha);
|
||||
if (shouldApplyWindowBackground()) {
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), mCurrentThemeResource,
|
||||
mCurrentThemeBackgroundOption, mCurrentThemeBackgroundAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -175,4 +177,8 @@ public abstract class ThemedFragmentActivity extends FragmentActivity implements
|
||||
public int getThemeResourceId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected boolean shouldApplyWindowBackground() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user