Skip to content
Snippets Groups Projects
Commit 91bd91f2 authored by shelmasalsa17's avatar shelmasalsa17
Browse files

feat:splash screen

parent 0c6fc938
No related merge requests found
Pipeline #61500 failed with stages
...@@ -44,7 +44,14 @@ ...@@ -44,7 +44,14 @@
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_file" /> android:resource="@xml/provider_file" />
</provider> </provider>
<activity android:name=".SplashScreenActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity <activity
android:name=".LoginActivity" android:name=".LoginActivity"
android:exported="true" android:exported="true"
......
package com.example.myapplication
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.animation.AnimationUtils
import android.widget.ImageView
import android.os.Handler
import android.os.Looper
class SplashScreenActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_splash_screen)
val backgroundImg: ImageView = findViewById(R.id.iv_logo)
val sideAnimation = AnimationUtils.loadAnimation(this, R.anim.slide)
backgroundImg.startAnimation(sideAnimation)
Handler(Looper.getMainLooper()).postDelayed({
startActivity(Intent(this, LoginActivity::class.java))
finish()
}, 3000)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="-50%"
android:fromYDelta="0%"
android:duration="1500"
/>
<alpha
android:fromAlpha="0.1"
android:toAlpha="1.0"
android:duration="1500"
/>
</set>
\ No newline at end of file
app/src/main/res/drawable/splash_screen_image.png

69 KiB

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_login"
tools:context=".SplashScreenActivity">
<ImageView
android:id="@+id/iv_logo"
android:src="@drawable/splash_screen_image"
android:layout_width="200dp"
android:layout_height="200dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment