Search in sources :

Example 16 with DialogFragment

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);
}
Also used : SimpleDialog(com.rey.material.app.SimpleDialog) DialogFragment(com.rey.material.app.DialogFragment) OnClick(butterknife.OnClick)

Example 17 with DialogFragment

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);
}
Also used : TimePickerDialog(com.rey.material.app.TimePickerDialog) ProgressDialog(android.app.ProgressDialog) AlertDialog(android.support.v7.app.AlertDialog) DatePickerDialog(com.rey.material.app.DatePickerDialog) SimpleDialog(com.rey.material.app.SimpleDialog) Dialog(com.rey.material.app.Dialog) DialogFragment(com.rey.material.app.DialogFragment) TimePickerDialog(com.rey.material.app.TimePickerDialog) SimpleDateFormat(java.text.SimpleDateFormat) OnClick(butterknife.OnClick)

Example 18 with DialogFragment

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);
}
Also used : EditText(android.widget.EditText) TimePickerDialog(com.rey.material.app.TimePickerDialog) ProgressDialog(android.app.ProgressDialog) AlertDialog(android.support.v7.app.AlertDialog) DatePickerDialog(com.rey.material.app.DatePickerDialog) SimpleDialog(com.rey.material.app.SimpleDialog) Dialog(com.rey.material.app.Dialog) DialogFragment(com.rey.material.app.DialogFragment)

Example 19 with DialogFragment

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);
}
Also used : SimpleDialog(com.rey.material.app.SimpleDialog) DialogFragment(com.rey.material.app.DialogFragment) OnClick(butterknife.OnClick)

Example 20 with DialogFragment

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);
}
Also used : SimpleDialog(com.rey.material.app.SimpleDialog) DialogFragment(com.rey.material.app.DialogFragment)

Aggregations

DialogFragment (com.rey.material.app.DialogFragment)27 SimpleDialog (com.rey.material.app.SimpleDialog)27 OnClick (butterknife.OnClick)13 Dialog (com.rey.material.app.Dialog)12 AlertDialog (android.support.v7.app.AlertDialog)11 ProgressDialog (android.app.ProgressDialog)9 DatePickerDialog (com.rey.material.app.DatePickerDialog)7 TimePickerDialog (com.rey.material.app.TimePickerDialog)7 EditText (android.widget.EditText)4 ArrayList (java.util.ArrayList)4 User (br.ufrj.caronae.models.User)3 CaretString (com.redmadrobot.inputmask.model.CaretString)3 SimpleDateFormat (java.text.SimpleDateFormat)3 Intent (android.content.Intent)2 RecyclerView (android.support.v7.widget.RecyclerView)2 View (android.view.View)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 RoundedTransformation (br.ufrj.caronae.RoundedTransformation)2 Ride (br.ufrj.caronae.models.Ride)2