Share My Creation Another ScrollView example

Attached another CustomScrollView example.
Just to show what could be done.
Two different item layouts.
Some of the ProgressBars are dynamicaly changed with their percentage values.

Best regards.
 

Attachments

  • CustomScrollView.zip
    9.3 KB · Views: 8,412
  • CustomScrollView.jpg
    CustomScrollView.jpg
    41 KB · Views: 75,581

moster67

Expert
Licensed User
Longtime User
Klaus,

haven't I seen this one before? :D

Just to let you know it turned out really nice. I added and modified a few things but the look and feel of it is the same. I also learned a lot of from the code you provided.

I really recommend this example to other users as well since it's a good base to explore the possibilites of the scrollview. The code by Klaus is excellent.

Vielen dank Klaus. :sign0188:
 

klaus

Expert
Licensed User
Longtime User
After a request here, I added Click events.
The Click events are managed in the View_Click Sub.
The sub checks the Sender and shows what Row and what View has raised the event.
The event can be raised either by the:
Panel1, Label1, Label2, Label3, ImageView1
If you want to remove one of the View raising the event replace in the Initialize lines Initialize("View") by Initialize("")

Best regards.
 

Attachments

  • CustomScrollView2.zip
    9.5 KB · Views: 4,186

netchicken

Active Member
Licensed User
Longtime User
Hi, I have been trying to use a scrollview instead of a listview.

I am using Kalus's great example of the scrollview but its connected to a sqlite db and I need to get the values of the entry I click on from the DB and put new values back into the DB. In listview i could use Itemlist with a WHERE query on the DB.

The click events in the example return the rows of the scrollview, but not the data in that row.

Is there a way to be able to click on the image on the left of the example, and then modify the data at that position in the DB?

For example, my project is a grocery list and the image will toggle between buy/not buy when you click on it, putting a value back in the db and eventually doing other things.

I hope this is understandable :)
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Is there a way to be able to click on the image on the left of the example, and then modify the data at that position in the DB?
No problem.
Did you have a look at the SQLiteDB example, here you have a ScrollView related to a database.
Combining the the code of the two examples you should be able to do what you want.

Best regards.
 

netchicken

Active Member
Licensed User
Longtime User
Thank you Klaus.

It seems that your example references the db by row and column, which, is great if the list is never sorted, or filtered.

Is there a way I can just select a row in the db based on the ID ( INTEGER PRIMARY KEY) field of the DB?

For example I can put the ID field onto the tag of the imageview1, or onto the text of a button in the panel or even as its own field anywhere in the row. However when i try to call it from imageview1_click, or btnID_click it doesn't hold the value, and naturally says its not declared which is correct, as its only declared into the FillScrollView.

When it is declared outside in the globals it only hold the last ID number in the array, which is correct as it should, but it means i can't use it anywhere else in the program.

Its stopping my program development dead :)

Here is my program attached, it will look very familiar to you I think.

(darn too big to be attached brb) http://stuffucanuse.com/grocerylist2.zip
 
Last edited:

klaus

Expert
Licensed User
Longtime User
It seems that your example references the db by row and column, which, is great if the list is never sorted, or filtered.
In the SQLiteDB program, when you click on a cell the program knows the row and the column. Knowing the row we know the INTEGER PRIMARY KEY so we can read this data set, even when it's sorted or filtered.

Is there a way I can just select a row in the db based on the ID ( INTEGER PRIMARY KEY) field of the DB?
That's exactly what the program does when you have selected a row and then you click on the Edit button. The program does read the data set with the given ID value and fills the EditText views of the Edit panel.

I will have a look at your program, I can't promise that I will send you a solution today because I have my grandchildren at home.

In the meantime you should also have a look at Chapter 12.4 DataBase Example in the Beginner's Guide.

Best regards.
 

klaus

Expert
Licensed User
Longtime User
Attached you find a new version of your project with some modifications:
- Clicking on the image changes from 'not buy' to 'buy' and vice and versa, and updates the database.
- Clicking on the button shows a new panel with the dataset data, click on the 'Back' button to go back.
- I don't understand why you use ListViews to show data ? I replaced those by Labels.

Best regards.
 

Attachments

  • grocerylist3.zip
    46.8 KB · Views: 2,693

netchicken

Active Member
Licensed User
Longtime User
Vielen Dank Klaus!

Those are great changes, I really appreciate the time you took to help me.

Thank you again.
 

BarrySumpter

Active Member
Licensed User
Longtime User
Sold!

Congrats Klaus,
You're scrolling example and assistance to other members here has sold me on purchasing Basic4Android.
Really looking forward!

All my best,
Barry G. Sumpter
 

netchicken

Active Member
Licensed User
Longtime User
Thats a good choice Barry, Not only is the program great fun, but the resources, libraries, code snippets, and help here are just phenomenal for such a new system. I spend a lot of time trawling the forums and finding great help in the threads.
 

gapi

Active Member
Licensed User
Longtime User
Hi klaus, how can I change the color of the line separating panel ?
tnx

[solved]
Panel0.Color = Colors.anothercolor or RGB-code
:)
 
Last edited:

CharlesIPTI

Active Member
Licensed User
Longtime User
Grumble Grumble

THIS is THE answer to my user controls problems,,

Its stuck in a list but it addresses my needs

Just to help anyone searching for

CustomUserControl

or UserControl this may suffice
 

korshkov

Member
Licensed User
Longtime User
Simulate click item

Hello All!
Please help with this example simulate click (hit) item.
On click item i return one element.
Not understand how select all elements of item. :confused:
Thanks!
 

klaus

Expert
Licensed User
Longtime User
Sorry, but I don't understand what exactly your problem is, what you want to do and what example code you are speaking of.
There are three examples:
- post 1
- post 3
- post 10

If you already have a project you can post it (IDE menu Export As Zip) so we could have a look at it.

Best regards.
 

vortex12

New Member
Licensed User
Longtime User
Attached you find a new version of your project with some modifications:
- Clicking on the image changes from 'not buy' to 'buy' and vice and versa, and updates the database.
- Clicking on the button shows a new panel with the dataset data, click on the 'Back' button to go back.
- I don't understand why you use ListViews to show data ? I replaced those by Labels.

Best regards.

The sql Database is missing and the APP crashes. Is it possible to upload the sql File?

Greets from Germany!
 
Top