ListView sorting on android

Discuss GUI programming with the RapaGUI plugin here
Post Reply
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

ListView sorting on android

Post by amyren »

How to use sorting listviews on Android?
Nothing happens when clicking the sortable column title in my program.
I also tried the small example below as an applet with Hollywood Player on android.

Code: Select all

@REQUIRE "RapaGUI"
moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application>
   <window title="Test program">
	<vgroup>
				<listview id="lv" notify="active">
					<column title="Last name" editable="true" sortable="true"/>
					<column title="First name" editable="true"/>
				</listview>
	</vgroup>
	</window>
</application>
]])

moai.DoMethod("lv", "insert", "bottom", "Peterson", "Bob")
moai.DoMethod("lv", "insert", "bottom", "Johnson", "Yusef")

Repeat
	WaitEvent
Forever
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: ListView sorting on android

Post by lazi »

You are missed to call the method:
moai.DoMethod("lv","sort")
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

Re: ListView sorting on android

Post by amyren »

Your suggestion will perform the sorting automaticly.

My example will set the sortable column and the sorting will happen when the user is clicking in the column title area.
Then you can toggle ascending/descending sorting as well.
This works on windows, but not on Android.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: ListView sorting on android

Post by airsoftsoftwair »

amyren wrote: Wed May 26, 2021 2:46 pm This works on windows, but not on Android.
Right, fixed now on Android.
Post Reply