Initial switch to WebView

This commit is contained in:
Bradlee Speice 2014-06-18 22:18:46 -04:00
parent 348a6da9a3
commit 8c71d4372e
2 changed files with 8 additions and 12 deletions

View File

@ -6,7 +6,7 @@ import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.webkit.WebView;
import org.bspeice.minimalbible.MinimalBible; import org.bspeice.minimalbible.MinimalBible;
import org.bspeice.minimalbible.R; import org.bspeice.minimalbible.R;
@ -28,8 +28,8 @@ public class BookFragment extends BaseFragment {
@Inject BookManager bookManager; @Inject BookManager bookManager;
@InjectView(R.id.section_label) @InjectView(R.id.book_content)
TextView sectionLabel; WebView mainContent;
private static final String ARG_BOOK_NAME = "book_name"; private static final String ARG_BOOK_NAME = "book_name";
@ -99,6 +99,6 @@ public class BookFragment extends BaseFragment {
private void displayBook(Book b) { private void displayBook(Book b) {
Log.d("BookFragment", b.getName()); Log.d("BookFragment", b.getName());
((BibleViewer)getActivity()).setActionBarTitle(b.getInitials()); ((BibleViewer)getActivity()).setActionBarTitle(b.getInitials());
sectionLabel.setText(b.getName()); mainContent.loadData("<p><strong>" + b.getName() + "</strong></p>", "text/html", "utf-8");
} }
} }

View File

@ -2,15 +2,11 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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" > tools:context="org.bspeice.minimalbible.MainActivity$PlaceholderFragment" >
<TextView <WebView
android:id="@+id/section_label" android:id="@+id/book_content"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" /> android:layout_height="fill_parent"></WebView>
</RelativeLayout> </RelativeLayout>