Commit 8d67e0b0 authored by Da-Jin Chu's avatar Da-Jin Chu Committed by Albert Vaca Cintora

Added a "No players found" message to MPRIS Plugin when player list is empty

parent 6328a01d
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment