コンテキストメニューに「アカウント/管理者WebUIで開く」を追加

This commit is contained in:
tateisu 2019-01-11 15:16:47 +09:00
parent 0ba187e545
commit 826084b86f
4 changed files with 24 additions and 2 deletions

View File

@ -117,7 +117,7 @@ internal class DlgContextMenu(
val btnAroundLTL : View = viewRoot.findViewById(R.id.btnAroundLTL)
val btnAroundFTL : View = viewRoot.findViewById(R.id.btnAroundFTL)
val btnCopyAccountId : Button = viewRoot.findViewById(R.id.btnCopyAccountId)
val btnOpenAccountInAdminWebUi :Button = viewRoot.findViewById(R.id.btnOpenAccountInAdminWebUi)
val llLinks : LinearLayout = viewRoot.findViewById(R.id.llLinks)
btnAroundAccountTL.setOnClickListener(this)
@ -162,6 +162,7 @@ internal class DlgContextMenu(
btnDomainBlock.setOnClickListener(this)
btnEndorse.setOnClickListener(this)
btnCopyAccountId.setOnClickListener(this)
btnOpenAccountInAdminWebUi.setOnClickListener(this)
viewRoot.findViewById<View>(R.id.btnQuoteUrlStatus).setOnClickListener(this)
viewRoot.findViewById<View>(R.id.btnQuoteUrlAccount).setOnClickListener(this)
@ -355,6 +356,7 @@ internal class DlgContextMenu(
btnInstanceInformation.visibility = View.GONE
btnDomainBlock.visibility = View.GONE
btnCopyAccountId.visibility = View.GONE
btnOpenAccountInAdminWebUi.visibility = View.GONE
} else {
val who_host = who.host
btnInstanceInformation.visibility = View.VISIBLE
@ -371,6 +373,9 @@ internal class DlgContextMenu(
btnCopyAccountId.visibility = View.VISIBLE
btnCopyAccountId.text = activity.getString(R.string.copy_account_id, who.id.toString() )
vg( btnOpenAccountInAdminWebUi , ! access_info.isPseudo)
}
viewRoot.findViewById<View>(R.id.btnAccountText).setOnClickListener(this)
@ -755,6 +760,8 @@ internal class DlgContextMenu(
)
R.id.btnCopyAccountId -> who.id.toString().copyToClipboard(activity)
R.id.btnOpenAccountInAdminWebUi -> App1.openBrowser(activity,"https://${access_info.host}/admin/accounts/${who.id}")
}
}

View File

@ -772,7 +772,20 @@
android:textAllCaps="false"
/>
<Button
android:id="@+id/btnOpenAccountInAdminWebUi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/btn_bg_transparent"
android:gravity="start|center_vertical"
android:minHeight="32dp"
android:paddingBottom="4dp"
android:paddingEnd="8dp"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:text="@string/open_in_admin_ui"
android:textAllCaps="false"
/>
<Button
android:id="@+id/btnAccountQrCode"

View File

@ -847,5 +847,6 @@
<string name="scheduled_status_requires_mastodon_2_7_0">予約投稿はマストドン2.7.0以降で使えます</string>
<string name="move_notifications_quick_filter_to_column_setting">通知カラムのクイックフィルタをカラム設定内部に表示する(アプリ再起動が必要)</string>
<string name="copy_account_id">アカウントID %1$s をコピー</string>
<string name="open_in_admin_ui">管理者WebUIで開く</string>
</resources>

View File

@ -868,5 +868,6 @@
<string name="scheduled_status_requires_mastodon_2_7_0">Scheduled status requires Mastodon 2.7.0 or later.</string>
<string name="move_notifications_quick_filter_to_column_setting">Show notifications quick filter in column setting (app restart required)</string>
<string name="copy_account_id">Copy account ID %1$s</string>
<string name="open_in_admin_ui">Open in admin web UI</string>
</resources>