Skip to content

Commit

Permalink
Merge pull request #12 from MoyeoRun/feature/toast_extension
Browse files Browse the repository at this point in the history
[#11] 각종 편의 확장함수 추가 - 토스트
  • Loading branch information
ethan-223 authored Mar 23, 2022
2 parents 75ecb96 + 78fd215 commit 2ab1469
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.moyerun.moyeorun_android.common.extension

import android.app.Activity
import android.widget.Toast

fun Activity.toast(msg: String, isShort: Boolean = true) {
Toast.makeText(this, msg, if (isShort) Toast.LENGTH_SHORT else Toast.LENGTH_LONG).show()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.moyerun.moyeorun_android.common.extension

import android.widget.Toast
import androidx.fragment.app.Fragment

fun Fragment.toast(msg: String, isShort: Boolean = false) {
Toast.makeText(context, msg, if (isShort) Toast.LENGTH_SHORT else Toast.LENGTH_LONG).show()
}

0 comments on commit 2ab1469

Please sign in to comment.