Value In Brief – by Abanoub Hanna
All You Need To Know Explained In Brief

Posts Tagged with XML

Adding GIF image in an ImageView in android

Android Java XML
use android-gif-drawable library add the following dependency to build.gradle file of your project. dependencies { implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' } Use the view in XML file like this. <pl.droidsonroids.gif.GifImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/src_anim" android:background="@drawable/bg_anim" /> For more customization and code, see the docs here. use VideoView on Android You can use VideoView to show the GIF image. But the library is more efficient and smooth. use ImageView on Android Use ImageView and Split the GIF file into several images and then apply animation to it.

How to make imageview over another view in Android ?

Android Java XML
There are at least 3 ways to put imageview on another imageview. Simple Order This way is just put the imageview after the other imageview in XML file. It is simple like that. The first view will be underneath the second one. Using FrameLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/t" /> <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> </FrameLayout> The second image will be on top.