Skip to content

Instantly share code, notes, and snippets.

View milaptank's full-sized avatar
💭
a lazy android developer

milap tank milaptank

💭
a lazy android developer
View GitHub Profile
/**
* @author Milap Tank
*
* @desc FragmentContainerActivity.java is for
* @since 29/12/17 5:08 PM
*/
public class FragmentContainerActivity extends BaseActivity implements AuthorizationService.TokenResponseCallback {
/**
* @author Milap Tank
BaseFragment.java is for
* @since 28/12/17 5:48 PM
*/
public abstract class BaseFragment extends Fragment {
protected BaseActivity baseActivity;
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) {
/**
* @author Milap Tank
* @desc DateUtils.java is for
* @since 26/12/17 4:28 PM
*/
public class DateUtils {
@milaptank
milaptank / gist:8e1b624468858124ea350df3a2710699
Created June 28, 2020 08:41 — forked from HeyLookItsBrandon/gist:9693410
Toggleable Android RadioButton
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);