Android - use spinner default drop shadow - android

I've created my own android drop down list (spinner). Its custom made by using a popupWindow(...). Now i would like to style it accordingly. I'd like to apply the same styles that a spinner drop down has or even another kind of drop down. Im especially in need of shadow effects and drop shadows that show up after the native spinner is rendered.
Anyone know of a style i can apply to get this without building my own drop shadow which might not be identical to the native set ?

found one that works the way i want. Seems it puts a drop shadow similar to an alert dialog:
android:background="#android:drawable/dialog_holo_light_frame"

Related

How to Create Neumorphism Style Button in Android

I'm interested in creating a
Neumorphism Style Button. This design utilizes two shadows for the button to create the effect as noted in this image
.
I'm wondering how one would go about adding two shadows to a button. I'm aware of using elevation, but that only adds one shadow and I can't seem to find a way to add two like in the second link.
Cheers

Xamarin.Forms drop down

I am using a picker in Xamarin forms and it looks like a entry box on the page until you tap it and it choices popup. I want to visually tell the user that this is drop down which they can select from. Can I do it using styling? So body suggested using Effects. How do I achieve this?
https://developer.xamarin.com/api/type/Xamarin.Forms.Picker/
This shows what the picker will render as across platforms. As you can see it does not give you an indication of a dropdown. From what I understand you would have to implement a custom renderer for each platform to add any kind of drop down arrow.
Unfortunately xamarin forms picker has simple features. I think try Custom renderer because if you want custom style or effect then use custom renderer and check below link.
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/Renderers/PickerRenderer.cs

How to change the default spinner-layout?

I created with Android Studio 1.0 a new project and added a spinner. But the result doesn't look very understandable. It's not clear enough that the spinner is a clickable object. It shows only the top element and a small arrow down. My default Spinner
I've implemented the spinner the way the developer-page from android describes.
How can I change it to something, that looks more like this.
I've tried things like setting the background color, but in the result the little arrow disappears.
How is it possible, that my default layout looks so different from the declared one by developer.android.com?
In any case you can create your own custom spinner or set some selector to it. For example: http://androidexample.com/Custom_Spinner_With_Image_And_Text_-_Android_Example/index.php?view=article_discription&aid=84&aaid=107

Android Contextual menu (similar to music app)

I would like to create a contextual menu for a listview similar to the one used by the google play music app in the listviews. (see screenshot. The triangle buttons open the menu for the album. and then one can select different options depending on the selected item.) But I've also seen this element in other apps.
https://lh5.ggpht.com/IvSpTcmdyUOC9GoX-x528xAzy9jEPjWCLcNcru4CBEcUNZ-YHo0y2TQHcGmuvOQ2zg
The Problem is that I neither know how to implement the triangle button correctly (is that just a normal imagebutton?) nor do I know how to open that popup window for each entry.
One approach I tried was using a spinner. But the problem is that the spinner always was as wide as the longest element in it and not just the triangle. Otherwise this would be a good solution. Is there a way to set the spinner to a smaller size and hide the horizontal line beneath it?
Or would a spinner be the complete wrong approach and I should solve this problem differently?
You should be using a Button or an ImageButton to trigger the PopupMenu. You could use Android Holo Colors to create the background image. Alternatively the Holo default spinner background should do the trick, too.
When the Button is clicked you should trigger a PopupMenu. The Android PopupMenu is for Android SDK API 11+. So if you're about to support lower versions you should consider external libraries like HoloEverywhere.
The Spinner Widget is not suitable for your purpose.
I have not really used the Music app before, but I would try to answer the question from what I understand from the screenshot. It seems to me that options that come up are presented in a simple Dialog. This dialog has a list that can be easily implemented as given here.
SO, what you can do is include a Button, or ImageView, or ImageButton or any other View in the list item and clicking on that will display the dialog.

Android Spinner Custom?

I am trying to create a spinner that looks exactly like the one in this android example, but not sure how or if it has to be custom? I cant imaging it would have to be a custom layout since it is shown this way in their example...
http://developer.android.com/guide/topics/ui/controls/spinner.html#Populate
I am not concerned with how the list looks, but just the way the spinner looks with the lower corner arrow. that is what I want.
This project is an attempt to backport the holo theme by building it into and Android Library project. You can link that library with your project in order to gain access to the holo theme widgets.
I have never used it but I would think that it contains the spinner widget that you are looking for.

Categories

Resources