Improve settings

This commit is contained in:
seven332 committed 2016-03-01 17:12:35 +08:00
1 parent da905f2a4f
commit b4f9e77a76
19 files changed
+849 -5

No files matched your search

+6 -1
View File
@@ -67,11 +67,16 @@
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme"/>
<activity
android:name="com.hippo.ehviewer.ui.DirPickerActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.NoActionBar"
android:label="@string/dir_picker"/>
<service
android:name="com.hippo.ehviewer.download.DownloadService"
android:icon="@mipmap/ic_launcher"
android:label="@string/download"/>
</application>
</manifest>
@@ -259,7 +259,7 @@ public class Settings {
return dir != null ? dir : UniFile.fromFile(AppConfig.getDefaultDownloadDir());
}
public static void putImageSaveLocation(@NonNull UniFile location) {
public static void putDownloadLocation(@NonNull UniFile location) {
Uri uri = location.getUri();
putString(KEY_DOWNLOAD_SAVE_SCHEME, uri.getScheme());
putString(KEY_DOWNLOAD_SAVE_AUTHORITY, uri.getEncodedAuthority());
@@ -0,0 +1,106 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.ui;
import android.annotation.TargetApi;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.hippo.ehviewer.R;
import com.hippo.rippleold.RippleSalon;
import com.hippo.widget.DirExplorer;
import java.io.File;
public class DirPickerActivity extends ToolbarActivity
implements View.OnClickListener, DirExplorer.OnChangeDirListener {
public static final String KEY_FILE_URI = "file_uri";
private TextView mPath;
private DirExplorer mDirExplorer;
private View mOk;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dir_picker);
setNavigationIcon(R.drawable.v_arrow_left_dark_x24);
mPath = (TextView) findViewById(R.id.path);
mDirExplorer = (DirExplorer) findViewById(R.id.dir_explorer);
mOk = findViewById(R.id.ok);
File file = null;
Intent intent = getIntent();
if (intent != null) {
Uri fileUri = intent.getParcelableExtra(KEY_FILE_URI);
if (fileUri != null) {
file = new File(fileUri.getPath());
}
}
mDirExplorer.setCurrentFile(file);
mDirExplorer.setOnChangeDirListener(this);
RippleSalon.addRipple(mOk, false);
mOk.setOnClickListener(this);
mPath.setText(mDirExplorer.getCurrentFile().getPath());
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onClick(@NonNull View v) {
if (mOk == v) {
File file = mDirExplorer.getCurrentFile();
if (!file.canWrite()) {
Toast.makeText(this, R.string.directory_not_writable, Toast.LENGTH_SHORT).show();
} else {
Intent intent = new Intent();
intent.setData(Uri.fromFile(file));
setResult(RESULT_OK, intent);
finish();
}
}
}
@Override
public void onChangeDir(File dir) {
mPath.setText(dir.getPath());
}
}
@@ -34,6 +34,8 @@ import android.widget.ListAdapter;
import com.hippo.app.AppCompatPreferenceActivity;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.ui.fragment.AboutFragment;
import com.hippo.ehviewer.ui.fragment.DownloadFragment;
import com.hippo.ehviewer.ui.fragment.EhFragment;
import com.hippo.ehviewer.ui.fragment.ReadFragment;
import com.hippo.util.DrawableManager;
@@ -48,11 +50,13 @@ public final class SettingsActivity extends AppCompatPreferenceActivity {
private static final String[] ENTRY_FRAGMENTS = {
EhFragment.class.getName(),
ReadFragment.class.getName(),
DownloadFragment.class.getName(),
AboutFragment.class.getName(),
};
private class FakeLayoutInflater extends LayoutInflater {
private LayoutInflater mInflater;
private final LayoutInflater mInflater;
protected FakeLayoutInflater(LayoutInflater inflater) {
super(null);
@@ -142,7 +146,6 @@ public final class SettingsActivity extends AppCompatPreferenceActivity {
replaceHeaderLayoutResId();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
@@ -0,0 +1,66 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.ui;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
import com.hippo.ehviewer.R;
public class ToolbarActivity extends AppCompatActivity{
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(R.layout.activity_toolbar);
getLayoutInflater().inflate(layoutResID, (ViewGroup) findViewById(R.id.content_panel), true);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
}
@Override
public void setContentView(View view) {
super.setContentView(R.layout.activity_toolbar);
((ViewGroup) findViewById(R.id.content_panel)).addView(view);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
super.setContentView(R.layout.activity_toolbar);
((ViewGroup) findViewById(R.id.content_panel)).addView(view, params);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
}
public void setNavigationIcon(@DrawableRes int resId) {
View toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
((Toolbar) toolbar).setNavigationIcon(resId);
}
}
public void setNavigationIcon(@Nullable Drawable icon) {
View toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
((Toolbar) toolbar).setNavigationIcon(icon);
}
}
}
@@ -0,0 +1,31 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.ui.fragment;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import com.hippo.ehviewer.R;
public class AboutFragment extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.about_settings);
}
}
@@ -0,0 +1,178 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.ui.fragment;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.widget.Toast;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
import com.hippo.ehviewer.ui.DirPickerActivity;
import com.hippo.unifile.UniFile;
public class DownloadFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener {
public static final int REQUEST_CODE_PICK_IMAGE_DIR = 0;
public static final int REQUEST_CODE_PICK_IMAGE_DIR_L = 1;
public static final String KEY_DOWNLOAD_LOCATION = "download_location";
private @Nullable Preference mDownloadLocation;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.download_settings);
mDownloadLocation = findPreference(KEY_DOWNLOAD_LOCATION);
onUpdateDownloadLocation();
if (mDownloadLocation != null) {
mDownloadLocation.setOnPreferenceClickListener(this);
}
}
public void onUpdateDownloadLocation() {
UniFile file = Settings.getDownloadLocation();
if (mDownloadLocation != null) {
if (file != null) {
mDownloadLocation.setSummary(file.getUri().toString());
} else {
mDownloadLocation.setSummary(R.string.settings_download_invalid_download_location);
}
}
}
@Override
public boolean onPreferenceClick(Preference preference) {
String key = preference.getKey();
if (KEY_DOWNLOAD_LOCATION.equals(key)) {
int sdk = Build.VERSION.SDK_INT;
if (sdk < Build.VERSION_CODES.KITKAT) {
openDirPicker();
} else if (sdk < Build.VERSION_CODES.LOLLIPOP) {
showDirPickerDialogKK();
} else {
showDirPickerDialogL();
}
return true;
}
return false;
}
private void showDirPickerDialogKK() {
new AlertDialog.Builder(getActivity()).setMessage(R.string.settings_download_pick_dir_kk)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
openDirPicker();
}
}).show();
}
private void showDirPickerDialogL() {
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case DialogInterface.BUTTON_POSITIVE:
openDirPicker();
break;
case DialogInterface.BUTTON_NEUTRAL:
openDirPickerL();
break;
}
}
};
new AlertDialog.Builder(getActivity()).setMessage(R.string.settings_download_pick_dir_l)
.setPositiveButton(android.R.string.ok, listener)
.setNeutralButton(R.string.settings_download_document, listener)
.show();
}
private void openDirPicker() {
UniFile uniFile = Settings.getDownloadLocation();
Intent intent = new Intent(getActivity(), DirPickerActivity.class);
if (uniFile != null) {
intent.putExtra(DirPickerActivity.KEY_FILE_URI, uniFile.getUri());
}
startActivityForResult(intent, REQUEST_CODE_PICK_IMAGE_DIR);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void openDirPickerL() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
try {
startActivityForResult(intent, REQUEST_CODE_PICK_IMAGE_DIR_L);
} catch (ActivityNotFoundException e) {
Toast.makeText(getActivity(), R.string.error_cant_find_activity, Toast.LENGTH_SHORT).show();
}
}
@Override
@TargetApi(Build.VERSION_CODES.KITKAT)
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_PICK_IMAGE_DIR: {
if (resultCode == Activity.RESULT_OK) {
UniFile uniFile = UniFile.fromUri(getActivity(), data.getData());
if (uniFile != null) {
Settings.putDownloadLocation(uniFile);
onUpdateDownloadLocation();
} else {
Toast.makeText(getActivity(), R.string.settings_download_cant_get_download_location,
Toast.LENGTH_SHORT).show();
}
}
break;
}
case REQUEST_CODE_PICK_IMAGE_DIR_L: {
if (resultCode == Activity.RESULT_OK) {
Uri treeUri = data.getData();
getActivity().getContentResolver().takePersistableUriPermission(
treeUri, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
UniFile uniFile = UniFile.fromTreeUri(getActivity(), treeUri);
if (uniFile != null) {
Settings.putDownloadLocation(uniFile);
onUpdateDownloadLocation();
} else {
Toast.makeText(getActivity(), R.string.settings_download_cant_get_download_location,
Toast.LENGTH_SHORT).show();
}
}
break;
}
default: {
super.onActivityResult(requestCode, resultCode, data);
}
}
}
}
@@ -0,0 +1,189 @@
/*
* 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.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.hippo.easyrecyclerview.EasyRecyclerView;
import com.hippo.easyrecyclerview.LinearDividerItemDecoration;
import com.hippo.ehviewer.R;
import com.hippo.rippleold.RippleSalon;
import com.hippo.yorozuya.LayoutUtils;
import com.hippo.yorozuya.ResourcesUtils;
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 final List<File> mFiles = new ArrayList<>();
private DirAdapter mAdapter;
private OnChangeDirListener mOnChangeDirListener;
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, getResources().getColor(R.color.divider),
LayoutUtils.dp2pix(context, 1));
decoration.setShowLastDivider(true);
addItemDecoration(decoration);
setSelector(RippleSalon.generateRippleDrawable(ResourcesUtils.getAttrBoolean(context, R.attr.dark)));
setOnItemClickListener(this);
mCurrentFile = Environment.getExternalStorageDirectory();
if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
|| mCurrentFile == null) {
mCurrentFile = new File("/");
}
updateFileList();
}
public void setOnChangeDirListener(OnChangeDirListener listener) {
mOnChangeDirListener = listener;
}
public 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();
if (mOnChangeDirListener != null) {
mOnChangeDirListener.onChangeDir(mCurrentFile);
}
}
}
@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 ViewHolder {
public TextView textView;
public DirHolder(View itemView) {
super(itemView);
textView = (TextView) itemView;
}
}
private class DirAdapter extends Adapter<DirHolder> {
@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<File> {
@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());
}
}
}
public interface OnChangeDirListener {
void onChangeDir(File dir);
}
}
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/colorPrimary"
android:pathData="@string/pd_download"/>
</vector>
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/colorPrimary"
android:pathData="@string/pd_info"/>
</vector>
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:elevation="8dp"/>
<FrameLayout
android:id="@+id/content_panel"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/keyline_margin"
android:orientation="vertical">
<TextView
android:id="@+id/path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:singleLine="true"
android:ellipsize="start"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/text_little_small"/>
<com.hippo.widget.DirExplorer
android:id="@+id/dir_explorer"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<TextView
android:id="@+id/ok"
style="@style/CardButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@android:string/ok"
android:textColor="?attr/colorPrimary"
android:background="@null"/>
</LinearLayout>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<merge>
<include layout="@layout/scene_toolbar"/>
</merge>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="8dp"/>
+1 -1
View File
@@ -36,7 +36,7 @@
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_height="8dp"
android:background="@drawable/shadow_bottom"/>
</FrameLayout>
+14
View File
@@ -288,6 +288,20 @@
<string name="settings_read_show_battery_title">Show battery</string>
<string name="settings_read_volume_page_title">Use volume key to turn pages</string>
<string name="settings_download_title">Download</string>
<string name="settings_download_download_location_title">Download location</string>
<string name="settings_download_invalid_download_location">Invalid download location</string>
<string name="settings_download_cant_get_download_location">Can\'t get download location</string>
<string name="settings_download_pick_dir_kk">You can\'t write any kind of data on your external SD card in Android 4.4+ unless you have hacked it</string>
<string name="settings_download_pick_dir_l">Android 5.0+ provides new API to write on external SD card. Click the \"DOCUMENT\" button if you want to set download location to SD card</string>
<string name="settings_download_document">Document</string>
<string name="settings_about_title">About</string>
<!-- Dir Picker-->
<string name="dir_picker">Dir picker</string>
<string name="directory_not_writable">The directory is not writable</string>
<!-- Progress Scene -->
<string name="error_something_wrong_happened">Something wrong happened</string>
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
</PreferenceScreen>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<Preference
android:key="download_location"
android:title="@string/settings_download_download_location_title"/>
</PreferenceScreen>
+10
View File
@@ -28,4 +28,14 @@
android:title="@string/settings_read_title"
android:icon="@drawable/v_book_open_primary_x24"/>
<header
android:fragment="com.hippo.ehviewer.ui.fragment.DownloadFragment"
android:title="@string/settings_download_title"
android:icon="@drawable/v_download_primary_x24"/>
<header
android:fragment="com.hippo.ehviewer.ui.fragment.AboutFragment"
android:title="@string/settings_about_title"
android:icon="@drawable/v_info_primary_x24"/>
</preference-headers>