This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.app.Activity | |
import android.content.Context | |
import android.view.inputmethod.InputMethodManager | |
import androidx.fragment.app.Fragment | |
fun Fragment?.hideKeyboard() = | |
(this?.activity?.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?)?.let { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.graphics.Typeface | |
import android.text.Selection | |
import android.text.Spannable | |
import android.text.TextPaint | |
import android.text.style.* | |
import android.view.View | |
import android.widget.TextView | |
import androidx.annotation.ColorInt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.animation.AnimatorSet | |
import android.animation.ObjectAnimator | |
import android.view.View | |
fun View.fadeIn(): AnimatorSet { | |
val animatorSet = AnimatorSet() | |
val object1: ObjectAnimator = ObjectAnimator.ofFloat(this, "alpha", 0f, 1f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.animation.AnimatorSet | |
import android.animation.ObjectAnimator | |
import android.view.View | |
fun View.bounceIn(): AnimatorSet { | |
val animatorSet = AnimatorSet() | |
val object1: ObjectAnimator = ObjectAnimator.ofFloat(this, "alpha", 0f, 1f, 1f, 1f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.animation.AnimatorSet | |
import android.animation.ObjectAnimator | |
import android.view.View | |
import android.view.ViewGroup | |
fun View.slideInDown(): AnimatorSet { | |
val animatorSet = AnimatorSet() | |
val distance = (top + height).toFloat() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.animation.AnimatorSet | |
import android.animation.ObjectAnimator | |
import android.view.View | |
fun View.flipInX(): AnimatorSet { | |
val animatorSet = AnimatorSet() | |
val object1: ObjectAnimator = ObjectAnimator.ofFloat(this, "alpha", 0.25f, 0.5f, 0.75f, 1f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.animation.AnimatorSet | |
import android.animation.ObjectAnimator | |
import android.view.View | |
fun View.attentionBounce(): AnimatorSet { | |
val animatorSet = AnimatorSet() | |
val object1: ObjectAnimator = ObjectAnimator.ofFloat(this, "translationY", 0f, 0f, -30f, 0f, -15f, 0f, 0f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.graphics.* | |
import android.graphics.Paint.ANTI_ALIAS_FLAG | |
import android.graphics.Paint.DITHER_FLAG | |
import androidx.annotation.ColorInt | |
fun addWatermark( | |
bitmap: Bitmap, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
inline val CharSequence?.isEmail: Boolean get() = isMatch(REGEX_EMAIL) | |
fun CharSequence?.isMatch(regex: String): Boolean = | |
!this.isNullOrEmpty() && Regex(regex).matches(this) | |
const val REGEX_EMAIL = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.skyyo.ext | |
import android.util.Log | |
import android.view.View | |
fun hideViews(vararg views: View) = views.forEach { it.visibility = View.GONE } | |
fun showViews(vararg views: View) = views.forEach { it.visibility = View.VISIBLE } | |
fun Any.log(message: String) = Log.d("vv", message) |
OlderNewer