summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/ListSubMenu.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/ui/ListSubMenu.java')
-rw-r--r--src/com/android/camera/ui/ListSubMenu.java20
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;
+ }
}