Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done with animation in Splash screen #9

Open
wants to merge 2 commits into
base: app-submission
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import android.os.Bundle
import android.os.Handler
import android.view.WindowManager
import com.gcect.gcectapp.R
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.ImageView


class SplashScreenActivity : AppCompatActivity() {
private val SPLASH_SCREEN_TIME_OUT = 2000
Expand All @@ -17,10 +21,18 @@ class SplashScreenActivity : AppCompatActivity() {
)
setContentView(R.layout.activity_splash_screen)

//variables for animation
// Animation topAnim
val backgroundImg : ImageView = findViewById(R.id.iv_logo)
val topAnim = AnimationUtils.loadAnimation(this,R.anim.top_navigation)
backgroundImg.startAnimation(topAnim)



Handler().postDelayed(Runnable {
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}, SPLASH_SCREEN_TIME_OUT.toLong())
},5000)
}
}
12 changes: 12 additions & 0 deletions app/src/main/res/anim/bottom_navigation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0%"
android:fromYDelta="100%"
android:duration="1500"/>
<alpha
android:fromAlpha="0.1"
android:toAlpha="1.0"
android:duration="1500"/>

</set>
12 changes: 12 additions & 0 deletions app/src/main/res/anim/top_navigation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0%"
android:fromYDelta="-100%"
android:duration="1500"/>
<alpha
android:fromAlpha="0.1"
android:toAlpha="1.0"
android:duration="1500"/>

</set>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_splash_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:background="#FCFEFF"
tools:context=".ui.activity.SplashScreenActivity">
<ImageView
android:id="@+id/iv_logo"
android:layout_width="180dp"
android:layout_height="180dp"
android:src="@drawable/gcect_logo"
Expand Down