Browse Source

Add PrefActivity

develop
Tommy Chen 8 years ago
parent
commit
e9427da5f2
  1. 13
      LICENSE
  2. 23
      README.md
  3. 2
      ehreader/build.gradle
  4. 4
      ehreader/src/main/AndroidManifest.xml
  5. 1
      ehreader/src/main/java/tw/skyarrow/ehreader/BaseApplication.java
  6. 2
      ehreader/src/main/java/tw/skyarrow/ehreader/Constant.java
  7. 37
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/ClearCacheDialog.java
  8. 77
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/ClearHistoryDialog.java
  9. 40
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/ClearSearchDialog.java
  10. 9
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadAgainDialog.java
  11. 11
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadConfirmDialog.java
  12. 9
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadDeleteConfirmDialog.java
  13. 2
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadDeleteDialog.java
  14. 11
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/FilterDialog.java
  15. 8
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/GalleryActivity.java
  16. 59
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/LicenseDialog.java
  17. 34
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/MainActivity.java
  18. 29
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/MainFragmentWeb.java
  19. 7
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/PhotoActivity.java
  20. 3
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/PhotoBookmarkDialog.java
  21. 36
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/PrefActivity.java
  22. 76
      ehreader/src/main/java/tw/skyarrow/ehreader/activity/PrefFragment.java
  23. 4
      ehreader/src/main/java/tw/skyarrow/ehreader/adapter/DownloadListAdapter.java
  24. 2
      ehreader/src/main/java/tw/skyarrow/ehreader/adapter/GalleryListAdapter.java
  25. 37
      ehreader/src/main/java/tw/skyarrow/ehreader/app/ListPreferenceWithSummary.java
  26. 8
      ehreader/src/main/java/tw/skyarrow/ehreader/service/GalleryDownloadService.java
  27. 11
      ehreader/src/main/java/tw/skyarrow/ehreader/util/SearchHelper.java
  28. BIN
      ehreader/src/main/res/drawable-hdpi/ic_download.png
  29. BIN
      ehreader/src/main/res/drawable-hdpi/ic_filter.png
  30. BIN
      ehreader/src/main/res/drawable-hdpi/ic_pause_all.png
  31. BIN
      ehreader/src/main/res/drawable-hdpi/ic_refresh.png
  32. BIN
      ehreader/src/main/res/drawable-hdpi/ic_search.png
  33. BIN
      ehreader/src/main/res/drawable-hdpi/ic_share.png
  34. BIN
      ehreader/src/main/res/drawable-hdpi/ic_share_dark.png
  35. BIN
      ehreader/src/main/res/drawable-hdpi/ic_star.png
  36. BIN
      ehreader/src/main/res/drawable-hdpi/ic_start_all.png
  37. BIN
      ehreader/src/main/res/drawable-hdpi/ic_unstar.png
  38. BIN
      ehreader/src/main/res/drawable-mdpi/ic_download.png
  39. BIN
      ehreader/src/main/res/drawable-mdpi/ic_filter.png
  40. BIN
      ehreader/src/main/res/drawable-mdpi/ic_pause_all.png
  41. BIN
      ehreader/src/main/res/drawable-mdpi/ic_refresh.png
  42. BIN
      ehreader/src/main/res/drawable-mdpi/ic_search.png
  43. BIN
      ehreader/src/main/res/drawable-mdpi/ic_share.png
  44. BIN
      ehreader/src/main/res/drawable-mdpi/ic_share_dark.png
  45. BIN
      ehreader/src/main/res/drawable-mdpi/ic_star.png
  46. BIN
      ehreader/src/main/res/drawable-mdpi/ic_start_all.png
  47. BIN
      ehreader/src/main/res/drawable-mdpi/ic_unstar.png
  48. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_download.png
  49. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_filter.png
  50. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_pause_all.png
  51. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_refresh.png
  52. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_search.png
  53. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_share.png
  54. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_share_dark.png
  55. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_star.png
  56. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_start_all.png
  57. BIN
      ehreader/src/main/res/drawable-xhdpi/ic_unstar.png
  58. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_download.png
  59. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_filter.png
  60. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_pause_all.png
  61. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_refresh.png
  62. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_search.png
  63. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_share.png
  64. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_share_dark.png
  65. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_star.png
  66. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_start_all.png
  67. BIN
      ehreader/src/main/res/drawable-xxhdpi/ic_unstar.png
  68. 2
      ehreader/src/main/res/layout/activity_gallery.xml
  69. 4
      ehreader/src/main/res/layout/activity_pref.xml
  70. 2
      ehreader/src/main/res/layout/fragment_image_search.xml
  71. 6
      ehreader/src/main/res/layout/preference_list_content.xml
  72. 2
      ehreader/src/main/res/menu/main.xml
  73. 8
      ehreader/src/main/res/menu/main_web.xml
  74. 43
      ehreader/src/main/res/raw/license.html
  75. 78
      ehreader/src/main/res/values-zh-rTW/strings.xml
  76. 27
      ehreader/src/main/res/values-zh-rTW/strings_download.xml
  77. 18
      ehreader/src/main/res/values-zh-rTW/strings_gallery.xml
  78. 20
      ehreader/src/main/res/values-zh-rTW/strings_main.xml
  79. 15
      ehreader/src/main/res/values-zh-rTW/strings_photo.xml
  80. 54
      ehreader/src/main/res/values-zh-rTW/strings_pref.xml
  81. 16
      ehreader/src/main/res/values-zh-rTW/strings_search.xml
  82. 80
      ehreader/src/main/res/values/strings.xml
  83. 27
      ehreader/src/main/res/values/strings_download.xml
  84. 18
      ehreader/src/main/res/values/strings_gallery.xml
  85. 20
      ehreader/src/main/res/values/strings_main.xml
  86. 15
      ehreader/src/main/res/values/strings_photo.xml
  87. 76
      ehreader/src/main/res/values/strings_pref.xml
  88. 16
      ehreader/src/main/res/values/strings_search.xml
  89. 57
      ehreader/src/main/res/xml/pref.xml

