编辑页面菜单修复

pull/9/head
SHarkii 2 months ago
parent 20d0e9fbca
commit ffb559f2b4

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">

@ -33,6 +33,8 @@
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- 允许应用接收系统启动完成的广播 --> <!-- 允许应用接收系统启动完成的广播 -->
<uses-permission android:name="android.permission.SET_ALARM"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<!-- 用于在设备启动后重新设置闹钟等任务 --> <!-- 用于在设备启动后重新设置闹钟等任务 -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
@ -200,6 +202,7 @@
* 以 singleInstance 模式启动 * 以 singleInstance 模式启动
* 使用全屏无标题栏主题,确保在锁屏状态下也能显示 * 使用全屏无标题栏主题,确保在锁屏状态下也能显示
--> -->
<activity <activity
android:name=".ui.AlarmAlertActivity" android:name=".ui.AlarmAlertActivity"
android:label="@string/app_name" android:label="@string/app_name"
@ -207,6 +210,7 @@
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" > android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" >
</activity> </activity>
<!-- <!--
* 应用设置偏好活动 * 应用设置偏好活动
* 提供应用内设置选项(如主题、通知等) * 提供应用内设置选项(如主题、通知等)

@ -54,12 +54,12 @@ public class AlarmInitReceiver extends BroadcastReceiver {
Intent sender = new Intent(context, AlarmReceiver.class); Intent sender = new Intent(context, AlarmReceiver.class);
sender.setData(ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, c.getLong(COLUMN_ID))); sender.setData(ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, c.getLong(COLUMN_ID)));
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, sender, 0); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, sender, 0);
AlarmManager alermManager = (AlarmManager) context AlarmManager alarmManager = (AlarmManager) context
.getSystemService(Context.ALARM_SERVICE); .getSystemService(Context.ALARM_SERVICE);
alermManager.set(AlarmManager.RTC_WAKEUP, alertDate, pendingIntent); alarmManager.set(AlarmManager.RTC_WAKEUP, alertDate, pendingIntent);
} while (c.moveToNext()); } while (c.moveToNext());
} }
c.close(); c.close();
} }
} }
} }

