Browse Source

Fixes form peer review

gradle-v8
Christophe Henry 12 months ago
parent
commit
1a050c2d73
  1. 6
      app/src/main/AndroidManifest.xml
  2. 1
      app/src/main/java/audio/funkwhale/ffa/activities/MainActivity.kt
  3. 3
      app/src/main/java/audio/funkwhale/ffa/views/NowPlayingBottomSheet.kt
  4. 26
      app/src/main/res/layout-land/activity_main.xml
  5. 30
      app/src/main/res/layout/activity_main.xml
  6. 2
      app/src/main/res/layout/fragment_now_playing.xml
  7. 7
      app/src/main/res/layout/partial_appbar.xml
  8. 1
      app/src/main/res/layout/partial_now_playing_header.xml
  9. 2
      app/src/main/res/values/styles.xml

6
app/src/main/AndroidManifest.xml

@ -22,11 +22,13 @@ @@ -22,11 +22,13 @@
android:name=".activities.SplashActivity"
android:launchMode="singleInstance"
android:noHistory="true"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
@ -38,7 +40,9 @@ @@ -38,7 +40,9 @@
android:launchMode="singleInstance"
android:screenOrientation="portrait" />
<activity android:name=".activities.MainActivity" />
<activity
android:name=".activities.MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activities.DownloadsActivity"

1
app/src/main/java/audio/funkwhale/ffa/activities/MainActivity.kt

@ -109,6 +109,7 @@ class MainActivity : AppCompatActivity() { @@ -109,6 +109,7 @@ class MainActivity : AppCompatActivity() {
setContentView(binding.root)
setSupportActionBar(binding.appbar)
supportActionBar?.setDisplayShowTitleEnabled(false)
onBackPressedDispatcher.addCallback(this) {
if (binding.nowPlayingBottomSheet.isOpen) {

3
app/src/main/java/audio/funkwhale/ffa/views/NowPlayingBottomSheet.kt

@ -6,6 +6,7 @@ import android.util.TypedValue @@ -6,6 +6,7 @@ import android.util.TypedValue
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.cardview.widget.CardView
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.content.res.use
import audio.funkwhale.ffa.R
@ -16,7 +17,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior.BottomSheetCa @@ -16,7 +17,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior.BottomSheetCa
class NowPlayingBottomSheet @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr), BottomSheetIneractable {
) : CardView(context, attrs, defStyleAttr), BottomSheetIneractable {
private val behavior = BottomSheetBehavior<NowPlayingBottomSheet>()
private val targetHeaderId: Int

26
app/src/main/res/layout-land/activity_main.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/appbar_wrapper">
app:layout_constraintBottom_toTopOf="@id/appbar">
<LinearLayout
android:id="@+id/nav_host_fragment_wrapper"
android:layout_width="match_parent"
@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/elevatedSurface"
app:cardElevation="8dp"
app:target_header="@id/constraint_layout_placeholder">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/now_playing"
@ -53,21 +54,14 @@ @@ -53,21 +54,14 @@
</audio.funkwhale.ffa.views.NowPlayingBottomSheet>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/appbar_wrapper"
<androidx.appcompat.widget.Toolbar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent">
android:layout_height="?attr/actionBarSize"
app:layout_constraintBottom_toBottomOf="parent"
android:theme="@style/AppTheme.AppBar"
app:navigationIcon="@drawable/funkwhaleshape"
tools:menu="@menu/toolbar"
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:theme="@style/AppTheme.AppBar"
app:backgroundTint="@color/elevatedSurface"
app:layout_insetEdge="bottom"
app:navigationIcon="@drawable/funkwhaleshape"
tools:menu="@menu/toolbar" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
/>
</androidx.constraintlayout.widget.ConstraintLayout>

30
app/src/main/res/layout/activity_main.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/appbar_wrapper">
app:layout_constraintBottom_toTopOf="@id/appbar">
<FrameLayout
android:layout_width="match_parent"
@ -32,7 +32,8 @@ @@ -32,7 +32,8 @@
android:id="@+id/now_playing_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/elevatedSurface"
android:backgroundTint="@color/elevatedSurface"
app:cardElevation="16dp"
app:target_header="@id/constraint_layout_placeholder">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/now_playing"
@ -44,21 +45,14 @@ @@ -44,21 +45,14 @@
</audio.funkwhale.ffa.views.NowPlayingBottomSheet>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/appbar_wrapper"
<androidx.appcompat.widget.Toolbar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent">
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:theme="@style/AppTheme.AppBar"
app:backgroundTint="@color/elevatedSurface"
app:layout_insetEdge="bottom"
app:navigationIcon="@drawable/funkwhaleshape"
tools:menu="@menu/toolbar" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
android:layout_height="?attr/actionBarSize"
app:layout_constraintBottom_toBottomOf="parent"
android:theme="@style/AppTheme.AppBar"
android:background="@color/elevatedSurface"
app:navigationIcon="@drawable/funkwhaleshape"
tools:menu="@menu/toolbar"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

2
app/src/main/res/layout/fragment_now_playing.xml

@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
android:id="@+id/controls"
layout="@layout/partial_now_playing_controls"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/detail_image_placeholder"

7
app/src/main/res/layout/partial_appbar.xml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
</merge>

1
app/src/main/res/layout/partial_now_playing_header.xml

@ -39,6 +39,7 @@ @@ -39,6 +39,7 @@
app:layout_constraintStart_toStartOf="@id/constraint_layout_placeholder"
app:layout_constraintTop_toBottomOf="@id/now_playing_progress"
app:layout_constraintBottom_toBottomOf="@id/constraint_layout_placeholder"
android:scaleType="centerCrop"
app:srcCompat="@drawable/cover"
tools:src="@tools:sample/avatars"
/>

2
app/src/main/res/values/styles.xml

@ -68,9 +68,9 @@ @@ -68,9 +68,9 @@
<style name="AppTheme.AppBar" parent="ThemeOverlay.MaterialComponents.Toolbar.Primary">
<item name="android:drawableTint" tools:targetApi="m">@color/colorPrimary</item>
<item name="android:tint">@color/colorPrimary</item>
<item name="actionBarPopupTheme">@style/AppTheme.PopupMenu</item>
<item name="popupTheme">@style/AppTheme.PopupMenu</item>
<item name="android:elevation">16dp</item>
</style>
<style name="AppTheme.PopupMenu" parent="ThemeOverlay.MaterialComponents.Toolbar.Primary">

Loading…
Cancel
Save