From 74c1c2144f53626fa301c1d520e31ba48ac7c7a4 Mon Sep 17 00:00:00 2001 From: seven332 Date: Tue, 28 Jul 2015 22:31:05 +0800 Subject: [PATCH] Add download settings --- .../java/com/hippo/ehviewer/AppConfig.java | 5 + .../ehviewer/ui/scene/MainSettingsScene.java | 5 + .../ui/scene/preference/DirPickScene.java | 175 ++++++++++++++++++ .../preference/DownloadSettingsScene.java | 104 +++++++++++ .../com/hippo/ehviewer/util/Settings.java | 70 ++++++- .../java/com/hippo/widget/DirExplorer.java | 173 +++++++++++++++++ .../res/drawable/ic_download_theme_accent.xml | 40 ++++ app/src/main/res/drawable/ic_folder.xml | 40 ++++ app/src/main/res/layout/item_dir_explorer.xml | 24 +++ app/src/main/res/layout/scene_dir_pick.xml | 86 +++++++++ app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values/pathdata.xml | 1 + app/src/main/res/values/strings.xml | 15 +- 13 files changed, 730 insertions(+), 10 deletions(-) create mode 100644 app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DirPickScene.java create mode 100644 app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DownloadSettingsScene.java create mode 100644 app/src/main/java/com/hippo/widget/DirExplorer.java create mode 100644 app/src/main/res/drawable/ic_download_theme_accent.xml create mode 100644 app/src/main/res/drawable/ic_folder.xml create mode 100644 app/src/main/res/layout/item_dir_explorer.xml create mode 100644 app/src/main/res/layout/scene_dir_pick.xml diff --git a/app/src/main/java/com/hippo/ehviewer/AppConfig.java b/app/src/main/java/com/hippo/ehviewer/AppConfig.java index f4a2d0b6d..5abf213a7 100644 --- a/app/src/main/java/com/hippo/ehviewer/AppConfig.java +++ b/app/src/main/java/com/hippo/ehviewer/AppConfig.java @@ -29,6 +29,7 @@ public final class AppConfig { private static final String APP_DIRNAME = "EhViewer-Test"; private static final String CRASH_DIRNAME = "crash"; private static final String DOWNLOAD_DIRNAME = "download"; + private static final String ARCHIVE_DIRNAME = "archive"; private static final String TORRENT_DIRNAME = "torrent"; public static @Nullable @@ -58,6 +59,10 @@ public final class AppConfig { return getFileInAppDir(DOWNLOAD_DIRNAME); } + public static @Nullable File getArchiveDir() { + return getFileInAppDir(ARCHIVE_DIRNAME); + } + public static @Nullable File getTorrentDir() { return getFileInAppDir(TORRENT_DIRNAME); } diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/MainSettingsScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/MainSettingsScene.java index 80f275d3f..03c27b6a5 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/MainSettingsScene.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/MainSettingsScene.java @@ -23,6 +23,7 @@ import com.hippo.ehviewer.R; import com.hippo.ehviewer.ui.ContentActivity; import com.hippo.ehviewer.ui.scene.preference.AdvanceSettingsScene; import com.hippo.ehviewer.ui.scene.preference.DisplaySettingsScene; +import com.hippo.ehviewer.ui.scene.preference.DownloadSettingsScene; import com.hippo.ehviewer.ui.scene.preference.EHSettingsScene; import com.hippo.scene.preference.PreferenceHeader; import com.hippo.scene.preference.PreferenceHeaderScene; @@ -51,6 +52,10 @@ public final class MainSettingsScene extends PreferenceHeaderScene { R.drawable.ic_eh_theme_accent, R.string.settings_eh, EHSettingsScene.class), + newPreferenceHeader( + R.drawable.ic_download_theme_accent, + R.string.settings_download, + DownloadSettingsScene.class), newPreferenceHeader( R.drawable.ic_black_mesa_theme_accent, R.string.settings_advance, diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DirPickScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DirPickScene.java new file mode 100644 index 000000000..16ffee5da --- /dev/null +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DirPickScene.java @@ -0,0 +1,175 @@ +/* + * Copyright 2015 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.ui.scene.preference; + +import android.annotation.TargetApi; +import android.app.Activity; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Toast; + +import com.hippo.ehviewer.R; +import com.hippo.ehviewer.util.Settings; +import com.hippo.rippleold.RippleSalon; +import com.hippo.scene.Announcer; +import com.hippo.scene.AppbarScene; +import com.hippo.scene.Scene; +import com.hippo.scene.SimpleDialog; +import com.hippo.unifile.UniFile; +import com.hippo.widget.DirExplorer; +import com.hippo.yorozuya.ViewUtils; + +import java.io.File; + +public class DirPickScene extends AppbarScene implements View.OnClickListener, + Scene.ActivityResultListener { + + public static final String ACTION_IMAGE_DOWNLOAD_LOCATION = "com.hippo.ehviewer.dirpick.action.IMAGE_DOWNLOAD_LOCATION"; + public static final String ACTION_ARCHIVE_DOWNLOAD_LOCATION = "com.hippo.ehviewer.dirpick.action.ARCHIVE_DOWNLOAD_LOCATION"; + + private String mAction; + + private View mDocument; + private View mDocumentHelp; + private View mOk; + private DirExplorer mDirExplorer; + + private int mDirExplorerOriginalPaddingBottom; + + private File getCurrentFile() { + UniFile dir = null; + if (ACTION_IMAGE_DOWNLOAD_LOCATION.equals(mAction)) { + dir = Settings.getImageDownloadLocation(); + } else if (ACTION_ARCHIVE_DOWNLOAD_LOCATION.equals(mAction)) { + dir = Settings.getArchiveDownloadLocation(); + } + if (dir != null) { + Uri uri = dir.getUri(); + if (UniFile.isFileUri(uri)) { + return new File(uri.getPath()); + } + } + return null; + } + + @Override + protected void onCreate(boolean rebirth) { + super.onCreate(rebirth); + + setContentView(R.layout.scene_dir_pick); + setTitle(R.string.dir_pick); + setIcon(R.drawable.ic_arrow_left_dark); + + Announcer announcer = getAnnouncer(); + if (announcer != null) { + mAction = announcer.getAction(); + } + + ViewGroup documentGroup = (ViewGroup) findViewById(R.id.document_group); + mDocument = documentGroup.findViewById(R.id.document); + mDocumentHelp = documentGroup.findViewById(R.id.document_help); + mOk = findViewById(R.id.ok); + mDirExplorer = (DirExplorer) findViewById(R.id.dir_explorer); + + mDirExplorerOriginalPaddingBottom = mDirExplorer.getPaddingBottom(); + mDirExplorer.setHasFixedSize(true); + mDirExplorer.setClipToPadding(false); + File file = getCurrentFile(); + if (file != null) { + mDirExplorer.setCurrentFile(file); + } + + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + documentGroup.setVisibility(View.GONE); + } + + RippleSalon.addRipple(mDocument, false); + RippleSalon.addRipple(mOk, false); + + mDocument.setOnClickListener(this); + mDocumentHelp.setOnClickListener(this); + mOk.setOnClickListener(this); + } + + @Override + protected void onGetFitPaddingBottom(int b) { + super.onGetFitPaddingBottom(b); + + mDirExplorer.setPadding(mDirExplorer.getPaddingLeft(), + mDirExplorer.getPaddingTop(), mDirExplorer.getPaddingRight(), + mDirExplorerOriginalPaddingBottom + b); + } + + @Override + public void onIconClick() { + finish(); + } + + private void save(UniFile uniFile) { + if (ACTION_IMAGE_DOWNLOAD_LOCATION.equals(mAction)) { + Settings.putImageDownloadLocation(uniFile); + } else if (ACTION_ARCHIVE_DOWNLOAD_LOCATION.equals(mAction)) { + Settings.putArchiveDownloadLocation(uniFile); + } + } + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void onClick(View v) { + if (v == mDocument) { + Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); + startActivityForResult(intent, this); + } else if (v == mDocumentHelp) { + int[] location = new int[2]; + ViewUtils.getCenterInAncestor(mDocumentHelp, location, getSceneView()); + new SimpleDialog.Builder(getStageActivity()).setTitle(R.string.document) + .setMessage(R.string.document_help) + .setStartPoint(location[0], location[1]) + .show(this); + } else if (v == mOk) { + UniFile dir = UniFile.fromFile(mDirExplorer.getCurrentFile()); + if (dir == null) { + Toast.makeText(getStageActivity(), R.string.em_cant_get_folder, Toast.LENGTH_SHORT).show(); + } else if (!dir.canWrite()) { + Toast.makeText(getStageActivity(), R.string.em_cant_write_folder, Toast.LENGTH_SHORT).show(); + } else { + save(dir); + finish(); + } + } + } + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void onGetResult(int resultCode, Intent data) { + if (resultCode == Activity.RESULT_OK) { + Uri treeUri = data.getData(); + getStageActivity().getContentResolver().takePersistableUriPermission( + treeUri, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); + UniFile dir = UniFile.fromTreeUri(getStageActivity(), treeUri); + if (dir != null) { + save(dir); + finish(); + } else { + Toast.makeText(getStageActivity(), R.string.em_cant_parse_document_uri, Toast.LENGTH_SHORT).show(); + } + } + } +} diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DownloadSettingsScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DownloadSettingsScene.java new file mode 100644 index 000000000..a580fd38b --- /dev/null +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/preference/DownloadSettingsScene.java @@ -0,0 +1,104 @@ +/* + * Copyright 2015 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.ui.scene.preference; + +import android.content.res.Resources; + +import com.hippo.ehviewer.R; +import com.hippo.ehviewer.util.Settings; +import com.hippo.scene.Announcer; +import com.hippo.scene.preference.Preference; +import com.hippo.scene.preference.PreferenceScene; +import com.hippo.scene.preference.PreferenceSet; +import com.hippo.unifile.UniFile; + +public class DownloadSettingsScene extends PreferenceScene implements Preference.OnClickListener { + + private static final String KEY_IMAGE_DOWNLOAD_LOACTION = "image_download_location"; + private static final String KEY_ARCHIVE_DOWNLOAD_LOACTION = "archive_download_location"; + + @Override + protected void onCreate(boolean rebirth) { + super.onCreate(rebirth); + + setTitle(R.string.settings_download); + setIcon(R.drawable.ic_arrow_left_dark); + + setPreferenceSet(getPreferenceSet()); + } + + @Override + public void onIconClick() { + finish(); + } + + private PreferenceSet[] getPreferenceSet() { + Resources resources = getStageActivity().getResources(); + + String imageSummary; + UniFile imageDir = Settings.getImageDownloadLocation(); + if (imageDir == null) { + imageSummary = resources.getString(R.string.unknown); + } else { + imageSummary = imageDir.getUri().getPath(); + } + + Preference imagePreference = new Preference( + KEY_IMAGE_DOWNLOAD_LOACTION, + resources.getString(R.string.settings_image_download_location), + imageSummary); + imagePreference.setOnClickListener(this); + + String archiveSummary; + UniFile archiveDir = Settings.getImageDownloadLocation(); + if (archiveDir == null) { + archiveSummary = resources.getString(R.string.unknown); + } else { + archiveSummary = archiveDir.getUri().getPath(); + } + + Preference archivePreference = new Preference( + KEY_ARCHIVE_DOWNLOAD_LOACTION, + resources.getString(R.string.settings_archive_download_location), + archiveSummary); + archivePreference.setOnClickListener(this); + + PreferenceSet preferenceSet = new PreferenceSet(); + preferenceSet.setPreferenceList(new Preference[] { + imagePreference, + archivePreference + }); + + return new PreferenceSet[] { + preferenceSet + }; + } + + @Override + public boolean onClick(Preference preference) { + String key = preference.getKey(); + switch (key) { + case KEY_IMAGE_DOWNLOAD_LOACTION: + Announcer announcer = new Announcer(); + announcer.setAction(DirPickScene.ACTION_IMAGE_DOWNLOAD_LOCATION); + startScene(DirPickScene.class, announcer); + return true; + default: + return true; + } + } +} diff --git a/app/src/main/java/com/hippo/ehviewer/util/Settings.java b/app/src/main/java/com/hippo/ehviewer/util/Settings.java index 1fdd9a807..61f62d7c2 100644 --- a/app/src/main/java/com/hippo/ehviewer/util/Settings.java +++ b/app/src/main/java/com/hippo/ehviewer/util/Settings.java @@ -18,6 +18,7 @@ package com.hippo.ehviewer.util; import android.content.Context; import android.content.SharedPreferences; +import android.net.Uri; import android.preference.PreferenceManager; import com.hippo.ehviewer.AppConfig; @@ -25,16 +26,15 @@ import com.hippo.ehviewer.BuildConfig; import com.hippo.ehviewer.client.EhConfig; import com.hippo.ehviewer.client.EhUrl; import com.hippo.unifile.UniFile; -import com.hippo.yorozuya.FileUtils; - -import java.io.File; public final class Settings { + private static Context sContext; private static SharedPreferences sSettingsPre; public static void initialize(Context context) { - sSettingsPre = PreferenceManager.getDefaultSharedPreferences(context); + sContext = context.getApplicationContext(); + sSettingsPre = PreferenceManager.getDefaultSharedPreferences(sContext); } public static boolean getBoolean(String key, boolean defValue) { @@ -193,11 +193,65 @@ public final class Settings { return getInt(KEY_PREVIEW_SIZE, DEFAULT_PREVIEW_SIZE); } + public static final String KEY_IMAGE_LOCATION_SCHEME = "image_scheme"; + public static final String KEY_IMAGE_LOCATION_AUTHORITY = "image_authority"; + public static final String KEY_IMAGE_LOCATION_PATH = "image_path"; + public static final String KEY_IMAGE_LOCATION_QUERY = "image_query"; + public static final String KEY_IMAGE_LOCATION_FRAGMENT = "image_fragment"; + public static final String KEY_ARCHIVE_LOCATION_SCHEME = "archive_scheme"; + public static final String KEY_ARCHIVE_LOCATION_AUTHORITY = "archive_authority"; + public static final String KEY_ARCHIVE_LOCATION_PATH = "archive_path"; + public static final String KEY_ARCHIVE_LOCATION_QUERY = "archive_query"; + public static final String KEY_ARCHIVE_LOCATION_FRAGMENT = "archive_fragment"; - public static UniFile getDownloadPath() { - File file = AppConfig.getDownloadDir(); - FileUtils.ensureDirectory(file); - return UniFile.fromFile(file); + public static UniFile getImageDownloadLocation() { + UniFile dir = null; + try { + Uri.Builder builder = new Uri.Builder(); + builder.scheme(getString(KEY_IMAGE_LOCATION_SCHEME, null)); + builder.encodedAuthority(getString(KEY_IMAGE_LOCATION_AUTHORITY, null)); + builder.encodedPath(getString(KEY_IMAGE_LOCATION_PATH, null)); + builder.encodedQuery(getString(KEY_IMAGE_LOCATION_QUERY, null)); + builder.encodedFragment(getString(KEY_IMAGE_LOCATION_FRAGMENT, null)); + dir = UniFile.fromUri(sContext, builder.build()); + } catch (Exception e) { + e.printStackTrace(); + } + return dir != null ? dir : UniFile.fromFile(AppConfig.getDownloadDir()); + } + + public static void putImageDownloadLocation(UniFile location) { + Uri uri = location.getUri(); + putString(KEY_IMAGE_LOCATION_SCHEME, uri.getScheme()); + putString(KEY_IMAGE_LOCATION_AUTHORITY, uri.getEncodedAuthority()); + putString(KEY_IMAGE_LOCATION_PATH, uri.getEncodedPath()); + putString(KEY_IMAGE_LOCATION_QUERY, uri.getEncodedQuery()); + putString(KEY_IMAGE_LOCATION_FRAGMENT, uri.getEncodedFragment()); + } + + public static UniFile getArchiveDownloadLocation() { + UniFile dir = null; + try { + Uri.Builder builder = new Uri.Builder(); + builder.scheme(getString(KEY_ARCHIVE_LOCATION_SCHEME, null)); + builder.encodedAuthority(getString(KEY_ARCHIVE_LOCATION_AUTHORITY, null)); + builder.encodedPath(getString(KEY_ARCHIVE_LOCATION_PATH, null)); + builder.encodedQuery(getString(KEY_ARCHIVE_LOCATION_QUERY, null)); + builder.encodedFragment(getString(KEY_ARCHIVE_LOCATION_FRAGMENT, null)); + dir = UniFile.fromUri(sContext, builder.build()); + } catch (Exception e) { + e.printStackTrace(); + } + return dir != null ? dir : UniFile.fromFile(AppConfig.getDownloadDir()); + } + + public static void putArchiveDownloadLocation(UniFile location) { + Uri uri = location.getUri(); + putString(KEY_ARCHIVE_LOCATION_SCHEME, uri.getScheme()); + putString(KEY_ARCHIVE_LOCATION_AUTHORITY, uri.getEncodedAuthority()); + putString(KEY_ARCHIVE_LOCATION_PATH, uri.getEncodedPath()); + putString(KEY_ARCHIVE_LOCATION_QUERY, uri.getEncodedQuery()); + putString(KEY_ARCHIVE_LOCATION_FRAGMENT, uri.getEncodedFragment()); } /****** Advance ******/ diff --git a/app/src/main/java/com/hippo/widget/DirExplorer.java b/app/src/main/java/com/hippo/widget/DirExplorer.java new file mode 100644 index 000000000..62a19e2a4 --- /dev/null +++ b/app/src/main/java/com/hippo/widget/DirExplorer.java @@ -0,0 +1,173 @@ +/* + * Copyright 2015 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.widget; + +import android.content.Context; +import android.os.Environment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.hippo.ehviewer.R; +import com.hippo.widget.recyclerview.EasyRecyclerView; +import com.hippo.widget.recyclerview.LinearDividerItemDecoration; +import com.hippo.yorozuya.LayoutUtils; + +import java.io.File; +import java.io.FileFilter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +public class DirExplorer extends EasyRecyclerView implements EasyRecyclerView.OnItemClickListener { + + private static final DirFilter DIR_FILTER = new DirFilter(); + private static final FileSort FILE_SORT = new FileSort(); + + private static final File PARENT_DIR = null; + private static final String PARENT_DIR_NAME = ".."; + + private File mCurrentFile; + private List mFiles = new ArrayList<>(); + + private DirAdapter mAdapter; + + public DirExplorer(Context context) { + super(context); + init(context); + } + + public DirExplorer(Context context, AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public DirExplorer(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + init(context); + } + + private void init(Context context) { + mAdapter = new DirAdapter(); + setAdapter(mAdapter); + setLayoutManager(new LinearLayoutManager(context)); + LinearDividerItemDecoration decoration = new LinearDividerItemDecoration( + LinearDividerItemDecoration.VERTICAL, context.getResources().getColor(R.color.divider_light), + LayoutUtils.dp2pix(context, 1)); + decoration.setShowLastDivider(true); + decoration.setPadding(context.getResources().getDimensionPixelOffset(R.dimen.keyline_margin)); + addItemDecoration(decoration); + setOnItemClickListener(this); + + mCurrentFile = Environment.getExternalStorageDirectory(); + if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) + || mCurrentFile == null) { + mCurrentFile = new File("/"); + } + updateFileList(); + } + + private void updateFileList() { + File[] files = mCurrentFile.listFiles(DIR_FILTER); + + mFiles.clear(); + if (mCurrentFile.getParent() != null) { + mFiles.add(PARENT_DIR); + } + if (files != null) { + Collections.addAll(mFiles, files); + } + // sort + Collections.sort(mFiles, FILE_SORT); + } + + public File getCurrentFile() { + return mCurrentFile; + } + + public void setCurrentFile(File file) { + if (file != null && file.isDirectory()) { + mCurrentFile = file; + updateFileList(); + mAdapter.notifyDataSetChanged(); + } + } + + @Override + public boolean onItemClick(EasyRecyclerView parent, View view, int position, long id) { + File file = mFiles.get(position); + if (file == PARENT_DIR) { + file = mCurrentFile.getParentFile(); + } + setCurrentFile(file); + return true; + } + + private class DirHolder extends RecyclerView.ViewHolder { + + public TextView textView; + + public DirHolder(View itemView) { + super(itemView); + textView = (TextView) itemView; + } + } + + private class DirAdapter extends RecyclerView.Adapter { + + @Override + public DirHolder onCreateViewHolder(ViewGroup parent, int viewType) { + return new DirHolder( LayoutInflater.from(getContext()).inflate(R.layout.item_dir_explorer, parent, false)); + } + + @Override + public void onBindViewHolder(DirHolder holder, int position) { + File file = mFiles.get(position); + holder.textView.setText(file == PARENT_DIR ? PARENT_DIR_NAME : file.getName()); + } + + @Override + public int getItemCount() { + return mFiles.size(); + } + } + + static class DirFilter implements FileFilter { + @Override + public boolean accept(File pathname) { + return pathname.isDirectory(); + } + } + + static class FileSort implements Comparator { + @Override + public int compare(File lhs, File rhs) { + if (lhs == null) { + return Integer.MIN_VALUE; + } else if (rhs == null) { + return Integer.MAX_VALUE; + } else { + return lhs.getName().compareToIgnoreCase(rhs.getName()); + } + } + } +} diff --git a/app/src/main/res/drawable/ic_download_theme_accent.xml b/app/src/main/res/drawable/ic_download_theme_accent.xml new file mode 100644 index 000000000..abeb55748 --- /dev/null +++ b/app/src/main/res/drawable/ic_download_theme_accent.xml @@ -0,0 +1,40 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_folder.xml b/app/src/main/res/drawable/ic_folder.xml new file mode 100644 index 000000000..f8e51cce2 --- /dev/null +++ b/app/src/main/res/drawable/ic_folder.xml @@ -0,0 +1,40 @@ + + + + + + + diff --git a/app/src/main/res/layout/item_dir_explorer.xml b/app/src/main/res/layout/item_dir_explorer.xml new file mode 100644 index 000000000..08a69e069 --- /dev/null +++ b/app/src/main/res/layout/item_dir_explorer.xml @@ -0,0 +1,24 @@ + + + diff --git a/app/src/main/res/layout/scene_dir_pick.xml b/app/src/main/res/layout/scene_dir_pick.xml new file mode 100644 index 000000000..aa538bb62 --- /dev/null +++ b/app/src/main/res/layout/scene_dir_pick.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0d0d98fe3..ebf426038 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -117,7 +117,7 @@ EH 源 日文标题 - 尝试显示日文标题。这可能会花费更多时间 + 尝试显示日文标题 显示默认标题 排除语言 在列表与搜索中隐藏指定语言画廊 diff --git a/app/src/main/res/values/pathdata.xml b/app/src/main/res/values/pathdata.xml index f3d794395..bebe0a722 100644 --- a/app/src/main/res/values/pathdata.xml +++ b/app/src/main/res/values/pathdata.xml @@ -41,5 +41,6 @@ M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M6,20H15L18,20V12L14,16L12,14L6,20M8,9A2,2 0 0,0 6,11A2,2 0 0,0 8,13A2,2 0 0,0 10,11A2,2 0 0,0 8,9Z + M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9786c7379..4551728ab 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -141,7 +141,7 @@ exhentai.org lofi.e-hentai.org Japanese title - Try to show japanese title. It may takes more time + Try to show japanese title Show default title Excluded languages Hide galleries in certain languages from the gallery list and searches @@ -149,6 +149,10 @@ Normal Large + Download + Image download location + Archive download location + Advance Show application stats Show application stats at the top-right corner of the screen @@ -165,6 +169,13 @@ Translated Rewrite + + Pick folder + Can\'t get folder + Can\'t write to this folder + Can\'t parse document uri + Lollipop provides an API to write to secondary external storage devices, namely SD card. If you want to set download location to SD card, click the \"DOCUMENT\" button. + Japanese English Chinese @@ -213,4 +224,6 @@ Comments Info + Document +