@ -29,18 +29,33 @@ import net.micode.notes.data.Notes;
import net.micode.notes.tool.DataUtils; import net.micode.notes.tool.DataUtils;
import net.micode.notes.tool.ResourceParser.NoteItemBgResources; import net.micode.notes.tool.ResourceParser.NoteItemBgResources;
/**
*
*
*/
public class NotesListItem extends LinearLayout { public class NotesListItem extends LinearLayout {
// 提醒图标(闹钟/通话记录等)
private ImageView mAlert; private ImageView mAlert;
// 标题文本
private TextView mTitle; private TextView mTitle;
// 时间文本(最后修改时间)
private TextView mTime; private TextView mTime;
// 通话记录名称(仅通话相关条目显示)
private TextView mCallName; private TextView mCallName;
// 绑定的数据项
private NoteItemData mItemData; private NoteItemData mItemData;
// 多选模式下的复选框
private CheckBox mCheckBox; private CheckBox mCheckBox;
/**
*
* @param context
*/
public NotesListItem(Context context) { public NotesListItem(Context context) {
super(context); super(context);
// 加载列表项布局
inflate(context, R.layout.note_item, this); inflate(context, R.layout.note_item, this);
// 初始化子视图
mAlert = (ImageView) findViewById(R.id.iv_alert_icon); mAlert = (ImageView) findViewById(R.id.iv_alert_icon);
mTitle = (TextView) findViewById(R.id.tv_title); mTitle = (TextView) findViewById(R.id.tv_title);
mTime = (TextView) findViewById(R.id.tv_time); mTime = (TextView) findViewById(R.id.tv_time);
@ -48,43 +63,60 @@ public class NotesListItem extends LinearLayout {
mCheckBox = (CheckBox) findViewById(android.R.id.checkbox); mCheckBox = (CheckBox) findViewById(android.R.id.checkbox);
} }
/**
*
* @param context
* @param data /
* @param choiceMode
* @param checked
*/
public void bind(Context context, NoteItemData data, boolean choiceMode, boolean checked) { public void bind(Context context, NoteItemData data, boolean choiceMode, boolean checked) {
// 处理多选模式下的复选框显示
if (choiceMode && data.getType() == Notes.TYPE_NOTE) { if (choiceMode && data.getType() == Notes.TYPE_NOTE) {
mCheckBox.setVisibility(View.VISIBLE); mCheckBox.setVisibility(View.VISIBLE); // 显示复选框(仅笔记项在多选模式下可见)
mCheckBox.setChecked(checked); mCheckBox.setChecked(checked); // 设置选中状态
} else { } else {
mCheckBox.setVisibility(View.GONE); mCheckBox.setVisibility(View.GONE); // 隐藏复选框
} }
mItemData = data; mItemData = data; // 保存数据项
// 根据数据类型和上下文设置不同的显示逻辑
if (data.getId() == Notes.ID_CALL_RECORD_FOLDER) { if (data.getId() == Notes.ID_CALL_RECORD_FOLDER) {
mCallName.setVisibility(View.GONE); // 通话记录文件夹特殊处理
mAlert.setVisibility(View.VISIBLE); mCallName.setVisibility(View.GONE); // 隐藏通话名称
mTitle.setTextAppearance(context, R.style.TextAppearancePrimaryItem); mAlert.setVisibility(View.VISIBLE); // 显示提醒图标
mTitle.setTextAppearance(context, R.style.TextAppearancePrimaryItem); // 设置主标题样式
// 显示文件夹名称和笔记数量
mTitle.setText(context.getString(R.string.call_record_folder_name) mTitle.setText(context.getString(R.string.call_record_folder_name)
+ context.getString(R.string.format_folder_files_count, data.getNotesCount())); + context.getString(R.string.format_folder_files_count, data.getNotesCount()));
mAlert.setImageResource(R.drawable.call_record); mAlert.setImageResource(R.drawable.call_record); // 设置通话记录图标
} else if (data.getParentId() == Notes.ID_CALL_RECORD_FOLDER) { } else if (data.getParentId() == Notes.ID_CALL_RECORD_FOLDER) {
mCallName.setVisibility(View.VISIBLE); // 通话记录文件夹内的笔记项
mCallName.setText(data.getCallName()); mCallName.setVisibility(View.VISIBLE); // 显示通话名称
mTitle.setTextAppearance(context,R.style.TextAppearanceSecondaryItem); mCallName.setText(data.getCallName()); // 设置通话人姓名
mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet())); mTitle.setTextAppearance(context, R.style.TextAppearanceSecondaryItem); // 设置次级标题样式
mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet())); // 显示格式化后的摘要
// 根据是否有提醒设置提醒图标
if (data.hasAlert()) { if (data.hasAlert()) {
mAlert.setImageResource(R.drawable.clock); mAlert.setImageResource(R.drawable.clock); // 闹钟图标
mAlert.setVisibility(View.VISIBLE); mAlert.setVisibility(View.VISIBLE);
} else { } else {
mAlert.setVisibility(View.GONE); mAlert.setVisibility(View.GONE);
} }
} else { } else {
mCallName.setVisibility(View.GONE); // 普通笔记或文件夹
mTitle.setTextAppearance(context, R.style.TextAppearancePrimaryItem); mCallName.setVisibility(View.GONE); // 隐藏通话名称
mTitle.setTextAppearance(context, R.style.TextAppearancePrimaryItem); // 设置主标题样式
if (data.getType() == Notes.TYPE_FOLDER) { if (data.getType() == Notes.TYPE_FOLDER) {
// 文件夹项:显示名称和子项数量
mTitle.setText(data.getSnippet() mTitle.setText(data.getSnippet()
+ context.getString(R.string.format_folder_files_count, + context.getString(R.string.format_folder_files_count,
data.getNotesCount())); data.getNotesCount()));
mAlert.setVisibility(View.GONE); mAlert.setVisibility(View.GONE); // 文件夹不显示提醒图标
} else { } else {
// 普通笔记项:显示摘要和提醒图标
mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet())); mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet()));
if (data.hasAlert()) { if (data.hasAlert()) {
mAlert.setImageResource(R.drawable.clock); mAlert.setImageResource(R.drawable.clock);
@ -94,29 +126,45 @@ public class NotesListItem extends LinearLayout {
} }
} }
} }
// 显示相对时间如“5分钟前”
mTime.setText(DateUtils.getRelativeTimeSpanString(data.getModifiedDate())); mTime.setText(DateUtils.getRelativeTimeSpanString(data.getModifiedDate()));
// 设置列表项背景(根据笔记类型和样式)
setBackground(data); setBackground(data);
} }
/**
*
* @param data
*/
private void setBackground(NoteItemData data) { private void setBackground(NoteItemData data) {
int id = data.getBgColorId(); int id = data.getBgColorId(); // 获取背景颜色ID
if (data.getType() == Notes.TYPE_NOTE) { if (data.getType() == Notes.TYPE_NOTE) {
// 笔记项背景处理(根据位置和样式)
if (data.isSingle() || data.isOneFollowingFolder()) { if (data.isSingle() || data.isOneFollowingFolder()) {
// 单独项或跟随一个文件夹的项
setBackgroundResource(NoteItemBgResources.getNoteBgSingleRes(id)); setBackgroundResource(NoteItemBgResources.getNoteBgSingleRes(id));
} else if (data.isLast()) { } else if (data.isLast()) {
// 最后一项
setBackgroundResource(NoteItemBgResources.getNoteBgLastRes(id)); setBackgroundResource(NoteItemBgResources.getNoteBgLastRes(id));
} else if (data.isFirst() || data.isMultiFollowingFolder()) { } else if (data.isFirst() || data.isMultiFollowingFolder()) {
// 第一项或跟随多个文件夹的项
setBackgroundResource(NoteItemBgResources.getNoteBgFirstRes(id)); setBackgroundResource(NoteItemBgResources.getNoteBgFirstRes(id));
} else { } else {
// 普通项
setBackgroundResource(NoteItemBgResources.getNoteBgNormalRes(id)); setBackgroundResource(NoteItemBgResources.getNoteBgNormalRes(id));
} }
} else { } else {
// 文件夹项背景(固定样式)
setBackgroundResource(NoteItemBgResources.getFolderBgRes()); setBackgroundResource(NoteItemBgResources.getFolderBgRes());
} }
} }
/**
*
* @return /
*/
public NoteItemData getItemData() { public NoteItemData getItemData() {
return mItemData; return mItemData;
} }
} }

