Sliding panel (early version, current implementation will probably replaced with a fragment implementation soon), translucent and colored statusbar for KitKat everywhere, use correct text colors for secondary texts, numerous clean ups

This commit is contained in:
Karim Abou Zeid 2015-07-30 22:44:34 +02:00
commit 5f0bfdb14b
65 changed files with 1247 additions and 1177 deletions

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -80,7 +81,9 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="@dimen/toolbar_elevation"
tools:ignore="UnusedAttribute">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
@ -96,10 +99,4 @@
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="end|right|bottom"
android:layout_margin="@dimen/fab_margin" />
</FrameLayout>

View file

@ -146,7 +146,7 @@
android:id="@+id/play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="bottom|right|end"
android:layout_margin="@dimen/fab_margin"
android:layout_margin="@dimen/fab_margin_top_left_right"
android:src="@drawable/ic_done_white_24dp"
tools:ignore="RtlHardcoded" />

View file

@ -81,7 +81,9 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="@dimen/toolbar_elevation"
tools:ignore="UnusedAttribute">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
@ -97,10 +99,4 @@
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin" />
</FrameLayout>

View file

@ -1,11 +1,19 @@
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".DrawerActivity">
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
<include layout="@layout/status_bar" />
</FrameLayout>
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
@ -15,7 +23,6 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
tools:ignore="UnusedAttribute">
<FrameLayout
@ -43,8 +50,10 @@
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
app:tabContentStart="72dp"
app:tabIndicatorColor="@color/white"
app:tabMode="scrollable" />
app:tabIndicatorColor="@color/primary_text_default_material_dark"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/primary_text_default_material_dark"
app:tabTextColor="@color/secondary_text_default_material_dark" />
</android.support.design.widget.AppBarLayout>
@ -54,20 +63,6 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="@menu/menu_drawer" />
</android.support.v4.widget.DrawerLayout>
</LinearLayout>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.internal.ScrimInsetsFrameLayout
android:fitsSystemWindows="true"
android:id="@+id/drawer_content_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/menu_drawer" />
</android.support.v4.widget.DrawerLayout>

View file

@ -1,4 +1,5 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -7,9 +8,13 @@
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/status_bar" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="@dimen/toolbar_elevation"
tools:ignore="UnusedAttribute">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
@ -45,10 +50,4 @@
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/empty_text_size" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin" />
</FrameLayout>

View file

@ -1,15 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:fitsSystemWindows="true"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/status_bar" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:background="?colorPrimary" />
android:background="@android:color/transparent" />
<FrameLayout
android:id="@+id/content_frame"

View file

@ -1,13 +1,13 @@
<LinearLayout 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"
android:orientation="vertical">
<include layout="@layout/status_bar" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
app:elevation="@dimen/toolbar_elevation" />
style="@style/Toolbar" />
<FrameLayout
android:layout_width="match_parent"

View file

@ -177,7 +177,7 @@
android:id="@+id/play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="bottom|right|end"
android:layout_margin="@dimen/fab_margin"
android:layout_margin="@dimen/fab_margin_top_left_right"
android:src="@drawable/ic_done_white_24dp"
tools:ignore="RtlHardcoded" />

View file

@ -43,7 +43,6 @@
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textColor="?caption_text_color" />

View file

@ -48,7 +48,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textColor="?caption_text_color"
android:textSize="12sp" />

View file

@ -46,6 +46,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:orientation="vertical">
@ -74,6 +76,8 @@
style="@style/OverFlowButton"
android:layout_gravity="center_vertical"
android:layout_marginEnd="2dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginStart="2dp"
tools:ignore="ContentDescription" />

View file

@ -48,6 +48,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:fontFamily="sans-serif"
@ -60,6 +62,8 @@
style="@style/OverFlowButton"
android:layout_gravity="center_vertical"
android:layout_marginEnd="2dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginStart="2dp"
tools:ignore="ContentDescription" />

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mini_player"
android:layout_width="match_parent"
android:layout_height="@dimen/mini_player_height"
android:background="?android:colorBackground">
<ImageView
android:id="@+id/mini_player_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:scaleType="centerCrop"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/mini_player_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="88dp"
android:layout_marginLeft="72dp"
android:layout_marginRight="88dp"
android:layout_marginStart="72dp"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</FrameLayout>

