This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java single and multi line | |
http://blog.ostermiller.org/find-comment | |
html or xml | |
https://stackoverflow.com/questions/1084741/regexp-to-strip-html-comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get dialog button by reference | |
class dialogRef { | |
Button positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE); | |
Button negativeButton = dialog.getButton(AlertDialog.BUTTON_NEGATIVE); | |
Button neutralButton = dialog.getButton(AlertDialog.BUTTON_NEUTRAL); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove Comment https://gist.github.com/himanshuvirmani | |
Drawable shadow https://gist.github.com/lecho/6473458 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"red": { | |
"50": "#ffebee", | |
"100": "#ffcdd2", | |
"200": "#ef9a9a", | |
"300": "#e57373", | |
"400": "#ef5350", | |
"500": "#f44336", | |
"600": "#e53935", | |
"700": "#d32f2f", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Android Studio Update Error on Mac, Apple | |
Open Android Studio using terminal | |
sudo /Applications/Android\ Studio.app/Contents/MacOS/studio | |
update android studio, after updating studio close it. | |
Now open android studio normally | |
2. Increase android studio heap size in mac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AndroidDeviceSignHashKey { | |
public static String printKeyHash(Activity context) { | |
PackageInfo packageInfo; | |
String key = null; | |
try { | |
//getting application package name, as defined in manifest | |
String packageName = context.getApplicationContext().getPackageName(); | |
//Retriving package info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RecyclerViewUtils { | |
// To remove fading edge from start and end scroll | |
// android:fadingEdge="none” | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change Application or View Typeface | |
// step 1 | |
public final class FontsOverride { | |
public static void setDefaultFont(Context context, | |
String staticTypefaceFieldName, String fontAssetName) { | |
final Typeface regular = Typeface.createFromAsset(context.getAssets(), | |
fontAssetName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TextViewUtils { | |
// Text get blurry after rotating canvas | |
private void closeHardwareAcceleration() { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { | |
setLayerType(LAYER_TYPE_SOFTWARE, null); | |
} | |
} |