use of com.owncloud.android.databinding.MultipleAccountsBinding in project android by nextcloud.
the class MultipleAccountsDialog method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Activity activity = getActivity();
if (activity == null) {
throw new IllegalArgumentException("Activity may not be null");
}
// Inflate the layout for the dialog
LayoutInflater inflater = activity.getLayoutInflater();
MultipleAccountsBinding binding = MultipleAccountsBinding.inflate(inflater, null, false);
final ReceiveExternalFilesActivity parent = (ReceiveExternalFilesActivity) getActivity();
AlertDialog.Builder builder = new AlertDialog.Builder(parent);
UserListAdapter adapter = new UserListAdapter(parent, accountManager, getAccountListItems(), this, false, false);
binding.list.setHasFixedSize(true);
binding.list.setLayoutManager(new LinearLayoutManager(activity));
binding.list.setAdapter(adapter);
builder.setView(binding.getRoot()).setTitle(R.string.common_choose_account);
Dialog dialog = builder.create();
Window window = dialog.getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
return dialog;
}
Aggregations