mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-06 10:09:33 +02:00
renamed ClientInfo => Client
This commit is contained in:
parent
8aecd477fa
commit
ab9ebbaef7
3 changed files with 25 additions and 25 deletions
|
@ -14,7 +14,7 @@ import android.widget.TextView;
|
||||||
import de.badaix.snapcast.control.ClientInfo;
|
import de.badaix.snapcast.control.ClientInfo;
|
||||||
import de.badaix.snapcast.control.Volume;
|
import de.badaix.snapcast.control.Volume;
|
||||||
|
|
||||||
public class ClientInfoItem extends LinearLayout implements SeekBar.OnSeekBarChangeListener, View.OnClickListener, PopupMenu.OnMenuItemClickListener {
|
public class ClientItem extends LinearLayout implements SeekBar.OnSeekBarChangeListener, View.OnClickListener, PopupMenu.OnMenuItemClickListener {
|
||||||
|
|
||||||
private TextView title;
|
private TextView title;
|
||||||
private SeekBar volumeSeekBar;
|
private SeekBar volumeSeekBar;
|
||||||
|
@ -23,7 +23,7 @@ public class ClientInfoItem extends LinearLayout implements SeekBar.OnSeekBarCha
|
||||||
private ClientInfo clientInfo;
|
private ClientInfo clientInfo;
|
||||||
private ClientInfoItemListener listener = null;
|
private ClientInfoItemListener listener = null;
|
||||||
|
|
||||||
public ClientInfoItem(Context context, ClientInfo clientInfo) {
|
public ClientItem(Context context, ClientInfo clientInfo) {
|
||||||
super(context);
|
super(context);
|
||||||
LayoutInflater vi = (LayoutInflater) context
|
LayoutInflater vi = (LayoutInflater) context
|
||||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
@ -114,13 +114,13 @@ public class ClientInfoItem extends LinearLayout implements SeekBar.OnSeekBarCha
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ClientInfoItemListener {
|
public interface ClientInfoItemListener {
|
||||||
void onVolumeChanged(ClientInfoItem clientInfoItem, int percent);
|
void onVolumeChanged(ClientItem clientItem, int percent);
|
||||||
|
|
||||||
void onMute(ClientInfoItem clientInfoItem, boolean mute);
|
void onMute(ClientItem clientItem, boolean mute);
|
||||||
|
|
||||||
void onDeleteClicked(ClientInfoItem clientInfoItem);
|
void onDeleteClicked(ClientItem clientItem);
|
||||||
|
|
||||||
void onPropertiesClicked(ClientInfoItem clientInfoItem);
|
void onPropertiesClicked(ClientItem clientItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -37,7 +37,7 @@ public class ClientListFragment extends Fragment {
|
||||||
private String mParam1;
|
private String mParam1;
|
||||||
|
|
||||||
private OnFragmentInteractionListener mListener;
|
private OnFragmentInteractionListener mListener;
|
||||||
private ClientInfoItem.ClientInfoItemListener clientInfoItemListener;
|
private ClientItem.ClientInfoItemListener clientInfoItemListener;
|
||||||
private ClientInfoAdapter clientInfoAdapter;
|
private ClientInfoAdapter clientInfoAdapter;
|
||||||
private ServerInfo serverInfo = null;
|
private ServerInfo serverInfo = null;
|
||||||
private boolean hideOffline = false;
|
private boolean hideOffline = false;
|
||||||
|
@ -99,7 +99,7 @@ public class ClientListFragment extends Fragment {
|
||||||
throw new RuntimeException(context.toString()
|
throw new RuntimeException(context.toString()
|
||||||
+ " must implement OnFragmentInteractionListener");
|
+ " must implement OnFragmentInteractionListener");
|
||||||
}
|
}
|
||||||
clientInfoItemListener = (ClientInfoItem.ClientInfoItemListener) context;
|
clientInfoItemListener = (ClientItem.ClientInfoItemListener) context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -147,11 +147,11 @@ public class ClientListFragment extends Fragment {
|
||||||
|
|
||||||
public class ClientInfoAdapter extends ArrayAdapter<ClientInfo> {
|
public class ClientInfoAdapter extends ArrayAdapter<ClientInfo> {
|
||||||
private Context context;
|
private Context context;
|
||||||
private ClientInfoItem.ClientInfoItemListener listener;
|
private ClientItem.ClientInfoItemListener listener;
|
||||||
private boolean hideOffline = false;
|
private boolean hideOffline = false;
|
||||||
private ServerInfo serverInfo = new ServerInfo();
|
private ServerInfo serverInfo = new ServerInfo();
|
||||||
|
|
||||||
public ClientInfoAdapter(Context context, ClientInfoItem.ClientInfoItemListener listener) {
|
public ClientInfoAdapter(Context context, ClientItem.ClientInfoItemListener listener) {
|
||||||
super(context, 0);
|
super(context, 0);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
|
@ -160,16 +160,16 @@ public class ClientListFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
ClientInfo clientInfo = getItem(position);
|
ClientInfo clientInfo = getItem(position);
|
||||||
final ClientInfoItem clientInfoItem;
|
final ClientItem clientItem;
|
||||||
|
|
||||||
if (convertView != null) {
|
if (convertView != null) {
|
||||||
clientInfoItem = (ClientInfoItem) convertView;
|
clientItem = (ClientItem) convertView;
|
||||||
clientInfoItem.setClientInfo(clientInfo);
|
clientItem.setClientInfo(clientInfo);
|
||||||
} else {
|
} else {
|
||||||
clientInfoItem = new ClientInfoItem(context, clientInfo);
|
clientItem = new ClientItem(context, clientInfo);
|
||||||
}
|
}
|
||||||
clientInfoItem.setListener(listener);
|
clientItem.setListener(listener);
|
||||||
return clientInfoItem;
|
return clientItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateServer(final ServerInfo serverInfo) {
|
public void updateServer(final ServerInfo serverInfo) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ import de.badaix.snapcast.utils.NsdHelper;
|
||||||
import de.badaix.snapcast.utils.Settings;
|
import de.badaix.snapcast.utils.Settings;
|
||||||
import de.badaix.snapcast.utils.Setup;
|
import de.badaix.snapcast.utils.Setup;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity implements ClientListFragment.OnFragmentInteractionListener, ClientInfoItem.ClientInfoItemListener, RemoteControl.RemoteControlListener, SnapclientService.SnapclientListener, NsdHelper.NsdHelperListener {
|
public class MainActivity extends AppCompatActivity implements ClientListFragment.OnFragmentInteractionListener, ClientItem.ClientInfoItemListener, RemoteControl.RemoteControlListener, SnapclientService.SnapclientListener, NsdHelper.NsdHelperListener {
|
||||||
|
|
||||||
private static final String TAG = "Main";
|
private static final String TAG = "Main";
|
||||||
private static final String SERVICE_NAME = "Snapcast";// #2";
|
private static final String SERVICE_NAME = "Snapcast";// #2";
|
||||||
|
@ -585,18 +585,18 @@ public class MainActivity extends AppCompatActivity implements ClientListFragmen
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVolumeChanged(ClientInfoItem clientInfoItem, int percent) {
|
public void onVolumeChanged(ClientItem clientItem, int percent) {
|
||||||
remoteControl.setVolume(clientInfoItem.getClientInfo(), percent);
|
remoteControl.setVolume(clientItem.getClientInfo(), percent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMute(ClientInfoItem clientInfoItem, boolean mute) {
|
public void onMute(ClientItem clientItem, boolean mute) {
|
||||||
remoteControl.setMute(clientInfoItem.getClientInfo(), mute);
|
remoteControl.setMute(clientItem.getClientInfo(), mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDeleteClicked(final ClientInfoItem clientInfoItem) {
|
public void onDeleteClicked(final ClientItem clientItem) {
|
||||||
final ClientInfo clientInfo = clientInfoItem.getClientInfo();
|
final ClientInfo clientInfo = clientItem.getClientInfo();
|
||||||
clientInfo.setDeleted(true);
|
clientInfo.setDeleted(true);
|
||||||
serverInfo.updateClient(clientInfo);
|
serverInfo.updateClient(clientInfo);
|
||||||
sectionsPagerAdapter.updateServer(serverInfo);
|
sectionsPagerAdapter.updateServer(serverInfo);
|
||||||
|
@ -625,9 +625,9 @@ public class MainActivity extends AppCompatActivity implements ClientListFragmen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPropertiesClicked(ClientInfoItem clientInfoItem) {
|
public void onPropertiesClicked(ClientItem clientItem) {
|
||||||
Intent intent = new Intent(this, ClientSettingsActivity.class);
|
Intent intent = new Intent(this, ClientSettingsActivity.class);
|
||||||
intent.putExtra("client", clientInfoItem.getClientInfo().toJson().toString());
|
intent.putExtra("client", clientItem.getClientInfo().toJson().toString());
|
||||||
intent.putExtra("streams", serverInfo.getJsonStreams().toString());
|
intent.putExtra("streams", serverInfo.getJsonStreams().toString());
|
||||||
intent.setFlags(0);
|
intent.setFlags(0);
|
||||||
startActivityForResult(intent, 1);
|
startActivityForResult(intent, 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue