Skip to content

Commit

Permalink
Improve weekViewClass and monthViewClass documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kizitonwose committed May 17, 2023
1 parent 8595799 commit 3dfb2d2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,29 @@ import com.kizitonwose.calendar.view.ViewContainer
import java.time.DayOfWeek
import java.time.YearMonth

// We assign this class to the `monthViewClass` attribute in XML.
// See usage in example_6_fragment.xml
// This can also be set programmatically:
// calendarView.monthViewClass = Example6MonthView::class.java.name
/**
* We assign this class to the `monthViewClass` attribute in XML.
* See usage in example_6_fragment.xml
* This can also be set programmatically:
* ```
* calendarView.monthViewClass = Example6MonthView::class.java.name
* ```
* **NOTE:** This class must have a constructor which takes only a [Context]. You should
* exclude the constructor of this class from code obfuscation if enabled. Use the [Keep]
* annotation on the class constructor OR add the following proguard rule:
* ```
* -keepclassmembers class com.kizitonwose.calendar.sample.view.Example6MonthView {
* public <init>(android.content.Context);
* }
* ```
* If this class is assigned vial xml, you should also exclude the class
* name from code obfuscation:
* ```
* -keepnames class com.kizitonwose.calendar.sample.view.Example6MonthView
* ```
* Please replace com.kizitonwose.calendar.sample.view.Example6MonthView in the
* proguard examples above with your class full qualified name.
*/
class Example6MonthView @Keep constructor(context: Context) : CardView(context) {

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ open class CalendarView : RecyclerView {

/**
* A [ViewGroup] which is instantiated and used as the container for each month.
* This class must have a constructor which takes only a [Context]. You should
* exclude the name and constructor of this class from code obfuscation if enabled.
* This class must have a constructor which takes only a [Context].
*
* **You should exclude the name and constructor of this class from code
* obfuscation if enabled**.
*/
var monthViewClass: String? = null
set(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ open class WeekCalendarView : RecyclerView {

/**
* A [ViewGroup] which is instantiated and used as the container for each week.
* This class must have a constructor which takes only a [Context]. You should
* exclude the name and constructor of this class from code obfuscation if enabled.
* This class must have a constructor which takes only a [Context].
*
* **You should exclude the name and constructor of this class from code
* obfuscation if enabled**.
*/
var weekViewClass: String? = null
set(value) {
Expand Down

0 comments on commit 3dfb2d2

Please sign in to comment.