Android Example [B4X] AS FeatureRequest - Approved and implemented requests


In this example I show how easy you can display 2 pages, with the features that are under development and the features that are already implemented.

Libraries that are needed:



B4X:
Private Sub LoadFeatureRequests(FeatureRequest As AS_FeatureRequest,LoadApproved As Boolean)
 
    FeatureRequest.Clear 'Clears the list
    FeatureRequest.ShowLoadingIndicator
 
    Try
 
        Dim CallFunction As Supabase_DatabaseRpc = xSupabase.Database.CallFunction
        CallFunction.Parameters(CreateMap("appid":1)) 'Change this to the app id in the dt_FeatureRequestApp
        CallFunction.Rpc("GetFeatureRequests".ToLowerCase)
        If LoadApproved Then
            CallFunction.Filter_Is(CreateMap("implementedversion":"null")) 'Load implemented items
            CallFunction.OrderBy("status.desc,votecount.desc")
        Else
            CallFunction.Filter_NotEqual(CreateMap("implementedversion":"")) 'Load approved items
            CallFunction.OrderBy("implementedversion.desc")
        End If

        Wait For (CallFunction.Execute) Complete (RpcResult As SupabaseRpcResult)
        'Log(RpcResult.Error.ErrorMessage)
        If RpcResult.Error.Success Then
            'Log(RpcResult.Data)
    
            Dim parser As JSONParser
            parser.Initialize(RpcResult.Data)
            Dim jRoot As List = parser.NextArray
            For Each Row As Map In jRoot
        
                Dim StatusText As String = ""
                Select Row.Get("status")
                    Case 0
                        StatusText = "Submitted"
                    Case 1
                        StatusText = "Planned"
                    Case 2
                        StatusText = "In Development"
                    Case 3
                        StatusText = "Testing"
                    Case 4
                        StatusText = "Done"
                End Select
        
                Dim lstChips As List : lstChips.Initialize
                If Row.Get("implementedversion") <> Null Then lstChips.Add(FeatureRequest.CreateItemChip(Row.Get("implementedversion"),xui.Color_ARGB(255,73, 98, 164),xui.Color_White))
                lstChips.Add(FeatureRequest.CreateItemChip(StatusText,xui.Color_ARGB(255,45, 136, 121),xui.Color_White))
                If Row.Get("ispremiumfeature") Then lstChips.Add(FeatureRequest.CreateItemChip("Premium",xui.Color_ARGB(255,141, 68, 173),xui.Color_White))
            
                FeatureRequest.AddItem(Row.Get("title"),Row.Get("description"),lstChips,FeatureRequest.UserVoteStatus2Text(Row.Get("uservotestatus")),Row.Get("votecount"),Row.Get("id"))
            
            Next
    
        End If
 
    Catch
        Log(LastException)
    End Try
 
    FeatureRequest.HideLoadingIndicator
 
End Sub
 

Attachments

  • AS_FeatureRequest Supabase Approved and implemented requests Example.zip
    181.8 KB · Views: 433
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Example project updated through the changes in this tutorial:
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • Add CallFunction.OrderBy("status.desc,votecount.desc")
    • Sorts the development status of the feature + the voting count in descending order
  • Add CallFunction.OrderBy("implementedversion.desc")
    • Sorts the version numbers of the implemented features in descending order
 

asales

Expert
Licensed User
Longtime User
Hi @Alexander Stolte.

I buy this lib but I get this error (file not found) when I try to compile the example:
(...)\AS_FeatureRequest Example\B4A\Objects\b4xlibs\Files\frm_as_featurerequestitem_1.bal

Thanks for your support.
 

asales

Expert
Licensed User
Longtime User
I buy this lib but I get this error (file not found) when I try to compile the example:
(...)\AS_FeatureRequest Example\B4A\Objects\b4xlibs\Files\frm_as_featurerequestitem_1.bal
The error above was solved. I forgot to add the AS_AnimatedCounter component.
Now I get this new error when I try to compile the AS Feature example (the AS_AnimatedCounter example was compiled fine).

B4X:
Linking resources    (0.40s)
    build tools: 36.0.0, android jar: android-36
Compiling generated Java code.    Error
Cannot find: C:\Program Files\Anywhere Software\B4A\libraries\as_animatedcounter.jar
 

Alexander Stolte

Expert
Licensed User
Longtime User
Cannot find: C:\Program Files\Anywhere Software\B4A\libraries\as_animatedcounter.jar
maybe the AS_ScrollingChips is missing?
Do you have all the b4xlibs in the additional folder? Most of the time, the problems are fixed after compiling once and reopening the project.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…