diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views/ViewUtils.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/views/ViewUtils.kt | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/ViewUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/ViewUtils.kt deleted file mode 100644 index 8dc3f01f..00000000 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/ViewUtils.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.pitchedapps.frost.views - -import android.content.res.ColorStateList -import android.support.annotation.ColorInt -import android.support.annotation.ColorRes -import android.support.annotation.StringRes -import android.support.design.widget.Snackbar -import android.support.v4.content.ContextCompat -import android.view.View -import android.view.ViewGroup -import android.widget.ProgressBar - - -/** - * Created by Allan Wang on 2017-05-31. - */ -fun View.matchParent() { - with(layoutParams) { - height = ViewGroup.LayoutParams.MATCH_PARENT - width = ViewGroup.LayoutParams.MATCH_PARENT - } -} - -fun ProgressBar.tintRes(@ColorRes id: Int) = tint(ContextCompat.getColor(context, id)) - -fun ProgressBar.tint(@ColorInt color: Int) { - val sl = ColorStateList.valueOf(color) - progressTintList = sl - secondaryProgressTintList = sl - indeterminateTintList = sl -} - -fun View.snackbar(text: String, duration: Int = Snackbar.LENGTH_LONG) { - Snackbar.make(this, text, duration).show() -} - -fun View.snackbar(@StringRes textId: Int, duration: Int = Snackbar.LENGTH_LONG) { - Snackbar.make(this, textId, duration).show() -}
\ No newline at end of file |