コード例 #1
0
  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;
  }