mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-25 05:53:05 +00:00
Add a PC menu header to show PC status
This commit is contained in:
parent
ab0531aa76
commit
f26b384697
@ -317,6 +317,22 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
|
||||
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
|
||||
ComputerObject computer = (ComputerObject) pcGridAdapter.getItem(info.position);
|
||||
|
||||
// Add a header with PC status details
|
||||
menu.clearHeader();
|
||||
switch (computer.details.state)
|
||||
{
|
||||
case ONLINE:
|
||||
menu.setHeaderTitle(R.string.pcview_menu_header_online);
|
||||
break;
|
||||
case OFFLINE:
|
||||
menu.setHeaderIcon(R.drawable.ic_pc_offline);
|
||||
menu.setHeaderTitle(R.string.pcview_menu_header_offline);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
menu.setHeaderTitle(R.string.pcview_menu_header_unknown);
|
||||
break;
|
||||
}
|
||||
|
||||
// Inflate the context menu
|
||||
if (computer.details.state == ComputerDetails.State.OFFLINE ||
|
||||
computer.details.state == ComputerDetails.State.UNKNOWN) {
|
||||
|
@ -15,6 +15,9 @@
|
||||
<string name="help_loading_msg">Loading help page…</string>
|
||||
|
||||
<!-- PC view menu entries -->
|
||||
<string name="pcview_menu_header_online">PC Status: Online</string>
|
||||
<string name="pcview_menu_header_offline">PC Status: Offline</string>
|
||||
<string name="pcview_menu_header_unknown">PC Status: Refreshing</string>
|
||||
<string name="pcview_menu_app_list">View All Apps</string>
|
||||
<string name="pcview_menu_pair_pc">Pair with PC</string>
|
||||
<string name="pcview_menu_unpair_pc">Unpair</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user