File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
mvvm/src/main/java/com/catchpig/mvvm/base Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.catchpig.mvvm.base.activity
22
33import android.content.Intent
44import android.os.Bundle
5+ import android.view.Gravity
56import android.view.LayoutInflater
67import android.view.View
78import android.view.ViewGroup
@@ -107,12 +108,12 @@ open class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
107108 titleText.setText(title)
108109 }
109110
110- fun snackBar (text : CharSequence ) {
111- SnackbarManager .show(rootBinding.layoutBody , text)
111+ fun snackBar (text : CharSequence , gravity : Int = Gravity . BOTTOM ) {
112+ SnackbarManager .show(bodyBinding.root , text, gravity )
112113 }
113114
114- fun snackBar (@StringRes textRes : Int ) {
115- SnackbarManager .show(rootBinding.layoutBody , textRes)
115+ fun snackBar (@StringRes textRes : Int , gravity : Int = Gravity . BOTTOM ) {
116+ SnackbarManager .show(bodyBinding.root , textRes, gravity )
116117 }
117118
118119 fun loadingDialog () {
Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ open class BaseFragment<VB : ViewBinding> : Fragment() {
7171 SnackbarManager .show(bodyBinding.root, text, gravity)
7272 }
7373
74- fun snackBar (@StringRes textRes : Int ) {
75- SnackbarManager .show(bodyBinding.root, textRes)
74+ fun snackBar (@StringRes textRes : Int , gravity : Int = Gravity . BOTTOM ) {
75+ SnackbarManager .show(bodyBinding.root, textRes, gravity )
7676 }
7777
7878 fun loadingView () {
You can’t perform that action at this time.
0 commit comments