Which layout should I use in android? - 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.

Related

Background key on Keyboard Android

I want to do a part of a custom keyboard on Android like this:
I'm trying by:
android:keyIcon="#drawable/btn_del"
and
android:keyBackground="#drawable/btn_del"
beside
android:keyLabel="1 2 3"
to the first key. But it don't work.
How I can do this layout? (I have the grays image)
If I understood correctly, you are trying to change the order of the buttons, in the image you posted?
If that is so, then I would use a RelativeLayout and I would set an android:allignParentLeft="true" property for the "btn_del"
This would make it be the leftmost element.
All the others would have layout_toRightOf="id_of_the_previous_button", so that they would position to the right of eachother

android: how can i create a TextView combining icom?

is there an easy way to create a text view with an icon inside the text?
like in this number of rates example:
(** 3,45642)
(I have less then reputeshion 10 so I cant insert the image I wanted
** means an icon of a small man)
or is it part of RatingBar that i couldn't find?
I don't want to use android:drawableLeft="#drawable/my_icon"
as i feel like the parenthesis are critical.
Many thanks for any help!
Check out SpannableStringBuilder class.
Usage examples are posted here:
http://www.programcreek.com/java-api-examples/index.php?api=android.text.SpannableStringBuilder

Trying to create odd irregular shaped button

I am trying to create a keypad using Android Grid Layout. I would like one button that spans columns and rows in a 'L' Shape, for the Enter key.
See diagram. I have created a keypad and added the numeric buttons using Grid layout ok, but am struggling to work out if it is possible to span the rows and columns as I want to create the Enter Key.
Is this possible?
any hints tips or example code would be appreciated
A more elegant solution would be to create your buttons dynamically drawing filled touchable polygons on a canvas.
Take a look at "ImageMap for Android" (http://catchthecows.com/?p=113). It is really powerful, you can even create touchable charts.
Quick and dirty workaround: create a button (return) which is as big as 4 (2*2) of the regular ones.
Then put button 9 over it, top lef aligned.
It will work just fine

¿Is it possible to put an icon with an action inside of EditText?

I'm looking forward to create an EditText with an Icon on the right that has some kind of functionality.
I've seen that the Google IO 2013 app has something like that on the search widget.
I want to know if its possible to do that with a simple EditText.
I've tried with a simple ImageView on the right of the EditText, but it looks really bad.
I would really appreciate if someone could point me in the right direction.
Thanks.
EDIT 1
This is an example of what I want. It looks really good. I have used the drawableRight and it doesn't look this good.
http://img836.imageshack.us/img836/1521/6faa.png
EDIT 2
I managed to build something that looks really similar to the SearchWidget with the voice recognition option.
I put two EditText next to each other (with a RelativeLayout), and set the margin left for the one on the right to -10dp. This way it looks like one EditText. I know this is not proper, but right now does what I want.
My problem now is the image, I'm using a 32x32 px image, because it fits fine, but it has really low quality, I'll look into that.
http://img560.imageshack.us/img560/9394/ilwp.png
You can definitely use a custom EditText with drawableRight as follows:
android:drawableRight="#drawable/your_drawable"
Refer
1.Custom EditText- 1
2.Custom EditText- 2

Line Numbers, Code Highlighting in TextView

I'm working on an 'IDE' for Android - it could be useful for editing short scripts / making quick adjustments to files. At the moment I'm just using a simple EditText, but I am wanting to add several features, for example Line Numbering down the left hand side of the EditText and Code Highlighting.
Does anyone have any suggestions about how to approach this? For the code highlighting, I'm guessing I'll need to write my own subclass of EditText. For the line numbering, could I have a thin vertical TextView that has the same text size as the EditText??
Yes, I'm aware editing code on a mobile sized screen is painful.
Thanks!
The stock Email application uses an html view (android.webkit.WebView) to wrap even text emails in html. Perhaps rendering the code into html and displaying in a WebView would be a good way to get syntax highlighting.
For line numbering, the thin TextView beside the EditText seems reasonable. You might want to encapsulate it into your own View class that handles both subviews - and allows line numbers to be turned on and off (and perhaps does other good things like keep text size of both equal)
I think an ide for Android is a good idea. Would be nice to be able to code on an airplane without having to get the tray table involved =)

Categories

Resources