13
LICENSE

@ -0,0 +1,13 @@
Copyright 2014 Tommy Chen
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.

23
README.md

@ -0,0 +1,23 @@
# E-Hentai Reader for Android
The best E-Hentai Reader for Android ever!
## License
Apache License 2.0
```
Copyright 2014 Tommy Chen
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.
```

2
ehreader/build.gradle

@ -7,8 +7,6 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "0.1"
}
buildTypes {

4
ehreader/src/main/AndroidManifest.xml

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tw.skyarrow.ehreader" >
package="tw.skyarrow.ehreader"
android:versionName="@string/version"
android:versionCode="1">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

1
ehreader/src/main/java/tw/skyarrow/ehreader/BaseApplication.java

@ -1,6 +1,7 @@
package tw.skyarrow.ehreader;
import android.app.Application;
import android.content.SharedPreferences;
import com.androidquery.callback.BitmapAjaxCallback;

2
ehreader/src/main/java/tw/skyarrow/ehreader/Constant.java

@ -25,4 +25,6 @@ public class Constant {
public static final int PHOTO_PER_PAGE = 20;
public static final String FOLDER_NAME = "ehreader";
public static final String HOMEPAGE = "https://github.com/tommy351/ehreader-android";
}

37
ehreader/src/main/java/tw/skyarrow/ehreader/activity/ClearCacheDialog.java

@ -0,0 +1,37 @@
package tw.skyarrow.ehreader.activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import com.androidquery.util.AQUtility;
import tw.skyarrow.ehreader.R;
/**
* Created by SkyArrow on 2014/2/3.
*/
public class ClearCacheDialog extends DialogFragment {
public static final String TAG = "ClearCacheDialog";
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.clear_cache_title)
.setMessage(R.string.clear_cache_msg)
.setPositiveButton(R.string.ok, onSubmitClick)
.setNegativeButton(R.string.cancel, null);
return builder.create();
}
private DialogInterface.OnClickListener onSubmitClick = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
AQUtility.cleanCacheAsync(getActivity());
}
};
}

77
ehreader/src/main/java/tw/skyarrow/ehreader/activity/ClearHistoryDialog.java

@ -0,0 +1,77 @@
package tw.skyarrow.ehreader.activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.text.TextUtils;
import java.util.List;
import de.greenrobot.dao.query.Query;
import de.greenrobot.dao.query.QueryBuilder;
import tw.skyarrow.ehreader.Constant;
import tw.skyarrow.ehreader.R;
import tw.skyarrow.ehreader.db.DaoMaster;
import tw.skyarrow.ehreader.db.DaoSession;
import tw.skyarrow.ehreader.db.Download;
import tw.skyarrow.ehreader.db.DownloadDao;
import tw.skyarrow.ehreader.db.Gallery;
import tw.skyarrow.ehreader.db.GalleryDao;
import tw.skyarrow.ehreader.db.PhotoDao;
import tw.skyarrow.ehreader.util.L;
/**
* Created by SkyArrow on 2014/2/3.
*/
public class ClearHistoryDialog extends DialogFragment {
public static final String TAG = "ClearHistoryDialog";
private SQLiteDatabase db;
private DaoMaster daoMaster;
private DaoSession daoSession;
private GalleryDao galleryDao;
private DownloadDao downloadDao;
private PhotoDao photoDao;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(getActivity(), Constant.DB_NAME, null);
db = helper.getWritableDatabase();
daoMaster = new DaoMaster(db);
daoSession = daoMaster.newSession();
galleryDao = daoSession.getGalleryDao();
downloadDao = daoSession.getDownloadDao();
photoDao = daoSession.getPhotoDao();
builder.setTitle(R.string.clear_history_title)
.setMessage(R.string.clear_history_msg)
.setPositiveButton(R.string.ok, onSubmitClick)
.setNegativeButton(R.string.cancel, null);
return builder.create();
}
private DialogInterface.OnClickListener onSubmitClick = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int n) {
QueryBuilder galleryQb = galleryDao.queryBuilder();
galleryQb.where(GalleryDao.Properties.Starred.notEq(true));
List<Gallery> galleryList = galleryQb.list();
for (Gallery gallery : galleryList) {
if (!gallery.getStarred() && downloadDao.load(gallery.getId()) == null) {
QueryBuilder photoQb = photoDao.queryBuilder();
photoQb.where(PhotoDao.Properties.GalleryId.eq(gallery.getId()));
photoQb.buildDelete();
galleryDao.deleteInTx(gallery);
}
}
}
};
}

40
ehreader/src/main/java/tw/skyarrow/ehreader/activity/ClearSearchDialog.java

@ -0,0 +1,40 @@
package tw.skyarrow.ehreader.activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.provider.SearchRecentSuggestions;
import android.support.v4.app.DialogFragment;
import tw.skyarrow.ehreader.R;
import tw.skyarrow.ehreader.provider.SearchSuggestionProvider;
/**
* Created by SkyArrow on 2014/2/3.
*/
public class ClearSearchDialog extends DialogFragment {
public static final String TAG = "ClearSearchDialog";
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.clear_search_title)
.setMessage(R.string.clear_search_msg)
.setPositiveButton(R.string.ok, onSubmitClick)
.setNegativeButton(R.string.cancel, null);
return builder.create();
}
private DialogInterface.OnClickListener onSubmitClick = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(getActivity(),
SearchSuggestionProvider.AUTHORITY, SearchSuggestionProvider.MODE);
suggestions.clearHistory();
}
};
}

