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
| class InfiniteScrollListener( | |
| val func: () -> Unit, | |
| val layoutManager: LinearLayoutManager) : RecyclerView.OnScrollListener() { | |
| private var previousTotal = 0 | |
| private var loading = true | |
| private var visibleThreshold = 2 | |
| private var firstVisibleItem = 0 | |
| private var visibleItemCount = 0 | |
| private var totalItemCount = 0 |
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
| package co.cdmunoz.cryptocurrencyapp.utils | |
| import android.support.v7.widget.LinearLayoutManager | |
| import android.support.v7.widget.RecyclerView | |
| class InfiniteScrollListener( | |
| val func: () -> Unit, | |
| val layoutManager: LinearLayoutManager) : RecyclerView.OnScrollListener() { |
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
| package com.earlywarning.zelle.get_started; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.os.Bundle; | |
| import android.os.Handler; | |
| import android.text.InputType; | |
| import android.text.SpannableStringBuilder; | |
| import android.text.TextUtils; | |
| import android.text.method.LinkMovementMethod; |
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
| package com.earlywarning.zelle.common.widget; | |
| import android.animation.ObjectAnimator; | |
| import android.animation.ValueAnimator; | |
| import android.content.Context; | |
| import android.graphics.drawable.Drawable; | |
| import android.util.AttributeSet; | |
| import butterknife.BindDrawable; | |
| import butterknife.ButterKnife; | |
| import com.earlywarning.zelle.R; |
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
| fun withListSize(size: Int): Matcher<View> { | |
| return object : TypeSafeMatcher<View>() { | |
| public override fun matchesSafely(view: View): Boolean { | |
| return (view as ListView).count == size | |
| } | |
| override fun describeTo(description: Description) { | |
| description.appendText("ListView should have $size items") | |
| } | |
| } | |
| } |
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 static Matcher<View> withListSize (final int size) { | |
| return new TypeSafeMatcher<View>() { | |
| @Override public boolean matchesSafely (final View view) { | |
| return ((ListView) view).getCount () == size; | |
| } | |
| @Override public void describeTo (final Description description) { | |
| description.appendText ("ListView should have " + size + " items"); | |
| } | |
| }; | |
| } |
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 static Matcher<View> recyclerViewSizeMatcher(final int matcherSize) { | |
| return new BoundedMatcher<View, RecyclerView>(RecyclerView.class) { | |
| @Override | |
| public void describeTo(Description description) { | |
| description.appendText("with list size: " + matcherSize); | |
| } | |
| @Override | |
| protected boolean matchesSafely(RecyclerView recyclerView) { | |
| return matcherSize == recyclerView.getAdapter().getItemCount(); |
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 static Matcher<View> recyclerViewAtPositionOnView(final int position, final Matcher<View> itemMatcher, @NonNull final int targetViewId) { | |
| return new BoundedMatcher<View, RecyclerView>(RecyclerView.class) { | |
| @Override | |
| public void describeTo(Description description) { | |
| description.appendText("has view id " + itemMatcher + " at position " + position); | |
| } | |
| @Override | |
| public boolean matchesSafely(final RecyclerView recyclerView) { | |
| RecyclerView.ViewHolder viewHolder = recyclerView.findViewHolderForAdapterPosition(position); |
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 static Matcher<View> textInputLayoutwithItemHint(final String matcherText) { | |
| return new BoundedMatcher<View, TextInputLayout>(TextInputLayout.class) { | |
| @Override | |
| public void describeTo(Description description) { | |
| description.appendText("with item hint: " + matcherText); | |
| } | |
| @Override | |
| protected boolean matchesSafely(TextInputLayout editTextField) { |
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 static Matcher<View> withSeekbarProgress(final int expectedProgress) { | |
| return new BoundedMatcher<View, AppCompatSeekBar>(AppCompatSeekBar.class) { | |
| @Override | |
| public void describeTo(Description description) { | |
| description.appendText("expected: "); | |
| description.appendText("" + expectedProgress); | |
| } | |
| @Override | |
| public boolean matchesSafely(AppCompatSeekBar seekBar) { | |
| return seekBar.getProgress() == expectedProgress; |