1
0
Fork 0

No issue: Update AC version

master
Sawyer Blatz 2020-07-10 11:27:28 -07:00 committed by Emily Kager
parent da87727c61
commit bab0f9d95b
2 changed files with 23 additions and 5 deletions

View File

@ -45,6 +45,8 @@ import mozilla.components.feature.search.SearchAdapter
import mozilla.components.service.fxa.sync.SyncReason
import mozilla.components.support.base.feature.UserInteractionHandler
import mozilla.components.support.ktx.android.arch.lifecycle.addObservers
import mozilla.components.support.ktx.android.content.call
import mozilla.components.support.ktx.android.content.email
import mozilla.components.support.ktx.android.content.share
import mozilla.components.support.ktx.kotlin.isUrl
import mozilla.components.support.ktx.kotlin.toNormalizedUrl
@ -294,10 +296,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
EngineView::class.java.name -> components.core.engine.createView(context, attrs).apply {
selectionActionDelegate = DefaultSelectionActionDelegate(
getSearchAdapter(components.core.store),
resources = context.resources
) {
share(it)
}
resources = context.resources,
shareTextClicked = { share(it) },
emailTextClicked = { email(it) },
callTextClicked = { call(it) },
actionSorter = ::actionSorter
)
}.asView()
TabsTray::class.java.name -> {
val layout = LinearLayoutManager(context).apply {
@ -313,6 +317,20 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
else -> super.onCreateView(parent, name, context, attrs)
}
private fun actionSorter(actions: Array<String>) : Array<String> {
val order = hashMapOf<String, Int>()
order["org.mozilla.geckoview.COPY"] = 0
order["CUSTOM_CONTEXT_MENU_SEARCH"] = 1
order["org.mozilla.geckoview.SELECT_ALL"] = 2
order["CUSTOM_CONTEXT_MENU_SHARE"] = 3
return actions.sortedBy { actionName ->
// Sort the actions in our preferred order, putting "other" actions unsorted at the end
order[actionName] ?: actions.size
}.toTypedArray()
}
final override fun onBackPressed() {
supportFragmentManager.primaryNavigationFragment?.childFragmentManager?.fragments?.forEach {
if (it is UserInteractionHandler && it.onBackPressed()) {

View File

@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
object AndroidComponents {
const val VERSION = "50.0.20200709130100"
const val VERSION = "50.0.20200710130140"
}