Refactor Now Playing into Library
Turns out a dedicated Now Playing screen wont look that good, so refactor that into the Library screen. Also replace the ActionBar with a Toolbar and update the theming a bit.
This commit is contained in:
parent
7c447e0296
commit
9961b87f47
9 changed files with 46 additions and 21 deletions
|
@ -3,6 +3,7 @@ package org.oxycblt.auxio
|
|||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
|
@ -10,6 +11,8 @@ class MainActivity : AppCompatActivity() {
|
|||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||
|
||||
Log.d(this::class.simpleName, "Activity Created.")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.oxycblt.auxio.player
|
||||
package org.oxycblt.auxio.library
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
|
@ -8,9 +8,9 @@ import android.view.ViewGroup
|
|||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.FragmentPlayerBinding
|
||||
import org.oxycblt.auxio.databinding.FragmentLibraryBinding
|
||||
|
||||
class PlayerFragment : Fragment() {
|
||||
class LibraryFragment : Fragment() {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
|
@ -18,8 +18,8 @@ class PlayerFragment : Fragment() {
|
|||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
|
||||
val binding = DataBindingUtil.inflate<FragmentPlayerBinding>(
|
||||
inflater, R.layout.fragment_player, container, false
|
||||
val binding = DataBindingUtil.inflate<FragmentLibraryBinding>(
|
||||
inflater, R.layout.fragment_library, container, false
|
||||
)
|
||||
|
||||
Log.d(this::class.simpleName, "Fragment created.")
|
24
app/src/main/res/layout/fragment_library.xml
Normal file
24
app/src/main/res/layout/fragment_library.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/background">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="@dimen/elevation_normal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:title="@string/fragment_library_title"
|
||||
tools:titleTextColor="@color/primaryTextColor"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
|
@ -7,6 +7,6 @@
|
|||
|
||||
<fragment
|
||||
android:id="@+id/playerFragment"
|
||||
android:name="org.oxycblt.auxio.player.PlayerFragment"
|
||||
android:name="org.oxycblt.auxio.library.LibraryFragment"
|
||||
android:label="PlayerFragment" />
|
||||
</navigation>
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="primaryColor">#0d5af5</color>
|
||||
<color name="primaryLightColor">#6b86ff</color>
|
||||
<color name="primaryDarkColor">#0032c1</color>
|
||||
<color name="primaryColor">#272727</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>
|
||||
|
|
4
app/src/main/res/values/dimens.xml
Normal file
4
app/src/main/res/values/dimens.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="elevation_normal">4dp</dimen>
|
||||
</resources>
|
|
@ -1,4 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Auxio</string>
|
||||
|
||||
<string name="fragment_library_title">Library</string>
|
||||
</resources>
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Base theme -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<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>
|
||||
<item name="colorPrimaryDark">@color/primaryColor</item>
|
||||
<item name="colorAccent">@color/primaryColor</item>
|
||||
<item name="background">@color/secondaryColor</item>
|
||||
</style>
|
||||
</resources>
|
Loading…
Reference in a new issue