mirror of
https://github.com/seven332/EhViewer
synced 2026-12-01 19:48:02 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8d8ee8501 | ||
|
|
9a87701ad6 | ||
|
|
cdc8a7aea6 | ||
|
|
90bfd445d1 | ||
|
|
7493bd57f4 | ||
|
|
629c2bb80d | ||
|
|
4d45d717e2 | ||
|
|
b8e80c6c8c | ||
|
|
efed7776d3 | ||
|
|
56cfc0669b | ||
|
|
6d9ed41382 | ||
|
|
505efbdef6 | ||
|
|
52ab8cebb0 | ||
|
|
e8251ee521 | ||
|
|
d4195c6e5b | ||
|
|
f50975d767 | ||
|
|
4d9452c791 | ||
|
|
474eea094d | ||
|
|
bbb6b634ff | ||
|
|
d5da97141f | ||
|
|
a12f9ba595 | ||
|
|
75944e5a8b | ||
|
|
1aa51a5934 | ||
|
|
092fd6779c | ||
|
|
618dc2b180 |
No files matched your search
+4
-3
@@ -4,15 +4,16 @@ apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.2"
|
||||
buildToolsVersion "23.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.hippo.ehviewer"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 23
|
||||
versionCode 55
|
||||
versionName "1.0.2"
|
||||
versionCode 57
|
||||
versionName "1.0.4"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
resConfigs "zh", "zh-rCN", "zh-rHK", "zh-rTW"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.hippo.conaco.Conaco;
|
||||
import com.hippo.ehviewer.client.EhClient;
|
||||
import com.hippo.ehviewer.client.EhCookieStore;
|
||||
import com.hippo.ehviewer.client.EhEngine;
|
||||
import com.hippo.ehviewer.client.EhUrl;
|
||||
import com.hippo.ehviewer.client.data.GalleryDetail;
|
||||
import com.hippo.ehviewer.download.DownloadManager;
|
||||
import com.hippo.ehviewer.spider.SpiderDen;
|
||||
@@ -55,6 +56,8 @@ import java.util.List;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import okhttp3.Cookie;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
public class EhApplication extends SceneApplication implements Thread.UncaughtExceptionHandler {
|
||||
@@ -142,6 +145,29 @@ public class EhApplication extends SceneApplication implements Thread.UncaughtEx
|
||||
if (version < 52) {
|
||||
Settings.putGuideGallery(true);
|
||||
}
|
||||
if (version < 56) { // Make cookie long live
|
||||
HttpUrl eUrl = HttpUrl.parse(EhUrl.HOST_E);
|
||||
HttpUrl exUrl = HttpUrl.parse(EhUrl.HOST_EX);
|
||||
EhCookieStore cookieStore = getEhCookieStore(this);
|
||||
|
||||
Cookie c;
|
||||
c = cookieStore.get(eUrl, EhCookieStore.KEY_IPD_MEMBER_ID);
|
||||
if (null != c) {
|
||||
cookieStore.add(EhCookieStore.newCookie(c, c.domain(), true, true, true));
|
||||
}
|
||||
c = cookieStore.get(eUrl, EhCookieStore.KEY_IPD_PASS_HASH);
|
||||
if (null != c) {
|
||||
cookieStore.add(EhCookieStore.newCookie(c, c.domain(), true, true, true));
|
||||
}
|
||||
c = cookieStore.get(exUrl, EhCookieStore.KEY_IPD_MEMBER_ID);
|
||||
if (null != c) {
|
||||
cookieStore.add(EhCookieStore.newCookie(c, c.domain(), true, true, true));
|
||||
}
|
||||
c = cookieStore.get(exUrl, EhCookieStore.KEY_IPD_PASS_HASH);
|
||||
if (null != c) {
|
||||
cookieStore.add(EhCookieStore.newCookie(c, c.domain(), true, true, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void clearMemoryCache() {
|
||||
|
||||
@@ -253,6 +253,13 @@ public class Settings {
|
||||
return getIntFromStr(KEY_LIST_MODE, DEFAULT_LIST_MODE);
|
||||
}
|
||||
|
||||
public static final String KEY_THUMB_SIZE = "thumb_size";
|
||||
private static final int DEFAULT_THUMB_SIZE = 1;
|
||||
|
||||
public static int getThumbSize() {
|
||||
return getIntFromStr(KEY_THUMB_SIZE, DEFAULT_THUMB_SIZE);
|
||||
}
|
||||
|
||||
private static final String KEY_SHOW_JPN_TITLE = "show_jpn_title";
|
||||
private static final boolean DEFAULT_SHOW_JPN_TITLE = false;
|
||||
|
||||
@@ -459,6 +466,17 @@ public class Settings {
|
||||
putBoolean(KEY_VOLUME_PAGE, value);
|
||||
}
|
||||
|
||||
private static final String KEY_READING_FULLSCREEN = "reading_fullscreen";
|
||||
private static final boolean VALUE_READING_FULLSCREEN = true;
|
||||
|
||||
public static boolean getReadingFullscreen() {
|
||||
return getBoolean(KEY_READING_FULLSCREEN, VALUE_READING_FULLSCREEN);
|
||||
}
|
||||
|
||||
public static void putReadingFullscreen(boolean value) {
|
||||
putBoolean(KEY_READING_FULLSCREEN, value);
|
||||
}
|
||||
|
||||
private static final String KEY_CUSTOM_SCREEN_LIGHTNESS = "custom_screen_lightness";
|
||||
private static final boolean DEFAULT_CUSTOM_SCREEN_LIGHTNESS = false;
|
||||
|
||||
@@ -804,6 +822,13 @@ public class Settings {
|
||||
putString(KEY_SECURITY, value);
|
||||
}
|
||||
|
||||
public static final String KEY_READ_CACHE_SIZE = "read_cache_size";
|
||||
public static final int DEFAULT_READ_CACHE_SIZE = 160;
|
||||
|
||||
public static int getReadCacheSize() {
|
||||
return getIntFromStr(KEY_READ_CACHE_SIZE, DEFAULT_READ_CACHE_SIZE);
|
||||
}
|
||||
|
||||
/********************
|
||||
****** Guide
|
||||
********************/
|
||||
|
||||
@@ -49,11 +49,15 @@ public class EhCookieStore extends CookieDBStore {
|
||||
contain(EhUrl.DOMAIN_EX, KEY_IPD_PASS_HASH);
|
||||
}
|
||||
|
||||
public static Cookie newCookie(Cookie cookie, String newDomain, boolean forcePersistent, boolean forceNotHostOnly) {
|
||||
public static Cookie newCookie(Cookie cookie, String newDomain, boolean forcePersistent,
|
||||
boolean forceLongLive, boolean forceNotHostOnly) {
|
||||
Cookie.Builder builder = new Cookie.Builder();
|
||||
builder.name(cookie.name());
|
||||
builder.value(cookie.value());
|
||||
if (cookie.persistent()) {
|
||||
|
||||
if (forceLongLive) {
|
||||
builder.expiresAt(Long.MAX_VALUE);
|
||||
} else if (cookie.persistent()) {
|
||||
builder.expiresAt(cookie.expiresAt());
|
||||
} else if (forcePersistent) {
|
||||
builder.expiresAt(Long.MAX_VALUE);
|
||||
@@ -125,7 +129,9 @@ public class EhCookieStore extends CookieDBStore {
|
||||
// Save id and hash for exhentai
|
||||
if (KEY_IPD_MEMBER_ID.equals(cookie.name()) ||
|
||||
KEY_IPD_PASS_HASH.equals(cookie.name())) {
|
||||
result.add(newCookie(cookie, EhUrl.DOMAIN_EX, false, false));
|
||||
result.add(newCookie(cookie, EhUrl.DOMAIN_E, true, true, true));
|
||||
result.add(newCookie(cookie, EhUrl.DOMAIN_EX, true, true, true));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -500,6 +500,7 @@ public class EhEngine {
|
||||
builder.add("favnote", note != null ? note : "");
|
||||
// submit=Add+to+Favorites is not necessary, just use submit=Apply+Changes all the time
|
||||
builder.add("submit", "Apply Changes");
|
||||
builder.add("update", "1");
|
||||
String url = EhUrl.getAddFavorites(gid, token);
|
||||
Log.d(TAG, url);
|
||||
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig())
|
||||
|
||||
@@ -31,6 +31,7 @@ public class EhUrl {
|
||||
public static final String DOMAIN_G = "g.e-hentai.org";
|
||||
public static final String DOMAIN_LOFI = "lofi.e-hentai.org";
|
||||
|
||||
public static final String HOST_E = "http://" + DOMAIN_E + "/";
|
||||
public static final String HOST_EX = "http://" + DOMAIN_EX + "/";
|
||||
public static final String HOST_G = "http://" + DOMAIN_G + "/";
|
||||
|
||||
|
||||
@@ -54,15 +54,9 @@ public class EhGalleryProvider extends GalleryProvider implements SpiderQueen.On
|
||||
|
||||
if (mSpiderQueen != null) {
|
||||
mSpiderQueen.removeOnSpiderListener(this);
|
||||
final SpiderQueen spiderQueen = mSpiderQueen;
|
||||
// Activity recreate may called, so wait 3000s
|
||||
SimpleHandler.getInstance().postDelayed(new ReleaseTask(mSpiderQueen), 3000);
|
||||
mSpiderQueen = null;
|
||||
// Activity recreate may called
|
||||
SimpleHandler.getInstance().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SpiderQueen.releaseSpiderQueen(spiderQueen, SpiderQueen.MODE_READ);
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,4 +194,21 @@ public class EhGalleryProvider extends GalleryProvider implements SpiderQueen.On
|
||||
public void onGetImageFailure(int index, String error) {
|
||||
notifyPageFailed(index, error);
|
||||
}
|
||||
|
||||
private static class ReleaseTask implements Runnable {
|
||||
|
||||
private SpiderQueen mSpiderQueen;
|
||||
|
||||
public ReleaseTask(SpiderQueen spiderQueen) {
|
||||
mSpiderQueen = spiderQueen;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (null != mSpiderQueen) {
|
||||
SpiderQueen.releaseSpiderQueen(mSpiderQueen, SpiderQueen.MODE_READ);
|
||||
mSpiderQueen = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,9 +88,6 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
private static final int METHOD_SET_SCALE_MODE = 18;
|
||||
private static final int METHOD_SET_START_POSITION = 19;
|
||||
private static final int METHOD_ON_ATTACH_TO_ROOT = 20;
|
||||
private static final int METHOD_ON_DETACH_FROM_ROOT = 21;
|
||||
private static final int METHOD_PAUSE = 22;
|
||||
private static final int METHOD_RESUME = 23;
|
||||
|
||||
private final Context mContext;
|
||||
private MovableTextTexture mPageTextTexture;
|
||||
@@ -114,6 +111,7 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
|
||||
private boolean mEnableRequestFill = true;
|
||||
private boolean mRequestFill = false;
|
||||
private boolean mWillFill = false;
|
||||
|
||||
private boolean mScale = false;
|
||||
private boolean mScroll = false;
|
||||
@@ -247,40 +245,17 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
postMethod(METHOD_ON_ATTACH_TO_ROOT);
|
||||
}
|
||||
|
||||
private void onDetachFromRootInternal() {
|
||||
@Override
|
||||
public void onDetachFromRoot() {
|
||||
// When detached, render() will not be called. So do it here
|
||||
detachLayoutManager();
|
||||
if (null != mPageTextTexture) {
|
||||
mPageTextTexture.recycle();
|
||||
mPageTextTexture = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachFromRoot() {
|
||||
super.onDetachFromRoot();
|
||||
mEdgeView.onDetachFromRoot();
|
||||
postMethod(METHOD_ON_DETACH_FROM_ROOT);
|
||||
}
|
||||
|
||||
private void pauseInternal() {
|
||||
mPause = true;
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
postMethod(METHOD_PAUSE);
|
||||
}
|
||||
|
||||
private void resumeInternal() {
|
||||
if (mPause) {
|
||||
mPause = false;
|
||||
if (null != mLayoutManager) {
|
||||
mLayoutManager.bindUnloadedPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
postMethod(METHOD_RESUME);
|
||||
}
|
||||
|
||||
@LayoutMode
|
||||
@@ -311,7 +286,9 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
public void requestFill() {
|
||||
if (mEnableRequestFill) {
|
||||
mRequestFill = true;
|
||||
invalidate();
|
||||
if (!mWillFill) {
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -785,15 +762,6 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
case METHOD_ON_ATTACH_TO_ROOT:
|
||||
onAttachToRootInternal();
|
||||
break;
|
||||
case METHOD_ON_DETACH_FROM_ROOT:
|
||||
onDetachFromRootInternal();
|
||||
break;
|
||||
case METHOD_PAUSE:
|
||||
pauseInternal();
|
||||
break;
|
||||
case METHOD_RESUME:
|
||||
resumeInternal();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -803,6 +771,7 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
|
||||
@Override
|
||||
public void render(GLCanvas canvas) {
|
||||
mWillFill = true;
|
||||
int oldCurrentIndex = mCurrentIndex.get();
|
||||
|
||||
// Dispatch method
|
||||
@@ -814,6 +783,7 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
}
|
||||
|
||||
fill();
|
||||
mWillFill = false;
|
||||
|
||||
super.render(canvas);
|
||||
mEdgeView.render(canvas);
|
||||
@@ -975,8 +945,6 @@ public class GalleryView extends GLView implements GestureRecognizer.Listener {
|
||||
|
||||
public abstract void onDataChanged();
|
||||
|
||||
public abstract void bindUnloadedPage();
|
||||
|
||||
public abstract void onPageLeft();
|
||||
|
||||
public abstract void onPageRight();
|
||||
|
||||
@@ -449,9 +449,8 @@ public class PagerLayoutManager extends GalleryView.LayoutManager {
|
||||
image.getScaleDefault(scales);
|
||||
float scale = image.getScale();
|
||||
float endScale = scales[0];
|
||||
for (int i = 0, size = scales.length; i < size; i++) {
|
||||
float value = scales[i];
|
||||
if (scale < value) {
|
||||
for (float value: scales) {
|
||||
if (scale < value - 0.01f) {
|
||||
endScale = value;
|
||||
break;
|
||||
}
|
||||
@@ -717,23 +716,6 @@ public class PagerLayoutManager extends GalleryView.LayoutManager {
|
||||
mGalleryView.requestFill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindUnloadedPage() {
|
||||
if (null == mAdapter) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (null != mCurrent && !mCurrent.getImageView().isLoaded()) {
|
||||
mAdapter.bind(mCurrent, mIndex);
|
||||
}
|
||||
if (null != mPrevious && !mPrevious.getImageView().isLoaded()) {
|
||||
mAdapter.bind(mPrevious, mIndex - 1);
|
||||
}
|
||||
if (null != mNext && !mNext.getImageView().isLoaded()) {
|
||||
mAdapter.bind(mNext, mIndex + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageLeft() {
|
||||
int size = mAdapter.size();
|
||||
|
||||
@@ -22,12 +22,15 @@ import android.support.annotation.NonNull;
|
||||
import android.util.Log;
|
||||
|
||||
import com.hippo.ehviewer.gallery.GalleryProvider;
|
||||
import com.hippo.gl.anim.Animation;
|
||||
import com.hippo.gl.view.GLView;
|
||||
import com.hippo.gl.widget.GLEdgeView;
|
||||
import com.hippo.gl.widget.GLProgressView;
|
||||
import com.hippo.gl.widget.GLTextureView;
|
||||
import com.hippo.yorozuya.AnimationUtils;
|
||||
import com.hippo.yorozuya.AssertUtils;
|
||||
import com.hippo.yorozuya.LayoutUtils;
|
||||
import com.hippo.yorozuya.MathUtils;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
@@ -39,7 +42,13 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
private static final int INTERVAL = 24;
|
||||
|
||||
private static final float RESERVATIONS = 0.5f;
|
||||
private static final float RESERVATION = 1f;
|
||||
|
||||
private static final float MAX_SCALE = 2.0f;
|
||||
private static final float MIN_SCALE = 1.0f;
|
||||
private static final float SCALE_ERROR = 0.01f;
|
||||
|
||||
private static final int INVALID_TOP = Integer.MAX_VALUE;
|
||||
|
||||
private GalleryView.Adapter mAdapter;
|
||||
|
||||
@@ -49,16 +58,22 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
private final LinkedList<GalleryPageView> mPages = new LinkedList<>();
|
||||
private final LinkedList<GalleryPageView> mTempPages = new LinkedList<>();
|
||||
|
||||
private int mOffset;
|
||||
private float mScale = 0.5f;
|
||||
private int mOffsetX;
|
||||
private int mOffsetY;
|
||||
private int mDeltaX;
|
||||
private int mDeltaY;
|
||||
private int mFirstShownLoadedPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
private int mKeepTopPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
private int mKeepTop = INVALID_TOP;
|
||||
private int mFirstShownPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
private boolean mScrollUp;
|
||||
private boolean mFlingUp;
|
||||
private boolean mStopAnimationFinger;
|
||||
|
||||
private final int mInterval;
|
||||
|
||||
private final PageFling mPageFling;
|
||||
private final SmoothScaler mSmoothScaler;
|
||||
|
||||
// Current index
|
||||
private int mIndex;
|
||||
@@ -71,14 +86,20 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
mInterval = LayoutUtils.dp2pix(context, INTERVAL);
|
||||
mPageFling = new PageFling(context);
|
||||
mSmoothScaler = new SmoothScaler();
|
||||
}
|
||||
|
||||
private void resetParameters() {
|
||||
mOffset = 0;
|
||||
mScale = 1.0f;
|
||||
mOffsetX = 0;
|
||||
mOffsetY = 0;
|
||||
mDeltaX = 0;
|
||||
mDeltaY = 0;
|
||||
mFirstShownLoadedPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
mKeepTopPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
mKeepTop = INVALID_TOP;
|
||||
mFirstShownPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
mScrollUp = false;
|
||||
mFlingUp = false;
|
||||
mStopAnimationFinger = false;
|
||||
}
|
||||
|
||||
@@ -166,6 +187,19 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isInScreen(GalleryPageView page) {
|
||||
int height = mGalleryView.getHeight();
|
||||
Rect bound = page.bounds();
|
||||
int pageTop = bound.top;
|
||||
int pageBottom = bound.bottom;
|
||||
return (pageTop >= 0 && pageTop < height) || (pageBottom > 0 && pageBottom <= height) ||
|
||||
(pageTop < 0 && pageBottom > height);
|
||||
}
|
||||
|
||||
private float getReservation() {
|
||||
return Math.max(RESERVATION, (((1 + 2 * RESERVATION) * mScale) - 1) / 2);
|
||||
}
|
||||
|
||||
private void fillPages(int startIndex, int startOffset) {
|
||||
final GalleryView.Adapter adapter = mAdapter;
|
||||
final GalleryView galleryView = mGalleryView;
|
||||
@@ -173,11 +207,13 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
final LinkedList<GalleryPageView> tempPages = mTempPages;
|
||||
final int width = galleryView.getWidth();
|
||||
final int height = galleryView.getHeight();
|
||||
final int pageWidth = (int) (width * mScale);
|
||||
final int size = adapter.size();
|
||||
final int interval = mInterval;
|
||||
final int minY = (int) (-height * RESERVATIONS);
|
||||
final int maxY = (int) (height * (1 + RESERVATIONS));
|
||||
final int widthSpec = GLView.MeasureSpec.makeMeasureSpec(width, GLView.MeasureSpec.EXACTLY);
|
||||
final float reservation = getReservation();
|
||||
final int minY = (int) (-height * reservation);
|
||||
final int maxY = (int) (height * (1 + reservation));
|
||||
final int widthSpec = GLView.MeasureSpec.makeMeasureSpec(pageWidth, GLView.MeasureSpec.EXACTLY);
|
||||
final int heightSpec = GLView.MeasureSpec.makeMeasureSpec(height, GLView.MeasureSpec.UNSPECIFIED);
|
||||
|
||||
// Fix start index and start offset
|
||||
@@ -241,6 +277,14 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
tempPages.addAll(pages);
|
||||
pages.clear();
|
||||
|
||||
// Sanitize offsetX
|
||||
int margin = pageWidth - width;
|
||||
if (margin >= 0) {
|
||||
mOffsetX = MathUtils.clamp(mOffsetX, -margin, 0);
|
||||
} else {
|
||||
mOffsetX = -margin / 2;
|
||||
}
|
||||
|
||||
// Layout start page
|
||||
GalleryPageView page = getPageForIndex(tempPages, startIndex, true);
|
||||
if (null == page) {
|
||||
@@ -250,7 +294,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
}
|
||||
pages.add(page);
|
||||
page.measure(widthSpec, heightSpec);
|
||||
page.layout(0, startOffset, width, startOffset + page.getMeasuredHeight());
|
||||
page.layout(mOffsetX, startOffset, mOffsetX + pageWidth, startOffset + page.getMeasuredHeight());
|
||||
|
||||
// Prepare for check up and down
|
||||
int bottomOffset = startOffset - interval;
|
||||
@@ -267,7 +311,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
}
|
||||
pages.addFirst(page);
|
||||
page.measure(widthSpec, heightSpec);
|
||||
page.layout(0, bottomOffset - page.getMeasuredHeight(), width, bottomOffset);
|
||||
page.layout(mOffsetX, bottomOffset - page.getMeasuredHeight(), mOffsetX + pageWidth, bottomOffset);
|
||||
// Update
|
||||
bottomOffset -= page.getMeasuredHeight() + interval;
|
||||
index--;
|
||||
@@ -294,7 +338,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
}
|
||||
pages.addLast(page);
|
||||
page.measure(widthSpec, heightSpec);
|
||||
page.layout(0, topOffset, width, topOffset + page.getMeasuredHeight());
|
||||
page.layout(mOffsetX, topOffset, mOffsetX + pageWidth, topOffset + page.getMeasuredHeight());
|
||||
// Update
|
||||
topOffset += page.getMeasuredHeight() + interval;
|
||||
index++;
|
||||
@@ -330,7 +374,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
p.offsetTopAndBottom(offset);
|
||||
}
|
||||
int bottom = pagesTop - interval + offset;
|
||||
page.layout(0, bottom - page.getMeasuredHeight(), width, bottom);
|
||||
page.layout(mOffsetX, bottom - page.getMeasuredHeight(), mOffsetX + pageWidth, bottom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +388,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
if (!pages.isEmpty()) {
|
||||
page = pages.getFirst();
|
||||
mIndex = page.getIndex();
|
||||
mOffset = page.bounds().top;
|
||||
mOffsetY = page.bounds().top;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,7 +398,6 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
GalleryView galleryView = mGalleryView;
|
||||
AssertUtils.assertNotEquals("The PagerLayoutManager is not attached", adapter, null);
|
||||
|
||||
int height = galleryView.getHeight();
|
||||
int size = adapter.size();
|
||||
String errorStr = adapter.getError();
|
||||
|
||||
@@ -418,45 +461,49 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
removeAllPages();
|
||||
}
|
||||
|
||||
// Find first shown loaded page top
|
||||
GalleryPageView firstShownLoadedPage = null;
|
||||
int firstShownLoadedPageTop = mOffset;
|
||||
if (mFirstShownLoadedPageIndex != GalleryPageView.INVALID_INDEX) {
|
||||
// Find keep index and keep top
|
||||
int keepTop = INVALID_TOP;
|
||||
int keepTopIndex;
|
||||
if (GalleryPageView.INVALID_INDEX != mKeepTopPageIndex) {
|
||||
keepTopIndex = mKeepTopPageIndex;
|
||||
keepTop = mKeepTop;
|
||||
} else if (GalleryPageView.INVALID_INDEX != mFirstShownPageIndex) {
|
||||
keepTopIndex = mFirstShownPageIndex;
|
||||
} else {
|
||||
keepTopIndex = GalleryPageView.INVALID_INDEX;
|
||||
}
|
||||
if (GalleryPageView.INVALID_INDEX != keepTopIndex && INVALID_TOP == keepTop) {
|
||||
keepTop = mOffsetY;
|
||||
for (GalleryPageView page : pages) {
|
||||
// Check first shown loaded page
|
||||
if (mFirstShownLoadedPageIndex == page.getIndex()) {
|
||||
firstShownLoadedPage = page;
|
||||
// Check keep page
|
||||
if (keepTopIndex == page.getIndex()) {
|
||||
break;
|
||||
}
|
||||
firstShownLoadedPageTop += page.getHeight() + mInterval;
|
||||
keepTop += page.getHeight() + mInterval;
|
||||
}
|
||||
}
|
||||
|
||||
int startIndex;
|
||||
int startOffset;
|
||||
if (null != firstShownLoadedPage) {
|
||||
startIndex = mFirstShownLoadedPageIndex;
|
||||
startOffset = firstShownLoadedPageTop;
|
||||
if (GalleryPageView.INVALID_INDEX != keepTopIndex) {
|
||||
startIndex = keepTopIndex;
|
||||
startOffset = keepTop;
|
||||
} else {
|
||||
startIndex = mIndex;
|
||||
startOffset = mOffset;
|
||||
startOffset = mOffsetY;
|
||||
}
|
||||
fillPages(startIndex, startOffset);
|
||||
|
||||
// Get first shown loaded image
|
||||
mFirstShownLoadedPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
// Get first shown image
|
||||
mFirstShownPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
for (GalleryPageView page : mPages) {
|
||||
// Check first shown loaded page
|
||||
if (!page.isLoaded()) {
|
||||
if ((mScrollUp || mFlingUp) && !page.isLoaded()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Rect bound = page.bounds();
|
||||
int pageTop = bound.top;
|
||||
int pageBottom = bound.bottom;
|
||||
if ((pageTop >= 0 && pageTop < height) || (pageBottom > 0 && pageBottom <= height) ||
|
||||
(pageTop < 0 && pageBottom > height)) {
|
||||
mFirstShownLoadedPageIndex = page.getIndex();
|
||||
if (isInScreen(page)) {
|
||||
mFirstShownPageIndex = page.getIndex();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -473,12 +520,25 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
@Override
|
||||
public void onUp() {
|
||||
mScrollUp = false;
|
||||
mGalleryView.getEdgeView().onRelease();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDoubleTapConfirmed(float x, float y) {
|
||||
if (mPages.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
float startScale = mScale;
|
||||
float endScale;
|
||||
if (startScale < MAX_SCALE - SCALE_ERROR) {
|
||||
endScale = MAX_SCALE;
|
||||
} else {
|
||||
endScale = MIN_SCALE;
|
||||
}
|
||||
|
||||
mSmoothScaler.startSmoothScaler(x, y, startScale, endScale, 300);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -492,7 +552,6 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
mDeltaX += dx;
|
||||
mDeltaY += dy;
|
||||
|
||||
/*
|
||||
if (mDeltaX < 0) {
|
||||
edgeView.onPull(-mDeltaX, y, GLEdgeView.LEFT);
|
||||
if (!edgeView.isFinished(GLEdgeView.RIGHT)) {
|
||||
@@ -504,7 +563,6 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
edgeView.onRelease(GLEdgeView.LEFT);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (mDeltaY < 0) {
|
||||
edgeView.onPull(-mDeltaY, x, GLEdgeView.TOP);
|
||||
@@ -521,7 +579,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
private void getBottomState() {
|
||||
List<GalleryPageView> pages = mPages;
|
||||
int bottom = mOffset;
|
||||
int bottom = mOffsetY;
|
||||
int i = 0;
|
||||
for (GalleryPageView page : pages) {
|
||||
if (i != 0) {
|
||||
@@ -538,49 +596,70 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
// True for get top or bottom
|
||||
private boolean scrollInternal(float dx, float dy, boolean fling, float x, float y) {
|
||||
if (mPages.size() == 0) {
|
||||
if (mPages.size() <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
GalleryView galleryView = mGalleryView;
|
||||
int width = galleryView.getWidth();
|
||||
int height = galleryView.getHeight();
|
||||
int pageWidth = (int) (width * mScale);
|
||||
final float reservation = getReservation();
|
||||
boolean requestFill = false;
|
||||
int remainY = (int) dy;
|
||||
boolean result = false;
|
||||
|
||||
int margin = pageWidth - width;
|
||||
int dxInt = (int) dx;
|
||||
if (margin > 0 && 0 != dxInt) {
|
||||
int oldOffsetX = mOffsetX;
|
||||
int exceptOffsetX = oldOffsetX - dxInt;
|
||||
mOffsetX = MathUtils.clamp(exceptOffsetX, -margin, 0);
|
||||
if (mOffsetX != oldOffsetX) {
|
||||
requestFill = true;
|
||||
}
|
||||
// Do not show over scroll effect for left and right
|
||||
/*
|
||||
int extraOffsetX = mOffsetX - exceptOffsetX;
|
||||
if (0 != extraOffsetX) {
|
||||
overScrollEdge(extraOffsetX, 0, x, y);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
int remainY = (int) dy;
|
||||
while (remainY != 0) {
|
||||
if (remainY < 0) { // Try to show top
|
||||
int limit;
|
||||
if (mIndex > 0) {
|
||||
limit = (int) (-height * RESERVATIONS) + mInterval;
|
||||
limit = (int) (-height * reservation) + mInterval;
|
||||
} else {
|
||||
limit = 0;
|
||||
}
|
||||
|
||||
if (mOffset - remainY <= limit) {
|
||||
mOffset -= remainY;
|
||||
if (mOffsetY - remainY <= limit) {
|
||||
mOffsetY -= remainY;
|
||||
remainY = 0;
|
||||
requestFill = true;
|
||||
mDeltaX = 0;
|
||||
mDeltaY = 0;
|
||||
} else {
|
||||
if (mIndex > 0) {
|
||||
mOffset = limit;
|
||||
remainY = remainY + limit - mOffset;
|
||||
mOffsetY = limit;
|
||||
remainY = remainY + limit - mOffsetY;
|
||||
// Offset one pixel to avoid infinite loop
|
||||
++mOffset;
|
||||
++mOffsetY;
|
||||
++remainY;
|
||||
galleryView.forceFill();
|
||||
requestFill = false;
|
||||
mDeltaX = 0;
|
||||
mDeltaY = 0;
|
||||
} else {
|
||||
if (mOffset != limit) {
|
||||
mOffset = limit;
|
||||
if (mOffsetY != limit) {
|
||||
mOffsetY = limit;
|
||||
requestFill = true;
|
||||
}
|
||||
if (!fling) {
|
||||
overScrollEdge(0, remainY + limit - mOffset, x, y);
|
||||
overScrollEdge(0, remainY + limit - mOffsetY, x, y);
|
||||
}
|
||||
remainY = 0;
|
||||
result = true;
|
||||
@@ -593,7 +672,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
int limit;
|
||||
if (hasNext) {
|
||||
limit = (int) (height * (1 + RESERVATIONS)) - mInterval;
|
||||
limit = (int) (height * (1 + reservation)) - mInterval;
|
||||
} else {
|
||||
limit = height;
|
||||
}
|
||||
@@ -601,25 +680,25 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
limit = Math.min(bottom, limit);
|
||||
|
||||
if (bottom - remainY >= limit) {
|
||||
mOffset -= remainY;
|
||||
mOffsetY -= remainY;
|
||||
remainY = 0;
|
||||
requestFill = true;
|
||||
mDeltaX = 0;
|
||||
mDeltaY = 0;
|
||||
} else {
|
||||
if (hasNext) {
|
||||
mOffset -= bottom - limit;
|
||||
mOffsetY -= bottom - limit;
|
||||
remainY = remainY + limit - bottom;
|
||||
// Offset one pixel to avoid infinite loop
|
||||
--mOffset;
|
||||
--mOffsetY;
|
||||
--remainY;
|
||||
galleryView.forceFill();
|
||||
requestFill = false;
|
||||
mDeltaX = 0;
|
||||
mDeltaY = 0;
|
||||
} else {
|
||||
if (mOffset != limit) {
|
||||
mOffset -= bottom - limit;
|
||||
if (mOffsetY != limit) {
|
||||
mOffsetY -= bottom - limit;
|
||||
requestFill = true;
|
||||
}
|
||||
if (!fling) {
|
||||
@@ -641,6 +720,8 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
@Override
|
||||
public void onScroll(float dx, float dy, float totalX, float totalY, float x, float y) {
|
||||
mKeepTopPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
mKeepTop = INVALID_TOP;
|
||||
mScrollUp = dy < 0;
|
||||
scrollInternal(dx, dy, false, x, y);
|
||||
}
|
||||
@@ -651,13 +732,28 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
return;
|
||||
}
|
||||
|
||||
mScrollUp = velocityY > 0;
|
||||
mKeepTopPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
mKeepTop = INVALID_TOP;
|
||||
mFlingUp = velocityY > 0;
|
||||
|
||||
int maxX;
|
||||
int minX;
|
||||
int width = mGalleryView.getWidth();
|
||||
int pageWidth = (int) (width * mScale);
|
||||
int margin = pageWidth - width;
|
||||
if (margin > 0) {
|
||||
maxX = -mOffsetX;
|
||||
minX = -margin + mOffsetX;
|
||||
} else {
|
||||
maxX = 0;
|
||||
minX = 0;
|
||||
}
|
||||
|
||||
int maxY;
|
||||
if (mIndex > 0) {
|
||||
maxY = Integer.MAX_VALUE;
|
||||
} else {
|
||||
maxY = -mOffset;
|
||||
maxY = -mOffsetY;
|
||||
}
|
||||
|
||||
getBottomState();
|
||||
@@ -670,23 +766,66 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
minY = mGalleryView.getHeight() - bottom;
|
||||
}
|
||||
|
||||
mPageFling.startFling((int) velocityX, 0, 0,
|
||||
mPageFling.startFling((int) velocityX, minX, maxX,
|
||||
(int) velocityY, minY, maxY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canScale() {
|
||||
return false;
|
||||
return mPages.size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScale(float focusX, float focusY, float scale) {
|
||||
if (mPages.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
float oldScale = mScale;
|
||||
mScale = MathUtils.clamp(oldScale * scale, MIN_SCALE, MAX_SCALE);
|
||||
scale = mScale / oldScale;
|
||||
|
||||
if (oldScale != mScale) {
|
||||
GalleryPageView page = null;
|
||||
// Keep scale page origin position
|
||||
for (GalleryPageView p : mPages) {
|
||||
if (p.bounds().top < focusY) {
|
||||
page = p;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (null != page) {
|
||||
mKeepTopPageIndex = page.getIndex();
|
||||
mKeepTop = page.bounds().top;
|
||||
|
||||
mGalleryView.forceFill();
|
||||
int oldKeepTop = mKeepTop;
|
||||
mKeepTop = INVALID_TOP;
|
||||
|
||||
// Apply scroll
|
||||
int newOffsetX = (int) (focusX - ((focusX - mOffsetX) * scale));
|
||||
int newKeepTop;
|
||||
if (page.isLoaded()) {
|
||||
newKeepTop = (int) (focusY - ((focusY - oldKeepTop) * scale));
|
||||
} else {
|
||||
newKeepTop = oldKeepTop;
|
||||
}
|
||||
scrollInternal(mOffsetX - newOffsetX, oldKeepTop - newKeepTop, false, focusX, focusY);
|
||||
} else {
|
||||
Log.e(TAG, "Can't find target page");
|
||||
mKeepTopPageIndex = GalleryPageView.INVALID_INDEX;
|
||||
mKeepTop = INVALID_TOP;
|
||||
mGalleryView.forceFill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUpdateAnimation(long time) {
|
||||
boolean invalidate = mPageFling.calculate(time);
|
||||
invalidate |= mSmoothScaler.calculate(time);
|
||||
return invalidate;
|
||||
}
|
||||
|
||||
@@ -705,21 +844,6 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
mGalleryView.requestFill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindUnloadedPage() {
|
||||
if (null == mAdapter || 0 <= mPages.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int index = mIndex;
|
||||
for (GalleryPageView page: mPages) {
|
||||
if (!page.getImageView().isLoaded()) {
|
||||
mAdapter.bind(page, index);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageLeft() {
|
||||
int size = mAdapter.size();
|
||||
@@ -727,8 +851,11 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
return;
|
||||
}
|
||||
|
||||
///////
|
||||
// UP
|
||||
///////
|
||||
GalleryView galleryView = mGalleryView;
|
||||
if (mIndex == 0 && mOffset >= 0) {
|
||||
if (mIndex == 0 && mOffsetY >= 0) {
|
||||
GLEdgeView edgeView = galleryView.getEdgeView();
|
||||
edgeView.onPull(galleryView.getHeight(),
|
||||
galleryView.getWidth() / 2, GLEdgeView.TOP);
|
||||
@@ -736,13 +863,37 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
} else {
|
||||
// Cancel all animations
|
||||
cancelAllAnimations();
|
||||
mOffset += galleryView.getHeight() / 2;
|
||||
// Backup offset
|
||||
int offset = mOffset;
|
||||
// Reset parameters
|
||||
resetParameters();
|
||||
// Restore offset
|
||||
mOffset = offset;
|
||||
|
||||
// Get first shown page
|
||||
GalleryPageView previousPage = null;
|
||||
GalleryPageView firstShownPage = null;
|
||||
for (GalleryPageView p: mPages) {
|
||||
if (isInScreen(p)) {
|
||||
firstShownPage = p;
|
||||
break;
|
||||
}
|
||||
previousPage = p;
|
||||
}
|
||||
|
||||
int height = galleryView.getHeight();
|
||||
int maxOffset = height - mInterval;
|
||||
if (null == firstShownPage) {
|
||||
Log.e(TAG, "Can't find first shown page when paging left");
|
||||
mOffsetY += height / 2;
|
||||
} else {
|
||||
int firstShownTop = firstShownPage.bounds().top;
|
||||
if (firstShownTop >= 0) {
|
||||
if (null == previousPage) {
|
||||
Log.e(TAG, "Can't find previous page when paging left and offsetY == 0");
|
||||
mOffsetY += height / 2;
|
||||
} else {
|
||||
mOffsetY += Math.min(maxOffset, -previousPage.bounds().top);
|
||||
}
|
||||
} else {
|
||||
mOffsetY += Math.min(maxOffset, -firstShownTop);
|
||||
}
|
||||
}
|
||||
|
||||
// Request fill
|
||||
mGalleryView.requestFill();
|
||||
}
|
||||
@@ -755,6 +906,9 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
return;
|
||||
}
|
||||
|
||||
/////////
|
||||
// DOWN
|
||||
/////////
|
||||
GalleryView galleryView = mGalleryView;
|
||||
getBottomState();
|
||||
int bottom = mBottomStateBottom;
|
||||
@@ -767,13 +921,38 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
} else {
|
||||
// Cancel all animations
|
||||
cancelAllAnimations();
|
||||
mOffset -= galleryView.getHeight() / 2;
|
||||
// Backup offset
|
||||
int offset = mOffset;
|
||||
// Reset parameters
|
||||
resetParameters();
|
||||
// Restore offset
|
||||
mOffset = offset;
|
||||
|
||||
// Get first shown page
|
||||
GalleryPageView lastShownPage = null;
|
||||
GalleryPageView nextPage = null;
|
||||
for (GalleryPageView p: mPages) {
|
||||
if (isInScreen(p)) {
|
||||
lastShownPage = p;
|
||||
} else if (null != lastShownPage) {
|
||||
nextPage = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int height = galleryView.getHeight();
|
||||
int maxOffset = height - mInterval;
|
||||
if (null == lastShownPage) {
|
||||
Log.e(TAG, "Can't find last shown page when paging left");
|
||||
mOffsetY -= height / 2;
|
||||
} else {
|
||||
int lastShownBottom = lastShownPage.bounds().bottom;
|
||||
if (lastShownBottom <= height) {
|
||||
if (null == nextPage) {
|
||||
Log.e(TAG, "Can't find previous page when paging left and offsetY == 0");
|
||||
mOffsetY -= height / 2;
|
||||
} else {
|
||||
mOffsetY -= Math.min(maxOffset, nextPage.bounds().bottom - height);
|
||||
}
|
||||
} else {
|
||||
mOffsetY -= Math.min(maxOffset, lastShownBottom - height);
|
||||
}
|
||||
}
|
||||
|
||||
// Request fill
|
||||
mGalleryView.requestFill();
|
||||
}
|
||||
@@ -796,13 +975,8 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
@Override
|
||||
public int getCurrentIndex() {
|
||||
int height = mGalleryView.getHeight();
|
||||
for (GalleryPageView page : mPages) {
|
||||
Rect bound = page.bounds();
|
||||
int pageTop = bound.top;
|
||||
int pageBottom = bound.bottom;
|
||||
if ((pageTop >= 0 && pageTop < height) || (pageBottom > 0 && pageBottom <= height) ||
|
||||
(pageTop < 0 && pageBottom > height)) {
|
||||
if (isInScreen(page)) {
|
||||
return page.getIndex();
|
||||
}
|
||||
}
|
||||
@@ -816,9 +990,13 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
// Can't get size now, assume size is MAX
|
||||
size = Integer.MAX_VALUE;
|
||||
}
|
||||
if (index == mIndex || index < 0 || index >= size) {
|
||||
if (index < 0 || index >= size) {
|
||||
return;
|
||||
}
|
||||
|
||||
mKeepTopPageIndex = index;
|
||||
mKeepTop = INVALID_TOP;
|
||||
|
||||
if (mPages.isEmpty()) {
|
||||
mIndex = index;
|
||||
} else {
|
||||
@@ -834,25 +1012,18 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
if (targetPage != null) {
|
||||
// Cancel all animations
|
||||
cancelAllAnimations();
|
||||
mOffset -= targetPage.bounds().top;
|
||||
// Backup offset
|
||||
int offset = mOffset;
|
||||
// Reset parameters
|
||||
resetParameters();
|
||||
// Restore offset
|
||||
mOffset = offset;
|
||||
mOffsetY -= targetPage.bounds().top;
|
||||
// Request fill
|
||||
mGalleryView.requestFill();
|
||||
} else {
|
||||
mIndex = index;
|
||||
mOffsetY = 0;
|
||||
// Cancel all animations
|
||||
cancelAllAnimations();
|
||||
// Remove all view
|
||||
removeProgress();
|
||||
removeErrorView();
|
||||
removeAllPages();
|
||||
// Reset parameters
|
||||
resetParameters();
|
||||
// Request fill
|
||||
mGalleryView.requestFill();
|
||||
}
|
||||
@@ -884,7 +1055,7 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
return currentIndex;
|
||||
}
|
||||
|
||||
class PageFling extends Fling {
|
||||
private class PageFling extends Fling {
|
||||
|
||||
private int mVelocityX;
|
||||
private int mVelocityY;
|
||||
@@ -950,9 +1121,11 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
|
||||
@Override
|
||||
protected void onFinish() {
|
||||
mFlingUp = false;
|
||||
|
||||
int index = mIndex;
|
||||
|
||||
boolean topEdge = index <= 0 && mOffset >= 0;
|
||||
boolean topEdge = index <= 0 && mOffsetY >= 0;
|
||||
|
||||
getBottomState();
|
||||
int bottom = mBottomStateBottom;
|
||||
@@ -971,4 +1144,40 @@ public class ScrollLayoutManager extends GalleryView.LayoutManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class SmoothScaler extends Animation {
|
||||
|
||||
private float mFocusX;
|
||||
private float mFocusY;
|
||||
private float mStartScale;
|
||||
private float mEndScale;
|
||||
private float mLastScale;
|
||||
|
||||
public SmoothScaler() {
|
||||
setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR);
|
||||
}
|
||||
|
||||
public void startSmoothScaler(float focusX, float focusY,
|
||||
float startScale, float endScale, int duration) {
|
||||
mFocusX = focusX;
|
||||
mFocusY = focusY;
|
||||
mStartScale = startScale;
|
||||
mEndScale = endScale;
|
||||
mLastScale = startScale;
|
||||
setDuration(duration);
|
||||
start();
|
||||
mGalleryView.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCalculate(float progress) {
|
||||
if (mPages.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
float scale = MathUtils.lerp(mStartScale, mEndScale, progress);
|
||||
onScale(mFocusX, mFocusY, scale / mLastScale);
|
||||
mLastScale = scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.hippo.ehviewer.preference;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.hippo.ehviewer.EhApplication;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.Settings;
|
||||
import com.hippo.ehviewer.download.DownloadManager;
|
||||
import com.hippo.unifile.UniFile;
|
||||
import com.hippo.yorozuya.NumberUtils;
|
||||
|
||||
public class CleanRedundancyPreference extends TaskPreference {
|
||||
|
||||
public CleanRedundancyPreference(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public CleanRedundancyPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public CleanRedundancyPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected Task onCreateTask() {
|
||||
return new ClearTask(getContext());
|
||||
}
|
||||
|
||||
private static class ClearTask extends Task {
|
||||
|
||||
private final EhApplication mApplication;
|
||||
private final DownloadManager mManager;
|
||||
|
||||
public ClearTask(@NonNull Context context) {
|
||||
super(context);
|
||||
mApplication = (EhApplication) context.getApplicationContext();
|
||||
mManager = EhApplication.getDownloadManager(mApplication);
|
||||
}
|
||||
|
||||
// True for cleared
|
||||
private boolean clearFile(UniFile file) {
|
||||
String name = file.getName();
|
||||
int index = name.indexOf('-');
|
||||
if (index >= 0) {
|
||||
name = name.substring(0, index);
|
||||
}
|
||||
long gid = NumberUtils.parseLongSafely(name, -1L);
|
||||
if (-1L == gid) {
|
||||
return false;
|
||||
}
|
||||
if (mManager.containDownloadInfo(gid)) {
|
||||
return false;
|
||||
}
|
||||
file.delete();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doInBackground(Void... params) {
|
||||
UniFile dir = Settings.getDownloadLocation();
|
||||
if (null == dir) {
|
||||
return 0;
|
||||
}
|
||||
UniFile[] files = dir.listFiles();
|
||||
if (null == files) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (UniFile f: files) {
|
||||
if (clearFile(f)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Object o) {
|
||||
int count;
|
||||
if (o instanceof Integer) {
|
||||
count = (Integer) o;
|
||||
} else {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
Toast.makeText(mApplication, 0 == count ?
|
||||
mApplication.getString(R.string.settings_download_clean_redundancy_no_redundancy):
|
||||
mApplication.getString(R.string.settings_download_clean_redundancy_done, count), Toast.LENGTH_SHORT).show();
|
||||
super.onPostExecute(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ import com.hippo.unifile.FilenameFilter;
|
||||
import com.hippo.unifile.UniFile;
|
||||
import com.hippo.yorozuya.FileUtils;
|
||||
import com.hippo.yorozuya.IOUtils;
|
||||
import com.hippo.yorozuya.MathUtils;
|
||||
import com.hippo.yorozuya.Utilities;
|
||||
import com.hippo.yorozuya.io.InputStreamPipe;
|
||||
import com.hippo.yorozuya.io.OutputStreamPipe;
|
||||
@@ -54,7 +55,8 @@ public final class SpiderDen {
|
||||
private static SimpleDiskCache sCache;
|
||||
|
||||
public static void initialize(Context context) {
|
||||
sCache = new SimpleDiskCache(new File(context.getCacheDir(), "image"), 160 * 1024 * 1024);
|
||||
sCache = new SimpleDiskCache(new File(context.getCacheDir(), "image"),
|
||||
MathUtils.clamp(Settings.getReadCacheSize(), 40, 640) * 1024 * 1024);
|
||||
}
|
||||
|
||||
private static class StartWithFilenameFilter implements FilenameFilter {
|
||||
|
||||
@@ -223,6 +223,14 @@ public class GalleryActivity extends EhActivity
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
if (Settings.getReadingFullscreen() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Window w = getWindow();
|
||||
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
|
||||
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
|
||||
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
@@ -256,16 +264,18 @@ public class GalleryActivity extends EhActivity
|
||||
glRootView.setContentPane(mGalleryView);
|
||||
|
||||
// System UI helper
|
||||
int systemUiLevel;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
systemUiLevel = SystemUiHelper.LEVEL_IMMERSIVE;
|
||||
} else {
|
||||
systemUiLevel = SystemUiHelper.LEVEL_HIDE_STATUS_BAR;
|
||||
if (Settings.getReadingFullscreen()) {
|
||||
int systemUiLevel;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
systemUiLevel = SystemUiHelper.LEVEL_IMMERSIVE;
|
||||
} else {
|
||||
systemUiLevel = SystemUiHelper.LEVEL_HIDE_STATUS_BAR;
|
||||
}
|
||||
mSystemUiHelper = new SystemUiHelper(this, systemUiLevel,
|
||||
SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES | SystemUiHelper.FLAG_IMMERSIVE_STICKY);
|
||||
mSystemUiHelper.hide();
|
||||
mShowSystemUi = false;
|
||||
}
|
||||
mSystemUiHelper = new SystemUiHelper(this, systemUiLevel,
|
||||
SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES | SystemUiHelper.FLAG_IMMERSIVE_STICKY);
|
||||
mSystemUiHelper.hide();
|
||||
mShowSystemUi = false;
|
||||
|
||||
mMaskView = (ColorView) ViewUtils.$$(this, R.id.mask);
|
||||
mClock = ViewUtils.$$(this, R.id.clock);
|
||||
@@ -341,24 +351,6 @@ public class GalleryActivity extends EhActivity
|
||||
SimpleHandler.getInstance().removeCallbacks(mHideSliderRunnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
if (null != mGalleryView) {
|
||||
mGalleryView.pause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (null != mGalleryView) {
|
||||
mGalleryView.resume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
@@ -719,6 +711,7 @@ public class GalleryActivity extends EhActivity
|
||||
private final SwitchCompat mShowClock;
|
||||
private final SwitchCompat mShowBattery;
|
||||
private final SwitchCompat mVolumePage;
|
||||
private final SwitchCompat mReadingFullscreen;
|
||||
private final SwitchCompat mCustomScreenLightness;
|
||||
private final SeekBar mScreenLightness;
|
||||
|
||||
@@ -733,6 +726,7 @@ public class GalleryActivity extends EhActivity
|
||||
mShowClock = (SwitchCompat) mView.findViewById(R.id.show_clock);
|
||||
mShowBattery = (SwitchCompat) mView.findViewById(R.id.show_battery);
|
||||
mVolumePage = (SwitchCompat) mView.findViewById(R.id.volume_page);
|
||||
mReadingFullscreen = (SwitchCompat) mView.findViewById(R.id.reading_fullscreen);
|
||||
mCustomScreenLightness = (SwitchCompat) mView.findViewById(R.id.custom_screen_lightness);
|
||||
mScreenLightness = (SeekBar) mView.findViewById(R.id.screen_lightness);
|
||||
|
||||
@@ -744,6 +738,7 @@ public class GalleryActivity extends EhActivity
|
||||
mShowClock.setChecked(Settings.getShowClock());
|
||||
mShowBattery.setChecked(Settings.getShowBattery());
|
||||
mVolumePage.setChecked(Settings.getVolumePage());
|
||||
mReadingFullscreen.setChecked(Settings.getReadingFullscreen());
|
||||
mCustomScreenLightness.setChecked(Settings.getCustomScreenLightness());
|
||||
mScreenLightness.setProgress(Settings.getScreenLightness());
|
||||
mScreenLightness.setEnabled(Settings.getCustomScreenLightness());
|
||||
@@ -770,9 +765,12 @@ public class GalleryActivity extends EhActivity
|
||||
boolean showClock = mShowClock.isChecked();
|
||||
boolean showBattery = mShowBattery.isChecked();
|
||||
boolean volumePage = mVolumePage.isChecked();
|
||||
boolean readingFullscreen = mReadingFullscreen.isChecked();
|
||||
boolean customScreenLightness = mCustomScreenLightness.isChecked();
|
||||
int screenLightness = mScreenLightness.getProgress();
|
||||
|
||||
boolean oldReadingFullscreen = Settings.getReadingFullscreen();
|
||||
|
||||
Settings.putScreenRotation(screenRotation);
|
||||
Settings.putReadingDirection(layoutMode);
|
||||
Settings.putPageScaling(scaleMode);
|
||||
@@ -781,6 +779,7 @@ public class GalleryActivity extends EhActivity
|
||||
Settings.putShowClock(showClock);
|
||||
Settings.putShowBattery(showBattery);
|
||||
Settings.putVolumePage(volumePage);
|
||||
Settings.putReadingFullscreen(readingFullscreen);
|
||||
Settings.putCustomScreenLightness(customScreenLightness);
|
||||
Settings.putScreenLightness(screenLightness);
|
||||
|
||||
@@ -819,6 +818,10 @@ public class GalleryActivity extends EhActivity
|
||||
// Update slider
|
||||
mLayoutMode = layoutMode;
|
||||
updateSlider();
|
||||
|
||||
if (oldReadingFullscreen != readingFullscreen) {
|
||||
recreate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,11 @@ public class EhFragment extends PreferenceFragment
|
||||
|
||||
Preference gallerySite = findPreference(Settings.KEY_GALLERY_SITE);
|
||||
Preference listMode = findPreference(Settings.KEY_LIST_MODE);
|
||||
Preference thumbSize = findPreference(Settings.KEY_THUMB_SIZE);
|
||||
|
||||
gallerySite.setOnPreferenceChangeListener(this);
|
||||
listMode.setOnPreferenceChangeListener(this);
|
||||
thumbSize.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,6 +50,8 @@ public class EhFragment extends PreferenceFragment
|
||||
} else if (Settings.KEY_LIST_MODE.equals(key)) {
|
||||
getActivity().setResult(Activity.RESULT_OK);
|
||||
return true;
|
||||
} else if (Settings.KEY_THUMB_SIZE.equals(key)) {
|
||||
getActivity().setResult(Activity.RESULT_OK);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -329,12 +329,12 @@ public class DownloadsScene extends ToolbarScene
|
||||
|
||||
private void guide() {
|
||||
if (Settings.getGuideDownloadThumb()) {
|
||||
SimpleHandler.getInstance().post(new Runnable() {
|
||||
SimpleHandler.getInstance().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
guideDownloadThumb();
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
} else {
|
||||
guideDownloadLabels();
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import android.widget.TextView;
|
||||
import com.hippo.drawable.TriangleDrawable;
|
||||
import com.hippo.easyrecyclerview.MarginItemDecoration;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.Settings;
|
||||
import com.hippo.ehviewer.client.EhCacheKeyFactory;
|
||||
import com.hippo.ehviewer.client.EhUtils;
|
||||
import com.hippo.ehviewer.client.data.GalleryInfo;
|
||||
@@ -100,7 +101,20 @@ abstract class GalleryAdapter extends RecyclerView.Adapter<GalleryHolder> {
|
||||
break;
|
||||
}
|
||||
case GalleryAdapter.TYPE_GRID: {
|
||||
int columnWidth = mResources.getDimensionPixelOffset(R.dimen.gallery_grid_column_width);
|
||||
int columnWidthId;
|
||||
switch (Settings.getThumbSize()) {
|
||||
case 0:
|
||||
columnWidthId = R.dimen.gallery_grid_column_width_large;
|
||||
break;
|
||||
default:
|
||||
case 1:
|
||||
columnWidthId = R.dimen.gallery_grid_column_width_middle;
|
||||
break;
|
||||
case 2:
|
||||
columnWidthId = R.dimen.gallery_grid_column_width_small;
|
||||
break;
|
||||
}
|
||||
int columnWidth = mResources.getDimensionPixelOffset(columnWidthId);
|
||||
mLayoutManager.setColumnSize(columnWidth);
|
||||
mLayoutManager.setStrategy(AutoGridLayoutManager.STRATEGY_SUITABLE_SIZE);
|
||||
if (null == mGirdDecoration) {
|
||||
|
||||
@@ -329,7 +329,6 @@ public final class SignInScene extends BaseScene implements EditText.OnEditorAct
|
||||
new AlertDialog.Builder(context)
|
||||
.setTitle(R.string.sign_in_failed)
|
||||
.setMessage(R.string.sign_in_failed_plain)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(R.string.get_it, null)
|
||||
.show();
|
||||
}
|
||||
@@ -377,8 +376,7 @@ public final class SignInScene extends BaseScene implements EditText.OnEditorAct
|
||||
mSigningIn = false;
|
||||
Toast.makeText(context, ExceptionUtils.getReadableString(context, e),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
hideProgress();
|
||||
whetherToSkip();
|
||||
redirectTo();
|
||||
}
|
||||
|
||||
private class SignInListener extends EhCallback<SignInScene, String> {
|
||||
|
||||
@@ -121,7 +121,7 @@ public class WebViewSignInScene extends BaseScene {
|
||||
}
|
||||
|
||||
private void addCookie(Context context, String domain, Cookie cookie) {
|
||||
EhApplication.getEhCookieStore(context).add(EhCookieStore.newCookie(cookie, domain, true, true));
|
||||
EhApplication.getEhCookieStore(context).add(EhCookieStore.newCookie(cookie, domain, true, true, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,12 +18,12 @@ package com.hippo.ehviewer.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.AppCompatEditText;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.EditText;
|
||||
|
||||
public class SearchEditText extends EditText {
|
||||
public class SearchEditText extends AppCompatEditText {
|
||||
|
||||
private SearchEditTextListener mListener;
|
||||
|
||||
|
||||
@@ -573,28 +573,34 @@ public class GLRootView extends GLSurfaceView
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
|
||||
unfreeze();
|
||||
super.surfaceChanged(holder, format, w, h);
|
||||
|
||||
requestLayoutContentPane();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
unfreeze();
|
||||
super.surfaceCreated(holder);
|
||||
|
||||
if (mContentView != null && !mContentView.isAttachedToRoot()) {
|
||||
mContentView.attachToRoot(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
unfreeze();
|
||||
super.surfaceDestroyed(holder);
|
||||
|
||||
if (mContentView != null && mContentView.isAttachedToRoot()) {
|
||||
mContentView.detachFromRoot();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
unfreeze();
|
||||
super.onDetachedFromWindow();
|
||||
|
||||
if (mContentView != null) {
|
||||
mContentView.detachFromRoot();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.hippo.okhttp;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
@@ -176,6 +178,35 @@ public class CookieDBStore implements CookieJar {
|
||||
}
|
||||
}
|
||||
|
||||
private Cookie getInternal(HttpUrl url, String name, List<CookieWithID> cookies) {
|
||||
for (Iterator<CookieWithID> i = cookies.iterator(); i.hasNext();) {
|
||||
CookieWithID cwi = i.next();
|
||||
Cookie cookie = cwi.cookie;
|
||||
// Check expired
|
||||
if (hasExpired(cookie)) {
|
||||
// Remove from list
|
||||
i.remove();
|
||||
// Remove from DB
|
||||
CookieDB.removeCookie(cwi.id);
|
||||
} else if (cookie.name().equals(name) && cookie.matches(url)) {
|
||||
return cookie;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public synchronized Cookie get(HttpUrl url, String name) {
|
||||
String host = url.host();
|
||||
for (String key : map.keySet()) {
|
||||
if (domainMatch(host, key)) {
|
||||
List<CookieWithID> cookies = map.get(key);
|
||||
return getInternal(url, name, cookies);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public synchronized List<Cookie> get(HttpUrl url) {
|
||||
List<Cookie> result = new ArrayList<>();
|
||||
|
||||
@@ -185,6 +216,7 @@ public class CookieDBStore implements CookieJar {
|
||||
List<CookieWithID> cookies = map.get(key);
|
||||
// cookies can not be null
|
||||
getInternal(url, cookies, result);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.support.annotation.ArrayRes;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
|
||||
import com.hippo.ehviewer.R;
|
||||
|
||||
@@ -139,6 +140,9 @@ public class ListPreference extends DialogPreference {
|
||||
* @param value The value to set for the key.
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
|
||||
Log.d("TAG", "value = " + value);
|
||||
|
||||
// Always persist/notify the first time.
|
||||
final boolean changed = !TextUtils.equals(mValue, value);
|
||||
if (changed || !mValueSet) {
|
||||
|
||||
@@ -99,6 +99,8 @@ public class SlidingDrawerLayout extends ViewGroup implements ValueAnimator.Anim
|
||||
Build.VERSION.SDK_INT >= 21;
|
||||
private static final int DRAWER_ELEVATION = 10; //dp
|
||||
|
||||
private static final int MIN_DRAWER_MARGIN = 56;
|
||||
|
||||
private static final SlidingDrawerLayoutInsetsHelper INSETS_HELPER;
|
||||
|
||||
static {
|
||||
@@ -153,8 +155,6 @@ public class SlidingDrawerLayout extends ViewGroup implements ValueAnimator.Anim
|
||||
private Paint mStatusBarPaint;
|
||||
private Paint mNavigationBarPaint;
|
||||
|
||||
private static int sDefaultMinDrawerMargin = 56;
|
||||
|
||||
/**
|
||||
* Listener for monitoring events about drawers.
|
||||
*/
|
||||
@@ -190,15 +190,6 @@ public class SlidingDrawerLayout extends ViewGroup implements ValueAnimator.Anim
|
||||
void onDrawerStateChanged(View drawerView, int newState);
|
||||
}
|
||||
|
||||
/**
|
||||
* minMargin should be app bar height in Material design
|
||||
*
|
||||
* @param minMargin
|
||||
*/
|
||||
public static void setDefaultMinDrawerMargin(int minMargin) {
|
||||
sDefaultMinDrawerMargin = minMargin;
|
||||
}
|
||||
|
||||
public SlidingDrawerLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init(context);
|
||||
@@ -217,7 +208,7 @@ public class SlidingDrawerLayout extends ViewGroup implements ValueAnimator.Anim
|
||||
mRightState = STATE_CLOSED;
|
||||
mLeftPercent = 0.0f;
|
||||
mRightPercent = 0.0f;
|
||||
mMinDrawerMargin = sDefaultMinDrawerMargin;
|
||||
mMinDrawerMargin = LayoutUtils.dp2pix(context, MIN_DRAWER_MARGIN);
|
||||
mDragHelper = ViewDragHelper.create(this, 0.5f, new DragHelperCallback());
|
||||
mAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
|
||||
mAnimator.addUpdateListener(this);
|
||||
@@ -536,8 +527,8 @@ public class SlidingDrawerLayout extends ViewGroup implements ValueAnimator.Anim
|
||||
}
|
||||
}
|
||||
final int drawerWidthSpec = getChildMeasureSpec(widthMeasureSpec,
|
||||
lp.leftMargin + lp.rightMargin,
|
||||
Math.min(widthSize - mMinDrawerMargin, lp.width));
|
||||
lp.leftMargin + lp.rightMargin + mMinDrawerMargin,
|
||||
Math.min(widthSize, lp.width));
|
||||
final int drawerHeightSpec = getChildMeasureSpec(heightMeasureSpec,
|
||||
lp.topMargin + lp.bottomMargin + paddingTop + paddingBottom,
|
||||
lp.height);
|
||||
|
||||
@@ -1,29 +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.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/primary_drawable_light"
|
||||
android:pathData="@string/pd_close"/>
|
||||
|
||||
</vector>
|
||||
@@ -1,29 +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.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/primary_drawable_dark"
|
||||
android:pathData="@string/pd_label"/>
|
||||
|
||||
</vector>
|
||||
@@ -150,6 +150,13 @@
|
||||
android:text="@string/settings_read_volume_page"
|
||||
android:textColor="@color/primary_text_dark"/>
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/reading_fullscreen"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_read_reading_fullscreen"
|
||||
android:textColor="@color/primary_text_dark"/>
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/custom_screen_lightness"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -24,41 +24,42 @@
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp">
|
||||
android:layout_height="48dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_menu"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:padding="16dp"/>
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/search_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:layout_marginRight="56dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="@dimen/text_large"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:layout_marginRight="48dp"
|
||||
android:textSize="@dimen/text_little_large"
|
||||
android:textColor="@color/secondary_text_light"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_action"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
android:padding="16dp"/>
|
||||
android:padding="12dp"/>
|
||||
|
||||
<com.hippo.ehviewer.widget.SearchEditText
|
||||
android:id="@+id/search_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:layout_marginRight="56dp"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:layout_marginRight="48dp"
|
||||
android:textSize="@dimen/text_little_small"
|
||||
android:background="@null"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
|
||||
@@ -1,29 +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.
|
||||
-->
|
||||
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@drawable/v_magnify_dark_x24"
|
||||
android:title="@string/search"
|
||||
app:showAsAction="always"
|
||||
app:actionViewClass="android.support.v7.widget.SearchView"/>
|
||||
|
||||
</menu>
|
||||
@@ -361,6 +361,10 @@
|
||||
<string name="settings_eh_list_mode">列表模式</string>
|
||||
<string name="settings_eh_list_mode_detail">详情</string>
|
||||
<string name="settings_eh_list_mode_thumb">缩略图</string>
|
||||
<string name="settings_eh_thumb_size">缩略图大小</string>
|
||||
<string name="settings_eh_thumb_size_large">大</string>
|
||||
<string name="settings_eh_thumb_size_middle">中</string>
|
||||
<string name="settings_eh_thumb_size_small">小</string>
|
||||
<string name="settings_eh_default_categories">主页分类显示</string>
|
||||
<string name="settings_eh_default_categories_summary">默认在主页所显示的分类</string>
|
||||
<string name="settings_eh_excluded_tag_namespaces">排除标签组</string>
|
||||
@@ -401,6 +405,7 @@
|
||||
<string name="settings_read_show_clock">显示时钟</string>
|
||||
<string name="settings_read_show_battery">显示电量</string>
|
||||
<string name="settings_read_volume_page">使用音量键翻页</string>
|
||||
<string name="settings_read_reading_fullscreen">全屏</string>
|
||||
<string name="settings_read_custom_screen_lightness">自定义屏幕亮度</string>
|
||||
<string name="settings_read_screen_lightness">屏幕亮度</string>
|
||||
|
||||
@@ -424,6 +429,10 @@
|
||||
<string name="settings_download_restore_not_found">未找到可恢复下载项</string>
|
||||
<string name="settings_download_restore_failed">恢复失败</string>
|
||||
<string name="settings_download_restore_successfully">成功恢复 %s 项</string>
|
||||
<string name="settings_download_clean_redundancy">清理下载冗余</string>
|
||||
<string name="settings_download_clean_redundancy_summary">清理下载目录中不在下载列表里的图片文件</string>
|
||||
<string name="settings_download_clean_redundancy_no_redundancy">未发现冗余</string>
|
||||
<string name="settings_download_clean_redundancy_done">完成冗余清理,共清理 %d 项</string>
|
||||
|
||||
<string name="settings_advanced">高级</string>
|
||||
<string name="settings_advanced_save_parse_error_body">解析失败时保存页面内容</string>
|
||||
@@ -437,6 +446,7 @@
|
||||
<string name="settings_advanced_clear_download_path_cache_message">清除画廊下载路径缓存?</string>
|
||||
<string name="settings_advanced_clear_memory_cache">清理内存缓存</string>
|
||||
<string name="settings_advanced_clear_memory_cache_summary">清理缩略图、画廊信息的内存缓存</string>
|
||||
<string name="settings_advanced_read_cache_size">阅读缓存大小</string>
|
||||
<string name="settings_advanced_pattern_protection_title">图案保护</string>
|
||||
<string name="settings_advanced_pattern_protection_not_set">未设置图案保护</string>
|
||||
<string name="settings_advanced_pattern_protection_set">已设置图案保护</string>
|
||||
|
||||
@@ -361,6 +361,10 @@
|
||||
<string name="settings_eh_list_mode">列表模式</string>
|
||||
<string name="settings_eh_list_mode_detail">詳情</string>
|
||||
<string name="settings_eh_list_mode_thumb">縮略圖</string>
|
||||
<string name="settings_eh_thumb_size">縮略圖大小</string>
|
||||
<string name="settings_eh_thumb_size_large">大</string>
|
||||
<string name="settings_eh_thumb_size_middle">中</string>
|
||||
<string name="settings_eh_thumb_size_small">小</string>
|
||||
<string name="settings_eh_default_categories">主頁分類顯示</string>
|
||||
<string name="settings_eh_default_categories_summary">默認在主頁所顯示的分類</string>
|
||||
<string name="settings_eh_excluded_tag_namespaces">排除標籤組</string>
|
||||
@@ -401,6 +405,7 @@
|
||||
<string name="settings_read_show_clock">顯示時鐘</string>
|
||||
<string name="settings_read_show_battery">顯示電量</string>
|
||||
<string name="settings_read_volume_page">使用音量鍵翻頁</string>
|
||||
<string name="settings_read_reading_fullscreen">全屏</string>
|
||||
<string name="settings_read_custom_screen_lightness">自定義屏幕亮度</string>
|
||||
<string name="settings_read_screen_lightness">屏幕亮度</string>
|
||||
|
||||
@@ -424,6 +429,10 @@
|
||||
<string name="settings_download_restore_not_found">未找到可恢復下載項</string>
|
||||
<string name="settings_download_restore_failed">恢復失敗</string>
|
||||
<string name="settings_download_restore_successfully">成功恢復 %s 項</string>
|
||||
<string name="settings_download_clean_redundancy">清理下載宂餘</string>
|
||||
<string name="settings_download_clean_redundancy_summary">清理下載目錄中不在下載列表裏的圖片文件</string>
|
||||
<string name="settings_download_clean_redundancy_no_redundancy">未發現宂餘</string>
|
||||
<string name="settings_download_clean_redundancy_done">完成宂餘清理,共清理 %d 項</string>
|
||||
|
||||
<string name="settings_advanced">高級</string>
|
||||
<string name="settings_advanced_save_parse_error_body">解析失敗時保存頁面內容</string>
|
||||
@@ -437,6 +446,7 @@
|
||||
<string name="settings_advanced_clear_download_path_cache_message">清除畫廊下載路徑緩存?</string>
|
||||
<string name="settings_advanced_clear_memory_cache">清理內存緩存</string>
|
||||
<string name="settings_advanced_clear_memory_cache_summary">清理縮略圖、畫廊信息的內存緩存</string>
|
||||
<string name="settings_advanced_read_cache_size">閲讀緩存大小</string>
|
||||
<string name="settings_advanced_pattern_protection_title">圖案保護</string>
|
||||
<string name="settings_advanced_pattern_protection_not_set">未設置圖案保護</string>
|
||||
<string name="settings_advanced_pattern_protection_set">已設置圖案保護</string>
|
||||
|
||||
@@ -361,6 +361,10 @@
|
||||
<string name="settings_eh_list_mode">列表模式</string>
|
||||
<string name="settings_eh_list_mode_detail">詳情</string>
|
||||
<string name="settings_eh_list_mode_thumb">縮圖</string>
|
||||
<string name="settings_eh_thumb_size">縮圖大小</string>
|
||||
<string name="settings_eh_thumb_size_large">大</string>
|
||||
<string name="settings_eh_thumb_size_middle">中</string>
|
||||
<string name="settings_eh_thumb_size_small">小</string>
|
||||
<string name="settings_eh_default_categories">主頁分類顯示</string>
|
||||
<string name="settings_eh_default_categories_summary">預設在主頁所顯示的分類</string>
|
||||
<string name="settings_eh_excluded_tag_namespaces">排除標籤組</string>
|
||||
@@ -401,6 +405,7 @@
|
||||
<string name="settings_read_show_clock">顯示時鐘</string>
|
||||
<string name="settings_read_show_battery">顯示電量</string>
|
||||
<string name="settings_read_volume_page">使用音量鍵翻頁</string>
|
||||
<string name="settings_read_reading_fullscreen">全屏</string>
|
||||
<string name="settings_read_custom_screen_lightness">自定義螢幕亮度</string>
|
||||
<string name="settings_read_screen_lightness">螢幕亮度</string>
|
||||
|
||||
@@ -424,6 +429,10 @@
|
||||
<string name="settings_download_restore_not_found">未找到可恢復下載項</string>
|
||||
<string name="settings_download_restore_failed">恢復失敗</string>
|
||||
<string name="settings_download_restore_successfully">成功恢復 %s 項</string>
|
||||
<string name="settings_download_clean_redundancy">清理下載冗餘</string>
|
||||
<string name="settings_download_clean_redundancy_summary">清理下載目錄中不在下載列表裡的圖片檔案</string>
|
||||
<string name="settings_download_clean_redundancy_no_redundancy">未發現冗餘</string>
|
||||
<string name="settings_download_clean_redundancy_done">完成冗餘清理,共清理 %d 項</string>
|
||||
|
||||
<string name="settings_advanced">高階</string>
|
||||
<string name="settings_advanced_save_parse_error_body">解析失敗時儲存頁面內容</string>
|
||||
@@ -437,6 +446,7 @@
|
||||
<string name="settings_advanced_clear_download_path_cache_message">清除畫廊下載路徑快取?</string>
|
||||
<string name="settings_advanced_clear_memory_cache">清理記憶體快取</string>
|
||||
<string name="settings_advanced_clear_memory_cache_summary">清理縮圖、畫廊資訊的記憶體快取</string>
|
||||
<string name="settings_advanced_read_cache_size">閱讀快取大小</string>
|
||||
<string name="settings_advanced_pattern_protection_title">圖案保護</string>
|
||||
<string name="settings_advanced_pattern_protection_not_set">未設定圖案保護</string>
|
||||
<string name="settings_advanced_pattern_protection_set">已設定圖案保護</string>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<string-array name="list_mode_entries">
|
||||
<string-array name="list_mode_entries" translatable="false">
|
||||
<item>@string/settings_eh_list_mode_detail</item>
|
||||
<item>@string/settings_eh_list_mode_thumb</item>
|
||||
</string-array>
|
||||
@@ -37,6 +37,18 @@
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="thumb_size_entries" translatable="false">
|
||||
<item>@string/settings_eh_thumb_size_large</item>
|
||||
<item>@string/settings_eh_thumb_size_middle</item>
|
||||
<item>@string/settings_eh_thumb_size_small</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="thumb_size_entry_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="search_min_rating">
|
||||
<item>@string/star_2</item>
|
||||
<item>@string/star_3</item>
|
||||
@@ -132,6 +144,22 @@
|
||||
<item>4</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="read_cache_size_entries" translatable="false">
|
||||
<item>40 MB</item>
|
||||
<item>80 MB</item>
|
||||
<item>160 MB</item>
|
||||
<item>320 MB</item>
|
||||
<item>640 MB</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="read_cache_size_entry_values" translatable="false">
|
||||
<item>40</item>
|
||||
<item>80</item>
|
||||
<item>160</item>
|
||||
<item>320</item>
|
||||
<item>640</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="page_menu_entries">
|
||||
<item>@string/page_menu_refresh</item>
|
||||
<item>@string/page_menu_share</item>
|
||||
|
||||
@@ -44,11 +44,13 @@
|
||||
<dimen name="list_content_margin_v">4dp</dimen>
|
||||
<dimen name="list_content_interval">4dp</dimen>
|
||||
<dimen name="list_search_bar_margin">4dp</dimen>
|
||||
<dimen name="list_padding_top_search_bar">72dp</dimen>
|
||||
<dimen name="list_padding_top_search_bar">64dp</dimen>
|
||||
<dimen name="list_padding_bottom_fab">80dp</dimen>
|
||||
|
||||
<dimen name="gallery_list_column_width">320dp</dimen>
|
||||
<dimen name="gallery_grid_column_width">120dp</dimen>
|
||||
<dimen name="gallery_grid_column_width_large">160dp</dimen>
|
||||
<dimen name="gallery_grid_column_width_middle">120dp</dimen>
|
||||
<dimen name="gallery_grid_column_width_small">80dp</dimen>
|
||||
<dimen name="gallery_grid_margin">8dp</dimen>
|
||||
|
||||
<dimen name="preview_grid_column_width">120dp</dimen>
|
||||
|
||||
@@ -403,6 +403,10 @@
|
||||
<string name="settings_eh_list_mode">List mode</string>
|
||||
<string name="settings_eh_list_mode_detail">Detail</string>
|
||||
<string name="settings_eh_list_mode_thumb">Thumb</string>
|
||||
<string name="settings_eh_thumb_size">Thumb size</string>
|
||||
<string name="settings_eh_thumb_size_large">Large</string>
|
||||
<string name="settings_eh_thumb_size_middle">Middle</string>
|
||||
<string name="settings_eh_thumb_size_small">Small</string>
|
||||
<string name="settings_eh_default_categories">Categories on Homepage</string>
|
||||
<string name="settings_eh_default_categories_summary">The categories shown as default on Homepage</string>
|
||||
<string name="settings_eh_excluded_languages">Excluded languages</string>
|
||||
@@ -443,6 +447,7 @@
|
||||
<string name="settings_read_show_clock">Show clock</string>
|
||||
<string name="settings_read_show_battery">Show battery</string>
|
||||
<string name="settings_read_volume_page">Use volume key to turn pages</string>
|
||||
<string name="settings_read_reading_fullscreen">Fullscreen</string>
|
||||
<string name="settings_read_custom_screen_lightness">Custom screen lightness</string>
|
||||
<string name="settings_read_screen_lightness">Screen lightness</string>
|
||||
|
||||
@@ -466,6 +471,10 @@
|
||||
<string name="settings_download_restore_not_found">Not found download items to restore</string>
|
||||
<string name="settings_download_restore_failed">Restore failed</string>
|
||||
<string name="settings_download_restore_successfully">Restore %d items successfully</string>
|
||||
<string name="settings_download_clean_redundancy">Clear download redundancy</string>
|
||||
<string name="settings_download_clean_redundancy_summary">Remove gallery images which are not in download list but in download location</string>
|
||||
<string name="settings_download_clean_redundancy_no_redundancy">No redundancy</string>
|
||||
<string name="settings_download_clean_redundancy_done">Redundancy cleaning completed, clean-up %d items totally</string>
|
||||
|
||||
<string name="settings_advanced">Advanced</string>
|
||||
<string name="settings_advanced_save_parse_error_body">Save html content when parsing error</string>
|
||||
@@ -479,6 +488,7 @@
|
||||
<string name="settings_advanced_clear_download_path_cache_message">Clear download path cache?</string>
|
||||
<string name="settings_advanced_clear_memory_cache">Clear memory cache</string>
|
||||
<string name="settings_advanced_clear_memory_cache_summary">Clear thumb, gallery info memory cache</string>
|
||||
<string name="settings_advanced_read_cache_size">Read cache size</string>
|
||||
<string name="settings_advanced_pattern_protection_title">Pattern protection</string>
|
||||
<string name="settings_advanced_pattern_protection_not_set">Pattern protection has not been set</string>
|
||||
<string name="settings_advanced_pattern_protection_set">Pattern protection has been set</string>
|
||||
|
||||
@@ -70,7 +70,8 @@
|
||||
<style name="AppTheme.Main" parent="AppTheme.NoActionBar">
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Gallery" parent="AppTheme.Dark.NoActionBar.TranslucentDecor">
|
||||
<style name="AppTheme.Gallery" parent="AppTheme.Dark.NoActionBar">
|
||||
<item name="colorPrimaryDark">@android:color/black</item>
|
||||
<item name="android:windowBackground">@color/gallery_background</item>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -39,6 +39,15 @@
|
||||
android:title="@string/settings_advanced_clear_memory_cache"
|
||||
android:summary="@string/settings_advanced_clear_memory_cache_summary"/>
|
||||
|
||||
<com.hippo.preference.ListPreference
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:key="read_cache_size"
|
||||
android:title="@string/settings_advanced_read_cache_size"
|
||||
android:summary="%s"
|
||||
app:entries="@array/read_cache_size_entries"
|
||||
app:entryValues="@array/read_cache_size_entry_values"
|
||||
android:defaultValue="160"/>
|
||||
|
||||
<com.hippo.preference.ActivityPreference
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:key="pattern_protection"
|
||||
|
||||
@@ -50,4 +50,9 @@
|
||||
android:title="@string/settings_download_restore_download_items"
|
||||
android:summary="@string/settings_download_restore_download_items_summary"/>
|
||||
|
||||
<com.hippo.ehviewer.preference.CleanRedundancyPreference
|
||||
android:key="clean_redundancy"
|
||||
android:title="@string/settings_download_clean_redundancy"
|
||||
android:summary="@string/settings_download_clean_redundancy_summary"/>
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -40,6 +40,14 @@
|
||||
app:entryValues="@array/list_mode_entry_values"
|
||||
android:defaultValue="0"/>
|
||||
|
||||
<com.hippo.preference.ListPreference
|
||||
android:key="thumb_size"
|
||||
android:title="@string/settings_eh_thumb_size"
|
||||
android:summary="%s"
|
||||
app:entries="@array/thumb_size_entries"
|
||||
app:entryValues="@array/thumb_size_entry_values"
|
||||
android:defaultValue="1"/>
|
||||
|
||||
<com.hippo.ehviewer.preference.DefaultCategoryPreference
|
||||
android:key="default_categories"
|
||||
android:title="@string/settings_eh_default_categories"
|
||||
|
||||
@@ -71,6 +71,11 @@
|
||||
android:title="@string/settings_read_volume_page"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
<com.hippo.preference.SwitchPreference
|
||||
android:key="reading_fullscreen"
|
||||
android:title="@string/settings_read_reading_fullscreen"
|
||||
android:defaultValue="true"/>
|
||||
|
||||
<com.hippo.preference.SwitchPreference
|
||||
android:key="custom_screen_lightness"
|
||||
android:title="@string/settings_read_custom_screen_lightness"
|
||||
|
||||
+1
-1
Submodule beerbelly updated: 226afb5f5d...cb50b6fb4d.
+1
-1
Submodule conaco updated: e990da228c...497ececc87.
+1
-1
Submodule easyrecyclerview updated: 8ead137d46...12b6bcf950.
+1
-1
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
|
||||
+1
-1
Submodule hotspot updated: 83971eeca1...399d7bb48b.
@@ -18,7 +18,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.2"
|
||||
buildToolsVersion "23.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 1
|
||||
|
||||
+1
-1
Submodule rippleold updated: 8e23bfb9b2...2f8b7334f1.
+1
-1
Submodule unifile updated: e020c4cb33...21d947418e.
+1
-1
Submodule yorozuya updated: f33ccd94c2...588c13d696.
Reference in new issue
Block a user