Search in sources :

Example 1 with RotateImageView

use of com.android.camera.ui.RotateImageView in project android_packages_apps_Snap by LineageOS.

the class CameraControls method setOrientation.

public void setOrientation(int orientation, boolean animation) {
    mOrientation = orientation;
    View[] views = { mSceneModeSwitcher, mFilterModeSwitcher, mFrontBackSwitcher, TsMakeupManager.HAS_TS_MAKEUP ? mTsMakeupSwitcher : mHdrSwitcher, mBokehSwitcher, mMenu, mPreview, mSwitcher, mMute, mReviewRetakeButton, mReviewCancelButton, mReviewDoneButton, mExitPanorama };
    for (View v : views) {
        if (v != null) {
            ((RotateImageView) v).setOrientation(orientation, animation);
        }
    }
    layoutRemaingPhotos();
}
Also used : RotateImageView(com.android.camera.ui.RotateImageView) RotateImageView(com.android.camera.ui.RotateImageView) View(android.view.View) TextView(android.widget.TextView)

Example 2 with RotateImageView

use of com.android.camera.ui.RotateImageView in project android_packages_apps_Snap by LineageOS.

the class GridAdapter method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final boolean isSecureCamera = getIntent().getBooleanExtra(CameraUtil.KEY_IS_SECURE_CAMERA, false);
    if (isSecureCamera) {
        setShowInLockScreen();
    }
    setContentView(R.layout.scene_mode_menu_layout);
    mSettingsManager = SettingsManager.getInstance();
    mCurrentScene = mSettingsManager.getValueIndex(SettingsManager.KEY_SCENE_MODE);
    mEntries = mSettingsManager.getEntries(SettingsManager.KEY_SCENE_MODE);
    mThumbnails = mSettingsManager.getResource(SettingsManager.KEY_SCENE_MODE, SettingsManager.RESOURCE_TYPE_THUMBNAIL);
    mNumElement = mThumbnails.length;
    int pages = mNumElement / mElemPerPage;
    if (mNumElement % mElemPerPage != 0)
        pages++;
    mNumPage = pages;
    mAdapter = new MyPagerAdapter(this);
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setOverScrollMode(ViewPager.OVER_SCROLL_NEVER);
    mPager.setAdapter(mAdapter);
    mCloseButton = findViewById(R.id.close_button);
    mCloseButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    int pageCount = mAdapter.getCount();
    mDotsView = (DotsView) findViewById(R.id.page_indicator);
    mPager.setCurrentItem(mCurrentScene / mElemPerPage);
    mDotsView.update(mCurrentScene / mElemPerPage, 0f);
    if (pageCount > 1) {
        mDotsView.setItems(new PageItems(pageCount));
        mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {

            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
                mDotsView.update(position, positionOffset);
            }
        });
    } else {
        mDotsView.setVisibility(View.GONE);
    }
    mButton = (RotateImageView) findViewById(R.id.setting_button);
    mButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getBaseContext(), SettingsActivity.class);
            intent.putExtra(CameraUtil.KEY_IS_SECURE_CAMERA, isSecureCamera);
            startActivity(intent);
            finish();
        }
    });
}
Also used : Intent(android.content.Intent) GridView(android.widget.GridView) RotateImageView(com.android.camera.ui.RotateImageView) ImageView(android.widget.ImageView) DotsView(com.android.camera.ui.DotsView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ViewPager(android.support.v4.view.ViewPager)

Example 3 with RotateImageView

use of com.android.camera.ui.RotateImageView in project android_packages_apps_Snap by LineageOS.

the class PhotoUI method initializeSecondTime.

// called from onResume every other time
public void initializeSecondTime(Camera.Parameters params) {
    initializeZoom(params);
    if (mController.isImageCaptureIntent()) {
        hidePostCaptureAlert();
    }
    if (mMenu != null) {
        mMenu.reloadPreferences();
    }
    RotateImageView muteButton = (RotateImageView) mRootView.findViewById(R.id.mute_button);
    muteButton.setVisibility(View.GONE);
}
Also used : RotateImageView(com.android.camera.ui.RotateImageView)

Example 4 with RotateImageView

use of com.android.camera.ui.RotateImageView in project android_packages_apps_Snap by LineageOS.

the class PhotoUI method setOrientation.

public void setOrientation(int orientation, boolean animation) {
    mOrientation = orientation;
    mCameraControls.setOrientation(orientation, animation);
    if (mMenuLayout != null)
        mMenuLayout.setOrientation(orientation, animation);
    if (mSubMenuLayout != null)
        mSubMenuLayout.setOrientation(orientation, animation);
    if (mPreviewMenuLayout != null) {
        ViewGroup vg = (ViewGroup) mPreviewMenuLayout.getChildAt(0);
        if (vg != null)
            vg = (ViewGroup) vg.getChildAt(0);
        if (vg != null) {
            for (int i = vg.getChildCount() - 1; i >= 0; --i) {
                RotateLayout l = (RotateLayout) vg.getChildAt(i);
                l.setOrientation(orientation, animation);
            }
        }
    }
    if (mMakeupMenuLayout != null) {
        View view = mMakeupMenuLayout.getChildAt(0);
        if (view instanceof RotateLayout) {
            for (int i = mMakeupMenuLayout.getChildCount() - 1; i >= 0; --i) {
                RotateLayout l = (RotateLayout) mMakeupMenuLayout.getChildAt(i);
                l.setOrientation(orientation, animation);
            }
        } else {
            ViewGroup vg = (ViewGroup) mMakeupMenuLayout.getChildAt(1);
            if (vg != null) {
                for (int i = vg.getChildCount() - 1; i >= 0; --i) {
                    ViewGroup vewiGroup = (ViewGroup) vg.getChildAt(i);
                    if (vewiGroup instanceof RotateLayout) {
                        RotateLayout l = (RotateLayout) vewiGroup;
                        l.setOrientation(orientation, animation);
                    }
                }
            }
        }
    }
    if (mCountDownView != null)
        mCountDownView.setOrientation(orientation);
    RotateTextToast.setOrientation(orientation);
    if (mFaceView != null) {
        mFaceView.setDisplayRotation(orientation);
    }
    if (mZoomRenderer != null) {
        mZoomRenderer.setOrientation(orientation);
    }
    if (mReviewImage != null) {
        RotateImageView v = (RotateImageView) mReviewImage;
        v.setOrientation(orientation, animation);
    }
    mOrientation = orientation;
}
Also used : RotateImageView(com.android.camera.ui.RotateImageView) ViewGroup(android.view.ViewGroup) RotateLayout(com.android.camera.ui.RotateLayout) SurfaceView(android.view.SurfaceView) ImageView(android.widget.ImageView) CameraRootView(com.android.camera.ui.CameraRootView) View(android.view.View) ListView(android.widget.ListView) RotateImageView(com.android.camera.ui.RotateImageView) CountDownView(com.android.camera.ui.CountDownView) SelfieFlashView(com.android.camera.ui.SelfieFlashView) FaceView(com.android.camera.ui.FaceView) Point(android.graphics.Point)

Example 5 with RotateImageView

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

the class VideoModule method initializeControlByIntent.

private void initializeControlByIntent() {
    mBlocker = mRootView.findViewById(R.id.blocker);
    mMenu = mRootView.findViewById(R.id.menu);
    mMenu.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mPieRenderer != null) {
                mPieRenderer.showInCenter();
            }
        }
    });
    mOnScreenIndicators = mRootView.findViewById(R.id.on_screen_indicators);
    mFlashIndicator = (ImageView) mRootView.findViewById(R.id.menu_flash_indicator);
    mExposureIndicator = (ImageView) mOnScreenIndicators.findViewById(R.id.menu_exposure_indicator);
    mHdrIndicator = (ImageView) mOnScreenIndicators.findViewById(R.id.menu_hdr_indicator);
    if (mIsVideoCaptureIntent) {
        mActivity.hideSwitcher();
        // Cannot use RotateImageView for "done" and "cancel" button because
        // the tablet layout uses RotateLayout, which cannot be cast to
        // RotateImageView.
        mReviewDoneButton = (Rotatable) mRootView.findViewById(R.id.btn_done);
        mReviewCancelButton = (Rotatable) mRootView.findViewById(R.id.btn_cancel);
        mReviewPlayButton = (RotateImageView) mRootView.findViewById(R.id.btn_play);
        ((View) mReviewCancelButton).setVisibility(View.VISIBLE);
        ((View) mReviewDoneButton).setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                onReviewDoneClicked(v);
            }
        });
        ((View) mReviewCancelButton).setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                onReviewCancelClicked(v);
            }
        });
        ((View) mReviewPlayButton).setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                onReviewPlayClicked(v);
            }
        });
        // layout is not a TwoStateImageView.
        if (mReviewDoneButton instanceof TwoStateImageView) {
            ((TwoStateImageView) mReviewDoneButton).enableFilter(false);
        }
    }
}
Also used : TwoStateImageView(com.android.camera.ui.TwoStateImageView) OnClickListener(android.view.View.OnClickListener) TwoStateImageView(com.android.camera.ui.TwoStateImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) PreviewSurfaceView(com.android.camera.ui.PreviewSurfaceView) RotateImageView(com.android.camera.ui.RotateImageView)

Aggregations

RotateImageView (com.android.camera.ui.RotateImageView)7 View (android.view.View)6 TextView (android.widget.TextView)5 ImageView (android.widget.ImageView)4 Intent (android.content.Intent)2 Point (android.graphics.Point)2 ViewPager (android.support.v4.view.ViewPager)2 SurfaceView (android.view.SurfaceView)2 OnClickListener (android.view.View.OnClickListener)2 ListView (android.widget.ListView)2 CameraRootView (com.android.camera.ui.CameraRootView)2 DotsView (com.android.camera.ui.DotsView)2 FaceView (com.android.camera.ui.FaceView)2 Bitmap (android.graphics.Bitmap)1 Display (android.view.Display)1 ViewGroup (android.view.ViewGroup)1 Window (android.view.Window)1 WindowManager (android.view.WindowManager)1 AdapterView (android.widget.AdapterView)1 GridView (android.widget.GridView)1