-
For old version of gradle (before arctic fox update)
Add this in your root
build.gradlefile (project scope) :
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}-
For gradle version 7 or latest
Add this in your root
setting.gradlefile :
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}Add this to your module's build.gradle file :
dependencies {
...
implementation 'com.github.KylixEza:Raion-UI-Kit:version'
}you can check the version on jitpack badge above or on release tag
RaionToast.Builder()
.setContext(this@MainActivity)
.setText("Hello there this is RaionToast")
.setLogoVisibility(true)
.setDuration(Toast.LENGTH_SHORT)
.setToastType(ToastType.INFO)
.setToastShape(ToastShape.RECTANGLE)
.build().show()| Method / Class | Parameter | Usage | Attribute Default Value |
|---|---|---|---|
Builder |
- | Build the toast | No default value because it's mandatory |
setText |
String |
To set message that will shown from toast | "" |
setToastType |
ToastType |
To set type of toast | ToastType.NORMAL |
setLogoVisibility |
Boolean |
To set visibility of Raion logo | true |
setDuration |
Int |
To set duration of toast | Toast.LENGTH_SHORT |
setToastShape |
ToastShape |
To set shape of toast | ToastShape.ROUNDED |
build |
- | To create the toast => returns toast object | - |
- To display a normal Snackbar:
RaionSneeze.makeNormalSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG).show()
RaionSneeze.showNormalSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG)- To display a success Snackbar:
RaionSneeze.makeSuccessSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG).show()
RaionSneeze.showSuccessSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG)- To display an error Snackbar:
RaionSneeze.makeErrorSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG).show()
RaionSneeze.showErrorSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG)- To display an warning Snackbar:
RaionSneeze.makeWarningSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG).show()
RaionSneeze.showWarningSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG)- To display an info Snackbar:
RaionSneeze.makeInfoSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG).show()
RaionSneeze.showInfoSneeze(findViewById(R.id.content), "Hello there this is raion snackbar", Snackbar.LENGTH_LONG)Dialog type currently available:
Confirmation dialog
More dialog type will added soon. Insya'allah
- Is Dialog type which has
Icon, Main text, Confirm Button, Cancel Button
- Default basic function
val dialog = RaionDialog
.Confirmation()
.build(context, onYesBtnClick = {...},onNoBtnClick = {...})
dialog.show()
- Available costumization function
Function Parameter Type Usage Default Parameter Value setButtonColoryesColorId:Int&noColorId:Intto set colors of Yes & No button R.color.DefaultCyan,R.color.DefaultRedsetButtonTextleftText:String,rightText:String,leftTextColor:Int,rightTextColor:Intto set text of each button, and set the color of the text "yes","no",R.color.DefaultBlack,R.color.DefaultBlacksetTexttext:String&textColor:Intto set the main text and its color "Confirm?",R.color.DefaultBlacksetBackgroundColorcolorId:Intto set background color of the dialog R.color.DefaultWhitesetIconiconId:Intto set main icon of dialog, the default is Raion Logo R.drawable.icon_raionsetTypedialogType:DialogTypeto change the dialog type, such as TOP, CENTER, and BOTTOM DialogType.CENTERbuildcontext:Context,onYesBtnClick:Unit,onNoBtnClick:Unitto build the dialog. This function must be called last no default parameter, all parameter must be implemented
>> You can costumize the dialog by calling available function before calling build function
Raion-UI-Kit is under MIT License and Raion Community License
Raion Community License
Copyright (c) 2022 Raion Community Faculty of Computer Science University of Brawijaya
This project belongs to Raion Community
Raion-UI-Kit is partially open. This project open to use for everyone but
close for any changes from outside Raion Community. If any developers are
interested to contribute in this project but are not the part of Raion Community,
they must contact the Project Lead or Raion Community through social media
(Recommend to contact via Instagram or LinkedIn).
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of this project.
Don't forget to βthis repository to motivates me to share more open source library

