Linux
- 1 ответ
- 0 вопросов
1
Вклад в тег
Dialog.Builder builder = new SimpleDialog.Builder(){
@Override
protected void onBuildDone(Dialog dialog) {
dialog.layoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
public void onNegativeActionClicked(DialogFragment fragment) {
super.onNegativeActionClicked(fragment);
}
@Override
public void onPositiveActionClicked(final DialogFragment fragment) {
final EditText codeField = (EditText) fragment.getDialog().findViewById(R.id.facCode);
final View panelProgress=fragment.getDialog()
.findViewById(R.id.facProgressPanel);
final ProgressView progress=(ProgressView)fragment.getDialog()
.findViewById(R.id.facProgress);
if (Is.empty(codeField)) {
App.showMessage(R.string.warn_fields);
return;
}
......
}
};
builder.title(App.getResStr(R.string.activation))
.positiveAction(App.getResStr(R.string.send))
.negativeAction(App.getResStr(R.string.cancel))
.contentView(R.layout.fragment_activation);
DialogFragment fragment = DialogFragment.newInstance(builder);
fragment.show(context.getSupportFragmentManager(), null);
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="5dp" >
<EditText
android:id="@+id/facCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_activation"
android:layout_centerInParent="true"
android:inputType="number"
android:singleLine="true"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/facProgressPanel"
android:orientation="horizontal"
android:gravity="center"
android:visibility="gone"
android:background="@color/xxxxxx"
android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.rey.material.widget.ProgressView
android:id="@+id/facProgress"
style="?attr/xxxxxxx
/>
</LinearLayout>
</RelativeLayout>