Giter VIP home page Giter VIP logo

customdialog's Introduction

CustomDialog

API

Android Library that shows simple and customizable flat designed dialogs with no title.

How to import

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add the dependency

dependencies {
	compile 'com.github.EunsilJo:CustomDialog:1.0.3'
}

How to use

CustomDialog

new CustomDialog.Builder(activity)
        .content("The verification e-mail sent. Please check.")
        .neutralText("OK")
        .onNeutral(new CustomDialog.DialogButtonCallback(){...})
        .action(CustomDialog.DialogAction.NEUTRAL)
        .cancelable(false)
        .build()
        .show();
new CustomDialog.Builder(activity)
        .content("Are you sure you want to sign out?")
        .positiveText("Sign Out")
        .onPositive(new CustomDialog.DialogButtonCallback(){...})
        .negativeText("Cancel")
        .onNegative(new CustomDialog.DialogButtonCallback(){...})
        .cancelable(false)
        .build()
        .show();

You can change color of buttons.

        .positiveDrawable(R.color.colorAccent)
        .negativeColor(Color.parseColor("#212121"))

CustomInputDialog

new CustomInputDialog.Builder(activity)
        .hint("Please enter your review.")
        .maxLines(2)
        .maxLength(50)
        .showLength(true)
        .inputCallback(new CustomInputDialog.DialogInputCallback(){...})
        .inputColor(CustomDialog.DialogColor.PRIMARYDARK)
        .neutralText("OK")
        .action(CustomDialog.DialogAction.NEUTRAL)
        .cancelable(true)
        .build()
        .show();

You can set text of prefill.

        .prefill("www.instagram.com/")
        .showLength(false)

CustomSelectDialog

new CustomSelectDialog.Builder(activity)
        .items(Arrays.asList("Apple", "Banana", "Cherry", "Durian", "Melon", "Orange"))
        .selectedItems(new ArrayList<>(Arrays.asList(1, 2, 5))
        .choice(SelectButtonAdapter.CHOICE_MODE.MULTIPLE)
        .type(CustomSelectDialog.DialogSelectType.LIST)
        .multiChoiceListCallback(new CustomSelectDialog.DialogMultiChoiceListCallback(){...})
        .selectColor(CustomDialog.DialogColor.PRIMARY)
        .action(CustomDialog.DialogAction.NEUTRAL)
        .cancelable(true)
        .build()
        .show();

You can show select list with button style.

        .type(CustomSelectDialog.DialogSelectType.BUTTON)

You can set single choice list.

        .selectedItem(1)
        .choice(SelectButtonAdapter.CHOICE_MODE.SINGLE)

CustomDatePickerDialog

new CustomDatePickerDialog.Builder(activity)
        .year(2017)
        .monthOfYear(9)
        .dayOfMonth(27)
        .showYear(true)
        .showMonth(true)
        .showDay(true)
        .datePickerCallback(new CustomDatePickerDialog.DialogDatePickerCallback(){...})
        .dividerColor(CustomDialog.DialogColor.PRIMARY)
        .cancelable(true)
        .build()
        .show();

You can show/hide year, month and day.

        .showDay(false)

v1.0.2 updated

CustomTimePickerDialog

new CustomTimePickerDialog.Builder(activity)
        .hour(18)
        .minute(23)
        .timePickerCallback(new CustomTimePickerDialog.DialogTimePickerCallback(){...})
        .cancelable(true)
        .build()
        .show();

You can show/hide AM/PM.

        .is24HourView(true)

CustomStartEndPickerDialog

new CustomStartEndPickerDialog.Builder(activity)
        .startHour(11)
        .startMinute(20)
        .endHour(13)
        .endMinute(20)
        .startEndPickerCallback(CustomStartEndPickerDialog.DialogStartEndPickerCallback(){...})
        .cancelable(true)
        .build()
        .show();

You can pick start and end time.

CustomMultiPickerDialog

new CustomMultiPickerDialog.Builder(activity)
        .number1(2)
        .minMaxValue1(1, 1000)
        .number2(2)
        .minMaxValue2(0, maxValue2)
        .displayValues2(new String[]{"Apple", "Banana", "Cherry", "Durian", "Melon", "Orange"})
        .multiPickerCallback(CustomMultiPickerDialog.DialogMultiPickerCallback(){...})
        .cancelable(true)
        .build()
        .show();

You can pick two items.

v1.0.3 updated

CustomDatePickerDialog

    public interface DialogDatePickerCallback {
        void onDateChanged(@NonNull CustomDatePickerDialog dialog, DatePicker view, int year, int monthOfYear, int dayOfMonth);
        ...
    }
  • onDateChanged : The callback used to indicate the user changed the date.

+

Please check the demo app to see examples.

customdialog's People

Contributors

eunsiljo avatar

Stargazers

mejdi hafiane avatar Yang dong seok avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.