mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 05:37:43 +00:00
Added a "No players found" message to MPRIS Plugin when player list is empty
This commit is contained in:
parent
6328a01d1e
commit
8d67e0b0f1
@ -12,6 +12,14 @@
|
||||
android:paddingRight="60dip"
|
||||
android:paddingBottom="5dip">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="@string/no_players_connected"
|
||||
android:id="@+id/no_players"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<Spinner
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -109,6 +109,7 @@
|
||||
<string name="sftp_readonly">(read only)</string>
|
||||
<string name="sftp_camera">Camera pictures</string>
|
||||
<string name="add_host">Add host/IP</string>
|
||||
<string name="no_players_connected">No players found</string>
|
||||
<string name="custom_dev_list_help">Use this option only if your device is not automatically detected. Enter IP address or hostname below and touch the button to add it to the list. Touch an existing item to remove it from the list.</string>
|
||||
<string name="mpris_player_on_device">%1$s on %2$s</string>
|
||||
|
||||
|
@ -135,6 +135,14 @@ public class MprisActivity extends ActionBarActivity {
|
||||
//String prevPlayer = (String)spinner.getSelectedItem();
|
||||
spinner.setAdapter(adapter);
|
||||
|
||||
if(playerList.isEmpty()){
|
||||
findViewById(R.id.no_players).setVisibility(View.VISIBLE);
|
||||
spinner.setVisibility(View.GONE);
|
||||
}else{
|
||||
findViewById(R.id.no_players).setVisibility(View.GONE);
|
||||
spinner.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> arg0, View arg1, int pos, long id) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user