第一次维护以及报告的合并

master
eazzy 11 months ago
parent b54f6ba626
commit eb0ff40ec5

Binary file not shown.

@ -1,185 +1,155 @@
<?xml version="1.0" encoding="utf-8"?> <?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" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.micode.notes" package="net.micode.notes"
android:versionCode="1" android:versionCode="1"
android:versionName="0.1" > android:versionName="0.1"> <!-- - 指定应用程序需要支持的最低的 Android SDK 版本 -->
<!--- 指定应用程序需要支持的最低的 Android SDK 版本 -->
<uses-sdk android:minSdkVersion="14" /> <uses-sdk android:minSdkVersion="14" />
<!--- 权限声明 --> <!-- - 权限声明 -->
<!--- 写入 SD 卡的权限 --> <!-- - 写入 SD 卡的权限 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- - 创建、删除有关快捷方式的权限 -->
<!--- 创建、删除有关快捷方式的权限 --> <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> <!-- - 访问网络的权限 -->
<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.INTERNET" /> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> <!-- - 验证账户的权限 -->
<!--- 读取联系人的权限 -->
<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.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> <!-- - 开机自动运行权限 -->
<!--- 开机自动运行权限 -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!--- 应用程序组件声明 -->
<!--- 定义应用程序的图标和名称 -->
<application <application
android:icon="@drawable/icon_app" android:icon="@drawable/icon_app_1"
android:label="@string/app_name" > android:label="@string/app_name">
<activity
android:name=".ui.SplashActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:theme="@style/Theme.Notes.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--- 应用程序的入口 NotesListActivity --> <!-- - 应用程序的入口 NotesListActivity -->
<activity <activity
android:name=".ui.NotesListActivity" android:name=".ui.NotesListActivity"
android:exported="true"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/NoteTheme" android:theme="@style/NoteTheme"
android:windowSoftInputMode="adjustPan" > android:windowSoftInputMode="adjustPan">
<!--- 定义该 Activity 为启动器,即默认启动的 Activity -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> </activity>
<!--- 笔记编辑 Activity --> <!-- - 笔记编辑 Activity -->
<activity <activity
android:name=".ui.NoteEditActivity" android:name=".ui.NoteEditActivity"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/NoteTheme" > android:theme="@style/NoteTheme">
<!--- 笔记编辑 Activity 的 Intent Filter用于接收其他应用程序发送过来的消息 --> <!-- - 笔记编辑 Activity 的 Intent Filter用于接收其他应用程序发送过来的消息 -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<!--- 笔记编辑 Activity 可以处理的 MIME 类型 --> <!-- - 笔记编辑 Activity 可以处理的 MIME 类型 -->
<data android:mimeType="vnd.android.cursor.item/text_note" android:scheme="content" android:host="com.example.notes.provider" android:path="/notes" /> <data
<data android:mimeType="vnd.android.cursor.item/call_note" android:scheme="content" android:host="com.example.notes.provider" android:path="/notes" /> android:host="com.example.notes.provider"
android:mimeType="vnd.android.cursor.item/text_note"
android:path="/notes"
android:scheme="content" />
<data
android:host="com.example.notes.provider"
android:mimeType="vnd.android.cursor.item/call_note"
android:path="/notes"
android:scheme="content" />
</intent-filter> </intent-filter>
<!--- 笔记编辑 Activity 的 Intent Filter用于接收其他应用程序发送过来的消息 --> <!-- - 笔记编辑 Activity 的 Intent Filter用于接收其他应用程序发送过来的消息 -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.INSERT_OR_EDIT" /> <action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<!--- 笔记编辑 Activity 可以处理的 MIME 类型 --> <!-- - 笔记编辑 Activity 可以处理的 MIME 类型 -->
<data android:mimeType="vnd.android.cursor.item/text_note" /> <data android:mimeType="vnd.android.cursor.item/text_note" />
<data android:mimeType="vnd.android.cursor.item/call_note" /> <data android:mimeType="vnd.android.cursor.item/call_note" />
</intent-filter> </intent-filter>
<!--- 搜索 Intent Filter用于响应搜索请求 --> <!-- - 搜索 Intent Filter用于响应搜索请求 -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEARCH" /> <action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
<!--- 搜索框的配置信息 --> <!-- - 搜索框的配置信息 -->
<meta-data <meta-data
android:name="android.app.searchable" android:name="android.app.searchable"
android:resource="@xml/searchable" /> android:resource="@xml/searchable" />
</activity> </activity> <!-- - 笔记供应器,用于共享笔记数据 -->
<!--- 笔记供应器,用于共享笔记数据 -->
<provider <provider
android:name="net.micode.notes.data.NotesProvider" android:name=".data.NotesProvider"
android:authorities="micode_notes" android:authorities="micode_notes"
android:multiprocess="true" /> android:multiprocess="true" /> <!-- - 笔记小部件,支持两种大小 -->
<!--- 笔记小部件,支持两种大小 -->
<receiver <receiver
android:name=".widget.NoteWidgetProvider_2x" android:name=".widget.NoteWidgetProvider_2x"
android:label="@string/app_widget2x2" > android:label="@string/app_widget2x2">
<!--- 笔记小部件的 Intent Filter用于接收系统广播和小部件更新操作 --> <!-- - 笔记小部件的 Intent Filter用于接收系统广播和小部件更新操作 -->
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" /> <action android:name="android.appwidget.action.APPWIDGET_DELETED" />
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" /> <action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
</intent-filter> </intent-filter>
<!--- 笔记小部件的配置信息 --> <!-- - 笔记小部件的配置信息 -->
<meta-data <meta-data
android:name="android.appwidget.provider" android:name="android.appwidget.provider"
android:resource="@xml/widget_2x_info" /> android:resource="@xml/widget_2x_info" />
</receiver> </receiver>
<receiver <receiver
android:name=".widget.NoteWidgetProvider_4x" android:name=".widget.NoteWidgetProvider_4x"
android:label="@string/app_widget4x4" > android:label="@string/app_widget4x4">
<!--- 笔记小部件的 Intent Filter用于接收系统广播和小部件更新操作 --> <!-- - 笔记小部件的 Intent Filter用于接收系统广播和小部件更新操作 -->
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.appwidget.action.APPWIDGET_DELETED" /> <action android:name="android.appwidget.action.APPWIDGET_DELETED" />
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" /> <action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
</intent-filter> </intent-filter>
<!--- 笔记小部件的配置信息 --> <!-- - 笔记小部件的配置信息 -->
<meta-data <meta-data
android:name="android.appwidget.provider" android:name="android.appwidget.provider"
android:resource="@xml/widget_4x_info" /> android:resource="@xml/widget_4x_info" />
</receiver> </receiver> <!-- - 启动时需要初始化闹钟服务 -->
<receiver android:name=".ui.AlarmInitReceiver">
<!--- 启动时需要初始化闹钟服务 -->
<receiver android:name=".ui.AlarmInitReceiver" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter> </intent-filter>
</receiver> </receiver> <!-- - 闹钟服务 -->
<!--- 闹钟服务 -->
<receiver <receiver
android:name="net.micode.notes.ui.AlarmReceiver" android:name=".ui.AlarmReceiver"
android:process=":remote" > android:process=":remote"></receiver> <!-- - 闹钟提示 Activity -->
</receiver>
<!--- 闹钟提示 Activity -->
<activity <activity
android:name=".ui.AlarmAlertActivity" android:name=".ui.AlarmAlertActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" > android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar"></activity> <!-- - 首选项 Activity -->
</activity>
<!--- 首选项 Activity -->
<activity <activity
android:name="net.micode.notes.ui.NotesPreferenceActivity" android:name=".ui.NotesPreferenceActivity"
android:label="@string/preferences_title" android:label="@string/preferences_title"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@android:style/Theme.Holo.Light" > android:theme="@android:style/Theme.Holo.Light"></activity> <!-- - GTask 同步服务 -->
</activity>
<!--- GTask 同步服务 -->
<service <service
android:name="net.micode.notes.gtask.remote.GTaskSyncService" android:name=".gtask.remote.GTaskSyncService"
android:exported="false" > android:exported="false"></service> <!-- - 默认搜索 Activity -->
</service>
<!--- 默认搜索 Activity -->
<meta-data <meta-data
android:name="android.app.default_searchable" android:name="android.app.default_searchable"
android:value=".ui.NoteEditActivity" /> android:value=".ui.NoteEditActivity" />
</application> </application>
</manifest> </manifest>

