Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Volume, mode, and save channel; widgets more usable #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,11 @@ public void updateVolumeIcon(int volume) {

// At full volume
if (volume > 8) {
icon = R.drawable.ic_volume_up_white_24dp;
icon = R.drawable.ic_volume_up_white_100dp;
} else if (volume > 0) {
icon = R.drawable.ic_volume_down_white_24dp;
icon = R.drawable.ic_volume_down_white_100dp;
} else {
icon = R.drawable.ic_volume_mute_white_24dp;
icon = R.drawable.ic_volume_mute_white_100dp;
}

volumeButton.setImageResource(icon);
Expand Down Expand Up @@ -1104,10 +1104,10 @@ public void onRadioVolumeChanged(int volume) {
if (playerService.isDucked() && playerService.isPlaying()) { // Ducking
if (volume == 0) {
// Full duck
icon = R.drawable.ic_volume_mute_white_24dp;
icon = R.drawable.ic_volume_mute_white_100dp;
} else {
// Duck
icon = R.drawable.ic_volume_down_white_24dp;
icon = R.drawable.ic_volume_down_white_100dp;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="100dp"
android:height="100dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="100dp"
android:height="100dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="100dp"
android:height="100dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="100dp"
android:height="100dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
Expand Down
50 changes: 32 additions & 18 deletions app/src/main/res/layout-land/activity_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -285,48 +285,53 @@

<SeekBar
android:id="@+id/volume_seek_bar"
android:layout_width="300dp"
android:layout_height="40dp"
android:layout_width="400dp"
android:layout_height="100dp"
android:max="16" />
</android.support.v7.widget.CardView>

<TextView
android:id="@+id/volume_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_height="60dp"
android:layout_width="60dp"
android:autoSizeTextType="uniform"
android:text="11"
android:textAppearance="?android:textAppearanceSmall"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintStart_toEndOf="@+id/volume_button" />
app:layout_constraintStart_toEndOf="@+id/volume_button"
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"/>

<ImageButton
android:id="@+id/volume_button"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_height="60dp"
android:layout_width="60dp"
android:layout_marginLeft="10dp"
android:background="?selectableItemBackgroundBorderless"
android:scaleType="fitXY"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintStart_toStartOf="@+id/player_and_station_list_separator"
app:srcCompat="@drawable/ic_volume_mute_white_24dp" />
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"
app:srcCompat="@drawable/ic_volume_mute_white_100dp" />

<Switch
android:id="@+id/mode_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scaleX="3"
android:scaleY="3"
android:showText="true"
android:textOff="@string/dab"
android:textOn="@string/fm"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/player_and_station_list_separator" />
app:layout_constraintStart_toStartOf="@+id/player_and_station_list_separator"
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"/>

<android.support.constraint.Guideline
android:id="@+id/player_controls_top_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.73" />
app:layout_constraintGuide_percent="0.75" />

<android.support.v7.widget.CardView
android:id="@+id/player_control_panel_background"
Expand Down Expand Up @@ -415,12 +420,21 @@

<android.support.design.widget.FloatingActionButton
android:id="@+id/add_channel_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_height="60dp"
android:layout_width="60dp"
app:fabSize="mini"
android:layout_marginRight="10dp"
android:clickable="true"
android:scaleType="fitXY"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/player_controls_top_guideline"
app:srcCompat="@drawable/ic_add_white_24dp" />
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"
app:srcCompat="@drawable/ic_add_white_100dp" />

<android.support.constraint.Guideline
android:id="@+id/volume_controls_top_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.65" />
</android.support.constraint.ConstraintLayout>
48 changes: 31 additions & 17 deletions app/src/main/res/layout/activity_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.66" />
app:layout_constraintGuide_percent="0.70" />

<android.support.v7.widget.CardView
android:id="@+id/channel_status_bar"
Expand Down Expand Up @@ -292,41 +292,46 @@

<TextView
android:id="@+id/volume_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_height="45dp"
android:layout_width="45dp"
android:autoSizeTextType="uniform"
android:text="11"
android:textAppearance="?android:textAppearanceSmall"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintStart_toEndOf="@+id/volume_button" />
app:layout_constraintStart_toEndOf="@+id/volume_button"
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"/>

<ImageButton
android:id="@+id/volume_button"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_height="45dp"
android:layout_width="45dp"
android:layout_marginLeft="10dp"
android:background="?selectableItemBackgroundBorderless"
android:scaleType="fitXY"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintStart_toStartOf="@+id/player_and_station_list_separator"
app:srcCompat="@drawable/ic_volume_mute_white_24dp" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"
app:srcCompat="@drawable/ic_volume_mute_white_100dp" />

<Switch
android:id="@+id/mode_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="2"
android:scaleY="2"
android:showText="true"
android:textOff="@string/dab"
android:textOn="@string/fm"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"/>

<android.support.constraint.Guideline
android:id="@+id/player_controls_top_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.482" />
app:layout_constraintGuide_percent="0.55" />

<android.support.v7.widget.CardView
android:id="@+id/player_control_panel_background"
Expand Down Expand Up @@ -415,12 +420,21 @@

<android.support.design.widget.FloatingActionButton
android:id="@+id/add_channel_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_height="45dp"
android:layout_width="45dp"
app:fabSize="mini"
android:layout_marginRight="14dp"
android:clickable="true"
android:scaleType="fitXY"
app:layout_constraintBottom_toTopOf="@+id/player_controls_top_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/player_controls_top_guideline"
app:srcCompat="@drawable/ic_add_white_24dp" />
app:layout_constraintTop_toTopOf="@+id/volume_controls_top_guideline"
app:srcCompat="@drawable/ic_add_white_100dp" />

<android.support.constraint.Guideline
android:id="@+id/volume_controls_top_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.45" />
</android.support.constraint.ConstraintLayout>