public void onIndicatorEvent(int event) { switch (event) { case OnIndicatorEventListener.EVENT_ENTER_ZOOM_CONTROL: mIndicatorControlWheel.setVisibility(View.GONE); mZoomControlWheel.setVisibility(View.VISIBLE); mZoomControlWheel.startZoomControl(); break; case OnIndicatorEventListener.EVENT_LEAVE_ZOOM_CONTROL: mZoomControlWheel.setVisibility(View.GONE); mIndicatorControlWheel.setVisibility(View.VISIBLE); break; } }
public void initialize( Context context, PreferenceGroup group, boolean isZoomSupported, String[] keys, String[] otherSettingKeys) { mShutterButtonRadius = IndicatorControlWheelContainer.SHUTTER_BUTTON_RADIUS; mStrokeWidth = Util.dpToPixel(IndicatorControlWheelContainer.STROKE_WIDTH); mWheelRadius = mShutterButtonRadius + mStrokeWidth * 0.5; setPreferenceGroup(group); // Add the ZoomControl if supported. if (isZoomSupported) { mZoomControl = (ZoomControlWheel) findViewById(R.id.zoom_control); mZoomControl.setVisibility(View.VISIBLE); } // Add CameraPicker. initializeCameraPicker(); // Add second-level Indicator Icon. mSecondLevelIcon = addImageButton(context, R.drawable.ic_settings_holo_light, true); mSecondLevelStartIndex = getChildCount(); // Add second-level buttons. mCloseIcon = addImageButton(context, R.drawable.btn_wheel_close_settings, false); addControls(keys, otherSettingKeys); // The angle(in radians) of each icon for touch events. mChildRadians = new double[getChildCount()]; presetFirstLevelChildRadians(); presetSecondLevelChildRadians(); mInitialized = true; }