mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-11-21 23:48:18 -05:00
Main content now working correctly
This commit is contained in:
parent
21f940d767
commit
21730b7db6
@ -25,9 +25,15 @@ public class BibleViewer extends BaseActivity implements Injector {
|
||||
@Named("MainBook")
|
||||
Book mainBook;
|
||||
|
||||
@Inject
|
||||
BibleViewerPreferences prefs;
|
||||
|
||||
@InjectView(R.id.navigation_drawer)
|
||||
BibleMenu bibleMenu;
|
||||
|
||||
@InjectView(R.id.content)
|
||||
BibleView bibleContent;
|
||||
|
||||
@InjectView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
|
||||
@ -78,5 +84,7 @@ public class BibleViewer extends BaseActivity implements Injector {
|
||||
setSupportActionBar(toolbar);
|
||||
bibleMenu.setBible(mainBook);
|
||||
setInsets(this, bibleMenu);
|
||||
|
||||
bibleContent.setBook(mainBook, prefs);
|
||||
}
|
||||
}
|
||||
|
@ -92,20 +92,4 @@ public class BibleViewerModules {
|
||||
BookManager bookManager() {
|
||||
return new BookManager();
|
||||
}
|
||||
|
||||
/*
|
||||
Commenting, as I will likely need these in the near future.
|
||||
@Provides
|
||||
@Named("MainAdapter")
|
||||
@Singleton
|
||||
BookAdapter bookAdapter(@Named("MainBook") Book b, BibleViewerPreferences prefs) {
|
||||
return new BookAdapter(b, prefs);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PublishSubject<BookScrollEvent> scrollEventProvider() {
|
||||
return PublishSubject.create();
|
||||
}
|
||||
*/
|
||||
}
|
@ -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
|
@ -21,10 +21,10 @@
|
||||
android:background="@color/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Main Content" />
|
||||
<org.bspeice.minimalbible.activity.viewer.BibleView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Navigation drawer - layout_gravity:start activates the magic. -->
|
||||
|
11
app/src/main/res/layout/view_bible.xml
Normal file
11
app/src/main/res/layout/view_bible.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/bible_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
@ -18,4 +18,4 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
|
||||
# org.gradle.parallel=true
|
||||
|
||||
# Use the build daemon
|
||||
org.gradle.daemon=true
|
||||
org.gradle.daemon=false
|
||||
|
Loading…
Reference in New Issue
Block a user