Compare commits

...
32 Commits
Author SHA1 Message Date
seven332 f5318cf6d3 update 2014-10-07 02:35:17 +08:00
seven332 082dc2e3f5 修正 file select 对话框 2014-10-07 01:54:28 +08:00
seven332 c4ed7a034a 默认为继续阅读 2014-10-07 01:30:04 +08:00
seven332 28f548e565 调整主题 2014-10-07 01:13:06 +08:00
seven332 20927eea63 由服务器获取代理地址 2014-10-07 00:52:06 +08:00
seven332 1a302e5157 修改 checkbox button 2014-10-06 00:07:06 +08:00
seven332 92417cb7b4 避免线程冲突 2014-10-05 21:29:46 +08:00
seven332 1dab2722dd 修正 MaterialAlertDialog 列表显示错误 2014-10-05 19:23:34 +08:00
seven332 3a59e3eaae 修正继续阅读时图片未加载问题 2014-10-05 03:31:01 +08:00
seven332 d56c4e5386 调整下载信息存储,记录阅读位置 2014-10-05 02:37:51 +08:00
seven332 0c3a7301cc 修正当前页面索引错误 2014-10-04 23:35:36 +08:00
seven332 6878de9175 保持下载列表顺序 2014-10-04 22:17:27 +08:00
seven332 97956b98df 调整滑动效果 2014-10-04 01:37:56 +08:00
seven332 52bf4ac74d 使用 L 风格 Dialog 2014-10-04 01:17:21 +08:00
seven332 b53e8b49e0 替换 Notification 图标 2014-09-29 22:42:10 +08:00
seven332 51d648ac6b 添加 Notification 图标 2014-09-29 22:37:37 +08:00
seven332 03a5b75648 使用 L 风格 Dialog 2014-09-29 22:32:27 +08:00
seven332 bea31278a7 重命名下载中间文件 2014-09-24 16:05:14 +08:00
seven332 3bec2e47e3 获取更多错误 2014-09-23 23:53:22 +08:00
seven332 13eb3d291d 在清理冗余时删除 gid 文件 2014-09-23 14:19:44 +08:00
seven332 23225bdb56 搜索显示 suggestion 2014-09-23 14:03:39 +08:00
seven332 8ba3d11c11 添加解码格式选择 2014-09-19 10:35:09 +08:00
seven332 d519179ae2 添加清理阅读冗余 2014-09-19 00:55:51 +08:00
seven332 e8aa39d66d 修正 cmyk_gray_convert 2014-09-18 01:38:13 +08:00
seven332 ee231382f5 修正 cmyk_gray_convert 2014-09-18 01:32:58 +08:00
seven332 0324b87ad6 对 jpeg 解码添加 cmyk->gray 与 cmyk->rgb 2014-09-18 01:24:06 +08:00
seven332 855e4cc61c 修正 armv7 而无 neon 而导致的解码错误 2014-09-17 14:51:24 +08:00
seven332 b759ee0997 update 2014-09-17 11:58:41 +08:00
seven332 f2a1ad7df4 修正 ExpandingListView 计算错误 2014-09-15 16:10:35 +08:00
seven332 33999a317e 修正 ExpandingListView collapse 时的错误 2014-09-15 15:23:48 +08:00
seven332 2d9a54bc0e 修正 onStartCommand 可能的 NullPointerException 2014-09-15 15:09:43 +08:00
seven332 8d1ad9697b ListView 添加 expand 动画效果 2014-09-15 15:01:22 +08:00
133 changed files with 4115 additions and 1387 deletions

No files matched your search

