This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.view.GestureDetector; | |
import android.view.MotionEvent; | |
import android.view.ViewGroup; | |
/** | |
* Detects if scroll gesture happens, and if the secondary (often, the "inner" scrollable is at the | |
* edge in the direction the gesture is in, have the primary scrollable process the gesture | |
*/ | |
public class CooperativeScrollGestureListener implements GestureDetector.OnGestureListener { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meter.setProgressDrawable(getResources().getDrawable(R.drawable.progress_bar_circular_green)); | |
// rotate circle progress bar to make it look like it's counter-clockwise and starting at the top | |
meter.setRotation((-progress / 100f * 360f) - 90f); | |
meter.setVisibility(View.VISIBLE); | |
meter.setProgress(progress); |