Skip to content

Commit

Permalink
Merge pull request #4544 from Bnyro/master
Browse files Browse the repository at this point in the history
fix: remove useless buttons to reset pitch and playback speed
  • Loading branch information
Bnyro authored Aug 19, 2023
2 parents be389fc + b271103 commit b457938
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.recyclerview.widget.GridLayoutManager
import com.github.libretube.constants.PreferenceKeys
import com.github.libretube.databinding.PlaybackBottomSheetBinding
import com.github.libretube.extensions.round
import com.github.libretube.helpers.PlayerHelper
import com.github.libretube.helpers.PreferenceHelper
import com.github.libretube.ui.adapters.SliderLabelsAdapter

Expand Down Expand Up @@ -55,15 +54,6 @@ class PlaybackOptionsSheet(
onChange()
}

binding.resetSpeed.setOnClickListener {
binding.speed.value = PlayerHelper.playbackSpeed
}

binding.resetPitch.setOnClickListener {
binding.pitch.value = 1f
onChange()
}

binding.skipSilence.setOnCheckedChangeListener { _, isChecked ->
player.skipSilenceEnabled = isChecked
PreferenceHelper.putBoolean(PreferenceKeys.SKIP_SILENCE, isChecked)
Expand Down
61 changes: 13 additions & 48 deletions app/src/main/res/layout/playback_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,14 @@
android:layout_marginTop="10dp"
android:orientation="horizontal" />

<LinearLayout
<com.google.android.material.slider.Slider
android:id="@+id/speed"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<com.google.android.material.slider.Slider
android:id="@+id/speed"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:stepSize="0.1"
android:value="1.0"
android:valueFrom="0.2"
android:valueTo="4.0" />

<ImageView
android:id="@+id/reset_speed"
android:tooltipText="@string/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_history" />

</LinearLayout>
android:layout_height="wrap_content"
android:stepSize="0.1"
android:value="1.0"
android:valueFrom="0.2"
android:valueTo="4.0" />

<TextView
android:layout_width="wrap_content"
Expand All @@ -79,32 +62,14 @@
android:layout_marginTop="10dp"
android:orientation="horizontal" />

<LinearLayout
<com.google.android.material.slider.Slider
android:id="@+id/pitch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<com.google.android.material.slider.Slider
android:id="@+id/pitch"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:stepSize="0.1"
android:value="1.0"
android:valueFrom="0.5"
android:valueTo="2.0" />

<ImageView
android:id="@+id/reset_pitch"
android:tooltipText="@string/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_history" />

</LinearLayout>
android:stepSize="0.1"
android:value="1.0"
android:valueFrom="0.5"
android:valueTo="2.0" />

</LinearLayout>

Expand Down

0 comments on commit b457938

Please sign in to comment.