package jp.juggler.subwaytooter import android.annotation.SuppressLint import android.app.Dialog import android.graphics.PorterDuff import android.support.v7.app.AlertDialog import android.view.View import android.view.WindowManager import android.widget.Button import android.widget.CheckBox import android.widget.ImageView import android.widget.TextView import java.util.ArrayList import jp.juggler.subwaytooter.action.Action_Account import jp.juggler.subwaytooter.action.Action_App import jp.juggler.subwaytooter.action.Action_Follow import jp.juggler.subwaytooter.action.Action_Instance import jp.juggler.subwaytooter.action.Action_Notification import jp.juggler.subwaytooter.action.Action_Toot import jp.juggler.subwaytooter.action.Action_User import jp.juggler.subwaytooter.api.entity.TootAccountRef import jp.juggler.subwaytooter.api.entity.TootNotification import jp.juggler.subwaytooter.api.entity.TootStatus import jp.juggler.subwaytooter.dialog.DlgListMember import jp.juggler.subwaytooter.dialog.DlgQRCode import jp.juggler.subwaytooter.table.FavMute import jp.juggler.subwaytooter.table.SavedAccount import jp.juggler.subwaytooter.table.UserRelation import jp.juggler.subwaytooter.util.LogCategory import jp.juggler.subwaytooter.util.showToast @SuppressLint("InflateParams") internal class DlgContextMenu( val activity : ActMain, private val column : Column, private val whoRef : TootAccountRef?, private val status : TootStatus?, private val notification : TootNotification? ) : View.OnClickListener, View.OnLongClickListener { companion object { private val log = LogCategory("DlgContextMenu") } private val access_info : SavedAccount private val relation : UserRelation private val dialog : Dialog init { this.access_info = column.access_info val column_type = column.column_type val who = whoRef?.get() val status = this.status this.relation = UserRelation.load(access_info.db_id, who?.id ?: - 1) val viewRoot = activity.layoutInflater.inflate(R.layout.dlg_context_menu, null, false) this.dialog = Dialog(activity) dialog.setContentView(viewRoot) dialog.setCancelable(true) dialog.setCanceledOnTouchOutside(true) val llStatus = viewRoot.findViewById(R.id.llStatus) val btnStatusWebPage = viewRoot.findViewById(R.id.btnStatusWebPage) val btnText = viewRoot.findViewById(R.id.btnText) val btnFavouriteAnotherAccount = viewRoot.findViewById(R.id.btnFavouriteAnotherAccount) val btnBoostAnotherAccount = viewRoot.findViewById(R.id.btnBoostAnotherAccount) val btnReplyAnotherAccount = viewRoot.findViewById(R.id.btnReplyAnotherAccount) val btnDelete = viewRoot.findViewById(R.id.btnDelete) val btnRedraft = viewRoot.findViewById(R.id.btnRedraft) val btnReport = viewRoot.findViewById(R.id.btnReport) val btnMuteApp = viewRoot.findViewById