commit
6867c9b257
@ -1,47 +0,0 @@ |
|||||||
package net.pokeranalytics.android.ui.view |
|
||||||
|
|
||||||
import android.content.Context |
|
||||||
import android.util.AttributeSet |
|
||||||
import androidx.appcompat.widget.AppCompatTextView |
|
||||||
import net.pokeranalytics.android.calculus.TextFormat |
|
||||||
|
|
||||||
/** |
|
||||||
* Extended TextView to display a TextFormat object |
|
||||||
*/ |
|
||||||
class FormattedTextView: AppCompatTextView { |
|
||||||
|
|
||||||
var textFormat: TextFormat? = null |
|
||||||
set(value) { |
|
||||||
field = value |
|
||||||
updateUI() |
|
||||||
} |
|
||||||
|
|
||||||
constructor(context: Context?) : super(context) { |
|
||||||
init(null) |
|
||||||
} |
|
||||||
|
|
||||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) { |
|
||||||
init(attrs) |
|
||||||
} |
|
||||||
|
|
||||||
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { |
|
||||||
init(attrs) |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Init class |
|
||||||
*/ |
|
||||||
private fun init(attrs: AttributeSet?) { |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Update the UI to manage currency format & color management |
|
||||||
*/ |
|
||||||
private fun updateUI() { |
|
||||||
textFormat?.let { |
|
||||||
setTextColor(it.getColor(context)) |
|
||||||
text = it.text |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -0,0 +1,23 @@ |
|||||||
|
package net.pokeranalytics.android.util |
||||||
|
|
||||||
|
/** |
||||||
|
* URL enum |
||||||
|
*/ |
||||||
|
enum class URL(var value: String) { |
||||||
|
|
||||||
|
// Terms |
||||||
|
PRIVACY_POLICY("https://www.poker-analytics.net/privacypolicy.html"), |
||||||
|
TERMS("https://www.poker-analytics.net/terms.html"), |
||||||
|
|
||||||
|
// Social Network |
||||||
|
BLOG("https://medium.com/poker-analytics"), |
||||||
|
INSTAGRAM("https://www.instagram.com/pokeranalytics"), |
||||||
|
TWITTER("https://twitter.com/paapptweet"), |
||||||
|
FACEBOOK("https://www.facebook.com/171053452998758"), |
||||||
|
|
||||||
|
// Support |
||||||
|
SUPPORT_EMAIL("support@pokeranalytics.net") |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
@ -1,7 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<resources> |
|
||||||
<declare-styleable name="FormattedTextView"> |
|
||||||
<attr name="isCurrency" format="boolean" /> |
|
||||||
<attr name="amount" format="float" /> |
|
||||||
</declare-styleable> |
|
||||||
</resources> |
|
||||||
Loading…
Reference in new issue