In this Android Studio article iam going to show you How To Create Circular ImageView. so for good explanation you can watch the video for this article at the end .
Also you can read more android development articles
1: Android Development Articles
Also you can check Python GUI Development Tutorials in the below link.
1: PyQt5 GUI Development Tutorials
2: TKinter GUI Development Tutorials
3: Pyside2 GUI Development Tutorials
4: Kivy GUI Development Tutorials
5: wxPython GUI Development Tutorials
1: First of all create a new project in your Android Studio, and choose Empty Activity also
iam using API 20 for this project.
2: After that you need to open your build.gradle(module:app) file, and add this library
in the dependencies section.
1 |
implementation 'de.hdodenhof:circleimageview:3.0.0' |
above is the library that we are using for circular imageview, it is a fast circular ImageView
perfect for profile images. This is based on RoundedImageView from Vince Mi.
It uses a BitmapShader and does not:
- create a copy of the original bitmap
- use a clipPath (which is neither hardware accelerated nor anti-aliased)
- use setXfermode to clip the bitmap (which means drawing twice to the canvas)
as this is just a custom ImageView and not a custom Drawable or a combination of both, it can be used with all kinds of drawables, i.e. a PicassoDrawable from Picasso or other non-standard drawables (needs some testing though).
After adding your build.gradle(module:app) file will look like this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.forogh.parwiz.circularimage" minSdkVersion 20 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0-alpha1' implementation 'com.android.support.constraint:constraint-layout:1.1.0' implementation 'de.hdodenhof:circleimageview:3.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' } |
3: So now open your main_activity.xml file, basically we are going to add our Circular
ImageView library with a TextView in the xml file. also make sure that you have an image
in your drawable folder.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" tools:context=".MainActivity"> <de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/profile_image" android:layout_width="96dp" android:layout_height="96dp" android:layout_marginStart="8dp" android:layout_marginTop="24dp" android:layout_marginEnd="8dp" android:src="@drawable/profile" app:civ_border_color="#FF000000" app:civ_border_width="2dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:layout_marginEnd="8dp" android:text="Cristiano Ronaldo" android:textColor="@android:color/white" android:textSize="15sp" android:textStyle="bold" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.502" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/profile_image" /> </android.support.constraint.ConstraintLayout> |
So now run the complete project and this will be the result
Also you can check the complete video for this article
Subscribe and Get Free Video Courses & Articles in your Email
deneme mal2 deneme mal2 deneme mal2
mal
Eşya Taşımacılığı Nasıl Yapılır?
Şehirlerarası nakliyat firması olarak eşyalarınızı evinizden ya da ofisinizden alır.
Uygun şekilde ambalajlayarak taşıma işlemini gerçekleştirir.
Bu sırada eşyalarınızda oluşabilecek herhangi bir hasara karşı kaskolu
nakliyat seçeneğini sitemizdeki yer alan firmalar üzerinden değerlendirebilirsiniz.
Şehirlerarası Eşya Taşımacılığı Nasıl Yapılır?
İstanbul şehirlerarası nakliyat firması olarak nakliye araçlarımızı
uygun yapıda seçiyor ve iç kısımları da eşya taşınacak düzeyde ayarlıyoruz.
Şehirlerarası nakliyat İstanbul sizin için eşyalarınızı ambalajlar ve gideceği yer şehir dışında olsa dahi hızlı
bir şekilde transferini sağlar. İşlemlerin sorunsuz yürümesi sizin yıpranmadan taşınma işinin üstesinden gelebilmeniz açısından önemlidir.
Şehirlerarası nakliyat fiyatları politikamız
ekonomik olarak belirlenmiştir. Sizde en iyi hizmeti alabilir ve kısa sürede yeni adresinize huzurlu bir geçiş sağlayabilirsiniz.
https://sites.google.com/view/sehirlerarasi-nakliyatci/
I love your blog.. very nice colors & theme. Did you create
this website yourself or did you hire someone to do it for you?
Plz respond as I’m looking to design my own blog
and would like to know where u got this from. cheers
bookmarked!!, I like your website!
my web site: blog
My family every time say that I am wasting my time here at net,
but I know I am getting knowledge every day by reading thes pleasant articles.
Formal Education In The Philippines National Science
Day Celebration Report
Here is my website; International Journal Of Pharmaceutical Sciences And Research Journal