Get build working again after merge

pull/257/head
Adam Novak 3 years ago
parent 12bbfa9c4c
commit a233c796fd

@ -34,7 +34,7 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import mozilla.components.feature.addons.Addon import mozilla.components.feature.addons.Addon
import mozilla.components.feature.addons.R import mozilla.components.feature.addons.R
import mozilla.components.feature.addons.ui.translatedName import mozilla.components.feature.addons.ui.translateName
import mozilla.components.support.base.log.logger.Logger import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.ktx.android.content.appName import mozilla.components.support.ktx.android.content.appName
import mozilla.components.support.ktx.android.content.res.resolveAttribute import mozilla.components.support.ktx.android.content.res.resolveAttribute
@ -158,7 +158,7 @@ class PagedAddonInstallationDialogFragment : AppCompatDialogFragment() {
rootView.findViewById<TextView>(R.id.title).text = rootView.findViewById<TextView>(R.id.title).text =
requireContext().getString( requireContext().getString(
R.string.mozac_feature_addons_installed_dialog_title, R.string.mozac_feature_addons_installed_dialog_title,
addon.translatedName, addon.translateName(requireContext()),
requireContext().appName requireContext().appName
) )

@ -35,8 +35,8 @@ import mozilla.components.feature.addons.ui.CustomViewHolder
import mozilla.components.feature.addons.ui.CustomViewHolder.AddonViewHolder import mozilla.components.feature.addons.ui.CustomViewHolder.AddonViewHolder
import mozilla.components.feature.addons.ui.CustomViewHolder.SectionViewHolder import mozilla.components.feature.addons.ui.CustomViewHolder.SectionViewHolder
import mozilla.components.feature.addons.ui.CustomViewHolder.UnsupportedSectionViewHolder import mozilla.components.feature.addons.ui.CustomViewHolder.UnsupportedSectionViewHolder
import mozilla.components.feature.addons.ui.translatedName import mozilla.components.feature.addons.ui.translateName
import mozilla.components.feature.addons.ui.translatedSummary import mozilla.components.feature.addons.ui.translateSummary
import mozilla.components.support.base.log.logger.Logger import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.ktx.android.content.res.resolveAttribute import mozilla.components.support.ktx.android.content.res.resolveAttribute
import java.io.IOException import java.io.IOException
@ -96,7 +96,8 @@ class PagedAddonsManagerAdapter(
val inflater = LayoutInflater.from(context) val inflater = LayoutInflater.from(context)
val view = inflater.inflate(R.layout.mozac_feature_addons_section_item, parent, false) val view = inflater.inflate(R.layout.mozac_feature_addons_section_item, parent, false)
val titleView = view.findViewById<TextView>(R.id.title) val titleView = view.findViewById<TextView>(R.id.title)
return SectionViewHolder(view, titleView) val divider = view.findViewById<View>(R.id.divider)
return SectionViewHolder(view, titleView, divider)
} }
private fun createUnsupportedSectionViewHolder(parent: ViewGroup): CustomViewHolder { private fun createUnsupportedSectionViewHolder(parent: ViewGroup): CustomViewHolder {
@ -210,13 +211,13 @@ class PagedAddonsManagerAdapter(
holder.titleView.text = holder.titleView.text =
if (addon.translatableName.isNotEmpty()) { if (addon.translatableName.isNotEmpty()) {
addon.translatedName addon.translateName(context)
} else { } else {
addon.id addon.id
} }
if (addon.translatableSummary.isNotEmpty()) { if (addon.translatableSummary.isNotEmpty()) {
holder.summaryView.text = addon.translatedSummary holder.summaryView.text = addon.translateSummary(context)
} else { } else {
holder.summaryView.visibility = View.GONE holder.summaryView.visibility = View.GONE
} }

@ -84,7 +84,7 @@ class Components(private val context: Context) {
PagedAddonCollectionProvider( PagedAddonCollectionProvider(
context, context,
core.client, core.client,
collectionUser = context.settings().overrideAmoUser, collectionAccount = context.settings().overrideAmoUser,
collectionName = context.settings().overrideAmoCollection collectionName = context.settings().overrideAmoCollection
) )
} }

@ -181,7 +181,6 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), UserInteractionHandler
} }
} }
@Suppress("LongMethod")
@OptIn(ExperimentalCoroutinesApi::class) @OptIn(ExperimentalCoroutinesApi::class)
@Suppress("LongMethod") @Suppress("LongMethod")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

