Skip to content

Commit ad7b993

Browse files
Create README.md
1 parent d3ad7bf commit ad7b993

1 file changed

Lines changed: 112 additions & 0 deletions

File tree

README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Dialog-Library
2+
[![platform](https://img.shields.io/badge/platform-Android-yellow.svg)](https://www.android.com)
3+
[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=plastic)](https://android-arsenal.com/api?level=24)
4+
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0.html)
5+
6+
7+
## Dependency
8+
9+
Add this to your module's `build.gradle` file:
10+
11+
```gradle
12+
dependencies {
13+
...
14+
implementation 'com.github.professorDeveloper:Dialog-Library:1.0.1'
15+
}
16+
```
17+
<h1>Material Dialog-Library</h1>
18+
19+
<h3>Wifi Dialog</h3>
20+
21+
```kotlin
22+
...
23+
val dialog = WifiDialog()
24+
dialog.show(supportFragmentManager, "wifi_dialog")
25+
dialog.createDialog("Google wifi", "Pixel 2 A", "i929uui4ui", "Wpa2")
26+
dialog.setonButtonsCLickedListener(object : WifiDialog.WiFiDialogListeners {
27+
override fun okButtonClicked(password: String) {
28+
Toast.makeText(this@MainActivity, "$password", Toast.LENGTH_SHORT).show()
29+
}
30+
override fun cancelButtonClicked() {}
31+
})
32+
...
33+
```
34+
<h3>Color Dialog</h3>
35+
36+
```kotlin
37+
val dialog = ColorDialog()
38+
dialog.show(supportFragmentManager, "color_dialog")
39+
dialog.setOnColorSelectedListener(object : ColorDialog.OnColorSelectListener {
40+
override fun OnColorSelected(color: Int) {
41+
binding.colorsheetDialog.setBackgroundColor(color)
42+
}
43+
44+
})
45+
```
46+
<h3>Dialog Bassic</h3>
47+
48+
```kotlin
49+
val basicDialog = BasicDialog(this)
50+
basicDialog.createDialog(
51+
title = "Lorem ipsum?",
52+
mainTxt = "Lorem ipsum dolor sit amet, consectetur adipiscing elit," +
53+
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
54+
okBtnTxt = "Agree",
55+
cancelBtnTxt = "Disagree"
56+
)
57+
basicDialog.show(supportFragmentManager, "basic_dialog")
58+
basicDialog.setOnButtonClickListener(object : BasicDialog.BasicDialogListeners {
59+
override fun okButtonClicked() {
60+
Toast.makeText(this@MainActivity, "DISAGREE", Toast.LENGTH_SHORT).show()
61+
62+
}
63+
64+
override fun cancelButtonClicked() {
65+
Toast.makeText(this@MainActivity, "AGREE", Toast.LENGTH_SHORT).show()
66+
67+
}
68+
69+
})
70+
```
71+
72+
<h3>Date Dialog</h3>
73+
74+
```kotlin
75+
val dialog = DateAndTimeDialog()
76+
dialog.show(supportFragmentManager, "date_dialog")
77+
dialog.setOnOkButtonClicked(object : DateAndTimeDialog.OnButtonClicked {
78+
@RequiresApi(Build.VERSION_CODES.M)
79+
override fun OnOkButtonClicked(datePicker: DatePicker, timePicker: TimePicker) {
80+
val date = "${datePicker.dayOfMonth}.${datePicker.month}.${datePicker.year} " +
81+
"${timePicker.hour}:${timePicker.minute}"
82+
Toast.makeText(this@MainActivity, date, Toast.LENGTH_SHORT).show()
83+
}
84+
85+
86+
})
87+
```
88+
89+
90+
## Screenshot
91+
92+
![Dialogs](https://github.com/Dan629pl/NordanMaterialDialog/blob/master/img/dialogs.png)
93+
94+
95+
## License
96+
97+
* [Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
98+
99+
```
100+
Copyright 2020 ProfessorDveloper Library
101+
102+
Licensed under the Apache License, Version 2.0 (the "License");
103+
you may not use this file except in compliance with the License.
104+
You may obtain a copy of the License at
105+
106+
http://www.apache.org/licenses/LICENSE-2.0
107+
108+
Unless required by applicable law or agreed to in writing, software
109+
distributed under the License is distributed on an "AS IS" BASIS,
110+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111+
See the License for the specific language governing permissions and
112+
limitations under the License.

0 commit comments

Comments
 (0)