9
ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadAgainDialog.java

@ -26,7 +26,7 @@ public class DownloadAgainDialog extends DialogFragment {
builder.setMessage(R.string.download_again_confirm)
.setPositiveButton(R.string.download_again, onSubmitClick)
.setNegativeButton(R.string.cancel, onCancelClick);
.setNegativeButton(R.string.cancel, null);
return builder.create();
}
@ -41,11 +41,4 @@ public class DownloadAgainDialog extends DialogFragment {
getActivity().startService(intent);
}
};
private DialogInterface.OnClickListener onCancelClick = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dismiss();
}
};
}

11
ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadConfirmDialog.java

@ -25,11 +25,11 @@ public class DownloadConfirmDialog extends DialogFragment {
Bundle args = getArguments();
galleryId = args.getLong("id");
long gallerySize = args.getLong("size");
String message = String.format(getResources().getString(R.string.download_confirm), FileInfoHelper.toBytes(gallerySize));
String message = String.format(getString(R.string.download_confirm), FileInfoHelper.toBytes(gallerySize));
builder.setMessage(message)
.setPositiveButton(R.string.ok, onSubmitClick)
.setNegativeButton(R.string.cancel, onCancelClick);
.setNegativeButton(R.string.cancel, null);
return builder.create();
}
@ -44,11 +44,4 @@ public class DownloadConfirmDialog extends DialogFragment {
getActivity().startService(intent);
}
};
private DialogInterface.OnClickListener onCancelClick = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dismiss();
}
};
}

9
ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadDeleteConfirmDialog.java

@ -25,7 +25,7 @@ public class DownloadDeleteConfirmDialog extends DialogFragment {
builder.setTitle(R.string.delete_gallery_title)
.setMessage(R.string.delete_gallery_msg)
.setPositiveButton(R.string.ok, onSubmitClick)
.setNegativeButton(R.string.cancel, onCancelClick);
.setNegativeButton(R.string.cancel, null);
return builder.create();
}
@ -42,11 +42,4 @@ public class DownloadDeleteConfirmDialog extends DialogFragment {
dialog.show(getActivity().getSupportFragmentManager(), DownloadDeleteDialog.TAG);
}
};
private DialogInterface.OnClickListener onCancelClick = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dismiss();
}
};
}

2
ehreader/src/main/java/tw/skyarrow/ehreader/activity/DownloadDeleteDialog.java

@ -59,7 +59,7 @@ public class DownloadDeleteDialog extends DialogFragment {
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.setTitle(R.string.deleteing);
dialog.setTitle(R.string.gallery_deleting);
dialog.setMax(gallery.getCount());
dialog.setProgress(0);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);

11
ehreader/src/main/java/tw/skyarrow/ehreader/activity/FilterDialog.java

@ -42,7 +42,7 @@ public class FilterDialog extends DialogFragment {
builder.setMultiChoiceItems(buildResourceArray(categories), null, onChoose)
.setPositiveButton(R.string.ok, onSubmitClick)
.setNegativeButton(R.string.cancel, onCancelClick);
.setNegativeButton(R.string.cancel, null);
return builder.create();
}
@ -51,7 +51,7 @@ public class FilterDialog extends DialogFragment {
String[] result = new String[arr.length];
for (int i = 0; i < arr.length; i++) {
result[i] = getResources().getString(arr[i]);
result[i] = getString(arr[i]);
}
return result;
@ -76,11 +76,4 @@ public class FilterDialog extends DialogFragment {
startActivity(intent);
}
};
private DialogInterface.OnClickListener onCancelClick = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dismiss();
}
};
}

8
ehreader/src/main/java/tw/skyarrow/ehreader/activity/GalleryActivity.java

