use of com.rey.material.app.DialogFragment in project caronae-android by caronae.
the class RideOfferFrag method centerEt.
@OnClick(R.id.center_et)
public void centerEt() {
SimpleDialog.Builder campiBuilder = new SimpleDialog.Builder(R.style.SimpleDialogLight) {
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
if (getSelectedValue().equals(Util.getCampi()[2]) && (going)) {
// center_et.setVisibility(View.GONE);
center_et.setText(getSelectedValue());
} else
showCenterListDialog(getSelectedValue().toString());
super.onPositiveActionClicked(fragment);
}
@Override
public void onNegativeActionClicked(DialogFragment fragment) {
super.onNegativeActionClicked(fragment);
}
};
campiBuilder.items(Util.getCampiWithoutAllCampi(), 0).title(getContext().getString(R.string.frag_rideOffer_pickCampi)).positiveAction(getContext().getString(R.string.ok)).negativeAction(getContext().getString(R.string.cancel));
DialogFragment fragmentCampi = DialogFragment.newInstance(campiBuilder);
fragmentCampi.show(getFragmentManager(), null);
}
use of com.rey.material.app.DialogFragment in project caronae-android by caronae.
the class RideOfferFrag method time_et.
@OnClick(R.id.time_et)
public void time_et() {
Dialog.Builder builder = new TimePickerDialog.Builder(R.style.Material_App_Dialog_TimePicker_Light, 24, 0) {
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
TimePickerDialog dialog = (TimePickerDialog) fragment.getDialog();
time_et.setText(dialog.getFormattedTime(new SimpleDateFormat("HH:mm", Locale.US)));
super.onPositiveActionClicked(fragment);
}
@Override
public void onNegativeActionClicked(DialogFragment fragment) {
super.onNegativeActionClicked(fragment);
}
};
builder.positiveAction(getContext().getString(R.string.ok)).negativeAction(getContext().getString(R.string.cancel));
DialogFragment fragment = DialogFragment.newInstance(builder);
fragment.show(getFragmentManager(), null);
}
use of com.rey.material.app.DialogFragment in project caronae-android by caronae.
the class RideOfferFrag method showOtherNeighborhoodDialog.
public void showOtherNeighborhoodDialog() {
Dialog.Builder builder = new SimpleDialog.Builder(R.style.SimpleDialogLight) {
@Override
protected void onBuildDone(Dialog dialog) {
dialog.layoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
EditText neighborhood_et2 = (EditText) fragment.getDialog().findViewById(R.id.neighborhood_et);
String neighborhood = neighborhood_et2.getText().toString();
if (!neighborhood.isEmpty()) {
neighborhood_et.setText(neighborhood);
}
super.onPositiveActionClicked(fragment);
}
@Override
public void onNegativeActionClicked(DialogFragment fragment) {
super.onNegativeActionClicked(fragment);
}
};
builder.title(getActivity().getString(R.string.frag_ridesearch_typeNeighborhood)).positiveAction(getString(R.string.ok)).negativeAction(getString(R.string.cancel)).contentView(R.layout.other_neighborhood);
DialogFragment fragment2 = DialogFragment.newInstance(builder);
fragment2.show(getActivity().getSupportFragmentManager(), null);
}
use of com.rey.material.app.DialogFragment in project caronae-android by caronae.
the class RideOfferFrag method campiEt.
@OnClick(R.id.campi_et)
public void campiEt() {
SimpleDialog.Builder builder = new SimpleDialog.Builder(R.style.SimpleDialogLight) {
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
campi_et.setText(getSelectedValue());
if ((campi_et.getText().toString().equals("") || campi_et.getText().toString().equals(Util.getCampi()[2]) && (going))) {
// center_et.setVisibility(View.GONE);
} else
center_et.setVisibility(View.VISIBLE);
super.onPositiveActionClicked(fragment);
}
@Override
public void onNegativeActionClicked(DialogFragment fragment) {
super.onNegativeActionClicked(fragment);
}
};
builder.items(Util.getCampiWithoutAllCampi(), 0).title(getContext().getString(R.string.frag_rideOffer_pickCampi)).positiveAction(getContext().getString(R.string.ok)).negativeAction(getContext().getString(R.string.cancel));
DialogFragment fragment = DialogFragment.newInstance(builder);
fragment.show(getFragmentManager(), null);
}
use of com.rey.material.app.DialogFragment in project caronae-android by caronae.
the class RideOfferFrag method locationEt2.
public void locationEt2(String zone) {
SimpleDialog.Builder builder = new SimpleDialog.Builder(R.style.SimpleDialogLight) {
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
neighborhood_et.setText(getSelectedValue());
super.onPositiveActionClicked(fragment);
}
@Override
public void onNegativeActionClicked(DialogFragment fragment) {
super.onNegativeActionClicked(fragment);
}
};
builder.items(Util.getNeighborhoods(zone), 0).title(getContext().getString(R.string.frag_rideOffer_pickNeighborhood)).positiveAction(getContext().getString(R.string.ok)).negativeAction(getContext().getString(R.string.cancel));
DialogFragment fragment = DialogFragment.newInstance(builder);
fragment.show(getFragmentManager(), null);
}
Aggregations