Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
BottomSheet: Remove dropdown arrow and album name
Browse files Browse the repository at this point in the history
Signed-off-by: Shinjo Akane <akane@akanework.org>
  • Loading branch information
AkaneTan committed Jul 18, 2023
1 parent 6d3d90b commit fa0803e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 46 deletions.
24 changes: 2 additions & 22 deletions app/src/main/java/org/akanework/symphonica/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package org.akanework.symphonica

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.content.BroadcastReceiver
Expand Down Expand Up @@ -149,7 +148,6 @@ class MainActivity : AppCompatActivity() {
private lateinit var bottomSheetArtistAndAlbum: TextView
private lateinit var fullSheetSongName: TextView
private lateinit var fullSheetArtist: TextView
private lateinit var fullSheetAlbum: TextView
private lateinit var fullSheetDuration: TextView
private lateinit var fullSheetTimeStamp: TextView
private lateinit var bottomSheetControlButton: MaterialButton
Expand Down Expand Up @@ -314,7 +312,6 @@ class MainActivity : AppCompatActivity() {

// Find the views.
val bottomSheetNextButton = findViewById<MaterialButton>(R.id.bottom_sheet_next)
val fullSheetBackButton = findViewById<MaterialButton>(R.id.sheet_extract_player)
val fullSheetNextButton = findViewById<MaterialButton>(R.id.sheet_next_song)
val fullSheetPrevButton = findViewById<MaterialButton>(R.id.sheet_previous_song)

Expand All @@ -326,7 +323,6 @@ class MainActivity : AppCompatActivity() {
bottomSheetSongName = findViewById(R.id.bottom_sheet_song_name)
fullSheetSongName = findViewById(R.id.sheet_song_name)
fullSheetArtist = findViewById(R.id.sheet_author)
fullSheetAlbum = findViewById(R.id.sheet_album)
fullSheetLoopButton = findViewById(R.id.sheet_loop)
fullSheetShuffleButton = findViewById(R.id.sheet_random)
fullSheetControlButton = findViewById(R.id.sheet_mid_button)
Expand Down Expand Up @@ -505,16 +501,6 @@ class MainActivity : AppCompatActivity() {
}
}

fullSheetBackButton.setOnClickListener {
playerBottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED

ObjectAnimator.ofFloat(bottomFullSizePlayerPreview, "alpha", 1f, 0f)
.setDuration(FULL_PLAYER_FADE_ANIMATION_DURATION)
.start()

bottomPlayerPreview.visibility = VISIBLE
}

findViewById<ImageView>(R.id.sheet_cover).setOnLongClickListener {
val rootView = MaterialAlertDialogBuilder(
this,
Expand Down Expand Up @@ -834,7 +820,7 @@ class MainActivity : AppCompatActivity() {
* It receives a broadcast from [receiverPlay] and involves
* changes of various UI components including:
* [bottomSheetSongName], [bottomSheetArtistAndAlbum],
* [fullSheetSongName], [fullSheetAlbum], [fullSheetArtist].
* [fullSheetSongName], [fullSheetArtist].
* It also uses [updateAlbumView].
*/
inner class SheetPlayReceiver : BroadcastReceiver() {
Expand All @@ -852,8 +838,6 @@ class MainActivity : AppCompatActivity() {
)
fullSheetSongName.text =
playlistViewModel.playList[playlistViewModel.currentLocation].title
fullSheetAlbum.text =
playlistViewModel.playList[playlistViewModel.currentLocation].album
fullSheetArtist.text =
playlistViewModel.playList[playlistViewModel.currentLocation].artist
fullSheetDuration.text =
Expand Down Expand Up @@ -941,7 +925,7 @@ class MainActivity : AppCompatActivity() {
* It receives a broadcast from [receiverUpdate] and involves
* changes of various UI components including:
* [bottomSheetSongName], [bottomSheetArtistAndAlbum],
* [fullSheetSongName], [fullSheetAlbum], [fullSheetArtist].
* [fullSheetSongName], [fullSheetArtist].
* This receiver is used when resuming the activity.
*/
inner class SheetUpdateReceiver : BroadcastReceiver() {
Expand All @@ -957,8 +941,6 @@ class MainActivity : AppCompatActivity() {
)
fullSheetSongName.text =
playlistViewModel.playList[playlistViewModel.currentLocation].title
fullSheetAlbum.text =
playlistViewModel.playList[playlistViewModel.currentLocation].album
fullSheetArtist.text =
playlistViewModel.playList[playlistViewModel.currentLocation].artist
fullSheetDuration.text =
Expand Down Expand Up @@ -989,8 +971,6 @@ class MainActivity : AppCompatActivity() {
)
fullSheetSongName.text =
playlistViewModel.playList[playlistViewModel.currentLocation].title
fullSheetAlbum.text =
playlistViewModel.playList[playlistViewModel.currentLocation].album
fullSheetArtist.text =
playlistViewModel.playList[playlistViewModel.currentLocation].artist
fullSheetDuration.text =
Expand Down
24 changes: 0 additions & 24 deletions app/src/main/res/layout/global_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,6 @@
android:layout_width="wrap_content"
android:layout_height="48dp">

<com.google.android.material.button.MaterialButton
android:id="@+id/sheet_extract_player"
android:layout_width="48dp"
android:layout_height="48dp"
android:backgroundTint="?attr/colorSurface"
android:elevation="0dp"
android:insetLeft="0dp"
android:insetTop="0dp"
android:insetRight="0dp"
android:insetBottom="0dp"
app:icon="@drawable/ic_expand_more"
app:iconGravity="textStart"
app:iconPadding="0dp"
app:iconSize="30sp"
app:iconTint="?attr/colorOnSurface" />

</LinearLayout>

</FrameLayout>
Expand Down Expand Up @@ -162,14 +146,6 @@
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="16sp" />

<org.akanework.symphonica.ui.component.MarqueeTextView
android:id="@+id/sheet_album"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/library_album_view_unknown_album"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>

Expand Down

0 comments on commit fa0803e

Please sign in to comment.