diff options
author | Likai Ding <likaid@codeaurora.org> | 2015-01-26 10:07:21 +0800 |
---|---|---|
committer | Likai Ding <likaid@codeaurora.org> | 2015-02-02 13:55:08 +0800 |
commit | e2fb5dc7798cf677f6a66b6a697c4a011b0a101f (patch) | |
tree | 9250c3a47e27b90e3c094c9d3ffa1365c3914178 /src/com/android/camera/ui/ListSubMenu.java | |
parent | 07cf80cc97c68f12d5728919fcebba28e750761d (diff) | |
download | android_packages_apps_Snap-e2fb5dc7798cf677f6a66b6a697c4a011b0a101f.tar.gz android_packages_apps_Snap-e2fb5dc7798cf677f6a66b6a697c4a011b0a101f.tar.bz2 android_packages_apps_Snap-e2fb5dc7798cf677f6a66b6a697c4a011b0a101f.zip |
SnapdragonCamera: fix portrait orientation
Fix camera activity to portrait, so there is no delay when rotation
occurs. Main changes are:
1. RotateLayout now supports padding and dynamically added child.
2. Camera controls and gesture detetion are now orientation-aware.
3. Toasts are replaced with RotateTextToast.
4. Obselete layout files are removed.
Change-Id: I338849bd7fb84b847eb357f771a24a5cc09bf6fa
Diffstat (limited to 'src/com/android/camera/ui/ListSubMenu.java')
-rw-r--r-- | src/com/android/camera/ui/ListSubMenu.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/camera/ui/ListSubMenu.java b/src/com/android/camera/ui/ListSubMenu.java index af38b162a..3501af3bc 100644 --- a/src/com/android/camera/ui/ListSubMenu.java +++ b/src/com/android/camera/ui/ListSubMenu.java @@ -80,16 +80,6 @@ public class ListSubMenu extends ListView implements } } - @Override - protected void onLayout(boolean changed, int l, int t, int r, int b) { - int screenHeight = ((LinearLayout) getParent()).getHeight(); - super.onLayout(changed, l, t, r, b); - setY(Math.max(0, mY)); - if (mY + (b - t) > screenHeight) { - setY(Math.max(0, mY - (mY + (b - t) - screenHeight))); - } - } - public void initialize(ListPreference preference, int y) { mPreference = preference; Context context = getContext(); @@ -154,4 +144,14 @@ public class ListSubMenu extends ListView implements protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); } + + public int getPreCalculatedHeight() { + int count = getAdapter().getCount(); + return count * (int) getContext().getResources().getDimension(R.dimen.setting_row_height) + + (count - 1) * getDividerHeight(); + } + + public int getYBase() { + return mY; + } } |