I'm now working on some project and actually what I want to do is I will give a user a circle and when he clicks it , he will be able to choose photo either from gallery or with his/her cam , I've actually draw my custom shape of the circle , and then place image into it using Glide-Transformation Library , but the problem is I can't scroll inside this circle to show some specific part of user's image . Any Solution will be helpful . My XML file looks like this :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D2DDD7"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.karim.helloworld.MainActivity">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:id="@+id/imgView"
android:padding="5dp"
android:scaleType="centerCrop"
android:background="@drawable/circle_image"/>
</RelativeLayout>
and my class activity is :
package com.example.karim.helloworld;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.CropCircleTransformation;
public class MainActivity extends AppCompatActivity {
ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = (ImageView) findViewById(R.id.imgView);
Glide.with(this).load(R.drawable.pk).bitmapTransform(new CropCircleTransformation(getApplicationContext()))
.into(imageView);
}
}]