mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-17 11:32:05 +00:00
improve content loading
This commit is contained in:
parent
2a193a60ad
commit
9fa6dbf821
2 changed files with 8 additions and 8 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.habitrpg.android.habitica"
|
package="com.habitrpg.android.habitica"
|
||||||
android:versionCode="185"
|
android:versionCode="190"
|
||||||
android:versionName="1.1"
|
android:versionName="1.1"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:installLocation="auto" >
|
android:installLocation="auto" >
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco;
|
||||||
import com.habitrpg.android.habitica.api.HostConfig;
|
import com.habitrpg.android.habitica.api.HostConfig;
|
||||||
import com.habitrpg.android.habitica.components.AppComponent;
|
import com.habitrpg.android.habitica.components.AppComponent;
|
||||||
import com.habitrpg.android.habitica.data.ApiClient;
|
import com.habitrpg.android.habitica.data.ApiClient;
|
||||||
|
import com.habitrpg.android.habitica.data.InventoryRepository;
|
||||||
import com.habitrpg.android.habitica.helpers.RxErrorHandler;
|
import com.habitrpg.android.habitica.helpers.RxErrorHandler;
|
||||||
import com.habitrpg.android.habitica.proxy.CrashlyticsProxy;
|
import com.habitrpg.android.habitica.proxy.CrashlyticsProxy;
|
||||||
import com.habitrpg.android.habitica.ui.activities.IntroActivity;
|
import com.habitrpg.android.habitica.ui.activities.IntroActivity;
|
||||||
|
|
@ -51,7 +52,9 @@ public abstract class HabiticaBaseApplication extends MultiDexApplication {
|
||||||
private static AppComponent component;
|
private static AppComponent component;
|
||||||
public RefWatcher refWatcher;
|
public RefWatcher refWatcher;
|
||||||
@Inject
|
@Inject
|
||||||
Lazy<ApiClient> lazyApiHelper;
|
ApiClient lazyApiHelper;
|
||||||
|
@Inject
|
||||||
|
InventoryRepository inventoryRepository;
|
||||||
@Inject
|
@Inject
|
||||||
SharedPreferences sharedPrefs;
|
SharedPreferences sharedPrefs;
|
||||||
@Inject
|
@Inject
|
||||||
|
|
@ -83,7 +86,7 @@ public abstract class HabiticaBaseApplication extends MultiDexApplication {
|
||||||
editor.putBoolean("use_reminder", use_reminder);
|
editor.putBoolean("use_reminder", use_reminder);
|
||||||
editor.putString("reminder_time", reminder_time);
|
editor.putString("reminder_time", reminder_time);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
getInstance(context).lazyApiHelper.get().updateAuthenticationCredentials(null, null);
|
getInstance(context).lazyApiHelper.updateAuthenticationCredentials(null, null);
|
||||||
startActivity(LoginActivity.class, context);
|
startActivity(LoginActivity.class, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -165,10 +168,7 @@ public abstract class HabiticaBaseApplication extends MultiDexApplication {
|
||||||
int lastInstalledVersion = sharedPrefs.getInt("last_installed_version", 0);
|
int lastInstalledVersion = sharedPrefs.getInt("last_installed_version", 0);
|
||||||
if (lastInstalledVersion < info.versionCode) {
|
if (lastInstalledVersion < info.versionCode) {
|
||||||
sharedPrefs.edit().putInt("last_installed_version", info.versionCode).apply();
|
sharedPrefs.edit().putInt("last_installed_version", info.versionCode).apply();
|
||||||
ApiClient apiClient = this.lazyApiHelper.get();
|
inventoryRepository.retrieveContent().subscribe(contentResult -> {}, RxErrorHandler.handleEmptyError());
|
||||||
|
|
||||||
apiClient.getContent()
|
|
||||||
.subscribe(contentResult -> { }, RxErrorHandler.handleEmptyError());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -283,7 +283,7 @@ public abstract class HabiticaBaseApplication extends MultiDexApplication {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public PurchaseVerifier getPurchaseVerifier() {
|
public PurchaseVerifier getPurchaseVerifier() {
|
||||||
return new HabiticaPurchaseVerifier(HabiticaBaseApplication.this, lazyApiHelper.get());
|
return new HabiticaPurchaseVerifier(HabiticaBaseApplication.this, lazyApiHelper);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue