B4A Class [B4X] What's new class

Discussion in 'Additional libraries, classes and official updates' started by hatzisn, Aug 15, 2019 at 4:55 PM.

  1. hatzisn

    hatzisn Active Member Licensed User

    Hi everyone,

    this is a what's new class for B4A and B4i (b4xlib) that you can use to display information for new views or functions (related to views obviously) of your application.

    The library takes advantage of the following libraries:

    • Android
      XUI Views and StringUtils

    • iOS
      XUI Views

    Screenshot_20190816-104728[1].jpg

    (The colors of the explanation label and [Next] and [Back] labels can be changed to transparent or what ever colour you wish - this is valid also for the drawn quarters around the view)

    B4A Example:

    Code:
    Sub Activity_Create(FirstTime As Boolean)
        
    'Do not forget to load the layout file created with the visual designer. For example:
        Activity.LoadLayout("1")
        
    Dim wn As WhatsNew
        wn.Initialize(
    Activity0xFFFFCC000xFFFFE37A0xFFFFF3C8, _
                
    0xFFFF00220xFFFFB00019, _
                
    0xFFFF00220xFFFFB0001910)
        wn.HighLigher = wn.HighlighterCircle

        
    'Insert values instead of 0,0,0,0 to define the dimensions of your explanation manually
        wn.AddViewToExplain(Button1, "This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. ",0,0,0,0)
        wn.AddViewToExplain(Button2, 
    "This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. ",0,0,0,0)
        wn.AddViewToExplain(Button3, 
    "This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. ",0,0,0,0)
        wn.StartExplainingWhatsNew

    End Sub

    B4i Example:

    Code:
    Private Sub Application_Start (Nav As NavigationController)
        
    'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
        NavControl = Nav
        Page1.Initialize(
    "Page1")
        Page1.Title = 
    "Page 1"
        Page1.RootPanel.LoadLayout(
    "1")
        Page1.RootPanel.Color = 
    Colors.White
        NavControl.NavigationBarVisible = 
    False
        NavControl.ShowPage(Page1)

        
    'Remove this to see what will happen - lower labels disappear

        wn.Initialize(Page1.RootPanel, 
    0xFFFFCC000xFFFFE37A0xFFFFF3C8, _
                
    0xFFFF00220xFFFFB00019, _
                
    0xFFFF00220xFFFFB0001910)
        wn.HighLigher = wn.HighlighterCircle
        wn.AddViewToExplain(Button1, 
    "This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. This is button 1. ",0,0,0,0)
        wn.AddViewToExplain(Button2, 
    "This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. This is button 2. ",0,0,0,0)
        wn.AddViewToExplain(Button3, 
    "This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. This is button 3. ",0,0,0,0)

    End Sub

    Private Sub Page1_Resize(Width As Int, Height As Int)
        wn.SetDimensions(Width, Height)
        wn.StartExplainingWhatsNew
    End Sub
    Have fun
     

    Attached Files:

    Last edited: Aug 16, 2019 at 9:08 AM
  2. scsjc

    scsjc Well-Known Member Licensed User


    Can you put a screenshot ?
    thanks ;)
     
  3. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Cannot find file b4xlibs \ Files \ b4xinputtemplate.bal '.
     
  4. hatzisn

    hatzisn Active Member Licensed User

    You will have to insert also the library "XUI views".
     
    Johan Hormaza likes this.
  5. hatzisn

    hatzisn Active Member Licensed User

    I just uploaded a snapshot in the first post.
     
    scsjc likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice