|
|
|
@ -5,11 +5,13 @@ import android.content.Context |
|
|
|
import android.content.Intent |
|
|
|
import android.content.Intent |
|
|
|
import android.content.res.Resources |
|
|
|
import android.content.res.Resources |
|
|
|
import android.net.Uri |
|
|
|
import android.net.Uri |
|
|
|
|
|
|
|
import android.view.View |
|
|
|
import android.widget.Toast |
|
|
|
import android.widget.Toast |
|
|
|
import androidx.appcompat.app.AlertDialog |
|
|
|
import androidx.appcompat.app.AlertDialog |
|
|
|
import androidx.appcompat.widget.AppCompatTextView |
|
|
|
import androidx.appcompat.widget.AppCompatTextView |
|
|
|
import androidx.browser.customtabs.CustomTabsIntent |
|
|
|
import androidx.browser.customtabs.CustomTabsIntent |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
|
|
|
|
import androidx.core.view.isVisible |
|
|
|
import net.pokeranalytics.android.BuildConfig |
|
|
|
import net.pokeranalytics.android.BuildConfig |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.calculus.TextFormat |
|
|
|
import net.pokeranalytics.android.calculus.TextFormat |
|
|
|
@ -107,4 +109,16 @@ fun showAlertDialog(context: Context, title: Int? = null, message: Int? = null) |
|
|
|
fun AppCompatTextView.setTextFormat(textFormat: TextFormat, context: Context) { |
|
|
|
fun AppCompatTextView.setTextFormat(textFormat: TextFormat, context: Context) { |
|
|
|
this.setTextColor(textFormat.getColor(context)) |
|
|
|
this.setTextColor(textFormat.getColor(context)) |
|
|
|
this.text = textFormat.text |
|
|
|
this.text = textFormat.text |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun View.hideWithAnimation() { |
|
|
|
|
|
|
|
isVisible = true |
|
|
|
|
|
|
|
animate().cancel() |
|
|
|
|
|
|
|
animate().alpha(0f).withEndAction { isVisible = false }.start() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun View.showWithAnimation() { |
|
|
|
|
|
|
|
isVisible = true |
|
|
|
|
|
|
|
animate().cancel() |
|
|
|
|
|
|
|
animate().alpha(1f).start() |
|
|
|
} |
|
|
|
} |