2018-01-17 18:39:16 +01:00
|
|
|
package jp.juggler.subwaytooter
|
|
|
|
|
|
|
|
import android.support.v7.widget.RecyclerView
|
|
|
|
import android.view.View
|
|
|
|
import android.widget.Button
|
|
|
|
import android.widget.TextView
|
|
|
|
import jp.juggler.subwaytooter.table.SavedAccount
|
|
|
|
import jp.juggler.subwaytooter.util.LogCategory
|
2018-01-21 13:46:36 +01:00
|
|
|
import jp.juggler.subwaytooter.util.scan
|
2018-01-17 18:39:16 +01:00
|
|
|
|
|
|
|
internal abstract class ViewHolderHeaderBase(val activity : ActMain, val viewRoot : View) :
|
|
|
|
RecyclerView.ViewHolder(viewRoot) {
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
private val log = LogCategory("HeaderViewHolderBase")
|
|
|
|
}
|
|
|
|
|
|
|
|
internal lateinit var column : Column
|
|
|
|
internal lateinit var access_info : SavedAccount
|
|
|
|
|
|
|
|
init {
|
2018-01-21 13:46:36 +01:00
|
|
|
viewRoot.scan { v ->
|
2018-01-17 18:39:16 +01:00
|
|
|
try {
|
|
|
|
if(v is Button) {
|
|
|
|
// ボタンは太字なので触らない
|
|
|
|
} else if(v is TextView) {
|
|
|
|
if(activity.timeline_font != null) {
|
|
|
|
v.typeface = activity.timeline_font
|
|
|
|
}
|
|
|
|
if(! activity.timeline_font_size_sp.isNaN()) {
|
|
|
|
v.textSize = activity.timeline_font_size_sp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch(ex : Throwable) {
|
|
|
|
log.trace(ex)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
internal open fun bindData(column : Column) {
|
|
|
|
this.column = column
|
|
|
|
this.access_info = column.access_info
|
|
|
|
}
|
|
|
|
|
|
|
|
internal abstract fun showColor()
|
|
|
|
|
|
|
|
internal abstract fun onViewRecycled()
|
|
|
|
}
|