remove obsolete zoom in / zoom out menu actions

This commit is contained in:
Daniel Micay 2022-05-06 06:43:47 -04:00
parent 21d7b9d76e
commit 96651d02af
3 changed files with 4 additions and 26 deletions

View File

@ -527,10 +527,10 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
@Override @Override
public boolean onPrepareOptionsMenu(Menu menu) { public boolean onPrepareOptionsMenu(Menu menu) {
final int[] ids = {R.id.action_zoom_in, R.id.action_zoom_out, R.id.action_jump_to_page, final int[] ids = {R.id.action_jump_to_page, R.id.action_next, R.id.action_previous,
R.id.action_next, R.id.action_previous, R.id.action_first, R.id.action_last, R.id.action_first, R.id.action_last, R.id.action_rotate_clockwise,
R.id.action_rotate_clockwise, R.id.action_rotate_counterclockwise, R.id.action_rotate_counterclockwise, R.id.action_view_document_properties,
R.id.action_view_document_properties, R.id.action_share, R.id.action_save_as}; R.id.action_share, R.id.action_save_as};
if (mDocumentState < STATE_LOADED) { if (mDocumentState < STATE_LOADED) {
for (final int id : ids) { for (final int id : ids) {
final MenuItem item = menu.findItem(id); final MenuItem item = menu.findItem(id);
@ -549,8 +549,6 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
} }
enableDisableMenuItem(menu.findItem(R.id.action_open), getWebViewRelease() >= MIN_WEBVIEW_RELEASE); enableDisableMenuItem(menu.findItem(R.id.action_open), getWebViewRelease() >= MIN_WEBVIEW_RELEASE);
enableDisableMenuItem(menu.findItem(R.id.action_zoom_in), mZoomRatio != MAX_ZOOM_RATIO);
enableDisableMenuItem(menu.findItem(R.id.action_zoom_out), mZoomRatio != MIN_ZOOM_RATIO);
enableDisableMenuItem(menu.findItem(R.id.action_share), mUri != null); enableDisableMenuItem(menu.findItem(R.id.action_share), mUri != null);
enableDisableMenuItem(menu.findItem(R.id.action_next), mPage < mNumPages); enableDisableMenuItem(menu.findItem(R.id.action_next), mPage < mNumPages);
enableDisableMenuItem(menu.findItem(R.id.action_previous), mPage > 1); enableDisableMenuItem(menu.findItem(R.id.action_previous), mPage > 1);
@ -577,12 +575,6 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
} else if (itemId == R.id.action_open) { } else if (itemId == R.id.action_open) {
openDocument(); openDocument();
return true; return true;
} else if (itemId == R.id.action_zoom_out) {
zoomOut(0.25f, true);
return true;
} else if (itemId == R.id.action_zoom_in) {
zoomIn(0.25f, true);
return true;
} else if (itemId == R.id.action_rotate_clockwise) { } else if (itemId == R.id.action_rotate_clockwise) {
documentOrientationChanged(90); documentOrientationChanged(90);
return true; return true;

View File

@ -25,18 +25,6 @@
android:title="@string/action_open" android:title="@string/action_open"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item
android:id="@+id/action_zoom_out"
android:icon="@drawable/ic_zoom_out_24dp"
android:title="@string/action_zoom_out"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_zoom_in"
android:icon="@drawable/ic_zoom_in_24dp"
android:title="@string/action_zoom_in"
app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_share" android:id="@+id/action_share"
android:icon="@drawable/ic_share_24dp" android:icon="@drawable/ic_share_24dp"

View File

@ -7,8 +7,6 @@
<string name="action_open">Open document</string> <string name="action_open">Open document</string>
<string name="action_first">First page</string> <string name="action_first">First page</string>
<string name="action_last">Last page</string> <string name="action_last">Last page</string>
<string name="action_zoom_out">Zoom out</string>
<string name="action_zoom_in">Zoom in</string>
<string name="action_rotate_clockwise">Rotate clockwise</string> <string name="action_rotate_clockwise">Rotate clockwise</string>
<string name="action_rotate_counterclockwise">Rotate counterclockwise</string> <string name="action_rotate_counterclockwise">Rotate counterclockwise</string>
<string name="action_jump_to_page">Jump to page</string> <string name="action_jump_to_page">Jump to page</string>