Skip to content

Commit

Permalink
Embed radial seek bar
Browse files Browse the repository at this point in the history
to remove dependy of JCenter artifact repository
  • Loading branch information
kaaholst committed Nov 1, 2024
1 parent 5c676eb commit 8601856
Show file tree
Hide file tree
Showing 8 changed files with 875 additions and 57 deletions.
3 changes: 0 additions & 3 deletions Squeezer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ dependencies {
// Changelogs, see https://github.com/cketti/ckChangeLog.
implementation 'de.cketti.library.changelog:ckchangelog:1.2.0'

// Radial SeekBar
implementation 'com.sdsmdg.harjot:croller:1.0.7'

// Fastscroller
implementation 'com.quiph.ui:recyclerviewfastscroller:1.0.0'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.slider.Slider;
import com.sdsmdg.harjot.crollerTest.Croller;
import com.sdsmdg.harjot.crollerTest.OnCrollerChangeListener;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
Expand Down Expand Up @@ -107,9 +105,11 @@
import uk.org.ngo.squeezer.service.event.SongTimeChanged;
import uk.org.ngo.squeezer.util.ImageFetcher;
import uk.org.ngo.squeezer.widget.CallStatePermissionLauncher;
import uk.org.ngo.squeezer.widget.RadialSeekBar;
import uk.org.ngo.squeezer.widget.OnRadialSeekBarChangeListener;
import uk.org.ngo.squeezer.widget.OnSwipeListener;

public class NowPlayingFragment extends Fragment implements OnCrollerChangeListener, CallStateDialog.CallStateDialogHost {
public class NowPlayingFragment extends Fragment implements OnRadialSeekBarChangeListener, CallStateDialog.CallStateDialogHost {

private static final String TAG = "NowPlayingFragment";

Expand Down Expand Up @@ -188,7 +188,7 @@ public class NowPlayingFragment extends Fragment implements OnCrollerChangeList

// For the small artwork layout
private CheckBox muteToggle;
private Croller volumeWheel;
private RadialSeekBar volumeWheel;
private int currentProgress = 0;
private boolean trackingTouch;

Expand Down Expand Up @@ -445,7 +445,7 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
mActivity.recreate();
});

volumeWheel.setOnCrollerChangeListener(this);
volumeWheel.setOnRadialSeekBarChangeListener(this);
muteToggle.setOnClickListener(view -> requireService().toggleMute());

v.findViewById(R.id.settings).setOnClickListener(view1 -> {
Expand Down Expand Up @@ -900,7 +900,7 @@ private void updateVolumeInfo() {
volumeWheel.setIndicatorColor(ColorUtils.setAlphaComponent(volumeWheel.getIndicatorColor(), volumeInfo.muted ? 63 : 255));
volumeWheel.setProgressPrimaryColor(ColorUtils.setAlphaComponent(volumeWheel.getProgressPrimaryColor(), volumeInfo.muted ? 63 : 255));
volumeWheel.setProgressSecondaryColor(ColorUtils.setAlphaComponent(volumeWheel.getProgressSecondaryColor(), volumeInfo.muted ? 63 : 255));
volumeWheel.setOnCrollerChangeListener(volumeInfo.muted ? null : this);
volumeWheel.setOnRadialSeekBarChangeListener(volumeInfo.muted ? null : this);
volumeWheel.setOnTouchListener(volumeInfo.muted ? (view, motionEvent) -> true : null);
}
}
Expand Down Expand Up @@ -1272,7 +1272,7 @@ public void onEvent(PlayerVolume event) {
}

@Override
public void onProgressChanged(Croller croller, int progress) {
public void onProgressChanged(RadialSeekBar seekBar, int progress) {
if (currentProgress != progress) {
currentProgress = progress;
volumeWheel.setLabel(String.valueOf(progress));
Expand All @@ -1281,12 +1281,12 @@ public void onProgressChanged(Croller croller, int progress) {
}

@Override
public void onStartTrackingTouch(Croller croller) {
public void onStartTrackingTouch(RadialSeekBar seekBar) {
trackingTouch = true;
}

@Override
public void onStopTrackingTouch(Croller croller) {
public void onStopTrackingTouch(RadialSeekBar seekBar) {
trackingTouch = false;
}

Expand Down
42 changes: 0 additions & 42 deletions Squeezer/src/main/java/uk/org/ngo/squeezer/widget/Croller.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package uk.org.ngo.squeezer.widget;

public interface OnRadialSeekBarChangeListener {
void onProgressChanged(RadialSeekBar seekBar, int progress);

void onStartTrackingTouch(RadialSeekBar seekBar);

void onStopTrackingTouch(RadialSeekBar seekBar);
}
Loading

0 comments on commit 8601856

Please sign in to comment.