[packages/apps/Camera2] 修改进入图片幻灯片模式时底部按钮仍然响应遥控器焦点
This commit is contained in:
22
packages/apps/Camera2/src/com/android/camera/CameraActivity.java
Normal file → Executable file
22
packages/apps/Camera2/src/com/android/camera/CameraActivity.java
Normal file → Executable file
@ -213,6 +213,7 @@ public class CameraActivity extends QuickActivity
|
||||
private FrameLayout mAboveFilmstripControlLayout;
|
||||
private FilmstripController mFilmstripController;
|
||||
private boolean mFilmstripVisible;
|
||||
private boolean mFilmstripBottomControlsVisible = false;
|
||||
/** Whether the filmstrip fully covers the preview. */
|
||||
private boolean mFilmstripCoversPreview = false;
|
||||
private int mResultCodeForTesting;
|
||||
@ -804,11 +805,13 @@ public class CameraActivity extends QuickActivity
|
||||
mCameraAppUI.getFilmstripBottomControls().setVisible(visible);
|
||||
if (visible != mActionBar.isShowing()) {
|
||||
if (visible) {
|
||||
mActionBar.show();
|
||||
mCameraAppUI.showBottomControls();
|
||||
mActionBar.show();
|
||||
mCameraAppUI.showBottomControls();
|
||||
mCameraAppUI.setBottomControlsFocusable(false);
|
||||
mFilmstripBottomControlsVisible = false;
|
||||
} else {
|
||||
mActionBar.hide();
|
||||
mCameraAppUI.hideBottomControls();
|
||||
mCameraAppUI.hideBottomControls();
|
||||
}
|
||||
}
|
||||
mFilmstripCoversPreview = visible;
|
||||
@ -1987,16 +1990,25 @@ public class CameraActivity extends QuickActivity
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT && !mFilmstripBottomControlsVisible) {
|
||||
mFilmstripController.goToNextItem();
|
||||
return true;
|
||||
} else if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
|
||||
} else if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT && !mFilmstripBottomControlsVisible) {
|
||||
boolean wentToPrevious = mFilmstripController.goToPreviousItem();
|
||||
if (!wentToPrevious) {
|
||||
// at beginning of filmstrip, hide and go back to preview
|
||||
mCameraAppUI.hideFilmstrip();
|
||||
mFilmstripBottomControlsVisible = false;
|
||||
}
|
||||
return true;
|
||||
} else if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
|
||||
mCameraAppUI.setBottomControlsFocusable(true);
|
||||
mFilmstripBottomControlsVisible = true;
|
||||
return true;
|
||||
} else if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
|
||||
mCameraAppUI.setBottomControlsFocusable(false);
|
||||
mFilmstripBottomControlsVisible = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onKeyUp(keyCode, event);
|
||||
|
||||
4
packages/apps/Camera2/src/com/android/camera/app/CameraAppUI.java
Normal file → Executable file
4
packages/apps/Camera2/src/com/android/camera/app/CameraAppUI.java
Normal file → Executable file
@ -1523,6 +1523,10 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
|
||||
mFilmstripBottomControls.hide();
|
||||
}
|
||||
|
||||
public void setBottomControlsFocusable(boolean bFocusable) {
|
||||
mFilmstripBottomControls.setControlLayoutButtonFocusable(bFocusable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param listener The listener for bottom controls.
|
||||
*/
|
||||
|
||||
7
packages/apps/Camera2/src/com/android/camera/app/FilmstripBottomPanel.java
Normal file → Executable file
7
packages/apps/Camera2/src/com/android/camera/app/FilmstripBottomPanel.java
Normal file → Executable file
@ -64,6 +64,13 @@ class FilmstripBottomPanel implements CameraAppUI.BottomPanel {
|
||||
setupDeleteButton();
|
||||
setupShareButton();
|
||||
setupProgressUi();
|
||||
setControlLayoutButtonFocusable(false);
|
||||
}
|
||||
|
||||
public void setControlLayoutButtonFocusable(boolean bFocusable) {
|
||||
mEditButton.setFocusable(bFocusable);
|
||||
mShareButton.setFocusable(bFocusable);
|
||||
mDeleteButton.setFocusable(bFocusable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user