修改部分合并后导致的错误

pull/16/head
Surponess 2 months ago
parent 5fd0235eb2
commit 362bcd4f41

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="0.1" >
<!-- 已移除package属性已注释minSdkVersion可选删除 -->
<!-- <uses-sdk android:minSdkVersion="14" /> -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:icon="@drawable/icon_app"
android:label="@string/app_name" >
<activity
android:name=".ui.NotesListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="adjustPan"
android:exported="true" > <!-- 新增 -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.NoteEditActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:exported="true" > <!-- 新增 -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<provider
android:name="net.micode.notes.data.NotesProvider"
android:authorities="micode_notes"
android:multiprocess="true" />
<receiver
android:name=".widget.NoteWidgetProvider_2x"
android:label="@string/app_widget2x2"
android:exported="false" > <!-- 新增 -->
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_2x_info" />
</receiver>
<receiver
android:name=".widget.NoteWidgetProvider_4x"
android:label="@string/app_widget4x4"
android:exported="false" > <!-- 新增 -->
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_4x_info" />
</receiver>
<receiver
android:name=".ui.AlarmInitReceiver"
android:exported="true" > <!-- 新增 -->
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name="net.micode.notes.ui.AlarmReceiver"
android:process=":remote" >
</receiver>
<activity
android:name=".ui.AlarmAlertActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" >
</activity>
<activity
android:name="net.micode.notes.ui.NotesPreferenceActivity"
android:label="@string/preferences_title"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".ui.TrashActivity"
android:label="@string/menu_trash"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:exported="true" >
</activity>
<activity
android:name=".ui.PasswordInputActivity"
android:label="@string/password_input_title"
android:theme="@style/NoteTheme"
android:exported="false" >
</activity>
<service
android:name="net.micode.notes.gtask.remote.GTaskSyncService"
android:exported="false" >
</service>
<meta-data
android:name="android.app.default_searchable"
android:value=".ui.NoteEditActivity" />
</application>
</manifest>

@ -1,6 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
package="net.micode.notes"
android:versionCode="1"
android:versionName="0.1" >
<!-- 已移除package属性已注释minSdkVersion可选删除 -->
<!-- <uses-sdk android:minSdkVersion="14" /> -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.INTERNET" />
@ -11,28 +26,17 @@
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Notesmaster"
tools:targetApi="31">
android:icon="@drawable/icon_app"
android:label="@string/app_name" >
<activity
android:name=".ui.NotesListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="adjustPan"
android:exported="true">
<!-- 这段本来在theme和windowSoftInputMode之间android:uiOptions="splitActionBarWhenNarrow" -->
android:exported="true" > <!-- 新增 -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@ -136,6 +140,19 @@
android:launchMode="singleTop"
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<activity
android:name=".ui.TrashActivity"
android:label="@string/menu_trash"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
android:exported="true" >
</activity>
<activity
android:name=".ui.PasswordInputActivity"
android:label="@string/password_input_title"
android:theme="@style/NoteTheme"
android:exported="false" >
</activity>
<service
android:name="net.micode.notes.gtask.remote.GTaskSyncService"

@ -88,7 +88,10 @@ public class Notes {
// 查询数据表的URI
public static final Uri CONTENT_DATA_URI = Uri.parse("content://" + AUTHORITY + "/data");
/**
* Uri to query trash notes
*/
public static final Uri CONTENT_TRASH_URI = Uri.parse("content://" + AUTHORITY + "/trash");
/**
* NoteColumns - 便(notes)
* 便
@ -148,8 +151,19 @@ public class Notes {
// 版本号
public static final String VERSION = "version";
/**
* Whether the note is encrypted
* <P> Type : INTEGER (0 = not encrypted, 1 = encrypted) </P>
*/
public static final String IS_ENCRYPTED = "is_encrypted";
}
public interface TrashColumns extends NoteColumns {
/**
* Deleted date for trash note
* <P> Type: INTEGER (long) </P>
*/
public static final String DELETED_DATE = "deleted_date";
}
/**
* DataColumns - 便(data)
* 便

@ -36,7 +36,19 @@ import net.micode.notes.tool.DataUtils;
public class NoteItemData {
/** 数据库查询投影数组 */
static final String [] PROJECTION = new String [] {
NoteColumns.IS_ENCRYPTED, // 是否加密
NoteColumns.ID, // 笔记ID
NoteColumns.ALERTED_DATE, // 提醒日期
NoteColumns.BG_COLOR_ID, // 背景颜色ID
NoteColumns.CREATED_DATE, // 创建日期
NoteColumns.HAS_ATTACHMENT, // 是否有附件
NoteColumns.MODIFIED_DATE, // 修改日期
NoteColumns.NOTES_COUNT, // 笔记数量
NoteColumns.PARENT_ID, // 父文件夹ID
NoteColumns.SNIPPET, // 笔记摘要
NoteColumns.TYPE, // 笔记类型
NoteColumns.WIDGET_ID, // 小部件ID
NoteColumns.WIDGET_TYPE, // 小部件类型
NoteColumns.IS_ENCRYPTED, // 是否加密
};
/** 笔记ID列索引 */

@ -274,7 +274,10 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
mNoteModeButton = (Button) findViewById(R.id.btn_note_mode);
mChecklistModeButton = (Button) findViewById(R.id.btn_checklist_mode);
mIsChecklistMode = false;
updateModeButtons();
// 只有当按钮存在时才更新状态,避免空指针异常
if (mNoteModeButton != null && mChecklistModeButton != null) {
updateModeButtons();
}
mChecklistManager = new ChecklistManager(mContentResolver);
}
@ -833,18 +836,21 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
* OMO
*/
private void updateModeButtons() {
if (mIsChecklistMode) {
// 清单模式下,清单按钮高亮
mChecklistModeButton.setBackgroundColor(0xFF007AFF);
mChecklistModeButton.setTextColor(0xFFFFFFFF);
mNoteModeButton.setBackgroundColor(0xFFFFFFFF);
mNoteModeButton.setTextColor(0xFF000000);
} else {
// 笔记模式下,笔记按钮高亮
mNoteModeButton.setBackgroundColor(0xFF007AFF);
mNoteModeButton.setTextColor(0xFFFFFFFF);
mChecklistModeButton.setBackgroundColor(0xFFFFFFFF);
mChecklistModeButton.setTextColor(0xFF000000);
// 确保按钮不为空,避免空指针异常
if (mNoteModeButton != null && mChecklistModeButton != null) {
if (mIsChecklistMode) {
// 清单模式下,清单按钮高亮
mChecklistModeButton.setBackgroundColor(0xFF007AFF);
mChecklistModeButton.setTextColor(0xFFFFFFFF);
mNoteModeButton.setBackgroundColor(0xFFFFFFFF);
mNoteModeButton.setTextColor(0xFF000000);
} else {
// 笔记模式下,笔记按钮高亮
mNoteModeButton.setBackgroundColor(0xFF007AFF);
mNoteModeButton.setTextColor(0xFFFFFFFF);
mChecklistModeButton.setBackgroundColor(0xFFFFFFFF);
mChecklistModeButton.setTextColor(0xFF000000);
}
}
}

Loading…
Cancel
Save