添加清除搜索记录

This commit is contained in:
seven332 committed 2014-09-08 23:50:23 +08:00
1 parent 60dc0a7f72
commit 645f0df208
6 files changed
+32

No files matched your search

+3
View File
@@ -190,6 +190,9 @@
<string name="exculde_tag_group_summary">在标签搜索中排除特定标签类别</string>
<string name="exculde_language_title">排除语言</string>
<string name="exculde_language_summary">在列表与搜索中排除特定语言</string>
<string name="search_eh_settings_title">搜索</string>
<string name="clear_suggestions_title">清除搜索记录</string>
<string name="clear_suggestions_summary">删除您已执行的所有搜索</string>
<string name="detail_eh_settings_title">详情</string>
<string name="preview_mode_title">预览图模式</string>
<string name="preview_mode_normal">正常预览图</string>
+3
View File
@@ -178,6 +178,9 @@
<string name="exculde_tag_group_summary">在標籤搜索中排除特定標籤類別</string>
<string name="exculde_language_title">排除語言</string>
<string name="exculde_language_summary">在列表與搜索中排除特定語言</string>
<string name="search_eh_settings_title">搜索</string>
<string name="clear_suggestions_title">清除搜索記錄</string>
<string name="clear_suggestions_summary">刪除您已執行的所有搜索</string>
<string name="detail_eh_settings_title">詳情</string>
<string name="preview_mode_title">預覽圖模式</string>
<string name="preview_mode_normal">正常預覽圖</string>
+3
View File
@@ -178,6 +178,9 @@
<string name="exculde_tag_group_summary">在標籤搜索中排除特定標籤類別</string>
<string name="exculde_language_title">排除語言</string>
<string name="exculde_language_summary">在列表與搜索中排除特定語言</string>
<string name="search_eh_settings_title">搜索</string>
<string name="clear_suggestions_title">清除搜索記錄</string>
<string name="clear_suggestions_summary">刪除您已執行的所有搜索</string>
<string name="detail_eh_settings_title">詳情</string>
<string name="preview_mode_title">預覽圖模式</string>
<string name="preview_mode_normal">正常預覽圖</string>
+3
View File
@@ -193,6 +193,9 @@
<string name="exculde_tag_group_summary">Exclude certain tag groups from a default tag search</string>
<string name="exculde_language_title">Exculde language</string>
<string name="exculde_language_summary">To hide galleries in certain languages from the gallery list and searches</string>
<string name="search_eh_settings_title">Search</string>
<string name="clear_suggestions_title">Clear search history</string>
<string name="clear_suggestions_summary">Remove all the searches you have performed</string>
<string name="detail_eh_settings_title">Detail</string>
<string name="preview_mode_title">Preview mode</string>
<string name="preview_mode_normal">Normal</string>
+9
View File
@@ -34,6 +34,15 @@
android:title="@string/exculde_language_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/search_eh_settings_title" >
<Preference
android:key="clear_suggestions"
android:title="@string/clear_suggestions_title"
android:summary="@string/clear_suggestions_summary" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/detail_eh_settings_title" >
<com.hippo.ehviewer.preference.AutoListPreference
@@ -34,6 +34,7 @@ import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.provider.SearchRecentSuggestions;
import android.text.util.Linkify;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -51,6 +52,7 @@ import android.widget.TextView;
import com.hippo.ehviewer.AppContext;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.SimpleSuggestionProvider;
import com.hippo.ehviewer.UpdateHelper;
import com.hippo.ehviewer.ehclient.EhInfo;
import com.hippo.ehviewer.network.HttpHelper;
@@ -295,12 +297,14 @@ public class SettingsActivity extends AbsPreferenceActivity {
private static final String KEY_LIST_DEFAULT_CATEGORY = "list_default_category";
private static final String KEY_EXCULDE_TAG_GROUP = "exculde_tag_group";
private static final String KEY_EXCULDE_LANGUAGE = "exculde_language";
private static final String KEY_CLEAR_SUGGESTIONS = "clear_suggestions";
private static final String KEY_PREVIEW_MODE = "preview_mode";
private static final String KEY_DEFAULT_FAVORITE = "default_favorite";
private Preference mListDefaultCategory;
private Preference mExculdeTagGroup;
private Preference mExculdeLanguage;
private Preference mClearSuggestions;
private AutoListPreference mPreviewMode;
private ListPreference mDefaultFavorite;
@@ -315,6 +319,8 @@ public class SettingsActivity extends AbsPreferenceActivity {
mExculdeTagGroup.setOnPreferenceClickListener(this);
mExculdeLanguage = findPreference(KEY_EXCULDE_LANGUAGE);
mExculdeLanguage.setOnPreferenceClickListener(this);
mClearSuggestions = findPreference(KEY_CLEAR_SUGGESTIONS);
mClearSuggestions.setOnPreferenceClickListener(this);
mPreviewMode = (AutoListPreference)findPreference(KEY_PREVIEW_MODE);
mPreviewMode.setOnPreferenceChangeListener(this);
mDefaultFavorite = (ListPreference)findPreference(KEY_DEFAULT_FAVORITE);
@@ -394,6 +400,11 @@ public class SettingsActivity extends AbsPreferenceActivity {
EhInfo.getInstance(mActivity).setExculdeLanguage(newValue);
}
}).create().show();
} else if (KEY_CLEAR_SUGGESTIONS.equals(key)) {
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(mActivity,
SimpleSuggestionProvider.AUTHORITY, SimpleSuggestionProvider.MODE);
suggestions.clearHistory();
}
return true;
}