devadvance / circularseekbar

Custom circular SeekBar (Circle, Semi-circle, and Ellipse) View/Widget for Android
Apache License 2.0
464 stars 134 forks source link

added onStopTracking #2

Closed Berco closed 10 years ago

Berco commented 10 years ago

like in the original SeekBarChangeListener.

sud007 commented 10 years ago

How'd you do that? I also tried adding these methods in the interface declaration in the middle of the CircularSeekBar.java but no response. Please enlighten. Thanks.

***edit

Thanks Got it cool. But why "onProgressChanged" was changed? and "onStopTrackingTouch" not added ?

i am trying this after the comment though. thanks.

sud007 commented 10 years ago

Please guide on 1 more issue... Following 1 of the three methods.

l1 @Override l2 public void onStartTrackingTouch(CircularSeekBar circularSeekBar) { l3 // TODO Auto-generated method stub l4 Log.v("test", "start"); l5 Toast.makeText(getApplication(), "ended at", Toast.LENGTH_SHORT).show(); }

Logcat shows the texts successfully in all the three methods. But if any Task is given eg here to show a Toast or To change a string in TextView... it says

"02-07 06:30:30.272: E/AndroidRuntime(5866): FATAL EXCEPTION: main 02-07 06:30:30.272: E/AndroidRuntime(5866): Process: com.ui.yogeshblogspot, PID: 5866 02-07 06:30:30.272: E/AndroidRuntime(5866): java.lang.NullPointerException 02-07 06:30:30.272: E/AndroidRuntime(5866): at android.widget.Toast.(Toast.java:93) 02-07 06:30:30.272: E/AndroidRuntime(5866): at android.widget.Toast.makeText(Toast.java:241) 02-07 06:30:30.272: E/AndroidRuntime(5866): at com.ui.yogeshblogspot.CustomSeekBarExActivity.onProgressChanged(CustomSeekBarExActivity.java:76) 02-07 06:30:30.272: E/AndroidRuntime(5866): at com.devadvance.circularseekbar.CircularSeekBar.onTouchEvent(CircularSeekBar.java:699) 02-07 06:30:30.272: E/AndroidRuntime(5866): at android.view.View.dispatchTouchEvent(View.java:7690) 02-07 06:30:30.272: E/AndroidRuntime(5866): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216) "

not letting me do anything on events. Pleaselet me know Thanks.

Berco commented 10 years ago

Hi,

I've just added onStopStracking to the motion event UP. onStartTracking could be added to the motion event Down. I've only added onStopTracking because that was all I needed for my project. I'm not sure if my solution is the best, it was the first thing that came to my mind while exploring your (nice!) code.

I'm using it here: https://github.com/Berco/PilightTesting/blob/development/src/by/zatta/pilight/fragments/DeviceListFragment.java#L222 https://github.com/Berco/PilightTesting/blob/development/src/by/zatta/pilight/fragments/DeviceListFragment.java#L230 https://github.com/Berco/PilightTesting/blob/development/src/by/zatta/pilight/fragments/DeviceListFragment.java#L305

All in the same file, not yet in a production app.

sud007 commented 10 years ago

@Berco nice code.

Got my issue resolved by @devadvance , thanks all!