The library is a flexible implementation of toast message display in android application development. It allows almost full customization of displaying a toast message including changing the background drawable, text color to mention few.
#Add the JitPack repository to your build file(project)
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
implementation 'com.github.darothub:DarotToastLib:version' gdToast("Hello World!", Gravity.CENTER) gdToast("Hello World", R.drawable.ic_android_green_24dp, Gravity.BOTTOM) gdToast("Hello World", Gravity.CENTER, Pair(0, 20)) gdToast("Hello World",R.drawable.ic_android_green_24dp, R.color.newColor, Gravity.BOTTOM) gdToast("Hello World", getDrawable(R.drawable.ic_android_green_24dp)) gdToast(
message = "Hello World",
icon = R.drawable.ic_android_green_24dp,
backgroundColor = "#000000",
textColor = R.color.newColor,
gravity = Gravity.CENTER,
toastDuration = Toast.LENGTH_LONG
)gdToast(
message = "Hello World",
icon = R.drawable.ic_android_green_24dp,
backgroundColor = R.color.newColor,
textColor = R.color.colorPrimaryDark,
gravity = Gravity.TOP,
textGravity = Gravity.START,
x_Offset = 10,
y_OffSet = 20,
toastDuration = Toast.LENGTH_SHORT
)Darot.getGdDrawableBackgrnd = your-new-drawable-xml gdErrorToast("Error World", Gravity.TOP) requireActivity.gdToast("Hello World!", Gravity.CENTER) Copyright 2020 Durosomo Abdulrasaq Darot
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.