添加BaseFunctionItemView类视图1像素美化边框
This commit is contained in:
@@ -413,7 +413,18 @@ public class AboutView extends LinearLayout {
|
||||
setPadding(dp2px(PADDING_MID), dp2px(PADDING_SMALL), dp2px(PADDING_MID), dp2px(PADDING_SMALL));
|
||||
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
|
||||
setClickable(true);
|
||||
setBackgroundResource(android.R.drawable.list_selector_background);
|
||||
setBackground(create_item_background());
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建带1像素边框的背景drawable
|
||||
*/
|
||||
private android.graphics.drawable.Drawable create_item_background() {
|
||||
android.graphics.drawable.GradientDrawable drawable = new android.graphics.drawable.GradientDrawable();
|
||||
drawable.setStroke(1, mItemContext.getResources().getColor(R.color.gray_200));
|
||||
drawable.setCornerRadius(4);
|
||||
drawable.setColor(mItemContext.getResources().getColor(android.R.color.white));
|
||||
return drawable;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user