handle deprecation of resource ids as constants
This commit is contained in:
parent
fb44da509c
commit
2cdd5f967e
@ -499,56 +499,45 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
final int itemId = item.getItemId();
|
||||||
case R.id.action_previous:
|
if (itemId == R.id.action_previous) {
|
||||||
onJumpToPageInDocument(mPage - 1);
|
onJumpToPageInDocument(mPage - 1);
|
||||||
return true;
|
return true;
|
||||||
|
} else if (itemId == R.id.action_next) {
|
||||||
case R.id.action_next:
|
onJumpToPageInDocument(mPage + 1);
|
||||||
onJumpToPageInDocument(mPage + 1);
|
return true;
|
||||||
return true;
|
} else if (itemId == R.id.action_first) {
|
||||||
|
onJumpToPageInDocument(1);
|
||||||
case R.id.action_first:
|
return true;
|
||||||
onJumpToPageInDocument(1);
|
} else if (itemId == R.id.action_last) {
|
||||||
return true;
|
onJumpToPageInDocument(mNumPages);
|
||||||
|
return true;
|
||||||
case R.id.action_last:
|
} else if (itemId == R.id.action_open) {
|
||||||
onJumpToPageInDocument(mNumPages);
|
openDocument();
|
||||||
return true;
|
return true;
|
||||||
|
} else if (itemId == R.id.action_zoom_out) {
|
||||||
case R.id.action_open:
|
zoomOut(0.25f, true);
|
||||||
openDocument();
|
return true;
|
||||||
return true;
|
} else if (itemId == R.id.action_zoom_in) {
|
||||||
|
zoomIn(0.25f, true);
|
||||||
case R.id.action_zoom_out:
|
return true;
|
||||||
zoomOut(0.25f, true);
|
} else if (itemId == R.id.action_rotate_clockwise) {
|
||||||
return true;
|
documentOrientationChanged(90);
|
||||||
|
return true;
|
||||||
case R.id.action_zoom_in:
|
} else if (itemId == R.id.action_rotate_counterclockwise) {
|
||||||
zoomIn(0.25f, true);
|
documentOrientationChanged(-90);
|
||||||
return true;
|
return true;
|
||||||
|
} else if (itemId == R.id.action_view_document_properties) {
|
||||||
case R.id.action_rotate_clockwise:
|
DocumentPropertiesFragment
|
||||||
documentOrientationChanged(90);
|
.newInstance(mDocumentProperties)
|
||||||
return true;
|
.show(getSupportFragmentManager(), DocumentPropertiesFragment.TAG);
|
||||||
|
return true;
|
||||||
case R.id.action_rotate_counterclockwise:
|
} else if (itemId == R.id.action_jump_to_page) {
|
||||||
documentOrientationChanged(-90);
|
new JumpToPageFragment()
|
||||||
return true;
|
.show(getSupportFragmentManager(), JumpToPageFragment.TAG);
|
||||||
|
return true;
|
||||||
case R.id.action_view_document_properties:
|
|
||||||
DocumentPropertiesFragment
|
|
||||||
.newInstance(mDocumentProperties)
|
|
||||||
.show(getSupportFragmentManager(), DocumentPropertiesFragment.TAG);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.action_jump_to_page:
|
|
||||||
new JumpToPageFragment()
|
|
||||||
.show(getSupportFragmentManager(), JumpToPageFragment.TAG);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user