Android Studio 2.3 Development Essentials - Android 7 Edition by Neil Smyth
Author:Neil Smyth [Smyth, Neil]
Language: eng
Format: mobi
Publisher: Payload Media, Inc.
Published: 2017-03-12T05:00:00+00:00
static {
// Add 3 sample items.
addItem(new DummyItem("1", "eBookFrenzy",
"http://www.ebookfrenzy.com"));
addItem(new DummyItem("2", "Amazon",
"http://www.amazon.com"));
addItem(new DummyItem("3", "New York Times",
"http://www.nytimes.com"));
}
The code now takes advantage of the modified DummyItem class to store an ID, web site name and URL for each item.
41.6 Changing the Detail Pane
The detail information shown to the user when an item is selected from the master list is currently displayed via the layout contained in the website_detail.xml file. By default, this contains a single view in the form of a TextView. Since the TextView class is not capable of displaying a web page, this needs to be changed to a WebView object for this tutorial. To achieve this, navigate to the app -> res -> layout -> website_detail.xml file in the Project tool window and double-click on it to load it into the Layout Editor tool. Switch to Text mode and delete the current XML content from the file. Replace this content with the following XML:
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/website_detail"
tools:context=
"com.ebookfrenzy.masterdetailflow.WebsiteDetailFragment">
</WebView>
Switch to Design mode and verify that the layout now matches that shown in Figure 41-5:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5212)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(4752)
Kotlin in Action by Dmitry Jemerov(3998)
React Native - Building Mobile Apps with JavaScript by Novick Vladimir(2068)
Pride and Prejudice by Jane Austen(1862)
Learning Angular - Second Edition by Christoffer Noring(1604)
Bulletproof Android: Practical Advice for Building Secure Apps (Developer's Library) by Godfrey Nolan(1517)
Android Development with Kotlin by Marcin Moskala & Igor Wojda(1454)
Computers For Seniors For Dummies by Nancy C. Muir(1393)
Building Progressive Web Apps: Bringing the Power of Native to the Browser by Ater Tal(1369)
Android App Development by Franceschi Hervé J.;(1338)
Mobile Forensics Cookbook by Igor Mikhaylov(1312)
1936941139 (N) by Bob Rosenthal(1299)
Ember.js in Action by Joachim Haagen Skeie(1288)
Building Android UIs with Custom Views by Raimon Ràfols Montané(1263)
Coding Literacy: How Computer Programming is Changing Writing (Software Studies) by Annette Vee(1073)
Android Studio 2.3 Development Essentials - Android 7 Edition by Neil Smyth(1030)
Pro Windows Phone App Development by Falafel Software(969)
The Art of iPhone Photography by Bob Weil & Nicki Fitz-Gerald(938)
