Material Design TextInputLayout With An Attached Dropdown? - android

Is there a Material component that will easily let me set the left of a TextInputEditText to be a dropdown like this image below? If not, I can create something, but wanted to see if anyone knew more about Material components before I start doing too much custom work. Looks custom to me, though.

With material component, Google has removed spinner from its UI Elements.
Preferred way to do it is TextInputLayout along with AutoCompleteTextView just like Ashu has mentioned in the comment section.
Here is a more thorough article, which can help you in implementing AutoCompleteTextView.
https://blog.usejournal.com/there-is-no-material-design-spinner-for-android-3261b7c77da8

So far, both answers say to use AutoCompleteTextView. However, that doesn't answer my question. As you can see in the image I posted with the question, only the left side is a drop down. The right side is just a normal text input that isn't affected by the drop down.
However, I think it is safe to assume there isn't a component that will do this for me easily and that it would indeed be custom work to make these two components appear to be one single component.

Related

Android CustonView - How implement selectable items for resizing a CustonView in a parent View?

everyone. I am not very familiar with the Android system and need food for thought or a hint on how best to implement my idea.I would like to create a resizable CustonView. I have already created the basic structure of the CustonView. I can also assign a Drawable.xml to this to make it clear to the user that this CustonView is selected. But this is just a shape. I would like it to look something like the graphic below.
draft
Ideally, each element should be independently selectable. In any case, I would be grateful for any hints or even examples.

Using material design, how to programmatically create a Material Button?

I know how to create a normal button and textview programmtically. However, the documentation for Material design components is a bit lacking. How would I dynamically create a Material Button (and other Material Design components)?
Was referring to the official documentation here but it only shows xml creation. Seems like it should be fairly straightforward but I haven't found anything on google / stackoverflow covering this.
You need to add proper dependency. Check this link Then you can create it as average view.

How to style the children Views from the parent View?

I am currently trying to get the look of my app right. But I am having problems figuring out how to even set up a way to change themes. For one thing, is there even a way to change styles through code? I checked the method list and I saw nothing. This leads me to my actual question; is there a way that, like CSS, in which you style the parent, and then have it trickle down but also changed depending on the View? I looked at the Android docs, and they did not show any examples of this. Hopefully someone can give me an idea as to how to accomplish this, or if its not possible, to let me know that as well. Thanks in advance.
You should be able to do this using styles and themes. I've implemented this using Jake whartons Sherlock action bar. (I'm not certain if it's necessary) It involves using the comparability library which gives you the ability to use fragments and loaders as well. Look at his democode at http://actionbarsherlock.com/download.html. Look for where themes are mentioned and you will find the information you need. In the demo app you can change the theme in the top right corner and see how it affects the activities look and feel. It also shows many of the features available and the code to write them. I have found this an invaluable resource and it should show you how to theme your app.

Listview theming issues

This is probably a simple question, but I really have tried searching here and google with no joy.
I can make listview lists by following the many tutorials on the net. The problem is, they always seem to churn out lists that don't seem similar in appearance to the bulk of the lists I see in apps.
For example, I've attached a screenshot of a menu in the Chainfire3D app. It uses the 'standard' blue dividers, white titles and smaller blue 'description' text for the second line. This style of menu/list is used in many of the market apps I have. Feedly is another example.
Every time I create a listview I get either all white text (or text which is themed by whatever I have used in the layout).
Are there 2 line menus, with white and blue text that are easy to create, because I'm having to specify the colours in XML etc if I want them to look this way.
Also, to get two line listviews I have been using a custom adapter and 2 textviews on top of each other in a layout. I tried a 'simple_list_item_2' and that worked but again it didn't take this 'standard' theme. I'm sure I'm missing something.
Anyone know what?
Ideally, can someone share some code with me that will create a 2 item listviews, ideally (if poss) with a suitable adapter that will allow the running of different activities based on menu items presses. Here's hoping you can help.
The easiest way is to customize your layout.
You can find good examples here or here.

Android: ListView style like text messages conversations

I was wondering if there is a simple way to style a ListView along with it's items like the conversation in android's text message app. There are rounded corners and stuff like that, where I'm not sure how I could implement this myself.
I know that I could look for the source code of it, and try to copy from there, but it's a huge app with a lot of files and that's why I decided to ask first.
Thanks in advance,
Jan Oliver
I don't see any rounded corners in the stock sms app...? Either way, rounded corners are quite easy to do with 9-patch png files. Other than that the styling of the sms app is pretty simple. It contains a couple of TextViews, and one QuickContactBadge, a few different background colors, and that's it.
Here is a good place to start https://dl.google.com/googleio/2010/android-world-of-listview-android.pdf
you are basically going to want to use an Adapter to inflate views you make in the xml editor. Once you have more specific questions we can go into more detail.

Categories

Resources