AndroidManifest.xml file
XML
<? xml version = "1.0" encoding = "utf-8" ?> < manifest xmlns:android = "http://schemas.android.com/apk/res/android" package = "com.w3wiki.myfirstkotlinapp" > < application android:allowBackup = "true" android:icon = "@mipmap/ic_launcher" android:label = "@string/app_name" android:roundIcon = "@mipmap/ic_launcher_round" android:supportsRtl = "true" android:theme = "@style/AppTheme" > < activity android:name = ".MainActivity" > < intent-filter > < action android:name = "android.intent.action.MAIN" /> < category android:name = "android.intent.category.LAUNCHER" /> </ intent-filter > </ activity > </ application > </ manifest > |
ImageSwitcher in Kotlin
Android ImageSwitcher is a user interface widget that provides a smooth transition animation effect to the images while switching between them to display in the view.
ImageSwitcher is subclass of View Switcher which is used to animates one image and displays next one.
Generally, we use ImageSwitcher in two ways manually in XML layout and programmatically in Kotlin file.
We should define an XML component, to use ImageSwitcher in our android application.
XML
< ImageSwitcher android:id = "@+id/imgSw" android:layout_width = "match_parent" android:layout_height = "match_parent" > </ ImageSwitcher > |
First we create a new project by following the below steps:
- Click on File, then New => New Project.
- After that include the Kotlin support and click on next.
- Select the minimum SDK as per convenience and click next button.
- Then select the Empty activity => next => finish.
Contact Us