Skip to content

Instantly share code, notes, and snippets.

💭
a lazy android developer

milap tank milaptank

💭
a lazy android developer
View GitHub Profile
View gist:8e1b624468858124ea350df3a2710699
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RadioButton;
import android.widget.RadioGroup;
/** Extension of Android's RadioButton that restores CompoundButton's check toggling
* behavior, allowing a checked RadioButton to be unchecked by tapping on it again. */
public class ToggleableRadioButton extends RadioButton {
public ToggleableRadioButton(Context context) {
super(context);
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);
}
}
You can’t perform that action at this time.