Skip to content

Commit

Permalink
选中
Browse files Browse the repository at this point in the history
  • Loading branch information
yannecer committed Nov 8, 2018
1 parent 164a62a commit 2caea27
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
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.

4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="necer.ncalendardemo">

<application
Expand All @@ -8,7 +9,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".activity.TestMiui9Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;


import org.joda.time.DateTime;

import necer.ncalendardemo.R;

/**
Expand All @@ -24,5 +27,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
supportActionBar.hide();
}




}
}
6 changes: 6 additions & 0 deletions app/src/main/res/layout/activity_miui9.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
android:layout_height="match_parent">


<Button
android:layout_width="match_parent"
android:layout_height="wrap_content" />


<com.necer.calendar.Miui9Calendar
android:layout_width="match_parent"
app:calendarHeight="300dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_height="match_parent"/>


Expand Down
12 changes: 2 additions & 10 deletions calendar/src/main/java/com/necer/calendar/Miui9Calendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.necer.MyLog;
import com.necer.utils.Attrs;

/**
Expand All @@ -32,21 +31,14 @@ public Miui9Calendar(@NonNull Context context, @Nullable AttributeSet attrs) {
monthCalendar = new MonthCalendar(context, attrs);
weekCalendar = new WeekCalendar(context, attrs);


Attrs attrss = monthCalendar.getAttrs();

duration = attrss.duration;
monthHeigh = attrss.monthCalendarHeight;
STATE = attrss.defaultCalendar;


weekHeigh = monthHeigh / 5;


MyLog.d("monthHeigh::" + monthHeigh);
MyLog.d("monthHeigh:22:" + weekHeigh);


addView(monthCalendar);
addView(weekCalendar);

Expand All @@ -59,9 +51,9 @@ public Miui9Calendar(@NonNull Context context, @Nullable AttributeSet attrs) {
monthCalendar.setLayoutParams(monthLayoutParams);
weekCalendar.setLayoutParams(weekLayoutParams);

weekCalendar.setVisibility(STATE == Attrs.MONTH ? INVISIBLE : VISIBLE);


MyLog.d("LayoutParams::" + monthLayoutParams);
MyLog.d("LayoutParams::" + weekLayoutParams);

}
}

0 comments on commit 2caea27

Please sign in to comment.