+2 -2
View File
@@ -16,8 +16,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hippo.ehviewer"
android:versionCode="25"
android:versionName="0.6.4" >
android:versionCode="26"
android:versionName="0.6.5" >
<uses-sdk
android:minSdkVersion="14"
+7 -1
View File
@@ -47,7 +47,11 @@ libjpeg-turbo/turbojpeg.c
LOCAL_CFLAGS := -O3
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -mfpu=neon
# Don't add -mfpu=neon
# Some arm v7 cpu do not support neon,
# libjpeg-turbo can check neon in init_simd()
# through parse_proc_cpuinfo()
#LOCAL_CFLAGS += -mfpu=neon
endif
ifeq ($(TARGET_ARCH),arm)
@@ -143,6 +147,8 @@ libpng/pngtrans.c
LOCAL_CFLAGS := -O3
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
# Add -mfpu=neon
# libpng only check neon when add -mfpu=neon
LOCAL_CFLAGS += -mfpu=neon
LOCAL_SRC_FILES += \
libpng/arm/arm_init.c \
+7 -1
View File
@@ -497,7 +497,7 @@ jobject getObjFromGifFileType(JNIEnv* env, GifFileType* gifFile, int format) {
return NULL;
} else {
return (*env)->NewObject(env, gifClazz, constructor, (jint) gif,
FORMAT_GIF, realWidth, gifFile->SHeight, format,
FILE_FORMAT_GIF, realWidth, gifFile->SHeight, format,
DEFAULT_TYPE, delayArray);
}
}
@@ -508,6 +508,9 @@ jobject GIF_DecodeStream(JNIEnv* env, jobject is, jint format) {
GifFileType* gifFile;
jobject gifImage;
if (format == FORMAT_AUTO)
format = FORMAT_RGB;
sc = (StreamContainer*)getStreamContainer(env, is);
if (sc == NULL)
return NULL;
@@ -537,6 +540,9 @@ jobject GIF_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
GifFileType* gifFile;
jobject gifImage;
if (format == FORMAT_AUTO)
format = FORMAT_RGB;
gifFile = DGifOpen(fp, &fileReadFun, &errorCode);
if (gifFile == NULL)
return NULL;
+26 -26
View File
@@ -4,16 +4,16 @@
#include "giflib/gif_lib.h"
static int checkFormat(int format) {
if (format != GL_RGB && format != GL_RGBA && format != GL_LUMINANCE
&& format != GL_LUMINANCE_ALPHA)
return GL_RGB;
if (format != FORMAT_AUTO && format != FORMAT_GRAY && format != FORMAT_GRAY_ALPHA
&& format != FORMAT_RGB && format != FORMAT_RGBA)
return FORMAT_AUTO;
else
return format;
}
// TODO
static int detectFileFormat() {
return FORMAT_GIF;
return FILE_FORMAT_GIF;
}
/**
@@ -28,25 +28,25 @@ static FILE* detectFileFormatPathName(const char* namePath, int* format) {
FILE* fp = fopen(namePath, "r");
if (fp == NULL) {
*format = FORMAT_UNKNOWN;
*format = FILE_FORMAT_UNKNOWN;
return NULL;
}
if (fread(buf, 1, 2, fp) != 2) {
fclose(fp);
*format = FORMAT_UNKNOWN;
*format = FILE_FORMAT_UNKNOWN;
return NULL;
}
rewind(fp);
if (!memcmp(buf, jpegSig, 2))
*format = FORMAT_JPEG;
*format = FILE_FORMAT_JPEG;
else if (!memcmp(buf, pngSig, 2))
*format = FORMAT_PNG;
*format = FILE_FORMAT_PNG;
else if (!memcmp(buf, gifSig, 2))
*format = FORMAT_GIF;
*format = FILE_FORMAT_GIF;
else
*format = FORMAT_UNKNOWN;
*format = FILE_FORMAT_UNKNOWN;
return fp;
}
@@ -58,16 +58,16 @@ Java_com_hippo_ehviewer_gallery_image_Image_nativeDecodeStream(JNIEnv* env,
format = checkFormat(format);
switch (detectFileFormat()) {
case FORMAT_JPEG:
case FILE_FORMAT_JPEG:
return JPEG_DecodeStream(env, is, format);
case FORMAT_PNG:
case FILE_FORMAT_PNG:
return PNG_DecodeStream(env, is, format);
case FORMAT_BMP:
case FILE_FORMAT_BMP:
return NULL;
case FORMAT_GIF:
case FILE_FORMAT_GIF:
return GIF_DecodeStream(env, is, format);
default:
@@ -94,16 +94,16 @@ Java_com_hippo_ehviewer_gallery_image_Image_nativeDecodeFile(JNIEnv* env,
}
switch (fileFormat) {
case FORMAT_JPEG:
case FILE_FORMAT_JPEG:
image = JPEG_DecodeFileHandler(env, fp, format);
break;
case FORMAT_PNG:
case FILE_FORMAT_PNG:
image = PNG_DecodeFileHandler(env, fp, format);
break;
case FORMAT_BMP:
case FILE_FORMAT_BMP:
image = NULL;
break;
case FORMAT_GIF:
case FILE_FORMAT_GIF:
image = GIF_DecodeFileHandler(env, fp, format);
break;
default:
@@ -122,15 +122,15 @@ Java_com_hippo_ehviewer_gallery_image_Image_nativeFree(JNIEnv* env,
jclass clazz, jint nativeImage, jint fileFormat) {
switch (fileFormat) {
case FORMAT_JPEG:
case FILE_FORMAT_JPEG:
JPEG_Free(env, nativeImage);
break;
case FORMAT_PNG:
case FILE_FORMAT_PNG:
PNG_Free(env, nativeImage);
break;
case FORMAT_BMP:
case FILE_FORMAT_BMP:
break;
case FORMAT_GIF:
case FILE_FORMAT_GIF:
GIF_Free(env, nativeImage);
break;
}
@@ -141,13 +141,13 @@ Java_com_hippo_ehviewer_gallery_image_Image_nativeRender(JNIEnv* env,
jclass clazz, jint format, jint type, jint nativeImage, jint fileFormat) {
switch (fileFormat) {
case FORMAT_JPEG:
case FILE_FORMAT_JPEG:
JPEG_Render(env, nativeImage, format);
break;
case FORMAT_PNG:
case FILE_FORMAT_PNG:
PNG_Render(env, nativeImage, format);
break;
case FORMAT_BMP:
case FILE_FORMAT_BMP:
break;
}
}
@@ -157,7 +157,7 @@ Java_com_hippo_ehviewer_gallery_image_GifImage_nativeRender(JNIEnv* env,
jclass clazz, jint format, jint type, jint nativeImage, jint fileFormat,
jint index) {
if (type != DEFAULT_TYPE || fileFormat != FORMAT_GIF)
if (type != DEFAULT_TYPE || fileFormat != FILE_FORMAT_GIF)
return;
GIF_Render(env, nativeImage, format, index);
+11 -5
View File
@@ -55,11 +55,17 @@ typedef struct {
#define DEFAULT_TARGET GL_TEXTURE_2D
#define DEFAULT_TYPE GL_UNSIGNED_BYTE
#define FORMAT_UNKNOWN -1
#define FORMAT_JPEG 0x0
#define FORMAT_PNG 0x1
#define FORMAT_BMP 0x2
#define FORMAT_GIF 0x3
#define FILE_FORMAT_UNKNOWN -1
#define FILE_FORMAT_JPEG 0x0
#define FILE_FORMAT_PNG 0x1
#define FILE_FORMAT_BMP 0x2
#define FILE_FORMAT_GIF 0x3
#define FORMAT_AUTO 0x0
#define FORMAT_GRAY GL_LUMINANCE
#define FORMAT_GRAY_ALPHA GL_LUMINANCE_ALPHA
#define FORMAT_RGB GL_RGB
#define FORMAT_RGBA GL_RGBA
#define BG_LUM 0x21
static rgb defaultBgColorRGB ={0x21, 0x21, 0x21};
+22 -8
View File
@@ -11,9 +11,11 @@ struct my_error_mgr {
typedef struct my_error_mgr * my_error_ptr;
char emsg[JMSG_LENGTH_MAX];
static void my_error_exit(j_common_ptr cinfo) {
my_error_ptr myerr = (my_error_ptr) cinfo->err;
(*cinfo->err->output_message)(cinfo);
(*cinfo->err->format_message)(cinfo, emsg);
longjmp(myerr->setjmp_buffer, 1);
}
@@ -43,6 +45,7 @@ jobject JPEG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = my_error_exit;
if (setjmp(jerr.setjmp_buffer)) {
LOGE("%s", emsg);
free(jpeg);
jpeg_destroy_decompress(&cinfo);
return NULL;
@@ -53,24 +56,35 @@ jobject JPEG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
// Set png format
switch (format) {
case GL_RGB:
case FORMAT_AUTO:
if (cinfo.jpeg_color_space == JCS_GRAYSCALE) {
format = FORMAT_GRAY;
cinfo.out_color_space == JCS_GRAYSCALE;
} else {
format = FORMAT_RGB;
cinfo.out_color_space = JCS_RGB;
}
break;
case FORMAT_RGB:
cinfo.out_color_space = JCS_RGB;
break;
case GL_RGBA:
case FORMAT_RGBA:
cinfo.out_color_space = JCS_EXT_RGBA;
break;
case GL_LUMINANCE:
default:
format = GL_LUMINANCE;
case FORMAT_GRAY:
cinfo.out_color_space = JCS_GRAYSCALE;
break;
default:
format = FORMAT_RGB;
cinfo.out_color_space = JCS_RGB;
break;
}
jpeg_start_decompress(&cinfo);
// Set
realStride = cinfo.output_width * cinfo.output_components;
fakeWidth = format != GL_RGBA ? nextMulOf4(cinfo.output_width) : cinfo.output_width;
fakeWidth = format != FORMAT_RGBA ? nextMulOf4(cinfo.output_width) : cinfo.output_width;
fakeStride = fakeWidth * cinfo.output_components;
data = malloc(fakeStride * cinfo.output_height);
if (data == NULL) {
@@ -113,7 +127,7 @@ jobject JPEG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
return NULL;
} else {
return (*env)->NewObject(env, imageClazz, constructor, (jint) jpeg,
FORMAT_JPEG, cinfo.output_width, cinfo.output_height, format,
FILE_FORMAT_JPEG, cinfo.output_width, cinfo.output_height, format,
DEFAULT_TYPE);
}
}
+39
View File
@@ -140,3 +140,42 @@ rgb_rgb_convert_internal (j_decompress_ptr cinfo,
}
}
}
/*
* Convert RGB to extended RGB: just swap the order of source pixels
*/
INLINE
LOCAL(void)
cmyk_rgb_convert_internal (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows) {
register float lum;
register JSAMPROW inptr0, inptr1, inptr2, inptr3;
register JSAMPROW outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
inptr3 = input_buf[3][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
lum = inptr3[col] / 255.0f;
outptr[RGB_RED] = inptr0[col] * lum;
outptr[RGB_GREEN] = inptr1[col] * lum;
outptr[RGB_BLUE] = inptr2[col] * lum;
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
/* alpha channel value */
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
}
}
}
+106 -5
View File
@@ -104,6 +104,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define ycc_rgb_convert_internal ycc_extrgb_convert_internal
#define gray_rgb_convert_internal gray_extrgb_convert_internal
#define rgb_rgb_convert_internal rgb_extrgb_convert_internal
#define cmyk_rgb_convert_internal cmyk_extrgb_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -112,6 +113,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#undef cmyk_rgb_convert_internal
#define RGB_RED EXT_RGBX_RED
#define RGB_GREEN EXT_RGBX_GREEN
@@ -121,6 +123,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define ycc_rgb_convert_internal ycc_extrgbx_convert_internal
#define gray_rgb_convert_internal gray_extrgbx_convert_internal
#define rgb_rgb_convert_internal rgb_extrgbx_convert_internal
#define cmyk_rgb_convert_internal cmyk_extrgbx_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -130,6 +133,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#undef cmyk_rgb_convert_internal
#define RGB_RED EXT_BGR_RED
#define RGB_GREEN EXT_BGR_GREEN
@@ -138,6 +142,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define ycc_rgb_convert_internal ycc_extbgr_convert_internal
#define gray_rgb_convert_internal gray_extbgr_convert_internal
#define rgb_rgb_convert_internal rgb_extbgr_convert_internal
#define cmyk_rgb_convert_internal cmyk_extbgr_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -146,6 +151,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#undef cmyk_rgb_convert_internal
#define RGB_RED EXT_BGRX_RED
#define RGB_GREEN EXT_BGRX_GREEN
@@ -155,6 +161,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define ycc_rgb_convert_internal ycc_extbgrx_convert_internal
#define gray_rgb_convert_internal gray_extbgrx_convert_internal
#define rgb_rgb_convert_internal rgb_extbgrx_convert_internal
#define cmyk_rgb_convert_internal cmyk_extbgrx_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -164,6 +171,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#undef cmyk_rgb_convert_internal
#define RGB_RED EXT_XBGR_RED
#define RGB_GREEN EXT_XBGR_GREEN
@@ -173,6 +181,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define ycc_rgb_convert_internal ycc_extxbgr_convert_internal
#define gray_rgb_convert_internal gray_extxbgr_convert_internal
#define rgb_rgb_convert_internal rgb_extxbgr_convert_internal
#define cmyk_rgb_convert_internal cmyk_extxbgr_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -182,6 +191,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#undef cmyk_rgb_convert_internal
#define RGB_RED EXT_XRGB_RED
#define RGB_GREEN EXT_XRGB_GREEN
@@ -191,6 +201,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define ycc_rgb_convert_internal ycc_extxrgb_convert_internal
#define gray_rgb_convert_internal gray_extxrgb_convert_internal
#define rgb_rgb_convert_internal rgb_extxrgb_convert_internal
#define cmyk_rgb_convert_internal cmyk_extxrgb_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -200,7 +211,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#undef cmyk_rgb_convert_internal
/*
* Initialize tables for YCC->RGB colorspace conversion.
@@ -353,6 +364,45 @@ rgb_gray_convert (j_decompress_ptr cinfo,
}
}
/*
* Convert CMYK to grayscale.
*/
METHODDEF(void)
cmyk_gray_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows) {
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register float lum;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_y_tab;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2, inptr3;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
inptr3 = input_buf[3][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
lum = (inptr3[col]) / 255.0f;
r = inptr0[col] * lum;
g = inptr1[col] * lum;
b = inptr2[col] * lum;
/* Y */
outptr[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
}
}
}
/*
* Color conversion for no colorspace change: just copy the data,
@@ -492,6 +542,50 @@ rgb_rgb_convert (j_decompress_ptr cinfo,
}
}
/*
* Convert CMYK to RGB
*/
METHODDEF(void)
cmyk_rgb_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
switch (cinfo->out_color_space) {
case JCS_EXT_RGB:
cmyk_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
cmyk_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGR:
cmyk_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
cmyk_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
cmyk_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
cmyk_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
default:
cmyk_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
}
}
/*
* Adobe-style YCCK->CMYK conversion.
@@ -616,8 +710,12 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
} else if (cinfo->jpeg_color_space == JCS_RGB) {
cconvert->pub.color_convert = rgb_gray_convert;
build_rgb_y_table(cinfo);
} else
} else if (cinfo->jpeg_color_space == JCS_CMYK) {
cconvert->pub.color_convert = cmyk_gray_convert;
build_rgb_y_table(cinfo);
} else {
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
}
break;
case JCS_RGB:
@@ -633,9 +731,9 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
case JCS_EXT_ARGB:
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
if (cinfo->jpeg_color_space == JCS_YCbCr) {
if (jsimd_can_ycc_rgb())
if (jsimd_can_ycc_rgb()) {
cconvert->pub.color_convert = jsimd_ycc_rgb_convert;
else {
} else {
cconvert->pub.color_convert = ycc_rgb_convert;
build_ycc_rgb_table(cinfo);
}
@@ -649,8 +747,11 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
cconvert->pub.color_convert = null_convert;
else
cconvert->pub.color_convert = rgb_rgb_convert;
} else
} else if (cinfo->jpeg_color_space == JCS_CMYK) {
cconvert->pub.color_convert = cmyk_rgb_convert;
} else {
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
}
break;
case JCS_RGB565:
+1 -1
View File
@@ -33,7 +33,7 @@
*/
#ifndef PNG_ARM_NEON_FILE
# ifdef __linux__
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
# define PNG_ARM_NEON_FILE "../contrib/arm-neon/linux.c"
# endif
#endif
+159
View File
@@ -0,0 +1,159 @@
/* contrib/arm-neon/linux.c
*
* Copyright (c) 2014 Glenn Randers-Pehrson
* Written by John Bowler, 2014.
* Last changed in libpng 1.6.10 [March 6, 2014]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* SEE contrib/arm-neon/README before reporting bugs
*
* STATUS: SUPPORTED
* BUG REPORTS: png-mng-implement@sourceforge.net
*
* png_have_neon implemented for Linux by reading the widely available
* pseudo-file /proc/cpuinfo.
*
* This code is strict ANSI-C and is probably moderately portable, it does
* however use <stdio.h> and assumes that /proc/cpuinfo is never localized.
*/
#include <stdio.h>
static int
png_have_neon(png_structp png_ptr)
{
FILE *f = fopen("/proc/cpuinfo", "rb");
if (f != NULL)
{
/* This is a simple state machine which reads the input byte-by-byte until
* it gets a match on the 'neon' feature or reaches the end of the stream.
*/
static const char ch_feature[] = { 70, 69, 65, 84, 85, 82, 69, 83 };
static const char ch_neon[] = { 78, 69, 79, 78 };
enum
{
StartLine, Feature, Colon, StartTag, Neon, HaveNeon, SkipTag, SkipLine
} state;
int counter;
for (state=StartLine, counter=0;;)
{
int ch = fgetc(f);
if (ch == EOF)
{
/* EOF means error or end-of-file, return false; neon at EOF is
* assumed to be a mistake.
*/
fclose(f);
return 0;
}
switch (state)
{
case StartLine:
/* Match spaces at the start of line */
if (ch <= 32) /* skip control characters and space */
break;
counter=0;
state = Feature;
/* FALL THROUGH */
case Feature:
/* Match 'FEATURE', ASCII case insensitive. */
if ((ch & ~0x20) == ch_feature[counter])
{
if (++counter == (sizeof ch_feature))
state = Colon;
break;
}
/* did not match 'feature' */
state = SkipLine;
/* FALL THROUGH */
case SkipLine:
skipLine:
/* Skip everything until we see linefeed or carriage return */
if (ch != 10 && ch != 13)
break;
state = StartLine;
break;
case Colon:
/* Match any number of space or tab followed by ':' */
if (ch == 32 || ch == 9)
break;
if (ch == 58) /* i.e. ':' */
{
state = StartTag;
break;
}
/* Either a bad line format or a 'feature' prefix followed by
* other characters.
*/
state = SkipLine;
goto skipLine;
case StartTag:
/* Skip space characters before a tag */
if (ch == 32 || ch == 9)
break;
state = Neon;
counter = 0;
/* FALL THROUGH */
case Neon:
/* Look for 'neon' tag */
if ((ch & ~0x20) == ch_neon[counter])
{
if (++counter == (sizeof ch_neon))
state = HaveNeon;
break;
}
state = SkipTag;
/* FALL THROUGH */
case SkipTag:
/* Skip non-space characters */
if (ch == 10 || ch == 13)
state = StartLine;
else if (ch == 32 || ch == 9)
state = StartTag;
break;
case HaveNeon:
/* Have seen a 'neon' prefix, but there must be a space or new
* line character to terminate it.
*/
if (ch == 10 || ch == 13 || ch == 32 || ch == 9)
{
fclose(f);
return 1;
}
state = SkipTag;
break;
default:
png_error(png_ptr, "png_have_neon: internal error (bug)");
}
}
}
else
png_warning(png_ptr, "/proc/cpuinfo open failed");
return 0;
}
+1 -1
View File
@@ -17,7 +17,7 @@
#define PNG_16BIT_SUPPORTED
#define PNG_ALIGNED_MEMORY_SUPPORTED
#define PNG_ARM_NEON_API_SUPPORTED
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
#define PNG_ARM_NEON_CHECK_SUPPORTED
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
+37 -22
View File
@@ -7,7 +7,7 @@ jobject PNG_DecodeStream(JNIEnv* env, jobject is, jint format) {
}
jobject PNG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
int pngFormat, width, height;
int width, height;
png_image image;
png_bytep buffer;
PNG* png;
@@ -20,32 +20,47 @@ jobject PNG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
if (png == NULL)
return NULL;
// Get png format
switch (format) {
case GL_RGB:
pngFormat = PNG_FORMAT_RGB;
break;
case GL_RGBA:
pngFormat = PNG_FORMAT_RGBA;
break;
case GL_LUMINANCE:
pngFormat = PNG_FORMAT_GRAY;
break;
case GL_LUMINANCE_ALPHA:
default:
format = GL_LUMINANCE_ALPHA;
pngFormat = PNG_FORMAT_GA;
break;
}
memset(&image, 0, sizeof image);
image.version = PNG_IMAGE_VERSION;
if (!png_image_begin_read_from_stdio(&image, fp))
return NULL;
image.format = pngFormat;
fakeWidth = format != GL_RGBA ? nextMulOf4(image.width) : image.width;
// Get png format
switch (format) {
case FORMAT_AUTO:
if (image.format == PNG_FORMAT_GRAY) {
format = FORMAT_GRAY;
} else if (image.format == PNG_FORMAT_GA) {
format = FORMAT_GRAY_ALPHA;
} else if (image.format == PNG_FORMAT_RGB) {
format = FORMAT_RGB;
} else if (image.format == PNG_FORMAT_RGBA) {
format = FORMAT_RGBA;
} else {
format = FORMAT_RGB;
image.format = PNG_FORMAT_RGB;
}
break;
case FORMAT_RGB:
image.format = PNG_FORMAT_RGB;
break;
case FORMAT_RGBA:
image.format = PNG_FORMAT_RGBA;
break;
case FORMAT_GRAY:
image.format = PNG_FORMAT_GRAY;
break;
case FORMAT_GRAY_ALPHA:
image.format = PNG_FORMAT_GA;
break;
default:
format = FORMAT_RGB;
image.format = PNG_FORMAT_RGB;
break;
}
fakeWidth = format != FORMAT_RGBA ? nextMulOf4(image.width) : image.width;
fakeStride = PNG_IMAGE_PIXEL_CHANNELS(image.format) * fakeWidth;
buffer = malloc(image.height * fakeStride);
if (buffer == NULL)
@@ -74,7 +89,7 @@ jobject PNG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
return NULL;
} else {
return (*env)->NewObject(env, imageClazz, constructor, (jint) png,
FORMAT_PNG, png->width, png->height, format,
FILE_FORMAT_PNG, png->width, png->height, format,
DEFAULT_TYPE);
}
}
+1
View File
@@ -5,6 +5,7 @@ int nextMulOf4(int x) {
return (x + 3) / 4 * 4;
}
// TODO Need a better one
byte getVFrowRGB(byte r, byte g, byte b) {
byte t = g > b ? g : b;
return r > t ? r : t;
Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
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_enabled="false" android:state_checked="true">
<bitmap android:src="@drawable/btn_check_on_disabled" />
</item>
<item android:state_enabled="false">
<bitmap android:src="@drawable/btn_check_off_disabled" />
</item>
<item android:state_checked="true">
<bitmap android:src="@drawable/btn_check_on_dialog" />
</item>
<item>
<bitmap android:src="@drawable/btn_check_off_dialog" />
</item>
</selector>
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
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_enabled="false" android:state_checked="true">
<bitmap android:src="@drawable/btn_check_on_disabled" />
</item>
<item android:state_enabled="false">
<bitmap android:src="@drawable/btn_check_off_disabled" />
</item>
<item android:state_checked="true">
<bitmap android:src="@drawable/btn_check_on" />
</item>
<item>
<bitmap android:src="@drawable/btn_check_off" />
</item>
</selector>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
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_enabled="false" android:state_checked="true">
<bitmap android:src="@drawable/btn_radio_on_disabled" />
</item>
<item android:state_enabled="false">
<bitmap android:src="@drawable/btn_radio_off_disabled" />
</item>
<item android:state_checked="true">
<bitmap android:src="@drawable/btn_radio_on_dialog" />
</item>
<item>
<bitmap android:src="@drawable/btn_radio_off_dialog" />
</item>
</selector>
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
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_enabled="false" android:state_checked="true">
<bitmap android:src="@drawable/btn_radio_on_disabled" />
</item>
<item android:state_enabled="false">
<bitmap android:src="@drawable/btn_radio_off_disabled" />
</item>
<item android:state_checked="true">
<bitmap android:src="@drawable/btn_radio_on" />
</item>
<item>
<bitmap android:src="@drawable/btn_radio_off" />
</item>
</selector>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="2dp" />
<solid
android:color="@color/background_light" />
</shape>
+6 -2
View File
@@ -14,7 +14,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge 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:orientation="vertical" >
<ListView
android:id="@+id/list"
@@ -25,6 +28,7 @@
<CheckBox
android:id="@+id/set_default"
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8.0dp"
@@ -33,4 +37,4 @@
android:checked="false"
android:text="@string/set_default_favorite" />
</merge>
</LinearLayout>
+136
View File
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 The Android Open Source Project
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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parentPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/dialog_background_material" >
<ScrollView android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:clipToPadding="false" >
<LinearLayout
android:id="@+id/top_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="24dp"
android:paddingTop="24dp"
android:paddingRight="24dp"
android:paddingBottom="12dp" >
<TextView
android:id="@+id/title"
android:textAppearance="@style/TextAppearance.DialogTitle"
android:singleLine="true"
android:ellipsize="end"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginBottom="24dp" />
<TextView
android:id="@+id/message"
style="@style/DialogMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- custom view add here -->
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/top_panel_noscroll"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="24dp"
android:paddingTop="24dp"
android:paddingRight="24dp"
android:paddingBottom="12dp" >
<TextView android:id="@+id/title2"
android:textAppearance="@style/TextAppearance.DialogTitle"
android:singleLine="true"
android:ellipsize="end"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginBottom="24dp" />
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- custom view add here -->
</LinearLayout>
<RelativeLayout
android:id="@+id/button_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="12dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="12dp" >
<Button android:id="@+id/button_action"
style="@style/DialogButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center" />
<LinearLayout
android:id="@+id/non_action_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:orientation="horizontal" >
<Button android:id="@+id/button_negative"
style="@style/DialogButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" />
<Button android:id="@+id/button_neutral"
style="@style/DialogButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" />
<Button android:id="@+id/button_positive"
style="@style/DialogButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/holo_blue_light"
android:gravity="center" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
+10 -10
View File
@@ -23,7 +23,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginRight="6.0dp"
android:background="@color/doujinshi_bg"
android:textColor="@color/doujinshi_bg"
android:text="@string/doujinshi" />
<com.hippo.ehviewer.widget.CheckTextView
@@ -31,7 +31,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginLeft="6.0dp"
android:background="@color/manga_bg"
android:textColor="@color/manga_bg"
android:text="@string/manga" />
</TableRow>
@@ -42,7 +42,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginRight="6.0dp"
android:background="@color/artist_cg_bg"
android:textColor="@color/artist_cg_bg"
android:text="@string/artist_cg" />
<com.hippo.ehviewer.widget.CheckTextView
@@ -50,7 +50,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginLeft="6.0dp"
android:background="@color/game_cg_bg"
android:textColor="@color/game_cg_bg"
android:text="@string/game_cg" />
</TableRow>
@@ -61,7 +61,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginRight="6.0dp"
android:background="@color/western_bg"
android:textColor="@color/western_bg"
android:text="@string/western" />
<com.hippo.ehviewer.widget.CheckTextView
@@ -69,7 +69,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginLeft="6.0dp"
android:background="@color/non_h_bg"
android:textColor="@color/non_h_bg"
android:text="@string/non_h" />
</TableRow>
@@ -80,7 +80,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginRight="6.0dp"
android:background="@color/image_set_bg"
android:textColor="@color/image_set_bg"
android:text="@string/image_set" />
<com.hippo.ehviewer.widget.CheckTextView
@@ -88,7 +88,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginLeft="6.0dp"
android:background="@color/cosplay_bg"
android:textColor="@color/cosplay_bg"
android:text="@string/cosplay" />
</TableRow>
@@ -99,7 +99,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginRight="6.0dp"
android:background="@color/asian_porn_bg"
android:textColor="@color/asian_porn_bg"
android:text="@string/asian_porn" />
<com.hippo.ehviewer.widget.CheckTextView
@@ -107,7 +107,7 @@
style="@style/SearchCategory"
android:layout_width="0.0dp"
android:layout_marginLeft="6.0dp"
android:background="@color/misc_bg"
android:textColor="@color/misc_bg"
android:text="@string/misc" />
</TableRow>
+1
View File
@@ -15,6 +15,7 @@
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/color_scheme_dialog_row_padding" >
+2 -2
View File
@@ -19,13 +19,13 @@
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
<com.hippo.ehviewer.widget.ExpandingListView
android:id="@+id/download"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clipToPadding="false"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" >
</ListView>
</com.hippo.ehviewer.widget.ExpandingListView>
</LinearLayout>
+1 -1
View File
@@ -78,7 +78,7 @@
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:paddingTop="8dp"
android:layout_below="@id/thumb" >
<TableRow
+113 -47
View File
@@ -30,6 +30,7 @@
android:layout_weight="1" />
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -37,6 +38,7 @@
tools:ignore="HardcodedText" />
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -44,6 +46,7 @@
tools:ignore="HardcodedText" />
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -56,6 +59,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -70,13 +74,15 @@
android:id="@+id/el_japanese_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_japanese_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -84,6 +90,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -93,19 +100,22 @@
android:id="@+id/el_english_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_english_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_english_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -113,6 +123,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -122,19 +133,22 @@
android:id="@+id/el_chinese_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_chinese_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_chinese_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -142,6 +156,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -151,19 +166,22 @@
android:id="@+id/el_dutch_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_dutch_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_dutch_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -171,6 +189,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -180,19 +199,22 @@
android:id="@+id/el_french_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_french_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_french_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -200,6 +222,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -209,19 +232,22 @@
android:id="@+id/el_german_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_german_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_german_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -229,6 +255,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -238,19 +265,22 @@
android:id="@+id/el_hungarian_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_hungarian_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_hungarian_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -258,6 +288,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -267,19 +298,22 @@
android:id="@+id/el_italian_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_italian_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_italian_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -287,6 +321,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -296,19 +331,22 @@
android:id="@+id/el_korean_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_korean_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_korean_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -316,6 +354,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -325,19 +364,22 @@
android:id="@+id/el_polish_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_polish_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_polish_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -345,6 +387,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -354,19 +397,22 @@
android:id="@+id/el_portuguese_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_portuguese_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_portuguese_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -374,6 +420,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -383,19 +430,22 @@
android:id="@+id/el_russian_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_russian_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_russian_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -403,6 +453,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -412,19 +463,22 @@
android:id="@+id/el_spanish_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_spanish_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_spanish_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -432,6 +486,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -441,19 +496,22 @@
android:id="@+id/el_thai_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_thai_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_thai_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -461,6 +519,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -470,19 +529,22 @@
android:id="@+id/el_vietnamese_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_vietnamese_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_vietnamese_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
<TableRow
@@ -490,6 +552,7 @@
android:layout_height="wrap_content" >
<TextView
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2"
@@ -499,19 +562,22 @@
android:id="@+id/el_other_original"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_other_translated"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
<CheckBox
android:id="@+id/el_other_rewrite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material" />
</TableRow>
</TableLayout>
+16
View File
@@ -26,18 +26,22 @@
<CheckBox
android:id="@+id/tag_group_reclass"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="reclass"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
<CheckBox
android:id="@+id/tag_group_language"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="language"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
</TableRow>
@@ -47,18 +51,22 @@
<CheckBox
android:id="@+id/tag_group_parody"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="parody"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
<CheckBox
android:id="@+id/tag_group_character"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="character"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
</TableRow>
@@ -68,18 +76,22 @@
<CheckBox
android:id="@+id/tag_group_group"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="group"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
<CheckBox
android:id="@+id/tag_group_artist"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="artist"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
</TableRow>
@@ -89,18 +101,22 @@
<CheckBox
android:id="@+id/tag_group_male"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="male"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
<CheckBox
android:id="@+id/tag_group_female"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="female"
android:button="@drawable/btn_check_dialog_material"
tools:ignore="HardcodedText" />
</TableRow>
+3 -3
View File
@@ -26,15 +26,15 @@
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:src="@drawable/ic_dir_dark" />
android:src="@drawable/ic_dir_dark_dialog" />
<TextView
android:id="@+id/text"
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="8.0dp"
android:layout_toRightOf="@id/icon"
android:textColor="@android:color/black" />
android:layout_toRightOf="@id/icon" />
</RelativeLayout>
+4 -4
View File
@@ -22,6 +22,7 @@
<TextView
android:id="@+id/list_jump_sum"
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -35,20 +36,19 @@
<TextView
android:id="@+id/list_jump_to"
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp" />
<EditText
android:id="@+id/list_jump_edit"
style="@style/DialogMessage"
android:layout_width="128dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:singleLine="true" >
android:singleLine="true" />
<requestFocus />
</EditText>
</LinearLayout>
</LinearLayout>
+6 -8
View File
@@ -18,28 +18,26 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical" >
<EditText
android:id="@+id/username"
style="@style/DialogMessage"
android:inputType="textEmailAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="4dp"
android:hint="@string/username" />
<EditText
android:id="@+id/password"
style="@style/DialogMessage"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="16dp"
android:fontFamily="sans-serif"
android:hint="@string/password"/>
android:hint="@string/password" />
</LinearLayout>
+8 -5
View File
@@ -17,10 +17,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="24dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="24dp"
android:orientation="vertical" >
<TableLayout
@@ -33,19 +29,23 @@
<CheckBox
android:id="@+id/checkboxSimilar"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:checked="true"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/use_similarity_scan" />
<CheckBox
android:id="@+id/checkboxCovers"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/only_search_covers" />
</TableRow>
@@ -55,16 +55,18 @@
<CheckBox
android:id="@+id/checkboxExp"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/show_expunged" />
</TableRow>
</TableLayout>
<TextView
style="@style/EmbedButton"
style="@style/EmbedButton.Dialog"
android:id="@+id/select_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -73,6 +75,7 @@
<TextView
android:id="@+id/target_image"
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
+29 -14
View File
@@ -25,47 +25,42 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="12dp" />
android:layout_marginBottom="8dp" />
<CheckBox
android:id="@+id/checkbox_uploader"
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginLeft="16dp"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_uploader" />
<com.hippo.ehviewer.widget.PrefixEditText
<com.hippo.ehviewer.widget.SuggestionTextView
android:id="@+id/search_text"
style="@style/DialogMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:ems="10"
android:hint="@string/hint_no_keyword"
android:singleLine="true" >
</com.hippo.ehviewer.widget.PrefixEditText>
android:singleLine="true"
android:dropDownVerticalOffset="38dp" />
<CheckBox
android:id="@+id/checkbox_advance"
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_advance" />
<TableLayout
android:id="@+id/filter_advance"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:visibility="gone" >
<TableRow
@@ -74,20 +69,24 @@
<CheckBox
android:id="@+id/checkbox_sname"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:checked="true"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_sname" />
<CheckBox
android:id="@+id/checkbox_stags"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:checked="true"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_stags" />
</TableRow>
@@ -97,18 +96,22 @@
<CheckBox
android:id="@+id/checkbox_sdesc"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_sdesc" />
<CheckBox
android:id="@+id/checkbox_storr"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_storr" />
</TableRow>
@@ -118,18 +121,22 @@
<CheckBox
android:id="@+id/checkbox_sto"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_sto" />
<CheckBox
android:id="@+id/checkbox_sdt1"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_sdt1" />
</TableRow>
@@ -139,18 +146,22 @@
<CheckBox
android:id="@+id/checkbox_sdt2"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_sdt2" />
<CheckBox
android:id="@+id/checkbox_sh"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_sh" />
</TableRow>
@@ -160,18 +171,22 @@
<CheckBox
android:id="@+id/checkbox_sr"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:text="@string/checkbox_sr" />
<Spinner
android:id="@+id/spinner_min_rating"
style="@style/DialogMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:button="@drawable/btn_check_dialog_material"
android:entries="@array/min_rating" >
</Spinner>
</TableRow>
+1
View File
@@ -20,6 +20,7 @@
<EditText
android:id="@+id/search_tag_text"
style="@style/DialogMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 The Android Open Source Project
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.
-->
<!--
This layout file is used by the AlertDialog when displaying a list of items.
This layout file is inflated and used as the TextView to display individual
items.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="@style/DialogMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:gravity="center_vertical"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:ellipsize="marquee" />
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
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.
-->
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="@style/DialogMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:gravity="center_vertical"
android:paddingLeft="12dip"
android:paddingRight="7dip"
android:checkMark="@drawable/btn_radio_dialog_material"
android:ellipsize="marquee" />
+8 -2
View File
@@ -14,7 +14,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge 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:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
@@ -22,6 +25,7 @@
android:orientation="horizontal" >
<TextView
style="@style/DialogMessage"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:layout_margin="12dp"
@@ -46,6 +50,7 @@
android:orientation="horizontal" >
<TextView
style="@style/DialogMessage"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:layout_margin="12dp"
@@ -70,6 +75,7 @@
android:orientation="horizontal" >
<TextView
style="@style/DialogMessage"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:layout_margin="12dp"
@@ -87,4 +93,4 @@
android:layout_gravity="center"
android:entries="@array/lofi_resolution_list" />
</LinearLayout>
</merge>
</LinearLayout>
+9 -2
View File
@@ -14,7 +14,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge 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:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
@@ -22,6 +25,7 @@
android:orientation="horizontal" >
<TextView
style="@style/DialogMessage"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:layout_margin="12dp"
@@ -31,6 +35,7 @@
<EditText
android:id="@+id/portrait"
style="@style/DialogMessage"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:layout_margin="12dp"
@@ -44,6 +49,7 @@
android:orientation="horizontal" >
<TextView
style="@style/DialogMessage"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:layout_margin="12dp"
@@ -53,6 +59,7 @@
<EditText
android:id="@+id/landscape"
style="@style/DialogMessage"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:layout_margin="12dp"
@@ -60,4 +67,4 @@
android:inputType="number" />
</LinearLayout>
</merge>
</LinearLayout>
+5 -6
View File
@@ -16,22 +16,21 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dp" >
android:orientation="vertical" >
<TextView
style="@style/DialogMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="@string/tag_name" />
<EditText
android:id="@+id/set_name_edit"
android:layout_width="wrap_content"
style="@style/DialogMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:singleLine="true" >
</EditText>
android:singleLine="true" />
</LinearLayout>
+2 -2
View File
@@ -17,11 +17,11 @@
<item
android:id="@+id/action_delete"
android:title="@string/delete"
android:icon="@drawable/ic_action_delete_dark"
android:icon="@drawable/ic_action_delete"
android:showAsAction="always" />
<item
android:id="@+id/action_move"
android:title="@string/move"
android:icon="@drawable/ic_action_move_dark"
android:icon="@drawable/ic_action_move"
android:showAsAction="always" />
</menu>
+16
View File
@@ -1,3 +1,19 @@
Version 0.6.5 (2014-10-07)
* 调整界面
* 调整阅读滑动效果
* 下载列表添加动画效果
* 可能修正 armv7 无 neno 导致的自定义解码错误
* 修正自定义解码 jpeg cmyk 格式无法解码错误
* 修正下载列表排序错误
* 修正页面索引错误
* 添加阅读冗余清理功能
* 添加解码格式选择
* 添加阅读页面记录
* 左侧栏搜索添加建议显示
* 优化下载
* 修正多处可能的崩溃
* 修正其他问题
Version 0.6.4 (2014-09-14)
* 添加搜索记录
* 添加通知停止按钮
+2
View File
@@ -4,6 +4,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#fafafa">
<h3>为该应用提供帮助的开源项目</h3>
<a href="https://github.com/koral--/android-gif-drawable">android-gif-drawable</a>
<br>
+10 -1
View File
@@ -61,7 +61,7 @@
<!-- Send Crash -->
<string name="dialog_send_crash_title">这很重要</string>
<string name="dialog_send_crash_plain">上次该应用崩溃了。你愿意把日志发送给开发者以便以后得到更好的用户体验么?</string>
<string name="dialog_send_crash_plain">上次该应用崩溃了。你愿意把错误日志发送给开发者以便以后得到更好的用户体验么?(以电子邮件的形式发送)</string>
<string name="dialog_send_crash_yes">我愿意</string>
<string name="dialog_send_crash_no">门儿都没有</string>
<string name="dialog_wait_send_crash_msg">请在发送完日志后关闭该窗口</string>
@@ -206,6 +206,15 @@
<string name="custom_codec_title">自定义解码</string>
<string name="custom_codec_summary">自定义解码可能会更使用更少内存,解码更快</string>
<string name="custom_codec_summary_not">自定义解码暂不支持 x86, mips</string>
<string name="clean_redundancy_title">清理阅读冗余</string>
<string name="no_redundancy">未发现冗余</string>
<string name="clean_redundancy">完成冗余清理,共清理 %d 项</string>
<string name="decode_format_title">解码格式</string>
<string name="decode_format_auto">自动</string>
<string name="decode_format_gray">黑白</string>
<string name="decode_format_gray_alpha">黑白(透明)</string>
<string name="decode_format_rgb">彩色</string>
<string name="decode_format_rgba">彩色(透明)</string>
<string name="download_settings_title">下载</string>
<string name="download_path_title">下载路径</string>
+1 -1
View File
@@ -49,7 +49,7 @@
<!-- Send Crash -->
<string name="dialog_send_crash_title">這很重要</string>
<string name="dialog_send_crash_plain">上次該應用崩潰了。你願意把日誌發送給開發者以便以後得到更好的用戶體驗麼?</string>
<string name="dialog_send_crash_plain">上次該應用崩潰了。你願意把錯誤日誌發送給開發者以便以後得到更好的用戶體驗麼?(以電子郵件的形式發送)</string>
<string name="dialog_send_crash_yes">我願意</string>
<string name="dialog_send_crash_no">門兒都沒有</string>
<string name="dialog_wait_send_crash_msg">請在發送完日誌後關閉該窗口</string>
+1 -1
View File
@@ -49,7 +49,7 @@
<!-- Send Crash -->
<string name="dialog_send_crash_title">這很重要</string>
<string name="dialog_send_crash_plain">上次該應用崩潰了。你願意把日誌發送給開發者以便以後得到更好的使用者體驗麼?</string>
<string name="dialog_send_crash_plain">上次該應用崩潰了。你願意把錯誤日誌發送給開發者以便以後得到更好的使用者體驗麼?(以電子郵件的形式發送)</string>
<string name="dialog_send_crash_yes">我願意</string>
<string name="dialog_send_crash_no">門兒都沒有</string>
<string name="dialog_wait_send_crash_msg">請在發送完日誌後關閉該視窗</string>
+17
View File
@@ -148,4 +148,21 @@
<item>m</item>
<item>l</item>
</string-array>
<string-array name="decode_format_entries">
<item>@string/decode_format_auto</item>
<item>@string/decode_format_gray</item>
<item>@string/decode_format_gray_alpha</item>
<item>@string/decode_format_rgb</item>
<item>@string/decode_format_rgba</item>
</string-array>
<string-array name="decode_format_values" translatable="false">
<item>0</item>
<item>6409</item>
<item>6410</item>
<item>6407</item>
<item>6408</item>
</string-array>
</resources>
+6 -1
View File
@@ -68,6 +68,8 @@
<color name="primary_text_light">#deffffff</color>
<color name="secondary_text_light">#61ffffff</color>
<color name="disabled_mask">#61000000</color>
<color name="theme_red">#ffc53929</color>
<color name="theme_orange">#ffff9100</color>
<color name="theme_lime">#ffafb42b</color>
@@ -76,6 +78,9 @@
<color name="theme_blue">#ff3367d6</color>
<color name="theme_purple">#ff9c27b0</color>
<color name="theme_brown">#ff795548</color>
<color name="material_progress_blue">#ff40c4ff</color>
<color name="edit_text_gb">#11000000</color>
</resources>
+1
View File
@@ -18,5 +18,6 @@
<item type="id" name="position_x"></item>
<item type="id" name="position_y"></item>
<item type="id" name="edittextpreference_edittext"></item>
</resources>
+1 -1
View File
@@ -64,7 +64,7 @@
<!-- Send Crash -->
<string name="dialog_send_crash_title">It is important</string>
<string name="dialog_send_crash_plain">This application crashed last time. Would you mind to send logcat to the developer for a better user experience in future ?</string>
<string name="dialog_send_crash_plain">This application crashed last time. Would you mind to send logcat to the developer for a better user experience in future ? (via e-mail)</string>
<string name="dialog_send_crash_yes">Never mind</string>
<string name="dialog_send_crash_no">Yes, I would</string>
<string name="dialog_wait_send_crash_msg">Please close the dialog after sending logcat</string>
+48 -2
View File
@@ -46,6 +46,18 @@
<item name="@android:textStyle">normal</item>
</style>
<style name="TextAppearance.DialogTitle">
<item name="@android:textSize">@dimen/text_super_large</item>
</style>
<style name="TextAppearance.DialogMessage">
<item name="@android:textColor">@color/secondary_text_dark</item>
<item name="@android:textSize">@dimen/text_little_large</item>
</style>
<style name="TextAppearance.DropDownItem" parent="TextAppearance.DialogMessage">
</style>
<style name="TextAppearance.SuperButton">
<item name="@android:fontFamily">sans-serif-medium</item>
<item name="@android:textAllCaps">true</item>
@@ -56,6 +68,26 @@
<item name="@android:textSize">13sp</item>
</style>
<style name="TextAppearance.DialogButton">
<item name="@android:textAllCaps">true</item>
<item name="@android:textSize">@dimen/text_little_large</item>
</style>
<style name="DialogMessage">
<item name="@android:textAppearance">@style/TextAppearance.DialogMessage</item>
<item name="@android:textColor">@color/secondary_text_dark</item>
<item name="@android:textSize">@dimen/text_little_large</item>
</style>
<style name="DialogButton" parent="@android:Widget.Button">
<item name="@android:background">@null</item>
<item name="@android:textAppearance">@style/TextAppearance.DialogButton</item>
<item name="@android:minHeight">36dp</item>
<item name="@android:maxLines">2</item>
<item name="@android:paddingLeft">16dp</item>
<item name="@android:paddingRight">16dp</item>
</style>
<style name="SuperButton" parent="@android:Widget.Button">
<item name="backgroundColor">@color/background_light</item>
<item name="@android:textAppearance">@style/TextAppearance.SuperButton</item>
@@ -158,8 +190,8 @@
</style>
<style name="TextAppearance.SearchCategory">
<item name="@android:textColor">@color/primary_text_light</item>
<item name="android:textSize">@dimen/text_little_large</item>
<item name="@android:textStyle">bold</item>
<item name="@android:textSize">@dimen/text_little_large</item>
<item name="@android:singleLine">true</item>
</style>
@@ -188,5 +220,19 @@
<item name="@android:minHeight">48dp</item>
<item name="@android:gravity">center</item>
</style>
<style name="EmbedButton.Dialog">
<item name="@android:textColor">@color/secondary_text_dark</item>
</style>
<style name="DropDownItem" parent="@android:Widget.DropDownItem">
<item name="android:textAppearance">@style/TextAppearance.DropDownItem</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
</style>
<style name="DropDownItem.Spinner">
</style>
</resources>
+6
View File
@@ -28,6 +28,12 @@
<item name="@android:homeAsUpIndicator">@drawable/ic_ab_back</item>
<item name="@android:windowActionBarOverlay">true</item>
<!-- <item name="@android:listChoiceIndicatorSingle">@drawable/btn_radio_material_anim</item> -->
<item name="@android:listChoiceIndicatorMultiple">@drawable/btn_check_material</item>
<!-- spinner -->
<item name="@android:spinnerDropDownItemStyle">@style/DropDownItem.Spinner</item>
<item name="@android:spinnerItemStyle">@style/DropDownItem.Spinner</item>
</style>
<style name="AppTheme.Normal">
+1 -1
View File
@@ -54,7 +54,7 @@
android:title="@string/check_for_update_title"
android:summary="@string/check_for_update_summary" />
<com.hippo.ehviewer.preference.AutoListPreference
<com.hippo.ehviewer.preference.ListPreference
android:entries="@array/update_server_entries"
android:entryValues="@array/update_server_entry_values"
android:key="update_server"
+2 -2
View File
@@ -35,7 +35,7 @@
<PreferenceCategory
android:title="@string/screen_display_settings_title">
<com.hippo.ehviewer.preference.AutoListPreference
<com.hippo.ehviewer.preference.ListPreference
android:key="screen_orientation"
android:title="@string/screen_orientation_title"
android:entries="@array/screen_orientation_entries"
@@ -48,7 +48,7 @@
<PreferenceCategory
android:title="@string/list_display_settings_title">
<com.hippo.ehviewer.preference.AutoListPreference
<com.hippo.ehviewer.preference.ListPreference
android:key="list_mode"
android:title="@string/list_mode_title"
android:entries="@array/list_mode_entries"
+2 -2
View File
@@ -45,7 +45,7 @@
<PreferenceCategory android:title="@string/detail_eh_settings_title" >
<com.hippo.ehviewer.preference.AutoListPreference
<com.hippo.ehviewer.preference.ListPreference
android:defaultValue="l"
android:entries="@array/preview_mode_entries"
android:entryValues="@array/preview_mode_entry_values"
@@ -57,7 +57,7 @@
<PreferenceCategory android:title="@string/favorite_eh_settings_title" >
<com.hippo.ehviewer.preference.AutoListPreference
<com.hippo.ehviewer.preference.ListPreference
android:key="default_favorite"
android:title="@string/default_favorite"
android:entryValues="@array/default_favorite_entry_values"
+15 -2
View File
@@ -17,7 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<com.hippo.ehviewer.preference.AutoListPreference
<com.hippo.ehviewer.preference.ListPreference
android:key="page_scaling"
android:title="@string/page_scaling_title"
android:entries="@array/page_scaling_entries"
@@ -25,7 +25,7 @@
android:defaultValue="3"
android:summary="%s" />
<com.hippo.ehviewer.preference.AutoListPreference
<com.hippo.ehviewer.preference.ListPreference
android:key="start_position"
android:title="@string/start_position_title"
android:entries="@array/start_position_entries"
@@ -48,4 +48,17 @@
android:title="@string/custom_codec_title"
android:summary="@string/custom_codec_summary" />
<com.hippo.ehviewer.preference.ListPreference
android:key="decode_format"
android:title="@string/decode_format_title"
android:entries="@array/decode_format_entries"
android:entryValues="@array/decode_format_values"
android:defaultValue="0"
android:summary="%s"
android:dependency="custom_codec" />
<Preference
android:key="clean_redundancy"
android:title="@string/clean_redundancy_title" />
</PreferenceScreen>
+53 -2
View File
@@ -17,6 +17,7 @@
package com.hippo.ehviewer;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.Thread.UncaughtExceptionHandler;
@@ -30,11 +31,14 @@ import com.hippo.ehviewer.data.Data;
import com.hippo.ehviewer.ehclient.EhClient;
import com.hippo.ehviewer.ehclient.EhInfo;
import com.hippo.ehviewer.ehclient.ExDownloaderManager;
import com.hippo.ehviewer.network.HttpHelper;
import com.hippo.ehviewer.util.Config;
import com.hippo.ehviewer.util.Crash;
import com.hippo.ehviewer.util.EhUtils;
import com.hippo.ehviewer.util.Favorite;
import com.hippo.ehviewer.util.Log;
import com.hippo.ehviewer.util.Ui;
import com.hippo.ehviewer.util.Utils;
import com.hippo.ehviewer.widget.MaterialToast;
public class AppContext extends Application implements UncaughtExceptionHandler {
@@ -85,10 +89,57 @@ public class AppContext extends Application implements UncaughtExceptionHandler
} catch (IOException e) {}
}
// Fix <=22 error
if (Config.getVersionCode() <= 22)
// Update proxy urls
HttpHelper.updateProxyUrls(this);
int oldVersion = Config.getVersionCode();
// Fix <=22 login error
if (oldVersion <= 22)
EhInfo.getInstance(this).logout();
// Fix <=25 Update
if (oldVersion <= 25) {
File downloadDir = new File(Config.getDownloadPath());
String cachePath = getExternalCacheDir() != null
? getExternalCacheDir().getPath()
: getCacheDir().getPath();
File oldEdInfoDir = new File(cachePath, "ExDownloaderManager");
String[] list = downloadDir.list();
if (list != null && list.length != 0) {
for (String str : list) {
// Change download dir name from gid-title to gid
File oldDir = new File(downloadDir, str);
if (!new File(oldDir, EhUtils.EH_DOWNLOAD_FILENAME).exists())
continue;
int index = str.indexOf('-');
if (index == -1)
continue;
String gid = str.substring(0, index);
File newDir = new File(downloadDir, gid);
if (!oldDir.renameTo(newDir)) {
// if delete error, might same gid and different title
Utils.deleteDirInThread(oldDir);
continue;
}
// Move download info file
File oldInfoFile = new File(oldEdInfoDir, gid);
File newInfoFile = new File(newDir, EhUtils.EH_DOWNLOAD_FILENAME);
try {
FileOutputStream fos = new FileOutputStream(newInfoFile);
// Add last page
byte[] bs = {'0', '0', '0', '0', '0', '0', '0', '0', '\n'};
fos.write(bs);
Utils.copy(new FileInputStream(oldInfoFile), fos);
} catch (Throwable e) {
continue;
}
}
}
// Delete old exdownload info dir
Utils.deleteDirInThread(oldEdInfoDir);
}
// Update version code
try {
PackageInfo pi= getPackageManager().getPackageInfo(getPackageName(), 0);
+80 -106
View File
@@ -32,11 +32,10 @@ import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import com.hippo.ehviewer.app.MaterialAlertDialog;
import com.hippo.ehviewer.ui.GalleryListActivity;
import com.hippo.ehviewer.util.Config;
import com.hippo.ehviewer.util.Crash;
import com.hippo.ehviewer.widget.AlertButton;
import com.hippo.ehviewer.widget.DialogBuilder;
public class StartActivity extends Activity {
@@ -47,136 +46,116 @@ public class StartActivity extends Activity {
private static final int CHECK_ANALYTICS = 1;
private static final int CHECK_NETWORK = 2;
private static final int CHECK_CRASH = 3;
private static final int CHECK_EXTERNAL_STORAGE = 4;
private String lastCrash;
private boolean isAnimationOver = false;
private boolean isCheckOver = false;
private AlertDialog createWarningDialog() {
return new DialogBuilder(this).setCancelable(false)
private MaterialAlertDialog createWarningDialog() {
return new MaterialAlertDialog.Builder(this).setCancelable(false)
.setTitle(R.string.dailog_waring_title)
.setMessage(R.string.dailog_waring_plain)
.setPositiveButton(R.string.dailog_waring_yes,
new View.OnClickListener() {
.setPositiveButton(R.string.dailog_waring_yes)
.setNegativeButton(R.string.dailog_waring_no)
.setButtonListener(new MaterialAlertDialog.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
Config.allowed();
check(CHECK_ANALYTICS);
}
}).setNegativeButton(R.string.dailog_waring_no,
new View.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
finish();
public boolean onClick(MaterialAlertDialog dialog, int which) {
switch (which) {
case MaterialAlertDialog.POSITIVE:
Config.allowed();
check(CHECK_ANALYTICS);
break;
case MaterialAlertDialog.NEGATIVE:
finish();
break;
}
return true;
}
}).create();
}
private AlertDialog createAllowAnalyicsDialog() {
return new DialogBuilder(this).setCancelable(false)
return new MaterialAlertDialog.Builder(this).setCancelable(false)
.setTitle(R.string.dailog_analyics_title)
.setMessageAutoLink(Linkify.WEB_URLS)
.setLongMessage(R.string.dailog_analyics_plain)
.setPositiveButton(android.R.string.ok, new View.OnClickListener() {
.setMessage(R.string.dailog_analyics_plain)
.setPositiveButton(android.R.string.ok)
.setNegativeButton(android.R.string.cancel)
.setButtonListener(new MaterialAlertDialog.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
Config.setAllowAnalyics(true);
check(CHECK_NETWORK);
}
}).setNegativeButton(android.R.string.cancel, new View.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
Config.setAllowAnalyics(false);
check(CHECK_NETWORK);
public boolean onClick(MaterialAlertDialog dialog, int which) {
switch (which) {
case MaterialAlertDialog.POSITIVE:
Config.setAllowAnalyics(true);
check(CHECK_NETWORK);
break;
case MaterialAlertDialog.NEGATIVE:
Config.setAllowAnalyics(false);
check(CHECK_NETWORK);
break;
}
return true;
}
}).create();
}
private AlertDialog createNetworkErrorDialog() {
return new DialogBuilder(this).setCancelable(false)
return new MaterialAlertDialog.Builder(this).setCancelable(false)
.setTitle(R.string.error).setMessage(R.string.em_no_network)
.setPositiveButton(R.string.dailog_network_error_yes,
new View.OnClickListener() {
.setPositiveButton(R.string.dailog_network_error_yes)
.setNegativeButton(R.string.dailog_network_error_no)
.setButtonListener(new MaterialAlertDialog.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
check(CHECK_CRASH);
}
})
.setNegativeButton(R.string.dailog_network_error_no,
new View.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
finish();
public boolean onClick(MaterialAlertDialog dialog, int which) {
switch (which) {
case MaterialAlertDialog.POSITIVE:
check(CHECK_CRASH);
break;
case MaterialAlertDialog.NEGATIVE:
finish();
break;
}
return true;
}
}).create();
}
private AlertDialog createSendCrashDialog() {
return new DialogBuilder(this).setCancelable(false)
return new MaterialAlertDialog.Builder(this).setCancelable(false)
.setTitle(R.string.dialog_send_crash_title)
.setMessage(R.string.dialog_send_crash_plain)
.setPositiveButton(R.string.dialog_send_crash_yes, new View.OnClickListener() {
.setPositiveButton(R.string.dialog_send_crash_yes)
.setNegativeButton(R.string.dialog_send_crash_no)
.setButtonListener(new MaterialAlertDialog.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
new DialogBuilder(StartActivity.this).setCancelable(false)
.setTitle(R.string.wait)
.setMessage(R.string.dialog_wait_send_crash_msg)
.setPositiveButton(android.R.string.ok,
new View.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
check(CHECK_EXTERNAL_STORAGE);
}
}).show();
Intent i = new Intent(Intent.ACTION_SENDTO);
i.setData(Uri.parse("mailto:ehviewersu@gmail.com"));
i.putExtra(Intent.EXTRA_SUBJECT, "I found a bug in EhViewer !");
i.putExtra(Intent.EXTRA_TEXT, lastCrash);
startActivity(i);
lastCrash = null;
}
}).setNegativeButton(R.string.dialog_send_crash_no, new View.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
lastCrash = null;
check(CHECK_EXTERNAL_STORAGE);
}
}).create();
}
private AlertDialog createNoSdCardDialog() {
return new DialogBuilder(this).setCancelable(false)
.setTitle("未检测到内置存储空间或 Sd Card")
.setMessage("未检测到内置存储空间或 Sd Card,您无法使用磁盘缓存与下载功能,用户体验会很糟,是否继续?")
.setPositiveButton("我不介意", new View.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
checkOver();
}
}).setNegativeButton("算了", new View.OnClickListener() {
@Override
public void onClick(View v) {
((AlertButton)v).dialog.dismiss();
finish();
public boolean onClick(MaterialAlertDialog dialog, int which) {
switch (which) {
case MaterialAlertDialog.POSITIVE:
// A wait dialog
new MaterialAlertDialog.Builder(StartActivity.this).setCancelable(false)
.setTitle(R.string.wait)
.setMessage(R.string.dialog_wait_send_crash_msg)
.setPositiveButton(android.R.string.ok)
.setButtonListener(new MaterialAlertDialog.OnClickListener() {
@Override
public boolean onClick(MaterialAlertDialog dialog, int which) {
checkOver();
return true;
}
}).show();
Intent i = new Intent(Intent.ACTION_SENDTO);
i.setData(Uri.parse("mailto:ehviewersu@gmail.com"));
i.putExtra(Intent.EXTRA_SUBJECT, "I found a bug in EhViewer !");
i.putExtra(Intent.EXTRA_TEXT, lastCrash);
startActivity(i);
lastCrash = null;
break;
case MaterialAlertDialog.NEGATIVE:
lastCrash = null;
checkOver();
break;
}
return true;
}
}).create();
}
@@ -253,11 +232,6 @@ public class StartActivity extends Activity {
createSendCrashDialog().show();
return;
}
case CHECK_EXTERNAL_STORAGE:
if (false) {
createNoSdCardDialog().show();
return;
}
}
checkOver();
}
+2 -2
View File
@@ -31,6 +31,7 @@ import android.net.Uri;
import android.os.Process;
import android.support.v4.app.NotificationCompat;
import com.hippo.ehviewer.ehclient.EhClient;
import com.hippo.ehviewer.network.HttpHelper;
import com.hippo.ehviewer.util.Config;
import com.hippo.ehviewer.util.Utils;
@@ -42,7 +43,6 @@ public class UpdateHelper implements Runnable {
@SuppressWarnings("unused")
private static final String TAG = "UpdateHelper";
private static final String UPDATE_API = "http://www.ehviewer.com/API";
private static final String HEADER = "Ehviewer-";
private static final String FOOTER = ".apk";
@@ -114,7 +114,7 @@ public class UpdateHelper implements Runnable {
jo.put("detail", detailJO);
_package.body = hp.postJson(UPDATE_API, jo);
_package.body = hp.postJson(EhClient.API_EHVIEWER, jo);
_package.emesg = hp.getEMsg();
send(_package);
} catch (NameNotFoundException e) {
@@ -0,0 +1,407 @@
/*
* Copyright (C) 2014 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.app;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.hippo.ehviewer.R;
public class MaterialAlertDialog extends AlertDialog implements View.OnClickListener, AdapterView.OnItemClickListener {
public final static int ACTION = 0;
public final static int POSITIVE = 1;
public final static int NEGATIVE = 2;
public final static int NEUTRAL = 3;
private final Context mContext;
private final Builder mBuilder;
private View mRootView;
private TextView mTitle;
private Button mActionButton;
private Button mPositiveButton;
private Button mNegativeButton;
private Button mNeutralButton;
private MaterialAlertDialog(Builder builder) {
//super(builder.mContext);
super(new ContextThemeWrapper(builder.mContext, R.style.AppTheme_Main));
mContext = builder.mContext;
mBuilder = builder;
init();
}
@SuppressLint("InflateParams")
private void init() {
mRootView = LayoutInflater.from(mContext).inflate(
R.layout.alert_dialog_material, null);
// Check in scroll view or not
boolean inScrollView;
if (mBuilder.mCustomView != null)
inScrollView = mBuilder.mInScrollView;
else if (mBuilder.mAdapter != null)
inScrollView = false;
else
inScrollView = true;
// Get widget
LinearLayout topPanel;
TextView message = null;
ListView list = null;
if (inScrollView) {
mRootView.findViewById(R.id.top_panel_noscroll).setVisibility(View.GONE);
mTitle = (TextView) mRootView.findViewById(R.id.title);
topPanel = (LinearLayout) mRootView.findViewById(R.id.top_panel);
message = (TextView) mRootView.findViewById(R.id.message);
} else {
mRootView.findViewById(R.id.scroll_view).setVisibility(View.GONE);
mTitle = (TextView) mRootView.findViewById(R.id.title2);
topPanel = (LinearLayout) mRootView.findViewById(R.id.top_panel_noscroll);
list = (ListView) mRootView.findViewById(R.id.list);
}
// Title
if (mBuilder.mTitle == null)
mTitle.setVisibility(View.GONE);
else
mTitle.setText(mBuilder.mTitle);
// Content
if (mBuilder.mCustomView != null) {
// CustomView
if (message != null) message.setVisibility(View.GONE);
if (list != null) list.setVisibility(View.GONE);
LinearLayout.LayoutParams lp = mBuilder.mCustomLp;
if (lp == null)
lp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
mBuilder.mCustomView.setId(R.id.custom);
topPanel.addView(mBuilder.mCustomView, lp);
} else if (mBuilder.mAdapter != null) {
// List
if (message != null) message.setVisibility(View.GONE);
list.setAdapter(mBuilder.mAdapter);
list.setOnItemClickListener(this);
if (mBuilder.mIsSingleChoice) {
list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
if (mBuilder.mCheckedItem > -1) {
list.setItemChecked(mBuilder.mCheckedItem, true);
list.setSelection(mBuilder.mCheckedItem);
}
}
} else {
// Message
if (list != null) list.setVisibility(View.GONE);
if (mBuilder.mAutoLinkMask != -1)
message.setAutoLinkMask(mBuilder.mAutoLinkMask);
message.setText(mBuilder.mMessage);
}
// Buttons
View buttonPanel = mRootView.findViewById(R.id.button_panel);
View nonActionPanel = mRootView.findViewById(R.id.non_action_panel);
mActionButton = (Button) mRootView.findViewById(R.id.button_action);
mPositiveButton = (Button) mRootView.findViewById(R.id.button_positive);
mNegativeButton = (Button) mRootView.findViewById(R.id.button_negative);
mNeutralButton = (Button) mRootView.findViewById(R.id.button_neutral);
boolean hasAction = mBuilder.mActionButtonText != null;
boolean hasNonAction = mBuilder.mPositiveButtonText != null
|| mBuilder.mNegativeButtonText != null
|| mBuilder.mNeutralButtonText != null;
boolean hasButton = hasAction || hasNonAction;
if (hasButton) {
if (hasAction) {
mActionButton.setText(mBuilder.mActionButtonText);
mActionButton.setOnClickListener(this);
} else {
mActionButton.setVisibility(View.GONE);
}
if (hasNonAction) {
// Positive
if (mBuilder.mPositiveButtonText != null) {
mPositiveButton.setText(mBuilder.mPositiveButtonText);
mPositiveButton.setOnClickListener(this);
} else {
mPositiveButton.setVisibility(View.GONE);
}
// Negative
if (mBuilder.mNegativeButtonText != null) {
mNegativeButton.setText(mBuilder.mNegativeButtonText);
mNegativeButton.setOnClickListener(this);
} else {
mNegativeButton.setVisibility(View.GONE);
}
// Neutral
if (mBuilder.mNeutralButtonText != null) {
mNeutralButton.setText(mBuilder.mNeutralButtonText);
mNeutralButton.setOnClickListener(this);
} else {
mNeutralButton.setVisibility(View.GONE);
}
} else {
nonActionPanel.setVisibility(View.GONE);
}
} else {
buttonPanel.setVisibility(View.GONE);
}
setView(mRootView);
setCancelable(mBuilder.mCancelable);
if (mBuilder.mOnDismissListener != null)
setOnDismissListener(mBuilder.mOnDismissListener);
}
@Override
public void setTitle(CharSequence title) {
mTitle.setText(title);
}
@Override
public void setTitle(int resId) {
setTitle(getContext().getString(resId));
}
@Override
public void onClick(View v) {
boolean close = true;
if (mBuilder.mButtonListener != null) {
if (v == mActionButton)
close = mBuilder.mButtonListener.onClick(this, ACTION);
else if (v == mPositiveButton)
close = mBuilder.mButtonListener.onClick(this, POSITIVE);
else if (v == mNegativeButton)
close = mBuilder.mButtonListener.onClick(this, NEGATIVE);
else if (v == mNeutralButton)
close = mBuilder.mButtonListener.onClick(this, NEUTRAL);
}
if (close)
dismiss();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
boolean close = false;
if (mBuilder.mOnClickListener != null)
close = mBuilder.mOnClickListener.onClick(this, position);
if (close)
dismiss();
}
public static interface OnClickListener {
public boolean onClick(MaterialAlertDialog dialog, int which);
}
public static class Builder {
private final Context mContext;
private CharSequence mTitle;
private CharSequence mMessage;
private CharSequence mActionButtonText;
private CharSequence mPositiveButtonText;
private CharSequence mNegativeButtonText;
private CharSequence mNeutralButtonText;
private OnClickListener mButtonListener;
private View mCustomView;
private LinearLayout.LayoutParams mCustomLp;
private boolean mInScrollView = true;
private boolean mCancelable = true;
private int mAutoLinkMask = -1;
private ListAdapter mAdapter;
private OnClickListener mOnClickListener;
private int mCheckedItem;
private boolean mIsSingleChoice;
private DialogInterface.OnDismissListener mOnDismissListener;
public Builder(Context context) {
mContext = context;
}
public Builder setTitle(CharSequence title) {
mTitle = title;
return this;
}
public Builder setTitle(int resId) {
return setTitle(mContext.getString(resId));
}
public Builder setMessage(CharSequence message) {
mMessage = message;
return this;
}
public Builder setMessage(int resId) {
return setMessage(mContext.getString(resId));
}
public Builder setActionButton(CharSequence text) {
mActionButtonText = text;
return this;
}
public Builder setActionButton(int resId) {
return setActionButton(mContext.getString(resId));
}
public Builder setPositiveButton(CharSequence text) {
mPositiveButtonText = text;
return this;
}
public Builder setPositiveButton(int resId) {
return setPositiveButton(mContext.getString(resId));
}
public Builder setNegativeButton(CharSequence text) {
mNegativeButtonText = text;
return this;
}
public Builder setNegativeButton(int resId) {
return setNegativeButton(mContext.getString(resId));
}
public Builder setNeutralButton(CharSequence text) {
mNeutralButtonText = text;
return this;
}
public Builder setNeutralButton(int resId) {
return setNeutralButton(mContext.getString(resId));
}
public Builder setButtonListener(OnClickListener l) {
mButtonListener = l;
return this;
}
public Builder setView(View view, boolean inScrollView) {
mCustomView = view;
mInScrollView = inScrollView;
return this;
}
public Builder setView(View view, boolean inScrollView, LinearLayout.LayoutParams lp) {
mCustomView = view;
mInScrollView = inScrollView;
mCustomLp = lp;
return this;
}
public Builder setCancelable(boolean cancelable) {
mCancelable = cancelable;
return this;
}
public Builder setMessageAutoLink(int mask) {
mAutoLinkMask = mask;
return this;
}
public Builder setItems(int itemsId, final OnClickListener listener) {
mAdapter = new ArrayAdapter<CharSequence>(mContext,
R.layout.select_dialog_item, android.R.id.text1,
mContext.getResources().getTextArray(itemsId));
mOnClickListener = listener;
mIsSingleChoice = false;
return this;
}
public Builder setItems(CharSequence[] items, final OnClickListener listener) {
mAdapter = new ArrayAdapter<CharSequence>(mContext,
R.layout.select_dialog_item, android.R.id.text1, items);
mOnClickListener = listener;
mIsSingleChoice = false;
return this;
}
public Builder setAdapter(final ListAdapter adapter, final OnClickListener listener) {
mAdapter = adapter;
mOnClickListener = listener;
mIsSingleChoice = false;
return this;
}
public Builder setSingleChoiceItems(int itemsId, int checkedItem,
final OnClickListener listener) {
mAdapter = new ArrayAdapter<CharSequence>(mContext,
R.layout.select_dialog_singlechoice, android.R.id.text1,
mContext.getResources().getTextArray(itemsId));
mOnClickListener = listener;
mCheckedItem = checkedItem;
mIsSingleChoice = true;
return this;
}
public Builder setSingleChoiceItems(CharSequence[] items, int checkedItem, final OnClickListener listener) {
mAdapter = new ArrayAdapter<CharSequence>(mContext,
R.layout.select_dialog_singlechoice, android.R.id.text1, items);
mOnClickListener = listener;
mCheckedItem = checkedItem;
mIsSingleChoice = true;
return this;
}
public Builder setSingleChoiceItems(ListAdapter adapter, int checkedItem, final OnClickListener listener) {
mAdapter = adapter;
mOnClickListener = listener;
mCheckedItem = checkedItem;
mIsSingleChoice = true;
return this;
}
public Builder setOnDismissListener(DialogInterface.OnDismissListener l) {
mOnDismissListener = l;
return this;
}
public MaterialAlertDialog create() {
return new MaterialAlertDialog(this);
}
public MaterialAlertDialog show() {
MaterialAlertDialog dialog = create();
dialog.show();
return dialog;
}
}
}
+87 -16
View File
@@ -30,11 +30,13 @@ import com.hippo.ehviewer.Analytics;
import com.hippo.ehviewer.util.Log;
import com.hippo.ehviewer.util.SqlUtils;
// TODO
// what a mess
// refactoring
public class Data {
private static final String TAG = "Data";
private static final int VERSION = 2;
private static final int VERSION = 3;
private static final String DB_NAME = "data";
private static final String TABLE_GALLERY = "gallery";
@@ -63,6 +65,8 @@ public class Data {
private static final String COLUMN_STATE = "state";
private static final String COLUMN_LEGACY = "legacy";
private static final String COLUMN_DATE = "date";
private final SparseArray<GalleryInfo> mGallerys;
private long mTagRowNum;
@@ -87,11 +91,11 @@ public class Data {
public Data(Context context) {
mContext = context;
mGallerys = new SparseArray<GalleryInfo>();
mDBHelper = new DBHelper(mContext);
mDatabase = mDBHelper.getWritableDatabase();
mGallerys = new SparseArray<GalleryInfo>();
getTags();
getLocalFavourites();
getDownloads();
@@ -110,10 +114,10 @@ public class Data {
* @param gid
* @return
*/
public GalleryInfo getGallery(int gid) {
public GalleryInfo getGallery(SQLiteDatabase db, int gid) {
GalleryInfo galleryInfo = mGallerys.get(gid);
if (galleryInfo == null) {
Cursor cursor = mDatabase.rawQuery("select * from " + TABLE_GALLERY + " where " + COLUMN_GID + "=?",
Cursor cursor = db.rawQuery("select * from " + TABLE_GALLERY + " where " + COLUMN_GID + "=?",
new String[]{String.valueOf(gid)});
if (cursor.moveToFirst()) {
galleryInfo = new GalleryInfo();
@@ -255,13 +259,14 @@ public class Data {
private synchronized void getDownloads() {
mDownloads = new ArrayList<DownloadInfo>();
Cursor cursor = mDatabase.rawQuery("select * from "
+ TABLE_DOWNLOAD, null);
Cursor cursor = mDatabase.rawQuery("select * from " + TABLE_DOWNLOAD
+ " order by " + COLUMN_DATE + " asc", null);
if (cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
int gid = cursor.getInt(0);
GalleryInfo galleryInfo = getGallery(gid);
GalleryInfo galleryInfo = getGallery(mDatabase, gid);
if (galleryInfo == null) {
cursor.moveToNext();
continue;
@@ -335,6 +340,9 @@ public class Data {
COLUMN_GID + "=?", new String[]{String.valueOf(galleryInfo.gid)});
return false;
} else {
// If not update, set date
values.put(COLUMN_DATE, System.currentTimeMillis());
if (mDatabase.insert(TABLE_DOWNLOAD, null,
values) != -1) { // If add ok
mDownloads.add(downloadInfo);
@@ -395,7 +403,7 @@ public class Data {
if (cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
int gid = cursor.getInt(0);
GalleryInfo galleryInfo = getGallery(gid);
GalleryInfo galleryInfo = getGallery(mDatabase, gid);
if (galleryInfo != null)
mLocalFavourites.add(galleryInfo);
cursor.moveToNext();
@@ -636,11 +644,11 @@ public class Data {
db.execSQL(CreateTag);
// download
createDownloadTable(db);
createDownloadTableVer3(db);
}
private void createDownloadTable(SQLiteDatabase db) {
String CreateDownload = "create table "
private void createDownloadTableVer2(SQLiteDatabase db) {
String createDownload = "create table "
+ TABLE_DOWNLOAD + "("
+ COLUMN_GID + " integer primary key,"
+ COLUMN_MODE + " integer,"
@@ -648,7 +656,66 @@ public class Data {
+ COLUMN_LEGACY + " integer,"
+ "foreign key(" + COLUMN_GID + ") references " + TABLE_GALLERY + "(" + COLUMN_GID + "));";
SqlUtils.exeSQLSafely(db, CreateDownload);
SqlUtils.exeSQLSafely(db, createDownload);
}
private synchronized List<DownloadInfo> getDownloadsVer2(SQLiteDatabase db) {
List<DownloadInfo> list = new ArrayList<DownloadInfo>();
Cursor cursor = db.rawQuery("select * from " + TABLE_DOWNLOAD,
null);
if (cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
int gid = cursor.getInt(0);
GalleryInfo galleryInfo = getGallery(db, gid);
if (galleryInfo == null) {
cursor.moveToNext();
continue;
}
int mode = cursor.getInt(1);
int state = cursor.getInt(2);
int legacy = cursor.getInt(3);
if (state == DownloadInfo.STATE_WAIT || state == DownloadInfo.STATE_DOWNLOAD)
state = DownloadInfo.STATE_NONE;
DownloadInfo downloadInfo = new DownloadInfo(
galleryInfo, mode, state, legacy);
list.add(downloadInfo);
cursor.moveToNext();
}
}
cursor.close();
return list;
}
private void createDownloadTableVer3(SQLiteDatabase db) {
String createDownload = "create table "
+ TABLE_DOWNLOAD + "("
+ COLUMN_GID + " integer primary key,"
+ COLUMN_MODE + " integer,"
+ COLUMN_STATE + " integer,"
+ COLUMN_LEGACY + " integer,"
+ COLUMN_DATE + " long,"
+ "foreign key(" + COLUMN_GID + ") references " + TABLE_GALLERY + "(" + COLUMN_GID + "));";
SqlUtils.exeSQLSafely(db, createDownload);
}
public void addDownloadInfoVer3(SQLiteDatabase db, List<DownloadInfo> l) {
for (int i = 0; i < l.size(); i++) {
DownloadInfo di = l.get(i);
ContentValues values = new ContentValues();
values.put(COLUMN_GID, di.galleryInfo.gid);
values.put(COLUMN_MODE, di.mode);
values.put(COLUMN_STATE, di.state);
values.put(COLUMN_LEGACY, di.legacy);
values.put(COLUMN_DATE, (long) i);
db.insert(TABLE_DOWNLOAD, null, values);
}
}
@Override
@@ -657,8 +724,12 @@ public class Data {
case 1:
SqlUtils.dropTable(db, TABLE_DOWNLOAD);
SqlUtils.dropTable(db, "read");
createDownloadTable(db);
break;
createDownloadTableVer2(db);
case 2:
List<DownloadInfo> l = getDownloadsVer2(db);
SqlUtils.dropTable(db, TABLE_DOWNLOAD);
createDownloadTableVer3(db);
addDownloadInfoVer3(db, l);
case VERSION:
break;
default:
+14 -2
View File
@@ -16,8 +16,10 @@
package com.hippo.ehviewer.data;
import com.hippo.ehviewer.widget.ExpandableListItem;
public class DownloadInfo {
public class DownloadInfo implements ExpandableListItem {
@SuppressWarnings("unused")
private static final String TAG = DownloadInfo.class.getSimpleName();
@@ -35,7 +37,7 @@ public class DownloadInfo {
public volatile int total = -1;
public volatile int legacy;
public boolean selected = false;
private boolean mExpanded = false;
public DownloadInfo(GalleryInfo gi, int mode) {
this.galleryInfo = gi;
@@ -48,4 +50,14 @@ public class DownloadInfo {
this.state = state;
this.legacy = legacy;
}
@Override
public void setExpanded(boolean expanded) {
mExpanded = expanded;
}
@Override
public boolean getExpanded() {
return mExpanded;
}
}
+1 -1
View File
@@ -61,7 +61,7 @@ public class GalleryInfo implements Parcelable {
public static final String[] S_LANG_PATTERNS = {
"[(\\[]eng(?:lish)?[)\\]]",
"[((\\[]chinese[))\\]]|[汉漢]化",
"[((\\[]chinese[))\\]]|[汉漢]化|中[国國][语語]",
"[(\\[]spanish[)\\]]|[(\\[]Español[)\\]]",
"[(\\[]korean[)\\]]",
"[(\\[]rus(?:sian)?[)\\]]",
Loaded 100 of 133 files, more files were not shown because too many files have changed in this diff. Show more