@ -47,43 +47,47 @@ import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.NoteColumns; import net.micode.notes.data.Notes.NoteColumns;
import net.micode.notes.gtask.remote.GTaskSyncService; import net.micode.notes.gtask.remote.GTaskSyncService;
/**
* ActivityPreferenceActivity
* Google Task
*/
public class NotesPreferenceActivity extends PreferenceActivity { public class NotesPreferenceActivity extends PreferenceActivity {
// 偏好设置文件名
public static final String PREFERENCE_NAME = "notes_preferences"; public static final String PREFERENCE_NAME = "notes_preferences";
// 同步账户名的偏好设置键
public static final String PREFERENCE_SYNC_ACCOUNT_NAME = "pref_key_account_name"; public static final String PREFERENCE_SYNC_ACCOUNT_NAME = "pref_key_account_name";
// 上次同步时间的偏好设置键
public static final String PREFERENCE_LAST_SYNC_TIME = "pref_last_sync_time"; public static final String PREFERENCE_LAST_SYNC_TIME = "pref_last_sync_time";
// 背景颜色随机设置的偏好设置键
public static final String PREFERENCE_SET_BG_COLOR_KEY = "pref_key_bg_random_appear"; public static final String PREFERENCE_SET_BG_COLOR_KEY = "pref_key_bg_random_appear";
// 同步账户分类的键
private static final String PREFERENCE_SYNC_ACCOUNT_KEY = "pref_sync_account_key"; private static final String PREFERENCE_SYNC_ACCOUNT_KEY = "pref_sync_account_key";
// 账户权限过滤键
private static final String AUTHORITIES_FILTER_KEY = "authorities"; private static final String AUTHORITIES_FILTER_KEY = "authorities";
private PreferenceCategory mAccountCategory; private PreferenceCategory mAccountCategory; // 账户分类偏好
private GTaskReceiver mReceiver; // 同步服务广播接收器
private GTaskReceiver mReceiver; private Account[] mOriAccounts; // 原始账户列表
private boolean mHasAddedAccount; // 是否添加了新账户的标志
private Account[] mOriAccounts;
private boolean mHasAddedAccount;
@Override @Override
protected void onCreate(Bundle icicle) { protected void onCreate(Bundle icicle) {
super.onCreate(icicle); super.onCreate(icicle);
/* using the app icon for navigation */ // 在ActionBar上显示返回按钮
getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
// 从XML资源添加偏好设置
addPreferencesFromResource(R.xml.preferences); addPreferencesFromResource(R.xml.preferences);
mAccountCategory = (PreferenceCategory) findPreference(PREFERENCE_SYNC_ACCOUNT_KEY); mAccountCategory = (PreferenceCategory) findPreference(PREFERENCE_SYNC_ACCOUNT_KEY);
mReceiver = new GTaskReceiver(); mReceiver = new GTaskReceiver();
// 注册广播接收器,监听同步服务状态变化
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
filter.addAction(GTaskSyncService.GTASK_SERVICE_BROADCAST_NAME); filter.addAction(GTaskSyncService.GTASK_SERVICE_BROADCAST_NAME);
registerReceiver(mReceiver, filter); registerReceiver(mReceiver, filter);
mOriAccounts = null; mOriAccounts = null;
// 添加设置界面的头部视图
View header = LayoutInflater.from(this).inflate(R.layout.settings_header, null); View header = LayoutInflater.from(this).inflate(R.layout.settings_header, null);
getListView().addHeaderView(header, null, true); getListView().addHeaderView(header, null, true);
} }
@ -92,11 +96,11 @@ public class NotesPreferenceActivity extends PreferenceActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
// need to set sync account automatically if user has added a new // 如果用户添加了新账户,需要自动设置同步账户
// account
if (mHasAddedAccount) { if (mHasAddedAccount) {
Account[] accounts = getGoogleAccounts(); Account[] accounts = getGoogleAccounts();
if (mOriAccounts != null && accounts.length > mOriAccounts.length) { if (mOriAccounts != null && accounts.length > mOriAccounts.length) {
// 找出新添加的账户
for (Account accountNew : accounts) { for (Account accountNew : accounts) {
boolean found = false; boolean found = false;
for (Account accountOld : mOriAccounts) { for (Account accountOld : mOriAccounts) {
@ -113,19 +117,23 @@ public class NotesPreferenceActivity extends PreferenceActivity {
} }
} }
refreshUI(); refreshUI(); // 刷新UI
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
// 注销广播接收器
if (mReceiver != null) { if (mReceiver != null) {
unregisterReceiver(mReceiver); unregisterReceiver(mReceiver);
} }
super.onDestroy(); super.onDestroy();
} }
/**
*
*/
private void loadAccountPreference() { private void loadAccountPreference() {
mAccountCategory.removeAll(); mAccountCategory.removeAll(); // 清除所有现有偏好
Preference accountPref = new Preference(this); Preference accountPref = new Preference(this);
final String defaultAccount = getSyncAccountName(this); final String defaultAccount = getSyncAccountName(this);
@ -135,48 +143,52 @@ public class NotesPreferenceActivity extends PreferenceActivity {
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
if (!GTaskSyncService.isSyncing()) { if (!GTaskSyncService.isSyncing()) {
if (TextUtils.isEmpty(defaultAccount)) { if (TextUtils.isEmpty(defaultAccount)) {
// the first time to set account // 第一次设置账户,显示选择账户对话框
showSelectAccountAlertDialog(); showSelectAccountAlertDialog();
} else { } else {
// if the account has already been set, we need to promp // 账户已设置,显示更改账户确认对话框
// user about the risk
showChangeAccountConfirmAlertDialog(); showChangeAccountConfirmAlertDialog();
} }
} else { } else {
// 同步进行中,不能更改账户
Toast.makeText(NotesPreferenceActivity.this, Toast.makeText(NotesPreferenceActivity.this,
R.string.preferences_toast_cannot_change_account, Toast.LENGTH_SHORT) R.string.preferences_toast_cannot_change_account, Toast.LENGTH_SHORT)
.show(); .show();
} }
return true; return true;
} }
}); });
mAccountCategory.addPreference(accountPref); mAccountCategory.addPreference(accountPref); // 添加账户偏好
} }
/**
*
*/
private void loadSyncButton() { private void loadSyncButton() {
Button syncButton = (Button) findViewById(R.id.preference_sync_button); Button syncButton = (Button) findViewById(R.id.preference_sync_button);
TextView lastSyncTimeView = (TextView) findViewById(R.id.prefenerece_sync_status_textview); TextView lastSyncTimeView = (TextView) findViewById(R.id.prefenerece_sync_status_textview);
// set button state // 设置按钮状态
if (GTaskSyncService.isSyncing()) { if (GTaskSyncService.isSyncing()) {
syncButton.setText(getString(R.string.preferences_button_sync_cancel)); syncButton.setText(getString(R.string.preferences_button_sync_cancel));
syncButton.setOnClickListener(new View.OnClickListener() { syncButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
GTaskSyncService.cancelSync(NotesPreferenceActivity.this); GTaskSyncService.cancelSync(NotesPreferenceActivity.this); // 取消同步
} }
}); });
} else { } else {
syncButton.setText(getString(R.string.preferences_button_sync_immediately)); syncButton.setText(getString(R.string.preferences_button_sync_immediately));
syncButton.setOnClickListener(new View.OnClickListener() { syncButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
GTaskSyncService.startSync(NotesPreferenceActivity.this); GTaskSyncService.startSync(NotesPreferenceActivity.this); // 开始同步
} }
}); });
} }
// 只有设置了同步账户才能启用同步按钮
syncButton.setEnabled(!TextUtils.isEmpty(getSyncAccountName(this))); syncButton.setEnabled(!TextUtils.isEmpty(getSyncAccountName(this)));
// set last sync time // 设置上次同步时间显示
if (GTaskSyncService.isSyncing()) { if (GTaskSyncService.isSyncing()) {
lastSyncTimeView.setText(GTaskSyncService.getProgressString()); lastSyncTimeView.setText(GTaskSyncService.getProgressString());
lastSyncTimeView.setVisibility(View.VISIBLE); lastSyncTimeView.setVisibility(View.VISIBLE);
@ -193,14 +205,21 @@ public class NotesPreferenceActivity extends PreferenceActivity {
} }
} }
/**
* UI
*/
private void refreshUI() { private void refreshUI() {
loadAccountPreference(); loadAccountPreference();
loadSyncButton(); loadSyncButton();
} }
/**
*
*/
private void showSelectAccountAlertDialog() { private void showSelectAccountAlertDialog() {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
// 设置自定义标题视图
View titleView = LayoutInflater.from(this).inflate(R.layout.account_dialog_title, null); View titleView = LayoutInflater.from(this).inflate(R.layout.account_dialog_title, null);
TextView titleTextView = (TextView) titleView.findViewById(R.id.account_dialog_title); TextView titleTextView = (TextView) titleView.findViewById(R.id.account_dialog_title);
titleTextView.setText(getString(R.string.preferences_dialog_select_account_title)); titleTextView.setText(getString(R.string.preferences_dialog_select_account_title));
@ -210,13 +229,14 @@ public class NotesPreferenceActivity extends PreferenceActivity {
dialogBuilder.setCustomTitle(titleView); dialogBuilder.setCustomTitle(titleView);
dialogBuilder.setPositiveButton(null, null); dialogBuilder.setPositiveButton(null, null);
Account[] accounts = getGoogleAccounts(); Account[] accounts = getGoogleAccounts(); // 获取所有Google账户
String defAccount = getSyncAccountName(this); String defAccount = getSyncAccountName(this);
mOriAccounts = accounts; mOriAccounts = accounts; // 保存原始账户列表
mHasAddedAccount = false; mHasAddedAccount = false; // 重置添加账户标志
if (accounts.length > 0) { if (accounts.length > 0) {
// 创建账户选择列表
CharSequence[] items = new CharSequence[accounts.length]; CharSequence[] items = new CharSequence[accounts.length];
final CharSequence[] itemMapping = items; final CharSequence[] itemMapping = items;
int checkedItem = -1; int checkedItem = -1;
@ -230,6 +250,7 @@ public class NotesPreferenceActivity extends PreferenceActivity {
dialogBuilder.setSingleChoiceItems(items, checkedItem, dialogBuilder.setSingleChoiceItems(items, checkedItem,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
// 设置选择的账户
setSyncAccount(itemMapping[which].toString()); setSyncAccount(itemMapping[which].toString());
dialog.dismiss(); dialog.dismiss();
refreshUI(); refreshUI();
@ -237,6 +258,7 @@ public class NotesPreferenceActivity extends PreferenceActivity {
}); });
} }
// 添加"添加账户"视图
View addAccountView = LayoutInflater.from(this).inflate(R.layout.add_account_text, null); View addAccountView = LayoutInflater.from(this).inflate(R.layout.add_account_text, null);
dialogBuilder.setView(addAccountView); dialogBuilder.setView(addAccountView);
@ -244,9 +266,10 @@ public class NotesPreferenceActivity extends PreferenceActivity {
addAccountView.setOnClickListener(new View.OnClickListener() { addAccountView.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
mHasAddedAccount = true; mHasAddedAccount = true;
// 启动添加账户设置界面
Intent intent = new Intent("android.settings.ADD_ACCOUNT_SETTINGS"); Intent intent = new Intent("android.settings.ADD_ACCOUNT_SETTINGS");
intent.putExtra(AUTHORITIES_FILTER_KEY, new String[] { intent.putExtra(AUTHORITIES_FILTER_KEY, new String[] {
"gmail-ls" "gmail-ls" // 只显示Gmail账户
}); });
startActivityForResult(intent, -1); startActivityForResult(intent, -1);
dialog.dismiss(); dialog.dismiss();
@ -254,9 +277,13 @@ public class NotesPreferenceActivity extends PreferenceActivity {
}); });
} }
/**
*
*/
private void showChangeAccountConfirmAlertDialog() { private void showChangeAccountConfirmAlertDialog() {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
// 设置自定义标题视图
View titleView = LayoutInflater.from(this).inflate(R.layout.account_dialog_title, null); View titleView = LayoutInflater.from(this).inflate(R.layout.account_dialog_title, null);
TextView titleTextView = (TextView) titleView.findViewById(R.id.account_dialog_title); TextView titleTextView = (TextView) titleView.findViewById(R.id.account_dialog_title);
titleTextView.setText(getString(R.string.preferences_dialog_change_account_title, titleTextView.setText(getString(R.string.preferences_dialog_change_account_title,
@ -265,6 +292,7 @@ public class NotesPreferenceActivity extends PreferenceActivity {
subtitleTextView.setText(getString(R.string.preferences_dialog_change_account_warn_msg)); subtitleTextView.setText(getString(R.string.preferences_dialog_change_account_warn_msg));
dialogBuilder.setCustomTitle(titleView); dialogBuilder.setCustomTitle(titleView);
// 设置菜单项
CharSequence[] menuItemArray = new CharSequence[] { CharSequence[] menuItemArray = new CharSequence[] {
getString(R.string.preferences_menu_change_account), getString(R.string.preferences_menu_change_account),
getString(R.string.preferences_menu_remove_account), getString(R.string.preferences_menu_remove_account),
@ -273,8 +301,10 @@ public class NotesPreferenceActivity extends PreferenceActivity {
dialogBuilder.setItems(menuItemArray, new DialogInterface.OnClickListener() { dialogBuilder.setItems(menuItemArray, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (which == 0) { if (which == 0) {
// 更改账户
showSelectAccountAlertDialog(); showSelectAccountAlertDialog();
} else if (which == 1) { } else if (which == 1) {
// 移除账户
removeSyncAccount(); removeSyncAccount();
refreshUI(); refreshUI();
} }
@ -283,11 +313,17 @@ public class NotesPreferenceActivity extends PreferenceActivity {
dialogBuilder.show(); dialogBuilder.show();
} }
/**
* Google
*/
private Account[] getGoogleAccounts() { private Account[] getGoogleAccounts() {
AccountManager accountManager = AccountManager.get(this); AccountManager accountManager = AccountManager.get(this);
return accountManager.getAccountsByType("com.google"); return accountManager.getAccountsByType("com.google"); // 只获取Google账户
} }
/**
*
*/
private void setSyncAccount(String account) { private void setSyncAccount(String account) {
if (!getSyncAccountName(this).equals(account)) { if (!getSyncAccountName(this).equals(account)) {
SharedPreferences settings = getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); SharedPreferences settings = getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
@ -299,10 +335,10 @@ public class NotesPreferenceActivity extends PreferenceActivity {
} }
editor.commit(); editor.commit();
// clean up last sync time // 清除上次同步时间
setLastSyncTime(this, 0); setLastSyncTime(this, 0);
// clean up local gtask related info // 清除本地GTask相关信息
new Thread(new Runnable() { new Thread(new Runnable() {
public void run() { public void run() {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
@ -318,6 +354,9 @@ public class NotesPreferenceActivity extends PreferenceActivity {
} }
} }
/**
*
*/
private void removeSyncAccount() { private void removeSyncAccount() {
SharedPreferences settings = getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); SharedPreferences settings = getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = settings.edit(); SharedPreferences.Editor editor = settings.edit();
@ -329,7 +368,7 @@ public class NotesPreferenceActivity extends PreferenceActivity {
} }
editor.commit(); editor.commit();
// clean up local gtask related info // 清除本地GTask相关信息
new Thread(new Runnable() { new Thread(new Runnable() {
public void run() { public void run() {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
@ -340,12 +379,18 @@ public class NotesPreferenceActivity extends PreferenceActivity {
}).start(); }).start();
} }
/**
*
*/
public static String getSyncAccountName(Context context) { public static String getSyncAccountName(Context context) {
SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME, SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME,
Context.MODE_PRIVATE); Context.MODE_PRIVATE);
return settings.getString(PREFERENCE_SYNC_ACCOUNT_NAME, ""); return settings.getString(PREFERENCE_SYNC_ACCOUNT_NAME, "");
} }
/**
*
*/
public static void setLastSyncTime(Context context, long time) { public static void setLastSyncTime(Context context, long time) {
SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME, SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME,
Context.MODE_PRIVATE); Context.MODE_PRIVATE);
@ -354,29 +399,36 @@ public class NotesPreferenceActivity extends PreferenceActivity {
editor.commit(); editor.commit();
} }
/**
*
*/
public static long getLastSyncTime(Context context) { public static long getLastSyncTime(Context context) {
SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME, SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME,
Context.MODE_PRIVATE); Context.MODE_PRIVATE);
return settings.getLong(PREFERENCE_LAST_SYNC_TIME, 0); return settings.getLong(PREFERENCE_LAST_SYNC_TIME, 0);
} }
/**
* GTask广
*/
private class GTaskReceiver extends BroadcastReceiver { private class GTaskReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
refreshUI(); refreshUI(); // 刷新UI
if (intent.getBooleanExtra(GTaskSyncService.GTASK_SERVICE_BROADCAST_IS_SYNCING, false)) { if (intent.getBooleanExtra(GTaskSyncService.GTASK_SERVICE_BROADCAST_IS_SYNCING, false)) {
// 更新同步进度显示
TextView syncStatus = (TextView) findViewById(R.id.prefenerece_sync_status_textview); TextView syncStatus = (TextView) findViewById(R.id.prefenerece_sync_status_textview);
syncStatus.setText(intent syncStatus.setText(intent
.getStringExtra(GTaskSyncService.GTASK_SERVICE_BROADCAST_PROGRESS_MSG)); .getStringExtra(GTaskSyncService.GTASK_SERVICE_BROADCAST_PROGRESS_MSG));
} }
} }
} }
@Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case android.R.id.home: case android.R.id.home:
// 点击返回按钮返回到笔记列表Activity
Intent intent = new Intent(this, NotesListActivity.class); Intent intent = new Intent(this, NotesListActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent); startActivity(intent);
@ -385,4 +437,4 @@ public class NotesPreferenceActivity extends PreferenceActivity {
return false; return false;
} }
} }
} }

@ -1,138 +1,183 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
版权声明 (Copyright notice)
2010-2011 年,小米开源社区 (MiCode Open Source Community) 版权所有
遵循 Apache 2.0 许可证
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net) <!-- 应用名称和部件相关 -->
<string name="app_name">Notes</string> <!-- 应用名称 -->
<string name="app_widget2x2">Notes 2x2</string> <!-- 2x2桌面小部件名称 -->
<string name="app_widget4x4">Notes 4x4</string> <!-- 4x4桌面小部件名称 -->
<string name="widget_havenot_content">No associated note found, click to create associated note.</string> <!-- 部件无内容提示 -->
<string name="widget_under_visit_mode">Privacy modecan not see note content</string> <!-- 隐私模式提示 -->
Licensed under the Apache License, Version 2.0 (the "License"); <!-- 笔记列表相关 -->
you may not use this file except in compliance with the License. <string name="notelist_string_info">...</string> <!-- 笔记列表信息(未使用完整) -->
You may obtain a copy of the License at <string name="notelist_menu_new">Add note</string> <!-- 添加新笔记菜单项 -->
http://www.apache.org/licenses/LICENSE-2.0 <!-- 提醒相关 -->
<string name="delete_remind_time_message">Delete reminder successfully</string> <!-- 删除提醒成功提示 -->
<string name="set_remind_time_message">Set reminder</string> <!-- 设置提醒提示 -->
<string name="note_alert_expired">Expired</string> <!-- 提醒过期提示 -->
Unless required by applicable law or agreed to in writing, software <!-- 日期时间格式 -->
distributed under the License is distributed on an "AS IS" BASIS, <string name="format_date_ymd">yyyyMMdd</string> <!-- 年月日格式 -->
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <string name="format_datetime_mdhm">MMMd kk:mm</string> <!-- 月日时分格式 -->
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android" <!-- 提醒对话框按钮 -->
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="notealert_ok">Got it</string> <!-- 知道了按钮 -->
<string name="app_name">Notes</string> <string name="notealert_enter">Take a look</string> <!-- 查看按钮 -->
<string name="app_widget2x2">Notes 2x2</string>
<string name="app_widget4x4">Notes 4x4</string> <!-- 笔记链接操作 -->
<string name="widget_havenot_content">No associated note found, click to create associated note.</string> <string name="note_link_tel">Call</string> <!-- 打电话链接 -->
<string name="widget_under_visit_mode">Privacy modecan not see note content</string> <string name="note_link_email">Send email</string> <!-- 发邮件链接 -->
<string name="notelist_string_info">...</string> <string name="note_link_web">Browse web</string> <!-- 浏览网页链接 -->
<string name="notelist_menu_new">Add note</string> <string name="note_link_other">Open map</string> <!-- 打开地图链接 -->
<string name="delete_remind_time_message">Delete reminder successfully</string>
<string name="set_remind_time_message">Set reminder</string> <!-- 文本导出相关 -->
<string name="note_alert_expired">Expired</string> <string name="file_path">/MIUI/notes/</string> <!-- 导出文件路径 -->
<string name="format_date_ymd">yyyyMMdd</string> <string name="file_name_txt_format">notes_%s.txt</string> <!-- 导出文件名格式 -->
<string name="format_datetime_mdhm">MMMd kk:mm</string>
<string name="notealert_ok">Got it</string> <!-- 笔记列表字符串 -->
<string name="notealert_enter">Take a look</string> <string name="format_folder_files_count">(%d)</string> <!-- 文件夹中文件数量显示格式 -->
<string name="note_link_tel">Call</string>
<string name="note_link_email">Send email</string> <!-- 菜单项 -->
<string name="note_link_web">Browse web</string> <string name="menu_create_folder">New Folder</string> <!-- 新建文件夹菜单 -->
<string name="note_link_other">Open map</string> <string name="menu_export_text">Export text</string> <!-- 导出文本菜单 -->
<!-- Text export file information --> <string name="menu_sync">Sync</string> <!-- 同步菜单 -->
<string name="file_path">/MIUI/notes/</string> <string name="menu_sync_cancel">Cancel syncing</string> <!-- 取消同步菜单 -->
<string name="file_name_txt_format">notes_%s.txt</string> <string name="menu_setting">Settings</string> <!-- 设置菜单 -->
<!-- notes list string --> <string name="menu_search">Search</string> <!-- 搜索菜单 -->
<string name="format_folder_files_count">(%d)</string> <string name="menu_delete">Delete</string> <!-- 删除菜单 -->
<string name="menu_create_folder">New Folder</string> <string name="menu_move">Move to folder</string> <!-- 移动到文件夹菜单 -->
<string name="menu_export_text">Export text</string> <string name="menu_select_title">%d selected</string> <!-- 已选择数量标题 -->
<string name="menu_sync">Sync</string> <string name="menu_select_none">Nothing selected, the operation is invalid</string> <!-- 未选择提示 -->
<string name="menu_sync_cancel">Cancel syncing</string> <string name="menu_select_all">Select all</string> <!-- 全选菜单 -->
<string name="menu_setting">Settings</string> <string name="menu_deselect_all">Deselect all</string> <!-- 取消全选菜单 -->
<string name="menu_search">Search</string>
<string name="menu_delete">Delete</string> <!-- 字体大小菜单 -->
<string name="menu_move">Move to folder</string> <string name="menu_font_size">Font size</string> <!-- 字体大小菜单标题 -->
<string name="menu_select_title">%d selected</string> <string name="menu_font_small">Small</string> <!-- 小号字体 -->
<string name="menu_select_none">Nothing selected, the operation is invalid</string> <string name="menu_font_normal">Medium</string> <!-- 中号字体 -->
<string name="menu_select_all">Select all</string> <string name="menu_font_large">Large</string> <!-- 大号字体 -->
<string name="menu_deselect_all">Deselect all</string> <string name="menu_font_super">Super</string> <!-- 超大号字体 -->
<string name="menu_font_size">Font size</string>
<string name="menu_font_small">Small</string> <!-- 列表模式菜单 -->
<string name="menu_font_normal">Medium</string> <string name="menu_list_mode">Enter check list</string> <!-- 进入选择列表模式 -->
<string name="menu_font_large">Large</string> <string name="menu_normal_mode">Leave check list</string> <!-- 退出选择列表模式 -->
<string name="menu_font_super">Super</string>
<string name="menu_list_mode">Enter check list</string> <!-- 文件夹操作菜单 -->
<string name="menu_normal_mode">Leave check list</string> <string name="menu_folder_view">View folder</string> <!-- 查看文件夹 -->
<string name="menu_folder_view">View folder</string> <string name="menu_folder_delete">Delete folder</string> <!-- 删除文件夹 -->
<string name="menu_folder_delete">Delete folder</string> <string name="menu_folder_change_name">Change folder name</string> <!-- 修改文件夹名称 -->
<string name="menu_folder_change_name">Change folder name</string>
<string name="folder_exist">The folder %1$s exist, please rename</string> <!-- 文件夹错误提示 -->
<string name="menu_share">Share</string> <string name="folder_exist">The folder %1$s exist, please rename</string> <!-- 文件夹已存在提示 -->
<string name="menu_send_to_desktop">Send to home</string>
<string name="menu_alert">Remind me</string> <!-- 其他菜单 -->
<string name="menu_remove_remind">Delete reminder</string> <string name="menu_share">Share</string> <!-- 分享菜单 -->
<string name="menu_title_select_folder">Select folder</string> <string name="menu_send_to_desktop">Send to home</string> <!-- 发送到桌面菜单 -->
<string name="menu_move_parent_folder">Parent folder</string> <string name="menu_alert">Remind me</string> <!-- 设置提醒菜单 -->
<string name="info_note_enter_desktop">Note added to home</string> <string name="menu_remove_remind">Delete reminder</string> <!-- 删除提醒菜单 -->
<string name="alert_message_delete_folder">Confirm to delete folder and its notes?</string>
<string name="alert_title_delete">Delete selected notes</string> <!-- 文件夹选择相关 -->
<string name="alert_message_delete_notes">Confirm to delete the selected %d notes?</string> <string name="menu_title_select_folder">Select folder</string> <!-- 选择文件夹标题 -->
<string name="alert_message_delete_note">Confirm to delete this note?</string> <string name="menu_move_parent_folder">Parent folder</string> <!-- 父文件夹菜单 -->
<string name="format_move_notes_to_folder">Have moved selected %1$d notes to %2$s folder</string>
<!-- Error information --> <!-- 操作成功提示 -->
<string name="error_sdcard_unmounted">SD card busy, not available now</string> <string name="info_note_enter_desktop">Note added to home</string> <!-- 笔记添加到桌面成功 -->
<string name="error_sdcard_export">Export failed, please check SD card</string>
<string name="error_note_not_exist">The note is not exist</string> <!-- 删除确认对话框 -->
<string name="error_note_empty_for_clock">Sorry, can not set clock on empty note</string> <string name="alert_message_delete_folder">Confirm to delete folder and its notes?</string> <!-- 删除文件夹确认 -->
<string name="error_note_empty_for_send_to_desktop">Sorry, can not send and empty note to home</string> <string name="alert_title_delete">Delete selected notes</string> <!-- 删除笔记标题 -->
<string name="success_sdcard_export">Export successful</string> <string name="alert_message_delete_notes">Confirm to delete the selected %d notes?</string> <!-- 删除多个笔记确认 -->
<string name="failed_sdcard_export">Export fail</string> <string name="alert_message_delete_note">Confirm to delete this note?</string> <!-- 删除单个笔记确认 -->
<string name="format_exported_file_location">Export text file (%1$s) to SD (%2$s) directory</string>
<!-- Sync --> <!-- 移动笔记提示 -->
<string name="ticker_syncing">Syncing notes...</string> <string name="format_move_notes_to_folder">Have moved selected %1$d notes to %2$s folder</string> <!-- 移动笔记成功提示 -->
<string name="ticker_success">Sync is successful</string>
<string name="ticker_fail">Sync is failed</string> <!-- 错误信息 -->
<string name="ticker_cancel">Sync is canceled</string> <string name="error_sdcard_unmounted">SD card busy, not available now</string> <!-- SD卡不可用错误 -->
<string name="success_sync_account">Sync is successful with account %1$s</string> <string name="error_sdcard_export">Export failed, please check SD card</string> <!-- 导出失败错误 -->
<string name="error_sync_network">Sync failed, please check network and account settings</string> <string name="error_note_not_exist">The note is not exist</string> <!-- 笔记不存在错误 -->
<string name="error_sync_internal">Sync failed, internal error occurs</string> <string name="error_note_empty_for_clock">Sorry, can not set clock on empty note</string> <!-- 空笔记设置提醒错误 -->
<string name="error_sync_cancelled">Sync is canceled</string> <string name="error_note_empty_for_send_to_desktop">Sorry, can not send and empty note to home</string> <!-- 空笔记发送到桌面错误 -->
<string name="sync_progress_login">Logging into %1$s...</string>
<string name="sync_progress_init_list">Getting remote note list...</string> <!-- 导出结果提示 -->
<string name="sync_progress_syncing">Synchronize local notes with Google Task...</string> <string name="success_sdcard_export">Export successful</string> <!-- 导出成功 -->
<!-- Preferences --> <string name="failed_sdcard_export">Export fail</string> <!-- 导出失败 -->
<string name="preferences_title">Settings</string> <string name="format_exported_file_location">Export text file (%1$s) to SD (%2$s) directory</string> <!-- 导出文件位置信息 -->
<string name="preferences_account_title">Sync account</string>
<string name="preferences_account_summary">Sync notes with google task</string> <!-- 同步相关提示 -->
<string name="preferences_last_sync_time">Last sync time %1$s</string> <string name="ticker_syncing">Syncing notes...</string> <!-- 同步进行中通知 -->
<string name="preferences_last_sync_time_format">yyyy-MM-dd hh:mm:ss</string> <string name="ticker_success">Sync is successful</string> <!-- 同步成功通知 -->
<string name="preferences_add_account">Add account</string> <string name="ticker_fail">Sync is failed</string> <!-- 同步失败通知 -->
<string name="preferences_menu_change_account">Change sync account</string> <string name="ticker_cancel">Sync is canceled</string> <!-- 同步取消通知 -->
<string name="preferences_menu_remove_account">Remove sync account</string> <string name="success_sync_account">Sync is successful with account %1$s</string> <!-- 同步成功带账号信息 -->
<string name="preferences_menu_cancel">Cancel</string> <string name="error_sync_network">Sync failed, please check network and account settings</string> <!-- 网络同步失败 -->
<string name="preferences_button_sync_immediately">Sync immediately</string> <string name="error_sync_internal">Sync failed, internal error occurs</string> <!-- 内部错误导致同步失败 -->
<string name="preferences_button_sync_cancel">Cancel syncing</string> <string name="error_sync_cancelled">Sync is canceled</string> <!-- 同步已取消 -->
<string name="preferences_dialog_change_account_title">Current account %1$s</string>
<string name="preferences_dialog_change_account_warn_msg">All sync related information will be deleted, which may result in duplicated items sometime</string> <!-- 同步进度提示 -->
<string name="preferences_dialog_select_account_title">Sync notes</string> <string name="sync_progress_login">Logging into %1$s...</string> <!-- 登录中提示 -->
<string name="preferences_dialog_select_account_tips">Please select a google account. Local notes will be synced with google task.</string> <string name="sync_progress_init_list">Getting remote note list...</string> <!-- 获取远程笔记列表 -->
<string name="preferences_toast_cannot_change_account">Cannot change the account because sync is in progress</string> <string name="sync_progress_syncing">Synchronize local notes with Google Task...</string> <!-- 同步本地笔记与Google Task -->
<string name="preferences_toast_success_set_accout">%1$s has been set as the sync account</string>
<string name="preferences_bg_random_appear_title">New note background color random</string> <!-- 设置相关 -->
<string name="preferences_title">Settings</string> <!-- 设置标题 -->
<string name="button_delete">Delete</string> <string name="preferences_account_title">Sync account</string> <!-- 同步账号标题 -->
<string name="call_record_folder_name">Call notes</string> <string name="preferences_account_summary">Sync notes with google task</string> <!-- 同步账号摘要 -->
<string name="hint_foler_name">Input name</string> <string name="preferences_last_sync_time">Last sync time %1$s</string> <!-- 上次同步时间 -->
<string name="preferences_last_sync_time_format">yyyy-MM-dd hh:mm:ss</string> <!-- 同步时间格式 -->
<string name="menu_beijing">Background: beijing</string> <string name="preferences_add_account">Add account</string> <!-- 添加账号 -->
<string name="menu_bb">Background: bb</string> <string name="preferences_menu_change_account">Change sync account</string> <!-- 更改同步账号菜单 -->
<string name="preferences_menu_remove_account">Remove sync account</string> <!-- 移除同步账号菜单 -->
<string name="search_label">Searching Notes</string> <string name="preferences_menu_cancel">Cancel</string> <!-- 取消菜单 -->
<string name="search_hint">Search notes</string> <string name="preferences_button_sync_immediately">Sync immediately</string> <!-- 立即同步按钮 -->
<string name="search_setting_description">Text in your notes</string> <string name="preferences_button_sync_cancel">Cancel syncing</string> <!-- 取消同步按钮 -->
<string name="search">Notes</string>
<string name="datetime_dialog_ok">set</string> <!-- 账号相关对话框 -->
<string name="datetime_dialog_cancel">cancel</string> <string name="preferences_dialog_change_account_title">Current account %1$s</string> <!-- 当前账号对话框标题 -->
<string name="preferences_dialog_change_account_warn_msg">All sync related information will be deleted, which may result in duplicated items sometime</string> <!-- 更改账号警告信息 -->
<string name="preferences_dialog_select_account_title">Sync notes</string> <!-- 选择账号对话框标题 -->
<string name="preferences_dialog_select_account_tips">Please select a google account. Local notes will be synced with google task.</string> <!-- 选择账号提示 -->
<!-- 设置相关提示 -->
<string name="preferences_toast_cannot_change_account">Cannot change the account because sync is in progress</string> <!-- 同步中无法更改账号提示 -->
<string name="preferences_toast_success_set_accout">%1$s has been set as the sync account</string> <!-- 成功设置同步账号提示 -->
<string name="preferences_bg_random_appear_title">New note background color random</string> <!-- 新笔记随机背景颜色设置 -->
<!-- 通用按钮 -->
<string name="button_delete">Delete</string> <!-- 删除按钮 -->
<!-- 特殊文件夹名称 -->
<string name="call_record_folder_name">Call notes</string> <!-- 通话记录文件夹名称 -->
<!-- 输入提示 -->
<string name="hint_foler_name">Input name</string> <!-- 文件夹名称输入提示 -->
<!-- 背景选择菜单 -->
<string name="menu_beijing">Background: beijing</string> <!-- 北京背景菜单 -->
<string name="menu_bb">Background: bb</string> <!-- bb背景菜单 -->
<!-- 搜索相关 -->
<string name="search_label">Searching Notes</string> <!-- 搜索标签 -->
<string name="search_hint">Search notes</string> <!-- 搜索提示 -->
<string name="search_setting_description">Text in your notes</string> <!-- 搜索设置描述 -->
<string name="search">Notes</string> <!-- 搜索 -->
<!-- 日期时间对话框按钮 -->
<string name="datetime_dialog_ok">set</string> <!-- 设置按钮 -->
<string name="datetime_dialog_cancel">cancel</string> <!-- 取消按钮 -->
<!-- 搜索结果标题(支持单复数) -->
<plurals name="search_results_title"> <plurals name="search_results_title">
<item quantity="one"><xliff:g id="number" example="1">%1$s</xliff:g> result for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item> <item quantity="one"><xliff:g id="number" example="1">%1$s</xliff:g> result for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
<!-- Case of 0 or 2 or more results. --> <!-- 0个或多个结果的情况 -->
<item quantity="other"><xliff:g id="number" example="15">%1$s</xliff:g> results for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item> <item quantity="other"><xliff:g id="number" example="15">%1$s</xliff:g> results for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
</plurals> </plurals>
</resources> </resources>

@ -62,9 +62,12 @@
<item name="android:actionBarStyle">@style/NoteActionBarStyle</item> <item name="android:actionBarStyle">@style/NoteActionBarStyle</item>
</style> </style>
<!-- <style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">-->
<!-- <item name="android:displayOptions" />-->
<!-- <item name="android:visibility">gone</item>-->
<!-- </style>-->
<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid"> <style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:displayOptions" /> <item name="android:visibility">visible</item>
<item name="android:visibility">gone</item>
</style> </style>
</resources> </resources>
<!--<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">--> <!--<style name="NoteActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">-->

Loading…
Cancel
Save