Skip to content

Instantly share code, notes, and snippets.

milap tank milaptank

Block or report user

Report or block milaptank

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:fef7d4ad273357de2986c28f4dfeffbe
/**
* @author Milap Tank
* @desc DateUtils.java is for
* @since 26/12/17 4:28 PM
*/
public class DateUtils {
View FragmentTransaction
public static void startFragment(FragmentTransaction fragmentTransaction, BaseFragment fragment,
boolean withAnimation, boolean withBackStack, int fragmentContainerId) {
if (withAnimation) {
fragmentTransaction.setCustomAnimations(R.anim.fragment_slide_in_left,
R.anim.fragment_slide_out_left, R.anim.fragment_slide_in_right,
R.anim.fragment_slide_out_right);
}
fragmentTransaction.replace(fragmentContainerId, fragment, fragment.getTagText());
if (withBackStack) {
View gist:530345c11752f0cfda1c23887ca3b5a3
/**
* @author Milap Tank
BaseFragment.java is for
* @since 28/12/17 5:48 PM
*/
public abstract class BaseFragment extends Fragment {
protected BaseActivity baseActivity;
View gist:46f546e92bbcdb1e1da370b733e95257
/**
* @author Milap Tank
*
* @desc FragmentContainerActivity.java is for
* @since 29/12/17 5:08 PM
*/
public class FragmentContainerActivity extends BaseActivity implements AuthorizationService.TokenResponseCallback {
View BaseActivity.java
/**
* @author Milap Tank
*
* @desc BaseActivity.java is for
* @since 26/12/17 6:08 PM
*/
public abstract class BaseActivity extends AppCompatActivity {
private Toolbar toolbar;
@milaptank
milaptank / ExpiryDateTextWatcher.java
Created May 30, 2019 — forked from orcchg/ExpiryDateTextWatcher.java
TextWatcher for expiry date MM/YY automatically adding slash. For Android
View ExpiryDateTextWatcher.java
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import android.text.Editable;
import android.text.Spannable;
import android.text.TextWatcher;
import android.text.style.ReplacementSpan;
public class ExpiryDateTextWatcher implements TextWatcher {
private int maxLength = 5;
View SharedPreferenceUtil.java
package com.core.storage;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import java.util.Map;
import java.util.Set;
/**
View BaseDialogFragment.java
package com.whyte.android.whytecatalogueapp.fragment;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
View DbException.java
package com.core.storage;
public class DbException extends Exception {
public DbException(String message) {
super(message);
}
}
View DatabaseUtil.java
package com.core.storage;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
import java.io.BufferedReader;
import java.io.IOException;
You can’t perform that action at this time.