Skip to content

Instantly share code, notes, and snippets.

View kalaiselvan369's full-sized avatar
🎯
Focusing

Kalaiselvan kalaiselvan369

🎯
Focusing
View GitHub Profile
@kalaiselvan369
kalaiselvan369 / TextView.xml
Last active November 26, 2018 05:45
xml contents
<?xml version="1.0" encoding="utf-8"?>
style="?android:listSeparatorTextViewStyle" // applied for text view with bottom border.
NumberPicker picker = new NumberPicker(this);
picker.setMinValue(0);
picker.setMaxValue(2);
picker.setDisplayedValues( new String[] { "Belgium", "France", "United Kingdom" } );
@kalaiselvan369
kalaiselvan369 / Resources.java
Last active November 26, 2018 05:47
Frequently used android functions.
Usage 1:
ContextCompat.getColor(context, R.color.color_name)
Usage 2:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
yourTitle.setTextColor(getActivity().getResources().getColor(android.R.color.white, getActivity().getTheme()));
}else {
yourTitle.setTextColor(getActivity().getResources().getColor(android.R.color.white));
}
##Method in the same class:
/** See also {@link #myMethod(String)}. */
void foo() { ... }
##Method in a different class, either in the same package or imported:
/** See also {@link MyOtherClass#myMethod(String)}. */
void foo() { ... }
##Method in a different package and not imported:
@kalaiselvan369
kalaiselvan369 / git-commands.txt
Last active November 26, 2018 05:49
Git commands
echo "# fresco-image-library-samples" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/glidodroid/fresco-image-library-samples.git
git push -u origin master
*** Create patch for last commit ***
git show HEAD > some-patch0001.patch