I am using Basic4Android as my programming language and I am trying to display the popup menu using the AHQuickAction library. (v1.01)
I am trying to make it when you tap on a label make it display the popup menu.
I am using the following code (which displays the popup menu)
Sub lblTest_Click
Dim lbl As Label
lbl = Sender
ac1.show(Sender)
End Sub
however, it always displays the popup under the item I taped on.
As shown in the image below I taped on the last item in the list (Test 19) and the popup is displaying on top of the item I taped on and looks like I taped on Test 17.
is there a way to display the correct item I taped on ?
I have attached the code as a zip so you can see what I mean and you might be able to tell me what I am missing. - My Example Code
In the example code, run the app on your device and tap on the label on the left in the app. You will find that it always displays under the item you tap on, where if there is space above the item you tapped on it never displays there.
Hope someone can help me out.
Related
I am developing an app where I have several items in a list and I want to show a menu like in truedialer whereby it pull from the bottom of the screen but does not fill. When I drag it upwards it can still fill the screen..
I have the menu items in an stand alone activity.
Can Someone help me figure out how o have to activity with the menus behave like the one of truedialer as shown in the screen
enter image description here
enter image description here
You can achieve this by using bottom sheets
https://material.google.com/components/bottom-sheets.html
http://android-developers.blogspot.com/2016/02/android-support-library-232.html
I m making book finder app.
step1: i clicked on search button and activity is waiting for my book title
step2: i input some book title
step3: the focus still stays on this search button, i have to click on screen to make it go away.
is there way to automatically loose focus on last widget i clicked on?
You probably just want to call requestFocus() on your book list whenever a search completes (however, if there are no results, you may want to re-open your search box, or do so after a delay). There is also a OnFocusChangedListener which might be of help if requesting focus on your list after serving up results does't work for some reason.
http://www.coderzheaven.com/2011/07/18/customizing-a-spinner-in-android/
In this example above, before an item is selected it shows text and dropdown arrow on the right. When the user clicks it (displaymode = dropdown?) it shows the prompt with an arrow as well. This is the behavior I want my customer spinner to do, but it's not. Primarily I want the spinner to load with wtih the normal dropdown arrow as first item. The prmpt issue I can at least get text to appear if i set displaymode=dialog on the spinner. For this post I mostly would like to get the default item issue resolved first...
Info:
I do not have android theme on my app. My parent systel is AppTheme butno parent above that. I have custom spinner like so:
List<LanguageSelection> nativeLanguagesData = getSupportedLanguageList();
LanguageSelectionListAdapter nativeAdapter = new LanguageSelectionListAdapter (this, R.layout.fragment_language_selection, nativeLanguagesData);
nativeAdapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
Spinner uxNativeLanguageSpinner = (Spinner)findViewById(R.id.uxNativeLanguageSpinner);
uxNativeLanguageSpinner.setAdapter(nativeAdapter);
and for xml:
<Spinner android:id="#+id/uxNativeLanguageSpinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:padding="0dp"
android:spinnerMode="dropdown"
android:prompt="#string/status_prompt"
android:layout_below="#id/uxNativeLanguageSelectLabel"
android:popupBackground="#android:color/transparent" />
Attached is what appears. I've scoured the internet trying to figure out why this thing doesn't show first item with arrow. I also have the android simple_spinner_dropdown_item.xml in my code base instead of referencing andorid.r.*. Any ideas? I'd like to get rid of my ugly label just above the spinner indicating the user needs to select something and instead use the common dropdown arrow on the first item. Just doesn't show when I create a custom spinner though. Again, the items in the list appear correctly it's just that i want the first item be something like in the link at the top where there is Select and iten and down arrow icon to the right indicating it's dropdown.
[http://tinypic.com/r/2r7927o/5][1]
And this is image link below shows exactly what I'm talking about. I circled in red the dropdown arrow I want to appear. I want my list to appear just like this and it except for the dropdown arrow. The actual list of items when clicked appear just fine...
tinypic.com/r/2ekj6mv/5 (sorry, can't hyperlink because i need 10 reps to post two links)
I would like to create a listview that looks like 'Settings' in Android (i.e. If I click "Sound & Display" item, it will show items such as "silent mode, ringer volume, etc"). It looks like PreferenceScreen but this time, it doesn't configure anything.
A clearer example:
What I wanted was when an item category is selected -- let's say, Hospitals --, it calls another listview which contains a roster of hospitals around the area. When one of the items in the roster is selected, it will execute the call intent and dial the number. And if I wanted to go back to the list, I will just press the back button then see other categories.
Thanks in advance!
Try this,
Android Preferences
And Also
Android - creating a custom preferences activity screen
i have a textview at the bottom of my screen but when menu clicked, i need to move the textview just above the menu, so that every one can see the textview,now when i clicked menu ,it cover the textview ,any solution for this problem
This is only possible with the virtual keyboard, I think.
It would not be a good idea anyway, since menus are for things the user can decide to do without looking at the screen information. Menus should be self-explaining.
A dialog is another story, since it sometimes refers to items, which are covered by it (open file e.g.). One might want to repeat the item in the dialog. I would not use a menu to open a file, the user has selected from a view. Instead, I would use a popup dialog, repeating the file name.