[JAVA] Android application implementation tips, reference site summary (layout)

First year new graduate from liberal arts, java, Android inexperienced person This is a summary of things that were helpful in creating Android apps! (Layout)

If there are recommended articles, we will update them from time to time! !!

EditText redesign

The color of the EditText cursor changes depending on the terminal, so if you want to unify it, specify it in xml

Summary of color changes in EditText

Change the color of the cursor of an EditText in Android across all the sdk

I want to do 50% placement in Relative Layout

Possible by using an empty view. Convenient.

Set the width of View of the child of RelativeLayout to 50%

To update the state of multiple views in the parent view ...

FindViewWithTag () is useful in such cases. For example, when there are 10 child views in the parent view, you don't have to find by 10 It is OK if you add a tag in xml and turn the for statement.

[How to use findViewWithTag ()](http://koga-app.tumblr.com/post/49431453714/ How to use findviewwithtag)

Add a shadow

If you are targeting API21 or above, you can use elevation in xml. In the meantime, create xml to deal with it.

How would I get a ListView Item to be elevated?

[Android] Create a view with a fixed aspect ratio

A custom view class that allows you to determine how many times the height is based on the width, such as 1: 1 or 4: 3. The best usability.

[Android] Create a view with a fixed aspect ratio

Conversion from px to dp

When specifying the size in the code, the unit is px. If you want to fix it to dp, refer to the following.

Problem that the height changes for each device when setting the height numerically on the code

ListView uses a different View for each row

Override getItemViewType () with Adapter and change the view to inflate using case statement in getView ()

Use a different View for each row in ListView

Touch the list view and the contents of the list (buttons, images, etc.)

Touch the contents of the list

About the space between items in ListView

<ListView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:divider="@null"
    android:dividerHeight="10dp" />

How to remove the dividing line of Android ListView and how to set the space for each element

Touch the list view and the contents of the list (buttons, images, etc.)

Touch the contents of the list

Make the background of the dialog transparent

getDialog().getWindow().setBackgroundDrawable(new 
ColorDrawable(Color.TRANSPARENT));

Can't make the custom DialogFragment transparent over the Fragment

Add a divider with RecyclerView

Add a divider with RecyclerView

Recommended Posts

Android application implementation tips, reference site summary (layout)
Android application implementation TIPS, reference site summary (function implementation)
Android application implementation tips, reference site summary (Android OS specific edition)
Android development reference site