本文整理汇总了Java中com.edmodo.cropper.CropImageView类的典型用法代码示例。如果您正苦于以下问题:Java CropImageView类的具体用法?Java CropImageView怎么用?Java CropImageView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CropImageView类属于com.edmodo.cropper包,在下文中一共展示了CropImageView类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConfigurationChanged
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int id = getResources().getIdentifier("config_enableTranslucentDecor", "bool", "android");
if (id != 0 && getResources().getBoolean(id)) // Translucent available
findViewById(R.id.buttonsContainer).setPadding(0, 0, 0, Util.getSoftbuttonsbarHeight(this));
}
View cropImageView = findViewById(R.id.CropImageView);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT)
params.setMargins(0, 0, 0, Util.getSoftbuttonsbarHeight(this) + findViewById(R.id.buttonsContainer).getHeight());
else
params.setMargins(0, 0, 0, findViewById(R.id.buttonsContainer).getHeight());
params.addRule(RelativeLayout.CENTER_IN_PARENT);
cropImageView.setLayoutParams(params);
}
示例2: initControls
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
private void initControls() {
//*****appbar******//
Appbar appbar = getAppbar();
appbar.setLeftDrawable(R.drawable.appbar_close_bg);
appbar.setRightDrawable(R.drawable.appbar_completed_bg);
appbar.setOnRightAction(this);
//*****controls*****//
cropImageView = (CropImageView) findViewById(R.id.cropimageview);
findViewById(R.id.button_rate_1_1).setOnClickListener(this);
findViewById(R.id.button_rate_2_3).setOnClickListener(this);
findViewById(R.id.button_rate_3_4).setOnClickListener(this);
findViewById(R.id.button_rate_9_16).setOnClickListener(this);
findViewById(R.id.button_rate_origin).setOnClickListener(this);
findViewById(R.id.imagebutton_rotate).setOnClickListener(this);
setImage(originPath);
}
示例3: onCreate
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_cropper);
try {
imagePath = getIntent().getStringExtra(IMAGE_PATH);
originalImage = BitmapFactory.decodeFile(imagePath);
} catch (Exception e) {
originalImage = null;
}
if (originalImage == null) {
Toast.makeText(this, "No image to crop!", Toast.LENGTH_SHORT).show();
finish();
}
cropImageView = (CropImageView) findViewById(R.id.image_cropper_crop_image_view);
cropImageView.setImageBitmap(originalImage);
cropImageView.setGuidelines(2);
ImageButton cropButton = (ImageButton) findViewById(R.id.image_cropper_crop_button);
ImageButton rotateButton = (ImageButton) findViewById(R.id.image_cropper_rotate_button);
ImageButton cancelButton = (ImageButton) findViewById(R.id.image_cropper_cancel_button);
cropButton.setOnClickListener(this);
rotateButton.setOnClickListener(this);
cancelButton.setOnClickListener(this);
}
示例4: onCreate
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_profile_pic);
//getActionBar().setDisplayHomeAsUpEnabled(true);
utilhelper = new Util_Database(this);
UserID = utilhelper.getUSER_ID();
profpic=(ImageView)findViewById(R.id.disp_myprofpic);
profpic.setMinimumHeight(350);
profpic.setMinimumWidth(350);
profpic.setMaxHeight(550);
profpic.setMaxWidth(550);
cropImageView = (CropImageView) findViewById(R.id.CropImageView);
postppic_btn = (ImageButton) findViewById(R.id.postppic_btn);
ppic_loading = (ProgressBar) findViewById(R.id.ppic_loading);
/*if(utilhelper.getFACEisIMG(UserID).equals("YES"))
{
Bitmap bmp = BitmapFactory.decodeByteArray(utilhelper.getFACEPPIC(UserID), 0, utilhelper.getFACEPPIC(UserID).length);
profpic.setImageBitmap(bmp);
}
else
{
profpic.setImageResource(R.drawable.me);
}*/
//Getprofpic();
new BMPAsyncTask().execute("img_"+UserID+".png");
}
示例5: init
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
private void init(Context context) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
mHandleRadius = HandleUtil.getTargetRadius(context);
mSnapRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
SNAP_RADIUS_DP,
displayMetrics);
mBorderPaint = PaintUtil.newBorderPaint(context);
mGuidelinePaint = PaintUtil.newGuidelinePaint();
mBackgroundPaint = PaintUtil.newBackgroundPaint(context);
mCornerPaint = PaintUtil.newCornerPaint(context);
// Sets the values for the corner sizes
mCornerOffset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
DEFAULT_CORNER_OFFSET_DP,
displayMetrics);
mCornerExtension = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
DEFAULT_CORNER_EXTENSION_DP,
displayMetrics);
mCornerLength = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
DEFAULT_CORNER_LENGTH_DP,
displayMetrics);
// Sets guidelines to default until specified otherwise
mGuidelines = CropImageView.DEFAULT_GUIDELINES;
}
示例6: onViewCreated
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
cropImageView = (CropImageView) view.findViewById(R.id.cropImageView);
cropImageView.setDrawingCacheEnabled(true);
//cropImageView.setAspectRatio(10, 10);
//cropImageView.setFixedAspectRatio(true);
imageLoadFail = (ImageView)view.findViewById(R.id.imageLoadFail);
circleLoading = (DonutProgress)view.findViewById(R.id.circleLoading);
llBottomOptions = (LinearLayout)view.findViewById(R.id.llBottomOptions);
done = (TextView)view.findViewById(R.id.done);
cancel = (TextView)view.findViewById(R.id.cancel);
done.setOnClickListener(mOnClickListener);
cancel.setOnClickListener(mOnClickListener);
}
示例7: init
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
private void init(Context context) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
mHandleRadius = HandleUtil.getTargetRadius(context);
mSnapRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
SNAP_RADIUS_DP,
displayMetrics);
mBorderPaint = PaintUtil.newBorderPaint(context);
mGuidelinePaint = PaintUtil.newGuidelinePaint();
mBackgroundPaint = PaintUtil.newBackgroundPaint(context);
mCornerPaint = PaintUtil.newCornerPaint(context);
// Sets the values for the corner sizes
mCornerOffset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
DEFAULT_CORNER_OFFSET_DP,
displayMetrics);
mCornerExtension = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
DEFAULT_CORNER_EXTENSION_DP,
displayMetrics);
mCornerLength = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
DEFAULT_CORNER_LENGTH_DP,
displayMetrics);
// Sets guidelines to default until specified otherwise
mGuidelines = CropImageView.DEFAULT_GUIDELINES;
}
示例8: onCreate
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
protected void onCreate(Bundle bundle)
{
super.onCreate(bundle);
setContentView(0x7f030019);
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction("android.intent.action.GET_CONTENT");
startActivityForResult(intent, 18);
c = (CropImageView)findViewById(0x7f0a009b);
g = findViewById(0x7f0a00a2);
g.setOnClickListener(this);
h = findViewById(0x7f0a00a0);
h.setOnClickListener(this);
}
示例9: onBackPressed
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
@Override
public void onBackPressed() {
if (isAboutShown) {
closeAbout();
return;
}
switch (state) {
case ST_UNKNOWN:
super.onBackPressed();
break;
case ST_CROP:
findViewById(R.id.getimg).setVisibility(View.VISIBLE);
findViewById(R.id.actions1).setVisibility(View.GONE);
findViewById(R.id.container).setVisibility(View.GONE);
findViewById(R.id.CropImageView).setVisibility(View.GONE);
state = ST_UNKNOWN;
break;
case ST_BLUR:
seekBar.setProgress(0);
findViewById(R.id.container).setVisibility(View.GONE);
findViewById(R.id.mask).setVisibility(View.VISIBLE);
findViewById(R.id.CropImageView).setVisibility(View.VISIBLE);
findViewById(R.id.blurryBackground).setVisibility(View.VISIBLE);
findViewById(R.id.blurryBackground_darkMask).setVisibility(View.VISIBLE);
findViewById(R.id.actions1).setVisibility(View.VISIBLE);
findViewById(R.id.actions2).setVisibility(View.GONE);
state = ST_CROP;
launchCrop(false);
break;
}
}
示例10: initControls
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
private void initControls() {
Appbar appbar = getAppbar();
appbar.setLeftDrawable(R.drawable.appbar_close_bg);
appbar.setRightDrawable(R.drawable.appbar_completed_bg);
appbar.setOnRightAction(this);
cropImageView = (CropImageView) findViewById(R.id.crop_upload_image);
imgRotate = (ImageView) findViewById(R.id.img_upload_rotate);
imgRotate.setOnClickListener(this);
}
示例11: ImageLoaderTask
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
public ImageLoaderTask(Context context, CropImageView cropImageView) {
mContext = context;
mCropImageView = cropImageView;
}
示例12: onCreateView
import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_crop, container, false);
v.findViewById(R.id.btn_rotate).setOnClickListener(this);
v.findViewById(R.id.btn_crop).setOnClickListener(this);
cropImageView = (CropImageView) v.findViewById(R.id.CropImageView);
cropImageView.setGuidelines(1);
Uri uri = getActivity().getIntent().getData();
new ImageLoaderTask(getActivity(), cropImageView).execute(uri);
return v;
}