In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
public class MyProgressDialog extends ProgressDialog { | |
private TextView mTvMessage; | |
private Context mContext; | |
public VedProgressDialog(Context context) { | |
super(context); | |
mContext = context; | |
setIndeterminate(true); | |
setCancelable(false); |
final LinearLayout layout = (LinearLayout) findViewById(R.id.YOUR_VIEW_ID); | |
ViewTreeObserver vto = layout.getViewTreeObserver(); | |
vto.addOnGlobalLayoutListener (new OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
layout.getViewTreeObserver().removeOnGlobalLayoutListener(this); | |
int width = layout.getMeasuredWidth(); | |
int height = layout.getMeasuredHeight(); | |
} |
// add double spaces | |
public String addSpacesBetweenChar(String str) { | |
if (!str.contains("*")) { | |
str = "******" + str; | |
} | |
return str.replaceAll(".(?=.)", "$0 "); | |
} |
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the ART/Dalvik VM | |
*.dex | |
# Java class files | |
*.class |
// passing to intent: | |
b.putSerializable(BUNDLE_PARAMS, new Gson().toJson(params)); | |
// retrieving data: | |
List<KeyValueStringPair> params = new Gson().fromJson(b.getString(BUNDLE_PARAMS), new TypeToken<List<KeyValueStringPair>>(){}.getType()) | |
// model class | |
public static class KeyValueStringPair implements Serializable { | |
@SerializedName("_key") |
private Bitmap getBitmapFromUrl(String src) { | |
if (!TextUtils.isEmpty(src)) { | |
try { | |
URL url = new URL(src); | |
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); | |
connection.setDoInput(true); | |
connection.connect(); | |
InputStream inputStream = connection.getInputStream(); | |
BitmapFactory.Options options = new BitmapFactory.Options(); |
View view = yourrecyclerview.findViewHolderForAdapterPosition(position); |