Skip to content

Commit

Permalink
SDTitleLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
SiberiaDante committed Jul 31, 2018
1 parent 3c0fd7d commit 4054153
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Documents/note.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
https://github.com/developerHaoz/DialogFragmentDemos/blob/master/app/src/main/java/com/example/haoz/dialogfragmentdemos/activity/DialogActivity.java

SDLineEditText 增加下划线高度动态设置
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ public static long string2Millis(String time, String pattern) {
/**
* convert to time according to the millisecond timestamp adn date pattern
*
* @param millisecond the millisecond timestamp
* @param pattern time pattern
* @param millisecond the millisecond timestamp
* @param pattern time pattern
* @return time, date
*/
public static String getSDFDateFromMillisTimeStamp(String millisecond, String pattern) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ private void initData(Context context, AttributeSet attrs) {

mPaint = new Paint();
mLineColor = attrArrays.getColor(R.styleable.SDLineEditText_sd_line_color, mLineColor);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(mLineColor);
// int lenght = attrArrays.getIndexCount();
// for (int i = 0; i < lenght; i++) {
// int index = attrArrays.getIndex(i);
Expand All @@ -59,8 +61,8 @@ public SDLineEditText(Context context, AttributeSet attrs, int defStyleAttr) {
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(mLineColor);
// mPaint.setStyle(Paint.Style.STROKE);
// mPaint.setColor(mLineColor);
canvas.drawLine(0, getHeight() - 1, getWidth() - 1, getHeight() - 1, mPaint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,14 @@ private void settingLine() {
}
}

/**
* setting title layout background
* @param colorRes
*/
public void setTitleLayoutBackground(int colorRes) {
mRlLayout.setBackgroundColor(colorRes);
}

/**
* 设置title
*
Expand Down

0 comments on commit 4054153

Please sign in to comment.