@ -215,7 +215,7 @@ public class GalleryActivity extends ActionBarActivity {
private void showGallery() {
int categoryRes = CategoryHelper.getResource(gallery.getCategory());
String meta = getResources().getString(categoryRes) + " / " + gallery.getCount() + "P";
String meta = getString(categoryRes) + " / " + gallery.getCount() + "P";
metaView.setText(meta);
titleView.setText(gallery.getTitle());
@ -274,7 +274,7 @@ public class GalleryActivity extends ActionBarActivity {
tags[i] = arr.getString(i);
}
String tagTitle = getResources().getString(R.string.meta_tags) + " ";
String tagTitle = getString(R.string.meta_tags) + " ";
String separator = ", ";
SpannableString sp = new SpannableString(tagTitle + TextUtils.join(separator, tags));
int length = tagTitle.length();
@ -305,7 +305,7 @@ public class GalleryActivity extends ActionBarActivity {
return;
}
String title = getResources().getString(R.string.meta_uploader) + " ";
String title = getString(R.string.meta_uploader) + " ";
SpannableString sp = new SpannableString(title + uploader);
int titleLength = title.length();
@ -342,7 +342,7 @@ public class GalleryActivity extends ActionBarActivity {
DateFormat dateFormat = DateFormat.getDateInstance();
String dateString = dateFormat.format(date);
String title = getResources().getString(R.string.meta_created) + " ";
String title = getString(R.string.meta_created) + " ";
SpannableString sp = new SpannableString(title + dateString);
int titleLength = title.length();

59
ehreader/src/main/java/tw/skyarrow/ehreader/activity/LicenseDialog.java

@ -0,0 +1,59 @@
package tw.skyarrow.ehreader.activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.webkit.WebView;
import android.widget.TextView;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import tw.skyarrow.ehreader.R;
/**
* Created by SkyArrow on 2014/2/3.
*/
public class LicenseDialog extends DialogFragment {
public static final String TAG = "LicenseDialog";
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final WebView webView = new WebView(getActivity());
builder.setTitle(R.string.open_source_license)
.setView(webView)
.setPositiveButton(R.string.ok, null);
new Thread(new Runnable() {
@Override
public void run() {
InputStream in = getResources().openRawResource(R.raw.license);
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int len;
try {
while ((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
in.close();
out.close();
webView.loadDataWithBaseURL("file:///android_res/raw/", out.toString(), "text/html", "UTF-8", null);
} catch (IOException e) {
e.printStackTrace();
}
}
}).run();
return builder.create();
}
}

34
ehreader/src/main/java/tw/skyarrow/ehreader/activity/MainActivity.java

@ -1,10 +1,11 @@
package tw.skyarrow.ehreader.activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
@ -25,6 +26,8 @@ public class MainActivity extends ActionBarActivity implements ActionBar.OnNavig
public static final int TAB_HISTORY = 2;
public static final int TAB_DOWNLOAD = 3;
private static final int CONTAINER = R.id.container;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -38,6 +41,9 @@ public class MainActivity extends ActionBarActivity implements ActionBar.OnNavig
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
actionBar.setDisplayShowTitleEnabled(false);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
String launchPagePref = preferences.getString(getString(R.string.pref_launch_page), "0");
int tab = Integer.parseInt(launchPagePref);
Bundle args;
if (savedInstanceState != null) {
@ -47,8 +53,10 @@ public class MainActivity extends ActionBarActivity implements ActionBar.OnNavig
}
if (args != null) {
actionBar.setSelectedNavigationItem(args.getInt("tab"));
tab = args.getInt("tab");
}
actionBar.setSelectedNavigationItem(tab);
}
@Override
@ -84,6 +92,7 @@ public class MainActivity extends ActionBarActivity implements ActionBar.OnNavig
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_settings:
openSettings();
return true;
case R.id.menu_file_search:
@ -128,14 +137,14 @@ public class MainActivity extends ActionBarActivity implements ActionBar.OnNavig
}
fragment.setArguments(args);
ft.replace(R.id.container, fragment, tag);
ft.replace(CONTAINER, fragment, tag);
ft.commit();
return true;
}
private void fileSearch() {
Intent intent = new Intent(MainActivity.this, ImageSearchActivity.class);
Intent intent = new Intent(this, ImageSearchActivity.class);
startActivity(intent);
}
@ -145,4 +154,21 @@ public class MainActivity extends ActionBarActivity implements ActionBar.OnNavig
dialog.show(getSupportFragmentManager(), FilterDialog.TAG);
}
private void openSettings() {
Intent intent = new Intent(this, PrefActivity.class);
startActivity(intent);
}
public void refreshFragment() {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment fragment = new MainFragmentWeb();
Bundle args = new Bundle();
args.putString("base", Constant.BASE_URL);
fragment.setArguments(args);
ft.replace(CONTAINER, fragment, MainFragmentWeb.TAG);
ft.commit();
}
}

29
ehreader/src/main/java/tw/skyarrow/ehreader/activity/MainFragmentWeb.java

@ -7,6 +7,9 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
@ -81,6 +84,7 @@ public class MainFragmentWeb extends MainFragmentBase implements InfiniteScrollL
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_main, container, false);
ButterKnife.inject(this, view);
setHasOptionsMenu(true);
Context context = getActivity();
DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, Constant.DB_NAME, null);
@ -119,6 +123,26 @@ public class MainFragmentWeb extends MainFragmentBase implements InfiniteScrollL
return view;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (!firstLoaded) {
inflater.inflate(R.menu.main_web, menu);
}
super.onCreateOptionsMenu(menu, inflater);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_refresh:
refresh();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
@ -260,6 +284,7 @@ public class MainFragmentWeb extends MainFragmentBase implements InfiniteScrollL
if (firstLoaded) {
firstLoaded = false;
progressBar.setVisibility(View.GONE);
getActivity().supportInvalidateOptionsMenu();
} else {
footerProgressBar.setVisibility(View.INVISIBLE);
}
@ -269,4 +294,8 @@ public class MainFragmentWeb extends MainFragmentBase implements InfiniteScrollL
public void onScrollToEnd(int page) {
getGalleryList(page);
}
private void refresh() {
((MainActivity) getActivity()).refreshFragment();
}
}

7
ehreader/src/main/java/tw/skyarrow/ehreader/activity/PhotoActivity.java

@ -134,6 +134,13 @@ public class PhotoActivity extends ActionBarActivity implements View.OnSystemUiV
});
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
hideSystemUI();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.photo, menu);

3
ehreader/src/main/java/tw/skyarrow/ehreader/activity/PhotoBookmarkDialog.java

@ -54,7 +54,7 @@ public class PhotoBookmarkDialog extends DialogFragment {
String[] menuItems = new String[size];
for (int i = 0; i < size; i++) {
menuItems[i] = String.format(getResources().getString(R.string.bookmark_list_item),
menuItems[i] = String.format(getString(R.string.bookmark_list_item),
photoList.get(i).getPage());
}
@ -81,7 +81,6 @@ public class PhotoBookmarkDialog extends DialogFragment {
if (photo == null) return;
EventBus.getDefault().post(new PhotoDialogEvent(galleryId, photo.getPage() - 1));
dismiss();
}
};
}

