Skip to content

Instantly share code, notes, and snippets.

@Isabellle
Last active November 21, 2016 15:58
Show Gist options
  • Save Isabellle/fef1651701af51721017b7d4a3483cce to your computer and use it in GitHub Desktop.
Save Isabellle/fef1651701af51721017b7d4a3483cce to your computer and use it in GitHub Desktop.
Make button move up when softkeyboard is shown
<activity android:windowSoftInputMode="adjustPan"> </activity>
Put next or done on SoftKeyboard
android:imeOptions="actionNext"
android:imeOptions="actionSend"
Empty states in Android, best practices
https://www.reddit.com/r/androiddev/comments/3bjnxi/best_way_to_handle_recyclerview_empty_state/https://www.reddit.com/r/androiddev/comments/3bjnxi/best_way_to_handle_recyclerview_empty_state/
http://stackoverflow.com/questions/25813039/format-relative-date-to-human-readable-format-in-android-using-android-dateutils (Date readable format)
https://github.com/Trinea/android-open-project/tree/master/English%20Version
https://github.com/jd-alexander/LikeButton << microinteraction
http://stackoverflow.com/questions/6608947/android-transparent-textview
HDPI blabla http://stackoverflow.com/questions/19875158/android-background-image-size-in-pixel
Below code for black:-
<color name="black">#000000</color>
Now if i want to use opacity than you can use below code :-
<color name="black">#99000000</color>
and below for opacity code:-
Hex Opacity Values
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C
50% — 80
45% — 73
40% — 66
35% — 59
30% — 4D
25% — 40
20% — 33
15% — 26
10% — 1A
5% — 0D
0% — 00
Give weight in % to textfields or other widgets
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:text="left"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".70" />
<Button
android:text="right"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".30" />
</LinearLayout>
android:fontFamily="sans-serif" // roboto regular
android:fontFamily="sans-serif-light" // roboto light
android:fontFamily="sans-serif-condensed" // roboto condensed
android:fontFamily="sans-serif-thin" // roboto thin (android 4.2)
android:fontFamily="sans-serif-medium" // roboto medium (android 5.0)
enter image description here
in combination with
android:textStyle="normal|bold|italic"
this 14 variants are possible:
Roboto regular
Roboto italic
Roboto bold
Roboto bold italic
Roboto-Light
Roboto-Light italic
Roboto-Thin
Roboto-Thin italic
Roboto-Condensed
Roboto-Condensed italic
Roboto-Condensed bold
Roboto-Condensed bold italic
Roboto-Medium
Roboto-Medium italic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment