选择车辆
This commit is contained in:
@@ -185,7 +185,7 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
protected void setTitleBar(String title, View.OnClickListener listener, boolean isVisible, String right, View.OnClickListener rightListener) {
|
||||
mToolbar = (Toolbar) findViewById(R.id.common_toolbar);
|
||||
mToolbar.setBackgroundColor(Color.TRANSPARENT);
|
||||
mToolbar.setBackgroundColor(statusColor == -1 ? Color.TRANSPARENT : ContextCompat.getColor(mContext, statusColor));
|
||||
if (!TextUtils.isEmpty(title))
|
||||
((TextView) findViewById(R.id.common_toolBar_title)).setText(title);
|
||||
TextView mTextRight = (TextView) findViewById(R.id.common_toolBar_text_right);
|
||||
|
||||
+13
-10
@@ -25,15 +25,14 @@ public class RecycleViewDivider extends RecyclerView.ItemDecoration {
|
||||
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认分割线:高度为2px,颜色为灰色
|
||||
* 获取属性值,
|
||||
*
|
||||
* @param context
|
||||
* @param orientation 列表方向
|
||||
* @param orientation 列表方向
|
||||
*/
|
||||
|
||||
public RecycleViewDivider(Context context, int orientation){
|
||||
public RecycleViewDivider(Context context, int orientation) {
|
||||
if (orientation != LinearLayoutManager.VERTICAL && orientation != LinearLayoutManager.HORIZONTAL) {
|
||||
throw new IllegalArgumentException("请输入正确的参数!");
|
||||
}
|
||||
@@ -88,7 +87,11 @@ public class RecycleViewDivider extends RecyclerView.ItemDecoration {
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
|
||||
if (mOrientation == LinearLayoutManager.VERTICAL) {
|
||||
outRect.set(0, 0, 0, mDividerHeight);
|
||||
if (parent.getChildAdapterPosition(view) == 0) {
|
||||
outRect.set(0, mDividerHeight, 0, mDividerHeight);
|
||||
} else {
|
||||
outRect.set(0, 0, 0, mDividerHeight);
|
||||
}
|
||||
} else {
|
||||
outRect.set(0, 0, mDividerHeight, 0);
|
||||
}
|
||||
@@ -97,10 +100,10 @@ public class RecycleViewDivider extends RecyclerView.ItemDecoration {
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
super.onDraw(c, parent, state);
|
||||
if(mOrientation==LinearLayoutManager.VERTICAL){
|
||||
drawVerticalLine(c,parent);
|
||||
}else{
|
||||
drawHorizontalLine(c,parent);
|
||||
if (mOrientation == LinearLayoutManager.VERTICAL) {
|
||||
drawVerticalLine(c, parent);
|
||||
} else {
|
||||
drawHorizontalLine(c, parent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +114,7 @@ public class RecycleViewDivider extends RecyclerView.ItemDecoration {
|
||||
final int bottom = parent.getMeasuredHeight() - parent.getPaddingBottom();
|
||||
final int childSize = parent.getChildCount();
|
||||
for (int i = 0; i < childSize - 1; i++) {
|
||||
if ((i+1) % 3 != 0) {
|
||||
if ((i + 1) % 3 != 0) {
|
||||
final View child = parent.getChildAt(i);
|
||||
RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) child.getLayoutParams();
|
||||
final int left = child.getRight() + layoutParams.rightMargin;
|
||||
@@ -134,7 +137,7 @@ public class RecycleViewDivider extends RecyclerView.ItemDecoration {
|
||||
final int right = parent.getMeasuredWidth() - parent.getPaddingRight();
|
||||
final int childSize = parent.getChildCount();
|
||||
for (int i = 0; i < childSize; i++) {
|
||||
if (i < childSize -1) {
|
||||
if (i < childSize - 1) {
|
||||
final View child = parent.getChildAt(i);
|
||||
RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) child.getLayoutParams();
|
||||
final int top = child.getBottom() + layoutParams.bottomMargin;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
|
||||
<color name="color_F5">#F5F5F5</color>
|
||||
<color name="color_F3">#F3F3F5</color>
|
||||
<color name="color_E1">#E1E1E1</color>
|
||||
<color name="colorBlack0">#000000</color>
|
||||
<color name="color_line">#E6E6E6</color>
|
||||
|
||||
Reference in New Issue
Block a user