C cwt Active Member Licensed User Longtime User Jan 28, 2021 #1 I am starting to implement CustomListView in my Android app after having used it extensively in my iOS app. I am running into a slight problem when I create a menu list by using a CustomListView - each choice on the menu goes to another activitly - this works fine. But when I return back from the activity to the menu, the item that was pressed still shows the pressed color. If I change the orientation then the CustomListView item clears back to the unpressed color. The menu list is created with AddTextItem. What am I missing here? Thanks.
I am starting to implement CustomListView in my Android app after having used it extensively in my iOS app. I am running into a slight problem when I create a menu list by using a CustomListView - each choice on the menu goes to another activitly - this works fine. But when I return back from the activity to the menu, the item that was pressed still shows the pressed color. If I change the orientation then the CustomListView item clears back to the unpressed color. The menu list is created with AddTextItem. What am I missing here? Thanks.
LucaMs Expert Licensed User Longtime User Jan 28, 2021 #2 cwt said: What am I missing here? Click to expand... Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 28, 2021 #3 cwt said: What am I missing here? Click to expand... Using complex, not cross platform, activities instead of using simple and cross platform B4XPages. Everything will simply work as you expect. Upvote 0
cwt said: What am I missing here? Click to expand... Using complex, not cross platform, activities instead of using simple and cross platform B4XPages. Everything will simply work as you expect.
C cwt Active Member Licensed User Longtime User Jan 28, 2021 #4 Erel said: Using complex, not cross platform, activities instead of using simple and cross platform B4XPages. Everything will simply work as you expect. Click to expand... I would love to use B4XPages but I need this app to work in both orientations, so I can't. I used B4XPages for my entire iOS app but need orientation changes in the Android app. So your answer is that this problem is not fixable? I can always make the pressed color the same as the background color of the view, but that is not telling the user what is being pressed. Upvote 0
Erel said: Using complex, not cross platform, activities instead of using simple and cross platform B4XPages. Everything will simply work as you expect. Click to expand... I would love to use B4XPages but I need this app to work in both orientations, so I can't. I used B4XPages for my entire iOS app but need orientation changes in the Android app. So your answer is that this problem is not fixable? I can always make the pressed color the same as the background color of the view, but that is not telling the user what is being pressed.
M Mahares Expert Licensed User Longtime User Jan 28, 2021 #5 cwt said: So your answer is that this problem is not fixable Click to expand... Try something like this. I think it will work for you. It worked for me. You may have to adjust the sleep time Code: Copy Sub clv1_ItemClick (Index As Int, Value As Object) If Index=0 Then Sleep(200) 'may have to adjust with less or more sleep time StartActivity(act2) Else Sleep(200) StartActivity(act3) End If End Sub Upvote 0
cwt said: So your answer is that this problem is not fixable Click to expand... Try something like this. I think it will work for you. It worked for me. You may have to adjust the sleep time Code: Copy Sub clv1_ItemClick (Index As Int, Value As Object) If Index=0 Then Sleep(200) 'may have to adjust with less or more sleep time StartActivity(act2) Else Sleep(200) StartActivity(act3) End If End Sub
C cwt Active Member Licensed User Longtime User Jan 28, 2021 #6 Mahares said: Try something like this. I think it will work for you. It worked for me. You may have to adjust the sleep time Code: Copy Sub clv1_ItemClick (Index As Int, Value As Object) If Index=0 Then Sleep(200) 'may have to adjust with less or more sleep time StartActivity(act2) Else Sleep(200) StartActivity(act3) End If End Sub Click to expand... Your solution worked perfectly - did not even have to change the sleep value - thank you very much. Upvote 0
Mahares said: Try something like this. I think it will work for you. It worked for me. You may have to adjust the sleep time Code: Copy Sub clv1_ItemClick (Index As Int, Value As Object) If Index=0 Then Sleep(200) 'may have to adjust with less or more sleep time StartActivity(act2) Else Sleep(200) StartActivity(act3) End If End Sub Click to expand... Your solution worked perfectly - did not even have to change the sleep value - thank you very much.
mangojack Expert Licensed User Longtime User Jan 29, 2021 #7 cwt said: Your solution worked perfectly Click to expand... Another option that might work for you is to set the Pressed Color (Designer) to Transparent. Upvote 0
cwt said: Your solution worked perfectly Click to expand... Another option that might work for you is to set the Pressed Color (Designer) to Transparent.
M Mahares Expert Licensed User Longtime User Jan 29, 2021 #8 mangojack said: Another option that might work for you is to set the Pressed Color (Designer) to Transparent Click to expand... The OP wants to make sure the user knows which item he clicked. See his post #4 for why a transparent pressed color will not work for him. Upvote 0
mangojack said: Another option that might work for you is to set the Pressed Color (Designer) to Transparent Click to expand... The OP wants to make sure the user knows which item he clicked. See his post #4 for why a transparent pressed color will not work for him.
mangojack Expert Licensed User Longtime User Jan 29, 2021 #9 Amazing what you see when you open your eyes. Upvote 0