Giter Site home page Giter Site logo

oooalertdialog's Introduction

OoOAlertDialog

platform API License

Pré-requisitos

  • É necessário que o compileSdkVersion seja maior ou igual a 26.

  • Adicione isto em seu arquivo build.gradle (Project: name_project):

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
  • Adicione ao build.gradle (Module: app):
dependencies {
        implementation 'com.github.Joinersa:OoOAlertDialog:1.0.3'
}

Utilizando o OoOAlertDialog

new OoOAlertDialog.Builder(MainActivity.this)
                        .setTitle("OoOAlertDialog")
                        .setMessage("Deseja fechar este OoOAlertDialog?")
                        .setImage(R.drawable.my_imagem)
                        .setAnimation(Animation.POP)
                        .setPositiveButton("Fechar", null)
                        .setNegativeButton("Mensagem", new OnClickListener() {
                            @Override
                            public void onClick() {
                                Toast.makeText(MainActivity.this, "mensagem", Toast.LENGTH_SHORT).show();
                            }
                        })
                        .build();

Scrennshots

Funções

  • Imagem:

É possível setar uma imagem no topo da janela de diálogo com o método setImage(int id).

  • Título e mensagem:

Título e mensagem são setados respectivamente com setTitle(String title) e setMessage(String message).

  • Animações:

Existem 4 tipos de animações pré-definidas que você pode usar: ZOOM, POP, SLIDE e SIDE. A animação pode ser definida com o método: setAnimation(Animation animation).

  • Cancelável:

A janela de diálogo pode ou não ser cancelável utilizando o método setCancelable(boolean cancelable).

  • Botões (Positivo e Negativo):

Existem dois tipos de botões que podem ou não ser utilizados. Para criar os botões, com eventos de click ou não, basta utilizar os métodos, setPositiveButton(String text, OnClickListener listener) para o botão positivo e setNegativeButton(String text, OnClickListener listener) para o botão negativo.

  • Cor de background da janela:

É possível mudar a cor da janela de diálogo com o método: setBackgroundColor(int color).

  • Cor dos Botões:

Os botões positivo e negativo podem ter suas cores alteradas através dos métodos: setPositiveButtonColor(int color) e setNegativeButtonColor(int color).

  • Cor dos textos dos Botões:

Para modificação das cores dos textos dos botões positivo e negativo, utilizam-se os métodos: setPositiveButtonTextColor(int color) e setNegativeButtonTextColor(int color).

  • Cor de Título e Separador:

É possível definir uma cor para o texto do título, utilizando o método: setTitleColor(int color). A cor do separador é definida com a mesma cor do título.

  • Cor da mensagem:

Para modificar a cor do texto da mensagem, utiliza-se o método: setMessageColor(int color).

Contatos

Licença

Copyright 2018 Joiner Sá

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.

oooalertdialog's People

Contributors

joinersa avatar

Watchers

Michael jentsch 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.