Main content now working correctly

This commit is contained in:
Bradlee Speice
2014-12-22 23:22:59 -05:00
parent 21f940d767
commit 21730b7db6
6 changed files with 46 additions and 21 deletions

View File

@ -15,6 +15,28 @@ import android.text.SpannableStringBuilder
import android.util.TypedValue
import org.bspeice.minimalbible.service.format.osisparser.OsisParser
import android.util.Log
import android.content.Context
import android.util.AttributeSet
import kotlin.properties.Delegates
import android.support.v7.widget.LinearLayoutManager
import android.widget.LinearLayout
class BibleView(val ctx: Context, val attrs: AttributeSet) : LinearLayout(ctx, attrs) {
var bibleContent: RecyclerView by Delegates.notNull();
{
val inflater = ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
// Don't attach yet, as we haven't finished setup
val rootView = inflater.inflate(R.layout.view_bible, this, true)
bibleContent = rootView.findViewById(R.id.bible_content) as RecyclerView
bibleContent setLayoutManager LinearLayoutManager(ctx)
}
fun setBook(b: Book, prefs: BibleViewerPreferences) {
bibleContent setAdapter BookAdapter(b, prefs)
}
}
/**
* Adapter used for displaying a book