Skip to content

Commit

Permalink
fragment hide show 使用
Browse files Browse the repository at this point in the history
  • Loading branch information
yannecer committed Feb 5, 2018
1 parent 85ca64b commit 3f403ff
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_week.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
android:id="@+id/weekCalendar"
android:layout_width="match_parent"
android:layout_height="50dp"
android:visibility="gone"></com.necer.ncalendar.calendar.WeekCalendar>
android:visibility="visible"></com.necer.ncalendar.calendar.WeekCalendar>

</LinearLayout>
5 changes: 4 additions & 1 deletion app/src/main/res/layout/fragment_1.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

Expand All @@ -14,7 +15,9 @@
<com.necer.ncalendar.calendar.MonthCalendar
android:id="@+id/monthcalendar"
android:layout_width="match_parent"
android:layout_height="300dp"/>
android:layout_height="300dp"
app:selectCircleRadius ="20dp"/>




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.necer.ncalendar.R;
import com.necer.ncalendar.adapter.CalendarAdapter;
import com.necer.ncalendar.utils.Attrs;
import com.necer.ncalendar.utils.MyLog;
import com.necer.ncalendar.utils.Utils;
import com.necer.ncalendar.view.CalendarView;

Expand Down Expand Up @@ -55,13 +56,18 @@ public CalendarPager(Context context, AttributeSet attrs) {
Attrs.hintColor = ta.getColor(R.styleable.NCalendar_hintColor, getResources().getColor(R.color.hintColor));
Attrs.solarTextSize = ta.getDimension(R.styleable.NCalendar_solarTextSize, Utils.sp2px(context, 18));
Attrs.lunarTextSize = ta.getDimension(R.styleable.NCalendar_lunarTextSize, Utils.sp2px(context, 10));
Attrs.selectCircleRadius = ta.getInt(R.styleable.NCalendar_selectCircleRadius, (int) Utils.dp2px(context, 20));
Attrs.selectCircleRadius = ta.getDimension(R.styleable.NCalendar_selectCircleRadius, Utils.dp2px(context, 20));


MyLog.d("selectCircleRadius::" + Attrs.selectCircleRadius);


Attrs.isShowLunar = ta.getBoolean(R.styleable.NCalendar_isShowLunar, true);

Attrs.pointSize = ta.getDimension(R.styleable.NCalendar_pointSize, (int) Utils.dp2px(context, 2));
Attrs.pointColor = ta.getColor(R.styleable.NCalendar_pointColor, getResources().getColor(R.color.pointColor));
Attrs.hollowCircleColor = ta.getColor(R.styleable.NCalendar_hollowCircleColor, Color.WHITE);
Attrs.hollowCircleStroke = ta.getInt(R.styleable.NCalendar_hollowCircleStroke, (int) Utils.dp2px(context, 1));
Attrs.hollowCircleStroke = ta.getDimension(R.styleable.NCalendar_hollowCircleStroke, Utils.dp2px(context, 1));


Attrs.monthCalendarHeight = (int) ta.getDimension(R.styleable.NCalendar_calendarHeight, Utils.dp2px(context, 300));
Expand Down
4 changes: 2 additions & 2 deletions ncalendar/src/main/java/com/necer/ncalendar/utils/Attrs.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public class Attrs {
public static int selectCircleColor;
public static float solarTextSize ;
public static float lunarTextSize;
public static int selectCircleRadius ;
public static float selectCircleRadius ;
public static boolean isShowLunar ;


public static float pointSize;
public static int pointColor;
public static int hollowCircleColor;
public static int hollowCircleStroke;
public static float hollowCircleStroke;

public static int firstDayOfWeek;
public static int defaultCalendar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class CalendarView extends View {
protected float mLunarTextSize;
protected Paint mSorlarPaint;
protected Paint mLunarPaint;
protected int mSelectCircleRadius;//选中圆的半径
protected float mSelectCircleRadius;//选中圆的半径
protected int mSelectCircleColor;//选中圆的颜色
protected boolean isShowLunar;//是否显示农历

Expand All @@ -45,7 +45,7 @@ public abstract class CalendarView extends View {
protected float mPointSize;//圆点大小

protected int mHollowCircleColor;//空心圆颜色
protected int mHollowCircleStroke;//空心圆粗细
protected float mHollowCircleStroke;//空心圆粗细

protected boolean isShowHoliday;//是否显示节假日
protected List<String> holidayList;
Expand Down
4 changes: 2 additions & 2 deletions ncalendar/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<attr name="selectCircleColor" format="color" />
<attr name="solarTextSize" format="dimension" />
<attr name="lunarTextSize" format="dimension" />
<attr name="selectCircleRadius" format="integer" />
<attr name="selectCircleRadius" format="dimension" />
<attr name="isShowLunar" format="boolean" />

<attr name="pointSize" format="dimension" />
<attr name="pointColor" format="color" />
<attr name="hollowCircleColor" format="color" />
<attr name="hollowCircleStroke" format="integer" />
<attr name="hollowCircleStroke" format="dimension" />
<attr name="startDate" format="string" />
<attr name="endDate" format="string" />

Expand Down

0 comments on commit 3f403ff

Please sign in to comment.