diff --git a/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java b/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java index b1768bc84a..165c8f578b 100644 --- a/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java +++ b/app/src/main/java/eu/kanade/mangafeed/data/preference/PreferencesHelper.java @@ -40,6 +40,19 @@ public class PreferencesHelper { return prefs.getBoolean(getKey(R.string.pref_hide_status_bar_key), true); } + public boolean isOrientationLocked() { + return prefs.getBoolean(getKey(R.string.pref_lock_orientation_key), true); + } + + public void setOrientationLocked(boolean lock) { + prefs.edit().putBoolean(getKey(R.string.pref_lock_orientation_key), lock).apply(); + } + + public Observable isOrientationLockedObservable() { + return rxPrefs.getBoolean(getKey(R.string.pref_lock_orientation_key), true) + .asObservable(); + } + public int getDefaultViewer() { return Integer.parseInt(prefs.getString(getKey(R.string.pref_default_viewer_key), "1")); } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java index 69d7e0ed1b..eecf610db4 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderActivity.java @@ -4,9 +4,11 @@ import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; +import android.support.annotation.NonNull; import android.support.v7.widget.Toolbar; import android.view.MotionEvent; import android.view.View; +import android.view.ViewGroup; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.TextView; @@ -30,6 +32,7 @@ import eu.kanade.mangafeed.ui.reader.viewer.horizontal.RightToLeftReader; import eu.kanade.mangafeed.ui.reader.viewer.vertical.VerticalReader; import eu.kanade.mangafeed.ui.reader.viewer.webtoon.WebtoonReader; import eu.kanade.mangafeed.util.ToastUtil; +import icepick.Icepick; import nucleus.factory.RequiresPresenter; @RequiresPresenter(ReaderPresenter.class) @@ -66,10 +69,20 @@ public class ReaderActivity extends BaseRxActivity { setupToolbar(toolbar); readerMenu = new ReaderMenu(this, prefs); + Icepick.restoreInstanceState(readerMenu, savedState); + if (savedState != null && readerMenu.showing) + readerMenu.show(false); + createUiHideFlags(); enableHardwareAcceleration(); } + @Override + protected void onDestroy() { + readerMenu.destroy(); + super.onDestroy(); + } + @Override protected void onResume() { super.onResume(); @@ -83,11 +96,17 @@ public class ReaderActivity extends BaseRxActivity { super.onPause(); } + @Override + protected void onSaveInstanceState(@NonNull Bundle outState) { + Icepick.saveInstanceState(readerMenu, outState); + super.onSaveInstanceState(outState); + } + private void createUiHideFlags() { uiFlags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; if (prefs.isHideStatusBarSet()) uiFlags |= View.SYSTEM_UI_FLAG_FULLSCREEN; - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) uiFlags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; } @@ -131,18 +150,22 @@ public class ReaderActivity extends BaseRxActivity { readerMenu.toggle(); } + public ViewGroup getContainer() { + return container; + } + private BaseReader getViewer(Manga manga) { int mangaViewer = manga.viewer == 0 ? prefs.getDefaultViewer() : manga.viewer; switch (mangaViewer) { case LEFT_TO_RIGHT: default: - return new LeftToRightReader(this, container); + return new LeftToRightReader(this); case RIGHT_TO_LEFT: - return new RightToLeftReader(this, container); + return new RightToLeftReader(this); case VERTICAL: - return new VerticalReader(this, container); + return new VerticalReader(this); case WEBTOON: - return new WebtoonReader(this, container); + return new WebtoonReader(this); } } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java index 937515756b..b1c01f198f 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderMenu.java @@ -1,9 +1,16 @@ package eu.kanade.mangafeed.ui.reader; +import android.app.Dialog; +import android.content.Context; +import android.content.pm.ActivityInfo; +import android.support.v7.app.AlertDialog; import android.support.v7.widget.Toolbar; +import android.view.Surface; import android.view.View; +import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; +import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.SeekBar; @@ -17,6 +24,8 @@ import eu.kanade.mangafeed.R; import eu.kanade.mangafeed.data.database.models.Chapter; import eu.kanade.mangafeed.data.database.models.Manga; import eu.kanade.mangafeed.data.preference.PreferencesHelper; +import icepick.State; +import rx.subscriptions.CompositeSubscription; public class ReaderMenu { @@ -26,41 +35,58 @@ public class ReaderMenu { @Bind(R.id.current_page) TextView currentPage; @Bind(R.id.page_seeker) SeekBar seekBar; @Bind(R.id.total_pages) TextView totalPages; + @Bind(R.id.lock_orientation) ImageButton lockOrientation; + @Bind(R.id.reader_selector) ImageButton readerSelector; + private ReaderActivity activity; private PreferencesHelper preferences; - private boolean showing; + @State boolean showing; private DecimalFormat decimalFormat; + private CompositeSubscription subscriptions; + public ReaderMenu(ReaderActivity activity, PreferencesHelper preferences) { this.activity = activity; this.preferences = preferences; ButterKnife.bind(this, activity); + // Intercept all image events in this layout + bottomMenu.setOnTouchListener((v, event) -> true); + seekBar.setOnSeekBarChangeListener(new PageSeekBarChangeListener()); decimalFormat = new DecimalFormat("#.##"); + + subscriptions = new CompositeSubscription(); + initializeOptions(); + } + + public void destroy() { + subscriptions.unsubscribe(); } public void toggle() { if (showing) hide(); else - show(); + show(true); } - private void show() { + public void show(boolean animate) { menu.setVisibility(View.VISIBLE); - Animation toolbarAnimation = AnimationUtils.loadAnimation(activity, R.anim.enter_from_top); - toolbar.startAnimation(toolbarAnimation); + if (animate) { + Animation toolbarAnimation = AnimationUtils.loadAnimation(activity, R.anim.enter_from_top); + toolbar.startAnimation(toolbarAnimation); - Animation bottomMenuAnimation = AnimationUtils.loadAnimation(activity, R.anim.enter_from_bottom); - bottomMenu.startAnimation(bottomMenuAnimation); + Animation bottomMenuAnimation = AnimationUtils.loadAnimation(activity, R.anim.enter_from_bottom); + bottomMenu.startAnimation(bottomMenuAnimation); + } showing = true; } - private void hide() { + public void hide() { Animation toolbarAnimation = AnimationUtils.loadAnimation(activity, R.anim.exit_to_top); toolbarAnimation.setAnimationListener(new HideMenuAnimationListener()); toolbar.startAnimation(toolbarAnimation); @@ -77,9 +103,9 @@ public class ReaderMenu { activity.setToolbarTitle(manga.title); activity.setToolbarSubtitle(chapter.chapter_number != -1 ? - activity.getString(R.string.chapter_subtitle, - decimalFormat.format(chapter.chapter_number)) : - chapter.name); + activity.getString(R.string.chapter_subtitle, + decimalFormat.format(chapter.chapter_number)) : + chapter.name); } @@ -88,6 +114,73 @@ public class ReaderMenu { seekBar.setProgress(pageIndex); } + private void initializeOptions() { + // Orientation changes + lockOrientation.setOnClickListener(v -> + preferences.setOrientationLocked(!preferences.isOrientationLocked())); + + subscriptions.add(preferences.isOrientationLockedObservable() + .subscribe(this::onOrientationOptionChanged)); + + // Reader selector + readerSelector.setOnClickListener(v -> { + final Manga manga = activity.getPresenter().getManga(); + final Dialog dialog = new AlertDialog.Builder(activity) + .setSingleChoiceItems(R.array.viewers_selector, manga.viewer, (d, which) -> { + if (manga.viewer != which) { + activity.getPresenter().updateMangaViewer(which); + activity.recreate(); + } + d.dismiss(); + }) + .create(); + + // Hack to not leave immersive mode + dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + dialog.getWindow().getDecorView().setSystemUiVisibility( + activity.getWindow().getDecorView().getSystemUiVisibility()); + dialog.show(); + dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); + WindowManager wm = (WindowManager) activity.getSystemService(Context.WINDOW_SERVICE); + wm.updateViewLayout(activity.getWindow().getDecorView(), activity.getWindow().getAttributes()); + }); + } + + private void onOrientationOptionChanged(boolean locked) { + if (locked) + lockOrientation(); + else + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + int resourceId = !locked ? R.drawable.ic_screen_rotation : + activity.getResources().getConfiguration().orientation == 1 ? + R.drawable.ic_screen_lock_portrait : + R.drawable.ic_screen_lock_landscape; + + lockOrientation.setImageResource(resourceId); + } + + private void lockOrientation() { + int orientation; + int rotation = ((WindowManager) activity.getSystemService( + Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation(); + switch (rotation) { + case Surface.ROTATION_0: + orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; + break; + case Surface.ROTATION_90: + orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; + break; + case Surface.ROTATION_180: + orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT; + break; + default: + orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE; + break; + } + activity.setRequestedOrientation(orientation); + } + class PageSeekBarChangeListener implements SeekBar.OnSeekBarChangeListener { @Override diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java index eea229add4..37e605d91e 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java @@ -232,4 +232,13 @@ public class ReaderPresenter extends BasePresenter { loadChapter(previousChapter); } } + + public Manga getManga() { + return manga; + } + + public void updateMangaViewer(int viewer) { + manga.viewer = viewer; + db.insertManga(manga).executeAsBlocking(); + } } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java index 3a518a4d3c..070ff3cab7 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/base/BaseReader.java @@ -1,7 +1,7 @@ package eu.kanade.mangafeed.ui.reader.viewer.base; import android.view.MotionEvent; -import android.widget.FrameLayout; +import android.view.ViewGroup; import java.util.List; @@ -11,12 +11,12 @@ import eu.kanade.mangafeed.ui.reader.ReaderActivity; public abstract class BaseReader { protected ReaderActivity activity; - protected FrameLayout container; + protected ViewGroup container; protected int currentPosition; - public BaseReader(ReaderActivity activity, FrameLayout container) { + public BaseReader(ReaderActivity activity) { this.activity = activity; - this.container = container; + this.container = activity.getContainer(); } public void updatePageNumber() { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java index 5d76d5bd38..c79f923015 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/HorizontalReader.java @@ -1,7 +1,6 @@ package eu.kanade.mangafeed.ui.reader.viewer.horizontal; import android.view.MotionEvent; -import android.widget.FrameLayout; import java.util.List; @@ -19,8 +18,8 @@ public abstract class HorizontalReader extends BaseReader { protected ViewPagerReaderAdapter adapter; - public HorizontalReader(ReaderActivity activity, FrameLayout container) { - super(activity, container); + public HorizontalReader(ReaderActivity activity) { + super(activity); activity.getLayoutInflater().inflate(R.layout.reader_horizontal, container); ButterKnife.bind(this, container); diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java index 18db8fb49b..0e5eaf2e30 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/LeftToRightReader.java @@ -1,13 +1,11 @@ package eu.kanade.mangafeed.ui.reader.viewer.horizontal; -import android.widget.FrameLayout; - import eu.kanade.mangafeed.ui.reader.ReaderActivity; public class LeftToRightReader extends HorizontalReader { - public LeftToRightReader(ReaderActivity activity, FrameLayout container) { - super(activity, container); + public LeftToRightReader(ReaderActivity activity) { + super(activity); } @Override diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java index 4cf4d0c4fb..e63d983aa9 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/horizontal/RightToLeftReader.java @@ -1,7 +1,5 @@ package eu.kanade.mangafeed.ui.reader.viewer.horizontal; -import android.widget.FrameLayout; - import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -11,8 +9,8 @@ import eu.kanade.mangafeed.ui.reader.ReaderActivity; public class RightToLeftReader extends HorizontalReader { - public RightToLeftReader(ReaderActivity activity, FrameLayout container) { - super(activity, container); + public RightToLeftReader(ReaderActivity activity) { + super(activity); } @Override diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java index 216c8199b8..29ec85876b 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/vertical/VerticalReader.java @@ -2,7 +2,6 @@ package eu.kanade.mangafeed.ui.reader.viewer.vertical; import android.support.v4.view.ViewPager; import android.view.MotionEvent; -import android.widget.FrameLayout; import java.util.List; @@ -20,8 +19,8 @@ public class VerticalReader extends BaseReader { private ViewPagerReaderAdapter adapter; - public VerticalReader(ReaderActivity activity, FrameLayout container) { - super(activity, container); + public VerticalReader(ReaderActivity activity) { + super(activity); activity.getLayoutInflater().inflate(R.layout.reader_vertical, container); ButterKnife.bind(this, container); diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java index 9329b6e0f1..a5d63bfc50 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/viewer/webtoon/WebtoonReader.java @@ -3,7 +3,6 @@ package eu.kanade.mangafeed.ui.reader.viewer.webtoon; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.MotionEvent; -import android.widget.FrameLayout; import java.util.List; @@ -22,8 +21,8 @@ public class WebtoonReader extends BaseReader { private List pages; private Subscription subscription; - public WebtoonReader(ReaderActivity activity, FrameLayout container) { - super(activity, container); + public WebtoonReader(ReaderActivity activity) { + super(activity); recycler = new RecyclerView(activity); layoutManager = new LinearLayoutManager(activity); diff --git a/app/src/main/res/drawable-hdpi/ic_screen_lock_landscape.png b/app/src/main/res/drawable-hdpi/ic_screen_lock_landscape.png new file mode 100644 index 0000000000..812ae6d5f1 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_screen_lock_landscape.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_screen_lock_portrait.png b/app/src/main/res/drawable-hdpi/ic_screen_lock_portrait.png new file mode 100644 index 0000000000..43f607446f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_screen_lock_portrait.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_screen_rotation.png b/app/src/main/res/drawable-hdpi/ic_screen_rotation.png new file mode 100644 index 0000000000..6e86113fb5 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_screen_rotation.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_view_carousel.png b/app/src/main/res/drawable-hdpi/ic_view_carousel.png new file mode 100644 index 0000000000..7b96543e79 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_view_carousel.png differ diff --git a/app/src/main/res/drawable-ldpi/ic_screen_lock_landscape.png b/app/src/main/res/drawable-ldpi/ic_screen_lock_landscape.png new file mode 100644 index 0000000000..b9ca52da7d Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_screen_lock_landscape.png differ diff --git a/app/src/main/res/drawable-ldpi/ic_screen_lock_portrait.png b/app/src/main/res/drawable-ldpi/ic_screen_lock_portrait.png new file mode 100644 index 0000000000..5e8404f33c Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_screen_lock_portrait.png differ diff --git a/app/src/main/res/drawable-ldpi/ic_screen_rotation.png b/app/src/main/res/drawable-ldpi/ic_screen_rotation.png new file mode 100644 index 0000000000..56ebc2d244 Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_screen_rotation.png differ diff --git a/app/src/main/res/drawable-ldpi/ic_view_carousel.png b/app/src/main/res/drawable-ldpi/ic_view_carousel.png new file mode 100644 index 0000000000..6d911d0233 Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_view_carousel.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_screen_lock_landscape.png b/app/src/main/res/drawable-mdpi/ic_screen_lock_landscape.png new file mode 100644 index 0000000000..5d767ac08c Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_screen_lock_landscape.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_screen_lock_portrait.png b/app/src/main/res/drawable-mdpi/ic_screen_lock_portrait.png new file mode 100644 index 0000000000..edb8dcd07b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_screen_lock_portrait.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_screen_rotation.png b/app/src/main/res/drawable-mdpi/ic_screen_rotation.png new file mode 100644 index 0000000000..4512bb19e0 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_screen_rotation.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_view_carousel.png b/app/src/main/res/drawable-mdpi/ic_view_carousel.png new file mode 100644 index 0000000000..5c6f94afd4 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_view_carousel.png differ diff --git a/app/src/main/res/drawable-tvdpi/ic_file_download.png b/app/src/main/res/drawable-tvdpi/ic_file_download.png deleted file mode 100644 index dd0db5bd97..0000000000 Binary files a/app/src/main/res/drawable-tvdpi/ic_file_download.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_screen_lock_landscape.png b/app/src/main/res/drawable-xhdpi/ic_screen_lock_landscape.png new file mode 100644 index 0000000000..5f95a70c90 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_screen_lock_landscape.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_screen_lock_portrait.png b/app/src/main/res/drawable-xhdpi/ic_screen_lock_portrait.png new file mode 100644 index 0000000000..07091e785e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_screen_lock_portrait.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_screen_rotation.png b/app/src/main/res/drawable-xhdpi/ic_screen_rotation.png new file mode 100644 index 0000000000..18e92807b0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_screen_rotation.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_view_carousel.png b/app/src/main/res/drawable-xhdpi/ic_view_carousel.png new file mode 100644 index 0000000000..a9ef5bd5d8 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_view_carousel.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_screen_lock_landscape.png b/app/src/main/res/drawable-xxhdpi/ic_screen_lock_landscape.png new file mode 100644 index 0000000000..376682320b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_screen_lock_landscape.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_screen_lock_portrait.png b/app/src/main/res/drawable-xxhdpi/ic_screen_lock_portrait.png new file mode 100644 index 0000000000..e034998159 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_screen_lock_portrait.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_screen_rotation.png b/app/src/main/res/drawable-xxhdpi/ic_screen_rotation.png new file mode 100644 index 0000000000..c3dd5c628b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_screen_rotation.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_view_carousel.png b/app/src/main/res/drawable-xxhdpi/ic_view_carousel.png new file mode 100644 index 0000000000..a77c46b674 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_view_carousel.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_screen_lock_landscape.png b/app/src/main/res/drawable-xxxhdpi/ic_screen_lock_landscape.png new file mode 100644 index 0000000000..af031ea404 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_screen_lock_landscape.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_screen_lock_portrait.png b/app/src/main/res/drawable-xxxhdpi/ic_screen_lock_portrait.png new file mode 100644 index 0000000000..66a80b9992 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_screen_lock_portrait.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_screen_rotation.png b/app/src/main/res/drawable-xxxhdpi/ic_screen_rotation.png new file mode 100644 index 0000000000..d072f881c2 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_screen_rotation.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_view_carousel.png b/app/src/main/res/drawable-xxxhdpi/ic_view_carousel.png new file mode 100644 index 0000000000..ab4206ceb6 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_view_carousel.png differ diff --git a/app/src/main/res/layout/reader_menu.xml b/app/src/main/res/layout/reader_menu.xml index 5af00e95ec..e0165a401c 100644 --- a/app/src/main/res/layout/reader_menu.xml +++ b/app/src/main/res/layout/reader_menu.xml @@ -1,9 +1,11 @@ + android:visibility="gone" + tools:visibility="visible"> @@ -12,32 +14,79 @@ android:layout_height="wrap_content" android:id="@+id/reader_menu_bottom" android:background="@color/reader_menu_background" + android:orientation="vertical" android:layout_alignParentBottom="true"> - + - + - + + + + + + + + + android:gravity="center_horizontal" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp"> + + + + + + + diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 81aa3dc977..0f2d6ae76c 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -14,10 +14,17 @@ 4 + + @string/default_viewer + @string/left_to_right_viewer + @string/right_to_left_viewer + @string/vertical_viewer + @string/webtoon_viewer + + 1 2 3 - \ No newline at end of file diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml index 85c3f0bd72..d8b8d0899b 100644 --- a/app/src/main/res/values/keys.xml +++ b/app/src/main/res/values/keys.xml @@ -4,6 +4,7 @@ pref_category_accounts_key pref_category_downloads_key pref_hide_status_bar_key + pref_lock_orientation_key pref_default_viewer_key pref_download_directory_key pref_download_threads_key diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 705a439857..971322f2f7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -29,6 +29,7 @@ Hide status bar Default viewer + Default Left to right Right to left Vertical @@ -82,5 +83,6 @@ Update completed No new chapters found Found new chapters for: + Lock orientation diff --git a/app/src/main/res/xml/pref_reader.xml b/app/src/main/res/xml/pref_reader.xml index b8029dc892..cf3ae6c087 100644 --- a/app/src/main/res/xml/pref_reader.xml +++ b/app/src/main/res/xml/pref_reader.xml @@ -5,6 +5,10 @@ android:key="@string/pref_hide_status_bar_key" android:defaultValue="true" /> + +