Skip to content

Commit

Permalink
Better layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Release-Candidate committed Apr 11, 2021
1 parent 2e198a7 commit 235879f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/Tzolkin.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="9" android:versionName="0.9.9" package="com.RC.Tzolkin" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="10" android:versionName="0.9.10" package="com.RC.Tzolkin" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:label="Tzolkin" android:icon="@drawable/icon"></application>
</manifest>
10 changes: 5 additions & 5 deletions src/Tzolkin/DateList.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module DateList =
items = numberPickList,
selectedIndexChanged = (fun (i, item) -> dispatch (SetListNumber i)),
width = 35.0,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
horizontalTextAlignment = TextAlignment.End
Expand All @@ -97,7 +97,7 @@ module DateList =
horizontalOptions = LayoutOptions.Start,
selectedIndex = modelGlyphToInt model,
items = glyphPickList,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
selectedIndexChanged = (fun (i, item) -> dispatch (SetListGlyph i))
Expand All @@ -111,7 +111,7 @@ module DateList =
selectedIndex = model.Filter.day,
items = "" :: [ for i in 1 .. 31 -> i.ToString () ],
selectedIndexChanged = (fun (i, item) -> dispatch (SetFilterDay i)),
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
width = 35.0,
Expand All @@ -123,7 +123,7 @@ module DateList =
selectedIndex = model.Filter.month,
items = "" :: [ for i in 1 .. 12 -> i.ToString () ],
selectedIndexChanged = (fun (i, item) -> dispatch (SetFilterMonth i)),
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
width = 35.0,
Expand All @@ -134,7 +134,7 @@ module DateList =
textChanged = (fun text -> SetFilterYear text.NewTextValue |> dispatch),
completed = (fun text -> SetFilterYear text |> dispatch),
keyboard = Keyboard.Numeric,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
width = 100.0,
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
Expand Down
10 changes: 8 additions & 2 deletions src/Tzolkin/Style.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ open Xamarin.Forms
[<AutoOpen>]
module Style =

let fontSize = FontSize.fromNamedSize NamedSize.Medium
let normalFontSize = FontSize.fromNamedSize NamedSize.Medium

let setBrown = Color.FromHex "#F2D8B8"
let glyphDescFontSize = FontSize.fromNamedSize NamedSize.Large

let tabBackgroundColor = Color.CadetBlue

let tabForegroundColor = Color.Yellow

let brownBackground = Color.FromHex "#F2D8B8"

let backgroundLight = Color.Default

Expand Down
36 changes: 18 additions & 18 deletions src/Tzolkin/TzolkinView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module TzolkinView =
View
.Label(text = tzolkinDate.number.ToString (),
horizontalTextAlignment = TextAlignment.Center,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
textColor = Color.Black,
backgroundColor = Color.Default,
verticalOptions = LayoutOptions.Start,
Expand All @@ -76,7 +76,7 @@ module TzolkinView =
View
.Label(text = tzolkinDate.glyph.ToString (),
horizontalTextAlignment = TextAlignment.Center,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
textColor = Color.Black,
backgroundColor = Color.Default,
verticalOptions = LayoutOptions.Start,
Expand All @@ -92,7 +92,7 @@ module TzolkinView =
[ tzolkinDateViewFirst model model.IsDarkMode

View.Frame (
backgroundColor = setBrown, //Style.backgroundColor model.IsDarkMode,
backgroundColor = brownBackground,
content =
View.DatePicker (
minimumDate = DateTime.MinValue,
Expand All @@ -104,7 +104,7 @@ module TzolkinView =
verticalOptions = LayoutOptions.Fill,
textColor = Color.Black,
backgroundColor = Color.Default,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
horizontalOptions = LayoutOptions.CenterAndExpand
)
) ]
Expand All @@ -128,92 +128,92 @@ module TzolkinView =
Dimension.Auto
Dimension.Auto
Dimension.Star
Dimension.Absolute 15. ],
coldefs = [ Dimension.Auto; Dimension.Auto ],
Dimension.Absolute 12. ],
coldefs = [ Dimension.Auto; Dimension.Star ],
children =
[ View
.Button(text = "-1",
textColor = Style.foregroundColor model.IsDarkMode,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
command = (fun () -> dispatch (AddDays -1)))
.Row(0)
.Column (0)
View
.Button(text = "+1",
textColor = Style.foregroundColor model.IsDarkMode,
fontSize = Style.fontSize,
fontSize = Style.normalFontSize,
command = (fun () -> dispatch (AddDays 1)))
.Row(0)
.Column (1)
View
.Label(text = "Significado:",
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(1)
.Column (0)
View
.Label(text = sprintf "%s" (glyphDesc.meaning),
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(1)
.Column (1)
View
.Label(text = "Elementos o animal asociados:",
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(2)
.Column(0)
.ColumnSpan (2)
View
.Label(text = sprintf "%s" (glyphDesc.elementOrAnimal),
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(3)
.Column (1)
View
.Label(text = "Rumbo asociado:",
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(4)
.Column (0)
View
.Label(text = sprintf "%s" (glyphDesc.direction),
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(4)
.Column (1)
View
.Label(text = "Color asociado:",
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(5)
.Column (0)
View
.Label(text = sprintf "%s" (glyphDesc.color),
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(5)
.Column (1)
View
.Label(text = "Dioses patronos:",
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(6)
.Column (0)
View
.Label(text = sprintf "%s" (glyphDesc.god),
textColor = Style.foregroundColor model.IsDarkMode,
backgroundColor = Style.backgroundColor model.IsDarkMode,
fontSize = Style.fontSize)
fontSize = Style.glyphDescFontSize)
.Row(6)
.Column (1)
View
Expand Down
4 changes: 3 additions & 1 deletion src/Tzolkin/View.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module View =
[ View.StackLayout (
padding = Thickness (0.0, 10.0, 10.0, 10.0),
orientation = setVerticalIfLandscape model.IsLandscape,
backgroundColor = setBrown, // Style.backgroundColor model.IsDarkMode,
backgroundColor = brownBackground,
children = dateSelector model dispatch
)

Expand Down Expand Up @@ -68,6 +68,8 @@ module View =
View.TabbedPage (
sizeChanged = (fun (width, height) -> dispatch (SetOrientation (width, height))),
useSafeArea = true,
barBackgroundColor = tabBackgroundColor,
barTextColor = tabForegroundColor,
currentPageChanged =
(fun index ->
match index with
Expand Down

0 comments on commit 235879f

Please sign in to comment.