Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kickstarter/android-oss into feat…
Browse files Browse the repository at this point in the history
…ure/NT-2059-update-stripe-sdk

* 'master' of github.com:kickstarter/android-oss:
  NT-1997:UI/UX – Error loading more replies (#1313)
  NT-2095:View Replies show and hide with scrolling (#1312)
  NT-2053:UX – Add pagination to replies (#1311)
  NT-2028: Navigation – Back button should slide view out #1310
  NT-1958: UX – Post a reply (#1305)
  NT-2071: Update exoplayer, mockito, and timber dependencies to latest versions (#1306)
  Set the name as an empty string to prevent the app from crashing. (#1309)
  NT-2069:Refactor Comment Pagination code  (#1308)
  NT-2005: Update Dependencies to Latest Version (#1304)
  NT-2069:Refactor Comment Pagination code (#1303)
  NT-1958: UX – Post a reply (#1301)
  • Loading branch information
Arkariang committed Jul 6, 2021
2 parents b1150fa + 0860cdd commit a2239f0
Show file tree
Hide file tree
Showing 44 changed files with 1,305 additions and 558 deletions.
26 changes: 13 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -269,33 +269,33 @@ repositories {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.appcompat:appcompat:1.4.0-alpha02'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.2.0-beta01'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.work:work-runtime-ktx:2.4.0'
implementation 'androidx.work:work-runtime-ktx:2.6.0-beta01'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'com.apollographql.apollo:apollo-runtime:2.3.0'
implementation 'com.facebook.android:facebook-android-sdk:7.1.0'
final auto_parcel_version = "0.3.1"
implementation "com.github.frankiesardo:auto-parcel:$auto_parcel_version"
kapt "com.github.frankiesardo:auto-parcel-processor:$auto_parcel_version"
implementation "com.google.android.gms:play-services-wallet:18.1.2"
implementation "com.google.android.exoplayer:exoplayer:2.10.2"
implementation "com.google.android.gms:play-services-wallet:18.1.3"
implementation "com.google.android.exoplayer:exoplayer:2.14.1"
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.google.android.material:material:1.3.0-beta01'
final dagger_version = "2.28.3"
implementation 'com.google.android.material:material:1.4.0-rc01'
final dagger_version = "2.37"
implementation "com.google.dagger:dagger:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
implementation "com.jakewharton:process-phoenix:2.0.0"
final rx_binding_version = "0.4.0"
implementation "com.jakewharton.rxbinding:rxbinding:$rx_binding_version"
implementation "com.jakewharton.rxbinding:rxbinding-recyclerview-v7:$rx_binding_version"
implementation "com.jakewharton.rxbinding:rxbinding-support-v4:$rx_binding_version"
implementation "com.jakewharton.timber:timber:3.0.1"
implementation "com.jakewharton.timber:timber:4.7.1"
implementation 'com.optimizely.ab:android-sdk:3.10.1'
implementation 'com.qualtrics:digital:1.3'
implementation "com.stripe:stripe-android:16.10.0"
Expand All @@ -312,7 +312,7 @@ dependencies {
implementation "com.trello:rxlifecycle-components:$rx_lifecycle_version"
implementation 'io.reactivex:rxandroid:1.2.1'
implementation "io.reactivex:rxjava:1.3.8"
implementation "net.danlew:android.joda:2.9.3"
implementation "net.danlew:android.joda:2.10.7"
implementation "org.jsoup:jsoup:1.12.1"

// Analytics Segment-Braze
Expand All @@ -331,12 +331,12 @@ dependencies {
implementation 'com.google.firebase:firebase-inappmessaging-display'

// Testing
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:2.8.9"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:3.6.0"
testImplementation "org.robolectric:robolectric:4.4"
testImplementation "org.robolectric:shadows-multidex:4.4"
testImplementation "androidx.test:core:1.3.0"
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'androidx.annotation:annotation:1.2.0'

def espresso = '3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:' + espresso
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/kickstarter/ApplicationModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.util.Log;

import com.apollographql.apollo.ApolloClient;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
Expand Down Expand Up @@ -105,6 +104,7 @@
import retrofit2.converter.gson.GsonConverterFactory;
import rx.Scheduler;
import rx.schedulers.Schedulers;
import timber.log.Timber;
import type.CustomType;

@Module
Expand Down Expand Up @@ -623,7 +623,7 @@ ExperimentsClientType provideOptimizely(final @ApplicationContext @NonNull Conte
FirebaseCrashlytics.getInstance().recordException(new Throwable("Optimizely failed to initialize."));
} else {
if (build.isDebug()) {
Log.d(ApplicationModule.class.getSimpleName(), "🔮 Optimizely successfully initialized.");
Timber.d(ApplicationModule.class.getSimpleName(), "🔮 Optimizely successfully initialized.");
}
context.sendBroadcast(new Intent(ExperimentsClientTypeKt.EXPERIMENTS_CLIENT_READY));
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/kickstarter/libs/CurrentConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void config(final @NonNull Config config) {

return new String(buffer);
} catch (final IOException e) {
Timber.e(e.getMessage());
Timber.e(e);
// TODO: This should probably be fatal?
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ private void displayNotificationFromUpdateActivity(final @NonNull PushNotificati
}
return requestCreator.get();
} catch (IOException e) {
Timber.e("Failed to load large icon: %s", e);
Timber.e(e.getMessage(), "Failed to load large icon: %s");
return null;
}
}
Expand Down
34 changes: 32 additions & 2 deletions app/src/main/java/com/kickstarter/libs/RecyclerViewPaginator.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,33 @@
import rx.Observable;
import rx.Subscription;
import rx.functions.Action0;
import rx.subjects.PublishSubject;

import static com.kickstarter.libs.rx.transformers.Transformers.combineLatestPair;

public final class RecyclerViewPaginator {
private final @NonNull RecyclerView recyclerView;
private final @NonNull Boolean isScrollEnabled;
private final @NonNull Action0 nextPage;
private Observable<Boolean> isLoading;
private final Observable<Boolean> isLoading;
private Subscription subscription;
private static final int DIRECTION_DOWN = 1;
private Subscription retrySubscription;
private final PublishSubject<Void> retryLoadingNextPageSubject = PublishSubject.create();

public RecyclerViewPaginator(final @NonNull RecyclerView recyclerView, final @NonNull Action0 nextPage, final @NonNull Observable<Boolean> isLoading) {
this.recyclerView = recyclerView;
this.nextPage = nextPage;
this.isLoading = isLoading;
this.isScrollEnabled =true;
start();
}

public RecyclerViewPaginator(final @NonNull RecyclerView recyclerView, final @NonNull Action0 nextPage, final @NonNull Observable<Boolean> isLoading, final @NonNull Boolean isScrollEnabled) {
this.recyclerView = recyclerView;
this.nextPage = nextPage;
this.isLoading = isLoading;
this.isScrollEnabled =isScrollEnabled;
start();
}

Expand Down Expand Up @@ -56,7 +69,20 @@ public void start() {
.filter(this::visibleItemIsCloseToBottom);

this.subscription = loadNextPage
.subscribe(__ -> this.nextPage.call());
.subscribe(__ ->{
if(this.isScrollEnabled) {
this.nextPage.call();
}
});

this.retrySubscription = this.retryLoadingNextPageSubject
.subscribe(__ ->
this.nextPage.call()
);
}

public void reload() {
this.retryLoadingNextPageSubject.onNext(null);
}

/**
Expand All @@ -69,6 +95,10 @@ public void stop() {
this.subscription.unsubscribe();
this.subscription = null;
}
if (this.retrySubscription != null) {
this.retrySubscription.unsubscribe();
this.retrySubscription = null;
}
}

/**
Expand Down
Loading

0 comments on commit a2239f0

Please sign in to comment.