当前位置: 首页>>代码示例>>Java>>正文


Java CropImageView类代码示例

本文整理汇总了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);
}
 
开发者ID:chteuchteu,项目名称:Blurify,代码行数:19,代码来源:Activity_Main.java

示例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);
}
 
开发者ID:qbeenslee,项目名称:Nepenthes-Android,代码行数:17,代码来源:CropActivity.java

示例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);
}
 
开发者ID:abicelis,项目名称:CreditCardExpenseManager,代码行数:31,代码来源:ImageCropperActivity.java

示例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");
}
 
开发者ID:lethalskillzz,项目名称:Mimix-Client,代码行数:37,代码来源:MyProfilePicActivity.java

示例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;
    }
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:30,代码来源:CropOverlayView.java

示例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);
}
 
开发者ID:bmbstack,项目名称:android-kit-old,代码行数:16,代码来源:PhotoPickClipFragment.java

示例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;
    }
 
开发者ID:wangeason,项目名称:PhotoViewCropper,代码行数:30,代码来源:CropOverlayView.java

示例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);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:15,代码来源:CropImageActivity.java

示例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;
	}
}
 
开发者ID:chteuchteu,项目名称:Blurify,代码行数:33,代码来源:Activity_Main.java

示例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);
}
 
开发者ID:qbeenslee,项目名称:Nepenthes-Android,代码行数:10,代码来源:UploadImageActivity.java

示例11: ImageLoaderTask

import com.edmodo.cropper.CropImageView; //导入依赖的package包/类
public ImageLoaderTask(Context context, CropImageView cropImageView) {
    mContext = context;
    mCropImageView = cropImageView;
}
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:5,代码来源:ImageLoaderTask.java

示例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;
}
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:18,代码来源:CropFragment.java


注:本文中的com.edmodo.cropper.CropImageView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。