Next week I'm in Barcelona in the Mobile World Congress. Might be closer for youOne day I will come to Israel and hug you...
Will it be possible to change the color of selected list view item from orange to blue that is used by the holo theme of Android 3+?
I understand that idPressed = r.GetStaticField("android.R$drawable", "list_selector_background") is the one that needs to be modified. Apparently list_selector_background is used by Android 2.3 and below, while Android 3+ uses list_selector_holo_dark, according to this post
android - Default selector background in Clickable Views - Stack Overflow
FACLV1.Initialize(Me, "FACLV1")
FACLV2.Initialize(Me, "FACLV2")
FA_SV_pnl.AddView(FACLV1.AsView, 0, 0, FA_SV_pnl.Width, FA_SV_pnl.Height)
FA_sv_detail_pnl.AddView(FACLV2.AsView, 0, 0, FA_sv_detail_pnl.Width, FA_sv_detail_pnl.Height)
FACLV1.DefaultTextBackgroundColor = Colors.White
FACLV1.DefaultTextSize=13
FACLV1.DefaultTextColor=Colors.Black
FACLV2.DefaultTextBackgroundColor = Colors.White
FACLV2.DefaultTextSize=13
FACLV2.DefaultTextColor=Colors.Black
If info="" Then
FACLV1.AddTextItem(""&Cursor7.GetString("Treatment"), "a")
Else
FACLV1.AddTextItem(""&Cursor7.GetString("Treatment"), "a")
FACLV2.AddTextItem(""&Cursor7.GetString("Information"), "a")
This is the code that sets the selection panel:how to change itemclick color in this kind of list. can the itemclick be disabled but text still remains?
Public Sub InsertAt(Index As Int, Pnl As Panel, ItemHeight As Int, Value As Object)
Dim sd As StateListDrawable
sd.Initialize
sd.AddState(sd.State_Pressed, pressedDrawable)
sd.AddCatchAllState(Pnl.Background)
Unlike the standard ListView (or Table class) all the items are created when the list is built. The advantage is that it is much easier to customize the list items. See the first post for more details.Does this CustomListView recycles the memory?
Dim clv4 As CustomListView
clv4.Initialize(Me, "clv4")
SpeciesPanel.AddView(clv4.AsView, 0, 0, SpeciesPanel.Width, SpeciesPanel.Height)
clv4.DefaultTextBackgroundColor = Colors.Black
clv4.AddTextItem(File.GetText(File.DirInternal,"SPECS1.grl"),0)
clv4.InsertAt( 0, SpeciesPanel, SpeciesPanel.Height ,"SPECSpic1.png")
clv4.AddImageItem.....
Yes, but it needs a modification of the CustoListView class.As in the ListView each "item" is cklickable - is their the possibilty to switch that off
You didn't explain that in your question.But this affects the complete class for the complete app...so this modification supresss that function also then when i want it.
Yes, the class in my previous post is already a 'special' class.Can I derive a separate class?
'Main Activity Module
Sub Process_Globals
Dim RE1 As RaiseEvent
End Sub
Sub Globals
Dim Label1 As Label
Dim ToggleButton1 As ToggleButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
RE1.Initialize(Me,"RE1")
End Sub
Sub ToggleButton1_CheckedChange(Checked As Boolean)
'Press ToggleButton to change the Fire Class Instance Variable
If Checked Then
RE1.SetFire(True)
Else
RE1.SetFire(False)
End If
End Sub
Sub RE1_FireEvent(FiringStatus As String)
'This Event is raised every time the ToggleButton is changed
Log("Firing Status: " & FiringStatus)
Label1.Text = "Firing Status: " & FiringStatus
End Sub
'Class module: RaiseEvent
Sub Class_Globals
'Class Instance variables
Private EventName As String
Private CallBack As Object
Private Fire As Boolean
Private FireText As String
End Sub
Public Sub Initialize(vCallBack As Object, vEventName As String)
'Initialise the Class Objects
EventName = vEventName
CallBack = vCallBack
Fire = False
FireText = "None"
End Sub
Public Sub SetFire(vFire As Boolean)
'Class Method
Fire = vFire
If Fire = True Then
FireText = "Did Fire"
Else
FireText = "Did Not Fire"
End If
FireTest 'Call the method that raises an Event
End Sub
Private Sub FireTest
'Class Method to Raise an Event
If SubExists(CallBack, EventName & "_FireEvent") Then
CallSub2(CallBack, EventName & "_FireEvent", FireText)
End If
End Sub