Skip to content

Commit f8f44dc

Browse files
committed
toast root layout set
1 parent 5f969ea commit f8f44dc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Toast/src/main/java/com/collegedunia/toast/ToastGenerate.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.collegedunia.toast
33
import android.annotation.SuppressLint
44
import android.content.Context
55
import android.util.Log
6-
import android.view.Gravity
76
import android.view.LayoutInflater
87
import android.view.View
98
import android.view.View.GONE
@@ -16,7 +15,6 @@ import androidx.lifecycle.LifecycleOwner
1615
import androidx.lifecycle.MediatorLiveData
1716
import androidx.lifecycle.MutableLiveData
1817
import java.util.*
19-
import kotlin.collections.ArrayList
2018
import kotlin.concurrent.schedule
2119

2220

@@ -46,6 +44,14 @@ class ToastGenerate constructor(private val context: Context) {
4644
toastLayout = layoutInflater.inflate(R.layout.layout_custom_toast, null) as View
4745
root = toastLayout.findViewById(R.id.root)
4846

47+
val lp = LinearLayout.LayoutParams(
48+
LinearLayout.LayoutParams.MATCH_PARENT,
49+
LinearLayout.LayoutParams.MATCH_PARENT
50+
)
51+
52+
53+
root.layoutParams = lp
54+
4955
root.setPadding(50, 0, 50, 0);
5056

5157
MediatorLiveData<Pair<ArrayList<ToastModel>?, Boolean?>>().apply {

0 commit comments

Comments
 (0)