View file

@ -1,15 +1,13 @@
<RelativeLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.kabouzeid.gramophone.ui.activities.MusicControllerActivity">
android:layout_height="match_parent">
<!-- BOTTOM-->
<LinearLayout
android:id="@+id/footer_frame"
android:id="@+id/player_footer_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
@ -17,7 +15,7 @@
android:orientation="vertical">
<RelativeLayout
android:id="@+id/alternative_progress_container"
android:id="@+id/player_alternative_progress_container"
android:layout_width="match_parent"
android:layout_height="@dimen/progress_container_height"
android:background="?music_controller_container_color"
@ -26,7 +24,7 @@
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/alternative_song_current_progress"
android:id="@+id/player_alternative_song_current_progress"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
@ -40,7 +38,7 @@
tools:ignore="RtlHardcoded,RtlSymmetry,SmallSp" />
<TextView
android:id="@+id/alternative_song_total_time"
android:id="@+id/player_alternative_song_total_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
@ -54,17 +52,17 @@
tools:ignore="RtlHardcoded,RtlSymmetry,SmallSp" />
<SeekBar
android:id="@+id/alternative_progress_slider"
android:id="@+id/player_alternative_progress_slider"
style="@style/MusicProgressSlider"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/alternative_song_total_time"
android:layout_toRightOf="@id/alternative_song_current_progress"
android:layout_toLeftOf="@id/player_alternative_song_total_time"
android:layout_toRightOf="@id/player_alternative_song_current_progress"
tools:ignore="RtlHardcoded,UnusedAttribute" />
</RelativeLayout>
<LinearLayout
android:id="@+id/footer"
android:id="@+id/player_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?default_bar_color"
@ -74,11 +72,10 @@
android:paddingLeft="72dp"
android:paddingRight="72dp"
android:paddingTop="@dimen/title_box_padding_large"
android:transitionName="@string/transition_album_art"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
android:id="@+id/player_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
@ -87,7 +84,7 @@
android:textColor="?attr/title_text_color" />
<TextView
android:id="@+id/text"
android:id="@+id/player_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
@ -98,14 +95,14 @@
</LinearLayout>
<RelativeLayout
android:id="@+id/media_controller_container"
android:id="@+id/player_media_controller_container"
android:layout_width="match_parent"
android:layout_height="@dimen/media_controller_container_height"
android:background="?music_controller_container_color"
tools:ignore="ContentDescription,UnusedAttribute">
<android.support.v7.widget.CardView
android:id="@+id/playback_controller_card"
android:id="@+id/player_playback_controller_card"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
@ -114,14 +111,14 @@
app:elevation="@dimen/card_elevation" />
<ImageButton
android:id="@+id/prev_button"
android:id="@+id/player_prev_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/tmp_now_playing_skip_rewind_margin"
android:layout_marginRight="@dimen/tmp_now_playing_skip_rewind_margin"
android:layout_toLeftOf="@+id/play_pause_fab"
android:layout_toStartOf="@+id/play_pause_fab"
android:layout_toLeftOf="@+id/player_dummy_fab"
android:layout_toStartOf="@+id/player_dummy_fab"
android:background="?round_selector"
android:elevation="8dp"
android:padding="22dp"
@ -129,14 +126,14 @@
android:src="@drawable/ic_skip_previous_white_36dp" />
<ImageButton
android:id="@+id/next_button"
android:id="@+id/player_next_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/tmp_now_playing_skip_rewind_margin"
android:layout_marginStart="@dimen/tmp_now_playing_skip_rewind_margin"
android:layout_toEndOf="@+id/play_pause_fab"
android:layout_toRightOf="@+id/play_pause_fab"
android:layout_toEndOf="@+id/player_dummy_fab"
android:layout_toRightOf="@+id/player_dummy_fab"
android:background="?round_selector"
android:elevation="8dp"
android:padding="22dp"
@ -144,7 +141,7 @@
android:src="@drawable/ic_skip_next_white_36dp" />
<ImageButton
android:id="@+id/repeat_button"
android:id="@+id/player_repeat_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_alignParentLeft="true"
@ -159,7 +156,7 @@
android:src="@drawable/ic_repeat_white_36dp" />
<ImageButton
android:id="@+id/shuffle_button"
android:id="@+id/player_shuffle_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_alignParentEnd="true"
@ -174,10 +171,11 @@
android:src="@drawable/ic_shuffle_white_36dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/play_pause_fab"
android:id="@+id/player_dummy_fab"
style="@style/PlayPauseFab"
android:layout_centerInParent="true"
android:layout_margin="0dp" />
android:layout_margin="0dp"
android:visibility="invisible" />
</RelativeLayout>
@ -186,31 +184,30 @@
<!-- ALBUMART-->
<FrameLayout
android:id="@+id/album_art_frame"
android:id="@+id/player_album_art_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/footer_frame"
android:layout_above="@id/player_footer_frame"
android:background="@color/black">
<ImageView
android:id="@+id/album_art_background"
android:id="@+id/player_album_art_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription" />
<com.kabouzeid.gramophone.views.SquareIfPlaceImageView
android:id="@+id/image"
android:id="@+id/player_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:src="@drawable/default_album_art"
android:transitionName="@string/transition_album_art"
tools:ignore="ContentDescription,UnusedAttribute" />
<ImageView
android:id="@+id/favorite_icon"
android:id="@+id/player_favorite_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -219,14 +216,14 @@
tools:ignore="ContentDescription" />
<RelativeLayout
android:id="@+id/default_progress_container"
android:id="@+id/player_default_progress_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/shadow_up">
<TextView
android:id="@+id/default_song_current_progress"
android:id="@+id/player_default_song_current_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
@ -240,7 +237,7 @@
tools:ignore="RtlHardcoded,RtlSymmetry,SmallSp" />
<TextView
android:id="@+id/default_song_total_time"
android:id="@+id/player_default_song_total_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
@ -259,9 +256,9 @@
<!-- PROGRESS SLIDER-->
<SeekBar
android:id="@+id/default_progress_slider"
android:id="@+id/player_default_progress_slider"
style="@style/TraditionalMusicProgressSlider"
android:layout_above="@+id/footer_frame"
android:layout_above="@id/player_footer_frame"
android:elevation="2dp"
tools:ignore="UnusedAttribute" />
@ -269,14 +266,18 @@
<include layout="@layout/shadow_statusbar_actionbar" />
<include
android:id="@+id/status_bar"
layout="@layout/status_bar" />
<View
android:id="@+id/player_status_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding"
android:background="@android:color/transparent"
android:elevation="@dimen/toolbar_elevation" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:id="@+id/player_toolbar"
style="@style/Toolbar"
android:layout_below="@id/status_bar"
android:background="#00000000" />
android:layout_below="@id/player_status_bar"
android:background="#00000000"
tools:ignore="UnusedAttribute" />
</RelativeLayout>

