Home | History | Annotate | Download | only in ui
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.camera.ui;
     18 
     19 import android.content.Context;
     20 
     21 import com.android.camera.CameraSettings;
     22 import com.android.camera.ListPreference;
     23 import com.android.camera.PreferenceGroup;
     24 
     25 public class CamcorderHeadUpDisplay extends HeadUpDisplay {
     26 
     27     private static final String TAG = "CamcorderHeadUpDisplay";
     28 
     29     private OtherSettingsIndicator mOtherSettings;
     30     private int mInitialOrientation;
     31 
     32     public CamcorderHeadUpDisplay(Context context) {
     33         super(context);
     34     }
     35 
     36     public void initialize(Context context, PreferenceGroup group,
     37             int initialOrientation) {
     38         mInitialOrientation = initialOrientation;
     39         super.initialize(context, group);
     40     }
     41 
     42     @Override
     43     protected void initializeIndicatorBar(
     44             Context context, PreferenceGroup group) {
     45         super.initializeIndicatorBar(context, group);
     46 
     47         ListPreference[] prefs = getListPreferences(group,
     48                 CameraSettings.KEY_FOCUS_MODE,
     49                 CameraSettings.KEY_EXPOSURE,
     50                 CameraSettings.KEY_SCENE_MODE,
     51                 CameraSettings.KEY_PICTURE_SIZE,
     52                 CameraSettings.KEY_JPEG_QUALITY,
     53                 CameraSettings.KEY_COLOR_EFFECT);
     54 
     55         mOtherSettings = new OtherSettingsIndicator(context, prefs);
     56         mOtherSettings.setOnRestorePreferencesClickedRunner(new Runnable() {
     57             public void run() {
     58                 if (mListener != null) {
     59                     mListener.onRestorePreferencesClicked();
     60                 }
     61             }
     62         });
     63         mIndicatorBar.addComponent(mOtherSettings);
     64 
     65         addIndicator(context, group, CameraSettings.KEY_WHITE_BALANCE);
     66         addIndicator(context, group, CameraSettings.KEY_VIDEOCAMERA_FLASH_MODE);
     67         addIndicator(context, group, CameraSettings.KEY_VIDEO_QUALITY);
     68         addIndicator(context, group, CameraSettings.KEY_CAMERA_ID);
     69 
     70         mIndicatorBar.setOrientation(mInitialOrientation);
     71     }
     72 }
     73