@ -25,8 +25,19 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import kotlinx.android.extensions.LayoutContainer import kotlinx.android.extensions.LayoutContainer
import kotlinx.android.synthetic.main.component_tabstray.view.* import kotlinx.android.synthetic.main.component_tabs_screen_top.view.exit_tabs_screen
import kotlinx.android.synthetic.main.component_tabstray_fab.view.* import kotlinx.android.synthetic.main.component_tabstray_bottom.view.exit_multi_select
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.handle
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.infoBanner
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.multiselect_title
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.tab_layout
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.tab_tray_empty_view
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.tab_tray_new_tab
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.tab_tray_overflow
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.tab_wrapper
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.tabsTray
import kotlinx.android.synthetic.main.component_tabstray_bottom.view.topBar
import kotlinx.android.synthetic.main.component_tabstray_fab_bottom.view.new_tab_button
import kotlinx.android.synthetic.main.tabs_tray_tab_counter.* import kotlinx.android.synthetic.main.tabs_tray_tab_counter.*
import kotlinx.android.synthetic.main.tabstray_multiselect_items.view.* import kotlinx.android.synthetic.main.tabstray_multiselect_items.view.*
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
@ -491,6 +502,9 @@ class TabTrayView(
} else { } else {
(behavior as BottomSheetBehavior).state = BottomSheetBehavior.STATE_EXPANDED (behavior as BottomSheetBehavior).state = BottomSheetBehavior.STATE_EXPANDED
} }
}
}
/** /**
* Updates the bottom sheet height based on the number tabs or screen orientation. * Updates the bottom sheet height based on the number tabs or screen orientation.
* Show the bottom sheet fully expanded if it is in landscape mode or the number of * Show the bottom sheet fully expanded if it is in landscape mode or the number of
@ -498,9 +512,17 @@ class TabTrayView(
*/ */
fun updateBottomSheetBehavior() { fun updateBottomSheetBehavior() {
if (isInLandscape() || getTabsNumberInAnyMode() >= getTabsNumberForExpandingTray()) { if (isInLandscape() || getTabsNumberInAnyMode() >= getTabsNumberForExpandingTray()) {
behavior.state = BottomSheetBehavior.STATE_EXPANDED if (useTopTabsTray) {
(behavior as TopSheetBehavior).state = TopSheetBehavior.STATE_EXPANDED
} else {
(behavior as BottomSheetBehavior).state = BottomSheetBehavior.STATE_EXPANDED
}
} else { } else {
behavior.state = BottomSheetBehavior.STATE_COLLAPSED if (useTopTabsTray) {
(behavior as TopSheetBehavior).state = TopSheetBehavior.STATE_COLLAPSED
} else {
(behavior as BottomSheetBehavior).state = BottomSheetBehavior.STATE_COLLAPSED
}
} }
} }
@ -535,7 +557,7 @@ class TabTrayView(
var mode: Mode = Mode.Normal var mode: Mode = Mode.Normal
private set private set
private fun setupGridTabView() { private fun setupGridTabView() {
view.tabsTray.apply { view.tabsTray.apply {
val gridLayoutManager = val gridLayoutManager =
@ -851,12 +873,6 @@ class TabTrayView(
fun scrollToSelectedBrowserTab(selectedTabId: String? = null) { fun scrollToSelectedBrowserTab(selectedTabId: String? = null) {
view.tabsTray.apply { view.tabsTray.apply {
val tabs = if (isPrivateModeSelected) {
view.context.components.core.store.state.privateTabs
} else {
view.context.components.core.store.state.normalTabs
}
val selectedBrowserTabIndex = getSelectedBrowserTabViewIndex(selectedTabId) val selectedBrowserTabIndex = getSelectedBrowserTabViewIndex(selectedTabId)
val recyclerViewIndex = if (reverseTabOrderInTabsTray) { val recyclerViewIndex = if (reverseTabOrderInTabsTray) {
@ -912,19 +928,3 @@ class TabTrayView(
const val GRID_ITEM_PARENT_PADDING = 8 const val GRID_ITEM_PARENT_PADDING = 8
} }
} }
class TabTrayItemMenu(
private val context: Context,
private val shouldShowSaveToCollection: () -> Boolean,
private val hasOpenTabs: () -> Boolean,
private val onItemTapped: (Item) -> Unit = {}
) {
sealed class Item {
object ShareAllTabs : Item()
object OpenTabSettings : Item()
object SaveToCollection : Item()
object CloseAllTabs : Item()
object OpenRecentlyClosed : Item()
}
}

@ -611,7 +611,7 @@
<style name="TopSheetModal" parent="Widget.Design.BottomSheet.Modal"> <style name="TopSheetModal" parent="Widget.Design.BottomSheet.Modal">
<item name="shapeAppearance">@style/TopSheetShapeAppearance</item> <item name="shapeAppearance">@style/TopSheetShapeAppearance</item>
<item name="behavior_fitToContents">false</item> <item name="behavior_fitToContents">false</item>
<item name="behavior_expandedOffset">80</item> <item name="behavior_expandedOffset">80dp</item>
<item name="behavior_skipCollapsed">false</item> <item name="behavior_skipCollapsed">false</item>
<item name="behavior_halfExpandedRatio">0.4</item> <item name="behavior_halfExpandedRatio">0.4</item>
</style> </style>

Loading…
Cancel
Save