use of com.android.camera.ui.RotateImageView in project android_packages_apps_Snap by LineageOS.
the class BestpictureActivity method onCreate.
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
mActivity = this;
Intent intent = getIntent();
String action = intent.getAction();
if (INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action) || ACTION_IMAGE_CAPTURE_SECURE.equals(action)) {
mSecureCamera = true;
} else {
mSecureCamera = intent.getBooleanExtra(SECURE_CAMERA_EXTRA, false);
}
if (mSecureCamera) {
// Change the window flags so that secure camera can show when locked
Window win = getWindow();
WindowManager.LayoutParams params = win.getAttributes();
params.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
win.setAttributes(params);
}
mFilesPath = getFilesDir() + "/Bestpicture";
setContentView(R.layout.bestpicture_editor);
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
mWidth = size.x / 4;
mHeight = size.y / 4;
mNamedImages = new PhotoModule.NamedImages();
mImageItems = new ImageItems(mActivity);
mDotsView = (DotsView) findViewById(R.id.dots_view);
mDotsView.setItems(mImageItems);
mPlaceHolderUri = getIntent().getData();
mImagePager = (ViewPager) findViewById(R.id.bestpicture_pager);
mImagePagerAdapter = new ImagePagerAdapter(getFragmentManager());
mImagePager.setAdapter(mImagePagerAdapter);
mImagePager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
mDotsView.update(position, positionOffset);
}
@Override
public void onPageSelected(int position) {
}
});
findViewById(R.id.bestpicture_done).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
int choosenCount = 0;
for (int i = 0; i < mImageItems.mChosen.length; i++) {
if (mImageItems.mChosen[i]) {
choosenCount++;
}
}
boolean showSaveDialog = CameraUtil.loadDialogShowConfig(BestpictureActivity.this, CameraUtil.KEY_SAVE);
if (showSaveDialog) {
// add save dialog
initSaveDialog(CameraUtil.MODE_TWO_BT, choosenCount);
mDialog.show();
setDialogLayoutPararms();
} else {
saveImages(choosenCount, false);
}
}
});
findViewById(R.id.delete_best).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
boolean showDeleteDialog = CameraUtil.loadDialogShowConfig(BestpictureActivity.this, CameraUtil.KEY_DELETE);
if (showDeleteDialog) {
initDeleteDialog(CameraUtil.MODE_TWO_BT);
mDialog.show();
setDialogLayoutPararms();
} else {
backToViewfinder();
}
}
});
RotateImageView moreView = (RotateImageView) findViewById(R.id.best_more);
Bitmap mMoreBp = BitmapFactory.decodeResource(getResources(), R.drawable.more_options);
mMoreBp = CameraUtil.adjustPhotoRotation(mMoreBp, 90);
moreView.setImageBitmap(mMoreBp);
moreView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
initOverFlow(v);
}
});
}
use of com.android.camera.ui.RotateImageView in project android_packages_apps_Snap by LineageOS.
the class VideoUI method initializeControlByIntent.
private void initializeControlByIntent() {
mMenuButton = mRootView.findViewById(R.id.menu);
mMenuButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mVideoMenu.openFirstLevel();
}
});
mCameraControls = (CameraControls) mRootView.findViewById(R.id.camera_controls);
if (mController.isVideoCaptureIntent()) {
hideSwitcher();
mActivity.getLayoutInflater().inflate(R.layout.review_module_control, (ViewGroup) mCameraControls);
// Cannot use RotateImageView for "done" and "cancel" button because
// the tablet layout uses RotateLayout, which cannot be cast to
// RotateImageView.
mReviewDoneButton = mRootView.findViewById(R.id.done_button);
mReviewCancelButton = mRootView.findViewById(R.id.btn_cancel);
mReviewPlayButton = mRootView.findViewById(R.id.btn_play);
mReviewCancelButton.setVisibility(View.VISIBLE);
mReviewDoneButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mController.onReviewDoneClicked(v);
}
});
mReviewCancelButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mController.onReviewCancelClicked(v);
}
});
mReviewPlayButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mController.onReviewPlayClicked(v);
}
});
}
}
Aggregations