fix poll options outline provider
closes sk22#702
This commit is contained in:
@@ -37,6 +37,16 @@ public class OutlineProviders{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private final static int BUTTON_BG_HEIGHT=V.dp(40);
|
||||||
|
public static final ViewOutlineProvider M3_BUTTON=new ViewOutlineProvider(){
|
||||||
|
@Override
|
||||||
|
public void getOutline(View view, Outline outline){
|
||||||
|
int viewHeight=view.getHeight();
|
||||||
|
int top=Math.floorDiv(viewHeight - BUTTON_BG_HEIGHT, 2);
|
||||||
|
outline.setRoundRect(0, top, view.getWidth(), top + BUTTON_BG_HEIGHT, V.dp(20));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public static ViewOutlineProvider roundedRect(int dp){
|
public static ViewOutlineProvider roundedRect(int dp){
|
||||||
ViewOutlineProvider provider=roundedRects.get(dp);
|
ViewOutlineProvider provider=roundedRects.get(dp);
|
||||||
if(provider!=null)
|
if(provider!=null)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class PollOptionStatusDisplayItem extends StatusDisplayItem{
|
|||||||
progressBg=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted, activity.getTheme()).mutate();
|
progressBg=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted, activity.getTheme()).mutate();
|
||||||
progressBgInset=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted_inset, activity.getTheme()).mutate();
|
progressBgInset=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted_inset, activity.getTheme()).mutate();
|
||||||
itemView.setOnClickListener(this::onButtonClick);
|
itemView.setOnClickListener(this::onButtonClick);
|
||||||
button.setOutlineProvider(OutlineProviders.roundedRect(24));
|
button.setOutlineProvider(OutlineProviders.M3_BUTTON);
|
||||||
button.setClipToOutline(true);
|
button.setClipToOutline(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user