Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Remove previous version of item detail menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Elise Richards committed Nov 18, 2019
1 parent cf80333 commit 74ede49
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ interface ItemDetailView {
fun showKebabMenu()
fun hideKebabMenu()
fun updateItem(item: ItemDetailViewModel)
fun showPopup()
fun showPopupWindow()
fun showToastNotification(@StringRes strId: Int)
fun handleNetworkError(networkErrorVisibility: Boolean)
Expand Down Expand Up @@ -171,7 +170,6 @@ class ItemDetailPresenter(

view.kebabMenuClicks
.subscribe {
// view.showPopup()
view.showPopupWindow()
}
.addTo(compositeDisposable)
Expand Down
30 changes: 0 additions & 30 deletions app/src/main/java/mozilla/lockbox/view/ItemDetailFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,36 +104,6 @@ class ItemDetailFragment : BackableFragment(), ItemDetailView {
updatePasswordVisibility(value)
}

override fun showPopup() {
val wrapper = ContextThemeWrapper(context, R.style.PopupKebabMenu)
val popupMenu = PopupMenu(
wrapper, // context
this.kebabMenuButton, // anchor
Gravity.END, // gravity
R.attr.popupWindowStyle, // styleAttr
R.style.PopupKebabMenu // styleRes
)
popupMenu.setOnMenuItemClickListener { item ->
when (item?.itemId) {
R.id.edit -> {
(editClicks as PublishSubject).onNext(Unit)
true
}
R.id.delete -> {
(deleteClicks as PublishSubject).onNext(Unit)
true
}
else -> false
}
}

popupMenu.inflate(R.menu.item_detail_menu)

val builder = popupMenu.menu as MenuBuilder
builder.setOptionalIconsVisible(true)
popupMenu.show()
}

@SuppressLint("InflateParams")
override fun showPopupWindow() {
val popupView = LayoutInflater.from(context).inflate(R.layout.popup_menu, null)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/popup_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_detail_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="120dp"
Expand Down
28 changes: 0 additions & 28 deletions app/src/main/res/menu/item_detail_menu.xml

This file was deleted.

0 comments on commit 74ede49

Please sign in to comment.