in src/main/java/com/amazonaws/kinesisvideo/demoapp/fragment/StreamWebRtcConfigurationFragment.java [116:167]
public void onViewCreated(final View view, Bundle savedInstanceState) {
Button mStartMasterButton = view.findViewById(R.id.start_master);
mStartMasterButton.setOnClickListener(startMasterActivityWhenClicked());
Button mStartViewerButton = view.findViewById(R.id.start_viewer);
mStartViewerButton.setOnClickListener(startViewerActivityWhenClicked());
mChannelName = view.findViewById(R.id.channel_name);
mClientId = view.findViewById(R.id.client_id);
mRegion = view.findViewById(R.id.region);
setRegionFromCognito();
mOptions = view.findViewById(R.id.webrtc_options);
mOptions.setAdapter(new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_multiple_choice, WEBRTC_OPTIONS) {
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
if(convertView == null) {
View v = getLayoutInflater().inflate(android.R.layout.simple_list_item_multiple_choice, null);
final CheckedTextView ctv = v.findViewById(android.R.id.text1);
ctv.setText(WEBRTC_OPTIONS[position]);
// Send video is enabled by default and cannot uncheck
if (position == 0) {
ctv.setEnabled(false);
ctv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ctv.setChecked(true);
}
});
}
return v;
}
return convertView;
}
});
mOptions.setItemsCanFocus(false);
mOptions.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
mOptions.setItemChecked(0, true);
mCameras = view.findViewById(R.id.camera_spinner);
List<String> cameraList = new ArrayList<>(Arrays.asList("Front Camera", "Back Camera"));
if (getContext() != null) {
mCameras.setAdapter(new ArrayAdapter<>(getContext(),
android.R.layout.simple_spinner_dropdown_item,
cameraList));
}
}