1,拍照打开本地图库裁剪先贴代码适配了4.0,5.0,6.0 和各种机型
//通用相册头像选择
private void showDialog() {
View view = getLayoutInflater().inflate(R.layout.photo_choose_dialog,null);
photos =(Button) view.findViewById(R.id.photo);
gallery =(Button) view.findViewById(R.id.gallery);
photocancle =(Button) view.findViewById(R.id.photocancle);
photos.setOnClickListener(this);
gallery.setOnClickListener(this);
photocancle.setOnClickListener(this);
view.getBackground().setAlpha(150);
dialog = new Dialog(PersonalInfo.this, R.style.transparentFrameWindowStyle);
dialog.setContentView(view, new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
Window window = dialog.getWindow();
// 设置显示动画
window.setWindowAnimations(R.style.main_menu_animstyle);
WindowManager.LayoutParams wl = window.getAttributes();
wl.x = 0;
wl.y = getWindowManager().getDefaultDisplay().getHeight();
// 以下这两句是为了保证按钮可以水平满屏
wl.width = Vie