Skip to content

Instantly share code, notes, and snippets.

View jesselima's full-sized avatar
📱
Coding for mobile...

Jesse Lima jesselima

📱
Coding for mobile...
View GitHub Profile
package com.example.myapplication.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public final class DateUtils {
@jesselima
jesselima / MaskEditUtil.java
Created November 7, 2018 16:28
Mascara para formatação de campos de formulários.
package com.example.myapplicationutils;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
public abstract class MaskEditUtil {
public static final String FORMAT_CPF = "###.###.###-##";
public class ColoredSnackBar {
private static final int red = 0xfff44336;
private static final int green = 0xff4caf50;
private static final int blue = 0xff2195f3;
private static final int orange = 0xffffc107;
private static View getSnackBarLayout(Snackbar snackbar) {
if (snackbar != null) {
@jesselima
jesselima / MovieReviewsAdapter.java
Created October 15, 2018 09:45
Adapter (and RecyclerView0 with click listener and transition for child views changs inside the ViewGroup.
package com.udacity.popularmovies.adapters;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.transition.TransitionManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
@jesselima
jesselima / README.md
Created October 15, 2018 09:26 — forked from gabrielemariotti/README.md
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@jesselima
jesselima / HelperUtil.java
Created October 15, 2018 09:24 — forked from gabrielemariotti/HelperUtil.java
HelperUtil using a IMPL
public class HelperUtil {
private final HelperUtilImpl mImpl;
public HelperUtil (Context context) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
mImpl = new HelperUtilImplL(context);
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
mImpl = new HelperUtilImplKK(context);
public class HelperUtil {
public static HelperUtilBase getInstance(Context context) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
return new HelperUtilL(context);
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
return new HelperUtilKK(context);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
return new HelperUtilJB(context);
package com.udacity.popularmovies.utils;
import android.content.Context;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
@jesselima
jesselima / DetailsFragmentPagerAdapter.java
Last active October 11, 2018 12:48
A simple implementation of ViewPager, Tabs and Fragments
package com.udacity.popularmovies.adapters;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.udacity.popularmovies.R;
import com.udacity.popularmovies.fragments.MovieDetailsFragment;
import com.udacity.popularmovies.fragments.MovieReviewsFragment;
@jesselima
jesselima / CursorLoader.java
Created September 11, 2018 11:22 — forked from AntonioDiaz/CursorLoader.java
CursorLoader example in a Fragment
package com.example.android.sunshine.app;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
public class ForecastFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> {