mirror of
https://github.com/Corewala/Buran
synced 2025-01-03 05:34:28 +00:00
Deleted unused link popup
This commit is contained in:
parent
a4ecd82004
commit
b4f963bf93
2 changed files with 0 additions and 41 deletions
|
@ -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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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>
|
|
Loading…
Reference in a new issue