Apply theme to GalleryActivity
This commit is contained in:
1 parent
1deb4c2d6c
commit
c625315a76
6 files changed
+23
-12
No files matched your search
@@ -49,6 +49,7 @@ import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.hippo.android.resource.AttrResources;
|
||||
import com.hippo.ehviewer.AppConfig;
|
||||
import com.hippo.ehviewer.BuildConfig;
|
||||
import com.hippo.ehviewer.R;
|
||||
@@ -301,7 +302,7 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
|
||||
.setScaleMode(Settings.getPageScaling())
|
||||
.setStartPosition(Settings.getStartPosition())
|
||||
.setStartPage(startPage)
|
||||
.setBackgroundColor(resources.getColor(R.color.gallery_background))
|
||||
.setBackgroundColor(AttrResources.getAttrColor(this, android.R.attr.colorBackground))
|
||||
.setEdgeColor(primaryColor & 0xffffff | 0x33000000)
|
||||
.setPagerInterval(Settings.getShowPageInterval() ? resources.getDimensionPixelOffset(R.dimen.gallery_pager_interval) : 0)
|
||||
.setScrollInterval(Settings.getShowPageInterval() ? resources.getDimensionPixelOffset(R.dimen.gallery_scroll_interval) : 0)
|
||||
|
||||
@@ -18,15 +18,13 @@ package com.hippo.ehviewer.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.hippo.android.resource.AttrResources;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.Settings;
|
||||
import com.hippo.yorozuya.ViewUtils;
|
||||
@@ -60,9 +58,9 @@ public class GalleryGuideView extends ViewGroup implements View.OnClickListener
|
||||
}
|
||||
|
||||
private void init(Context context) {
|
||||
mBgColor = ContextCompat.getColor(context, R.color.guide_bg);
|
||||
mBgColor = AttrResources.getAttrColor(context, R.attr.guideBackgroundColor);
|
||||
mPaint = new Paint();
|
||||
mPaint.setColor(Color.WHITE);
|
||||
mPaint.setColor(AttrResources.getAttrColor(context, R.attr.guideTitleColor));
|
||||
mPaint.setStyle(Paint.Style.STROKE);
|
||||
mPaint.setStrokeWidth(context.getResources().getDimension(R.dimen.gallery_guide_divider_width));
|
||||
setOnClickListener(this);
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/gallery_slider_background"
|
||||
android:background="?attr/gallerySliderBackgroundColor"
|
||||
android:fitsSystemWindows="true"
|
||||
android:visibility="invisible">
|
||||
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
<declare-styleable name="Theme">
|
||||
<attr name="dividerColor" format="color"/>
|
||||
<attr name="toolbarColor" format="color"/>
|
||||
|
||||
<attr name="textColorThemePrimary" format="color"/>
|
||||
<attr name="textColorThemeAccent" format="color"/>
|
||||
|
||||
<!-- For light theme, it's primary dark color -->
|
||||
<!-- For dark theme, it's primary light color -->
|
||||
<!-- For black theme, it's primary light color -->
|
||||
@@ -34,16 +36,22 @@
|
||||
<!-- For dark theme, it's primary light color -->
|
||||
<!-- For black theme, it's primary light color -->
|
||||
<attr name="drawableColorThemePrimary" format="color"/>
|
||||
|
||||
<!-- Color of card background -->
|
||||
<attr name="contentColorPrimary" format="color"/>
|
||||
<attr name="contentColorThemePrimary" format="color"/>
|
||||
<attr name="contentColorThemeAccent" format="color"/>
|
||||
<attr name="contentColorReactive" format="color"/>
|
||||
|
||||
<attr name="widgetColorThemePrimary" format="color"/>
|
||||
<attr name="widgetColorThemeAccent" format="color"/>
|
||||
|
||||
<attr name="guideBackgroundColor" format="color"/>
|
||||
<attr name="guideTitleColor" format="color"/>
|
||||
<attr name="guideTextColor" format="color"/>
|
||||
|
||||
<attr name="gallerySliderBackgroundColor" format="color"/>
|
||||
|
||||
<attr name="toolbarPopupTheme" format="reference"/>
|
||||
<attr name="galleryDetailDivider" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
@@ -119,8 +119,8 @@
|
||||
<color name="shadow_light">#38000000</color>
|
||||
|
||||
<!-- Gallery Activity -->
|
||||
<color name="gallery_background">#ff212121</color>
|
||||
<color name="gallery_slider_background">#ff353535</color>
|
||||
<color name="gallery_slider_background_dark">@color/grey_800</color>
|
||||
<color name="gallery_slider_background_black">@color/grey_900</color>
|
||||
|
||||
<color name="big_icon">#1f000000</color>
|
||||
|
||||
|
||||
@@ -149,11 +149,15 @@
|
||||
|
||||
<style name="AppTheme.Toolbar.Black" parent="AppTheme.Black.NoActionBar"/>
|
||||
|
||||
<style name="AppTheme.Gallery" parent="AppTheme.Dark.NoActionBar"/>
|
||||
<style name="AppTheme.Gallery" parent="AppTheme.Dark.NoActionBar">
|
||||
<item name="gallerySliderBackgroundColor">@color/gallery_slider_background_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Gallery.Dark" parent="AppTheme.Dark.NoActionBar"/>
|
||||
<style name="AppTheme.Gallery.Dark"/>
|
||||
|
||||
<style name="AppTheme.Gallery.Black" parent="AppTheme.Black.NoActionBar"/>
|
||||
<style name="AppTheme.Gallery.Black" parent="AppTheme.Black.NoActionBar">
|
||||
<item name="gallerySliderBackgroundColor">@color/gallery_slider_background_black</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Settings" parent="AppTheme"/>
|
||||
|
||||
|
||||
Reference in new issue
Block a user