New reader menu (#368)

This commit is contained in:
inorichi
2016-06-27 16:46:31 +02:00
committed by GitHub
parent fe6dff9086
commit 05c0516a57
22 changed files with 585 additions and 538 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size
android:height="@dimen/material_layout_keylines_horizontal_mobile_margin"
android:width="0dp"/>
<solid
android:color="@android:color/transparent"/>
</shape>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>

View File

@@ -1,30 +1,102 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center">
<FrameLayout
android:id="@+id/reader"
android:id="@+id/reader_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/reader"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<ProgressBar
android:id="@+id/please_wait"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<TextView
android:id="@+id/page_number"
style="@style/TextAppearance.Regular.Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:background="?android:attr/colorBackground"
android:padding="4dp"/>
</FrameLayout>
<ProgressBar
android:id="@+id/please_wait"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<FrameLayout
android:id="@+id/reader_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:visibility="invisible"
tools:visibility="visible">
<TextView
android:id="@+id/page_number"
style="@style/TextAppearance.Regular.Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:background="?android:attr/colorBackground"
android:padding="4dp"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?colorPrimary"
android:elevation="4dp"
android:theme="?attr/actionBarTheme"/>
<include layout="@layout/reader_menu"/>
<LinearLayout
android:id="@+id/reader_menu_bottom"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
android:gravity="center"
android:background="?colorPrimary"
android:orientation="horizontal">
<ImageButton
android:id="@+id/left_chapter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
android:background="?android:selectableItemBackground"
app:srcCompat="@drawable/ic_skip_previous_white_24dp"/>
<TextView
android:id="@+id/left_page_text"
android:layout_width="32dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"/>
<SeekBar
android:id="@+id/page_seekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:id="@+id/right_page_text"
android:layout_width="32dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"/>
<ImageButton
android:id="@+id/right_chapter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/material_layout_keylines_screen_edge_margin"
android:background="?android:selectableItemBackground"
app:srcCompat="@drawable/ic_skip_next_white_24dp"/>
</LinearLayout>
</FrameLayout>
</FrameLayout>

View File

@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/material_component_dialogs_padding_around_content_area"
android:divider="@drawable/empty_divider"
android:showDividers="middle">
<!-- Viewer for this series -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="@string/viewer_for_this_series" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/viewer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:entries="@array/viewers_selector">
</android.support.v7.widget.AppCompatSpinner>
</LinearLayout>
<!-- Rotation -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="@string/pref_rotation_type" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/rotation_mode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:entries="@array/rotation_type">
</android.support.v7.widget.AppCompatSpinner>
</LinearLayout>
<!-- Scale type -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="@string/pref_image_scale_type" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/scale_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:entries="@array/image_scale_type">
</android.support.v7.widget.AppCompatSpinner>
</LinearLayout>
<!-- Zoom start position -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="@string/pref_zoom_start" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/zoom_start"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:entries="@array/zoom_start">
</android.support.v7.widget.AppCompatSpinner>
</LinearLayout>
<!-- Image decoder -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="@string/pref_image_decoder" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/image_decoder"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:entries="@array/image_decoders">
</android.support.v7.widget.AppCompatSpinner>
</LinearLayout>
<!-- Background color -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="@string/pref_reader_theme" />
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/background_color"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:entries="@array/reader_themes">
</android.support.v7.widget.AppCompatSpinner>
</LinearLayout>
<android.support.v7.widget.SwitchCompat
android:id="@+id/enable_transitions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/pref_enable_transitions"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/show_page_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/pref_show_page_number"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/fullscreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/pref_fullscreen"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/keep_screen_on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/pref_keep_screen_on"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/custom_brightness"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/pref_custom_brightness"/>
<SeekBar
android:id="@+id/brightness_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.Regular.Body1.Light"/>
</LinearLayout>

View File

@@ -1,119 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/reader_menu"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?colorPrimary"
android:elevation="4dp"
android:theme="?attr/actionBarTheme"/>
<LinearLayout
android:id="@+id/reader_menu_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?colorPrimary"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize">
<TextView
android:id="@+id/left_page_text"
android:layout_width="32dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="12dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="12dp"
android:gravity="center_horizontal"
android:textSize="15sp"/>
<SeekBar
android:id="@+id/page_seekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
/>
<TextView
android:id="@+id/right_page_text"
android:layout_width="32dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="8dp"
android:gravity="center_horizontal"
android:textSize="15sp"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#777777"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize">
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/lock_orientation"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="?android:selectableItemBackground"
app:srcCompat="@drawable/ic_screen_rotation_white_24dp"/>
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/reader_zoom_selector"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="?android:selectableItemBackground"
app:srcCompat="@drawable/ic_crop_original_white_24dp"/>
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/reader_scale_type_selector"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="?android:selectableItemBackground"
app:srcCompat="@drawable/ic_zoom_out_map_white_24dp"/>
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/reader_selector"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="?android:selectableItemBackground"
app:srcCompat="@drawable/ic_view_carousel_white_24dp"/>
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/reader_extra_settings"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="?android:selectableItemBackground"
app:srcCompat="@drawable/ic_more_vert_white_24dp"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View File

@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?attr/colorPrimary"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:paddingTop="5dp">
<LinearLayout
android:id="@+id/image_decoder_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/image_decoder_initial"
android:layout_width="32dp"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="?colorAccent"
style="@style/TextAppearance.Regular.SubHeading"/>
<TextView
android:id="@+id/image_decoder"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:text="@string/pref_image_decoder"
style="@style/TextAppearance.Regular.Body1.Light"/>
</LinearLayout>
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/reader_theme"
android:button="@drawable/reader_background_checkbox"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:text="@string/pref_reader_theme"/>
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/enable_transitions"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:text="@string/pref_enable_transitions"/>
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/show_page_number"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:text="@string/pref_show_page_number"/>
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/hide_status_bar"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:text="@string/pref_hide_status_bar"/>
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/keep_screen_on"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:gravity="center"
android:text="@string/pref_keep_screen_on"/>
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/custom_brightness"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/pref_custom_brightness"/>
<SeekBar
android:id="@+id/brightness_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.Regular.Body1.Light"/>
</LinearLayout>

View File

@@ -3,17 +3,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_previous_chapter"
android:title="@string/action_previous_chapter"
android:icon="@drawable/ic_skip_previous_white_24dp"
android:visible="false"
app:showAsAction="always" />
<item
android:id="@+id/action_next_chapter"
android:title="@string/action_next_chapter"
android:icon="@drawable/ic_skip_next_white_24dp"
android:visible="false"
app:showAsAction="always" />
android:id="@+id/action_settings"
android:title="@string/label_settings"
android:icon="@drawable/ic_settings_white_24dp"
app:showAsAction="always"
/>
</menu>

View File

@@ -19,4 +19,14 @@
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@color/colorPrimaryDark</item>
</style>
<!--==============-->
<!-- Reader Theme -->
<!--==============-->
<style name="Theme.Reader" parent="Theme.Base.Reader">
<!-- Attributes specific for SDK 21 and up -->
<item name="android:statusBarColor">?colorPrimaryDark</item>
<item name="android:navigationBarColor">?colorPrimaryDark</item>
</style>
</resources>

View File

@@ -21,7 +21,7 @@
<string name="pref_default_viewer_key">pref_default_viewer_key</string>
<string name="pref_image_scale_type_key">pref_image_scale_type_key</string>
<string name="pref_zoom_start_key">pref_zoom_start_key</string>
<string name="pref_hide_status_bar_key">pref_hide_status_bar_key</string>
<string name="pref_fullscreen_key">fullscreen</string>
<string name="pref_rotation_type_key">pref_rotation_type_key</string>
<string name="pref_enable_transitions_key">pref_enable_transitions_key</string>
<string name="pref_show_page_number_key">pref_show_page_number_key</string>

View File

@@ -96,7 +96,7 @@
<string name="dark_theme">Dark theme</string>
<!-- Reader section -->
<string name="pref_hide_status_bar">Hide status bar</string>
<string name="pref_fullscreen">Fullscreen</string>
<string name="pref_lock_orientation">Lock orientation</string>
<string name="pref_enable_transitions">Enable transitions</string>
<string name="pref_show_page_number">Show page number</string>
@@ -264,6 +264,7 @@
<string name="no_previous_chapter">Previous chapter not found</string>
<string name="decode_image_error">Image could not be loaded.\nTry changing the image decoder or with one of the options below</string>
<string name="confirm_update_manga_sync">Update last chapter read in enabled services to %1$d?</string>
<string name="viewer_for_this_series">Viewer for this series</string>
<!-- Backup fragment -->
<string name="backup">Backup</string>

View File

@@ -83,10 +83,16 @@
<!--==============-->
<!-- Reader Theme -->
<!--==============-->
<style name="Theme.Reader" parent="Theme.Base.Dark">
<style name="Theme.Base.Reader" parent="Theme.Base.Dark">
<item name="colorPrimary">@color/md_blue_grey_900</item>
<item name="colorPrimaryDark">#171E22</item>
</style>
<style name="Theme.Reader" parent="Theme.Base.Reader">
<!-- Attributes specific for SDK 16 to SDK 20 -->
</style>
<!--===============-->
<!-- Launch Screen -->
<!--===============-->

View File

@@ -55,8 +55,8 @@
android:summary="%s" />
<SwitchPreference
android:title="@string/pref_hide_status_bar"
android:key="@string/pref_hide_status_bar_key"
android:title="@string/pref_fullscreen"
android:key="@string/pref_fullscreen_key"
android:defaultValue="true" />
<SwitchPreference