B4A Library [B4X] [XUI] AS BottomPhoneNumberFlagPicker

A bottom phone number prefix, flag emoji, country code picker.

You need:
I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee. :)

wz7SGXjrlH6ktttSI4iqEJ47ez7AKaoXMaqc32ByDKBhkvNFOT.jpeg
l0pUaNecVTZgingdrtFbeHIuXb0Lrz3IgHoL3lNA3Hgxk4nyse.jpeg


Datasource from:

Dark Example:
    BottomPhoneNumberFlagPicker.Initialize(Me,"BottomPhoneNumberFlagPicker",Root)
 
    BottomPhoneNumberFlagPicker.Color = xui.Color_ARGB(255,32, 33, 37)
    BottomPhoneNumberFlagPicker.TextColor = xui.Color_White
 
    'Selects an item with the dial code
    BottomPhoneNumberFlagPicker.SelectItem2("+49") 'Example: "+49" to select Germany
 
    BottomPhoneNumberFlagPicker.ShowPicker
Light Example:
    BottomPhoneNumberFlagPicker.Initialize(Me,"BottomPhoneNumberFlagPicker",Root)
 
    BottomPhoneNumberFlagPicker.Color = xui.Color_White
    BottomPhoneNumberFlagPicker.TextColor = xui.Color_Black
 
    'Selects an item with the country code
    BottomPhoneNumberFlagPicker.SelectItem(GetCountry) 'Example: "de" to select Germany
 
    BottomPhoneNumberFlagPicker.ShowPicker
Get Country Code Function B4A and B4I:
#If B4I
Private Sub GetCountry As String
    Dim no As NativeObject
    Dim s As String  = no.Initialize("NSLocale") _
        .RunMethod("currentLocale", Null).RunMethod("objectForKey:", Array("kCFLocaleCountryCodeKey")).AsString
    Return s
End Sub
#Else If B4A
Private Sub GetCountry As String
    Dim r As Reflector
    r.Target = r.RunStaticMethod("java.util.Locale", "getDefault", Null, Null)
    Return r.RunMethod("getCountry")
End Sub
#End If
AS_BottomPhoneNumberFlagPicker
Author: Alexander Stolte
Version: 1.00

  • AS_BottomPhoneNumberFlagPicker
    • Events:
      • ConfirmButtonClicked (Item As AS_BottomPhoneNumberFlagPicker_Item)
    • Fields:
      • Tag As Object
    • Functions:
      • Class_Globals As String
      • CreateAS_BottomPhoneNumberFlagPicker (FlagEmoji As String, CountryCode As String, DialCode As String, Name As String) As AS_BottomPhoneNumberFlagPicker_Item
      • getColor As Int
      • getTextColor As Int
      • Initialize (Callback As Object, EventName As String, Parent As B4XView) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • SelectItem (CountryCode As String) As String
        Selects an item with the country code
        Example: "de" to select Germany
      • SelectItem2 (DialCode As String) As String
        Selects an item with the dial code
        Example: "+49" to select Germany
      • setColor (Color As Int) As String
      • setTextColor (Color As Int) As String
      • ShowPicker
    • Properties:
      • Color As Int
      • TextColor As Int
  • AS_BottomPhoneNumberFlagPicker_Item
    • Fields:
      • CountryCode As String
      • DialCode As String
      • FlagEmoji As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Name As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
Changelog
  • 1.00
    • Release
  • 1.01
    • Add GetItem - Gets an item with the country code
    • Add GetItem2 - Gets an item with the dial code
Have Fun :)
 

Attachments

  • AS BottomPhoneNumberFlagPicker Example.zip
    178.3 KB · Views: 226
  • AS_BottomPhoneNumberFlagPicker.b4xlib
    9.5 KB · Views: 213
Last edited:
Top