mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +00:00
fix crashes
This commit is contained in:
parent
16ed0bed07
commit
a6f76cd6be
7 changed files with 25 additions and 52 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="1912"
|
android:versionCode="1914"
|
||||||
android:versionName="1.1.3"
|
android:versionName="1.1.3"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:installLocation="auto" >
|
android:installLocation="auto" >
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
//Networking
|
//Networking
|
||||||
compile 'com.squareup.okhttp3:okhttp:3.8.1'
|
compile 'com.squareup.okhttp3:okhttp:3.8.1'
|
||||||
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
|
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
|
||||||
|
|
@ -51,16 +51,13 @@ dependencies {
|
||||||
}
|
}
|
||||||
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
|
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
|
||||||
compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
|
compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
|
||||||
|
|
||||||
//Crash Logging
|
//Crash Logging
|
||||||
releaseCompile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
|
releaseCompile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
|
||||||
transitive = true;
|
transitive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// View Elements Binding :)
|
// View Elements Binding :)
|
||||||
compile 'com.jakewharton:butterknife:8.6.0'
|
compile 'com.jakewharton:butterknife:8.6.0'
|
||||||
apt 'com.jakewharton:butterknife-compiler:8.6.0'
|
apt 'com.jakewharton:butterknife-compiler:8.6.0'
|
||||||
|
|
||||||
//Dependency Injection
|
//Dependency Injection
|
||||||
compile 'com.google.dagger:dagger:2.11'
|
compile 'com.google.dagger:dagger:2.11'
|
||||||
apt 'com.google.dagger:dagger-compiler:2.11'
|
apt 'com.google.dagger:dagger-compiler:2.11'
|
||||||
|
|
@ -74,47 +71,34 @@ dependencies {
|
||||||
compile 'com.android.support:recyclerview-v7:25.3.1'
|
compile 'com.android.support:recyclerview-v7:25.3.1'
|
||||||
compile 'com.android.support:preference-v14:25.3.1'
|
compile 'com.android.support:preference-v14:25.3.1'
|
||||||
compile 'com.android.support:multidex:1.0.1'
|
compile 'com.android.support:multidex:1.0.1'
|
||||||
|
|
||||||
//QR Code
|
//QR Code
|
||||||
compile 'com.github.kenglxn.QRGen:android:2.2.0'
|
compile 'com.github.kenglxn.QRGen:android:2.2.0'
|
||||||
|
|
||||||
// Emojis
|
// Emojis
|
||||||
compile 'com.github.viirus:emoji-lib:0.0.4'
|
compile 'com.github.viirus:emoji-lib:0.0.4'
|
||||||
|
|
||||||
// Markdown
|
// Markdown
|
||||||
compile 'com.commonsware.cwac:anddown:0.3.0'
|
compile 'com.commonsware.cwac:anddown:0.3.0'
|
||||||
|
|
||||||
// About View for all dependent Libraries, we are using
|
// About View for all dependent Libraries, we are using
|
||||||
compile('com.mikepenz:aboutlibraries:5.9.4@aar') {
|
compile('com.mikepenz:aboutlibraries:5.9.4@aar') {
|
||||||
transitive = true
|
transitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// a better fab alternative
|
// a better fab alternative
|
||||||
compile 'com.github.clans:fab:1.6.4'
|
compile 'com.github.clans:fab:1.6.4'
|
||||||
|
|
||||||
//Eventbus
|
//Eventbus
|
||||||
compile 'org.greenrobot:eventbus:3.0.0'
|
compile 'org.greenrobot:eventbus:3.0.0'
|
||||||
|
|
||||||
// IAP Handling / Verification
|
// IAP Handling / Verification
|
||||||
compile 'org.solovyev.android:checkout:1.0.1'
|
compile 'org.solovyev.android:checkout:1.0.1'
|
||||||
|
|
||||||
//Facebook
|
//Facebook
|
||||||
compile('com.facebook.android:facebook-android-sdk:4.19.0') {
|
compile('com.facebook.android:facebook-android-sdk:4.19.0') {
|
||||||
transitive = true
|
transitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
|
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
|
||||||
|
|
||||||
// lodash/underscore
|
// lodash/underscore
|
||||||
compile 'com.github.javadev:underscore:1.23'
|
compile 'com.github.javadev:underscore:1.23'
|
||||||
|
|
||||||
//RxJava
|
//RxJava
|
||||||
compile 'io.reactivex:rxandroid:1.2.1'
|
compile 'io.reactivex:rxandroid:1.2.1'
|
||||||
compile 'io.reactivex:rxjava:1.3.0'
|
compile 'io.reactivex:rxjava:1.3.0'
|
||||||
|
|
||||||
//Analytics
|
//Analytics
|
||||||
compile 'com.amplitude:android-sdk:2.13.3'
|
compile 'com.amplitude:android-sdk:2.13.3'
|
||||||
|
|
||||||
// Fresco Image Management Library
|
// Fresco Image Management Library
|
||||||
compile('com.facebook.fresco:fresco:1.3.0') {
|
compile('com.facebook.fresco:fresco:1.3.0') {
|
||||||
exclude module: 'bolts-android'
|
exclude module: 'bolts-android'
|
||||||
|
|
@ -123,34 +107,27 @@ dependencies {
|
||||||
exclude module: 'bolts-android'
|
exclude module: 'bolts-android'
|
||||||
}
|
}
|
||||||
//Tests
|
//Tests
|
||||||
testCompile "junit:junit:4.10"
|
testCompile 'junit:junit:4.10'
|
||||||
testCompile "org.assertj:assertj-core:1.7.0"
|
testCompile 'org.assertj:assertj-core:1.7.0'
|
||||||
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
|
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
|
||||||
testCompile "org.robolectric:robolectric:3.3.2"
|
testCompile 'org.robolectric:robolectric:3.3.2'
|
||||||
testCompile 'org.robolectric:shadows-multidex:3.3.2'
|
testCompile 'org.robolectric:shadows-multidex:3.3.2'
|
||||||
testCompile "org.robolectric:shadows-support-v4:3.3.2"
|
testCompile 'org.robolectric:shadows-support-v4:3.3.2'
|
||||||
testCompile "org.mockito:mockito-core:2.8.9"
|
testCompile 'org.mockito:mockito-core:2.8.9'
|
||||||
testCompile 'org.powermock:powermock-api-mockito2:1.7.0'
|
testCompile 'org.powermock:powermock-api-mockito2:1.7.0'
|
||||||
testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.7.0'
|
testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.7.0'
|
||||||
testCompile 'org.powermock:powermock-module-junit4-rule:1.7.0'
|
testCompile 'org.powermock:powermock-module-junit4-rule:1.7.0'
|
||||||
testCompile 'org.powermock:powermock-module-junit4:1.7.0'
|
testCompile 'org.powermock:powermock-module-junit4:1.7.0'
|
||||||
|
|
||||||
//Leak Detection
|
//Leak Detection
|
||||||
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
|
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
|
||||||
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
|
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
|
||||||
|
|
||||||
//Push Notifications
|
//Push Notifications
|
||||||
compile 'com.google.firebase:firebase-core:10.2.0'
|
compile 'com.google.firebase:firebase-core:10.2.0'
|
||||||
compile 'com.google.firebase:firebase-messaging:10.2.0'
|
compile 'com.google.firebase:firebase-messaging:10.2.0'
|
||||||
|
|
||||||
compile 'com.google.android.gms:play-services-auth:10.2.0'
|
compile 'com.google.android.gms:play-services-auth:10.2.0'
|
||||||
|
|
||||||
compile 'org.apmem.tools:layouts:1.10@aar'
|
compile 'org.apmem.tools:layouts:1.10@aar'
|
||||||
|
|
||||||
compile 'com.roughike:bottom-bar:2.3.1'
|
compile 'com.roughike:bottom-bar:2.3.1'
|
||||||
|
|
||||||
compile 'io.realm:android-adapters:2.1.0'
|
compile 'io.realm:android-adapters:2.1.0'
|
||||||
|
|
||||||
compile(project(':seeds-sdk')) {
|
compile(project(':seeds-sdk')) {
|
||||||
exclude group: 'com.google.android.gms'
|
exclude group: 'com.google.android.gms'
|
||||||
exclude group: 'com.android.support', module: 'multidex'
|
exclude group: 'com.android.support', module: 'multidex'
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="3 Participants"
|
tools:text="3 Participants"
|
||||||
android:textColor="@color/gray_300"/>
|
android:textColor="@color/gray_300"
|
||||||
|
android:visibility="gone"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
@ -161,7 +162,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/quest.reject"
|
android:text="@string/quest.reject"
|
||||||
style="@style/HabiticaButton.Red"/>
|
style="@style/HabiticaButton.Red"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/quest_leader_response_wrapper"
|
android:id="@+id/quest_leader_response_wrapper"
|
||||||
|
|
@ -186,6 +186,11 @@
|
||||||
android:text="@string/quest.cancel"
|
android:text="@string/quest.cancel"
|
||||||
style="@style/HabiticaButton.Red" />
|
style="@style/HabiticaButton.Red" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/quest_participant_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class TaskRepositoryImpl extends BaseRepositoryImpl<TaskLocalRepository>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Observable<TaskList> retrieveTasks(String userId, TasksOrder tasksOrder, Date dueDate) {
|
public Observable<TaskList> retrieveTasks(String userId, TasksOrder tasksOrder, Date dueDate) {
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.US);
|
||||||
return this.apiClient.getTasks("dailys", formatter.format(dueDate))
|
return this.apiClient.getTasks("dailys", formatter.format(dueDate))
|
||||||
.doOnNext(res -> this.localRepository.saveTasks(userId, tasksOrder, res));
|
.doOnNext(res -> this.localRepository.saveTasks(userId, tasksOrder, res));
|
||||||
}
|
}
|
||||||
|
|
@ -244,7 +244,7 @@ public class TaskRepositoryImpl extends BaseRepositoryImpl<TaskLocalRepository>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Observable<TaskList> updateDailiesIsDue(Date date) {
|
public Observable<TaskList> updateDailiesIsDue(Date date) {
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.US);
|
||||||
return apiClient.getTasks("dailys", formatter.format(date))
|
return apiClient.getTasks("dailys", formatter.format(date))
|
||||||
.flatMap(localRepository::updateIsdue);
|
.flatMap(localRepository::updateIsdue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,9 @@ public class RealmInventoryLocalRepository extends RealmContentLocalRepository i
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Observable<RealmResults<Mount>> getOwnedMounts(String animalType, String animalGroup) {
|
public Observable<RealmResults<Mount>> getOwnedMounts(String animalType, String animalGroup) {
|
||||||
|
if (animalGroup == null) {
|
||||||
|
animalGroup = "";
|
||||||
|
}
|
||||||
animalGroup = animalGroup.replace("pets", "mounts").replace("Pets", "Mounts");
|
animalGroup = animalGroup.replace("pets", "mounts").replace("Pets", "Mounts");
|
||||||
return realm.where(Mount.class)
|
return realm.where(Mount.class)
|
||||||
.equalTo("animalGroup", animalGroup)
|
.equalTo("animalGroup", animalGroup)
|
||||||
|
|
|
||||||
|
|
@ -119,23 +119,7 @@ public class GemsPurchaseFragment extends BaseFragment implements GemPurchaseAct
|
||||||
}
|
}
|
||||||
|
|
||||||
public void purchaseGems(String sku) {
|
public void purchaseGems(String sku) {
|
||||||
// check if the user already bought and if it hasn't validated yet
|
final ActivityCheckout checkout = listener.getActivityCheckout();
|
||||||
billingRequests.isPurchased(ProductTypes.IN_APP, sku, new RequestListener<Boolean>() {
|
billingRequests.purchase(ProductTypes.IN_APP, sku, null, checkout.getPurchaseFlow());
|
||||||
@Override
|
|
||||||
public void onSuccess(@NonNull Boolean aBoolean) {
|
|
||||||
if (!aBoolean) {
|
|
||||||
// no current product exist
|
|
||||||
final ActivityCheckout checkout = listener.getActivityCheckout();
|
|
||||||
Log.d("GEM", sku);
|
|
||||||
billingRequests.purchase(ProductTypes.IN_APP, sku, null, checkout.getPurchaseFlow());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(int i, @NonNull Exception e) {
|
|
||||||
crashlyticsProxy.fabricLogE("Purchase", "Error", e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.facebook.drawee.view.SimpleDraweeView;
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
|
|
@ -85,6 +87,8 @@ public class PartyDetailFragment extends BaseFragment {
|
||||||
Button questCancelButton;
|
Button questCancelButton;
|
||||||
@BindView(R.id.quest_progress_view)
|
@BindView(R.id.quest_progress_view)
|
||||||
QuestProgressView questProgressView;
|
QuestProgressView questProgressView;
|
||||||
|
@BindView(R.id.quest_participant_list)
|
||||||
|
LinearLayout questParticipantList;
|
||||||
|
|
||||||
|
|
||||||
public String partyId;
|
public String partyId;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue