Android Question B4XDateTemplate Problem waiting for "ok" or "cancel"

fred-han

Member
Licensed User
Hello,
i try to use B4XDateTemplate but there is a behavior that i can't influence.
The template opens correct and the changes between month and year run as supposed.
But when i touch a day, the template is immediately closed. There is no change to press
"ok" or "cancel". This can't be the normal behavior.
What is that i have to do????
B4X:
Sub btn_egal_click
   
    Dim input As B4XDateTemplate
    input.Initialize
   
    wait for (dialog.ShowTemplate(input, "ok", "", "abbrechen")) complete (result As Int)

    If result = xui.DialogResponse_Positive Then
        Msgbox("Ergebnis: " & result, "Datum")
    End If
 

fred-han

Member
Licensed User
If there is no "ok" in the dialog, the designed behavior makes sense.
But that is not the way i want the user to act, he shall have the possibility to change
the selected date as long as he would and then press "ok".
I think i will make my own "input_date".
Thanks for your answer.
 

fred-han

Member
Licensed User
hi agraham,
thanks for this info. This lib brings the look i prefer.

I just want to change the color in Date and Time from green to the color of "my app". But i can't find a way to do that.
Little help??
 

agraham

Expert
Licensed User
I just want to change the color in Date and Time from green to the color of "my app"
If you mean DateDialog and TimeDialog then you can't change the colour. You may find that either or both of these don't display properly in portrait mode on many devices - an Android bug I can't fix. That's why DateDialog2 and TimeDialog2 are in the demo.
 

fred-han

Member
Licensed User
I tried the demo with dialogs2 lib.
And i only wanted to change the green color in Date and Time Control.
upload_2019-10-15_13-35-41.png


Is there no way to change this setting? Use of an underlying object ?
 

fred-han

Member
Licensed User
I changed the manifest file to this:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<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)
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#FF1CB6EA</color>
    <color name="statusbar">#FF808080</color>
    <color name="textColorPrimary">#ff000000</color>
       <color name="navigationBar">#FF808080</color>   
</resources>
)
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">@color/actionbar</item>
        <item name="colorPrimaryDark">@color/statusbar</item>
       <item name="android:textColorPrimary">@color/textColorPrimary</item>
       <item name="android:navigationBarColor">@color/navigationBar</item>
       <item name="windowNoTitle">true</item>
       <item name="windowActionBar">false</item>
       <item name="windowActionModeOverlay">true</item>
    </style>
</resources>
)
but there is no change. I don't know the property i have to adjust.
 
Top