Search in sources :

Example 1 with Rotatable

use of com.android.camera.ui.Rotatable in project android_packages_apps_Camera by CyanogenMod.

the class VideoModule method setOrientationIndicator.

private void setOrientationIndicator(int orientation, boolean animation) {
    Rotatable[] indicators = { mBgLearningMessageRotater, mReviewDoneButton, mReviewPlayButton };
    for (Rotatable indicator : indicators) {
        if (indicator != null)
            indicator.setOrientation(orientation, animation);
    }
    if (mGestures != null) {
        mGestures.setOrientation(orientation);
    }
    // icon.
    if (mReviewCancelButton instanceof RotateLayout) {
        mReviewCancelButton.setOrientation(orientation, animation);
    }
    // the width is not enough.
    if (mLabelsLinearLayout != null) {
        if (((orientation / 90) & 1) == 0) {
            mLabelsLinearLayout.setOrientation(LinearLayout.VERTICAL);
        } else {
            mLabelsLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
        }
    }
    mRecordingTimeRect.setOrientation(0, animation);
}
Also used : Rotatable(com.android.camera.ui.Rotatable) RotateLayout(com.android.camera.ui.RotateLayout)

Example 2 with Rotatable

use of com.android.camera.ui.Rotatable in project android_packages_apps_Camera by CyanogenMod.

the class PanoramaModule method setViews.

private void setViews(Resources appRes) {
    mCaptureState = CAPTURE_STATE_VIEWFINDER;
    mPanoProgressBar = (PanoProgressBar) mRootView.findViewById(R.id.pano_pan_progress_bar);
    mPanoProgressBar.setBackgroundColor(appRes.getColor(R.color.pano_progress_empty));
    mPanoProgressBar.setDoneColor(appRes.getColor(R.color.pano_progress_done));
    mPanoProgressBar.setIndicatorColor(mIndicatorColor);
    mPanoProgressBar.setOnDirectionChangeListener(new PanoProgressBar.OnDirectionChangeListener() {

        @Override
        public void onDirectionChange(int direction) {
            if (mCaptureState == CAPTURE_STATE_MOSAIC) {
                showDirectionIndicators(direction);
            }
        }
    });
    mLeftIndicator = mRootView.findViewById(R.id.pano_pan_left_indicator);
    mRightIndicator = mRootView.findViewById(R.id.pano_pan_right_indicator);
    mLeftIndicator.setEnabled(false);
    mRightIndicator.setEnabled(false);
    mTooFastPrompt = (TextView) mRootView.findViewById(R.id.pano_capture_too_fast_textview);
    // This mPreviewArea also shows the border for visual "too fast" indication.
    mPreviewArea = (LayoutNotifyView) mRootView.findViewById(R.id.pano_preview_area);
    mPreviewArea.setOnLayoutChangeListener(this);
    mSavingProgressBar = (PanoProgressBar) mRootView.findViewById(R.id.pano_saving_progress_bar);
    mSavingProgressBar.setIndicatorWidth(0);
    mSavingProgressBar.setMaxProgress(100);
    mSavingProgressBar.setBackgroundColor(appRes.getColor(R.color.pano_progress_empty));
    mSavingProgressBar.setDoneColor(appRes.getColor(R.color.pano_progress_indication));
    mCaptureIndicator = mRootView.findViewById(R.id.pano_capture_indicator);
    mReviewLayout = mRootView.findViewById(R.id.pano_review_layout);
    mReview = (ImageView) mRootView.findViewById(R.id.pano_reviewarea);
    View cancelButton = mRootView.findViewById(R.id.pano_review_cancel_button);
    cancelButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            if (mPaused || mCameraTexture == null)
                return;
            cancelHighResComputation();
        }
    });
    mShutterButton = mActivity.getShutterButton();
    mShutterButton.setImageResource(R.drawable.btn_new_shutter);
    mShutterButton.setOnShutterButtonListener(this);
    if (mActivity.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
        Rotatable view = (Rotatable) mRootView.findViewById(R.id.pano_rotate_reviewarea);
        view.setOrientation(270, false);
    }
}
Also used : Rotatable(com.android.camera.ui.Rotatable) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) GLRootView(com.android.gallery3d.ui.GLRootView) LayoutNotifyView(com.android.camera.ui.LayoutNotifyView)

Aggregations

Rotatable (com.android.camera.ui.Rotatable)2 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 LayoutNotifyView (com.android.camera.ui.LayoutNotifyView)1 RotateLayout (com.android.camera.ui.RotateLayout)1 GLRootView (com.android.gallery3d.ui.GLRootView)1