-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow overriding
calculateExtraLayoutSpace
in the layout manager (#601
- Loading branch information
1 parent
0e1b654
commit aea1992
Showing
9 changed files
with
83 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
view/src/main/java/com/kizitonwose/calendar/view/LayoutHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.kizitonwose.calendar.view | ||
|
||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.kizitonwose.calendar.view.internal.CalendarLayoutManager | ||
|
||
/** | ||
* An interface with methods that can be overridden | ||
* in the internal [LinearLayoutManager]. | ||
*/ | ||
public interface LayoutHelper { | ||
/** | ||
* Calculates the amount of extra space (in pixels) that should be laid out by | ||
* [CalendarLayoutManager] and stores the result in [extraLayoutSpace]. | ||
* [extraLayoutSpace[0]] should be used for the extra space at the top in a vertical | ||
* calendar or left in a horizontal calendar, and extraLayoutSpace[1] should be used for | ||
* the extra space at the bottom in a vertical calendar or right in a horizontal calendar. | ||
* | ||
* @see [LinearLayoutManager.calculateExtraLayoutSpace] | ||
*/ | ||
public fun calculateExtraLayoutSpace(state: RecyclerView.State, extraLayoutSpace: IntArray) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters