|
|
@ -34,32 +34,54 @@ import org.isoron.uhabits.utils.sres
|
|
|
|
import org.isoron.uhabits.utils.str
|
|
|
|
import org.isoron.uhabits.utils.str
|
|
|
|
|
|
|
|
|
|
|
|
class EmptyListView(context: Context) : LinearLayout(context) {
|
|
|
|
class EmptyListView(context: Context) : LinearLayout(context) {
|
|
|
|
|
|
|
|
var textTextView: TextView
|
|
|
|
|
|
|
|
var iconTextView: TextView
|
|
|
|
|
|
|
|
|
|
|
|
init {
|
|
|
|
init {
|
|
|
|
orientation = VERTICAL
|
|
|
|
orientation = VERTICAL
|
|
|
|
gravity = CENTER
|
|
|
|
gravity = CENTER
|
|
|
|
visibility = View.GONE
|
|
|
|
visibility = View.GONE
|
|
|
|
|
|
|
|
|
|
|
|
addView(
|
|
|
|
iconTextView = TextView(context).apply {
|
|
|
|
TextView(context).apply {
|
|
|
|
|
|
|
|
text = str(R.string.fa_star_half_o)
|
|
|
|
text = str(R.string.fa_star_half_o)
|
|
|
|
typeface = getFontAwesome()
|
|
|
|
typeface = getFontAwesome()
|
|
|
|
textSize = sp(40.0f)
|
|
|
|
textSize = sp(40.0f)
|
|
|
|
gravity = CENTER
|
|
|
|
gravity = CENTER
|
|
|
|
setTextColor(sres.getColor(R.attr.mediumContrastTextColor))
|
|
|
|
setTextColor(sres.getColor(R.attr.mediumContrastTextColor))
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addView(
|
|
|
|
|
|
|
|
iconTextView,
|
|
|
|
MATCH_PARENT,
|
|
|
|
MATCH_PARENT,
|
|
|
|
WRAP_CONTENT
|
|
|
|
WRAP_CONTENT
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
addView(
|
|
|
|
textTextView = TextView(context).apply {
|
|
|
|
TextView(context).apply {
|
|
|
|
|
|
|
|
text = str(R.string.no_habits_found)
|
|
|
|
text = str(R.string.no_habits_found)
|
|
|
|
gravity = CENTER
|
|
|
|
gravity = CENTER
|
|
|
|
setPadding(0, dp(20.0f).toInt(), 0, 0)
|
|
|
|
setPadding(0, dp(20.0f).toInt(), 0, 0)
|
|
|
|
setTextColor(sres.getColor(R.attr.mediumContrastTextColor))
|
|
|
|
setTextColor(sres.getColor(R.attr.mediumContrastTextColor))
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
addView(
|
|
|
|
|
|
|
|
textTextView,
|
|
|
|
MATCH_PARENT,
|
|
|
|
MATCH_PARENT,
|
|
|
|
WRAP_CONTENT
|
|
|
|
WRAP_CONTENT
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun showDone() {
|
|
|
|
|
|
|
|
visibility = VISIBLE
|
|
|
|
|
|
|
|
iconTextView.text = str(R.string.fa_umbrella_beach)
|
|
|
|
|
|
|
|
textTextView.text = str(R.string.no_habits_left_to_do)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun showEmpty() {
|
|
|
|
|
|
|
|
visibility = VISIBLE
|
|
|
|
|
|
|
|
iconTextView.text = str(R.string.fa_star_half_o)
|
|
|
|
|
|
|
|
textTextView.text = str(R.string.no_habits_found)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun hide() {
|
|
|
|
|
|
|
|
visibility = GONE
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|