toTab() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File dir = new File(Constants.APP_IMAGE_DIR);
dir.mkdirs();
- File photoFile = new File(dir.getAbsolutePath()+"/"+System.currentTimeMillis()+".jpg");
+ File photoFile = new File(dir.getAbsolutePath() + "/" + System.currentTimeMillis() + ".jpg");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
- startActivityForResult(intent,TAKE_PHOTO_REQUEST_CODE);
+ startActivityForResult(intent, TAKE_PHOTO_REQUEST_CODE);
return photoFile;
}
- private void showQRFragment(){
+ private void showQRFragment() {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
- if(qrFragment==null){
+ if (qrFragment == null) {
qrFragment = new GroupQRFragment();
Bundle bundle = new Bundle();
- bundle.putString("name",groupName);
- bundle.putInt("avatar",defaultAvatarId);
+ bundle.putString("name", groupName);
+ bundle.putInt("avatar", defaultAvatarId);
qrFragment.setArguments(bundle);
- ft.add(R.id.content_fragment,qrFragment);
- }else{
+ ft.add(R.id.content_fragment, qrFragment);
+ } else {
ft.show(qrFragment);
}
ft.commitAllowingStateLoss();
}
- private void showPhotoFragment(){
+ private void showPhotoFragment() {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
- if(photoFragment==null){
+ if (photoFragment == null) {
photoFragment = new GroupPhotoFragment();
Bundle bundle = new Bundle();
- bundle.putString("groupId",groupId);
+ bundle.putString("groupId", groupId);
photoFragment.setArguments(bundle);
- ft.add(R.id.content_fragment,photoFragment);
- }else{
+ ft.add(R.id.content_fragment, photoFragment);
+ } else {
ft.show(photoFragment);
}
ft.commitAllowingStateLoss();
}
+
+ private void showMask() {
+ cameraBtn.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ int mHeight = getSupportActionBar().getHeight();
+ int left = cameraBtn.getLeft();
+ int right = cameraBtn.getRight();
+ int top = cameraBtn.getTop() + mHeight;
+ int bottom = cameraBtn.getBottom() + mHeight;
+ int loc[] = {left, top, right, bottom};
+ Intent intent = new Intent(GroupActivity.this, TipsActivity.class);
+ intent.putExtra("loc", loc);
+ startActivity(intent);
+ }
+ });
+ }
+ }, 500);
+ }
}