mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-02 16:19:09 +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.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 SeekBar volumeSeekBar;
|
||||
|
@ -23,7 +23,7 @@ public class ClientInfoItem extends LinearLayout implements SeekBar.OnSeekBarCha
|
|||
private ClientInfo clientInfo;
|
||||
private ClientInfoItemListener listener = null;
|
||||
|
||||
public ClientInfoItem(Context context, ClientInfo clientInfo) {
|
||||
public ClientItem(Context context, ClientInfo clientInfo) {
|
||||
super(context);
|
||||
LayoutInflater vi = (LayoutInflater) context
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
@ -114,13 +114,13 @@ public class ClientInfoItem extends LinearLayout implements SeekBar.OnSeekBarCha
|
|||
}
|
||||
|
||||
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 OnFragmentInteractionListener mListener;
|
||||
private ClientInfoItem.ClientInfoItemListener clientInfoItemListener;
|
||||
private ClientItem.ClientInfoItemListener clientInfoItemListener;
|
||||
private ClientInfoAdapter clientInfoAdapter;
|
||||
private ServerInfo serverInfo = null;
|
||||
private boolean hideOffline = false;
|
||||
|
@ -99,7 +99,7 @@ public class ClientListFragment extends Fragment {
|
|||
throw new RuntimeException(context.toString()
|
||||
+ " must implement OnFragmentInteractionListener");
|
||||
}
|
||||
clientInfoItemListener = (ClientInfoItem.ClientInfoItemListener) context;
|
||||
clientInfoItemListener = (ClientItem.ClientInfoItemListener) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -147,11 +147,11 @@ public class ClientListFragment extends Fragment {
|
|||
|
||||
public class ClientInfoAdapter extends ArrayAdapter<ClientInfo> {
|
||||
private Context context;
|
||||
private ClientInfoItem.ClientInfoItemListener listener;
|
||||
private ClientItem.ClientInfoItemListener listener;
|
||||
private boolean hideOffline = false;
|
||||
private ServerInfo serverInfo = new ServerInfo();
|
||||
|
||||
public ClientInfoAdapter(Context context, ClientInfoItem.ClientInfoItemListener listener) {
|
||||
public ClientInfoAdapter(Context context, ClientItem.ClientInfoItemListener listener) {
|
||||
super(context, 0);
|
||||
this.context = context;
|
||||
this.listener = listener;
|
||||
|
@ -160,16 +160,16 @@ public class ClientListFragment extends Fragment {
|
|||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ClientInfo clientInfo = getItem(position);
|
||||
final ClientInfoItem clientInfoItem;
|
||||
final ClientItem clientItem;
|
||||
|
||||
if (convertView != null) {
|
||||
clientInfoItem = (ClientInfoItem) convertView;
|
||||
clientInfoItem.setClientInfo(clientInfo);
|
||||
clientItem = (ClientItem) convertView;
|
||||
clientItem.setClientInfo(clientInfo);
|
||||
} else {
|
||||
clientInfoItem = new ClientInfoItem(context, clientInfo);
|
||||
clientItem = new ClientItem(context, clientInfo);
|
||||
}
|
||||
clientInfoItem.setListener(listener);
|
||||
return clientInfoItem;
|
||||
clientItem.setListener(listener);
|
||||
return clientItem;
|
||||
}
|
||||
|
||||
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.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 SERVICE_NAME = "Snapcast";// #2";
|
||||
|
@ -585,18 +585,18 @@ public class MainActivity extends AppCompatActivity implements ClientListFragmen
|
|||
|
||||
|
||||
@Override
|
||||
public void onVolumeChanged(ClientInfoItem clientInfoItem, int percent) {
|
||||
remoteControl.setVolume(clientInfoItem.getClientInfo(), percent);
|
||||
public void onVolumeChanged(ClientItem clientItem, int percent) {
|
||||
remoteControl.setVolume(clientItem.getClientInfo(), percent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMute(ClientInfoItem clientInfoItem, boolean mute) {
|
||||
remoteControl.setMute(clientInfoItem.getClientInfo(), mute);
|
||||
public void onMute(ClientItem clientItem, boolean mute) {
|
||||
remoteControl.setMute(clientItem.getClientInfo(), mute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteClicked(final ClientInfoItem clientInfoItem) {
|
||||
final ClientInfo clientInfo = clientInfoItem.getClientInfo();
|
||||
public void onDeleteClicked(final ClientItem clientItem) {
|
||||
final ClientInfo clientInfo = clientItem.getClientInfo();
|
||||
clientInfo.setDeleted(true);
|
||||
serverInfo.updateClient(clientInfo);
|
||||
sectionsPagerAdapter.updateServer(serverInfo);
|
||||
|
@ -625,9 +625,9 @@ public class MainActivity extends AppCompatActivity implements ClientListFragmen
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onPropertiesClicked(ClientInfoItem clientInfoItem) {
|
||||
public void onPropertiesClicked(ClientItem clientItem) {
|
||||
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.setFlags(0);
|
||||
startActivityForResult(intent, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue