Skip to content

Commit

Permalink
Open the method
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverspryn committed Mar 28, 2024
1 parent 1c06740 commit 8d7af18
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import com.oliverspryn.android.multimodal.model.WindowSizeClass
* that can be extracted about the size of the screen and where its hinge
* is located.
*
* This class and all of its methods are open for extension and override,
* particularly for creating fakes for testing purposes.
*
* @constructor A default instance of this class without any initialization
* or other actions.
*/
Expand All @@ -36,14 +39,17 @@ open class Classifier {
* practices, as defined here:
* [Window Size Classes](https://developer.android.com/guide/topics/large-screens/support-different-screen-sizes#window_size_classes).
*
* This method is open for extension and override, particularly for
* creating fakes for testing purposes.
*
* @param foldingFeature A physical description of the screen's folded
* state, if a hinge is present.
* @param windowDpSize A rectangle indicating the X and Y dimensions of the
* screen in DPs (density-independent pixels).
* @return Data modeling the complete posture and size of the device's
* screen.
*/
fun createClassifier(foldingFeature: FoldingFeature?, windowDpSize: DpSize) = when {
open fun createClassifier(foldingFeature: FoldingFeature?, windowDpSize: DpSize) = when {
foldingFeature == null -> createFullyOpenedDevice(windowDpSize)
isBookMode(foldingFeature) -> createBookModeObject(foldingFeature)
isTableTopMode(foldingFeature) -> createTableTopObject(foldingFeature)
Expand Down

0 comments on commit 8d7af18

Please sign in to comment.