Search in sources :

Example 1 with LayoutNotifyView

use of com.android.camera.ui.LayoutNotifyView 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

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 Rotatable (com.android.camera.ui.Rotatable)1 GLRootView (com.android.gallery3d.ui.GLRootView)1