-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: LoadingDialog and lottie (#212)
- Loading branch information
1 parent
80bbb4d
commit 3a114e4
Showing
6 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
FindSportEvents/app/src/main/java/com/bounswe/findsportevents/util/DialogManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.bounswe.findsportevents.util | ||
|
||
import android.content.Context | ||
|
||
interface DialogManager { | ||
fun showLoading(context: Context) | ||
fun hideLoading() | ||
} |
19 changes: 19 additions & 0 deletions
19
FindSportEvents/app/src/main/java/com/bounswe/findsportevents/util/LoadingDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.bounswe.findsportevents.util | ||
|
||
import android.app.Dialog | ||
import android.content.Context | ||
import android.graphics.Color | ||
import android.graphics.drawable.ColorDrawable | ||
import android.os.Bundle | ||
import android.view.Window | ||
import com.bounswe.findsportevents.R | ||
|
||
class LoadingDialog(context: Context) : Dialog(context) { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
requestWindowFeature(Window.FEATURE_NO_TITLE) | ||
setContentView(R.layout.loading_layout) | ||
window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
FindSportEvents/app/src/main/res/layout/loading_layout.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<com.airbnb.lottie.LottieAnimationView | ||
android:id="@+id/animationView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:lottie_autoPlay="true" | ||
app:lottie_loop="true" | ||
app:lottie_rawRes="@raw/loading" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
Large diffs are not rendered by default.
Oops, something went wrong.