B4A Class [B4X] What's new class

Discussion in 'Additional libraries, classes and official updates' started by hatzisn, Aug 15, 2019.

  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.

    (23/8/2019)
    I have added the function CheckToShowWhatsNew which accepts the name of the Activity or page name (string) the version of the what's new we want to show (int) and an SQL. The function will check if the database has a table named "WhatsNew" and if there is not it will create it and insert the values of the name and the version and return True. If there is the table it will check if the name is in the inserted names and if it is not it will insert it as well as the version and return True. If the name there is in the table it will check the version and if the version we have sent is higher than the one in database it will update to the new version and return true else it will return false. If the result is true we show the what's new and if it is false we do not show it. OBVIOUSLY you will have to add to the dependencies the SQL (B4A) or the iSQL (b4i) as seen bellow.


    The library takes advantage of the following libraries:

    • Android
      XUI Views, StringUtils and SQL

    • iOS
      XUI Views, iSQL

    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 23, 2019
  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.
  6. hatzisn

    hatzisn Active Member Licensed User

    I have added some new functionality to the library. Get the file in the first post.

    (23/8/2019)
    I have added the function CheckToShowWhatsNew which accepts the name of the Activity or page name (string) the version of the what's new we want to show (int) and an SQL. The function will check if the database has a table named "WhatsNew" and if there is not it will create it and insert the values of the name and the version and return True. If there is the table it will check if the name is in the inserted names and if it is not it will insert it as well as the version and return True. If the name there is in the table it will check the version and if the version we have sent is higher than the one in database it will update to the new version and return true else it will return false. If the result is true we show the what's new and if it is false we do not show it. OBVIOUSLY you will have to add to the dependencies the SQL (B4A) or the iSQL (b4i) as seen bellow.
     
    José J. Aguilar 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