From cf02f3a2d77c3e31ff8cb5d32307a80819e03fd3 Mon Sep 17 00:00:00 2001 From: percy-g2 Date: Sat, 27 Jun 2020 20:55:21 +0530 Subject: [PATCH] Initial first beta release. --- app/build.gradle | 40 +++++++++++++++++-- .../exchange/openexchange/MainActivity.kt | 2 + .../openexchange/adapter/HomeAdapter.kt | 3 -- .../openexchange/ui/home/HomeFragment.kt | 2 +- .../openexchange/ui/home/HomeViewModel.kt | 3 +- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 801d7c2..b6f322b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,7 @@ android { targetSdkVersion 30 versionCode 5 versionName "beta-1.0" - ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' + // ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' externalNativeBuild { cmake { cppFlags "" @@ -49,8 +49,42 @@ android { } } -// To inline the bytecode built with JVM target 1.8 into -// bytecode that is being built with JVM target 1.6. (e.g. navArgs) + /** + * Configure your build for multiple apks. + * + * To configure your build for multiple apks. add a splits to your module-level 'build.gradle' file. + * + * Within the 'splits' block, provide a 'density' block that specifies how Gradle build generate pre-density apks. + * an 'abi(application binary interfaces)' block that specifies how gradle should generate pre-ABI APKS. + */ + splits { + /** + * Configure multiple APKs for ABIs + * + * Android Plugin for Gradle 3.1.0 and higher no longer generate APKs for the following ABIs by default: mips, mips64, and armeabi. + * That's because NDK r17 and higher no longer include these ABIs as supported targets. + * + * universalApk: + */ + // Configures multiple APKs based on ABI. + abi { + + // Enables building multiple APKs per ABI. + enable true + + // By default all ABIs are included, so use reset() and include to specify that we only + // want APKs for x86 and x86_64. + + // Resets the list of ABIs that Gradle should create APKs for to none. + reset() + + // Specifies a list of ABIs that Gradle should create APKs for. + include "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + + // Specifies that we do not want to also generate a universal APK that includes all ABIs. + universalApk false + } + } compileOptions { diff --git a/app/src/main/java/crypto/delta/exchange/openexchange/MainActivity.kt b/app/src/main/java/crypto/delta/exchange/openexchange/MainActivity.kt index b606079..aacc36a 100644 --- a/app/src/main/java/crypto/delta/exchange/openexchange/MainActivity.kt +++ b/app/src/main/java/crypto/delta/exchange/openexchange/MainActivity.kt @@ -11,6 +11,7 @@ import com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork import com.google.android.material.bottomnavigation.BottomNavigationMenuView import com.google.android.material.bottomnavigation.BottomNavigationView import crypto.delta.exchange.openexchange.utils.setupWithNavController +import io.reactivex.Observable import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable import io.reactivex.schedulers.Schedulers @@ -119,6 +120,7 @@ class MainActivity : AppCompatActivity() { } internetDisposable = ReactiveNetwork.observeInternetConnectivity() + .onErrorResumeNext(Observable.empty()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe { isConnectedToInternet -> diff --git a/app/src/main/java/crypto/delta/exchange/openexchange/adapter/HomeAdapter.kt b/app/src/main/java/crypto/delta/exchange/openexchange/adapter/HomeAdapter.kt index 37d0043..877cb54 100644 --- a/app/src/main/java/crypto/delta/exchange/openexchange/adapter/HomeAdapter.kt +++ b/app/src/main/java/crypto/delta/exchange/openexchange/adapter/HomeAdapter.kt @@ -55,8 +55,5 @@ class HomeAdapter( holder.dayVolume.text = "--" } }) - } - - } diff --git a/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeFragment.kt b/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeFragment.kt index 43e8b24..5177d46 100644 --- a/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeFragment.kt +++ b/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeFragment.kt @@ -29,7 +29,7 @@ class HomeFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener { savedInstanceState: Bundle? ): View? { homeViewModel = ViewModelProvider(this@HomeFragment).get(HomeViewModel::class.java) - homeViewModel.init(requireContext()) + homeViewModel.init() return inflater.inflate(R.layout.fragment_home, container, false) } diff --git a/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeViewModel.kt b/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeViewModel.kt index 4489c32..395c853 100644 --- a/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeViewModel.kt +++ b/app/src/main/java/crypto/delta/exchange/openexchange/ui/home/HomeViewModel.kt @@ -1,7 +1,6 @@ package crypto.delta.exchange.openexchange.ui.home import android.app.Application -import android.content.Context import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import crypto.delta.exchange.openexchange.BaseViewModel @@ -14,7 +13,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { private var deltaRepository: DeltaRepository? = null private val disposables: CompositeDisposable = CompositeDisposable() - fun init(context: Context) { + fun init() { deltaRepository = DeltaRepository.getInstance(this.getApplication()) }