Theme improvements

This commit is contained in:
NekoInverter committed 2020-03-23 16:41:14 +08:00
1 parent a9b7df3284
commit d0d9b77f5e
65 files changed
+458 -561

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ android {
defaultConfig {
applicationId "com.hippo.ehviewer"
minSdkVersion 14
minSdkVersion 21
targetSdkVersion 28
versionCode 104
versionName "1.7.3"
@@ -64,7 +64,7 @@ clean {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.getkeepsafe.relinker:relinker:1.3.1'
+2 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,5 +17,5 @@
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+2 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,5 +17,5 @@
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+2 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,5 +17,5 @@
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+2 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,5 +17,5 @@
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+2 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,5 +17,5 @@
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+2 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,5 +17,5 @@
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+2 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,5 +17,5 @@
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+1
View File
@@ -134,6 +134,7 @@
<activity
android:name="com.hippo.ehviewer.ui.SettingsActivity"
android:configChanges="screenSize|uiMode"
android:label="@string/settings"
android:theme="@style/AppTheme.Settings"/>
<activity
@@ -31,6 +31,7 @@ import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.collection.LruCache;
import com.getkeepsafe.relinker.ReLinker;
@@ -282,6 +283,8 @@ public class EhApplication extends RecordingApplication {
EhDB.mergeOldDB(this);
}
AppCompatDelegate.setDefaultNightMode(Settings.getTheme());
// Do io tasks in new thread
new AsyncTask<Void, Void, Void>() {
@Override
@@ -49,8 +49,9 @@ public class Settings {
********************/
public static final String KEY_THEME = "theme";
public static final int THEME_LIGHT = 0;
public static final int THEME_DARK = 1;
public static final String KEY_BLACK_DARK_THEME = "black_dark_theme";
public static final int THEME_LIGHT = 1;
public static final int THEME_SYSTEM = -1;
public static final int THEME_BLACK = 2;
public static final String KEY_APPLY_NAV_BAR_THEME_COLOR = "apply_nav_bar_theme_color";
public static final String KEY_GALLERY_SITE = "gallery_site";
@@ -109,7 +110,7 @@ public class Settings {
private static final boolean DEFAULT_SELECT_SITE = true;
private static final String KEY_QUICK_SEARCH_TIP = "quick_search_tip";
private static final boolean DEFAULT_QUICK_SEARCH_TIP = true;
private static final int DEFAULT_THEME = THEME_LIGHT;
private static final int DEFAULT_THEME = THEME_SYSTEM;
private static final boolean DEFAULT_APPLY_NAV_BAR_THEME_COLOR = true;
private static final int DEFAULT_GALLERY_SITE = 1;
private static final String KEY_LAUNCH_PAGE = "launch_page";
@@ -129,6 +130,8 @@ public class Settings {
private static final String DEFAULT_EXCLUDED_LANGUAGES = null;
private static final String KEY_CELLULAR_NETWORK_WARNING = "cellular_network_warning";
private static final boolean DEFAULT_CELLULAR_NETWORK_WARNING = false;
private static final String KEY_NIGHT_MODE = "night_mode";
private static final String DEFAULT_NIGHT_MODE = "-1";
/********************
****** Read
********************/
@@ -484,6 +484,7 @@ public class DownloadService extends Service implements DownloadManager.Download
// false for show, true for cancel
@Ops
private int mOps;
public NotificationDelay(Service service, NotificationManager notifyManager,
NotificationCompat.Builder builder, int id) {
mService = service;
@@ -19,9 +19,10 @@ package com.hippo.ehviewer.preference;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import androidx.preference.Preference;
import android.util.AttributeSet;
import androidx.preference.Preference;
import com.hippo.ehviewer.R;
public class VersionPreference extends Preference {
@@ -17,6 +17,8 @@
package com.hippo.ehviewer.ui;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.view.WindowManager;
@@ -32,9 +34,59 @@ import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
import java.util.Locale;
import java.util.Objects;
public abstract class EhActivity extends AppCompatActivity {
private static final String THEME_DEFAULT = "DEFAULT";
private static final String THEME_BLACK = "BLACK";
private String mTheme;
public static boolean isBlackNightTheme() {
return Settings.getBoolean("black_dark_theme", false);
}
public static String getTheme(Context context) {
if (isBlackNightTheme()
&& isNightMode(context.getResources().getConfiguration()))
return THEME_BLACK;
return THEME_DEFAULT;
}
public static boolean isNightMode(Configuration configuration) {
return (configuration.uiMode & Configuration.UI_MODE_NIGHT_YES) > 0;
}
@Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
// apply real style and our custom style
if (getParent() == null) {
theme.applyStyle(resid, true);
} else {
try {
theme.setTo(getParent().getTheme());
} catch (Exception e) {
// Empty
}
theme.applyStyle(resid, false);
}
theme.applyStyle(getThemeStyleRes(this), true);
// only pass theme style to super, so styled theme will not be overwritten
super.onApplyThemeResource(theme, R.style.ThemeOverlay, first);
}
@StyleRes
public int getThemeStyleRes(Context context) {
switch (getTheme(context)) {
case THEME_BLACK:
return R.style.ThemeOverlay_Black;
case THEME_DEFAULT:
default:
return R.style.ThemeOverlay;
}
}
@StyleRes
protected abstract int getThemeResId(int theme);
@@ -49,6 +101,7 @@ public abstract class EhActivity extends AppCompatActivity {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && Settings.getApplyNavBarThemeColor()) {
getWindow().setNavigationBarColor(AttrResources.getAttrColor(this, R.attr.colorPrimaryDark));
}
mTheme = getTheme(this);
}
@Override
@@ -67,6 +120,9 @@ public abstract class EhActivity extends AppCompatActivity {
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
if (!Objects.equals(mTheme, getTheme(this))) {
recreate();
}
}
@Override
@@ -48,6 +48,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.SwitchCompat;
import com.hippo.android.resource.AttrResources;
@@ -176,15 +177,7 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
@Override
protected int getThemeResId(int theme) {
switch (theme) {
case Settings.THEME_LIGHT:
default:
return R.style.AppTheme_Gallery;
case Settings.THEME_DARK:
return R.style.AppTheme_Gallery_Dark;
case Settings.THEME_BLACK:
return R.style.AppTheme_Gallery_Black;
}
return R.style.AppTheme_Gallery;
}
private void buildProvider() {
@@ -246,8 +239,9 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
}
@Override
@SuppressWarnings({"deprecation", "WrongConstant"})
@SuppressWarnings({"WrongConstant"})
protected void onCreate(@Nullable Bundle savedInstanceState) {
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
if (Settings.getReadingFullscreen() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
@@ -25,14 +25,12 @@ import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -47,7 +45,6 @@ import androidx.drawerlayout.widget.DrawerLayout;
import com.google.android.material.navigation.NavigationView;
import com.google.android.material.snackbar.Snackbar;
import com.hippo.ehviewer.AppConfig;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
import com.hippo.ehviewer.client.EhTagDatabase;
@@ -139,21 +136,11 @@ public final class MainActivity extends StageActivity
private LoadImageView mAvatar;
@Nullable
private TextView mDisplayName;
@Nullable
private Button mChangeTheme;
private int mNavCheckedItem = 0;
@Override
protected int getThemeResId(int theme) {
switch (theme) {
case Settings.THEME_LIGHT:
default:
return R.style.AppTheme_Main;
case Settings.THEME_DARK:
return R.style.AppTheme_Main_Dark;
case Settings.THEME_BLACK:
return R.style.AppTheme_Main_Black;
}
return R.style.AppTheme_Main;
}
@Override
@@ -168,9 +155,9 @@ public final class MainActivity extends StageActivity
return new Announcer(SecurityScene.class);
} else if (Settings.getShowWarning()) {
return new Announcer(WarningScene.class);
} else if (Settings.getAskAnalytics()) {
}/* else if (Settings.getAskAnalytics()) {
return new Announcer(AnalyticsScene.class);
} else if (EhUtils.needSignedIn(this)) {
}*/ else if (EhUtils.needSignedIn(this)) {
return new Announcer(SignInScene.class);
} else if (Settings.getSelectSite()) {
return new Announcer(SelectSiteScene.class);
@@ -194,12 +181,12 @@ public final class MainActivity extends StageActivity
newArgs.putString(WarningScene.KEY_TARGET_SCENE, announcer.getClazz().getName());
newArgs.putBundle(WarningScene.KEY_TARGET_ARGS, announcer.getArgs());
return new Announcer(WarningScene.class).setArgs(newArgs);
} else if (Settings.getAskAnalytics()) {
}/* else if (Settings.getAskAnalytics()) {
Bundle newArgs = new Bundle();
newArgs.putString(AnalyticsScene.KEY_TARGET_SCENE, announcer.getClazz().getName());
newArgs.putBundle(AnalyticsScene.KEY_TARGET_ARGS, announcer.getArgs());
return new Announcer(AnalyticsScene.class).setArgs(newArgs);
} else if (EhUtils.needSignedIn(this)) {
}*/ else if (EhUtils.needSignedIn(this)) {
Bundle newArgs = new Bundle();
newArgs.putString(SignInScene.KEY_TARGET_SCENE, announcer.getClazz().getName());
newArgs.putBundle(SignInScene.KEY_TARGET_ARGS, announcer.getArgs());
@@ -333,14 +320,6 @@ public final class MainActivity extends StageActivity
View headerLayout = mNavView.getHeaderView(0);
mAvatar = (LoadImageView) ViewUtils.$$(headerLayout, R.id.avatar);
mDisplayName = (TextView) ViewUtils.$$(headerLayout, R.id.display_name);
mChangeTheme = (Button) ViewUtils.$$(this, R.id.change_theme);
//mDrawerLayout.setStatusBarColor(ResourcesUtils.getAttrColor(this, R.attr.colorPrimaryDark));
// Pre-L need shadow drawable
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow_left, Gravity.LEFT);
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow_right, Gravity.RIGHT);
}
updateProfile();
@@ -348,12 +327,6 @@ public final class MainActivity extends StageActivity
mNavView.setNavigationItemSelectedListener(this);
}
mChangeTheme.setText(getThemeText());
mChangeTheme.setOnClickListener(v -> {
Settings.putTheme(getNextTheme());
((EhApplication) getApplication()).recreate();
});
if (savedInstanceState == null) {
onInit();
CommonOperations.checkUpdate(this, false);
@@ -368,35 +341,6 @@ public final class MainActivity extends StageActivity
EhTagDatabase.update(this);
}
private String getThemeText() {
int resId;
switch (Settings.getTheme()) {
default:
case Settings.THEME_LIGHT:
resId = R.string.theme_light;
break;
case Settings.THEME_DARK:
resId = R.string.theme_dark;
break;
case Settings.THEME_BLACK:
resId = R.string.theme_black;
break;
}
return getString(resId);
}
private int getNextTheme() {
switch (Settings.getTheme()) {
default:
case Settings.THEME_LIGHT:
return Settings.THEME_DARK;
case Settings.THEME_DARK:
return Settings.THEME_BLACK;
case Settings.THEME_BLACK:
return Settings.THEME_LIGHT;
}
}
private void checkDownloadLocation() {
UniFile uniFile = Settings.getDownloadLocation();
// null == uniFile for first start
@@ -25,7 +25,6 @@ import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.ActionBarDrawerToggle;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
import com.hippo.ehviewer.ui.fragment.AboutFragment;
import com.hippo.ehviewer.ui.fragment.AdvancedFragment;
import com.hippo.ehviewer.ui.fragment.DownloadFragment;
@@ -50,15 +49,7 @@ public final class SettingsActivity extends EhActivity {
@Override
protected int getThemeResId(int theme) {
switch (theme) {
case Settings.THEME_LIGHT:
default:
return R.style.AppTheme_Settings;
case Settings.THEME_DARK:
return R.style.AppTheme_Settings_Dark;
case Settings.THEME_BLACK:
return R.style.AppTheme_Settings_Black;
}
return R.style.AppTheme_Settings;
}
private void setActionBarUpIndicator(Drawable drawable) {
@@ -26,21 +26,12 @@ import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
public abstract class ToolbarActivity extends EhActivity {
@Override
protected int getThemeResId(int theme) {
switch (theme) {
case Settings.THEME_LIGHT:
default:
return R.style.AppTheme_Toolbar;
case Settings.THEME_DARK:
return R.style.AppTheme_Toolbar_Dark;
case Settings.THEME_BLACK:
return R.style.AppTheme_Toolbar_Black;
}
return R.style.AppTheme_Toolbar;
}
@Override
@@ -21,6 +21,7 @@ import android.os.Build;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.Preference;
import com.hippo.ehviewer.EhApplication;
@@ -37,6 +38,7 @@ public class EhFragment extends PreferenceFragmentCompat
addPreferencesFromResource(R.xml.eh_settings);
Preference theme = findPreference(Settings.KEY_THEME);
Preference blackDarkTheme = findPreference(Settings.KEY_BLACK_DARK_THEME);
Preference applyNavBarThemeColor = findPreference(Settings.KEY_APPLY_NAV_BAR_THEME_COLOR);
Preference gallerySite = findPreference(Settings.KEY_GALLERY_SITE);
Preference listMode = findPreference(Settings.KEY_LIST_MODE);
@@ -52,6 +54,7 @@ public class EhFragment extends PreferenceFragmentCompat
detailSize.setOnPreferenceChangeListener(this);
thumbSize.setOnPreferenceChangeListener(this);
showTagTranslations.setOnPreferenceChangeListener(this);
blackDarkTheme.setOnPreferenceChangeListener(this);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
getPreferenceScreen().removePreference(applyNavBarThemeColor);
@@ -67,6 +70,7 @@ public class EhFragment extends PreferenceFragmentCompat
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
if (Settings.KEY_THEME.equals(key)) {
AppCompatDelegate.setDefaultNightMode(Integer.parseInt((String) newValue));
((EhApplication) getActivity().getApplication()).recreate();
return true;
} else if (Settings.KEY_APPLY_NAV_BAR_THEME_COLOR.equals(key)) {
@@ -86,6 +90,9 @@ public class EhFragment extends PreferenceFragmentCompat
if (Boolean.TRUE.equals(newValue)) {
EhTagDatabase.update(getActivity());
}
} else if (Settings.KEY_BLACK_DARK_THEME.equals(key)) {
((EhApplication) getActivity().getApplication()).recreate();
return true;
}
return true;
}
@@ -515,7 +515,6 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mActionGroup = (ViewGroup) ViewUtils.$$(mHeader, R.id.action_card);
mDownload = (TextView) ViewUtils.$$(mActionGroup, R.id.download);
mRead = ViewUtils.$$(mActionGroup, R.id.read);
Ripple.addRipple(mOtherActions, isDarkTheme);
Ripple.addRipple(mDownload, isDarkTheme);
Ripple.addRipple(mRead, isDarkTheme);
mUploader.setOnClickListener(this);
@@ -45,10 +45,10 @@ public class SolidScene extends BaseScene {
break;
}
case CHECK_STEP_WARNING:
if (Settings.getAskAnalytics()) {
/*if (Settings.getAskAnalytics()) {
startScene(new Announcer(AnalyticsScene.class).setArgs(args));
break;
}
}*/
case CHECK_STEP_ANALYTICS:
if (EhUtils.needSignedIn(getContext2())) {
startScene(new Announcer(SignInScene.class).setArgs(args));
@@ -85,6 +85,7 @@ public final class ImageSearchLayout extends LinearLayout implements View.OnClic
setOrientation(VERTICAL);
setDividerDrawable(context.getResources().getDrawable(R.drawable.spacer_keyline));
setShowDividers(SHOW_DIVIDER_MIDDLE);
setClipToPadding(false);
LayoutInflater.from(context).inflate(R.layout.widget_image_search, this);
mPreview = (ImageView) ViewUtils.$$(this, R.id.preview);
@@ -42,8 +42,8 @@ import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import com.google.android.material.card.MaterialCardView;
import com.hippo.ehviewer.R;
import com.hippo.view.ViewTransition;
import com.hippo.yorozuya.AnimationUtils;
@@ -54,7 +54,7 @@ import com.hippo.yorozuya.ViewUtils;
import java.util.ArrayList;
import java.util.List;
public class SearchBar extends CardView implements View.OnClickListener,
public class SearchBar extends MaterialCardView implements View.OnClickListener,
TextView.OnEditorActionListener, TextWatcher,
SearchEditText.SearchEditTextListener {
@@ -28,8 +28,7 @@ public final class ViewAnimationUtils {
public static final boolean API_SUPPORT_CIRCULAR_REVEAL =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
// http://developer.android.com/guide/topics/graphics/hardware-accel.html#unsupported
public static final boolean API_SUPPORT_CANVAS_CLIP_PATH =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
private ViewAnimationUtils() {
}
@@ -90,18 +89,12 @@ public final class ViewAnimationUtils {
@Override
public void onAnimationStart(Animator animation) {
if (!API_SUPPORT_CANVAS_CLIP_PATH) {
mView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
mReveal.setRevealEnable(true);
}
@Override
public void onAnimationEnd(Animator animation) {
mReveal.setRevealEnable(false);
if (!API_SUPPORT_CANVAS_CLIP_PATH) {
mView.setLayerType(View.LAYER_TYPE_NONE, null);
}
}
}
}
@@ -140,8 +140,7 @@ public class LockPatternView extends View {
mPathPaint.setAntiAlias(true);
mPathPaint.setDither(true);
mRegularColor = getResources().getColor(AttrResources.getAttrBoolean(context, R.attr.isLightTheme) ?
R.color.lock_pattern_view_regular_color_light : R.color.lock_pattern_view_regular_color_dark);
mRegularColor = getResources().getColor(AttrResources.getAttrBoolean(context, R.attr.isLightTheme) ? R.color.lock_pattern_view_regular_color_light : R.color.lock_pattern_view_regular_color_dark);
mErrorColor = getResources().getColor(R.color.lock_pattern_view_error_color);
mSuccessColor = getResources().getColor(R.color.lock_pattern_view_success_color);
+3 -5
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +14,5 @@
~ limitations under the License.
-->
<accelerateInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="2.0"/>
<accelerateInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="2.0" />
+3 -5
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +14,5 @@
~ limitations under the License.
-->
<decelerateInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="2.0"/>
<decelerateInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="2.0" />
+3 -5
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +14,5 @@
~ limitations under the License.
-->
<decelerateInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="2.5"/>
<decelerateInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="2.5" />
+3 -5
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +14,5 @@
~ limitations under the License.
-->
<decelerateInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="1.5"/>
<decelerateInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:factor="1.5" />
+7 -9
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,16 +14,15 @@
~ limitations under the License.
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="0.7"
android:toAlpha="1.0"
android:fillEnabled="true"
android:fillBefore="true"
android:duration="250"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromAlpha="0.7"
android:interpolator="@anim/decelerate_terz"
android:duration="250"/>
android:toAlpha="1.0" />
</set>
+13 -15
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,27 +14,26 @@
~ limitations under the License.
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android"
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:interpolator="@android:interpolator/linear"
android:fillEnabled="true"
android:fillBefore="false"
android:duration="150"
android:fillAfter="true"
android:fillBefore="false"
android:fillEnabled="true"
android:fromAlpha="1.0"
android:interpolator="@android:interpolator/linear"
android:startOffset="100"
android:duration="150"/>
android:toAlpha="0.0" />
<translate
android:fromYDelta="0%"
android:toYDelta="8%"
android:fillEnabled="true"
android:fillBefore="true"
android:duration="250"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromYDelta="0%"
android:interpolator="@anim/accelerate_quart"
android:duration="250"/>
android:toYDelta="8%" />
</set>
+13 -15
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,26 +14,25 @@
~ limitations under the License.
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android"
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@anim/decelerate_quart"
android:fillEnabled="true"
android:fillBefore="false"
android:duration="200"
android:fillAfter="true"
android:duration="200"/>
android:fillBefore="false"
android:fillEnabled="true"
android:fromAlpha="0.0"
android:interpolator="@anim/decelerate_quart"
android:toAlpha="1.0" />
<translate
android:fromYDelta="8%"
android:toYDelta="0"
android:fillEnabled="true"
android:fillBefore="true"
android:duration="350"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromYDelta="8%"
android:interpolator="@anim/decelerate_quint"
android:duration="350"/>
android:toYDelta="0" />
</set>
+7 -9
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,16 +14,15 @@
~ limitations under the License.
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.7"
android:fillEnabled="true"
android:fillBefore="false"
android:duration="217"
android:fillAfter="true"
android:fillBefore="false"
android:fillEnabled="true"
android:fromAlpha="1.0"
android:interpolator="@android:interpolator/accelerate_decelerate"
android:duration="217"/>
android:toAlpha="0.7" />
</set>
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2018 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +16,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_activated="true" android:color="@color/content_activated_dark"/>
<item android:color="@color/content_dark"/>
<item android:color="@color/content_activated" android:state_activated="true" />
<item android:color="@color/content" />
</selector>
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2018 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +16,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_activated="true" android:color="@color/content_activated_black"/>
<item android:color="@color/content_black"/>
<item android:color="@color/content_activated_black" android:state_activated="true" />
<item android:color="@color/content_black" />
</selector>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2018 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_activated="true" android:color="@color/content_activated_light"/>
<item android:color="@color/content_light"/>
</selector>
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2018 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,6 +15,6 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="@color/primary_text_disabled_material_black"/>
<item android:color="@color/primary_text_default_material_black"/>
<item android:color="@color/primary_text_disabled_material_black" android:state_enabled="false" />
<item android:color="@color/primary_text_default_material_black" />
</selector>
@@ -19,7 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="@color/divider_light"/>
android:color="@color/divider"/>
<size
android:height="1dp"/>
@@ -19,7 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="@color/divider_dark"/>
android:color="@color/divider_black"/>
<size
android:height="1dp"/>
+1 -1
View File
@@ -21,7 +21,7 @@
<gradient
android:startColor="@android:color/transparent"
android:endColor="@color/shadow_light"
android:endColor="@color/shadow"
android:angle="90"/>
</shape>
+1 -1
View File
@@ -21,7 +21,7 @@
<gradient
android:startColor="@android:color/transparent"
android:endColor="@color/shadow_light"
android:endColor="@color/shadow"
android:angle="270"/>
</shape>
+7 -10
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,22 +14,20 @@
~ limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.appcompat.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/toolbarColor"
android:elevation="8dp"
android:saveEnabled="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="?attr/toolbarPopupTheme"/>
app:popupTheme="?attr/toolbarPopupTheme" />
<FrameLayout
android:layout_width="match_parent"
@@ -42,12 +39,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"/>
android:visibility="gone" />
<ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
</FrameLayout>
</LinearLayout>
+7 -10
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,22 +14,20 @@
~ limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.appcompat.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/toolbarColor"
android:elevation="8dp"
android:saveEnabled="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="?attr/toolbarPopupTheme"/>
app:popupTheme="?attr/toolbarPopupTheme" />
<FrameLayout
android:layout_width="match_parent"
@@ -42,12 +39,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"/>
android:visibility="gone" />
<com.hippo.easyrecyclerview.EasyRecyclerView
android:id="@+id/recycler_view_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
</FrameLayout>
</LinearLayout>
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,16 +14,15 @@
~ limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:background="?android:attr/activatedBackgroundIndicator"
android:clipToPadding="false">
android:clipToPadding="false"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight">
<RelativeLayout
android:layout_width="0dp"
@@ -37,9 +35,9 @@
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee" />
android:textAppearance="?android:attr/textAppearanceListItem" />
<TextView
android:id="@android:id/summary"
@@ -47,9 +45,9 @@
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignLeft="@android:id/title"
android:maxLines="10"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="10" />
android:textColor="?android:attr/textColorSecondary" />
<!-- Preference should place its actual preference widget here. -->
<LinearLayout
@@ -58,17 +56,17 @@
android:layout_height="match_parent"
android:layout_below="@android:id/summary"
android:layout_alignLeft="@android:id/title"
android:minWidth="@dimen/preference_widget_width"
android:gravity="center"
android:orientation="vertical"/>
android:minWidth="@dimen/preference_widget_width"
android:orientation="vertical" />
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@android:id/summary"
android:layout_toRightOf="@android:id/widget_frame"
android:layout_alignParentRight="true"/>
android:layout_alignParentRight="true"
android:layout_toRightOf="@android:id/widget_frame" />
</RelativeLayout>
</LinearLayout>
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,26 +14,24 @@
~ limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.appcompat.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/toolbarColor"
android:elevation="8dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="?attr/toolbarPopupTheme"/>
app:popupTheme="?attr/toolbarPopupTheme" />
<FrameLayout
android:id="@+id/content_panel"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
android:layout_weight="1" />
</LinearLayout>
+1 -9
View File
@@ -36,15 +36,7 @@
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/nav_drawer_main">
<Button
android:id="@+id/change_theme"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center" />
</com.google.android.material.navigation.NavigationView>
app:menu="@menu/nav_drawer_main" />
<com.hippo.ehviewer.widget.EhDrawerView
@@ -120,7 +120,7 @@
</RelativeLayout>
<androidx.cardview.widget.CardView
<com.google.android.material.card.MaterialCardView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/action_card"
android:layout_width="match_parent"
@@ -160,6 +160,6 @@
android:text="@string/read"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</FrameLayout>
@@ -15,7 +15,7 @@
~ limitations under the License.
-->
<androidx.cardview.widget.CardView
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
@@ -50,4 +50,4 @@
android:textStyle="bold"
tools:ignore="SpUsage"/>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>
@@ -14,7 +14,7 @@
~ limitations under the License.
-->
<androidx.cardview.widget.CardView
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
@@ -127,4 +127,4 @@
</LinearLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>
+13 -14
View File
@@ -47,6 +47,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:minWidth="@dimen/single_max_width"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:hint="@string/username">
<com.hippo.widget.HackyTextInputEditText
@@ -67,6 +68,7 @@
android:layout_gravity="center_horizontal"
android:minWidth="@dimen/single_max_width"
android:hint="@string/password"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:passwordToggleEnabled="true">
<com.hippo.widget.HackyTextInputEditText
@@ -89,7 +91,7 @@
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:orientation="vertical"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="4dp"
@@ -97,26 +99,23 @@
android:gravity="bottom"
style="?attr/buttonBarStyle">
<Button
android:id="@+id/register"
style="?attr/buttonBarNegativeButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/colorAccent"
android:textStyle="bold"
android:text="@string/register"/>
<Button
android:id="@+id/sign_in"
style="?attr/buttonBarPositiveButtonStyle"
android:layout_width="0dp"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/colorPrimary"
android:textStyle="bold"
android:text="@string/sign_in"/>
<Button
android:id="@+id/register"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:text="@string/register"/>
</LinearLayout>
<TextView
@@ -103,19 +103,12 @@
android:paddingBottom="4dp"
android:gravity="bottom"
style="?attr/buttonBarStyle">
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<Button
android:id="@+id/ok"
style="?attr/buttonBarPositiveButtonStyle"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/colorPrimary"
android:textStyle="bold"
android:text="@android:string/ok"/>
+12 -14
View File
@@ -60,7 +60,7 @@
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:orientation="vertical"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="4dp"
@@ -68,25 +68,23 @@
android:gravity="bottom"
style="?attr/buttonBarStyle">
<Button
android:id="@+id/reject"
style="?attr/buttonBarNegativeButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/colorAccent"
android:textStyle="bold"
android:text="@string/reject"/>
<Button
android:id="@+id/accept"
style="?attr/buttonBarPositiveButtonStyle"
android:layout_width="0dp"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="?attr/colorPrimary"
android:textStyle="bold"
android:text="@string/accept"/>
<Button
android:id="@+id/reject"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:text="@string/reject"/>
</LinearLayout>
</LinearLayout>
+1 -1
View File
@@ -28,7 +28,7 @@
android:layout_weight="1"
android:textColor="?attr/colorPrimary"
android:textStyle="bold"
style="?attr/buttonBarPositiveButtonStyle"/>
style="@style/Widget.MaterialComponents.Button.TextButton"/>
<Space
android:layout_width="0dp"
+2 -2
View File
@@ -14,7 +14,7 @@
~ limitations under the License.
-->
<androidx.cardview.widget.CardView
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -42,4 +42,4 @@
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>
@@ -72,6 +72,7 @@
android:layout_width="36dp"
android:layout_height="36dp"
android:padding="6dp"
android:background="?selectableItemBackgroundBorderless"
app:srcCompat="@drawable/v_help_circle_x24"/>
<Space
@@ -30,11 +30,11 @@
<Button
android:id="@+id/select_image"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/select_image"
style="?attr/buttonBarButtonStyle"/>
style="@style/Widget.MaterialComponents.Button"/>
<TableLayout
android:layout_width="match_parent"
+130
View File
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<color name="primary_drawable">#ffffffff</color>
<color name="secondary_drawable">#4dffffff</color>
<color name="background">#ff303030</color>
<color name="content">@color/grey_825</color>
<color name="content_activated">@color/grey_600</color>
<color name="widget">@color/grey_700</color>
<color name="progress">@color/grey_600</color>
<color name="tag_group_background">@color/grey_775</color>
<color name="tag_background">@color/grey_775</color>
<color name="gallery_detail_button_background">@color/grey_800</color>
<color name="red_500">#fff44336</color>
<color name="teal_500">#ff009688</color>
<color name="teal_700">#ff00796b</color>
<color name="purple_500">#ff9c27b0</color>
<color name="purple_a200">#ffe040fb</color>
<color name="purple_a400">#ffd500f9</color>
<color name="purple_a700">#ffaa00ff</color>
<color name="cyan_600">#ff00acc1</color>
<color name="light_green_600">#ff7cb342</color>
<color name="yellow_800">#fff9a825</color>
<color name="deep_orange_400">#ffff7043</color>
<color name="grey_975">#ff080808</color>
<color name="grey_950">#ff111111</color>
<color name="grey_925">#ff191919</color>
<color name="grey_900">#ff212121</color>
<color name="grey_875">#ff292929</color>
<color name="grey_850">#ff323232</color>
<color name="grey_825">#ff3a3a3a</color>
<color name="grey_800">#ff424242</color>
<color name="grey_775">#ff4a4a4a</color>
<color name="grey_750">#ff525252</color>
<color name="grey_725">#ff595959</color>
<color name="grey_700">#ff616161</color>
<color name="grey_675">#ff666666</color>
<color name="grey_650">#ff6b6b6b</color>
<color name="grey_625">#ff707070</color>
<color name="grey_600">#ff757575</color>
<color name="grey_575">#ff7f7f7f</color>
<color name="grey_550">#ff8a8a8a</color>
<color name="grey_525">#ff949494</color>
<color name="grey_500">#ff9e9e9e</color>
<color name="grey_475">#ffa6a6a6</color>
<color name="grey_450">#ffaeaeae</color>
<color name="grey_425">#ffb5b5b5</color>
<color name="grey_400">#ffbdbdbd</color>
<color name="grey_375">#ffc6c6c6</color>
<color name="grey_350">#ffcfcfcf</color>
<color name="grey_325">#ffd7d7d7</color>
<color name="grey_300">#ffe0e0e0</color>
<color name="grey_275">#ffe4e4e4</color>
<color name="grey_250">#ffe7e7e7</color>
<color name="grey_225">#ffebebeb</color>
<color name="grey_200">#ffeeeeee</color>
<color name="grey_175">#fff0f0f0</color>
<color name="grey_150">#fff2f2f2</color>
<color name="grey_125">#fff3f3f3</color>
<color name="grey_100">#fff5f5f5</color>
<color name="brown_500">#ff795548</color>
<color name="colorPrimary">@color/teal_500</color>
<color name="colorPrimaryDark">@color/teal_700</color>
<color name="colorAccent">@color/purple_a200</color>
<color name="translucent_bg">#80ffffff</color>
<color name="loading_indicator_red">#ffe53935</color>
<color name="loading_indicator_purple">@color/purple_a700</color>
<color name="loading_indicator_blue">#ff1d87e4</color>
<color name="loading_indicator_cyan">@color/cyan_600</color>
<color name="loading_indicator_green">@color/light_green_600</color>
<color name="loading_indicator_yellow">@color/yellow_800</color>
<color name="loading_indicator_orange">@color/deep_orange_400</color>
<color name="check_text_view_mask">#8a000000</color>
<!-- Red -->
<color name="doujinshi">#fff44336</color>
<!-- Orange -->
<color name="manga">#ffff9800</color>
<!-- Yellow 700 -->
<color name="artist_cg">#ffFbc02d</color>
<!-- Green -->
<color name="game_cg">#ff4caf50</color>
<!-- Light Green -->
<color name="western">#ff8bc34a</color>
<!-- Blue -->
<color name="non_h">#ff2196f3</color>
<!-- Indigo -->
<color name="image_set">#ff3f51b5</color>
<!-- Purple -->
<color name="cosplay">#ff9c27b0</color>
<!-- Deep Purple 300 -->
<color name="asian_porn">#ff9575cd</color>
<!-- Pink 300 -->
<color name="misc">#fff06292</color>
<color name="unknown_bg">@android:color/black</color>
<!-- divider -->
<color name="divider">#20ffffff</color>
<!-- shadow -->
<color name="shadow">#38000000</color>
<color name="big_icon">#1f000000</color>
<color name="guide_bg">#e5009688</color>
<!--Shortcut background-->
<color name="shortcut_bg">#F5F5F5</color>
</resources>
+4
View File
@@ -0,0 +1,4 @@
<resources>
<style name="ToolbarPopupTheme" parent="ThemeOverlay.MaterialComponents.Light"/>
</resources>
-38
View File
@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<style name="AppTheme.NoActionBar.Translucent">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="AppTheme.Dark.NoActionBar.Translucent">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="AppTheme.Black.NoActionBar.Translucent">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<style name="AppTheme" parent="BaseTheme">
<item name="android:colorEdgeEffect">?attr/colorEdgeEffect</item>
</style>
<style name="AppTheme.Dark" parent="BaseTheme.Dark">
<item name="android:colorEdgeEffect">?attr/colorEdgeEffect</item>
</style>
<style name="AppTheme.Black" parent="BaseTheme.Black">
<item name="android:colorEdgeEffect">?attr/colorEdgeEffect</item>
</style>
<style name="AppTheme.NoActionBar.Translucent">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="AppTheme.Dark.NoActionBar.Translucent">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="AppTheme.Black.NoActionBar.Translucent">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
+11
View File
@@ -282,4 +282,15 @@
<item>SOCKS</item>
</string-array>
<string-array name="night_mode_entries" translatable="false">
<item>@string/follow_system</item>
<item>@string/settings_eh_theme_light</item>
<item>@string/settings_eh_theme_dark</item>
</string-array>
<string-array name="night_mode_values">
<item>-1</item>
<item>1</item>
<item>2</item>
</string-array>
</resources>
+16 -23
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,12 +16,14 @@
<resources>
<!-- primary_drawable_light 54% -->
<!-- secondary_drawable_light 26% -->
<!-- primary_drawable 54% -->
<!-- secondary_drawable 26% -->
<!-- primary_drawable_dark 100% -->
<!-- secondary_drawable_dark 30% -->
<!-- primary_drawable_black 80% -->
<!-- secondary_drawable_black 24% -->
<color name="primary_drawable">#8a000000</color>
<color name="secondary_drawable">#42000000</color>
<color name="primary_drawable_light">#8a000000</color>
<color name="secondary_drawable_light">#42000000</color>
<color name="primary_drawable_dark">#ffffffff</color>
@@ -33,35 +34,27 @@
<color name="primary_text_default_material_black">#d9ffffff</color>
<color name="primary_text_disabled_material_black">#4dffffff</color>
<color name="background_dark">#ff303030</color>
<color name="background_light">#fffafafa</color>
<color name="background">#fffafafa</color>
<color name="content_light">@color/grey_100</color>
<color name="content_dark">@color/grey_825</color>
<color name="content">#fff</color>
<color name="content_black">@color/grey_925</color>
<color name="content_activated_light">@color/grey_300</color>
<color name="content_activated_dark">@color/grey_600</color>
<color name="content_activated">@color/grey_300</color>
<color name="content_activated_black">@color/grey_700</color>
<color name="widget_light">@color/grey_200</color>
<color name="widget_dark">@color/grey_700</color>
<color name="widget">@color/grey_200</color>
<color name="widget_black">@color/grey_850</color>
<color name="progress_light">@color/colorAccent</color>
<color name="progress_dark">@color/grey_600</color>
<color name="progress">@color/colorAccent</color>
<color name="progress_black">@color/grey_700</color>
<color name="tag_group_background_light">@color/colorAccent</color>
<color name="tag_group_background_dark">@color/grey_775</color>
<color name="tag_group_background">@color/colorAccent</color>
<color name="tag_group_background_black">@color/grey_875</color>
<color name="tag_background_light">@color/colorPrimary</color>
<color name="tag_background_dark">@color/grey_775</color>
<color name="tag_background">@color/colorPrimary</color>
<color name="tag_background_black">@color/grey_875</color>
<color name="gallery_detail_button_background_light">@color/grey_100</color>
<color name="gallery_detail_button_background_dark">@color/grey_800</color>
<color name="gallery_detail_button_background">@color/grey_100</color>
<color name="gallery_detail_button_background_black">@color/grey_900</color>
<color name="red_500">#fff44336</color>
@@ -152,11 +145,11 @@
<color name="unknown_bg">@android:color/black</color>
<!-- divider -->
<color name="divider_light">#20000000</color>
<color name="divider_dark">#20ffffff</color>
<color name="divider">#20000000</color>
<color name="divider_black">#20ffffff</color>
<!-- shadow -->
<color name="shadow_light">#38000000</color>
<color name="shadow">#38000000</color>
<!-- Gallery Activity -->
<color name="gallery_slider_background_dark">@color/grey_800</color>
+5 -3
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -202,7 +201,7 @@
<string name="search_sp">Pages:</string>
<string name="search_sp_to">to</string>
<!-- A placeholder for other languages -->
<string name="search_sp_suffix"/>
<string name="search_sp_suffix" />
<string name="search_sf">Disable default filters for:</string>
<string name="search_sfl">Language</string>
<string name="search_sfu">Uploader</string>
@@ -780,4 +779,7 @@
<string name="download_service">Download Service</string>
<string name="favorite_name">Favorite</string>
<string name="follow_system">Follow system</string>
<string name="black_dark_theme">Black dark theme</string>
</resources>
+33 -103
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,42 +19,46 @@
<!-- ========== -->
<!-- Base Theme -->
<!-- ========== -->
<style name="BaseTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<style name="BaseTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionBarStyle">@style/ActionBarStyle</item>
<item name="colorEdgeEffect">@color/colorPrimary</item>
<item name="dividerColor">@color/divider_light</item>
<item name="dividerColor">@color/divider</item>
<item name="toolbarColor">@color/colorPrimary</item>
<item name="textColorThemePrimary">@color/colorPrimary</item>
<item name="textColorThemeAccent">@color/colorAccent</item>
<item name="drawableColorPrimary">@color/primary_drawable_light</item>
<item name="drawableColorSecondary">@color/secondary_drawable_light</item>
<item name="drawableColorPrimary">@color/primary_drawable</item>
<item name="drawableColorSecondary">@color/secondary_drawable</item>
<item name="drawableColorThemePrimary">@color/colorPrimary</item>
<item name="contentColorPrimary">@color/content_light</item>
<item name="contentColorPrimary">@color/content</item>
<item name="contentColorThemePrimary">@color/colorPrimary</item>
<item name="contentColorThemeAccent">@color/colorAccent</item>
<item name="contentColorReactive">@color/content_reactive_light</item>
<item name="contentColorReactive">@color/content_reactive</item>
<item name="widgetColorThemePrimary">@color/colorPrimary</item>
<item name="widgetColorThemeAccent">@color/colorAccent</item>
<item name="progressColor">@color/progress_light</item>
<item name="progressColor">@color/progress</item>
<item name="guideBackgroundColor">@color/guide_bg</item>
<item name="guideTitleColor">?android:attr/textColorPrimaryInverse</item>
<item name="guideTextColor">?android:attr/textColorSecondaryInverse</item>
<item name="tagGroupBackgroundColor">@color/tag_group_background_light</item>
<item name="tagBackgroundColor">@color/tag_background_light</item>
<item name="tagGroupBackgroundColor">@color/tag_group_background</item>
<item name="tagBackgroundColor">@color/tag_background</item>
<item name="galleryDetailHeaderTitleColor">?android:attr/textColorPrimaryInverse</item>
<item name="galleryDetailHeaderBackgroundColor">?attr/contentColorThemePrimary</item>
<item name="galleryDetailButtonBackgroundColor">@color/gallery_detail_button_background_light</item>
<item name="galleryDetailButtonBackgroundColor">@color/gallery_detail_button_background
</item>
<item name="preferenceHeaderBackground">@drawable/preference_header_background_light</item>
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="galleryDetailDivider">@drawable/divider_gallery_detail_light</item>
<!--<item name="preferenceHeaderBackground">@drawable/preference_header_background</item>-->
<item name="toolbarPopupTheme">@style/ToolbarPopupTheme</item>
<item name="galleryDetailDivider">@drawable/divider_gallery_detail</item>
</style>
<style name="ToolbarPopupTheme" parent="ThemeOverlay.MaterialComponents.Light"/>
<style name="AppTheme" parent="BaseTheme">
<item name="android:colorEdgeEffect">?attr/colorEdgeEffect</item>
</style>
<style name="AppTheme.NoActionBar">
@@ -63,65 +66,18 @@
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.NoActionBar.Translucent"/>
<!-- =============== -->
<!-- Base Dark Theme -->
<!-- =============== -->
<style name="BaseTheme.Dark" parent="Theme.MaterialComponents">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/grey_900</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="colorControlActivated">@color/colorPrimary</item>
<item name="actionBarStyle">@style/ActionBarStyle</item>
<item name="android:windowBackground">@color/grey_850</item>
<item name="android:colorBackground">@color/grey_850</item>
<item name="colorBackgroundFloating">@color/grey_850</item>
<item name="colorEdgeEffect">@color/grey_500</item>
<item name="dividerColor">@color/divider_dark</item>
<item name="toolbarColor">?android:attr/colorBackground</item>
<item name="textColorThemePrimary">?android:attr/textColorSecondary</item>
<item name="textColorThemeAccent">?android:attr/textColorSecondary</item>
<item name="drawableColorPrimary">@color/primary_drawable_dark</item>
<item name="drawableColorSecondary">@color/secondary_drawable_dark</item>
<item name="drawableColorThemePrimary">@color/primary_drawable_dark</item>
<item name="contentColorPrimary">@color/content_dark</item>
<item name="contentColorThemePrimary">?attr/contentColorPrimary</item>
<item name="contentColorThemeAccent">?attr/contentColorPrimary</item>
<item name="contentColorReactive">@color/content_reactive_dark</item>
<item name="widgetColorThemePrimary">@color/widget_dark</item>
<item name="widgetColorThemeAccent">@color/widget_dark</item>
<item name="progressColor">@color/progress_dark</item>
<item name="guideBackgroundColor">#e5303030</item>
<item name="guideTitleColor">?android:attr/textColorPrimary</item>
<item name="guideTextColor">?android:attr/textColorSecondary</item>
<item name="tagGroupBackgroundColor">@color/tag_group_background_dark</item>
<item name="tagBackgroundColor">@color/tag_background_dark</item>
<item name="galleryDetailHeaderTitleColor">?android:attr/textColorPrimary</item>
<item name="galleryDetailHeaderBackgroundColor">?attr/contentColorThemePrimary</item>
<item name="galleryDetailButtonBackgroundColor">@color/gallery_detail_button_background_dark</item>
<item name="preferenceHeaderBackground">@drawable/preference_header_background_dark</item>
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
<item name="galleryDetailDivider">@drawable/divider_gallery_detail_dark</item>
<style name="AppTheme.NoActionBar.Translucent">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="AppTheme.Dark" parent="BaseTheme.Dark">
</style>
<style name="AppTheme.Dark.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.Dark.NoActionBar.Translucent"/>
<!-- =============== -->
<!-- Base Black Theme -->
<!-- =============== -->
<style name="BaseTheme.Black" parent="Theme.MaterialComponents">
<style name="ThemeOverlay"/>
<style name="ThemeOverlay.Black">
<item name="android:colorEdgeEffect">?attr/colorEdgeEffect</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@android:color/black</item>
<item name="colorAccent">@color/colorPrimary</item>
@@ -135,7 +91,7 @@
<item name="android:textColorPrimary">@color/primary_text_material_black</item>
<item name="colorEdgeEffect">@color/grey_500</item>
<item name="dividerColor">@color/divider_dark</item>
<item name="dividerColor">@color/divider_black</item>
<item name="toolbarColor">@android:color/black</item>
<item name="textColorThemePrimary">?android:attr/textColorSecondary</item>
<item name="textColorThemeAccent">?android:attr/textColorSecondary</item>
@@ -156,53 +112,27 @@
<item name="tagBackgroundColor">@color/tag_background_black</item>
<item name="galleryDetailHeaderTitleColor">?android:attr/textColorPrimary</item>
<item name="galleryDetailHeaderBackgroundColor">@android:color/black</item>
<item name="galleryDetailButtonBackgroundColor">@color/gallery_detail_button_background_black</item>
<item name="galleryDetailButtonBackgroundColor">
@color/gallery_detail_button_background_black
</item>
<item name="preferenceHeaderBackground">@drawable/preference_header_background_black</item>
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
<item name="galleryDetailDivider">@drawable/divider_gallery_detail_dark</item>
</style>
<style name="AppTheme.Black" parent="BaseTheme.Black">
</style>
<style name="AppTheme.Black.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.Black.NoActionBar.Translucent"/>
<!-- ========= -->
<!-- App Theme -->
<!-- ========= -->
<style name="AppTheme.Main" parent="AppTheme.NoActionBar.Translucent"/>
<style name="AppTheme.Main" parent="AppTheme.NoActionBar.Translucent" />
<style name="AppTheme.Main.Dark" parent="AppTheme.Dark.NoActionBar.Translucent"/>
<style name="AppTheme.Toolbar" parent="AppTheme.NoActionBar" />
<style name="AppTheme.Main.Black" parent="AppTheme.Black.NoActionBar.Translucent"/>
<style name="AppTheme.Toolbar" parent="AppTheme.NoActionBar"/>
<style name="AppTheme.Toolbar.Dark" parent="AppTheme.Dark.NoActionBar"/>
<style name="AppTheme.Toolbar.Black" parent="AppTheme.Black.NoActionBar"/>
<style name="AppTheme.Gallery" parent="AppTheme.Dark.NoActionBar">
<style name="AppTheme.Gallery" parent="AppTheme.NoActionBar">
<item name="gallerySliderBackgroundColor">@color/gallery_slider_background_dark</item>
</style>
<style name="AppTheme.Gallery.Dark"/>
<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"/>
<style name="AppTheme.Settings.Dark" parent="AppTheme.Dark"/>
<style name="AppTheme.Settings.Black" parent="AppTheme.Black"/>
<style name="AppTheme.Settings" parent="AppTheme" />
<!-- ============ -->
<!-- Widget Theme -->
+10 -5
View File
@@ -55,13 +55,18 @@
app:iconSpaceReserved="false"/>
<SimpleMenuPreference
android:defaultValue="-1"
android:entries="@array/night_mode_entries"
android:entryValues="@array/night_mode_values"
android:key="theme"
android:title="@string/settings_eh_theme"
android:summary="%s"
app:entries="@array/theme_entries"
app:entryValues="@array/theme_entry_values"
android:defaultValue="0"
app:iconSpaceReserved="false"/>
android:title="@string/settings_eh_theme"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:key="black_dark_theme"
android:title="@string/black_dark_theme"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:key="apply_nav_bar_theme_color"