36
ehreader/src/main/java/tw/skyarrow/ehreader/activity/PrefActivity.java

@ -1,9 +1,41 @@
package tw.skyarrow.ehreader.activity;
import android.preference.PreferenceActivity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;
import tw.skyarrow.ehreader.R;
/**
* Created by SkyArrow on 2014/1/29.
*/
public class PrefActivity extends PreferenceActivity {
public class PrefActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pref);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
FragmentTransaction ft = getFragmentManager().beginTransaction();
Fragment fragment = new PrefFragment();
ft.replace(R.id.container, fragment);
ft.commit();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

76
ehreader/src/main/java/tw/skyarrow/ehreader/activity/PrefFragment.java

@ -0,0 +1,76 @@
package tw.skyarrow.ehreader.activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import tw.skyarrow.ehreader.Constant;
import tw.skyarrow.ehreader.R;
/**
* Created by SkyArrow on 2014/2/3.
*/
public class PrefFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref);
Preference clearCachePref = findPreferenceByResource(R.string.pref_clear_cache);
clearCachePref.setOnPreferenceClickListener(
new OpenDialogPreference(new ClearCacheDialog(), ClearCacheDialog.TAG));
Preference clearHistoryPref = findPreferenceByResource(R.string.pref_clear_history);
clearHistoryPref.setOnPreferenceClickListener(
new OpenDialogPreference(new ClearHistoryDialog(), ClearHistoryDialog.TAG));
Preference clearSearchPref = findPreferenceByResource(R.string.pref_clear_search);
clearSearchPref.setOnPreferenceClickListener(
new OpenDialogPreference(new ClearSearchDialog(), ClearSearchDialog.TAG));
Preference aboutPref = findPreferenceByResource(R.string.pref_about);
aboutPref.setOnPreferenceClickListener(onAboutClick);
aboutPref.setTitle(String.format(getString(R.string.pref_about_ver),
getString(R.string.version)));
Preference licensePref = findPreferenceByResource(R.string.pref_open_source_license);
licensePref.setOnPreferenceClickListener(
new OpenDialogPreference(new LicenseDialog(), LicenseDialog.TAG));
}
private Preference.OnPreferenceClickListener onAboutClick = new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(Constant.HOMEPAGE));
startActivity(intent);
return true;
}
};
private class OpenDialogPreference implements Preference.OnPreferenceClickListener {
private DialogFragment dialog;
private String tag;
public OpenDialogPreference(DialogFragment dialog, String tag) {
this.dialog = dialog;
this.tag = tag;
}
@Override
public boolean onPreferenceClick(Preference preference) {
dialog.show(((FragmentActivity) getActivity()).getSupportFragmentManager(), tag);
return true;
}
};
private Preference findPreferenceByResource(int id) {
return findPreference(getString(id));
}
}

4
ehreader/src/main/java/tw/skyarrow/ehreader/adapter/DownloadListAdapter.java

@ -68,8 +68,6 @@ public class DownloadListAdapter extends BaseAdapter {
holder = new ViewHolder(view);
view.setTag(holder);
view.setClickable(true);
view.setOnClickListener(new OnClickListener(download));
view.setOnLongClickListener(new OnLongClickListener(download));
} else {
holder = (ViewHolder) view.getTag();
}
@ -78,6 +76,8 @@ public class DownloadListAdapter extends BaseAdapter {
int progress = download.getProgress();
int total = gallery.getCount();
view.setOnClickListener(new OnClickListener(download));
view.setOnLongClickListener(new OnLongClickListener(download));
holder.title.setText(gallery.getTitle());
aq.id(holder.cover).image(gallery.getThumbnail(), MEM_CACHE, FILE_CACHE);
holder.progressBar.setMax(total);

2
ehreader/src/main/java/tw/skyarrow/ehreader/adapter/GalleryListAdapter.java

@ -66,7 +66,7 @@ public class GalleryListAdapter extends BaseAdapter {
AQuery aq = new AQuery(view);
int categoryRes = CategoryHelper.getResource(gallery.getCategory());
String meta = context.getResources().getString(categoryRes) + " / " + gallery.getCount() + "P";
String meta = context.getString(categoryRes) + " / " + gallery.getCount() + "P";
holder.title.setText(gallery.getTitle());
holder.meta.setText(meta);

37
ehreader/src/main/java/tw/skyarrow/ehreader/app/ListPreferenceWithSummary.java

@ -0,0 +1,37 @@
package tw.skyarrow.ehreader.app;
import android.content.Context;
import android.preference.ListPreference;
import android.preference.Preference;
import android.util.AttributeSet;
/**
* Created by SkyArrow on 2014/2/3.
*/
// http://stackoverflow.com/a/8004498
public class ListPreferenceWithSummary extends ListPreference {
public ListPreferenceWithSummary(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public ListPreferenceWithSummary(Context context) {
super(context);
init();
}
private void init() {
setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object o) {
preference.setSummary(getEntry());
return true;
}
});
}
@Override
public CharSequence getSummary() {
return super.getEntry();
}
}

8
ehreader/src/main/java/tw/skyarrow/ehreader/service/GalleryDownloadService.java

