mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
#2110 Zoom controls disappeared in v3.3.1 - fix static analysis
This commit is contained in:
parent
2066877a8f
commit
ae63cd29ee
@ -65,7 +65,7 @@ class ZimFileSelectFragment : BaseFragment() {
|
|||||||
private val disposable = CompositeDisposable()
|
private val disposable = CompositeDisposable()
|
||||||
|
|
||||||
private val zimManageViewModel by lazy {
|
private val zimManageViewModel by lazy {
|
||||||
activity!!.viewModel<ZimManageViewModel>(viewModelFactory)
|
requireActivity().viewModel<ZimManageViewModel>(viewModelFactory)
|
||||||
}
|
}
|
||||||
private val bookDelegate: BookDelegate by lazy {
|
private val bookDelegate: BookDelegate by lazy {
|
||||||
BookDelegate(sharedPreferenceUtil,
|
BookDelegate(sharedPreferenceUtil,
|
||||||
@ -87,8 +87,8 @@ class ZimFileSelectFragment : BaseFragment() {
|
|||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View? {
|
): View? {
|
||||||
LanguageUtils(activity!!)
|
LanguageUtils(requireActivity())
|
||||||
.changeFont(activity!!.layoutInflater, sharedPreferenceUtil)
|
.changeFont(requireActivity().layoutInflater, sharedPreferenceUtil)
|
||||||
return inflater.inflate(R.layout.zim_list, container, false)
|
return inflater.inflate(R.layout.zim_list, container, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ class ZimFileSelectFragment : BaseFragment() {
|
|||||||
|
|
||||||
private fun sideEffects() = zimManageViewModel.sideEffects.subscribe(
|
private fun sideEffects() = zimManageViewModel.sideEffects.subscribe(
|
||||||
{
|
{
|
||||||
val effectResult = it.invokeWith(activity!! as AppCompatActivity)
|
val effectResult = it.invokeWith(requireActivity() as AppCompatActivity)
|
||||||
if (effectResult is ActionMode) {
|
if (effectResult is ActionMode) {
|
||||||
actionMode = effectResult
|
actionMode = effectResult
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ class ZimFileSelectFragment : BaseFragment() {
|
|||||||
|
|
||||||
private fun checkPermissions() {
|
private fun checkPermissions() {
|
||||||
if (ContextCompat.checkSelfPermission(
|
if (ContextCompat.checkSelfPermission(
|
||||||
activity!!,
|
requireActivity(),
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||||
) != PackageManager.PERMISSION_GRANTED
|
) != PackageManager.PERMISSION_GRANTED
|
||||||
) {
|
) {
|
||||||
|
@ -72,7 +72,7 @@ class LibraryFragment : BaseFragment() {
|
|||||||
@Inject lateinit var availableSpaceCalculator: AvailableSpaceCalculator
|
@Inject lateinit var availableSpaceCalculator: AvailableSpaceCalculator
|
||||||
|
|
||||||
private val zimManageViewModel by lazy {
|
private val zimManageViewModel by lazy {
|
||||||
activity!!.viewModel<ZimManageViewModel>(viewModelFactory)
|
requireActivity().viewModel<ZimManageViewModel>(viewModelFactory)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val libraryAdapter: LibraryAdapter by lazy {
|
private val libraryAdapter: LibraryAdapter by lazy {
|
||||||
@ -86,7 +86,7 @@ class LibraryFragment : BaseFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val noWifiWithWifiOnlyPreferenceSet
|
private val noWifiWithWifiOnlyPreferenceSet
|
||||||
get() = sharedPreferenceUtil.prefWifiOnly && !NetworkUtils.isWiFi(context!!)
|
get() = sharedPreferenceUtil.prefWifiOnly && !NetworkUtils.isWiFi(requireContext())
|
||||||
|
|
||||||
private val isNotConnected get() = conMan.activeNetworkInfo?.isConnected == false
|
private val isNotConnected get() = conMan.activeNetworkInfo?.isConnected == false
|
||||||
|
|
||||||
@ -216,5 +216,5 @@ class LibraryFragment : BaseFragment() {
|
|||||||
.apply {
|
.apply {
|
||||||
onSelectAction = ::storeDeviceInPreferences
|
onSelectAction = ::storeDeviceInPreferences
|
||||||
}
|
}
|
||||||
.show(fragmentManager!!, getString(R.string.pref_storage))
|
.show(requireFragmentManager(), getString(R.string.pref_storage))
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,7 @@ class AllProjectConfigurer {
|
|||||||
ignore(
|
ignore(
|
||||||
"SyntheticAccessor",
|
"SyntheticAccessor",
|
||||||
"GoogleAppIndexingApiWarning",
|
"GoogleAppIndexingApiWarning",
|
||||||
|
"LockedOrientationActivity",
|
||||||
//TODO stop ignoring below this
|
//TODO stop ignoring below this
|
||||||
"CheckResult",
|
"CheckResult",
|
||||||
"LabelFor",
|
"LabelFor",
|
||||||
|
@ -70,7 +70,7 @@ class StorageSelectDialog : DialogFragment() {
|
|||||||
layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
|
layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
|
||||||
setHasFixedSize(true)
|
setHasFixedSize(true)
|
||||||
}
|
}
|
||||||
Flowable.fromCallable { StorageDeviceUtils.getWritableStorage(activity!!) }
|
Flowable.fromCallable { StorageDeviceUtils.getWritableStorage(requireActivity()) }
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user