summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/IndicatorControlBar.java
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2011-09-13 16:00:20 +0800
committerChung-yih Wang <cywang@google.com>2011-09-13 16:54:40 +0800
commit6176dfc23f5a092ca1b2ee3d07d7076821ec6095 (patch)
tree1e4c4cd27d116329ae597abd9a3f2f1dd419c0ac /src/com/android/camera/ui/IndicatorControlBar.java
parented2ea4de7489f4e27d47227da6ad1bb08d2d15e7 (diff)
downloadLegacyCamera-6176dfc23f5a092ca1b2ee3d07d7076821ec6095.zip
LegacyCamera-6176dfc23f5a092ca1b2ee3d07d7076821ec6095.tar.gz
LegacyCamera-6176dfc23f5a092ca1b2ee3d07d7076821ec6095.tar.bz2
Fix the NPE in IndicatorControlBarContainer.
bug:5299759 move the view inits to onFinishInflate(). Change-Id: I3a3adb01805fbfb5e22d58f86c9d5da3ce3585a6
Diffstat (limited to 'src/com/android/camera/ui/IndicatorControlBar.java')
-rw-r--r--src/com/android/camera/ui/IndicatorControlBar.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/camera/ui/IndicatorControlBar.java b/src/com/android/camera/ui/IndicatorControlBar.java
index ff986ee..3838508 100644
--- a/src/com/android/camera/ui/IndicatorControlBar.java
+++ b/src/com/android/camera/ui/IndicatorControlBar.java
@@ -39,6 +39,14 @@ public class IndicatorControlBar extends IndicatorControl implements
super(context, attrs);
}
+ @Override
+ protected void onFinishInflate() {
+ mZoomIcon = (ImageView) findViewById(R.id.zoom_control_icon);
+ mSecondLevelIcon = (ImageView)
+ findViewById(R.id.second_level_indicator_bar_icon);
+ mSecondLevelIcon.setOnClickListener(this);
+ }
+
public void initialize(Context context, PreferenceGroup group,
String flashSetting, boolean zoomSupported) {
// From UI spec, we have camera_flash setting on the first level.
@@ -50,13 +58,10 @@ public class IndicatorControlBar extends IndicatorControl implements
// add Zoom Icon.
if (zoomSupported) {
- mZoomIcon = (ImageView) findViewById(R.id.zoom_control_icon);
mZoomIcon.setOnTouchListener(this);
mZoomIcon.setVisibility(View.VISIBLE);
}
- mSecondLevelIcon = (ImageView) findViewById(R.id.second_level_indicator_bar_icon);
- mSecondLevelIcon.setOnClickListener(this);
requestLayout();
}