Skip to content

Commit

Permalink
年份颜色修改
Browse files Browse the repository at this point in the history
  • Loading branch information
StarrySky123123123 committed Feb 10, 2020
1 parent fdc1bf7 commit 3d6356a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class Constant {
public static String DAYITEM = "#00EE76";

public static Integer YEAR_FONTSIZE = -1;
public static String YEAR_FONTCOLOR = "#000000";
public static Integer MOUTH_FONTSIZE = -1;
public static Integer DAY_FONTSIZE = -1;
public static Integer DAYNOTE_FONTSIZE = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Handler;
import android.os.Message;
import android.support.v4.view.ViewPager;
Expand Down Expand Up @@ -174,6 +175,7 @@ public ZhxDate(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DateLayout);
Constant.MONTH_XHX = a.getString(R.styleable.DateLayout_month_xhxcolor)==null?"#4678ff":a.getString(R.styleable.DateLayout_month_xhxcolor);
Constant.DAYITEM = a.getString(R.styleable.DateLayout_dayitemcolor)==null?"#4678ff":a.getString(R.styleable.DateLayout_dayitemcolor);
Constant.YEAR_FONTCOLOR = a.getString(R.styleable.DateLayout_year_fontcolor)==null?"#000000":a.getString(R.styleable.DateLayout_year_fontcolor);
bs = a.getInteger(R.styleable.DateLayout_bs,2);
Constant.YEAR_FONTSIZE = a.getInteger(R.styleable.DateLayout_year_fontsize,16);
Constant.MOUTH_FONTSIZE = a.getInteger(R.styleable.DateLayout_month_fontsize,15);
Expand Down Expand Up @@ -392,6 +394,8 @@ private void initView(View view) {
v1.setLayoutParams(params);

t1.setTextSize(Constant.YEAR_FONTSIZE);
t1.setTextColor(Color.parseColor(Constant.YEAR_FONTCOLOR));


i1.setOnClickListener(this);
i2.setOnClickListener(this);
Expand Down
1 change: 1 addition & 0 deletions customdatelibrary/src/main/res/layout/zhxdate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<TextView
android:id="@+id/t1"
android:text="2020"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"
android:gravity="center"
Expand Down
1 change: 1 addition & 0 deletions customdatelibrary/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<attr name="day_fontsize" format="integer" />
<attr name="daynote_fontsize" format="integer" />
<attr name="year_fontsize" format="integer" />
<attr name="year_fontcolor" format="string" />
<attr name="title_fontsize" format="integer" />
<attr name="title_backcolor" format="string" />
<attr name="title_fontcolor" format="string" />
Expand Down

0 comments on commit 3d6356a

Please sign in to comment.