-
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use constant map padding and quest form peek height (fixes #6039)
- Loading branch information
1 parent
f533924
commit bc3f658
Showing
4 changed files
with
20 additions
and
15 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
17 changes: 14 additions & 3 deletions
17
app/src/main/java/de/westnordost/streetcomplete/ui/theme/Dimensions.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 |
---|---|---|
@@ -1,14 +1,25 @@ | ||
package de.westnordost.streetcomplete.ui.theme | ||
|
||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
/** Padding on the map due to an open quest form */ | ||
fun getOpenQuestFormMapPadding(totalWidth: Dp, totalHeight: Dp, ): PaddingValues { | ||
val isLandscape = totalWidth > totalHeight | ||
return PaddingValues.Absolute( | ||
left = if (isLandscape) getMaxQuestFormWidth(totalWidth) else 0.dp, | ||
top = 0.dp, | ||
right = 0.dp, | ||
bottom = if (isLandscape) 0.dp else 320.dp | ||
) | ||
} | ||
|
||
fun getMaxQuestFormWidth(totalWidth: Dp): Dp = | ||
if (totalWidth >= 820.dp) 480.dp | ||
else if (totalWidth >= 600.dp) 360.dp | ||
else 480.dp | ||
|
||
fun getQuestFormPeekHeight(totalHeight: Dp, isLandscape: Boolean): Dp = | ||
fun getQuestFormPeekHeight(isLandscape: Boolean): Dp = | ||
if (isLandscape) 540.dp | ||
else if (totalHeight >= 720.dp) 442.dp | ||
else 352.dp | ||
else 400.dp |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<dimen name="quest_form_peekHeight">442dp</dimen> | ||
|
||
<dimen name="street_side_puzzle_height">160dp</dimen> | ||
</resources> |
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