This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface PaginationCallback { | |
boolean isRefreshing(); | |
void setRefreshing(boolean refreshing); | |
void getPage(int page); | |
UltimateAdapter getAdapter(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class EndDrawableOnTouchListener implements View.OnTouchListener { | |
private static final int DRAWABLE_START = 0; | |
private static final int DRAWABLE_TOP = 1; | |
private static final int DRAWABLE_END = 2; | |
private static final int DRAWABLE_BOTTOM = 3; | |
@Override | |
public boolean onTouch(View view, MotionEvent event) { | |
if (event.getAction() == MotionEvent.ACTION_DOWN) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.annotation.WorkerThread; | |
import android.webkit.MimeTypeMap; | |
import com.google.gson.annotations.SerializedName; | |
import java.io.File; | |
import java.lang.reflect.Field; | |
import java.util.ArrayList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class RealmUtils { | |
private RealmUtils() { | |
} | |
public static <T extends RealmObject> Observable<List<T>> createObservableList(Func1<Realm, RealmResults<T>> | |
query) { | |
final HandlerThread dbHandler = createDbHandler(); | |
final Scheduler scheduler = AndroidSchedulers.from(dbHandler.getLooper()); | |
final AtomicReference<Realm> realmReference = new AtomicReference<>(null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module | |
public class PresenterModule { | |
@Provides | |
LoginPresenter providePresenter(Router router, LoginInteractor interactor, PreferenceUtils preferenceUtils) { | |
return new LoginPresenter(router, interactor, preferenceUtils); | |
} | |
} | |
@Singleton | |
@Component(modules = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.MotionEvent; | |
import android.view.View; | |
import android.widget.TextView; | |
public abstract class DrawableOnTouchListener implements View.OnTouchListener { | |
private static final int DRAWABLE_START = 0; | |
private static final int DRAWABLE_TOP = 1; | |
private static final int DRAWABLE_END = 2; | |
private static final int DRAWABLE_BOTTOM = 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.support.annotation.ArrayRes; | |
import android.support.annotation.Nullable; | |
import android.support.annotation.StringRes; | |
import android.support.v4.content.ContextCompat; | |
import android.support.v4.graphics.drawable.DrawableCompat; | |
import android.support.v7.widget.AppCompatAutoCompleteTextView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PaginationScrollListener extends RecyclerView.OnScrollListener { | |
private static final int ITEMS_OFFSET_TO_LOAD_DEFAULT = 3; | |
private final OnRecyclerViewScrolledToPageListener mCallback; | |
private final int mOffset; | |
private LinearLayoutManager mLayoutManager; | |
private boolean loading; | |
private int previousTotal; | |
public interface OnRecyclerViewScrolledToPageListener { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void refitText(String text, int textWidth) { | |
if (textWidth <= 0) { | |
return; | |
} | |
final int targetWidth = textWidth - getPaddingLeft() - getPaddingRight(); | |
float hi = 1f; | |
float lo = 0f; | |
float textWidthCalculated; | |
while (hi - lo > 0.1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.arch.lifecycle.ViewModelProvider | |
import android.arch.lifecycle.ViewModelProviders | |
import android.content.Context | |
import android.content.Intent | |
import android.databinding.DataBindingUtil | |
import android.graphics.Color | |
import android.os.Bundle | |
import android.view.View | |
import com.popalay.cardme.R | |
import com.popalay.cardme.databinding.ActivityHolderDetailsBinding |
OlderNewer