Android-Expandable List - android

How to set the Height and width of group indicator in expandable list when i am using customized icons instead of default icons.
thank you

you should have a image view and there you place layout_height="40dp" and layout_wight="40dp"
I think is that sorry if i din't answer well

In your ExpandibleListView: (xml)
android:indicatorLeft="20dp" (or another size)
android:indicatorRight="20dp"

Related

How to make this imageview appear on the layout?

First, I am adding Gridview and second i add imageview in the gridview, but the layout can't show up the image。
Does anyone know what the problem could be?
Thank you very much!!
Simply change the height and width attributes :)
Don't drag, use xml text editor instead. And as mentioned above use height and width appropriate.
Android Studio shows you a warning, next to the ImageView (yellow warning icon). If you hover over this, it will tell you what the problem is. (most likely missing height and width)

Softening a TextView edges

I need to add a scrollable android TextView, which will show alot of text.
I want to achieve this kind of effect:
But I found no way of doing so.
Is there any good way of doing it?
Thank you!
try below properties to TextView
android:requiresFadingEdge="vertical"
android:fadingEdgeLength="32dp" //To change the gradient overlay height
The most convient way of doing this is creating a drawable. You can either make your own image in the image editing software of your choice or create a GradientDrawable. Make sure the colors go from white to transparent. Then place this drawable on top of the textview near the bottom.

Gridview with button and text

I am new in android I want to ask help how can achieve design like this that have 4 buttons ,icons and text. and it has icon in header part.
Thank you in advance.
First:Decide which layout should u use.I think u can use Gridlayout of 2*2.Or you can just use linearlayout and set weight.
Second:In gridlayout you can use button or Imageview or TextView(drawableTop).
for your images in the in the above screenshot which you have provided you can use Image Button in android and you can set their size according to you and for the header you can use any layout of your choice.
Thank you
Yes You Can
You can use many options GridView, CardView Or LinearLayout
, and for the icon header you Can Customize the Toolbar as described in the developer documentation here

listview listitem size increase with respects of android phone and tablet

i am creating a listview with custom arrayadapter..but the problem is in tablet it's showing the listitem is very small.. can any1 help me,
Thanks in advance
try to make the width of the listview fixed. you can do it in the corresponding layout xml file. there you add property like android:layout_width="200dp"
To fix this issue remove static variables ie, fixed values. Create dynamic xmls with fill_parent, match_parent.
Thanks...

Best way to program buttons/images

I am designing something that will have a homepage close to the Google+ android app.
I'm having trouble figuring out the best way to do this? Should I create a button with text and set the background as the image? Should I create an image with the text already programmed in the actual picture or should I program the text and picture to be buttons.
Any suggestions from you guys on past projects?
You can use a Button with text to whatever you like and then place the image for that button above the text (using android:drawableTop)like so:
<Button
android:id="#+id/imageButton"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Photos"
android:drawableTop="#drawable/button_image" />
replacing buttton_image with your actual image. If you want the image in a different position (i.e. below text etc) use:
android:drawableLeft
android:drawableRight
android:drawableBottom
This would be how I would and do do it...
Since I am a newbie in android development I may be wrong but I suggest why not use a Grid View with each grid item haaving a textview and imageview.
My suggest to layout:
If you want to try something new in Android 4.0 , you can try GridLayout to layout , it can reduce the complicate of the nested layout , check out the blog about GridLayout:
http://android-developers.blogspot.com/2011/11/new-layout-widgets-space-and-gridlayout.html
You should write Buttons this way: http://developer.android.com/resources/articles/layout-tricks-merge.html
I normally use RelativeLayout but this is not important.
Write a class myClass extends RelativeLayout and inflate the XML with
LayoutInflater.from(context).inflate(R.layout.myCustomLayout, this, true);
I think this is best practice by Google.
use a regular button and set the android:drawableTop="#drawable/icon_...." value
Having the text burnt into you image is most certainly not the way to go.
One option for you is a GridView. You could also do this through a combination of Image button and scrollview. In my opinion, GridView is best and involves the least amount of code with most flexibility.
Remember that you can replace the button's background image with a state list drawable.

Categories

Resources