Apps custom vertical seekbar is not working on API-23(Marshmallow)

GovindRai

Lurker
I have created a custom vertical seekbar (graphics) which is working on API-10 to API-22 and API -24. But its not working in API-23 (Marshmallow 6.x). Could you please help me why its breaking the widget / seekbar function.

Code:
<com.jci.thermostat.uc.common.VerticalSeekBar
       android:layout_width="32dp"
       android:layout_height="match_parent"
       android:id="@+id/setpointBar"
       android:splitTrack="false"
       android:thumb="@drawable/thumb_vertical"
       android:progressDrawable="@android:color/transparent"
       android:background="@android:color/transparent"
       android:thumbOffset="11dp"
       android:paddingLeft="11dp"
       android:paddingRight="11dp" />

Code:
public class VerticalSeekBar extends SeekBar {

public VerticalSeekBar(Context context, AttributeSet attrs) {
   super(context, attrs);
}

[USER=1021285]@override[/USER]
public void onDraw(Canvas canvas) {
   canvas.rotate(-90);
   canvas.translate(-getHeight(),0);
   super.onDraw(canvas);
}


[USER=1021285]@override[/USER]
protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
   super.onMeasure(heightMeasureSpec, widthMeasureSpec);
   setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
}

protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(h, w, oldh, oldw);
}

[USER=1021285]@override[/USER]
public boolean onTouchEvent(MotionEvent event) {
   if (!isEnabled()) {
       return isClickable() || isLongClickable();
   }

   switch (event.getAction()) {
       case MotionEvent.ACTION_DOWN:
       case MotionEvent.ACTION_UP:
           setPressed(MotionEvent.ACTION_UP != event.getAction());
       case MotionEvent.ACTION_MOVE:
           final int paddingLeft = getPaddingLeft();
           final int height = getHeight();
           final int available = height - paddingLeft - getPaddingRight();
           final int max = getMax();
           int progress = (int)((height - event.getY() - paddingLeft) * max / available);
           progress = Math.min(max, Math.max(0, progress));
           setProgress(progress);
           break;
       case MotionEvent.ACTION_CANCEL:
       case MotionEvent.ACTION_OUTSIDE:
           setPressed(false);
           break;
   }
   return true;
}

[USER=1021285]@override[/USER]
public synchronized void setProgress(int progress) {
   if (progress != getProgress()) {
       super.setProgress(progress);
       onSizeChanged(getWidth(), getHeight(), 0, 0);
   }
}
}

if you need more information plz let me know.
 
D

Deleted User

Guest
Can you please clarify the problem? "Not working" doesn't tell us much.
Thanks.
 

Phalon4

Android Enthusiast
Can you please clarify the problem? "Not working" doesn't tell us much.
Thanks.

Go into Settings look for Apps then in upper right corner tick 3 dots and tick Reset App permissions and see will that help. This options varies from device from device.
 

GovindRai

Lurker
Thread starter
Can you please clarify the problem? "Not working" doesn't tell us much.
Thanks.

I have created custom Vertical graphics scroll bar in older version (API 22) and it properly displaying in all versions from API 10 to 22 and from API 24, 25 onwards its working properly. Its displaying graphics scroll bar ( example - Change the temperature slider indication )
But in Android Version 6.x(API Version 23) - Vertical graphics temperature slider scroll bar is not displaying and i dont have any clue why its not displaying specially in this build. For your information is custom build vertical scroll widget.

Please refer my code above.

The image showing slider is appearing from API-10 to API-25 Except API-23.where it just show blank screen.which i have attached.
 

Attachments

  • Screenshot_1498066557.png
    Screenshot_1498066557.png
    160.1 KB · Views: 1,192
  • f96dc986-d3ff-43e8-980d-7b37a116872c.jpg
    f96dc986-d3ff-43e8-980d-7b37a116872c.jpg
    16.7 KB · Views: 398
Last edited:

GovindRai

Lurker
Thread starter
Go into Settings look for Apps then in upper right corner tick 3 dots and tick Reset App permissions and see will that help. This options varies from device from device.

Sorry, its not working when reset app preference functionalities.
 
Top