fix crashes

This commit is contained in:
Phillip Thelen 2017-07-11 20:10:38 +02:00
parent 16ed0bed07
commit a6f76cd6be
7 changed files with 25 additions and 52 deletions

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.habitrpg.android.habitica"
android:versionCode="1912"
android:versionCode="1914"
android:versionName="1.1.3"
android:screenOrientation="portrait"
android:installLocation="auto" >

View file

@ -41,7 +41,7 @@ repositories {
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
//Networking
compile 'com.squareup.okhttp3:okhttp: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:adapter-rxjava:2.3.0'
//Crash Logging
releaseCompile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
// View Elements Binding :)
compile 'com.jakewharton:butterknife:8.6.0'
apt 'com.jakewharton:butterknife-compiler:8.6.0'
//Dependency Injection
compile 'com.google.dagger:dagger: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:preference-v14:25.3.1'
compile 'com.android.support:multidex:1.0.1'
//QR Code
compile 'com.github.kenglxn.QRGen:android:2.2.0'
// Emojis
compile 'com.github.viirus:emoji-lib:0.0.4'
// Markdown
compile 'com.commonsware.cwac:anddown:0.3.0'
// About View for all dependent Libraries, we are using
compile('com.mikepenz:aboutlibraries:5.9.4@aar') {
transitive = true
}
// a better fab alternative
compile 'com.github.clans:fab:1.6.4'
//Eventbus
compile 'org.greenrobot:eventbus:3.0.0'
// IAP Handling / Verification
compile 'org.solovyev.android:checkout:1.0.1'
//Facebook
compile('com.facebook.android:facebook-android-sdk:4.19.0') {
transitive = true
}
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
// lodash/underscore
compile 'com.github.javadev:underscore:1.23'
//RxJava
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.3.0'
//Analytics
compile 'com.amplitude:android-sdk:2.13.3'
// Fresco Image Management Library
compile('com.facebook.fresco:fresco:1.3.0') {
exclude module: 'bolts-android'
@ -123,34 +107,27 @@ dependencies {
exclude module: 'bolts-android'
}
//Tests
testCompile "junit:junit:4.10"
testCompile "org.assertj:assertj-core:1.7.0"
testCompile 'junit:junit:4.10'
testCompile 'org.assertj:assertj-core:1.7.0'
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-support-v4:3.3.2"
testCompile "org.mockito:mockito-core:2.8.9"
testCompile 'org.robolectric:shadows-support-v4:3.3.2'
testCompile 'org.mockito:mockito-core:2.8.9'
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:1.7.0'
testCompile 'org.powermock:powermock-module-junit4:1.7.0'
//Leak Detection
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
//Push Notifications
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'org.apmem.tools:layouts:1.10@aar'
compile 'com.roughike:bottom-bar:2.3.1'
compile 'io.realm:android-adapters:2.1.0'
compile(project(':seeds-sdk')) {
exclude group: 'com.google.android.gms'
exclude group: 'com.android.support', module: 'multidex'

View file

@ -113,7 +113,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="3 Participants"
android:textColor="@color/gray_300"/>
android:textColor="@color/gray_300"
android:visibility="gone"/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
@ -161,7 +162,6 @@
android:layout_height="wrap_content"
android:text="@string/quest.reject"
style="@style/HabiticaButton.Red"/>
</LinearLayout>
<LinearLayout
android:id="@+id/quest_leader_response_wrapper"
@ -186,6 +186,11 @@
android:text="@string/quest.cancel"
style="@style/HabiticaButton.Red" />
</LinearLayout>
<LinearLayout
android:id="@+id/quest_participant_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"

View file

@ -60,7 +60,7 @@ public class TaskRepositoryImpl extends BaseRepositoryImpl<TaskLocalRepository>
@Override
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))
.doOnNext(res -> this.localRepository.saveTasks(userId, tasksOrder, res));
}
@ -244,7 +244,7 @@ public class TaskRepositoryImpl extends BaseRepositoryImpl<TaskLocalRepository>
@Override
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))
.flatMap(localRepository::updateIsdue);
}

View file

@ -161,6 +161,9 @@ public class RealmInventoryLocalRepository extends RealmContentLocalRepository i
@Override
public Observable<RealmResults<Mount>> getOwnedMounts(String animalType, String animalGroup) {
if (animalGroup == null) {
animalGroup = "";
}
animalGroup = animalGroup.replace("pets", "mounts").replace("Pets", "Mounts");
return realm.where(Mount.class)
.equalTo("animalGroup", animalGroup)

View file

@ -119,23 +119,7 @@ public class GemsPurchaseFragment extends BaseFragment implements GemPurchaseAct
}
public void purchaseGems(String sku) {
// check if the user already bought and if it hasn't validated yet
billingRequests.isPurchased(ProductTypes.IN_APP, sku, new RequestListener<Boolean>() {
@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);
}
});
final ActivityCheckout checkout = listener.getActivityCheckout();
billingRequests.purchase(ProductTypes.IN_APP, sku, null, checkout.getPurchaseFlow());
}
}

View file

@ -8,6 +8,8 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.facebook.drawee.view.SimpleDraweeView;
@ -85,6 +87,8 @@ public class PartyDetailFragment extends BaseFragment {
Button questCancelButton;
@BindView(R.id.quest_progress_view)
QuestProgressView questProgressView;
@BindView(R.id.quest_participant_list)
LinearLayout questParticipantList;
public String partyId;