From 8c71d4372e0e23455544eb15dbd123f2ca6e1cb0 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 18 Jun 2014 22:18:46 -0400 Subject: [PATCH] Initial switch to WebView --- .../minimalbible/activities/viewer/BookFragment.java | 8 ++++---- .../src/main/res/layout/fragment_viewer_main.xml | 12 ++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/MinimalBible/src/main/java/org/bspeice/minimalbible/activities/viewer/BookFragment.java b/MinimalBible/src/main/java/org/bspeice/minimalbible/activities/viewer/BookFragment.java index ff3f1f8..c108ed3 100644 --- a/MinimalBible/src/main/java/org/bspeice/minimalbible/activities/viewer/BookFragment.java +++ b/MinimalBible/src/main/java/org/bspeice/minimalbible/activities/viewer/BookFragment.java @@ -6,7 +6,7 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; +import android.webkit.WebView; import org.bspeice.minimalbible.MinimalBible; import org.bspeice.minimalbible.R; @@ -28,8 +28,8 @@ public class BookFragment extends BaseFragment { @Inject BookManager bookManager; - @InjectView(R.id.section_label) - TextView sectionLabel; + @InjectView(R.id.book_content) + WebView mainContent; private static final String ARG_BOOK_NAME = "book_name"; @@ -99,6 +99,6 @@ public class BookFragment extends BaseFragment { private void displayBook(Book b) { Log.d("BookFragment", b.getName()); ((BibleViewer)getActivity()).setActionBarTitle(b.getInitials()); - sectionLabel.setText(b.getName()); + mainContent.loadData("

" + b.getName() + "

", "text/html", "utf-8"); } } diff --git a/MinimalBible/src/main/res/layout/fragment_viewer_main.xml b/MinimalBible/src/main/res/layout/fragment_viewer_main.xml index 7e803da..befcaf6 100644 --- a/MinimalBible/src/main/res/layout/fragment_viewer_main.xml +++ b/MinimalBible/src/main/res/layout/fragment_viewer_main.xml @@ -2,15 +2,11 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingBottom="@dimen/activity_vertical_margin" - android:paddingLeft="@dimen/activity_horizontal_margin" - android:paddingRight="@dimen/activity_horizontal_margin" - android:paddingTop="@dimen/activity_vertical_margin" tools:context="org.bspeice.minimalbible.MainActivity$PlaceholderFragment" > - +