View file

@ -0,0 +1,43 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoPanelHeight="@dimen/mini_player_height"
sothree:umanoParalaxOffset="0dp"
sothree:umanoShadowHeight="@dimen/card_elevation">
<FrameLayout
android:id="@+id/content_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/player_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground">
<include layout="@layout/player" />
<include layout="@layout/mini_player" />
</FrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="end|bottom"
android:layout_marginBottom="@dimen/fab_margin_bottom"
android:layout_marginLeft="@dimen/fab_margin_top_left_right"
android:layout_marginRight="@dimen/fab_margin_top_left_right"
android:layout_marginTop="@dimen/fab_margin_top_left_right" />
</FrameLayout>

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<View
<View xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding"
android:background="@android:color/transparent"
xmlns:android="http://schemas.android.com/apk/res/android" />
android:elevation="@dimen/toolbar_elevation"
tools:ignore="UnusedAttribute" />

View file

@ -67,7 +67,8 @@
android:gravity="center_vertical"
android:singleLine="true"
android:text="@string/nothing_playing"
android:textAppearance="@style/Theme.MaterialMusic.Notification.Title" />
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/primary_text_default_material_light" />
<TextView
android:id="@+id/song_secondary_information"
@ -76,7 +77,8 @@
android:layout_weight="1"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/Theme.MaterialMusic.Notification" />
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textColor="@color/secondary_text_default_material_light" />
</LinearLayout>