@ -218,7 +218,7 @@ public class GalleryDownloadService extends IntentService {
isTerminated = true;
builder.setContentText(getResources().getString(R.string.download_paused))
builder.setContentText(getString(R.string.download_paused))
.setProgress(0, 0, false)
.setAutoCancel(true);
@ -311,7 +311,7 @@ public class GalleryDownloadService extends IntentService {
PendingIntent pendingIntent = PendingIntent.getActivity(GalleryDownloadService.this, 0,
intent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentText(getResources().getString(R.string.download_success))
builder.setContentText(getString(R.string.download_success))
.setProgress(0, 0, false)
.setAutoCancel(true)
.setContentIntent(pendingIntent);
@ -324,7 +324,7 @@ public class GalleryDownloadService extends IntentService {
private void fail() {
isTerminated = true;
builder.setContentText(getResources().getString(R.string.download_failed))
builder.setContentText(getString(R.string.download_failed))
.setProgress(0, 0, false)
.setAutoCancel(true);
@ -362,7 +362,7 @@ public class GalleryDownloadService extends IntentService {
.setContentTitle(gallery.getTitle())
.setContentIntent(pendingIntent)
.setProgress(0, 0, true)
.setContentText(getResources().getString(R.string.download_in_progress));
.setContentText(getString(R.string.download_in_progress));
sendNotification();
}

11
ehreader/src/main/java/tw/skyarrow/ehreader/util/SearchHelper.java

@ -5,6 +5,7 @@ import android.app.SearchManager;
import android.app.SearchableInfo;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.SearchView;
import android.view.MenuItem;
@ -34,7 +35,10 @@ public class SearchHelper {
@Override
public boolean onQueryTextSubmit(String s) {
menuItem.collapseActionView();
if (Build.VERSION.SDK_INT >= 14) {
menuItem.collapseActionView();
}
return false;
}
@ -58,7 +62,10 @@ public class SearchHelper {
@Override
public boolean onSuggestionClick(int i) {
menuItem.collapseActionView();
if (Build.VERSION.SDK_INT >= 14) {
menuItem.collapseActionView();
}
return false;
}
}

BIN
ehreader/src/main/res/drawable-hdpi/ic_download.png

Before

Width: 48  |  Height: 48  |  Size: 750 B

After

Width: 48  |  Height: 48  |  Size: 615 B

BIN
ehreader/src/main/res/drawable-hdpi/ic_filter.png

Before

Width: 48  |  Height: 48  |  Size: 951 B

After

Width: 48  |  Height: 48  |  Size: 978 B

BIN
ehreader/src/main/res/drawable-hdpi/ic_pause_all.png

Before

Width: 48  |  Height: 48  |  Size: 1.5 KiB

After

Width: 48  |  Height: 48  |  Size: 1.1 KiB

BIN
ehreader/src/main/res/drawable-hdpi/ic_refresh.png

After

Width: 48  |  Height: 48  |  Size: 1.3 KiB

BIN
ehreader/src/main/res/drawable-hdpi/ic_search.png

Before

Width: 48  |  Height: 48  |  Size: 1.5 KiB

After

Width: 48  |  Height: 48  |  Size: 1.2 KiB

BIN
ehreader/src/main/res/drawable-hdpi/ic_share.png

Before

Width: 48  |  Height: 48  |  Size: 1.1 KiB

After

Width: 48  |  Height: 48  |  Size: 815 B

BIN
ehreader/src/main/res/drawable-hdpi/ic_share_dark.png

Before

Width: 48  |  Height: 48  |  Size: 952 B

After

Width: 48  |  Height: 48  |  Size: 730 B

BIN
ehreader/src/main/res/drawable-hdpi/ic_star.png

Before

Width: 48  |  Height: 48  |  Size: 1.5 KiB

After

Width: 48  |  Height: 48  |  Size: 1.5 KiB

BIN
ehreader/src/main/res/drawable-hdpi/ic_start_all.png

Before

Width: 48  |  Height: 48  |  Size: 1.6 KiB

After

Width: 48  |  Height: 48  |  Size: 1.2 KiB

BIN
ehreader/src/main/res/drawable-hdpi/ic_unstar.png

Before

Width: 48  |  Height: 48  |  Size: 1.2 KiB

After

Width: 48  |  Height: 48  |  Size: 1.1 KiB

BIN
ehreader/src/main/res/drawable-mdpi/ic_download.png

Before

Width: 32  |  Height: 32  |  Size: 433 B

After

Width: 32  |  Height: 32  |  Size: 444 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_filter.png

Before

Width: 32  |  Height: 32  |  Size: 631 B

After

Width: 32  |  Height: 32  |  Size: 646 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_pause_all.png

Before

Width: 32  |  Height: 32  |  Size: 701 B

After

Width: 32  |  Height: 32  |  Size: 707 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_refresh.png

After

Width: 32  |  Height: 32  |  Size: 914 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_search.png

Before

Width: 32  |  Height: 32  |  Size: 914 B

After

Width: 32  |  Height: 32  |  Size: 794 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_share.png

Before

Width: 32  |  Height: 32  |  Size: 526 B

After

Width: 32  |  Height: 32  |  Size: 544 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_share_dark.png

Before

Width: 32  |  Height: 32  |  Size: 473 B

After

Width: 32  |  Height: 32  |  Size: 464 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_star.png

Before

Width: 32  |  Height: 32  |  Size: 883 B

After

Width: 32  |  Height: 32  |  Size: 924 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_start_all.png

Before

Width: 32  |  Height: 32  |  Size: 764 B

After

Width: 32  |  Height: 32  |  Size: 797 B

BIN
ehreader/src/main/res/drawable-mdpi/ic_unstar.png

Before

Width: 32  |  Height: 32  |  Size: 803 B

After

Width: 32  |  Height: 32  |  Size: 752 B

BIN
ehreader/src/main/res/drawable-xhdpi/ic_download.png

Before

Width: 64  |  Height: 64  |  Size: 1.1 KiB

After

Width: 64  |  Height: 64  |  Size: 797 B

BIN
ehreader/src/main/res/drawable-xhdpi/ic_filter.png

Before

Width: 64  |  Height: 64  |  Size: 1.3 KiB

After

Width: 64  |  Height: 64  |  Size: 1.3 KiB

BIN
ehreader/src/main/res/drawable-xhdpi/ic_pause_all.png

Before

Width: 64  |  Height: 64  |  Size: 2.2 KiB

After

Width: 64  |  Height: 64  |  Size: 1.4 KiB

BIN
ehreader/src/main/res/drawable-xhdpi/ic_refresh.png

After

Width: 64  |  Height: 64  |  Size: 1.8 KiB

BIN
ehreader/src/main/res/drawable-xhdpi/ic_search.png

Before

Width: 64  |  Height: 64  |  Size: 2.3 KiB

After

Width: 64  |  Height: 64  |  Size: 1.7 KiB

BIN
ehreader/src/main/res/drawable-xhdpi/ic_share.png

Before

Width: 64  |  Height: 64  |  Size: 1.2 KiB

After

Width: 64  |  Height: 64  |  Size: 1.1 KiB

BIN
ehreader/src/main/res/drawable-xhdpi/ic_share_dark.png

Before

Width: 64  |  Height: 64  |  Size: 1.0 KiB

After

Width: 64  |  Height: 64  |  Size: 936 B

BIN
ehreader/src/main/res/drawable-xhdpi/ic_star.png

Before

Width: 64  |  Height: 64  |  Size: 2.2 KiB

After

Width: 64  |  Height: 64  |  Size: 2.1 KiB

BIN
ehreader/src/main/res/drawable-xhdpi/ic_start_all.png

Before

Width: 64  |  Height: 64  |  Size: 2.4 KiB

After

Width: 64  |  Height: 64  |  Size: 1.6 KiB

BIN
ehreader/src/main/res/drawable-xhdpi/ic_unstar.png

Before

Width: 64  |  Height: 64  |  Size: 1.7 KiB

After

Width: 64  |  Height: 64  |  Size: 1.5 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_download.png

Before

Width: 96  |  Height: 96  |  Size: 1.9 KiB

After

Width: 96  |  Height: 96  |  Size: 1.2 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_filter.png

Before

Width: 96  |  Height: 96  |  Size: 2.0 KiB

After

Width: 96  |  Height: 96  |  Size: 2.0 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_pause_all.png

Before

Width: 96  |  Height: 96  |  Size: 4.3 KiB

After

Width: 96  |  Height: 96  |  Size: 2.4 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_refresh.png

After

Width: 96  |  Height: 96  |  Size: 2.9 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_search.png

Before

Width: 96  |  Height: 96  |  Size: 4.3 KiB

After

Width: 96  |  Height: 96  |  Size: 2.5 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_share.png

Before

Width: 96  |  Height: 96  |  Size: 3.2 KiB

After

Width: 96  |  Height: 96  |  Size: 1.7 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_share_dark.png

Before

Width: 96  |  Height: 96  |  Size: 2.5 KiB

After

Width: 96  |  Height: 96  |  Size: 1.6 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_star.png

Before

Width: 96  |  Height: 96  |  Size: 4.2 KiB

After

Width: 96  |  Height: 96  |  Size: 3.4 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_start_all.png

Before

Width: 96  |  Height: 96  |  Size: 4.7 KiB

After

Width: 96  |  Height: 96  |  Size: 2.9 KiB

BIN
ehreader/src/main/res/drawable-xxhdpi/ic_unstar.png

Before

Width: 96  |  Height: 96  |  Size: 3.2 KiB

After

Width: 96  |  Height: 96  |  Size: 2.4 KiB

2
ehreader/src/main/res/layout/activity_gallery.xml

@ -72,7 +72,7 @@
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:text="@string/read"/>
android:text="@string/read_btn"/>
<LinearLayout
android:id="@+id/meta_box"
android:layout_width="match_parent"

4
ehreader/src/main/res/layout/activity_pref.xml

@ -0,0 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

2
ehreader/src/main/res/layout/fragment_image_search.xml

@ -64,7 +64,7 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorHint"
android:text="@string/uploading"
android:text="@string/image_search_uploading"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</RelativeLayout>

6
ehreader/src/main/res/layout/preference_list_content.xml

@ -0,0 +1,6 @@
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawSelectorOnTop="false"
android:scrollbarAlwaysDrawVerticalTrack="true"/>

2
ehreader/src/main/res/menu/main.xml

@ -18,5 +18,5 @@
<item
android:id="@+id/menu_settings"
android:title="@string/menu_settings"
app:showAsAction="never" />
app:showAsAction="never"/>
</menu>

8
ehreader/src/main/res/menu/main_web.xml

@ -0,0 +1,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_refresh"
android:title="@string/menu_refresh"
android:icon="@drawable/ic_refresh"
app:showAsAction="always"/>
</menu>

43
ehreader/src/main/res/raw/license.html

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Open source license</title>
<style>
pre {
background: #eee;
padding: 10px;
word-wrap: break-word;
}
</style>
</head>
<body>
<p>E-Hentai Reader is licensed under the Apache License 2.0.</p>
<pre>
Copyright 2014 Tommy Chen
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.
</pre>
<p>This application uses the following libraries:</p>
<ul>
<li>Android Support Library v4</li>
<li>Android Support Library v7 appcompat</li>
<li>Android Query</li>
<li>PhotoView</li>
<li>GreenDAO</li>
<li>EventBus</li>
<li>Apache HttpComponents</li>
<li>Butter Knife</li>
</ul>
</body>
</html>

78
ehreader/src/main/res/values-zh-rTW/strings.xml

@ -1,33 +1,13 @@
<resources>
// App info
<string name="app_name">E-Hentai 閱讀器</string>
<string name="version">0.1</string>
<string name="menu_search">搜尋</string>
// Menu
<string name="menu_settings">設定</string>
<string name="menu_star">收藏</string>
<string name="menu_unstar">取消收藏</string>
<string name="menu_download">下載</string>
<string name="menu_image_search">圖片搜尋</string>
<string name="menu_share">分享</string>
<string name="menu_open_in_browser">以瀏覽器開啟</string>
<string name="menu_start_all">全部開始</string>
<string name="menu_pause_all">全部暫停</string>
<string name="menu_add_bookmark">新增書籤</string>
<string name="menu_remove_bookmark">移除書籤</string>
<string name="menu_bookmark_list">書籤清單</string>
<string name="menu_filter">過濾</string>
<string name="label_image_search">圖片搜尋</string>
<string name="label_settings">設定</string>
<string name="search_hint">Search</string>
<string-array name="main_tabs">
<item>藝廊</item>
<item>收藏</item>
<item>歷史</item>
<item>下載</item>
</string-array>
// Categories
<string name="category_doujinshi">同人誌</string>
<string name="category_manga">漫畫</string>
<string name="category_artistcg">作家 CG</string>
@ -39,55 +19,11 @@
<string name="category_asianporn">亞洲色情</string>
<string name="category_misc">其他</string>
<string name="notification_starred">已收藏</string>
<string name="notification_unstarred">已取消收藏</string>
<string name="notification_bookmark_added">書籤已新增</string>
<string name="notification_bookmark_removed">書籤已移除</string>
<string name="meta_tags">標籤:</string>
<string name="meta_uploader">上傳者:</string>
<string name="meta_created">建立時間:</string>
<string name="read">閱讀</string>
<string name="error_no_results">找不到相簿,請試試其他關鍵字。</string>
// Error
<string name="error_no_network">網路無法連線,請檢查您的網路連線。</string>
<string name="error_no_starred">您收藏的所有相簿都在這。</string>
<string name="error_no_more_results">找不到更多相簿了。</string>
<string name="error_no_download">下載佇列為空,試著下載一些相簿吧。</string>
<string name="error_no_history">沒有記錄。</string>
<string name="image_search_hint">選擇圖片以搜尋擁有該圖片的相簿。</string>
<string name="image_search_select">選擇</string>
<string name="image_search_similar">搜尋相似圖片</string>
<string name="image_search_only_cover">僅搜尋封面</string>
<string name="uploading">上傳中&#8230;</string>
<string name="download_confirm">此相簿總共需要 %s,您確定要下載嗎?</string>
<string name="download_again_confirm">此相簿已經下載過了,您要再次下載嗎?</string>
<string name="download_again">再次下載</string>
// Common buttons
<string name="retry">重試</string>
<string name="ok">確定</string>
<string name="cancel">取消</string>
<string-array name="download_context_menu">
<item>開啟</item>
<item>重新下載</item>
<item>刪除</item>
</string-array>
<string name="retry">重試</string>
<string name="bookmark_list">書籤清單</string>
<string name="bookmark_list_item">第 %d 頁</string>
<string name="no_bookmarks">沒有書籤。</string>
<string name="download_started">下載已開始</string>
<string name="download_in_progress">正在下載</string>
<string name="download_paused">下載已暫停</string>
<string name="download_failed">下載失敗</string>
<string name="download_success">下載成功</string>
<string name="download_pending">正在等待下載</string>
<string name="delete_gallery_title">刪除相簿</string>
<string name="delete_gallery_msg">您要刪除已下載的相簿嗎?此操作無法復原。</string>
<string name="deleteing">刪除中&#8230;</string>
</resources>

27
ehreader/src/main/res/values-zh-rTW/strings_download.xml

@ -0,0 +1,27 @@
<resources>
// Menu
<string name="menu_start_all">全部開始</string>
<string name="menu_pause_all">全部暫停</string>
<string name="download_confirm">此相簿總共需要 %s,您確定要下載嗎?</string>
<string name="download_again_confirm">此相簿已經下載過了,您要再次下載嗎?</string>
<string name="download_again">再次下載</string>
<string-array name="download_context_menu">
<item>開啟</item>
<item>重新下載</item>
<item>刪除</item>
</string-array>
<string name="download_started">下載已開始</string>
<string name="download_in_progress">正在下載</string>
<string name="download_paused">下載已暫停</string>
<string name="download_failed">下載失敗</string>
<string name="download_success">下載成功</string>
<string name="download_pending">正在等候下載</string>
// Delete gallery
<string name="delete_gallery_title">刪除相簿</string>
<string name="delete_gallery_msg">您要刪除已下載的相簿嗎?此操作無法復原。</string>
<string name="gallery_deleting">刪除中&#8230;</string>
</resources>

18
ehreader/src/main/res/values-zh-rTW/strings_gallery.xml

@ -0,0 +1,18 @@
<resources>
// Menu
<string name="menu_star">收藏</string>
<string name="menu_unstar">取消收藏</string>
<string name="menu_download">下載</string>
<string name="menu_open_in_browser">以瀏覽器開啟</string>
// Meta
<string name="meta_tags">標籤:</string>
<string name="meta_uploader">上傳者:</string>
<string name="meta_created">建立時間:</string>
<string name="read_btn">閱讀</string>
// Notification
<string name="notification_starred">已收藏</string>
<string name="notification_unstarred">已取消收藏</string>
</resources>

20