Italian Cambiare il colore alla Time Dialog

ken87

Active Member
Licensed User
Longtime User
Ciao,
con questa istruzione si carica la time dialog
B4X:
Dim td As TimeDialog
    td.SetTime(DateTime.GetHour(DateTime.Now),DateTime.GetMinute(DateTime.Now),True)   
 
    Dim sf As Object = td.ShowAsync("","Set Time","Ok","Cancel","",Null, False)
Esiste un modo per personalizzare il colore della finestra cambiare dimensioni senza usare il manifest?
Tipo
B4X:
td.background = colors.ornange
td.titlecolor = colors.white
 

ken87

Active Member
Licensed User
Longtime User
Ciao, stavo provando questo codice:
B4X:
    Dim sf As Object = td.ShowAsync("", "Select time", "Yes", "", "Close", Null, False)
    'Dim sf As Object = td.ShowAsync("Enter details", "Ok", "Cancel", "", LoadBitmap(File.DirAssets, "attesa.png"), True)
    Dim jo As JavaObject = sf
    Dim cd As ColorDrawable
    cd.Initialize2(Colors.Red, 4dip, 4dip, Colors.Yellow)
    jo.RunMethodJO("getWindow", Null).RunMethod("setBackgroundDrawable", Array(cd))
Ma mi cambia solo la cornice della finestra..
In che modo posso ottenere input orario con colori personalizzati?
 

ken87

Active Member
Licensed User
Longtime User
Ciao allego il progetto di prova e codice:
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private imposta As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("uno")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub imposta_Click
    Dim ret As Int
  
    Dim td As TimeDialog
    Dim txt As String
    td.Hour = DateTime.GetHour(DateTime.Now)
    td.Minute = DateTime.GetMinute(DateTime.Now)
    td.Is24Hours = True
    Dim sf As Object = td.ShowAsync("", "Select time", "Yes", "", "Close", Null, False)
    Dim jo As JavaObject = sf
    Dim cd As ColorDrawable
    cd.Initialize2(Colors.Red, 4dip, 4dip, Colors.Yellow)
    jo.RunMethodJO("getWindow", Null).RunMethod("setBackgroundDrawable", Array(cd))
    'ret = td.Show("Set the required time", "B4A Time Dialog", "Yes", "No", "Maybe", Bmp)
    ToastMessageShow(ret & " : " & td.Hour & ":" & td.Minute, False)
End Sub
Non trovo il modo per avere una finestra con colori personalizzati come si vede nella foto allegata.
Unica cosa che sono riuscito a cambiare e la cornice.
E' possibile oppure va creata da zero tramite spinner? e in che modo
Grazie mille
 

Attachments

  • imp.zip
    9.2 KB · Views: 164
  • fin.jpg
    fin.jpg
    43.9 KB · Views: 191

sirjo66

Well-Known Member
Licensed User
Longtime User
utilizzo B4A versione 8.5 con Dialogs versione 2.92
quando provo a caricare il tuo progetto di esempio mi dice che il metodo td.ShowAsync non esiste
 

ken87

Active Member
Licensed User
Longtime User
Ciao,
Dialogs 4.01
javaobjet 2.05
b4a 8.30
 
Last edited:

ken87

Active Member
Licensed User
Longtime User
ecco le librerie
 

Attachments

  • Dialogs.jar
    80.1 KB · Views: 168
  • Dialogs.xml
    60 KB · Views: 169

ken87

Active Member
Licensed User
Longtime User
Con questa istruzione cambi il colore del titolo:

B4X:
  Dim cs As CSBuilder
    jo.RunMethod("setTitle", Array(cs.Initialize.Color(Colors.Red).Append("Imposta orario").PopAll))
Mi manca il panello principale...
 

ken87

Active Member
Licensed User
Longtime User
Ciao ,
il problema sembra essere legato alla libreria funzionate male.
In alcune configuarzioni del Manifest non visualizza quasi nulla in alre viene visualizzato ma il il panello si colora solo ai bordi.
Fammi sapere se trovi soluzione...
Grazie mille
 
Top