Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #38 The createClassifier() Method Is Final #39

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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