Material Design: Button or Edit Text? - android

I have a question about Material Design and semantics.
I try to make the settings of my application and I have only a few fields. So I first try to make the UI like this one, with a LinearLayout and some EditText:
I have to set hour, and I have set OnClickListener to display a TimePickerDialog.
But when I check the settings on Google Agenda, it appear to be a List of Button? (The animation on touch is the same on Button)
Should I use Button and not EditText? Even if it's look like FullWidth Textfield?
Should I use a List rather than LinearLayout?
I am sorry for my bad english...

You can use both approach but if you will use Linear layout that will be good.
For material design you can follow below link:
https://github.com/navasmdc/MaterialDesignLibrary#flat-button
https://github.com/keithellis/MaterialWidget
https://github.com/tekinarslan/AndroidMaterialDesignToolbar
https://github.com/madcyph3r/AdvancedMaterialDrawer
I hope, It will help.

Related

Which layout should I use in android?

I make an app for boosting listening skills. I want to place several EditText like this:
When I enter some word I want that other words which placed on the right side will be lined break like this:
Eventually, If the EditBox reaches a screen border I want that he will be lined break with multiline edit property like this:
My question is which layout should I use and how to do it better. I need any ideas. Thank you.
Try to play with flexbox layout: https://github.com/google/flexbox-layout. It's a official google library.

how can I add a spinner in a category preference

I need to add a spinner in my PreferenceCategory with a text on its right is there a way to do that? plus when I create a checkboxpreference the text is on the left how can I make the text appear on the right?
thanks.
If you want to use these built in controls you have to use them the way they are designed. Its also good because it fits the android design that users expect.
If you need to do something different, just make your own preference screen. Its just a list view with click handlers, not too hard to make on your own. Then you get the styling you want.

Showing password in EditText like Linkedin "Style"

I'm developing a APP for Android for educational purposes, and I see this in Linkedin APP. I like it!
Is a eye, and function is similar to CheckBox.
How I can do this?
Is a customized EditText?
Is a customized CheckBox inside EditText?
The password box is probably a Horizontal Linear Layout with a background border surrounding it. For the edittext, it seems like a custom styled one, you can look here to figure out how to implement one.
Edit:
As for the checkbox, look here
just pass null to setTransformationMethod to show the password like --->
yourEditText.setTransformationMethod(null);

Something similar to .net panels in Android

I apologize for yet, another beginner question. I have a .Net background and this is my first time with Android.
In .Net I could use panels to show/hide controls, and I'm looking to do the samething in Android.
This is what I'm trying to do: There will be two radio buttons on the top: Basic and Advanced. Depending on the radio button clicked, I want to show the relevant form. How can I possibly accomplish this?
Thanks!
you can use setvisibility for the view
you have to register for CheckedChangeListener using setOnCheckedChangeListener for the radiogroup
In the onCheckedChanged
you have to do
hidingView.setVisibiliity(View.GONE)
showingview.setVisibility(View.VISIBLE)
You could just put each one of your forms into its own FrameLayout and then use a conditional statement that checks for the state of the radio buttons. I dont know what kind of format your forms are in but Im imagining theyre probably a series of edittext boxes and TextViews. It would probably be easiest if you set it up your xml layout, declare the view to place one form and then add the other forms content to the FrameLayout dynamically in java according to the radio buttons pressed.

How to grey out Views. Specifically an EditText?

Hey guy's
First of all thanks for reading this.
I'm having trouble to find a way to change my EditText when I loose focus to it.
I would like it to be greyed out when this happens, but I don't want it to be disabled because the user can touch it and edit the text later.
Anyone?
Greetings!
You can set different colors to the text based on an OnFocusChangeListener
Another option is to set a style in xml. See this question for details: Android: change style when focused
To change the opacity, use setAlpha. In this answer I show it how to do it in an animation: Two questions about custom app ui's and AlphaAnimation

Categories

Resources