Android Question PreoptimizedCLV and CLVExpandable

Sergey_New

Well-Known Member
Licensed User
Longtime User
Couldn't find any example of sharing.:mad:
I'm wondering how to change the height of the expandable row for any CLV entry.
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
you really need a bonafide database that has all the necessary columns to make it work
Of course, I have a real database containing about 7000 records in the form of a Map. The Map SurnamesMap uses the last names of people as the key, and the list of names related to that last name as the data. What does it change?
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
The English base is small. But haven't saved the complex map to a file yet. Tell me if there is an easy way to do this?
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
Attached a SQLite database containing two tables with the required data.
 

Attachments

  • Kennedy.zip
    2.6 KB · Views: 89
Upvote 0

Mahares

Expert
Licensed User
Longtime User
It is definitely doable. I don't know how much help you need and experience with SQLite, but here is a starting point to give you an idea how to approach the process by dis[laying the data in the logs. No CLVExpandable code in the below code:
If you create a small project and use this code, it will give you all the data you need . The result from rs1 gives you the title of each panel. The results from rs gives you the data when you expand the title. Again, the aggregate results of the 2 queris is what you need. Give your self a chance to incorporate the results in you xCLVExpandable. If you get stuck, get ask questions to all members, not just one or two members. If I am not available to answer, the rest of the members are a lot more qualified to give a helping hand. But I gave you the foundation for the data you need. If you plan to pursue the project, do not use PCLV, use lazy loading or no lazy loadin as you were advised
B4X:
Dim strQuery As String
    Dim rs1 As ResultSet
    strQuery = $"SELECT DISTINCT surn FROM names  ORDER BY surn "$
    rs1  = SQL.ExecQuery2(strQuery, Null )
    Do While rs1.NextRow
        Dim mysurname As String = rs1.GetString("surn")  'this will be the title
        Dim rs As ResultSet = SQL.ExecQuery2($"SELECT A.surn AS Surname, A.givn AS Fullname, B.sex AS Sex FROM persons B
        JOIN names A ON B.id = A.id_p WHERE Surname LIKE ? 
        ORDER BY Surname "$ _
        , Array As String (mysurname))        
            Do While rs.NextRow
                Log($"${rs.getstring("Surname")}${TAB}${rs.getstring("Fullname")} ${TAB}${rs.getstring("Sex")}"$)                
            Loop
            rs.Close
    Loop
    rs1.Close
By the way the database is relatively good except that you have some records that have more than one id. But, this is a working database and not your official one. Good luck.
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
If you plan to pursue the project, do not use PCLV, use lazy loading or no lazy loadin as you were advised
You don't seem to understand me.
I know how to populate the list with changing the height of the extension panel without using PCLV, which I already wrote about above. But the operation time is too long. Thanks for the advices.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
But the operation time is too long.
Are you sure you are applying lazy loading properly. LL and Run your project in release mode, Those are the words of Erel too. (lazy loading and release). If you can attach your database with all 7000 records or make up 7000 fake records in English names, I will be more than glad to test it.
But Lazy loading and release mode were not the main topic of my post #25.
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
I don't have a database with 7000 thousand records with English names.
Why don't Russian names suit you? I understand a little with English names :).
If you wish, I can attach a database with English and Russian names.
I created the database with SQLite from post # 24 on purpose, because I did not know how to save the SurnamesMap map to a file.
My project is based on DB from classes, not SQLite.
 
Upvote 0
Top