mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-10 23:01:45 +02:00
rename ClientList to GroupList
This commit is contained in:
parent
3915d075d4
commit
d57e8e6e6d
4 changed files with 18 additions and 18 deletions
|
@ -38,9 +38,9 @@ import de.badaix.snapcast.control.json.ServerStatus;
|
||||||
* {@link GroupItem.GroupItemListener} interface
|
* {@link GroupItem.GroupItemListener} interface
|
||||||
* to handle interaction events.
|
* to handle interaction events.
|
||||||
*/
|
*/
|
||||||
public class ClientListFragment extends Fragment {
|
public class GroupListFragment extends Fragment {
|
||||||
|
|
||||||
private static final String TAG = "ClientList";
|
private static final String TAG = "GroupList";
|
||||||
|
|
||||||
// TODO: Rename parameter arguments, choose names that match
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
|
@ -52,7 +52,7 @@ public class ClientListFragment extends Fragment {
|
||||||
private ServerStatus serverStatus = null;
|
private ServerStatus serverStatus = null;
|
||||||
private boolean hideOffline = false;
|
private boolean hideOffline = false;
|
||||||
|
|
||||||
public ClientListFragment() {
|
public GroupListFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,10 +62,10 @@ public class ClientListFragment extends Fragment {
|
||||||
* <p/>
|
* <p/>
|
||||||
* //@param param1 Parameter 1.
|
* //@param param1 Parameter 1.
|
||||||
*
|
*
|
||||||
* @return A new instance of fragment ClientListFragment.
|
* @return A new instance of fragment GroupListFragment.
|
||||||
* // TODO: Rename and change types and number of parameters
|
* // TODO: Rename and change types and number of parameters
|
||||||
* public static ClientListFragment newInstance(String param1) {
|
* public static GroupListFragment newInstance(String param1) {
|
||||||
* ClientListFragment fragment = new ClientListFragment();
|
* GroupListFragment fragment = new GroupListFragment();
|
||||||
* Bundle args = new Bundle();
|
* Bundle args = new Bundle();
|
||||||
* args.putString(ARG_PARAM1, param1);
|
* args.putString(ARG_PARAM1, param1);
|
||||||
* fragment.setArguments(args);
|
* fragment.setArguments(args);
|
||||||
|
@ -86,7 +86,7 @@ public class ClientListFragment extends Fragment {
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
Log.d(TAG, "onCreateView: " + this.toString());
|
Log.d(TAG, "onCreateView: " + this.toString());
|
||||||
View view = inflater.inflate(R.layout.fragment_client_list, container, false);
|
View view = inflater.inflate(R.layout.fragment_group_list, container, false);
|
||||||
ListView lvGroup = (ListView) view.findViewById(R.id.lvGroup);
|
ListView lvGroup = (ListView) view.findViewById(R.id.lvGroup);
|
||||||
groupAdapter = new GroupAdapter(getContext(), groupItemListener);
|
groupAdapter = new GroupAdapter(getContext(), groupItemListener);
|
||||||
groupAdapter.setHideOffline(hideOffline);
|
groupAdapter.setHideOffline(hideOffline);
|
||||||
|
@ -174,7 +174,7 @@ public class ClientListFragment extends Fragment {
|
||||||
for (Group group : GroupAdapter.this.serverStatus.getGroups()) {
|
for (Group group : GroupAdapter.this.serverStatus.getGroups()) {
|
||||||
add(group);
|
add(group);
|
||||||
/* for (Client client : group.getClients()) {
|
/* for (Client client : group.getClients()) {
|
||||||
if ((client != null) && (!hideOffline || client.isConnected()) && !client.isDeleted())// && client.getConfig().getStream().equals(ClientListFragment.this.stream.getId()))
|
if ((client != null) && (!hideOffline || client.isConnected()) && !client.isDeleted())// && client.getConfig().getStream().equals(GroupListFragment.this.stream.getId()))
|
||||||
add(client);
|
add(client);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
|
@ -75,7 +75,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
|
||||||
private RemoteControl remoteControl = null;
|
private RemoteControl remoteControl = null;
|
||||||
private ServerStatus serverStatus = null;
|
private ServerStatus serverStatus = null;
|
||||||
private SnapclientService snapclientService;
|
private SnapclientService snapclientService;
|
||||||
private ClientListFragment clientListFragment;
|
private GroupListFragment groupListFragment;
|
||||||
private TabLayout tabLayout;
|
private TabLayout tabLayout;
|
||||||
private Snackbar warningSamplerateSnackbar = null;
|
private Snackbar warningSamplerateSnackbar = null;
|
||||||
private int nativeSampleRate = 0;
|
private int nativeSampleRate = 0;
|
||||||
|
@ -130,7 +130,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
|
||||||
// Create the adapter that will return a fragment for each of the three
|
// Create the adapter that will return a fragment for each of the three
|
||||||
// primary sections of the activity.
|
// primary sections of the activity.
|
||||||
|
|
||||||
clientListFragment = (ClientListFragment) getSupportFragmentManager().findFragmentById(R.id.clientListFragment);
|
groupListFragment = (GroupListFragment) getSupportFragmentManager().findFragmentById(R.id.groupListFragment);
|
||||||
|
|
||||||
setActionbarSubtitle("Host: no Snapserver found");
|
setActionbarSubtitle("Host: no Snapserver found");
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
|
||||||
if (client.getConfig().getLatency() != clientOriginal.getConfig().getLatency())
|
if (client.getConfig().getLatency() != clientOriginal.getConfig().getLatency())
|
||||||
remoteControl.setLatency(client, client.getConfig().getLatency());
|
remoteControl.setLatency(client, client.getConfig().getLatency());
|
||||||
serverStatus.updateClient(client);
|
serverStatus.updateClient(client);
|
||||||
clientListFragment.updateServer(MainActivity.this.serverStatus);
|
groupListFragment.updateServer(MainActivity.this.serverStatus);
|
||||||
} else if (requestCode == GROUP_PROPERTIES_REQUEST) {
|
} else if (requestCode == GROUP_PROPERTIES_REQUEST) {
|
||||||
ArrayList<String> clients = data.getStringArrayListExtra("clients");
|
ArrayList<String> clients = data.getStringArrayListExtra("clients");
|
||||||
Log.d(TAG, "clients: " + clients);
|
Log.d(TAG, "clients: " + clients);
|
||||||
|
@ -424,7 +424,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
|
||||||
MainActivity.this.runOnUiThread(new Runnable() {
|
MainActivity.this.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
clientListFragment.updateServer(MainActivity.this.serverStatus);
|
groupListFragment.updateServer(MainActivity.this.serverStatus);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
@ -447,7 +447,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
|
||||||
public void onDisconnected(RemoteControl remoteControl, Exception e) {
|
public void onDisconnected(RemoteControl remoteControl, Exception e) {
|
||||||
Log.d(TAG, "onDisconnected");
|
Log.d(TAG, "onDisconnected");
|
||||||
serverStatus = new ServerStatus();
|
serverStatus = new ServerStatus();
|
||||||
clientListFragment.updateServer(serverStatus);
|
groupListFragment.updateServer(serverStatus);
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
if (e instanceof UnknownHostException)
|
if (e instanceof UnknownHostException)
|
||||||
setActionbarSubtitle("error: unknown host");
|
setActionbarSubtitle("error: unknown host");
|
||||||
|
@ -475,7 +475,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
|
||||||
@Override
|
@Override
|
||||||
public void onServerStatus(RemoteControl remoteControl, ServerStatus serverStatus) {
|
public void onServerStatus(RemoteControl remoteControl, ServerStatus serverStatus) {
|
||||||
this.serverStatus = serverStatus;
|
this.serverStatus = serverStatus;
|
||||||
clientListFragment.updateServer(serverStatus);
|
groupListFragment.updateServer(serverStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,12 +47,12 @@
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/clientListFragment"
|
android:id="@+id/groupListFragment"
|
||||||
android:name="de.badaix.snapcast.ClientListFragment"
|
android:name="de.badaix.snapcast.GroupListFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="?attr/actionBarSize"
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
tools:layout="@layout/fragment_client_list"/>
|
tools:layout="@layout/fragment_group_list"/>
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context="de.badaix.snapcast.ClientListFragment">
|
tools:context="de.badaix.snapcast.GroupListFragment">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/lvGroup"
|
android:id="@+id/lvGroup"
|
Loading…
Add table
Add a link
Reference in a new issue