Skip to content

Commit adc5544

Browse files
authored
Remove DaxExpandableMenu (#6954)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1207908166761516/task/1211670072079710?focus=true ### Description Removed the expandable layout component from the design system as it's no longer needed. This includes removing the `DaxExpandableMenu`, `DaxExpandableMenuItem`, and related files, as well as removing the component from the theme preview. ### Steps to test this PR _Verify component removal_ - [x] Check that the expandable layout component is no longer available in the theme preview - [x] Verify that the design system builds correctly without the removed components - [x] Ensure no references to the removed components remain in the codebase ### UI changes N/A
1 parent cfa8487 commit adc5544

15 files changed

+1
-844
lines changed

design-system/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/Component.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package com.duckduckgo.common.ui.themepreview.ui.component
1919
enum class Component {
2020
BUTTON,
2121
FAB,
22-
EXPANDABLE_LAYOUT,
2322
CARD,
2423
TOP_APP_BAR,
2524
CHIP,

design-system/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/ComponentViewHolder.kt

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ import android.view.LayoutInflater
2222
import android.view.View
2323
import android.view.ViewGroup
2424
import android.widget.FrameLayout
25-
import android.widget.LinearLayout
2625
import androidx.recyclerview.widget.RecyclerView
2726
import com.duckduckgo.common.ui.view.MessageCta
2827
import com.duckduckgo.common.ui.view.MessageCta.Message
2928
import com.duckduckgo.common.ui.view.MessageCta.MessageType.REMOTE_PROMO_MESSAGE
30-
import com.duckduckgo.common.ui.view.button.DaxButtonSecondary
31-
import com.duckduckgo.common.ui.view.expand.DaxExpandableMenuItem
32-
import com.duckduckgo.common.ui.view.expand.daxExpandableMenuItem
3329
import com.duckduckgo.common.ui.view.listitem.OneLineListItem
3430
import com.duckduckgo.common.ui.view.listitem.SectionHeaderListItem
3531
import com.duckduckgo.common.ui.view.listitem.TwoLineListItem
@@ -351,44 +347,6 @@ sealed class ComponentViewHolder(val view: View) : RecyclerView.ViewHolder(view)
351347
}
352348
}
353349

354-
class ExpandableComponentViewHolder(parent: ViewGroup) : ComponentViewHolder(inflate(parent, R.layout.component_expandable_layout)) {
355-
override fun bind(component: Component) {
356-
view.findViewById<DaxExpandableMenuItem>(R.id.expandable1).apply {
357-
setPrimaryButtonClickListener {
358-
Snackbar.make(this, component.name, Snackbar.LENGTH_SHORT).show()
359-
}
360-
}
361-
view.findViewById<DaxExpandableMenuItem>(R.id.expandable3).customExpandedLayout?.apply {
362-
findViewById<DaxButtonSecondary>(R.id.daxExpandableMenuItemSecondaryButton).apply {
363-
setOnClickListener {
364-
Snackbar.make(this, component.name, Snackbar.LENGTH_SHORT).show()
365-
}
366-
}
367-
}
368-
view.findViewById<DaxExpandableMenuItem>(R.id.expandable4).apply {
369-
LayoutInflater.from(context).inflate(R.layout.view_expandable_menu_item_expanded_layout_demo, this, false).apply {
370-
findViewById<DaxButtonSecondary>(R.id.daxExpandableMenuItemSecondaryButton).apply {
371-
setOnClickListener {
372-
Snackbar.make(this, component.name, Snackbar.LENGTH_SHORT).show()
373-
}
374-
}
375-
setExpandableMenuCustomLayout(this)
376-
}
377-
}
378-
379-
view.findViewById<LinearLayout>(R.id.expandableItemRootLayout).apply {
380-
val expandableMenuItem = context.daxExpandableMenuItem {
381-
setPrimaryText("This is a Menu Item")
382-
setSecondaryText("Created using DSL")
383-
setPrimaryButtonClickListener {
384-
Snackbar.make(rootView, component.name, Snackbar.LENGTH_SHORT).show()
385-
}.build()
386-
}
387-
addView(expandableMenuItem)
388-
}
389-
}
390-
}
391-
392350
class SettingsListItemComponentViewHolder(parent: ViewGroup) :
393351
ComponentViewHolder(inflate(parent, R.layout.component_settings))
394352

@@ -415,7 +373,6 @@ sealed class ComponentViewHolder(val view: View) : RecyclerView.ViewHolder(view)
415373
Component.TWO_LINE_LIST_ITEM -> TwoLineItemComponentViewHolder(parent)
416374
Component.SECTION_DIVIDER -> DividerComponentViewHolder(parent)
417375
Component.CARD -> CardComponentViewHolder(parent)
418-
Component.EXPANDABLE_LAYOUT -> ExpandableComponentViewHolder(parent)
419376
Component.SETTINGS_LIST_ITEM -> SettingsListItemComponentViewHolder(parent)
420377
else -> {
421378
TODO()

design-system/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/cards/ComponentLayoutsFragment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
package com.duckduckgo.common.ui.themepreview.ui.component.cards
1818

1919
import com.duckduckgo.common.ui.themepreview.ui.component.Component
20-
import com.duckduckgo.common.ui.themepreview.ui.component.Component.EXPANDABLE_LAYOUT
2120
import com.duckduckgo.common.ui.themepreview.ui.component.ComponentFragment
2221

2322
class ComponentLayoutsFragment : ComponentFragment() {
2423
override fun getComponents(): List<Component> {
25-
return listOf(EXPANDABLE_LAYOUT, Component.CARD)
24+
return listOf(Component.CARD)
2625
}
2726
}

design-system/src/main/java/com/duckduckgo/common/ui/view/expand/DaxExpandableMenu.kt

Lines changed: 0 additions & 69 deletions
This file was deleted.

design-system/src/main/java/com/duckduckgo/common/ui/view/expand/DaxExpandableMenuDsl.kt

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)