Skip to content

Commit

Permalink
added lottie animation on splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
annhienktuit committed Sep 14, 2021
1 parent 5625192 commit 69b471c
Show file tree
Hide file tree
Showing 17 changed files with 7,717 additions and 32 deletions.
5 changes: 2 additions & 3 deletions .idea/gradle.xml

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

8 changes: 8 additions & 0 deletions .idea/misc.xml

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

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "macos-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "macos-gcc-x64",
"compilerArgs": [
"-Wall",
"-Wextra",
"-Wpedantic"
]
}
],
"version": 4
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"C_Cpp_Runner.cCompilerPath": "/usr/bin/clang",
"C_Cpp_Runner.cppCompilerPath": "/usr/bin/clang++",
"C_Cpp_Runner.debuggerPath": "/usr/bin/lldb",
"C_Cpp_Runner.makePath": "/usr/bin/make",
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic"
],
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.excludeSearch": [],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false
}
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,7 @@ dependencies {
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.maxkeppeler.sheets:info:2.2.5'
//lottie
def lottieVersion = "4.1.0"
implementation "com.airbnb.android:lottie:$lottieVersion"
}
Binary file added app/release/.app-release.aab.icloud
Binary file not shown.
Binary file removed app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,8 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
overridePendingTransition(R.anim.from_middle, R.anim.to_middle) //transistion
//overridePendingTransition(R.anim.from_middle, R.anim.to_middle) //transistion
if(!isNetworkAvailable()){
// val builder = AlertDialog.Builder(this)
// builder.setTitle("Connection Warning")
// builder.setMessage("Make sure you have Internet connection to sync data with other devices.\n" +
// "But no worry, you can use the app and your local data will be upload when connection available")
// builder.setIcon(R.drawable.ic_baseline_warning_24)
// builder.setPositiveButton("Okay") { dialog, which ->
// }
// builder.show()
AestheticDialog.Builder(this, DialogStyle.CONNECTIFY, DialogType.ERROR)
.setTitle("No Internet Connection")
.setMessage("Dont't worry, your data will be upload when connection available")
Expand All @@ -118,7 +110,6 @@ class MainActivity : AppCompatActivity() {
.setOnClickListener(object : OnDialogClickListener {
override fun onClick(dialog: AestheticDialog.Builder) {
dialog.dismiss()
//actions...
}
})
.show()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class SavingActivity : AppCompatActivity() {

}
})
getDatabase(ref.child("saving" + pos), object : OnGetDataListener {
getDatabase(ref.child("saving$pos"), object : OnGetDataListener {
override fun onSuccess(dataSnapshot: DataSnapshot) {
if (dataSnapshot.exists()) {
val index = dataSnapshot.child("index").value.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ class SplashScreenActivity : AppCompatActivity() {
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.setStatusBarColor(Color.parseColor("#FFFFFF"))
}
imageViewLogo.alpha = 0f
//imageViewLogo.alpha = 0f
textViewTitle.alpha = 0f
// imageViewLogo.animate().setDuration(1500).alpha(1f).withEndAction {
// val intent = Intent(this, MainActivity::class.java)
// startActivity(intent)
// overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out)
// finish()
// }
imageViewLogo.animate().setDuration(1500).alpha(1f).withEndAction {
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out)
finish()
}
textViewTitle.animate().setDuration(1500).alpha(1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CardAdapter(private val cardList: List<Card>) : RecyclerView.Adapter<Recyc
override fun getItemCount() = cardList.size

fun getFirstCard(): Int {
if (cardList.size > 0) return cardList[0].index!!
if (cardList.isNotEmpty()) return cardList[0].index!!
return 0
}
fun deleteItem(pos: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class HomeFragment : Fragment() {
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.fragment_home, container, false)
setData(view)
val pref = this.requireActivity()
.getSharedPreferences("pref", Context.MODE_PRIVATE)
Log.i("NotiFrag: ", pref.getString("status","").toString())
Expand All @@ -57,7 +58,6 @@ class HomeFragment : Fragment() {
val intent = Intent(activity, TransactionActivity::class.java)
startActivity(intent)
}
setData(view)
return view
}

Expand Down
19 changes: 16 additions & 3 deletions app/src/main/res/layout/activity_splash_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,29 @@
android:layout_height="match_parent"
tools:context=".activity.SplashScreenActivity">

<ImageView
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/imageViewLogo"
android:layout_width="269dp"
android:layout_height="290dp"
app:lottie_rawRes="@raw/piggy_lottie"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.267"
app:srcCompat="@drawable/ic_piggy_bank" />
app:layout_constraintVertical_bias="0.267"/>

<!-- <ImageView-->
<!-- android:id="@+id/imageViewLogo"-->
<!-- android:layout_width="269dp"-->
<!-- android:layout_height="290dp"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintVertical_bias="0.267"-->
<!-- app:srcCompat="@drawable/ic_piggy_bank" />-->

<TextView
android:id="@+id/textViewTitle"
Expand Down
Loading

0 comments on commit 69b471c

Please sign in to comment.