Hello i am using [B4X] Light theme B4XDateTemplate example to change colors to my B4XDateTemplate
I used exactly the same code as example but the colors are as in the picture bellow
my manifest is
and Sub SetLightTheme
I lost to many hours searching without success. Can anyone help me please?
I used exactly the same code as example but the colors are as in the picture bellow
my manifest is
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
<color name="actionbar">#659CC3</color>
<color name="statusbar">#659CC3</color>
<color name="textColorPrimary">#FEFEFF</color>
<color name="navigationBar">#659CC3</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
<style name="LightTheme" parent="@android:style/Theme.Material.Light">
<item name="android:colorPrimary">@color/actionbar</item>
<item name="android:colorPrimaryDark">@color/statusbar</item>
<item name="android:textColorPrimary">@color/textColorPrimary</item>
<item name="android:navigationBarColor">@color/navigationBar</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:alertDialogTheme">@style/AlertDialogCustom</item>
</style>
<style name="AlertDialogCustom" parent="@android:style/Theme.Material.Light.Dialog.Alert">
<item name="android:colorPrimary">@color/actionbar</item>
<item name="android:colorAccent">@color/navigationBar</item>
</style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
<style name="LightTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
</style>
<style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@color/actionbar</item>
</style>
</resources>
)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyBWa2G2OOoMqQPEKUb1lE-XvaSbwQg34Uw"/>
)
AddApplicationText(
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
)
and Sub SetLightTheme
B4X:
Sub SetLightTheme
dialog.TitleBarColor = 0xFFFF7505
dialog.TitleBarHeight = 80dip
Dim TextColor As Int = 0xFF5B5B5B
dialog.BackgroundColor = xui.Color_White
dialog.ButtonsColor = xui.Color_White
dialog.ButtonsTextColor = dialog.TitleBarColor
dialog.BorderColor = xui.Color_Transparent
DateTemplate.DaysInWeekColor = xui.Color_Black
DateTemplate.SelectedColor = 0xFF39D7CE
DateTemplate.HighlightedColor = 0xFF00CEFF
DateTemplate.DaysInMonthColor = TextColor
DateTemplate.lblMonth.TextColor = TextColor
DateTemplate.lblYear.TextColor = TextColor
DateTemplate.SelectedColor = 0xFFFFA761
For Each b As B4XView In Array(DateTemplate.btnMonthLeft, DateTemplate.btnMonthRight, DateTemplate.btnYearLeft, DateTemplate.btnYearRight)
b.Color = xui.Color_Transparent
b.TextColor = TextColor
#if B4i
Dim no As NativeObject = b
no.RunMethod("setTitleColor:forState:", Array(no.ColorToUIColor(TextColor), 0))
#End If
Next
End Sub
I lost to many hours searching without success. Can anyone help me please?