0

i am using the datepicker dialog to dispaly the dateformat dialog,i want to change the divders color of datepicker and how to customize the datepickerdailog for as three blue color divders are single line.how can i customize the datepicker dialog like second picture.

i got this dialog from datepickersdialog. I got this dialog

//i am using the code to display the the datepicker dialog is:

public class MainActivity extends Activity {

private EditText txtView;
private String initialDate;
private String initialMonth;
private String initialYear;
private DatePickerDialog dialog = null;
Context context;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Button btn = (Button) findViewById(R.id.button1);
    txtView = (EditText) findViewById(R.id.textView1);
    context = getApplicationContext();
    btn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Calendar dtTxt = null;

            String preExistingDate = (String) txtView.getText().toString();

            if (preExistingDate != null && !preExistingDate.equals("")) {
                StringTokenizer st = new StringTokenizer(preExistingDate,
                        "/");

                System.out.println("datepicker dialog if condition");
                initialMonth = st.nextToken();
                initialDate = st.nextToken();
                initialYear = st.nextToken();
                if (dialog == null)
                    dialog = new DatePickerDialog(v.getContext(),
                            new PickDate(), Integer.parseInt(initialYear),
                            Integer.parseInt(initialDate), Integer
                                    .parseInt(initialMonth) - 1);


                dialog.updateDate(Integer.parseInt(initialYear),
                        Integer.parseInt(initialDate),
                        Integer.parseInt(initialMonth) - 1);


            } else {


                dtTxt = Calendar.getInstance();
                if (dialog == null)
                    System.out.println("datepicker dialog if condition else part");
                    dialog = new DatePickerDialog(v.getContext(),
                            new PickDate(), dtTxt.getTime().getYear(),
                            dtTxt.getTime().getDay(), dtTxt.getTime()
                                    .getMonth());
                dialog.updateDate(dtTxt.getTime().getYear(), dtTxt
                        .getTime().getDay(), dtTxt.getTime().getMonth());

                dialog.setTitle("");
            }

            dialog.show();
        }

    });
}

private class PickDate implements DatePickerDialog.OnDateSetListener {

    @Override
    public void onDateSet(DatePicker view, int year, int monthOfYear,
            int dayOfMonth) {
        view.updateDate(year, monthOfYear, dayOfMonth);
        txtView.setText(monthOfYear + "/" + dayOfMonth + "/" + year);
        dialog.hide();
    }

}

//i want to change the dialog divders like this: should change the blue color line and i want take a complete line also like below picture: enter image description here

naresh
  • 10,332
  • 25
  • 81
  • 124

1 Answers1

0

I could find no way to theme the built in DatePicker so I used this library and built my own.

https://github.com/SimonVT/android-numberpicker

Kuffs
  • 35,581
  • 10
  • 79
  • 92
  • Thanks for replying me but it is applying themes only,remiang things are same,but my requirement is i want avoid those 3 dividers and i wnat to keep the only single line between them. – naresh Dec 19 '13 at 11:10
  • I fully understood your question. My answer stated the solution I had to use to resolve the issue. – Kuffs Dec 19 '13 at 11:19