зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1259078 - Post: remove unneeded reading list panel resources and code r=liuche
MozReview-Commit-ID: Yoghq4MQRc --HG-- extra : rebase_source : be6ad845aad794de363180a760a561e3107a6334 extra : histedit_source : 2fbabe092716d0eb9da914b6ffca60845ab580bb
This commit is contained in:
Родитель
fc34d54579
Коммит
dec2b40772
|
@ -1,72 +0,0 @@
|
|||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
* 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/. */
|
||||
|
||||
package org.mozilla.gecko.home;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.mozilla.gecko.AppConstants;
|
||||
import org.mozilla.gecko.GeckoSharedPrefs;
|
||||
import org.mozilla.gecko.Locales;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.SnackbarHelper;
|
||||
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/**
|
||||
* Fragment that used to display reading list contents in a ListView, and now directs
|
||||
* users to Bookmarks to view their former reading-list content.
|
||||
*/
|
||||
public class ReadingListPanel extends HomeFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
|
||||
final ViewGroup root = (ViewGroup) inflater.inflate(R.layout.readinglistpanel_gone_fragment, container, false);
|
||||
|
||||
// We could update the ID names - however this panel is only intended to be live for one
|
||||
// release, hence there's little utility in optimising this code.
|
||||
root.findViewById(R.id.welcome_account).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean bookmarksEnabled = GeckoSharedPrefs.forProfile(getContext()).getBoolean(HomeConfig.PREF_KEY_BOOKMARKS_PANEL_ENABLED, true);
|
||||
|
||||
if (bookmarksEnabled) {
|
||||
mUrlOpenListener.onUrlOpen("about:home?panel=" + HomeConfig.getIdForBuiltinPanelType(HomeConfig.PanelType.BOOKMARKS),
|
||||
EnumSet.noneOf(HomePager.OnUrlOpenListener.Flags.class));
|
||||
} else {
|
||||
SnackbarHelper.showSnackbar(getActivity(),
|
||||
getResources().getString(R.string.reading_list_migration_bookmarks_hidden),
|
||||
Snackbar.LENGTH_LONG);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
root.findViewById(R.id.welcome_browse).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final String link = getString(R.string.migrated_reading_list_url,
|
||||
AppConstants.MOZ_APP_VERSION,
|
||||
AppConstants.OS_TARGET,
|
||||
Locales.getLanguageTag(Locale.getDefault()));
|
||||
|
||||
mUrlOpenListener.onUrlOpen(link,
|
||||
EnumSet.noneOf(HomePager.OnUrlOpenListener.Flags.class));
|
||||
}
|
||||
});
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void load() {
|
||||
// Must be overriden, but we're not doing any loading hence no real implementation...
|
||||
}
|
||||
}
|
|
@ -24,16 +24,10 @@
|
|||
|
||||
<!ENTITY onboard_start_restricted1 "Stay safe and in control with this simplified version of &brandShortName;.">
|
||||
|
||||
<!ENTITY reading_list_migration_title "Reading List connected">
|
||||
<!ENTITY reading_list_migration_subtext "Your Reading List items will now be added to your Bookmarks">
|
||||
<!ENTITY reading_list_migration_goto_bookmarks "Go to Bookmarks">
|
||||
<!ENTITY reading_list_migration_bookmarks_hidden "Your Bookmarks panel is hidden">
|
||||
|
||||
<!-- Localization note: These are used as the titles of different pages on the home screen.
|
||||
They are automatically converted to all caps by the Android platform. -->
|
||||
<!ENTITY bookmarks_title "Bookmarks">
|
||||
<!ENTITY history_title "History">
|
||||
<!ENTITY reading_list_title "Reading List">
|
||||
<!ENTITY recent_tabs_title "Recent Tabs">
|
||||
|
||||
<!ENTITY switch_to_tab "Switch to tab">
|
||||
|
|
|
@ -426,7 +426,6 @@ gbjar.sources += ['java/org/mozilla/gecko/' + x for x in [
|
|||
'home/PanelViewAdapter.java',
|
||||
'home/PanelViewItemHandler.java',
|
||||
'home/PinSiteDialog.java',
|
||||
'home/ReadingListPanel.java',
|
||||
'home/RecentTabsPanel.java',
|
||||
'home/RemoteTabsExpandableListState.java',
|
||||
'home/SearchEngine.java',
|
||||
|
|
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 2.8 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 6.1 KiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 10 KiB |
|
@ -1,58 +0,0 @@
|
|||
<?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/. -->
|
||||
|
||||
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/firstrun_min_height"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/reading_list_migration"/>
|
||||
|
||||
<TextView android:layout_width="@dimen/firstrun_content_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@style/TextAppearance.FirstrunLight.Main"
|
||||
android:text="@string/reading_list_migration_title"/>
|
||||
|
||||
<TextView android:id="@+id/firstrun_subtext"
|
||||
android:layout_width="@dimen/firstrun_content_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="30dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/reading_list_migration_subtext"
|
||||
android:textAppearance="@style/TextAppearance.FirstrunRegular.Body"
|
||||
android:singleLine="false"/>
|
||||
|
||||
<Button android:id="@+id/welcome_account"
|
||||
style="@style/Widget.Firstrun.Button"
|
||||
android:background="@drawable/button_background_action_orange_round"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/reading_list_migration_goto_bookmarks"/>
|
||||
|
||||
<TextView android:id="@+id/welcome_browse"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@style/TextAppearance.FirstrunRegular.Link"
|
||||
android:text="@string/pref_learn_more"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -53,12 +53,8 @@
|
|||
|
||||
<string name="bookmarks_title">&bookmarks_title;</string>
|
||||
<string name="history_title">&history_title;</string>
|
||||
<string name="reading_list_title">&reading_list_title;</string>
|
||||
<string name="recent_tabs_title">&recent_tabs_title;</string>
|
||||
|
||||
<!-- https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/reading-list -->
|
||||
<string name="migrated_reading_list_url">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/reading-list</string>
|
||||
|
||||
<string name="switch_to_tab">&switch_to_tab;</string>
|
||||
|
||||
<string name="crash_reporter_title">&crash_reporter_title;</string>
|
||||
|
@ -375,11 +371,6 @@
|
|||
<string name="site_settings_cancel">&site_settings_cancel;</string>
|
||||
<string name="site_settings_clear">&site_settings_clear;</string>
|
||||
|
||||
<string name="reading_list_migration_title">&reading_list_migration_title;</string>
|
||||
<string name="reading_list_migration_subtext">&reading_list_migration_subtext;</string>
|
||||
<string name="reading_list_migration_goto_bookmarks">&reading_list_migration_goto_bookmarks;</string>
|
||||
<string name="reading_list_migration_bookmarks_hidden">&reading_list_migration_bookmarks_hidden;</string>
|
||||
|
||||
<string name="page_action_dropmarker_description">&page_action_dropmarker_description;</string>
|
||||
|
||||
<string name="contextmenu_open_new_tab">&contextmenu_open_new_tab;</string>
|
||||
|
|
|
@ -117,7 +117,6 @@ public class StringHelper {
|
|||
public final String HISTORY_LABEL;
|
||||
public final String TOP_SITES_LABEL;
|
||||
public final String BOOKMARKS_LABEL;
|
||||
public final String READING_LIST_LABEL;
|
||||
public final String TODAY_LABEL;
|
||||
|
||||
// Desktop default bookmarks folders
|
||||
|
@ -290,7 +289,6 @@ public class StringHelper {
|
|||
HISTORY_LABEL = res.getString(R.string.home_history_title);
|
||||
TOP_SITES_LABEL = res.getString(R.string.home_top_sites_title);
|
||||
BOOKMARKS_LABEL = res.getString(R.string.bookmarks_title);
|
||||
READING_LIST_LABEL = res.getString(R.string.reading_list_title);
|
||||
TODAY_LABEL = res.getString(R.string.history_today_section);
|
||||
|
||||
BOOKMARKS_UP_TO = res.getString(R.string.home_move_back_to_filter);
|
||||
|
|
|
@ -35,7 +35,7 @@ public class AboutHomeComponent extends BaseComponent {
|
|||
PanelType.TOP_SITES,
|
||||
PanelType.BOOKMARKS,
|
||||
PanelType.COMBINED_HISTORY,
|
||||
PanelType.RECENT_TABS,
|
||||
PanelType.RECENT_TABS
|
||||
);
|
||||
|
||||
// The percentage of the panel to swipe between 0 and 1. This value was set through
|
||||
|
|
|
@ -34,7 +34,7 @@ public class testShareLink extends AboutHomeTest {
|
|||
blockForGeckoReady();
|
||||
|
||||
// FIXME: This is a temporary hack workaround for a permissions problem.
|
||||
openAboutHomeTab(AboutHomeTabs.READING_LIST);
|
||||
openAboutHomeTab(AboutHomeTabs.HISTORY);
|
||||
|
||||
inputAndLoadUrl(url);
|
||||
verifyUrlBarTitle(url); // Waiting for page title to ensure the page is loaded
|
||||
|
|
Загрузка…
Ссылка в новой задаче