mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 903160 - Follow-up: Use ViewStub in home_list_with_title.xml for lazy inflation. r=sriram
This commit is contained in:
parent
2096b42101
commit
5885e2d2e5
@ -467,6 +467,7 @@ RES_LAYOUT = \
|
||||
res/layout/font_size_preference.xml \
|
||||
res/layout/gecko_app.xml \
|
||||
res/layout/home_bookmarks_page.xml \
|
||||
res/layout/home_empty_page.xml \
|
||||
res/layout/home_item_row.xml \
|
||||
res/layout/home_header_row.xml \
|
||||
res/layout/home_history_page.xml \
|
||||
|
@ -24,6 +24,7 @@ import android.support.v4.content.Loader;
|
||||
import android.support.v4.widget.CursorAdapter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewStub;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ImageView;
|
||||
@ -159,7 +160,8 @@ public class LastTabsPage extends HomeFragment {
|
||||
|
||||
if (mEmptyView == null) {
|
||||
// Set empty page view. We delay this so that the empty view won't flash.
|
||||
mEmptyView = getActivity().findViewById(R.id.home_empty_view);
|
||||
ViewStub emptyViewStub = (ViewStub) getActivity().findViewById(R.id.home_empty_view_stub);
|
||||
mEmptyView = emptyViewStub.inflate();
|
||||
|
||||
final ImageView emptyIcon = (ImageView) mEmptyView.findViewById(R.id.home_empty_image);
|
||||
emptyIcon.setImageResource(R.drawable.icon_last_tabs_empty);
|
||||
|
@ -21,6 +21,7 @@ import android.support.v4.content.Loader;
|
||||
import android.util.SparseArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewStub;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ImageView;
|
||||
@ -158,7 +159,8 @@ public class MostRecentPage extends HomeFragment {
|
||||
mTitle.setVisibility(View.GONE);
|
||||
if (mEmptyView == null) {
|
||||
// Set empty page view. We delay this so that the empty view won't flash.
|
||||
mEmptyView = getActivity().findViewById(R.id.home_empty_view);
|
||||
ViewStub emptyViewStub = (ViewStub) getActivity().findViewById(R.id.home_empty_view_stub);
|
||||
mEmptyView = emptyViewStub.inflate();
|
||||
|
||||
final ImageView emptyIcon = (ImageView) mEmptyView.findViewById(R.id.home_empty_image);
|
||||
emptyIcon.setImageResource(R.drawable.icon_most_recent_empty);
|
||||
|
26
mobile/android/base/resources/layout/home_empty_page.xml
Normal file
26
mobile/android/base/resources/layout/home_empty_page.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/home_empty_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="50dp"
|
||||
android:paddingRight="50dp">
|
||||
|
||||
<ImageView android:id="@+id/home_empty_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="15dp"/>
|
||||
|
||||
<TextView android:id="@+id/home_empty_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@style/TextAppearance.EmptyMessage"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -5,28 +5,10 @@
|
||||
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<LinearLayout android:id="@+id/home_empty_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="50dp"
|
||||
android:paddingRight="50dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView android:id="@+id/home_empty_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="15dp"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<TextView android:id="@+id/home_empty_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@style/TextAppearance.EmptyMessage"/>
|
||||
|
||||
</LinearLayout>
|
||||
<ViewStub android:id="@+id/home_empty_view_stub"
|
||||
android:layout="@layout/home_empty_page"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"/>
|
||||
|
||||
<TextView android:id="@+id/title"
|
||||
style="@style/Widget.Home.PageTitle"
|
||||
|
Loading…
Reference in New Issue
Block a user