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();
}
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();
}
});
}
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);
}
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;
}
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);
}
}
}
Aggregations