VancedManager/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt

119 lines
4.2 KiB
Kotlin
Raw Normal View History

package com.vanced.manager.ui.fragments
2020-03-18 18:10:54 +00:00
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
2020-03-18 18:10:54 +00:00
import android.os.Bundle
2020-11-15 17:04:23 +00:00
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuInflater
import android.view.ViewGroup
2020-06-04 08:39:04 +00:00
import androidx.fragment.app.viewModels
import androidx.localbroadcastmanager.content.LocalBroadcastManager
2020-10-31 19:45:39 +00:00
import androidx.recyclerview.widget.LinearLayoutManager
import com.crowdin.platform.util.inflateWithCrowdin
2020-10-31 19:45:39 +00:00
import com.google.android.flexbox.FlexboxLayoutManager
import com.google.android.flexbox.JustifyContent
import com.vanced.manager.R
Vanced Manager 2.6.0 (#516) * updated app card UI * bug fixes * fixed grammar * removed unnoticable animation to improve performance * removed useless attribute * kotlin extensions are stonks * reference accent color variable instead of getting preference value every time * updated old stuff * removed useless check inside 'when' statement * optimised lifecycleOwner getter * property access syntax goes brrrrr * small accent update * added progress indicators to download dialogs * fixed changelog not appearing when pressing card in about menu * bumped up kotlin to 1.4.31 * fixed #437 * fixed #435 * fixed viewpager navigation on RTL layout * added a check for session id in root installer * updated strings * always notify about miui error * only run 1 animation at once * require external storage * sorted strings xml * improved layouts to look more close to each other * bumped up dependencies * updated version * fixed crash on manager update * New Crowdin updates (#489) * New translations strings.xml (Romanian) * New translations strings.xml (Bengali) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (Swedish) * New translations strings.xml (Turkish) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Marathi) * New translations strings.xml (Portuguese) * New translations strings.xml (Thai) * New translations strings.xml (Croatian) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Russian) * New translations strings.xml (Polish) * New translations strings.xml (Arabic) * New translations strings.xml (Spanish) * New translations strings.xml (Slovak) * New translations strings.xml (Malayalam) * New translations strings.xml (Japanese) * New translations strings.xml (Estonian) * New translations strings.xml (French) * New translations strings.xml (Kurdish) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Hungarian) * New translations strings.xml (Finnish) * New translations strings.xml (Korean) * New translations strings.xml (Afrikaans) * New translations strings.xml (Punjabi) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Hebrew) * New translations strings.xml (Italian) * New translations strings.xml (Georgian) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi, Pakistan) * Added button info on long press * preview adjustments to navigation xml * moved splash screen activity to parent dir * fixed buttontag getter * updated readme * fixed readme * Added build section to readme * Updated build instructions * prevent stacktrace from obfuscating * Added an option to switch between internal and external storage * removed warning for music vanced * added back a fix for split installer * added -r option for root music installer * Revert "prevent stacktrace from obfuscating" This reverts commit 2d30eb60af11f2d854c826953c025702c2e161ce. * Revert "added back a fix for split installer" This reverts commit aeaa0d445ec7cd6d2c318bf3f3751f8759d89801. * Revert "Added an option to switch between internal and external storage" This reverts commit 98c4b88961d14f36acf908bcee2376c1f79af86e. * reverted all storage-related commits * prevent stacktrace ovfuscation * updated readme * updated base url * use storage perms only on android 5 * cleanup * removed unused event file * fixed dark overlay not disappearing after bottom dialog has been dismissed * removed unecessary path from file_provider * fixed lint for core-ui * improved layout flexibility * updated icons in expandable app item * removed path prefix for api urls * removed microg bug dialog * fixed version code comparison * New translations strings.xml (Romanian) * New translations strings.xml (Croatian) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Bengali) * New translations strings.xml (Marathi) * New translations strings.xml (Thai) * New translations strings.xml (Estonian) * New translations strings.xml (Swedish) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Malayalam) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Punjabi, Pakistan) * New translations strings.xml (Turkish) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (French) * New translations strings.xml (Hebrew) * New translations strings.xml (Spanish) * New translations strings.xml (Afrikaans) * New translations strings.xml (Arabic) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Finnish) * New translations strings.xml (Hungarian) * New translations strings.xml (Slovak) * New translations strings.xml (Italian) * New translations strings.xml (Japanese) * New translations strings.xml (Georgian) * New translations strings.xml (Korean) * New translations strings.xml (Kurdish) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi) * New translations strings.xml (Polish) * New translations strings.xml (Portuguese) * New translations strings.xml (Russian) * New translations strings.xml (Lithuanian) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Arabic) * New translations strings.xml (Slovak) * New translations strings.xml (Korean) * New translations strings.xml (Polish) * New Crowdin updates (#515) * New translations strings.xml (Arabic) * New translations strings.xml (Greek) * New translations strings.xml (Dutch) * New translations strings.xml (Turkish) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Indonesian) Co-authored-by: X1nto <burtkni@yandex.ru> Co-authored-by: Tornike Khintibidze <48173186+X1nto@users.noreply.github.com>
2021-04-27 12:16:14 +00:00
import com.vanced.manager.adapter.ExpandableAppListAdapter
2020-10-31 19:45:39 +00:00
import com.vanced.manager.adapter.LinkAdapter
import com.vanced.manager.adapter.SponsorAdapter
import com.vanced.manager.core.ui.base.BindingFragment
2020-06-04 07:35:26 +00:00
import com.vanced.manager.databinding.FragmentHomeBinding
2020-08-05 11:52:09 +00:00
import com.vanced.manager.ui.dialogs.DialogContainer.installAlertBuilder
2020-06-04 08:39:04 +00:00
import com.vanced.manager.ui.viewmodels.HomeViewModel
import com.vanced.manager.ui.viewmodels.HomeViewModelFactory
2021-01-16 17:00:38 +00:00
import com.vanced.manager.utils.isFetching
2020-03-18 18:10:54 +00:00
2021-02-17 17:00:39 +00:00
class HomeFragment : BindingFragment<FragmentHomeBinding>() {
2020-11-14 21:48:47 +00:00
companion object {
2020-11-23 16:00:41 +00:00
const val INSTALL_FAILED = "INSTALL_FAILED"
const val REFRESH_HOME = "REFRESH_HOME"
2020-11-14 21:48:47 +00:00
}
2020-03-18 18:10:54 +00:00
private val viewModel: HomeViewModel by viewModels {
HomeViewModelFactory(requireActivity())
}
2020-11-14 21:48:47 +00:00
private val localBroadcastManager by lazy { LocalBroadcastManager.getInstance(requireActivity()) }
2020-10-31 19:45:39 +00:00
2020-11-14 21:48:47 +00:00
override fun binding(
inflater: LayoutInflater,
container: ViewGroup?,
2020-07-16 21:05:31 +00:00
savedInstanceState: Bundle?
2020-11-14 21:48:47 +00:00
) = FragmentHomeBinding.inflate(inflater, container, false)
2020-11-14 21:48:47 +00:00
override fun otherSetups() {
bindData()
}
2020-09-19 07:07:32 +00:00
2020-11-14 21:48:47 +00:00
private fun bindData() {
requireActivity().title = getString(R.string.title_home)
setHasOptionsMenu(true)
Vanced Manager 2.6.0 (#516) * updated app card UI * bug fixes * fixed grammar * removed unnoticable animation to improve performance * removed useless attribute * kotlin extensions are stonks * reference accent color variable instead of getting preference value every time * updated old stuff * removed useless check inside 'when' statement * optimised lifecycleOwner getter * property access syntax goes brrrrr * small accent update * added progress indicators to download dialogs * fixed changelog not appearing when pressing card in about menu * bumped up kotlin to 1.4.31 * fixed #437 * fixed #435 * fixed viewpager navigation on RTL layout * added a check for session id in root installer * updated strings * always notify about miui error * only run 1 animation at once * require external storage * sorted strings xml * improved layouts to look more close to each other * bumped up dependencies * updated version * fixed crash on manager update * New Crowdin updates (#489) * New translations strings.xml (Romanian) * New translations strings.xml (Bengali) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (Swedish) * New translations strings.xml (Turkish) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Marathi) * New translations strings.xml (Portuguese) * New translations strings.xml (Thai) * New translations strings.xml (Croatian) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Russian) * New translations strings.xml (Polish) * New translations strings.xml (Arabic) * New translations strings.xml (Spanish) * New translations strings.xml (Slovak) * New translations strings.xml (Malayalam) * New translations strings.xml (Japanese) * New translations strings.xml (Estonian) * New translations strings.xml (French) * New translations strings.xml (Kurdish) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Hungarian) * New translations strings.xml (Finnish) * New translations strings.xml (Korean) * New translations strings.xml (Afrikaans) * New translations strings.xml (Punjabi) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Hebrew) * New translations strings.xml (Italian) * New translations strings.xml (Georgian) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi, Pakistan) * Added button info on long press * preview adjustments to navigation xml * moved splash screen activity to parent dir * fixed buttontag getter * updated readme * fixed readme * Added build section to readme * Updated build instructions * prevent stacktrace from obfuscating * Added an option to switch between internal and external storage * removed warning for music vanced * added back a fix for split installer * added -r option for root music installer * Revert "prevent stacktrace from obfuscating" This reverts commit 2d30eb60af11f2d854c826953c025702c2e161ce. * Revert "added back a fix for split installer" This reverts commit aeaa0d445ec7cd6d2c318bf3f3751f8759d89801. * Revert "Added an option to switch between internal and external storage" This reverts commit 98c4b88961d14f36acf908bcee2376c1f79af86e. * reverted all storage-related commits * prevent stacktrace ovfuscation * updated readme * updated base url * use storage perms only on android 5 * cleanup * removed unused event file * fixed dark overlay not disappearing after bottom dialog has been dismissed * removed unecessary path from file_provider * fixed lint for core-ui * improved layout flexibility * updated icons in expandable app item * removed path prefix for api urls * removed microg bug dialog * fixed version code comparison * New translations strings.xml (Romanian) * New translations strings.xml (Croatian) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Bengali) * New translations strings.xml (Marathi) * New translations strings.xml (Thai) * New translations strings.xml (Estonian) * New translations strings.xml (Swedish) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Malayalam) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Punjabi, Pakistan) * New translations strings.xml (Turkish) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (French) * New translations strings.xml (Hebrew) * New translations strings.xml (Spanish) * New translations strings.xml (Afrikaans) * New translations strings.xml (Arabic) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Finnish) * New translations strings.xml (Hungarian) * New translations strings.xml (Slovak) * New translations strings.xml (Italian) * New translations strings.xml (Japanese) * New translations strings.xml (Georgian) * New translations strings.xml (Korean) * New translations strings.xml (Kurdish) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi) * New translations strings.xml (Polish) * New translations strings.xml (Portuguese) * New translations strings.xml (Russian) * New translations strings.xml (Lithuanian) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Arabic) * New translations strings.xml (Slovak) * New translations strings.xml (Korean) * New translations strings.xml (Polish) * New Crowdin updates (#515) * New translations strings.xml (Arabic) * New translations strings.xml (Greek) * New translations strings.xml (Dutch) * New translations strings.xml (Turkish) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Indonesian) Co-authored-by: X1nto <burtkni@yandex.ru> Co-authored-by: Tornike Khintibidze <48173186+X1nto@users.noreply.github.com>
2021-04-27 12:16:14 +00:00
with(binding) {
2020-11-14 21:48:47 +00:00
homeRefresh.setOnRefreshListener { viewModel.fetchData() }
2020-12-19 08:35:07 +00:00
isFetching.observe(viewLifecycleOwner) { homeRefresh.isRefreshing = it }
2020-10-31 19:45:39 +00:00
recyclerAppList.apply {
layoutManager = LinearLayoutManager(requireActivity())
Vanced Manager 2.6.0 (#516) * updated app card UI * bug fixes * fixed grammar * removed unnoticable animation to improve performance * removed useless attribute * kotlin extensions are stonks * reference accent color variable instead of getting preference value every time * updated old stuff * removed useless check inside 'when' statement * optimised lifecycleOwner getter * property access syntax goes brrrrr * small accent update * added progress indicators to download dialogs * fixed changelog not appearing when pressing card in about menu * bumped up kotlin to 1.4.31 * fixed #437 * fixed #435 * fixed viewpager navigation on RTL layout * added a check for session id in root installer * updated strings * always notify about miui error * only run 1 animation at once * require external storage * sorted strings xml * improved layouts to look more close to each other * bumped up dependencies * updated version * fixed crash on manager update * New Crowdin updates (#489) * New translations strings.xml (Romanian) * New translations strings.xml (Bengali) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (Swedish) * New translations strings.xml (Turkish) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Marathi) * New translations strings.xml (Portuguese) * New translations strings.xml (Thai) * New translations strings.xml (Croatian) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Russian) * New translations strings.xml (Polish) * New translations strings.xml (Arabic) * New translations strings.xml (Spanish) * New translations strings.xml (Slovak) * New translations strings.xml (Malayalam) * New translations strings.xml (Japanese) * New translations strings.xml (Estonian) * New translations strings.xml (French) * New translations strings.xml (Kurdish) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Hungarian) * New translations strings.xml (Finnish) * New translations strings.xml (Korean) * New translations strings.xml (Afrikaans) * New translations strings.xml (Punjabi) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Hebrew) * New translations strings.xml (Italian) * New translations strings.xml (Georgian) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi, Pakistan) * Added button info on long press * preview adjustments to navigation xml * moved splash screen activity to parent dir * fixed buttontag getter * updated readme * fixed readme * Added build section to readme * Updated build instructions * prevent stacktrace from obfuscating * Added an option to switch between internal and external storage * removed warning for music vanced * added back a fix for split installer * added -r option for root music installer * Revert "prevent stacktrace from obfuscating" This reverts commit 2d30eb60af11f2d854c826953c025702c2e161ce. * Revert "added back a fix for split installer" This reverts commit aeaa0d445ec7cd6d2c318bf3f3751f8759d89801. * Revert "Added an option to switch between internal and external storage" This reverts commit 98c4b88961d14f36acf908bcee2376c1f79af86e. * reverted all storage-related commits * prevent stacktrace ovfuscation * updated readme * updated base url * use storage perms only on android 5 * cleanup * removed unused event file * fixed dark overlay not disappearing after bottom dialog has been dismissed * removed unecessary path from file_provider * fixed lint for core-ui * improved layout flexibility * updated icons in expandable app item * removed path prefix for api urls * removed microg bug dialog * fixed version code comparison * New translations strings.xml (Romanian) * New translations strings.xml (Croatian) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Bengali) * New translations strings.xml (Marathi) * New translations strings.xml (Thai) * New translations strings.xml (Estonian) * New translations strings.xml (Swedish) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Malayalam) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Punjabi, Pakistan) * New translations strings.xml (Turkish) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (French) * New translations strings.xml (Hebrew) * New translations strings.xml (Spanish) * New translations strings.xml (Afrikaans) * New translations strings.xml (Arabic) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Finnish) * New translations strings.xml (Hungarian) * New translations strings.xml (Slovak) * New translations strings.xml (Italian) * New translations strings.xml (Japanese) * New translations strings.xml (Georgian) * New translations strings.xml (Korean) * New translations strings.xml (Kurdish) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi) * New translations strings.xml (Polish) * New translations strings.xml (Portuguese) * New translations strings.xml (Russian) * New translations strings.xml (Lithuanian) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Arabic) * New translations strings.xml (Slovak) * New translations strings.xml (Korean) * New translations strings.xml (Polish) * New Crowdin updates (#515) * New translations strings.xml (Arabic) * New translations strings.xml (Greek) * New translations strings.xml (Dutch) * New translations strings.xml (Turkish) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Indonesian) Co-authored-by: X1nto <burtkni@yandex.ru> Co-authored-by: Tornike Khintibidze <48173186+X1nto@users.noreply.github.com>
2021-04-27 12:16:14 +00:00
adapter = ExpandableAppListAdapter(requireActivity(), viewModel /*, tooltip*/)
2020-10-31 19:45:39 +00:00
setHasFixedSize(true)
}
recyclerSponsors.apply {
val lm = FlexboxLayoutManager(requireActivity())
lm.justifyContent = JustifyContent.SPACE_EVENLY
layoutManager = lm
setHasFixedSize(true)
2020-11-23 20:33:24 +00:00
adapter = SponsorAdapter(requireActivity(), viewModel)
2020-10-31 19:45:39 +00:00
}
recyclerLinks.apply {
val lm = FlexboxLayoutManager(requireActivity())
lm.justifyContent = JustifyContent.SPACE_EVENLY
layoutManager = lm
setHasFixedSize(true)
2020-11-23 20:33:24 +00:00
adapter = LinkAdapter(requireActivity(), viewModel)
2020-10-31 19:45:39 +00:00
}
2020-07-16 21:05:31 +00:00
}
2020-11-14 21:48:47 +00:00
}
2020-11-14 21:48:47 +00:00
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflateWithCrowdin(R.menu.toolbar_menu, menu, resources)
super.onCreateOptionsMenu(menu, inflater)
2020-03-18 18:10:54 +00:00
}
2020-11-14 21:48:47 +00:00
override fun onPause() {
super.onPause()
localBroadcastManager.unregisterReceiver(broadcastReceiver)
}
2020-08-04 13:49:46 +00:00
override fun onResume() {
super.onResume()
registerReceivers()
}
private val broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
when (intent.action) {
Vanced Manager 2.6.0 (#516) * updated app card UI * bug fixes * fixed grammar * removed unnoticable animation to improve performance * removed useless attribute * kotlin extensions are stonks * reference accent color variable instead of getting preference value every time * updated old stuff * removed useless check inside 'when' statement * optimised lifecycleOwner getter * property access syntax goes brrrrr * small accent update * added progress indicators to download dialogs * fixed changelog not appearing when pressing card in about menu * bumped up kotlin to 1.4.31 * fixed #437 * fixed #435 * fixed viewpager navigation on RTL layout * added a check for session id in root installer * updated strings * always notify about miui error * only run 1 animation at once * require external storage * sorted strings xml * improved layouts to look more close to each other * bumped up dependencies * updated version * fixed crash on manager update * New Crowdin updates (#489) * New translations strings.xml (Romanian) * New translations strings.xml (Bengali) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (Swedish) * New translations strings.xml (Turkish) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Marathi) * New translations strings.xml (Portuguese) * New translations strings.xml (Thai) * New translations strings.xml (Croatian) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Russian) * New translations strings.xml (Polish) * New translations strings.xml (Arabic) * New translations strings.xml (Spanish) * New translations strings.xml (Slovak) * New translations strings.xml (Malayalam) * New translations strings.xml (Japanese) * New translations strings.xml (Estonian) * New translations strings.xml (French) * New translations strings.xml (Kurdish) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Hungarian) * New translations strings.xml (Finnish) * New translations strings.xml (Korean) * New translations strings.xml (Afrikaans) * New translations strings.xml (Punjabi) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Hebrew) * New translations strings.xml (Italian) * New translations strings.xml (Georgian) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi, Pakistan) * Added button info on long press * preview adjustments to navigation xml * moved splash screen activity to parent dir * fixed buttontag getter * updated readme * fixed readme * Added build section to readme * Updated build instructions * prevent stacktrace from obfuscating * Added an option to switch between internal and external storage * removed warning for music vanced * added back a fix for split installer * added -r option for root music installer * Revert "prevent stacktrace from obfuscating" This reverts commit 2d30eb60af11f2d854c826953c025702c2e161ce. * Revert "added back a fix for split installer" This reverts commit aeaa0d445ec7cd6d2c318bf3f3751f8759d89801. * Revert "Added an option to switch between internal and external storage" This reverts commit 98c4b88961d14f36acf908bcee2376c1f79af86e. * reverted all storage-related commits * prevent stacktrace ovfuscation * updated readme * updated base url * use storage perms only on android 5 * cleanup * removed unused event file * fixed dark overlay not disappearing after bottom dialog has been dismissed * removed unecessary path from file_provider * fixed lint for core-ui * improved layout flexibility * updated icons in expandable app item * removed path prefix for api urls * removed microg bug dialog * fixed version code comparison * New translations strings.xml (Romanian) * New translations strings.xml (Croatian) * New translations strings.xml (Ukrainian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Vietnamese) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Indonesian) * New translations strings.xml (Tamil) * New translations strings.xml (Bengali) * New translations strings.xml (Marathi) * New translations strings.xml (Thai) * New translations strings.xml (Estonian) * New translations strings.xml (Swedish) * New translations strings.xml (Azerbaijani) * New translations strings.xml (Hindi) * New translations strings.xml (Filipino) * New translations strings.xml (Malayalam) * New translations strings.xml (Sinhala) * New translations strings.xml (Bengali, India) * New translations strings.xml (Kurmanji (Kurdish)) * New translations strings.xml (Sorani (Kurdish)) * New translations strings.xml (Pashto) * New translations strings.xml (Somali) * New translations strings.xml (Punjabi, Pakistan) * New translations strings.xml (Turkish) * New translations strings.xml (Serbian (Cyrillic)) * New translations strings.xml (French) * New translations strings.xml (Hebrew) * New translations strings.xml (Spanish) * New translations strings.xml (Afrikaans) * New translations strings.xml (Arabic) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Greek) * New translations strings.xml (Finnish) * New translations strings.xml (Hungarian) * New translations strings.xml (Slovak) * New translations strings.xml (Italian) * New translations strings.xml (Japanese) * New translations strings.xml (Georgian) * New translations strings.xml (Korean) * New translations strings.xml (Kurdish) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Punjabi) * New translations strings.xml (Polish) * New translations strings.xml (Portuguese) * New translations strings.xml (Russian) * New translations strings.xml (Lithuanian) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Arabic) * New translations strings.xml (Slovak) * New translations strings.xml (Korean) * New translations strings.xml (Polish) * New Crowdin updates (#515) * New translations strings.xml (Arabic) * New translations strings.xml (Greek) * New translations strings.xml (Dutch) * New translations strings.xml (Turkish) * New translations strings.xml (Chinese Traditional) * New translations strings.xml (Indonesian) Co-authored-by: X1nto <burtkni@yandex.ru> Co-authored-by: Tornike Khintibidze <48173186+X1nto@users.noreply.github.com>
2021-04-27 12:16:14 +00:00
INSTALL_FAILED -> installAlertBuilder(
intent.getStringExtra("errorMsg").toString(),
intent.getStringExtra("fullErrorMsg"),
requireActivity()
)
2020-09-17 10:13:16 +00:00
REFRESH_HOME -> viewModel.fetchData()
}
}
}
private fun registerReceivers() {
2020-06-23 13:47:20 +00:00
val intentFilter = IntentFilter()
2020-08-06 18:37:43 +00:00
intentFilter.addAction(INSTALL_FAILED)
intentFilter.addAction(REFRESH_HOME)
localBroadcastManager.registerReceiver(broadcastReceiver, intentFilter)
}
2020-03-18 18:10:54 +00:00
}