项目作者: colakcode

项目描述 :
Easy Options Dialog for your Android app. Dialog window with three option buttons for simple requests you want to users in your Android applications.
高级语言: Java
项目地址: git://github.com/colakcode/clkOptionsDialog.git
创建时间: 2020-08-18T18:56:33Z
项目社区:https://github.com/colakcode/clkOptionsDialog

开源协议:MIT License

下载


clkOptionsDialog

Platform
API
API
API

Easy Options Dialog for your Android app. Dialog window with three option buttons for simple requests you want to users in your Android applications.

GetStarted

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

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Step 2. Add the dependency

  1. dependencies {
  2. implementation 'com.github.colakcode:clkOptionsDialog:v0.1.1'
  3. }

Screenshot

OptionsDialog

Java Code

  1. OptionsDialog.showWithThreeOptions(activity, "Do you want to delete only this file or all your files?", "Delete", "Delete All", "Cancel", OptionsDialog.DialogGravity.BOTTOM );

or with just one option button

  1. OptionsDialog.showWithOneOption(activity, "Information window...", "Cancel", OptionsDialog.DialogGravity.CENTER );

with two option button

  1. OptionsDialog.showWithTwoOptions(activity, "Do you want to save this file?", "Save", "Cancel", OptionsDialog.DialogGravity.BOTTOM );

Call buttons and set onClickMethod

  1. OptionsDialog.getButtonLeft().setOnClickListener(new View.OnClickListener() {
  2. @Override
  3. public void onClick(View v) {
  4. OptionsDialog.dismiss();
  5. Toast.makeText(context, "Cancel", Toast.LENGTH_SHORT).show();
  6. }
  7. });

Set Background Color

  1. OptionsDialog.setBackgroundColor(Color.BLUE);

Other Options

You can choose many options such as background color, information text color and button text colors.

  1. OptionsDialog.setInfoTextColor(Color.BLACK);
  2. OptionsDialog.setAllButtonTextColor(Color.RED);

Open dialog window OptionsDialog.DialogGravity.BOTTOM, *.CENTER or *.TOP

Author

Kemal ÇOLAK @colakcode on GitHub

License

The MIT License (MIT)

Copyright (c) 2020 Kemal ÇOLAK

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.