Giter Site home page Giter Site logo

mldeng / materialdialog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kerasking/materialdialog

0.0 2.0 0.0 8.36 MB

(Deprecated)An Android dialog library, has strong extensibility, customizability, and for conveniently building Material Design Dialog in Android version 2.2 ~ L.

Java 100.00%

materialdialog's Introduction

Material Dialog v1.3.1

maven-central

This is an Android library, I call it MaterialDialog. It's very easy to use. Just new it & call show() method, then the beautiful AlertDialog will show automatically. It is artistic, conforms to Google Material Design. I hope that you will like it, and enjoys it. ^ ^

Screenshots

screenshotscreenshot screenshotscreenshot

You can also change the background with a image what you like. it's very easy!:

screenshotscreenshot

And with the v1.0.6, you can use the setContentView() to change the message view to your custom view.

Example:

setContentViewsetContentView

Usage

Step 1

Gradle

maven-central

dependencies {
    compile 'me.drakeet.materialdialog:library:1.3.1'
}

If it doesn't work, please send me a email, [email protected]

####Or

Import the library, then add it to your /settings.gradle and /app/build.gradle, if you don't know how to do it, you can read my blog for help.

Android Studio 简介及导入 jar 包和第三方开源库方法

Step 2

It's very easy, just like this:

MaterialDialog mMaterialDialog = new MaterialDialog(this)
    .setTitle("MaterialDialog")
    .setMessage("Hello world!")
    .setPositiveButton("OK", new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mMaterialDialog.dismiss();
            ...
        }
    })
    .setNegativeButton("CANCEL", new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mMaterialDialog.dismiss();
            ...
        }
    });

mMaterialDialog.show();

// You can change the message anytime. before show
mMaterialDialog.setTitle("提示");
mMaterialDialog.show();
// You can change the message anytime. after show
mMaterialDialog.setMessage("你好,世界~");

With the first initial and mMaterialDialog.show(), it will show automatically.

In addition, you can call setView (View v) & setContentView() to set a View what you like or custom after the instantiation. This replaces the title and message.

EditText contentView = new EditText(this);
MaterialDialog mMaterialDialog = new MaterialDialog(this).setView(contentView);

mMaterialDialog.show();

And, you can call setBackgroundResource(int resId) or setBackground(Drawable drawable) to change the background:

mMaterialDialog.setBackgroundResource(R.drawable.background);

1.2.8

  • Fix the problem of soft keyboard repeat display
  • Fix the action buttons became dismiss when scroll view height is too long.
  • Add get buttons so that you can custom them.
  • Update the versions of gradle and some build tools.

1.2.1

  • Now, It has been able to run perfectly on L.
  • Fix the button style on L.
  • Fix the problem, so that it can correctly use AutoCompleteTextView & EditText.

1.1.0

  • Fix the keyboard/input bug when more show.

1.0.9

  • If title is null, no show it, but I think it is ugly without title...;
  • Add set Button's text by string resId, e.g. setPositiveButton(android.R.string.yes, new View.OnClickListener()

1.0.8

  • Add every method return this

1.0.7

  • Fix the BUG of Can not show soft keyboard automatically when focus is on an EditText.
  • Add setCanceledOnTouchOutside() // You should set it before show(), otherwise, it can't take effect.
  • Add setContentView()
  • Add Button press style;
  • ...

I recently was too busy, if you have any Suggestions for the library, I encourage you to read the source code, and try to achieve your requirements, and then I'll merger it. We create good world together.

BUG

DEMO

demo apk v1.2.8

About me

I am a student in China, I love reading pure literature, love Japanese culture and Hongkong music. At the same time, I am also obsessed with writing code. If you have any questions or want to make friends with me, you can write to me: [email protected]

In addition, my blog: http://drakeet.me

If you like my open source projects, you can follow me: https://github.com/drakeet

License

Copyright 2014 drakeet

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

materialdialog's People

Contributors

drakeet avatar whilu avatar enricocid avatar badoualy avatar cashow avatar minia68 avatar badboy-tian avatar

Watchers

James Cloos avatar  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.