Skip to content

Commit

Permalink
toast gravity removed
Browse files Browse the repository at this point in the history
  • Loading branch information
har2008preet committed Aug 26, 2022
1 parent 2edd8da commit 5f969ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Toast/src/main/java/com/collegedunia/toast/ToastGenerate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ToastGenerate constructor(private val context: Context) {
toastLayout = layoutInflater.inflate(R.layout.layout_custom_toast, null) as View
root = toastLayout.findViewById(R.id.root)

root.setPadding(50, 0, 50, 50);
root.setPadding(50, 0, 50, 0);

MediatorLiveData<Pair<ArrayList<ToastModel>?, Boolean?>>().apply {
addSource(listen) { value = it to value?.second }
Expand Down Expand Up @@ -171,7 +171,6 @@ class ToastGenerate constructor(private val context: Context) {

private fun showToast(toastLayout: View, length: ToastLength?) {
var toast: Toast = Toast(context)
toast.setGravity(Gravity.CENTER_HORIZONTAL or Gravity.BOTTOM,0,0)
toast.duration = if(length==ToastLength.LONG){
Toast.LENGTH_LONG
}else{
Expand Down

0 comments on commit 5f969ea

Please sign in to comment.