Dialog-Library
Dependency
Add this to your module's build.gradle
file:
dependencies {
implementation 'com.github.professorDeveloper:Dialog-Library:1.0.1'
}
Material Dialog-Library
Wifi Dialog
val dialog = WifiDialog()
dialog.show(supportFragmentManager, "wifi_dialog")
dialog.createDialog("Google wifi", "Pixel 2 A", "i929uui4ui", "Wpa2")
dialog.setonButtonsCLickedListener(object : WifiDialog.WiFiDialogListeners {
override fun okButtonClicked(password: String) {
Toast.makeText(this@MainActivity, "$password", Toast.LENGTH_SHORT).show()
}
override fun cancelButtonClicked() {}
})
Color Dialog
val dialog = ColorDialog()
dialog.show(supportFragmentManager, "color_dialog")
dialog.setOnColorSelectedListener(object : ColorDialog.OnColorSelectListener {
override fun OnColorSelected(color: Int) {
binding.colorsheetDialog.setBackgroundColor(color)
}
})
Dialog Bassic
val basicDialog = BasicDialog(this)
basicDialog.createDialog(
title = "Lorem ipsum?",
mainTxt = "Lorem ipsum dolor sit amet, consectetur adipiscing elit," +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
okBtnTxt = "Agree",
cancelBtnTxt = "Disagree"
)
basicDialog.show(supportFragmentManager, "basic_dialog")
basicDialog.setOnButtonClickListener(object : BasicDialog.BasicDialogListeners {
override fun okButtonClicked() {
Toast.makeText(this@MainActivity, "DISAGREE", Toast.LENGTH_SHORT).show()
}
override fun cancelButtonClicked() {
Toast.makeText(this@MainActivity, "AGREE", Toast.LENGTH_SHORT).show()
}
})
Date Dialog
val dialog = DateAndTimeDialog()
dialog.show(supportFragmentManager, "date_dialog")
dialog.setOnOkButtonClicked(object : DateAndTimeDialog.OnButtonClicked {
@RequiresApi(Build.VERSION_CODES.M)
override fun OnOkButtonClicked(datePicker: DatePicker, timePicker: TimePicker) {
val date = "${datePicker.dayOfMonth}.${datePicker.month}.${datePicker.year} " +
"${timePicker.hour}:${timePicker.minute}"
Toast.makeText(this@MainActivity, date, Toast.LENGTH_SHORT).show()
}
})
Screenshot
License
Copyright 2020 ProfessorDveloper Library
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.
Top comments (0)