This file contains hidden or 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
package com.subinkrishna.ui; | |
/** | |
* @author Subinkrishna Gopi | |
*/ | |
public interface Recyclable<T> { | |
void recycle(T object); | |
} |
This file contains hidden or 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
package com.subinkrishna.customfont; | |
import android.content.Context; | |
import android.graphics.Paint; | |
import android.graphics.Typeface; | |
import android.text.TextPaint; | |
import android.text.style.TypefaceSpan; | |
public class CustomTypefaceSpan extends TypefaceSpan { | |
public static TypefaceSpan newInstance(Typeface tf) { |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright 2016 Google Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or 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
/** | |
* Returns new color with alpha applied. | |
* | |
* @param color | |
* @param alpha | |
* @return | |
*/ | |
public static int getColorWithAlpha(@ColorInt int color, | |
@FloatRange(from=0.0, to=1.0) float alpha) { | |
return (int) (0xFF * alpha) << 24 | color & 0xFFFFFF; |
This file contains hidden or 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
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.NonNull; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.TypedValue; | |
import android.view.View; |
This file contains hidden or 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 CustomRowView extends View { | |
private CharSequence mText; | |
private Layout mTextLayout; | |
private TextPaint mTextPaint; | |
private Drawable mImageDrawable; | |
public CustomRowView(Context context) { | |
this(context, null); |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="action_pause">#FF8F00</color> | |
<color name="action_resume">#43A047</color> | |
</resources> |
This file contains hidden or 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
// STEPS: | |
// 1. Go to the group's page | |
// 2. Choose "Members" | |
// 3. Open JavaScript console in your browser, preferably Firefox or Chrome | |
// 4. Paste this code and hit ENTER | |
var deleteAllGroupMembers = (function () { | |
var deleteAllGroupMembers = {}; | |
// the facebook ids of the users that will not be removed. | |
// IMPORTANT: add your own facebook id here so that the script will not remove yourself! |
This file contains hidden or 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
TextView title = (TextView) view.findViewById(R.id.listitemThreadsTitle); | |
title.setVisibility(View.VISIBLE); | |
TextPaint p = title.getPaint(); | |
String strTitle = "Moe, Joe, Isaac, Bethany, Cornelius, Charlie"; | |
title.setText(strTitle); | |
float avail = title.getMeasuredWidth(); | |
CharSequence ch = TextUtils.commaEllipsize(strTitle, p, avail, "one more", "%d more"); | |
title.setText(ch); |
This file contains hidden or 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
// In your library you need to tell gradle to build every time every variant: | |
android { | |
publishNonDefault true | |
} | |
// Then in your application, since recently I guess, you can do this: | |
dependencies { | |
(...) | |
devCompile project(path: ':lib', configuration: 'devDebug') // or 'devRelease' | |
storeCompile project(path: ':lib', configuration: 'storeRelease') // or 'storeDebug' |