Skip to content

Commit a6ef9dd

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 4643648 + dadd1b8 commit a6ef9dd

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.2'
15+
16+
}
17+
```
18+
<h1>Material Dialog-Library</h1>
19+
20+
<h3>Wifi Dialog</h3>
21+
22+
```kotlin
23+
24+
val dialog = WifiDialog()
25+
dialog.show(supportFragmentManager, "wifi_dialog")
26+
dialog.createDialog("Google wifi", "Pixel 2 A", "i929uui4ui", "Wpa2")
27+
dialog.setonButtonsCLickedListener(object : WifiDialog.WiFiDialogListeners {
28+
override fun okButtonClicked(password: String) {
29+
Toast.makeText(this@MainActivity, "$password", Toast.LENGTH_SHORT).show()
30+
}
31+
override fun cancelButtonClicked() {}
32+
})
33+
34+
```
35+
<h3>Color Dialog</h3>
36+
37+
```kotlin
38+
val dialog = ColorDialog()
39+
dialog.show(supportFragmentManager, "color_dialog")
40+
dialog.setOnColorSelectedListener(object : ColorDialog.OnColorSelectListener {
41+
override fun OnColorSelected(color: Int) {
42+
binding.colorsheetDialog.setBackgroundColor(color)
43+
}
44+
45+
})
46+
```
47+
<h3>Dialog Bassic</h3>
48+
49+
```kotlin
50+
val basicDialog = BasicDialog(this)
51+
basicDialog.createDialog(
52+
title = "Lorem ipsum?",
53+
mainTxt = "Lorem ipsum dolor sit amet, consectetur adipiscing elit," +
54+
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
55+
okBtnTxt = "Agree",
56+
cancelBtnTxt = "Disagree"
57+
)
58+
basicDialog.show(supportFragmentManager, "basic_dialog")
59+
basicDialog.setOnButtonClickListener(object : BasicDialog.BasicDialogListeners {
60+
override fun okButtonClicked() {
61+
Toast.makeText(this@MainActivity, "DISAGREE", Toast.LENGTH_SHORT).show()
62+
63+
}
64+
65+
override fun cancelButtonClicked() {
66+
Toast.makeText(this@MainActivity, "AGREE", Toast.LENGTH_SHORT).show()
67+
68+
}
69+
70+
})
71+
```
72+
73+
<h3>Date Dialog</h3>
74+
75+
```kotlin
76+
val dialog = DateAndTimeDialog()
77+
dialog.show(supportFragmentManager, "date_dialog")
78+
dialog.setOnOkButtonClicked(object : DateAndTimeDialog.OnButtonClicked {
79+
@RequiresApi(Build.VERSION_CODES.M)
80+
override fun OnOkButtonClicked(datePicker: DatePicker, timePicker: TimePicker) {
81+
val date = "${datePicker.dayOfMonth}.${datePicker.month}.${datePicker.year} " +
82+
"${timePicker.hour}:${timePicker.minute}"
83+
Toast.makeText(this@MainActivity, date, Toast.LENGTH_SHORT).show()
84+
}
85+
86+
87+
})
88+
```
89+
90+
91+
## Screenshot
92+
93+
![Untitled (2)](https://user-images.githubusercontent.com/108933534/222921972-fce8f015-48d6-4673-a444-792afda253b8.png)
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)