mirror of
				https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
				synced 2025-10-31 08:58:10 +01:00 
			
		
		
		
	Merge pull request #140 from OHermesJunior/eventbus-index
Enable EventBus Index, avoids reflection, and better performance.
This commit is contained in:
		| @@ -9,6 +9,11 @@ android { | |||||||
|         versionCode 35 |         versionCode 35 | ||||||
|         versionName "3.2.0" |         versionName "3.2.0" | ||||||
|         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||||
|  |         javaCompileOptions { | ||||||
|  |             annotationProcessorOptions { | ||||||
|  |                 arguments = [ eventBusIndex : 'ml.docilealligator.inifinityforreddit.EventBusIndex' ] | ||||||
|  |             } | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     buildTypes { |     buildTypes { | ||||||
|         release { |         release { | ||||||
| @@ -67,7 +72,10 @@ dependencies { | |||||||
|     implementation 'io.noties.markwon:recycler-table:4.3.1' |     implementation 'io.noties.markwon:recycler-table:4.3.1' | ||||||
|     implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' |     implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' | ||||||
|     implementation 'com.github.Ferfalk:SimpleSearchView:0.1.4' |     implementation 'com.github.Ferfalk:SimpleSearchView:0.1.4' | ||||||
|     implementation 'org.greenrobot:eventbus:3.2.0' |  | ||||||
|  |     def eventbusVersion = '3.2.0' | ||||||
|  |     implementation "org.greenrobot:eventbus:$eventbusVersion" | ||||||
|  |     annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbusVersion" | ||||||
|     implementation 'com.libRG:customtextview:2.4' |     implementation 'com.libRG:customtextview:2.4' | ||||||
|     implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.1' |     implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.1' | ||||||
|     implementation 'com.github.livefront:bridge:v1.2.1' |     implementation 'com.github.livefront:bridge:v1.2.1' | ||||||
|   | |||||||
| @@ -17,6 +17,7 @@ import org.greenrobot.eventbus.EventBus; | |||||||
| import ml.docilealligator.infinityforreddit.BroadcastReceiver.NetworkWifiStatusReceiver; | import ml.docilealligator.infinityforreddit.BroadcastReceiver.NetworkWifiStatusReceiver; | ||||||
| import ml.docilealligator.infinityforreddit.Event.ChangeWifiStatusEvent; | import ml.docilealligator.infinityforreddit.Event.ChangeWifiStatusEvent; | ||||||
| import ml.docilealligator.infinityforreddit.Utils.Utils; | import ml.docilealligator.infinityforreddit.Utils.Utils; | ||||||
|  | import ml.docilealligator.inifinityforreddit.EventBusIndex; | ||||||
|  |  | ||||||
| public class Infinity extends Application { | public class Infinity extends Application { | ||||||
|     private AppComponent mAppComponent; |     private AppComponent mAppComponent; | ||||||
| @@ -42,6 +43,8 @@ public class Infinity extends Application { | |||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         EventBus.builder().addIndex(new EventBusIndex()).installDefaultEventBus(); | ||||||
|  |  | ||||||
|         mNetworkWifiStatusReceiver = |         mNetworkWifiStatusReceiver = | ||||||
|                 new NetworkWifiStatusReceiver(() -> EventBus.getDefault().post(new ChangeWifiStatusEvent(Utils.isConnectedToWifi(getApplicationContext())))); |                 new NetworkWifiStatusReceiver(() -> EventBus.getDefault().post(new ChangeWifiStatusEvent(Utils.isConnectedToWifi(getApplicationContext())))); | ||||||
|         registerReceiver(mNetworkWifiStatusReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); |         registerReceiver(mNetworkWifiStatusReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user