зеркало из https://github.com/mozilla/gecko-dev.git
Bug 895866 - Implement empty screen state for 'history'. r=sriram
This commit is contained in:
Родитель
1d488c20c1
Коммит
9d5c107c57
|
@ -637,6 +637,7 @@ RES_DRAWABLE_MDPI = \
|
|||
res/drawable-mdpi/ic_url_bar_search.png \
|
||||
res/drawable-mdpi/ic_url_bar_star.png \
|
||||
res/drawable-mdpi/ic_url_bar_tab.png \
|
||||
res/drawable-mdpi/icon_most_recent_empty.png \
|
||||
res/drawable-mdpi/icon_last_tabs.png \
|
||||
res/drawable-mdpi/icon_most_recent.png \
|
||||
res/drawable-mdpi/icon_most_visited.png \
|
||||
|
@ -753,6 +754,7 @@ RES_DRAWABLE_HDPI = \
|
|||
res/drawable-hdpi/ic_url_bar_search.png \
|
||||
res/drawable-hdpi/ic_url_bar_star.png \
|
||||
res/drawable-hdpi/ic_url_bar_tab.png \
|
||||
res/drawable-hdpi/icon_most_recent_empty.png \
|
||||
res/drawable-hdpi/icon_last_tabs.png \
|
||||
res/drawable-hdpi/icon_most_recent.png \
|
||||
res/drawable-hdpi/icon_most_visited.png \
|
||||
|
@ -845,6 +847,7 @@ RES_DRAWABLE_XHDPI = \
|
|||
res/drawable-xhdpi/ic_url_bar_search.png \
|
||||
res/drawable-xhdpi/ic_url_bar_star.png \
|
||||
res/drawable-xhdpi/ic_url_bar_tab.png \
|
||||
res/drawable-xhdpi/icon_most_recent_empty.png \
|
||||
res/drawable-xhdpi/icon_last_tabs.png \
|
||||
res/drawable-xhdpi/icon_most_recent.png \
|
||||
res/drawable-xhdpi/icon_most_visited.png \
|
||||
|
|
|
@ -24,6 +24,7 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -103,6 +104,12 @@ public class MostRecentPage extends HomeFragment {
|
|||
}
|
||||
});
|
||||
|
||||
// Set empty page view.
|
||||
final View emptyView = view.findViewById(R.id.home_empty_view);
|
||||
((ImageView) emptyView.findViewById(R.id.home_empty_image)).setImageResource(R.drawable.icon_most_recent_empty);
|
||||
((TextView) emptyView.findViewById(R.id.home_empty_text)).setText(R.string.home_most_recent_empty);
|
||||
mList.setEmptyView(emptyView);
|
||||
|
||||
registerForContextMenu(mList);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,6 @@ public class MostVisitedPage extends HomeFragment {
|
|||
// The view shown by the fragment.
|
||||
private ListView mList;
|
||||
|
||||
// Empty message view
|
||||
private View mEmptyMessage;
|
||||
|
||||
// Callbacks used for the search and favicon cursor loaders
|
||||
private CursorLoaderCallbacks mCursorLoaderCallbacks;
|
||||
|
||||
|
@ -87,7 +84,6 @@ public class MostVisitedPage extends HomeFragment {
|
|||
final TextView title = (TextView) view.findViewById(R.id.title);
|
||||
title.setText(R.string.home_most_visited_title);
|
||||
|
||||
mEmptyMessage = view.findViewById(R.id.empty_message);
|
||||
mList = (HomeListView) view.findViewById(R.id.list);
|
||||
|
||||
mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
@ -110,7 +106,6 @@ public class MostVisitedPage extends HomeFragment {
|
|||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
mList = null;
|
||||
mEmptyMessage = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -182,10 +177,6 @@ public class MostVisitedPage extends HomeFragment {
|
|||
@Override
|
||||
public void onLoadFinished(Loader<Cursor> loader, Cursor c) {
|
||||
if (loader.getId() == LOADER_ID_FRECENCY) {
|
||||
// Only set empty view once cursor is loaded to avoid
|
||||
// flashing the empty message before loading.
|
||||
mList.setEmptyView(mEmptyMessage);
|
||||
|
||||
mAdapter.swapCursor(c);
|
||||
loadFavicons(c);
|
||||
} else {
|
||||
|
|
|
@ -265,8 +265,8 @@ size. -->
|
|||
<!ENTITY home_last_tabs_title "Tabs from last time">
|
||||
<!ENTITY home_last_tabs_open "Open all tabs from last time">
|
||||
<!ENTITY home_most_recent_title "Most recent">
|
||||
<!ENTITY home_most_recent_empty "Websites you visited most recently show up here.">
|
||||
<!ENTITY home_most_visited_title "Most visited">
|
||||
<!ENTITY home_visited_empty "Websites you visited go here">
|
||||
<!ENTITY pin_bookmark_dialog_hint "Enter a search keyword">
|
||||
|
||||
<!ENTITY filepicker_title "Choose File">
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.3 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 1.6 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 3.2 KiB |
|
@ -5,12 +5,28 @@
|
|||
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<TextView android:id="@+id/empty_message"
|
||||
style="@style/Widget.Home.EmptyMessage"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:text="@string/home_visited_empty"
|
||||
android:visibility="gone"/>
|
||||
<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>
|
||||
|
||||
<TextView android:id="@+id/title"
|
||||
style="@style/Widget.Home.PageTitle"/>
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<style name="TextAppearance.EmptyMessage" parent="TextAppearance.Large">
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Widget.TwoLinePageRow.Title" parent="TextAppearance.Medium">
|
||||
<item name="android:fontFamily">sans-serif-light</item>
|
||||
</style>
|
||||
|
|
|
@ -166,14 +166,6 @@
|
|||
<item name="android:paddingRight">10dip</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Home.EmptyMessage">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Widget.Home.PageTitle</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:focusable">false</item>
|
||||
<item name="android:paddingLeft">10dip</item>
|
||||
<item name="android:paddingRight">10dip</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Home.PageButton">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">40dip</item>
|
||||
|
@ -258,6 +250,8 @@
|
|||
<item name="android:textColorLink">?android:attr/textColorLink</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.EmptyMessage" parent="TextAppearance.Large"/>
|
||||
|
||||
<style name="TextAppearance.Micro">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">?android:attr/textColorTertiary</item>
|
||||
|
|
|
@ -247,8 +247,8 @@
|
|||
<string name="home_last_tabs_title">&home_last_tabs_title;</string>
|
||||
<string name="home_last_tabs_open">&home_last_tabs_open;</string>
|
||||
<string name="home_most_recent_title">&home_most_recent_title;</string>
|
||||
<string name="home_most_recent_empty">&home_most_recent_empty;</string>
|
||||
<string name="home_most_visited_title">&home_most_visited_title;</string>
|
||||
<string name="home_visited_empty">&home_visited_empty;</string>
|
||||
<string name="pin_bookmark_dialog_hint">&pin_bookmark_dialog_hint;</string>
|
||||
|
||||
<string name="filepicker_title">&filepicker_title;</string>
|
||||
|
|
Загрузка…
Ссылка в новой задаче