1
0
Fork 0
mirror of https://github.com/Corewala/Buran synced 2024-12-22 07:42:43 +00:00

Deleted unused link popup

This commit is contained in:
Corewala 2022-01-08 17:16:37 -05:00
parent a4ecd82004
commit b4f963bf93
2 changed files with 0 additions and 41 deletions

View file

@ -1,34 +0,0 @@
package corewala.buran.ui.modals_menus
import android.view.MenuInflater
import android.view.View
import androidx.appcompat.widget.PopupMenu
import corewala.buran.R
import corewala.endsWithImage
import corewala.isWeb
import java.net.URI
object LinkPopup {
fun show(view: View?, uri: URI, onMenuOption: (menuId: Int) -> Unit){
if(view != null) {
val popup = PopupMenu(view.context, view)
val inflater: MenuInflater = popup.menuInflater
val uriStr = uri.toString()
when {
uriStr.endsWithImage() && !uriStr.isWeb() -> inflater.inflate(R.menu.image_link_menu, popup.menu)
else -> inflater.inflate(R.menu.link_menu, popup.menu)
}
popup.setOnMenuItemClickListener { menuItem ->
onMenuOption(menuItem.itemId)
true
}
popup.show()
}
}
}

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/link_menu_load_image"
android:title="@string/load_image" />
<item android:id="@+id/link_menu_copy"
android:title="@string/copy_address" />
</menu>