-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve custom layouts in different form factors
- Loading branch information
1 parent
5a45d2c
commit 5a5ccb9
Showing
70 changed files
with
1,109 additions
and
694 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package me.magnum.melonds.domain.model | ||
|
||
import android.net.Uri | ||
import me.magnum.melonds.domain.model.ui.Orientation | ||
import java.util.* | ||
|
||
data class Background(val id: UUID?, val name: String, val orientation: Orientation, val uri: Uri) |
15 changes: 0 additions & 15 deletions
15
app/src/main/java/me/magnum/melonds/domain/model/BackgroundMode.kt
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package me.magnum.melonds.domain.model | ||
|
||
class Point(var x: Int, var y: Int) { | ||
data class Point(var x: Int, var y: Int) { | ||
constructor() : this(0, 0) | ||
} |
7 changes: 0 additions & 7 deletions
7
app/src/main/java/me/magnum/melonds/domain/model/PositionedLayoutComponent.kt
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
package me.magnum.melonds.domain.model | ||
|
||
data class Rect(val x: Int, val y: Int, val width: Int, val height: Int) | ||
data class Rect(val x: Int, val y: Int, val width: Int, val height: Int) { | ||
|
||
val bottom get() = y + height | ||
|
||
val right get() = x + width | ||
} |
2 changes: 2 additions & 0 deletions
2
app/src/main/java/me/magnum/melonds/domain/model/RuntimeBackground.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
14 changes: 0 additions & 14 deletions
14
app/src/main/java/me/magnum/melonds/domain/model/UILayout.kt
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
app/src/main/java/me/magnum/melonds/domain/model/layout/BackgroundMode.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,10 @@ | ||
package me.magnum.melonds.domain.model.layout | ||
|
||
enum class BackgroundMode { | ||
STRETCH, | ||
FIT_CENTER, | ||
FIT_TOP, | ||
FIT_LEFT, | ||
FIT_BOTTOM, | ||
FIT_RIGHT; | ||
} |
2 changes: 1 addition & 1 deletion
2
...m/melonds/domain/model/LayoutComponent.kt → ...ds/domain/model/layout/LayoutComponent.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
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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/me/magnum/melonds/domain/model/layout/PositionedLayoutComponent.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,9 @@ | ||
package me.magnum.melonds.domain.model.layout | ||
|
||
import me.magnum.melonds.domain.model.Rect | ||
|
||
data class PositionedLayoutComponent(val rect: Rect, val component: LayoutComponent) { | ||
fun isScreen(): Boolean { | ||
return component.isScreen() | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/me/magnum/melonds/domain/model/layout/ScreenFold.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,16 @@ | ||
package me.magnum.melonds.domain.model.layout | ||
|
||
import me.magnum.melonds.domain.model.Rect | ||
import me.magnum.melonds.domain.model.ui.Orientation | ||
|
||
data class ScreenFold( | ||
val orientation: Orientation, | ||
val type: FoldType, | ||
val foldBounds: Rect, | ||
) { | ||
|
||
enum class FoldType { | ||
SEAMLESS, | ||
GAP, | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/me/magnum/melonds/domain/model/layout/UILayout.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,14 @@ | ||
package me.magnum.melonds.domain.model.layout | ||
|
||
import java.util.UUID | ||
|
||
data class UILayout( | ||
val backgroundId: UUID?, | ||
val backgroundMode: BackgroundMode, | ||
val components: List<PositionedLayoutComponent>?, | ||
) { | ||
// Empty constructor allow parsing after new data is added to the class | ||
constructor() : this(null) | ||
|
||
constructor(components: List<PositionedLayoutComponent>?): this(null, BackgroundMode.FIT_CENTER, components) | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/me/magnum/melonds/domain/model/layout/UILayoutVariant.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,10 @@ | ||
package me.magnum.melonds.domain.model.layout | ||
|
||
import me.magnum.melonds.domain.model.Point | ||
import me.magnum.melonds.domain.model.ui.Orientation | ||
|
||
data class UILayoutVariant( | ||
val uiSize: Point, | ||
val orientation: Orientation, | ||
val folds: List<ScreenFold>, | ||
) |
2 changes: 1 addition & 1 deletion
2
...agnum/melonds/domain/model/Orientation.kt → ...um/melonds/domain/model/ui/Orientation.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
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
Oops, something went wrong.