use of com.nightonke.saver.adapter.RecordCheckDialogRecyclerViewAdapter in project CoCoin by Nightonke.
the class RecordCheckDialogFragment method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Context context = getActivity();
AlertDialog.Builder builder = new AlertDialog.Builder(context);
View view = LayoutInflater.from(context).inflate(R.layout.fragment_dialog_list, null, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(context));
RecordCheckDialogRecyclerViewAdapter adapter = new RecordCheckDialogRecyclerViewAdapter(context, list, this);
recyclerView.setAdapter(adapter);
builder.setTitle("Title");
builder.setView(view);
builder.setPositiveButton(mContext.getResources().getString(R.string.get), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
final AlertDialog alert = builder.create();
TextView title = new TextView(mContext);
title.setHeight(120);
title.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
title.setTypeface(CoCoinUtil.typefaceLatoLight);
title.setText(this.title);
alert.setCustomTitle(title);
alert.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
Button btnPositive = alert.getButton(Dialog.BUTTON_POSITIVE);
btnPositive.setTypeface(CoCoinUtil.typefaceLatoLight);
}
});
return alert;
}
Aggregations