New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: crash on android N #735

Merged
merged 1 commit into from Aug 2, 2017
Jump to file or symbol
Failed to load files and symbols.
+16 −5
Diff settings

Always

Just for now

@@ -5,8 +5,11 @@
package com.mifos; package com.mifos;
import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Build;
import android.os.StrictMode;
import android.support.multidex.MultiDexApplication; import android.support.multidex.MultiDexApplication;
import com.crashlytics.android.Crashlytics; import com.crashlytics.android.Crashlytics;
@@ -47,6 +50,7 @@ public static App get(Context context) {
return (App) context.getApplicationContext(); return (App) context.getApplicationContext();
} }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
@@ -57,6 +61,10 @@ public void onCreate() {
//Initializing the DBFlow and SQL Cipher Encryption //Initializing the DBFlow and SQL Cipher Encryption
FlowManager.init(new FlowConfig.Builder(this).build()); FlowManager.init(new FlowConfig.Builder(this).build());
Stetho.initializeWithDefaults(this); Stetho.initializeWithDefaults(this);
StrictMode.VmPolicy policy = new StrictMode.VmPolicy.Builder()
.detectFileUriExposure()
.build();
StrictMode.setVmPolicy(policy);
} }
public ApplicationComponent getComponent() { public ApplicationComponent getComponent() {
@@ -242,6 +242,7 @@ void onClickCreateNewClient() {
*/ */
@Override @Override
public void onRefresh() { public void onRefresh() {
showUserInterface();
mClientListPresenter.loadClients(false, 0); mClientListPresenter.loadClients(false, 0);
mClientListPresenter.loadDatabaseClients(); mClientListPresenter.loadDatabaseClients();
if (actionMode != null) actionMode.finish(); if (actionMode != null) actionMode.finish();
@@ -8,6 +8,7 @@
import com.bumptech.glide.load.model.GlideUrl; import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.load.model.LazyHeaders; import com.bumptech.glide.load.model.LazyHeaders;
import com.bumptech.glide.request.target.BitmapImageViewTarget; import com.bumptech.glide.request.target.BitmapImageViewTarget;
import com.bumptech.glide.signature.StringSignature;
import com.mifos.api.MifosInterceptor; import com.mifos.api.MifosInterceptor;
import com.mifos.mifosxdroid.R; import com.mifos.mifosxdroid.R;
@@ -37,6 +38,7 @@ public static void loadImage(Context context, int clientId, final ImageView imag
.asBitmap() .asBitmap()
.placeholder(R.drawable.ic_dp_placeholder) .placeholder(R.drawable.ic_dp_placeholder)
.error(R.drawable.ic_dp_placeholder) .error(R.drawable.ic_dp_placeholder)
.signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
.into(new BitmapImageViewTarget(imageView) { .into(new BitmapImageViewTarget(imageView) {
@Override @Override
protected void setResource(Bitmap result) { protected void setResource(Bitmap result) {
@@ -15,16 +15,16 @@
android:layout_width="75dp" android:layout_width="75dp"
android:layout_height="75dp"> android:layout_height="75dp">
<ProgressBar
android:id="@+id/pb_imageProgressBar"
style="@style/ProgressBar.Base"
android:layout_gravity="center"/>
<com.mifos.mifosxdroid.views.CircularImageView <com.mifos.mifosxdroid.views.CircularImageView
android:id="@+id/iv_clientImage" android:id="@+id/iv_clientImage"
style="@style/ClientImage" style="@style/ClientImage"
android:layout_gravity="center"/> android:layout_gravity="center"/>
<ProgressBar
android:id="@+id/pb_imageProgressBar"
style="@style/ProgressBar.Base"
android:layout_gravity="center"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
ProTip! Use n and p to navigate between commits in a pull request.