Skip to content

Commit

Permalink
【Jiang】:修复一个无箭头时文字左偏的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
jxr202 committed Mar 30, 2018
1 parent 6ce5bbd commit aea48fa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions colorful-ui-example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:jxr202="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eeeeee"
android:orientation="vertical" >
android:orientation="vertical">

<com.jxr202.colorful_ui.TitleBar
android:id="@+id/title_bar"
Expand All @@ -31,35 +30,36 @@
jxr202:mRightViewSrc="@drawable/date_right"
jxr202:mTitleViewId="@+id/date_title"
jxr202:mTitleViewText="@string/date_title"
jxr202:mTitleViewTextSize="16dp"
jxr202:mTitleViewTextColor="#2C9BB6"
jxr202:mTodayTextBackground="#50D2C2"
jxr202:mTitleViewTextSize="16dp"
jxr202:mTodayText="@string/date_today"
jxr202:mTodayTextSize="16dp"
jxr202:mTodayTextColor="#ffffff"/>
jxr202:mTodayTextBackground="#50D2C2"
jxr202:mTodayTextColor="#ffffff"
jxr202:mTodayTextSize="16dp" />

<TextView
android:id="@+id/tv_date"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:text="@string/date_title"
android:textColor="#2C9BB6"
android:textSize="16sp"
android:text="@string/date_title"/>
android:textSize="16sp" />

<com.jxr202.colorful_ui.ItemView
android:id="@+id/itemView"
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#ffffff"
jxr202:mBottomLineColor="#cccccc"
jxr202:mLeftImage="@mipmap/we_chat_sport_logo"
jxr202:mLeftTitleText="微信运动"
jxr202:mLeftTitleTextSize="15sp"
jxr202:mLeftTitleTextColor="#010101"
jxr202:mLeftTitleTextSize="15sp"
jxr202:mRightImage="@drawable/ic_item_more"
jxr202:mRightImageVisibility="gone"
jxr202:mRightText="24小时不停"
jxr202:mRightTextSize="14sp"
jxr202:mRightTextColor="#999999"
jxr202:mRightImage="@drawable/ic_item_more"
jxr202:mBottomLineColor="#cccccc"/>
jxr202:mRightTextSize="14sp" />

</LinearLayout >
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private void initView() {
LayoutParams bottomLineParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1);

leftIconParams.addRule(CENTER_VERTICAL);
leftIconParams.setMarginStart(dp2px(10));
leftIconParams.setMarginStart(dp2px(15));

leftTitleParams.addRule(CENTER_VERTICAL);
leftTitleParams.addRule(END_OF, mLeftIconId);
Expand All @@ -105,8 +105,8 @@ private void initView() {
if (mRightIconVisibility == VISIBLE) {
rightTextParams.addRule(START_OF, mRightIconId);
} else {
rightIconParams.addRule(ALIGN_PARENT_END);
rightIconParams.setMarginEnd(dp2px(15));
rightTextParams.addRule(ALIGN_PARENT_END);
rightTextParams.setMarginEnd(dp2px(20));
}

bottomLineParams.addRule(ALIGN_PARENT_BOTTOM);
Expand Down

0 comments on commit aea48fa

Please sign in to comment.