move ChaosflixApplication so we have separate debug and release versions, so we can enable Stetho only in debug builds

This commit is contained in:
Felix 2017-04-22 01:35:07 +02:00
parent 04e3fd3721
commit 0ac0efecdd
4 changed files with 34 additions and 5 deletions

View file

@ -50,6 +50,7 @@ dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'joda-time:joda-time:2.9.9'
compile 'org.joda:joda-convert:1.8'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.0.1'

View file

@ -4,7 +4,6 @@ import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import com.facebook.stetho.Stetho;
import com.orm.SugarContext;
/**
@ -15,7 +14,6 @@ public class ChaosflixApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Stetho.initializeWithDefaults(this);
SugarContext.init(this);
}

View file

@ -149,9 +149,8 @@ public class EventsDetailsFragment extends DetailsFragment {
adapter.add(new ListRow(header, randomEventAdapter));
}
setOnItemViewClickedListener(new ItemViewClickedListener(this));
setAdapter(adapter);
ItemViewClickedListener listener = new ItemViewClickedListener(EventsDetailsFragment.this);
setOnItemViewClickedListener(listener);
browseErrorFragment.dismiss();
});
});
@ -166,8 +165,8 @@ public class EventsDetailsFragment extends DetailsFragment {
ArrayObjectAdapter actionsAdapter = getStreamActionsAdapter(mRoom.getStreams());
detailsOverviewRow.setActionsAdapter(actionsAdapter);
adapter.add(detailsOverviewRow);
setAdapter(adapter);
setOnItemViewClickedListener(new ItemViewClickedListener(EventsDetailsFragment.this));
setAdapter(adapter);
browseErrorFragment.dismiss();
// TODO add other streams
});

View file

@ -0,0 +1,31 @@
package de.nicidienase.chaosflix;
import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import com.orm.SugarContext;
/**
* Created by felix on 18.03.17.
*/
public class ChaosflixApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
SugarContext.init(this);
}
@Override
public void onTerminate() {
SugarContext.terminate();
super.onTerminate();
}
@Override
protected void attachBaseContext(Context base) {
MultiDex.install(base);
super.attachBaseContext(base);
}
}