@ -25,7 +25,6 @@ import android.util.Log;
import java.util.HashMap; import java.util.HashMap;
/** /**
<<<<<<<< HEAD:src/main/java/net/micode/notes/data/Contact.java
* @Package: net.micode.notes.data * @Package: net.micode.notes.data
* @ClassName: Contact * @ClassName: Contact
* @Description: * @Description:
@ -37,29 +36,6 @@ public class Contact {
private static HashMap<String, String> sContactCache; private static HashMap<String, String> sContactCache;
private static final String TAG = "Contact"; private static final String TAG = "Contact";
========
* @Package: net.micode.notes.data
* @ClassName: Contact
* @Description:
* Contact
* HashMap
* getContact
*
* SQL
* 线线使
* @Author: YangYizhe
* @CreateDate: 12/17/2023 10:10 AM
* @Version: 1.0
*/
public class Contact {
/**
* ,
*/
private static HashMap<String, String> sContactCache;
private static final String TAG = "Contact";//设置日志TAG标签
//查询联系人的SQL筛选语句
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/data/Contact.java
private static final String CALLER_ID_SELECTION = "PHONE_NUMBERS_EQUAL(" + Phone.NUMBER private static final String CALLER_ID_SELECTION = "PHONE_NUMBERS_EQUAL(" + Phone.NUMBER
+ ",?) AND " + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'" + ",?) AND " + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'"
+ " AND " + Data.RAW_CONTACT_ID + " IN " + " AND " + Data.RAW_CONTACT_ID + " IN "

@ -19,6 +19,8 @@ import android.text.SpannableString;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.format.DateUtils; import android.text.format.DateUtils;
import android.text.style.BackgroundColorSpan; import android.text.style.BackgroundColorSpan;
import android.text.Editable;// 引入textwatcher和Editable
import android.text.TextWatcher;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -67,12 +69,6 @@ import java.util.regex.Pattern;
*/ */
public class NoteEditActivity extends Activity implements OnClickListener, public class NoteEditActivity extends Activity implements OnClickListener,
NoteSettingChangedListener, OnTextViewChangeListener { NoteSettingChangedListener, OnTextViewChangeListener {
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
========
/**
*
*/
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private class HeadViewHolder { private class HeadViewHolder {
public TextView tvModified; public TextView tvModified;
@ -81,6 +77,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
public TextView tvAlertDate; public TextView tvAlertDate;
public ImageView ibSetBgColor; public ImageView ibSetBgColor;
public TextView textNum;
} }
private static final Map<Integer, Integer> sBgSelectorBtnsMap = new HashMap<Integer, Integer>(); private static final Map<Integer, Integer> sBgSelectorBtnsMap = new HashMap<Integer, Integer>();
static { static {
@ -138,6 +136,70 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private String mUserQuery; private String mUserQuery;
private Pattern mPattern; private Pattern mPattern;
/**
* @method Textchange
* @description
* @date: 1/3/2024 8:48 AM
* @author: YangYizhe
* @param oriText
* @return
*/
private String Textchange(String oriText){
StringBuffer stringBuffer = new StringBuffer(oriText);
int Flag1 = -1;
int Flag2 = -1;
do {//不计入表示图片的字符
Flag1 = stringBuffer.indexOf("<img");
Flag2 = stringBuffer.indexOf(">");
if (Flag1 != -1 && Flag2 != -1) {
stringBuffer = stringBuffer.replace(Flag1, Flag2+1, "");
}
} while (Flag1 != -1 && Flag2 != -1);
do {//不计入换行字符
Flag1 = stringBuffer.indexOf("\n");
if (Flag1 != -1){
stringBuffer = stringBuffer.replace(Flag1, Flag1+1, "");
}
} while (Flag1 != -1);
do {//不计入空格字符
Flag1 = stringBuffer.indexOf(" ");
if (Flag1 != -1) {
stringBuffer = stringBuffer.replace(Flag1, Flag1+1, "");
}
} while (Flag1 != -1);
return stringBuffer.toString();
}
/**
* @method count
* @description
* @date: 1/3/2024 9:09 AM
* @author: YangYizhe
*/
private void count() {
mNoteEditor.addTextChangedListener(new TextWatcher() {
int currentLength = 0;
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
mNoteHeaderHolder.textNum.setText("字数:" + currentLength);
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
currentLength = Textchange(mNoteEditor.getText().toString()).length();
}
@Override
public void afterTextChanged(Editable s) {
mNoteHeaderHolder.textNum.setText("字数:" + currentLength);
}
});
}
/** /**
* Activity * Activity
*/ */
@ -150,6 +212,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
return; return;
} }
initResources(); initResources();
count();
} }
/** /**
@ -294,7 +357,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
*/ */
showAlertHeader(); showAlertHeader();
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method showAlertHeader * @method showAlertHeader
* @description * @description
@ -306,9 +368,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @date: 12/24/2023 6:24 PM * @date: 12/24/2023 6:24 PM
* @author: YangYizhe * @author: YangYizhe
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private void showAlertHeader() { private void showAlertHeader() {
if (mWorkingNote.hasClockAlert()) { if (mWorkingNote.hasClockAlert()) {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
@ -385,6 +444,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mNoteHeaderHolder.ivAlertIcon = (ImageView) findViewById(R.id.iv_alert_icon); mNoteHeaderHolder.ivAlertIcon = (ImageView) findViewById(R.id.iv_alert_icon);
mNoteHeaderHolder.tvAlertDate = (TextView) findViewById(R.id.tv_alert_date); mNoteHeaderHolder.tvAlertDate = (TextView) findViewById(R.id.tv_alert_date);
mNoteHeaderHolder.ibSetBgColor = (ImageView) findViewById(R.id.btn_set_bg_color); mNoteHeaderHolder.ibSetBgColor = (ImageView) findViewById(R.id.btn_set_bg_color);
mNoteHeaderHolder.textNum = (TextView) findViewById(R.id.text_num);
mNoteHeaderHolder.ibSetBgColor.setOnClickListener(this); mNoteHeaderHolder.ibSetBgColor.setOnClickListener(this);
mNoteEditor = (EditText) findViewById(R.id.note_edit_view); mNoteEditor = (EditText) findViewById(R.id.note_edit_view);
mNoteEditorPanel = findViewById(R.id.sv_note_edit); mNoteEditorPanel = findViewById(R.id.sv_note_edit);
@ -420,15 +480,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
} }
clearSettingState(); clearSettingState();
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method updateWidget * @method updateWidget
* @description * @description
* @date: 12/24/2023 6:21 PM * @date: 12/24/2023 6:21 PM
* @author: YangYizhe * @author: YangYizhe
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private void updateWidget() { private void updateWidget() {
Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE); Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
if (mWorkingNote.getWidgetType() == Notes.TYPE_WIDGET_2X) { if (mWorkingNote.getWidgetType() == Notes.TYPE_WIDGET_2X) {
@ -551,8 +608,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.menu_new_note) { if (itemId == R.id.menu_new_note) {
createNewNote(); createNewNote();
} } else if (itemId == R.id.menu_delete) {
else if (itemId == R.id.menu_delete) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getString(R.string.alert_title_delete)); builder.setTitle(getString(R.string.alert_title_delete));
builder.setIcon(android.R.drawable.ic_dialog_alert); builder.setIcon(android.R.drawable.ic_dialog_alert);
@ -677,7 +733,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
showToast(R.string.error_note_empty_for_clock); showToast(R.string.error_note_empty_for_clock);
} }
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* updateWidget * updateWidget
*/ */
@ -692,11 +747,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @param index * @param index
* @param text * @param text
*/ */
========
public void onWidgetChanged() {
updateWidget();
}
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
public void onEditTextDelete(int index, String text) { public void onEditTextDelete(int index, String text) {
int childCount = mEditTextList.getChildCount(); int childCount = mEditTextList.getChildCount();
if (childCount == 1) { if (childCount == 1) {
@ -722,7 +772,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
edit.requestFocus(); edit.requestFocus();
edit.setSelection(length); edit.setSelection(length);
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method onEditTextEnter * @method onEditTextEnter
* @description * @description
@ -731,8 +780,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @param index * @param index
* @param text * @param text
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
public void onEditTextEnter(int index, String text) { public void onEditTextEnter(int index, String text) {
/** /**
* Should not happen, check for debug * Should not happen, check for debug
@ -751,7 +798,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
.setIndex(i); .setIndex(i);
} }
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method switchToListMode * @method switchToListMode
* @description * @description
@ -759,8 +805,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @author: YangYizhe * @author: YangYizhe
* @param text * @param text
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private void switchToListMode(String text) { private void switchToListMode(String text) {
mEditTextList.removeAllViews(); mEditTextList.removeAllViews();
String[] items = text.split("\n"); String[] items = text.split("\n");
@ -777,7 +821,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mNoteEditor.setVisibility(View.GONE); mNoteEditor.setVisibility(View.GONE);
mEditTextList.setVisibility(View.VISIBLE); mEditTextList.setVisibility(View.VISIBLE);
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method getHighlightQueryResult * @method getHighlightQueryResult
* @description * @description
@ -787,8 +830,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @param userQuery * @param userQuery
* @return Spannable * @return Spannable
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private Spannable getHighlightQueryResult(String fullText, String userQuery) { private Spannable getHighlightQueryResult(String fullText, String userQuery) {
SpannableString spannable = new SpannableString(fullText == null ? "" : fullText); SpannableString spannable = new SpannableString(fullText == null ? "" : fullText);
if (!TextUtils.isEmpty(userQuery)) { if (!TextUtils.isEmpty(userQuery)) {
@ -805,7 +846,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
} }
return spannable; return spannable;
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method getListItem * @method getListItem
* @description * @description
@ -815,8 +855,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @param index * @param index
* @return * @return
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private View getListItem(String item, int index) { private View getListItem(String item, int index) {
View view = LayoutInflater.from(this).inflate(R.layout.note_edit_list_item, null); View view = LayoutInflater.from(this).inflate(R.layout.note_edit_list_item, null);
final NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text); final NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text);
@ -847,7 +885,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
edit.setText(getHighlightQueryResult(item, mUserQuery)); edit.setText(getHighlightQueryResult(item, mUserQuery));
return view; return view;
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method onTextChange * @method onTextChange
* @description * @description
@ -856,8 +893,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @param index * @param index
* @param hasText * @param hasText
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
public void onTextChange(int index, boolean hasText) { public void onTextChange(int index, boolean hasText) {
if (index >= mEditTextList.getChildCount()) { if (index >= mEditTextList.getChildCount()) {
Log.e(TAG, "Wrong index, should not happen"); Log.e(TAG, "Wrong index, should not happen");
@ -869,7 +904,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mEditTextList.getChildAt(index).findViewById(R.id.cb_edit_item).setVisibility(View.GONE); mEditTextList.getChildAt(index).findViewById(R.id.cb_edit_item).setVisibility(View.GONE);
} }
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method onCheckListModeChanged * @method onCheckListModeChanged
* @description * @description
@ -878,9 +912,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @param oldMode * @param oldMode
* @param newMode * @param newMode
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
public void onCheckListModeChanged(int oldMode, int newMode) { public void onCheckListModeChanged(int oldMode, int newMode) {
if (newMode == TextNote.MODE_CHECK_LIST) { if (newMode == TextNote.MODE_CHECK_LIST) {
switchToListMode(mNoteEditor.getText().toString()); switchToListMode(mNoteEditor.getText().toString());
@ -894,7 +925,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mNoteEditor.setVisibility(View.VISIBLE); mNoteEditor.setVisibility(View.VISIBLE);
} }
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method getWorkingText * @method getWorkingText
* @description * @description
@ -902,8 +932,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @author: YangYizhe * @author: YangYizhe
* @return * @return
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private boolean getWorkingText() { private boolean getWorkingText() {
boolean hasChecked = false;//初始化check标记 boolean hasChecked = false;//初始化check标记
if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) { if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) {
@ -943,11 +971,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* 便,退 * 便,退
* @date: 12/21/2023 8:14 AM * @date: 12/21/2023 8:14 AM
* @author: YangYizhe * @author: YangYizhe
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
========
* @param
* @return
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
*/ */
private boolean saveNote() { private boolean saveNote() {
getWorkingText(); getWorkingText();
@ -972,11 +995,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* send to home * send to home
* @date: 12/21/2023 8:15 AM * @date: 12/21/2023 8:15 AM
* @author: YangYizhe * @author: YangYizhe
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
========
* @param
* @return
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
*/ */
private void sendToDesktop() { private void sendToDesktop() {
/** /**
@ -1012,7 +1030,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
showToast(R.string.error_note_empty_for_send_to_desktop); showToast(R.string.error_note_empty_for_send_to_desktop);
} }
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method makeShortcutIconTitle * @method makeShortcutIconTitle
* @description * @description
@ -1021,8 +1038,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @param content * @param content
* @return * @return
*/ */
========
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
private String makeShortcutIconTitle(String content) { private String makeShortcutIconTitle(String content) {
content = content.replace(TAG_CHECKED, ""); content = content.replace(TAG_CHECKED, "");
content = content.replace(TAG_UNCHECKED, ""); content = content.replace(TAG_UNCHECKED, "");

@ -46,28 +46,12 @@ import java.util.Map;
* @Version: 1.0 * @Version: 1.0
*/ */
public class NoteEditText extends EditText { public class NoteEditText extends EditText {
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditText.java
private static final String TAG = "NoteEditText"; private static final String TAG = "NoteEditText";
private int mIndex; private int mIndex;
private int mSelectionStartBeforeDelete; private int mSelectionStartBeforeDelete;
private static final String SCHEME_TEL = "tel:" ; private static final String SCHEME_TEL = "tel:" ;
private static final String SCHEME_HTTP = "http:" ; private static final String SCHEME_HTTP = "http:" ;
private static final String SCHEME_EMAIL = "mailto:" ; private static final String SCHEME_EMAIL = "mailto:" ;
========
//常量标识
private static final String TAG = "NoteEditText";
//声明整型变量,文本索引
private int mIndex;
//声明整型变量
private int mSelectionStartBeforeDelete;
//声明字符串常量,标志电话、网址、邮件
private static final String SCHEME_TEL = "tel:" ;
private static final String SCHEME_HTTP = "http:" ;
private static final String SCHEME_EMAIL = "mailto:" ;
//设置映射,将文本内容(电话、网址、邮件)做链接处理
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditText.java
private static final Map<String, Integer> sSchemaActionResMap = new HashMap<String, Integer>(); private static final Map<String, Integer> sSchemaActionResMap = new HashMap<String, Integer>();
static { static {
sSchemaActionResMap.put(SCHEME_TEL, R.string.note_link_tel); sSchemaActionResMap.put(SCHEME_TEL, R.string.note_link_tel);
@ -112,13 +96,9 @@ public class NoteEditText extends EditText {
mIndex = 0; mIndex = 0;
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditText.java
/** /**
* *
*/ */
========
//设置索引号
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditText.java
public void setIndex(int index) { public void setIndex(int index) {
mIndex = index; mIndex = index;
} }
@ -144,17 +124,6 @@ public class NoteEditText extends EditText {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditText.java
========
/**
* @method onTouchEvent
* @description
* @date: 12/21/2023 12:41 AM
* @author: YangYizhe
* @param
* @return
*/
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditText.java
@Override @Override
/** /**
* @method onTouchEvent * @method onTouchEvent
@ -266,17 +235,6 @@ public class NoteEditText extends EditText {
super.onFocusChanged(focused, direction, previouslyFocusedRect); super.onFocusChanged(focused, direction, previouslyFocusedRect);
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditText.java
========
/**
* @method onCreateContextMenu
* @description
* @date: 12/21/2023 12:39 AM
* @author: YangYizhe
* @param
* @return
*/
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditText.java
@Override @Override
/** /**
* @method onCreateContextMenu * @method onCreateContextMenu

@ -34,6 +34,7 @@ import net.micode.notes.tool.DataUtils;
* @Version: 1.0 * @Version: 1.0
*/ */
public class NoteItemData { public class NoteItemData {
// 用于定义查询操作中要返回的列
static final String [] PROJECTION = new String [] { static final String [] PROJECTION = new String [] {
NoteColumns.ID, NoteColumns.ID,
NoteColumns.ALERTED_DATE, NoteColumns.ALERTED_DATE,

@ -85,6 +85,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
private static final String PREFERENCE_ADD_INTRODUCTION = "net.micode.notes.introduction"; private static final String PREFERENCE_ADD_INTRODUCTION = "net.micode.notes.introduction";
/**三个状态,主页面,文件夹,通话记录文件夹*/
private enum ListEditState { private enum ListEditState {
NOTE_LIST, SUB_FOLDER, CALL_RECORD_FOLDER NOTE_LIST, SUB_FOLDER, CALL_RECORD_FOLDER
}; };
@ -100,6 +101,8 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
private Button mAddNewNote; private Button mAddNewNote;
private boolean mDispatch; private boolean mDispatch;
// 控制背景颜色,初始为亮
private int mBackgroundColor = 1;
private int mOriginY; private int mOriginY;
@ -117,6 +120,9 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public static final int NOTES_LISTVIEW_SCROLL_RATE = 30; public static final int NOTES_LISTVIEW_SCROLL_RATE = 30;
/** 私密模式,初始为 0 开启为 1*/
public static int mSecretMode = 0;
private NoteItemData mFocusNoteDataItem; private NoteItemData mFocusNoteDataItem;
private static final String NORMAL_SELECTION = NoteColumns.PARENT_ID + "=?"; private static final String NORMAL_SELECTION = NoteColumns.PARENT_ID + "=?";
@ -140,6 +146,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
protected void onCreate(final Bundle savedInstanceState) { protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState); // 调用父类的onCreate函数 super.onCreate(savedInstanceState); // 调用父类的onCreate函数
setContentView(R.layout.note_list); setContentView(R.layout.note_list);
getWindow().setBackgroundDrawableResource(R.drawable.bg_light);
initResources(); initResources();
setAppInfoFromRawRes(); setAppInfoFromRawRes();
} }
@ -463,10 +470,12 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
* @return * @return
*/ */
private void startAsyncNotesListQuery() { private void startAsyncNotesListQuery() {
String selection = (mCurrentFolderId == Notes.ID_ROOT_FOLDER) ? ROOT_FOLDER_SELECTION : NORMAL_SELECTION; String selection = (mCurrentFolderId == Notes.ID_ROOT_FOLDER) ? ROOT_FOLDER_SELECTION
: NORMAL_SELECTION;
mBackgroundQueryHandler.startQuery(FOLDER_NOTE_LIST_QUERY_TOKEN, null, mBackgroundQueryHandler.startQuery(FOLDER_NOTE_LIST_QUERY_TOKEN, null,
Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[] {String.valueOf(mCurrentFolderId)}, Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[]{
NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC"); String.valueOf(mCurrentFolderId)
}, NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC");
} }
/** /**
* @Package: net.micode.notes.ui * @Package: net.micode.notes.ui
@ -530,6 +539,98 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}); });
builder.show(); builder.show();
} }
/**
* @method switchBackground
* @description
* @date: 1/3/2024 3:41 PM
* @author: YangYizhe
*/
private void switchBackground(){
mBackgroundColor = (mBackgroundColor + 1) % 2;
View frameLayout = findViewById(R.id.frame_layout_id);
if (mBackgroundColor == 1){
frameLayout.setBackgroundResource(R.drawable.bg_light);
} else{
frameLayout.setBackgroundResource(R.drawable.bg_dark);
}
}
private boolean isSecretMode(){
if(mSecretMode == 1){
return true;
}else {
return false;
}
}
/**
* @method enterSecertMode
* @description
* @date: 1/2/2024 8:18 PM
* @author: YangYizhe
*/
private void enterSecretMode(){
AlertDialog.Builder dialog = new AlertDialog.Builder(NotesListActivity.this);
dialog.setTitle("重要提醒");
dialog.setMessage("您确认进入隐私模式吗?");
dialog.setCancelable(false);
dialog.setPositiveButton("确认", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mSecretMode = 1;
startAsyncNotesListQuery();
Toast.makeText(NotesListActivity.this,"您已进入隐私模式",Toast.LENGTH_SHORT).show();
}
});
dialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which){}
});
dialog.show();
}
/**
* @method quitSecretMode
* @description 退
* @date: 1/2/2024 8:20 PM
* @author: YangYizhe
*/
private void quitSecretMode(){
AlertDialog.Builder dialog = new AlertDialog.Builder(NotesListActivity.this);
dialog.setTitle("重要提醒");
dialog.setMessage("您确认退出隐私模式吗?");
dialog.setCancelable(false);
dialog.setPositiveButton("确认", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mSecretMode = 0;
startAsyncNotesListQuery();
Toast.makeText(NotesListActivity.this,"您已退出隐私模式",Toast.LENGTH_SHORT).show();
}
});
dialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which){}
});
dialog.show();
}
/**
* @method restoreDeletedNodes
* @description
* @date: 1/3/2024 8:11 PM
* @author: YangYizhe
*/
private void restoreDeletedNodes(){
mState = ListEditState.SUB_FOLDER;
mCurrentFolderId = Notes.ID_TRASH_FOLER;
startAsyncNotesListQuery();
mTitleBar.setText("回收站");
mTitleBar.setVisibility(View.VISIBLE);
}
/** /**
* @method createNewNote * @method createNewNote
* @description 便 * @description 便
@ -544,6 +645,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
intent.putExtra(Notes.INTENT_EXTRA_FOLDER_ID, mCurrentFolderId); intent.putExtra(Notes.INTENT_EXTRA_FOLDER_ID, mCurrentFolderId);
this.startActivityForResult(intent, REQUEST_CODE_NEW_NODE); this.startActivityForResult(intent, REQUEST_CODE_NEW_NODE);
} }
/** /**
* @method batchDelete * @method batchDelete
* @description: * @description:
@ -558,15 +660,15 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
new AsyncTask<Void, Void, HashSet<AppWidgetAttribute>>() { new AsyncTask<Void, Void, HashSet<AppWidgetAttribute>>() {
protected HashSet<AppWidgetAttribute> doInBackground(Void... unused) { protected HashSet<AppWidgetAttribute> doInBackground(Void... unused) {
HashSet<AppWidgetAttribute> widgets = mNotesListAdapter.getSelectedWidget(); HashSet<AppWidgetAttribute> widgets = mNotesListAdapter.getSelectedWidget();
//如果没有同步,直接删除 // 如果是回收站中的,直接删除
if (!isSyncMode()) { if (mCurrentFolderId == Notes.ID_TRASH_FOLER) {
if (DataUtils.batchDeleteNotes(mContentResolver, mNotesListAdapter if (DataUtils.batchDeleteNotes(mContentResolver, mNotesListAdapter
.getSelectedItemIds())) { .getSelectedItemIds())) {
} else { } else {
Log.e(TAG, "Delete notes error, should not happens"); Log.e(TAG, "Delete notes error, should not happens");
} }
} }
//已同步,将删除的便签移到垃圾桶 // 将删除的便签移到回收站
else { else {
if (!DataUtils.batchMoveToFolder(mContentResolver, mNotesListAdapter if (!DataUtils.batchMoveToFolder(mContentResolver, mNotesListAdapter
.getSelectedItemIds(), Notes.ID_TRASH_FOLER)) { .getSelectedItemIds(), Notes.ID_TRASH_FOLER)) {
@ -891,6 +993,14 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
} }
@Override @Override
/**
* @method onPrepareOptionsMenu
* @description menuAndroid
* @date: 1/2/2024 7:40 PM
* @author: YangYizhe
* @param [menu]
* @return boolean
*/
public boolean onPrepareOptionsMenu(Menu menu) { public boolean onPrepareOptionsMenu(Menu menu) {
menu.clear(); menu.clear();
if (mState == ListEditState.NOTE_LIST) { if (mState == ListEditState.NOTE_LIST) {
@ -905,10 +1015,29 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
} else { } else {
Log.e(TAG, "Wrong state:" + mState); Log.e(TAG, "Wrong state:" + mState);
} }
// 若在隐私模式之中,则不显示进入隐私模式的选项,不在隐私模式之中,则不显示退出隐私模式选项
if(isSecretMode()){
menu.findItem(R.id.menu_secret).setVisible(false);
} else {
menu.findItem(R.id.menu_quit_secret).setVisible(false);
}
if(mBackgroundColor==1) {
menu.findItem(R.id.menu_light_mode).setVisible(false);
} else {
menu.findItem(R.id.menu_dark_mode).setVisible(false);
}
return true; return true;
} }
@Override @Override
/**
* @method onOptionsItemSelected
* @description
* @date: 1/2/2024 7:41 PM
* @author: YangYizhe
* @param [item]
* @return boolean
*/
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.menu_new_folder) { if (itemId == R.id.menu_new_folder) {
@ -931,6 +1060,16 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
createNewNote(); createNewNote();
} else if (itemId == R.id.menu_search) { } else if (itemId == R.id.menu_search) {
onSearchRequested(); onSearchRequested();
} else if (itemId == R.id.menu_secret) {
enterSecretMode();
} else if (itemId == R.id.menu_quit_secret){
quitSecretMode();
} else if(itemId == R.id.menu_light_mode) {
switchBackground();
} else if(itemId == R.id.menu_dark_mode) {
switchBackground();
} else if (itemId == R.id.menu_restore) {
restoreDeletedNodes();
} }
return true; return true;
} }

@ -26,7 +26,7 @@ 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; //打钩框

@ -0,0 +1,53 @@
package net.micode.notes.ui;
import android.annotation.SuppressLint;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowInsets;
import android.content.Intent;
import net.micode.notes.databinding.ActivitySplashBinding;
import net.micode.notes.R;
/**
* An example full-screen activity that shows and hides the system UI (i.e.
* status bar and navigation/system bar) with user interaction.
*/
public class SplashActivity extends AppCompatActivity {
/**
* Whether or not the system UI should be auto-hidden after
* {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds.
*/
private static final boolean AUTO_HIDE = true;
/**
* If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after
* user interaction before hiding the system UI.
*/
private static final int AUTO_HIDE_DELAY_MILLIS = 3000;
Handler mHandler=new Handler();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); //加载启动界面
setContentView(R.layout.activity_splash); //加载启动图片
// 当计时结束时跳转至NotesListActivity
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent=new Intent();
intent.setClass(SplashActivity.this, NotesListActivity.class);
startActivity(intent);
finish(); //销毁欢迎页面
}
}, 2000); // 2 秒后跳转
}
}

@ -46,7 +46,6 @@ public abstract class NoteWidgetProvider extends AppWidgetProvider {
NoteColumns.SNIPPET NoteColumns.SNIPPET
}; };
public static final int COLUMN_ID = 0; public static final int COLUMN_ID = 0;
public static final int COLUMN_BG_COLOR_ID = 1; public static final int COLUMN_BG_COLOR_ID = 1;
public static final int COLUMN_SNIPPET = 2; public static final int COLUMN_SNIPPET = 2;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash"
android:theme="@style/ThemeOverlay.Notes.FullscreenContainer"
tools:context=".ui.SplashActivity">
<!-- The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc. -->
<!-- This FrameLayout insets its children based on system windows using
android:fitsSystemWindows. -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<TextView
android:id="@+id/fullscreen_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:keepScreenOn="true"
android:text="@string/eazzy_note"
android:textColor="@android:color/holo_blue_dark"
android:textSize="50sp"
android:textStyle="bold|italic"
android:visibility="visible" />
</FrameLayout>
</FrameLayout>

@ -30,6 +30,7 @@
android:id="@+id/note_title" android:id="@+id/note_title"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<!-- 字符统计 -->
<TextView <TextView
android:id="@+id/tv_modified_date" android:id="@+id/tv_modified_date"
@ -56,6 +57,13 @@
android:layout_marginRight="8dip" android:layout_marginRight="8dip"
android:textAppearance="@style/TextAppearanceSecondaryItem" /> android:textAppearance="@style/TextAppearanceSecondaryItem" />
<TextView
android:id="@+id/text_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_marginRight="8dip" />
<ImageButton <ImageButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -91,13 +99,13 @@
android:id="@+id/note_edit_view" android:id="@+id/note_edit_view"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="left|top"
android:background="@null"
android:autoLink="all" android:autoLink="all"
android:background="@null"
android:gravity="left|top"
android:lineSpacingMultiplier="1.2"
android:linksClickable="false" android:linksClickable="false"
android:minLines="12" android:minLines="12"
android:textAppearance="@style/TextAppearancePrimaryItem" android:textAppearance="@style/TextAppearancePrimaryItem" />
android:lineSpacingMultiplier="1.2" />
<LinearLayout <LinearLayout
android:id="@+id/note_edit_list" android:id="@+id/note_edit_list"

@ -17,9 +17,10 @@
<FrameLayout <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout_id"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:background="@drawable/list_background"> android:background="@drawable/bg_light">
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"

@ -36,4 +36,24 @@
<item <item
android:id="@+id/menu_search" android:id="@+id/menu_search"
android:title="@string/menu_search"/> android:title="@string/menu_search"/>
<item
android:id="@+id/menu_light_mode"
android:title="@string/light_mode"/>
<item
android:id="@+id/menu_dark_mode"
android:title="@string/dark_mode"/>
<item
android:id="@+id/menu_secret"
android:title="@string/menu_secret"/>
<item
android:id="@+id/menu_quit_secret"
android:title="@string/menu_quit_secret"/>
<item
android:id="@+id/menu_restore"
android:title="@string/menu_restore"/>
</menu> </menu>

@ -21,4 +21,20 @@
<item <item
android:id="@+id/menu_new_note" android:id="@+id/menu_new_note"
android:title="@string/notelist_menu_new"/> android:title="@string/notelist_menu_new"/>
<item
android:id="@+id/menu_light_mode"
android:title="@string/light_mode"/>
<item
android:id="@+id/menu_dark_mode"
android:title="@string/dark_mode"/>
<item
android:id="@+id/menu_secret"
android:title="@string/menu_secret"/>
<item
android:id="@+id/menu_quit_secret"
android:title="@string/menu_quit_secret"/>
</menu> </menu>

@ -0,0 +1,7 @@
<resources>
<style name="ThemeOverlay.Notes.FullscreenContainer" parent="">
<item name="fullscreenBackgroundColor">@color/light_blue_900</item>
<item name="fullscreenTextColor">@color/light_blue_A400</item>
</style>
</resources>

@ -119,6 +119,14 @@
<string name="search">便签</string> <string name="search">便签</string>
<string name="datetime_dialog_ok">设置</string> <string name="datetime_dialog_ok">设置</string>
<string name="datetime_dialog_cancel">取消</string> <string name="datetime_dialog_cancel">取消</string>
<string name="light_mode">亮背景</string>
<string name="dark_mode">暗背景</string>
<string name="menu_secret">私密模式</string>
<string name="menu_quit_secret">退出私密模式</string>
<string name="note_length">字符数</string>
<string name="menu_restore">恢复</string>
<string name="title_activity_splash">欢迎页面</string>
<string name="eazzy_note">EAZZY\nNOTE</string>
<plurals name="search_results_title"> <plurals name="search_results_title">
<item quantity="other"><xliff:g id="NUMBER">%1$s</xliff:g> 条符合“<xliff:g id="SEARCH">%2$s</xliff:g>”的搜索结果</item> <item quantity="other"><xliff:g id="NUMBER">%1$s</xliff:g> 条符合“<xliff:g id="SEARCH">%2$s</xliff:g>”的搜索结果</item>
</plurals> </plurals>

@ -120,6 +120,14 @@
<string name="search">便籤</string> <string name="search">便籤</string>
<string name="datetime_dialog_ok">設置</string> <string name="datetime_dialog_ok">設置</string>
<string name="datetime_dialog_cancel">取消</string> <string name="datetime_dialog_cancel">取消</string>
<string name="light_mode">亮背景</string>
<string name="dark_mode">暗背景</string>
<string name="menu_secret">私密模式</string>
<string name="menu_quit_secret">退出私密模式</string>
<string name="note_length">字符数</string>
<string name="menu_restore">恢复</string>
<string name="title_activity_splash">欢迎页面</string>
<string name="eazzy_note">EAZZY\nNOTE</string>
<plurals name="search_results_title"> <plurals name="search_results_title">
<item quantity="other"><xliff:g id="NUMBER">%1$s</xliff:g> 條符合”<xliff:g id="SEARCH">%2$s</xliff:g>“的搜尋結果</item> <item quantity="other"><xliff:g id="NUMBER">%1$s</xliff:g> 條符合”<xliff:g id="SEARCH">%2$s</xliff:g>“的搜尋結果</item>
</plurals> </plurals>

@ -0,0 +1,6 @@
<resources>
<declare-styleable name="FullscreenAttrs">
<attr name="fullscreenBackgroundColor" format="color" />
<attr name="fullscreenTextColor" format="color" />
</declare-styleable>
</resources>

@ -17,4 +17,9 @@
<resources> <resources>
<color name="user_query_highlight">#335b5b5b</color> <color name="user_query_highlight">#335b5b5b</color>
<color name="light_blue_600">#FF039BE5</color>
<color name="light_blue_900">#FF01579B</color>
<color name="light_blue_A200">#FF40C4FF</color>
<color name="light_blue_A400">#FF00B0FF</color>
<color name="black_overlay">#66000000</color>
</resources> </resources>

@ -15,8 +15,7 @@
limitations under the License. limitations under the License.
--> -->
<resources xmlns:android="http://schemas.android.com/apk/res/android" <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">Notes</string> <string name="app_name">Notes</string>
<string name="app_widget2x2">Notes 2x2</string> <string name="app_widget2x2">Notes 2x2</string>
<string name="app_widget4x4">Notes 4x4</string> <string name="app_widget4x4">Notes 4x4</string>
@ -126,10 +125,24 @@
<string name="search">Notes</string> <string name="search">Notes</string>
<string name="datetime_dialog_ok">set</string> <string name="datetime_dialog_ok">set</string>
<string name="datetime_dialog_cancel">cancel</string> <string name="datetime_dialog_cancel">cancel</string>
<string name="light_mode">light mode</string>
<string name="dark_mode">dark mode</string>
<!-- secret mode -->
<string name="menu_secret">secret mode</string>
<string name="menu_quit_secret">quit secret mode</string>
<string name="note_length">length</string>
<string name="menu_restore">restore</string>
<string name="title_activity_splash">SplashActivity</string>
<string name="eazzy_note">EAZZY\nNOTE</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 example="1" id="number">%1$s</xliff:g> result for \"<xliff:g example="???" id="search">%2$s</xliff:g>\"</item>
<!-- Case of 0 or 2 or more results. --> <!-- Case of 0 or 2 or more results. -->
<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 example="15" id="number">%1$s</xliff:g> results for \"<xliff:g example="???" id="search">%2$s</xliff:g>\"</item>
</plurals> </plurals>
</resources> </resources>

@ -16,18 +16,22 @@
--> -->
<resources> <resources>
<style name="TextAppearanceSuper"> <style name="TextAppearanceSuper">
<item name="android:textSize">@dimen/text_font_size_super</item> <item name="android:textSize">@dimen/text_font_size_super</item>
<item name="android:textColorLink">#0000ff</item> <item name="android:textColorLink">#0000ff</item>
</style> </style>
<style name="TextAppearanceLarge"> <style name="TextAppearanceLarge">
<item name="android:textSize">@dimen/text_font_size_large</item> <item name="android:textSize">@dimen/text_font_size_large</item>
<item name="android:textColorLink">#0000ff</item> <item name="android:textColorLink">#0000ff</item>
</style> </style>
<style name="TextAppearanceMedium"> <style name="TextAppearanceMedium">
<item name="android:textSize">@dimen/text_font_size_medium</item> <item name="android:textSize">@dimen/text_font_size_medium</item>
<item name="android:textColorLink">#0000ff</item> <item name="android:textColorLink">#0000ff</item>
</style> </style>
<style name="TextAppearanceNormal"> <style name="TextAppearanceNormal">
<item name="android:textSize">@dimen/text_font_size_normal</item> <item name="android:textSize">@dimen/text_font_size_normal</item>
<item name="android:textColorLink">#0000ff</item> <item name="android:textColorLink">#0000ff</item>
@ -66,4 +70,13 @@
<item name="android:displayOptions" /> <item name="android:displayOptions" />
<item name="android:visibility">visible</item> <item name="android:visibility">visible</item>
</style> </style>
<style name="Widget.Theme.Notes.ActionBar.Fullscreen" parent="Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_overlay</item>
</style>
<style name="Widget.Theme.Notes.ButtonBar.Fullscreen" parent="">
<item name="android:background">@color/black_overlay</item>
<item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item>
</style>
</resources> </resources>

@ -0,0 +1,15 @@
<resources>
<style name="Theme.Notes" parent="Theme.AppCompat.Light" />
<style name="Theme.Notes.Fullscreen" parent="Theme.Notes">
<item name="android:actionBarStyle">@style/Widget.Theme.Notes.ActionBar.Fullscreen</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowBackground">@null</item>
</style>
<style name="ThemeOverlay.Notes.FullscreenContainer" parent="">
<item name="fullscreenBackgroundColor">@color/light_blue_600</item>
<item name="fullscreenTextColor">@color/light_blue_A200</item>
</style>
</resources>
Loading…
Cancel
Save