aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHermes Junior <ohermesjunior@gmail.com>2020-06-18 09:57:47 +0000
committerOHermesJunior <ohermesjunior@gmail.com>2020-06-18 09:58:34 +0000
commitdc39cb72afe70dbc6a42ef6a62669dda5603c2c5 (patch)
tree8f6646b9566b3f3bd4f3fc657d69b34d84de560f /app/src/main/java
parentb5fec7dac7e559391a95adb4342790fa54b172f9 (diff)
downloadinfinity-for-reddit-dc39cb72afe70dbc6a42ef6a62669dda5603c2c5.tar
infinity-for-reddit-dc39cb72afe70dbc6a42ef6a62669dda5603c2c5.tar.gz
infinity-for-reddit-dc39cb72afe70dbc6a42ef6a62669dda5603c2c5.tar.bz2
infinity-for-reddit-dc39cb72afe70dbc6a42ef6a62669dda5603c2c5.tar.lz
infinity-for-reddit-dc39cb72afe70dbc6a42ef6a62669dda5603c2c5.tar.xz
infinity-for-reddit-dc39cb72afe70dbc6a42ef6a62669dda5603c2c5.tar.zst
infinity-for-reddit-dc39cb72afe70dbc6a42ef6a62669dda5603c2c5.zip
Enable EventBus Index, avoids reflection, and better performance.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java
index 90478a08..04edd825 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java
@@ -17,6 +17,7 @@ import org.greenrobot.eventbus.EventBus;
import ml.docilealligator.infinityforreddit.BroadcastReceiver.NetworkWifiStatusReceiver;
import ml.docilealligator.infinityforreddit.Event.ChangeWifiStatusEvent;
import ml.docilealligator.infinityforreddit.Utils.Utils;
+import ml.docilealligator.inifinityforreddit.EventBusIndex;
public class Infinity extends Application {
private AppComponent mAppComponent;
@@ -42,6 +43,8 @@ public class Infinity extends Application {
}
});
+ EventBus.builder().addIndex(new EventBusIndex()).installDefaultEventBus();
+
mNetworkWifiStatusReceiver =
new NetworkWifiStatusReceiver(() -> EventBus.getDefault().post(new ChangeWifiStatusEvent(Utils.isConnectedToWifi(getApplicationContext()))));
registerReceiver(mNetworkWifiStatusReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));