Add Loading Screen

Add a basic loading screen that loads the music in the background before starting the app.
This commit is contained in:
OxygenCobalt
2020-08-19 09:28:15 -06:00
parent 3134e313a3
commit 1b21552576
18 changed files with 230 additions and 82 deletions
+4 -3
View File
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
<layout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
@@ -13,9 +14,9 @@
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="@dimen/elevation_normal"
android:textColor="?attr/titleTextColor"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/fragment_library_title"
tools:titleTextColor="@color/primaryTextColor" />
app:title="@string/title_library_fragment" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/loading_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateTint="?attr/colorAccent"
android:indeterminateTintMode="src_in"
android:paddingBottom="@dimen/padding_small"
app:layout_constraintBottom_toTopOf="@+id/text_indexing_library"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"/>
<TextView
android:id="@+id/text_indexing_library"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_loading_music"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loading_bar" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
+12 -3
View File
@@ -3,11 +3,20 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_main"
app:startDestination="@id/playerFragment">
app:startDestination="@id/loadingFragment">
<fragment
android:id="@+id/playerFragment"
android:id="@+id/loadingFragment"
android:name="org.oxycblt.auxio.loading.LoadingFragment"
android:label="LoadingFragment"
tools:layout="@layout/fragment_loading" >
<action
android:id="@+id/action_to_library"
app:destination="@id/libraryFragment" />
</fragment>
<fragment
android:id="@+id/libraryFragment"
android:name="org.oxycblt.auxio.library.LibraryFragment"
android:label="PlayerFragment"
android:label="LibraryFragment"
tools:layout="@layout/fragment_library" />
</navigation>
+9 -8
View File
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primaryColor">#424242</color>
<color name="primaryLightColor">#6d6d6d</color>
<color name="primaryDarkColor">#1b1b1b</color>
<color name="secondaryColor">#212121</color>
<color name="secondaryLightColor">#484848</color>
<color name="secondaryDarkColor">#000000</color>
<color name="primaryTextColor">#ffffff</color>
<color name="secondaryTextColor">#ffffff</color>
<!-- Dark Colors -->
<color name="gray">#424242</color>
<color name="lightGray">#6d6d6d</color>
<color name="darkGray">#1b1b1b</color>
<color name="secondaryGray">#484848</color>
<color name="black">#000000</color>
<color name="white">#ffffff</color>
</resources>
+3 -1
View File
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="elevation_normal">4dp</dimen>
<dimen name="padding_small">4dp</dimen>
<dimen name="elevation_normal">6dp</dimen>
</resources>
+3 -1
View File
@@ -2,5 +2,7 @@
<resources>
<string name="app_name">Auxio</string>
<string name="fragment_library_title">Library</string>
<string name="label_loading_music">Scanning your music library for the first time...</string>
<string name="title_library_fragment">Library</string>
</resources>
+2 -3
View File
@@ -2,8 +2,7 @@
<resources>
<!-- Base theme -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimary">@color/primaryColor</item>
<item name="colorPrimaryDark">@color/primaryDarkColor</item>
<item name="colorAccent">@color/secondaryColor</item>
<!-- Make this accent settable -->
<item name="colorAccent">#295DE5</item>
</style>
</resources>