Compare commits

...

6 Commits

Author SHA1 Message Date
eazzy 3412ab3dfd last commit
10 months ago
eazzy edc716f4ed 报告的一部分
10 months ago
eazzy bf78bf8ca5 功能:撤回undo,重做redo
10 months ago
eazzy 73953b77e9 质量分析报告完善
11 months ago
eazzy 654e548bb5 第一次维护
11 months ago
eazzy 3a1fc50227 报告合并,第一次维护
11 months ago

1
.gitignore vendored

@ -2,3 +2,4 @@
/src/.idea/
/src/Notes-master1/
/.idea/
/MiNotes.iml/

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="SonarLintModuleSettings">
<option name="uniqueId" value="499b6a1f-5e4f-45a0-a056-ac9b183cc908" />
</component>
</module>

Binary file not shown.

@ -1,68 +1,53 @@
<?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"
package="net.micode.notes"
android:versionCode="1"
android:versionName="0.1" >
<!--- 指定应用程序需要支持的最低的 Android SDK 版本 -->
android:versionName="0.1"> <!-- - 指定应用程序需要支持的最低的 Android SDK 版本 -->
<uses-sdk android:minSdkVersion="14" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<!-- - 权限声明 -->
<!-- - 写入 SD 卡的权限 -->
<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.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.USE_CREDENTIALS" /> <!--- 开机自动运行权限 -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" /> <!-- 网络权限 -->
<uses-permission android:name="android.permission.CAMERA" /> <!-- 相机权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 读取SD卡权限 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 写SD卡权限 -->
<!--- 应用程序组件声明 -->
<!--- 定义应用程序的图标和名称 -->
<application
android:icon="@drawable/icon_app"
android:icon="@drawable/icon_app_1"
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 -->
<activity
android:name=".ui.NotesListActivity"
android:exported="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/NoteTheme"
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 -->
@ -75,15 +60,25 @@
<!-- - 笔记编辑 Activity 的 Intent Filter用于接收其他应用程序发送过来的消息 -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<!-- - 笔记编辑 Activity 可以处理的 MIME 类型 -->
<data android:mimeType="vnd.android.cursor.item/text_note" android:scheme="content" android:host="com.example.notes.provider" android:path="/notes" />
<data android:mimeType="vnd.android.cursor.item/call_note" android:scheme="content" android:host="com.example.notes.provider" android:path="/notes" />
<data
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>
<!-- - 笔记编辑 Activity 的 Intent Filter用于接收其他应用程序发送过来的消息 -->
<intent-filter>
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<!-- - 笔记编辑 Activity 可以处理的 MIME 类型 -->
<data android:mimeType="vnd.android.cursor.item/text_note" />
@ -93,6 +88,7 @@
<!-- - 搜索 Intent Filter用于响应搜索请求 -->
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@ -100,15 +96,11 @@
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<!--- 笔记供应器,用于共享笔记数据 -->
</activity> <!-- - 笔记供应器,用于共享笔记数据 -->
<provider
android:name="net.micode.notes.data.NotesProvider"
android:name=".data.NotesProvider"
android:authorities="micode_notes"
android:multiprocess="true" />
<!--- 笔记小部件,支持两种大小 -->
android:multiprocess="true" /> <!-- - 笔记小部件,支持两种大小 -->
<receiver
android:name=".widget.NoteWidgetProvider_2x"
android:label="@string/app_widget2x2">
@ -140,46 +132,31 @@
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_4x_info" />
</receiver>
<!--- 启动时需要初始化闹钟服务 -->
</receiver> <!-- - 启动时需要初始化闹钟服务 -->
<receiver android:name=".ui.AlarmInitReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!--- 闹钟服务 -->
</receiver> <!-- - 闹钟服务 -->
<receiver
android:name="net.micode.notes.ui.AlarmReceiver"
android:process=":remote" >
</receiver>
<!--- 闹钟提示 Activity -->
android:name=".ui.AlarmReceiver"
android:process=":remote"></receiver> <!-- - 闹钟提示 Activity -->
<activity
android:name=".ui.AlarmAlertActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" >
</activity>
<!--- 首选项 Activity -->
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar"></activity> <!-- - 首选项 Activity -->
<activity
android:name="net.micode.notes.ui.NotesPreferenceActivity"
android:name=".ui.NotesPreferenceActivity"
android:label="@string/preferences_title"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Holo.Light" >
</activity>
<!--- GTask 同步服务 -->
android:theme="@android:style/Theme.Holo.Light"></activity> <!-- - GTask 同步服务 -->
<service
android:name="net.micode.notes.gtask.remote.GTaskSyncService"
android:exported="false" >
</service>
<!--- 默认搜索 Activity -->
android:name=".gtask.remote.GTaskSyncService"
android:exported="false"></service> <!-- - 默认搜索 Activity -->
<meta-data
android:name="android.app.default_searchable"
android:value=".ui.NoteEditActivity" />
</application>
</manifest>

@ -46,21 +46,23 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);//设置界面显示——无标题
// 设置界面显示——无标题
requestWindowFeature(Window.FEATURE_NO_TITLE);
final Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);//设置窗体属性——在锁屏时显示
// 设置窗体属性——在锁屏时显示
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
if (!isScreenOn()) {
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON//保持点亮、点亮屏幕、允许点亮时解锁
// 设置窗体属性——保持点亮、点亮屏幕、允许点亮时解锁
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
| WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
}
Intent intent = getIntent();//获取传递的 Intent
// 获取传递的 Intent
Intent intent = getIntent();
try {
// 从 Intent 中获取数据并处理——获取标签 ID
@ -78,33 +80,24 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
mPlayer = new MediaPlayer();
if (DataUtils.visibleInNoteDatabase(getContentResolver(), mNoteId, Notes.TYPE_NOTE)) {
showActionDialog();// 显示对话框
playAlarmSound();// 播放闹钟提示音
// 显示对话框
showActionDialog();
// 播放闹钟提示音
playAlarmSound();
} else {
finish();// 结束当前 Activity
// 结束当前 Activity
finish();
}
}
/**
* @method isScreenOn
* @description
*
* @date: 12/23/2023 11:21 PM
* @author: YangYizhe
* @param
* @return
*/
private boolean isScreenOn() {
//判断屏幕是否锁屏,调用系统函数判断,最后返回值是布尔类型
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
return pm.isScreenOn();
}
/**
* @method playAlarmSound
* @description
*
* @date: 12/23/2023 11:21 PM
* @author: YangYizhe
*/
private void playAlarmSound() {
//闹钟提示音激发
Uri url = RingtoneManager.getActualDefaultRingtoneUri(this, RingtoneManager.TYPE_ALARM);
//调用系统的铃声管理URI得到闹钟提示音
int silentModeStreams = Settings.System.getInt(getContentResolver(),
@ -117,12 +110,19 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
}
try {
mPlayer.setDataSource(this, url);
//方法setDataSource(Context context, Uri uri)
//解释:无返回值,设置多媒体数据来源【根据 Uri】
mPlayer.prepare();
mPlayer.setLooping(true);//设置是否循环播放
mPlayer.start();//开始播放
//准备同步
mPlayer.setLooping(true);
//设置是否循环播放
mPlayer.start();
//开始播放
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//e.printStackTrace()函数功能是抛出异常, 还将显示出更深的调用信息
//System.out.println(e),这个方法打印出异常,并且输出在哪里出现的异常
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@ -134,67 +134,61 @@ public class AlarmAlertActivity extends Activity implements OnClickListener, OnD
e.printStackTrace();
}
}
/**
* @method showActionDialog
* @description
* AlertDialogProtected
private void showActionDialog() {
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
/* AlertDialogProtected
* newAlertDialogAlertDialog
* AlertDialogAlertDialog.Buildercreate()
* dialogAlertDialog
* @date: 12/23/2023 11:28 PM
* @author: YangYizhe
*/
private void showActionDialog() {
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle(R.string.app_name);//为对话框设置标题
dialog.setMessage(mSnippet);//为对话框设置内容
dialog.setPositiveButton(R.string.notealert_ok, this);//给对话框添加"Yes"按钮
dialog.setTitle(R.string.app_name);
//为对话框设置标题
dialog.setMessage(mSnippet);
//为对话框设置内容
dialog.setPositiveButton(R.string.notealert_ok, this);
//给对话框添加"Yes"按钮
if (isScreenOn()) {
dialog.setNegativeButton(R.string.notealert_enter, this);//对话框添加"No"按钮
}
dialog.setNegativeButton(R.string.notealert_enter, this);
}//对话框添加"No"按钮
dialog.show().setOnDismissListener(this);
}
/**
* @method onClick
* @description
* @date: 12/23/2023 11:27 PM
* @author: YangYizhe
* @param dialog
* @param which
*/
public void onClick(DialogInterface dialog, int which) {
switch (which) {//用which来选择click后下一步的操作
case DialogInterface.BUTTON_NEGATIVE://这是取消操作
Intent intent = new Intent(this, NoteEditActivity.class);//实现两个类间的数据传输
intent.setAction(Intent.ACTION_VIEW);//设置动作属性
intent.putExtra(Intent.EXTRA_UID, mNoteId);//实现key-value对 EXTRA_UID为keymNoteId为键
startActivity(intent);//开始动作
switch (which) {
//用which来选择click后下一步的操作
case DialogInterface.BUTTON_NEGATIVE:
//这是取消操作
Intent intent = new Intent(this, NoteEditActivity.class);
//实现两个类间的数据传输
intent.setAction(Intent.ACTION_VIEW);
//设置动作属性
intent.putExtra(Intent.EXTRA_UID, mNoteId);
//实现key-value对
//EXTRA_UID为keymNoteId为键
startActivity(intent);
//开始动作
break;
default:
//这是确定操作
break;
}
}
/**
* @method onDismiss
* @description
* @date: 12/23/2023 11:25 PM
* @author: YangYizhe
* @param dialog
*/
public void onDismiss(DialogInterface dialog) {
stopAlarmSound();//停止闹钟声音
//忽略
stopAlarmSound();
//停止闹钟声音
finish();
//完成该动作
}
/**
* @method stopAlarmSound
* @description
* @date: 12/23/2023 11:26 PM
* @author: YangYizhe
*/
private void stopAlarmSound() {
if (mPlayer != null) {
mPlayer.stop();//停止播放
mPlayer.release();//释放MediaPlayer对象
mPlayer.stop();
//停止播放
mPlayer.release();
//释放MediaPlayer对象
mPlayer = null;
}
}

@ -30,7 +30,6 @@ import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -55,6 +54,8 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import jp.wasabeef.richeditor.RichEditor;
/**
* @Package: net.micode.notes.ui
* @ClassName: NoteEditActivity
@ -75,6 +76,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
public TextView tvAlertDate;
public ImageView ibSetBgColor;
public TextView textNum;
}
private static final Map<Integer, Integer> sBgSelectorBtnsMap = new HashMap<Integer, Integer>();
static {
@ -115,7 +118,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private View mHeadViewPanel;
private View mNoteBgColorSelector;
private View mFontSizeSelector;
private EditText mNoteEditor;
//private EditText mNoteEditor;
private RichEditor mNoteEditor;//富文本编辑器
private TextView mPreview;
private String mText;//mText和mNoteLength是给富文本编辑器的
private int mNoteLength;
private int mFontSize;
private View mNoteEditorPanel;
public WorkingNote mWorkingNote;
private SharedPreferences mSharedPrefs;
@ -132,6 +140,324 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private String mUserQuery;
private Pattern mPattern;
/**
*
*
*/
public void initRichEditor(){
mNoteEditor.setEditorHeight(200);//设置编辑器界面高度
mNoteEditor.setEditorFontSize(22);//字体大小
mNoteEditor.setEditorFontColor(1);//字体颜色
mNoteEditor.setPadding(0, 0, 0, 0);//内边距
mNoteEditor.setPlaceholder("点击输入内容");//设置默认显示语句
mNoteEditor.setInputEnabled(true);//设置编辑器是否可用
mNoteEditor.setBackgroundResource(R.drawable.edit_yellow);//编辑背景
mNoteEditor.setOnTextChangeListener(new RichEditor.OnTextChangeListener() {
@Override
public void onTextChange(String text) {
mText = text;
mNoteLength = textChange(mText).length();
mNoteHeaderHolder.tvModified.setText(DateUtils.formatDateTime(NoteEditActivity.this,
mWorkingNote.getModifiedDate(), DateUtils.FORMAT_SHOW_DATE
| DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME
| DateUtils.FORMAT_SHOW_YEAR)+"\n字符数"+mNoteLength);
}
});
findViewById(R.id.action_undo).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.undo();
}
});
findViewById(R.id.action_redo).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.redo();
}
});
findViewById(R.id.action_bold).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setBold();
}
});
findViewById(R.id.action_italic).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setItalic();
}
});
findViewById(R.id.action_subscript).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setSubscript();
}
});
findViewById(R.id.action_superscript).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setSuperscript();
}
});
findViewById(R.id.action_strikethrough).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setStrikeThrough();
}
});
findViewById(R.id.action_underline).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setUnderline();
}
});
findViewById(R.id.action_heading1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setHeading(1);
}
});
findViewById(R.id.action_heading2).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setHeading(2);
}
});
findViewById(R.id.action_heading3).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setHeading(3);
}
});
findViewById(R.id.action_heading4).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setHeading(4);
}
});
findViewById(R.id.action_heading5).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setHeading(5);
}
});
findViewById(R.id.action_heading6).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setHeading(6);
}
});
/**findViewById(R.id.action_txt_color).setOnClickListener(new View.OnClickListener() {
private boolean isChanged;
@Override
public void onClick(View v) {
mNoteEditor.setTextColor(isChanged ? Color.BLACK : Color.RED);
isChanged = !isChanged;
}
});*/
/**findViewById(R.id.action_bg_color).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {//设置点击响应方法
mNoteEditor.focusEditor();
new AlertDialog.Builder(NoteEditActivity.this).setTitle("选择字体背景颜色")//设置一个AlertDialog供用户选择具体的颜色
.setSingleChoiceItems(R.array.text_bg_color, 0,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which) {
//红
case 0:
mNoteEditor.setTextBackgroundColor(Color.RED);
break;
//黄
case 1:
mNoteEditor.setTextBackgroundColor(Color.YELLOW);
break;
//蓝
case 2:
mNoteEditor.setTextBackgroundColor(Color.BLUE);
break;
//绿
case 3:
mNoteEditor.setTextBackgroundColor(Color.GREEN);
break;
//黑
case 4:
mNoteEditor.setTextBackgroundColor(Color.BLACK);
break;
case 5:
mNoteEditor.setTextBackgroundColor(Color.WHITE);
break;
}
}
}).show();
}
});*/
findViewById(R.id.action_indent).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setIndent();
}
});
findViewById(R.id.action_outdent).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setOutdent();
}
});
findViewById(R.id.action_align_left).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setAlignLeft();
}
});
findViewById(R.id.action_align_center).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setAlignCenter();
}
});
findViewById(R.id.action_align_right).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setAlignRight();
}
});
findViewById(R.id.action_blockquote).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setBlockquote();
}
});
findViewById(R.id.action_insert_bullets).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setBullets();
}
});
findViewById(R.id.action_insert_numbers).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.setNumbers();
}
});
/**findViewById(R.id.action_insert_link).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.insertLink("https://github.com/wasabeef", "wasabeef");
}
});*/
/**findViewById(R.id.action_insert_image).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.insertImage("https://raw.githubusercontent.com/wasabeef/art/master/chip.jpg",
"dachshund", 320);
}
});*/
findViewById(R.id.action_insert_checkbox).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mNoteEditor.insertTodo();
}
});
}
/**
* @method textChange
* @description
* @date: 1/3/2024 8:48 AM
* @author: YangYizhe
* @param oriText
* @return
*/
private String textChange(String oriText) {
StringBuilder stringBuilder = new StringBuilder(oriText);
// 移除所有<>
removeAngleBrackets(stringBuilder);
// 移除换行符和空格
for (int i = 0; i < stringBuilder.length(); i++) {
char c = stringBuilder.charAt(i);
if (c == '\n' || c == ' ') {
stringBuilder.deleteCharAt(i);
i--;
}
}
return stringBuilder.toString();
}
/**
* @method removeAngleBrackets
* @description <></>
* @date: 1/18/2024 7:22 PM
* @author: YangYizhe
* @param
* @return
*/
private void removeAngleBrackets(StringBuilder stringBuilder) {
int startIndex = stringBuilder.indexOf("<");
int endIndex = stringBuilder.indexOf(">");
if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) {
stringBuilder.delete(startIndex, endIndex + 1);
removeAngleBrackets(stringBuilder);
}
}
/**
* @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
*/
@ -144,6 +470,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
return;
}
initResources();
initRichEditor();
//count();
}
/**
@ -263,13 +591,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @author: YangYizhe
*/
private void initNoteScreen() {
mNoteEditor.setTextAppearance(this, TextAppearanceResources
.getTexAppearanceResource(mFontSizeId));
mNoteEditor.setEditorFontSize(30);
if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) {
switchToListMode(mWorkingNote.getContent());
} else {
mNoteEditor.setText(getHighlightQueryResult(mWorkingNote.getContent(), mUserQuery));
mNoteEditor.setSelection(mNoteEditor.getText().length());
mNoteEditor.setHtml(String.valueOf(getHighlightQueryResult(mWorkingNote.getContent(), mUserQuery)));
//mNoteEditor.setSelection(mText.length());
}
for (Integer id : sBgSelectorSelectionMap.keySet()) {
findViewById(sBgSelectorSelectionMap.get(id)).setVisibility(View.GONE);
@ -375,8 +702,20 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mNoteHeaderHolder.ivAlertIcon = (ImageView) findViewById(R.id.iv_alert_icon);
mNoteHeaderHolder.tvAlertDate = (TextView) findViewById(R.id.tv_alert_date);
mNoteHeaderHolder.ibSetBgColor = (ImageView) findViewById(R.id.btn_set_bg_color);
mNoteHeaderHolder.textNum = (TextView) findViewById(R.id.text_num);
mNoteHeaderHolder.ibSetBgColor.setOnClickListener(this);
mNoteEditor = (EditText) findViewById(R.id.note_edit_view);
mNoteEditor = findViewById(R.id.note_edit_view);
mNoteEditor.setOnTextChangeListener(new RichEditor.OnTextChangeListener() {
@Override
public void onTextChange(String text) {
mText = text;
mNoteLength = textChange(mText).length();
mNoteHeaderHolder.tvModified.setText(DateUtils.formatDateTime(NoteEditActivity.this,
mWorkingNote.getModifiedDate(), DateUtils.FORMAT_SHOW_DATE
| DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME
| DateUtils.FORMAT_SHOW_YEAR)+"\n字符数"+mNoteLength);
}
});
mNoteEditorPanel = findViewById(R.id.sv_note_edit);
mNoteBgColorSelector = findViewById(R.id.note_bg_color_selector);
for (int id : sBgSelectorBtnsMap.keySet()) {
@ -456,8 +795,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
getWorkingText();
switchToListMode(mWorkingNote.getContent());
} else {
mNoteEditor.setTextAppearance(this,
TextAppearanceResources.getTexAppearanceResource(mFontSizeId));
mNoteEditor.setEditorFontSize(mFontSizeId);
}
mFontSizeSelector.setVisibility(View.GONE);
}
@ -538,8 +876,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
int itemId = item.getItemId();
if (itemId == R.id.menu_new_note) {
createNewNote();
}
else if (itemId == R.id.menu_delete) {
} else if (itemId == R.id.menu_delete) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getString(R.string.alert_title_delete));
builder.setIcon(android.R.drawable.ic_dialog_alert);
@ -753,15 +1090,15 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mEditTextList.setVisibility(View.VISIBLE);
}
/**
* @param fullText
* @param userQuery
* @return Spannable
* @method getHighlightQueryResult
* @description
* @date: 12/24/2023 6:18 PM
* @author: YangYizhe
* @param fullText
* @param userQuery
* @return Spannable
*/
private Spannable getHighlightQueryResult(String fullText, String userQuery) {
private SpannableString getHighlightQueryResult(String fullText, String userQuery) {
SpannableString spannable = new SpannableString(fullText == null ? "" : fullText);
if (!TextUtils.isEmpty(userQuery)) {
mPattern = Pattern.compile(userQuery);
@ -845,13 +1182,13 @@ public class NoteEditActivity extends Activity implements OnClickListener,
*/
public void onCheckListModeChanged(int oldMode, int newMode) {
if (newMode == TextNote.MODE_CHECK_LIST) {
switchToListMode(mNoteEditor.getText().toString());
switchToListMode(mText.toString());
} else {
if (!getWorkingText()) {
mWorkingNote.setWorkingText(mWorkingNote.getContent().replace(TAG_UNCHECKED + " ",
""));
}
mNoteEditor.setText(getHighlightQueryResult(mWorkingNote.getContent(), mUserQuery));
mNoteEditor.setHtml(String.valueOf(getHighlightQueryResult(mWorkingNote.getContent(), mUserQuery)));
mEditTextList.setVisibility(View.GONE);
mNoteEditor.setVisibility(View.VISIBLE);
}
@ -892,7 +1229,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
}
mWorkingNote.setWorkingText(sb.toString());//利用编辑好的字符串设置运行便签的内容
} else {// 若不是该模式直接用编辑器中的内容设置运行中标签的内容
mWorkingNote.setWorkingText(mNoteEditor.getText().toString());
mWorkingNote.setWorkingText(mText.toString());
}
return hasChecked;
}

@ -34,6 +34,7 @@ import net.micode.notes.tool.DataUtils;
* @Version: 1.0
*/
public class NoteItemData {
// 用于定义查询操作中要返回的列
static final String [] PROJECTION = new String [] {
NoteColumns.ID,
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 enum ListEditState {
NOTE_LIST, SUB_FOLDER, CALL_RECORD_FOLDER
};
@ -100,6 +101,8 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
private Button mAddNewNote;
private boolean mDispatch;
// 控制背景颜色,初始为亮
private int mBackgroundColor = 1;
private int mOriginY;
@ -117,6 +120,9 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public static final int NOTES_LISTVIEW_SCROLL_RATE = 30;
/** 私密模式,初始为 0 开启为 1*/
public static int mSecretMode = 0;
private NoteItemData mFocusNoteDataItem;
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) {
super.onCreate(savedInstanceState); // 调用父类的onCreate函数
setContentView(R.layout.note_list);
getWindow().setBackgroundDrawableResource(R.drawable.bg_light);
initResources();
setAppInfoFromRawRes();
}
@ -463,10 +470,12 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
* @return
*/
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,
Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[] {String.valueOf(mCurrentFolderId)},
NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC");
Notes.CONTENT_NOTE_URI, NoteItemData.PROJECTION, selection, new String[]{
String.valueOf(mCurrentFolderId)
}, NoteColumns.TYPE + " DESC," + NoteColumns.MODIFIED_DATE + " DESC");
}
/**
* @Package: net.micode.notes.ui
@ -530,6 +539,98 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
});
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
* @description 便
@ -544,6 +645,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
intent.putExtra(Notes.INTENT_EXTRA_FOLDER_ID, mCurrentFolderId);
this.startActivityForResult(intent, REQUEST_CODE_NEW_NODE);
}
/**
* @method batchDelete
* @description:
@ -558,15 +660,15 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
new AsyncTask<Void, Void, HashSet<AppWidgetAttribute>>() {
protected HashSet<AppWidgetAttribute> doInBackground(Void... unused) {
HashSet<AppWidgetAttribute> widgets = mNotesListAdapter.getSelectedWidget();
//如果没有同步,直接删除
if (!isSyncMode()) {
// 如果是回收站中的,直接删除
if (mCurrentFolderId == Notes.ID_TRASH_FOLER) {
if (DataUtils.batchDeleteNotes(mContentResolver, mNotesListAdapter
.getSelectedItemIds())) {
} else {
Log.e(TAG, "Delete notes error, should not happens");
}
}
//已同步,将删除的便签移到垃圾桶
// 将删除的便签移到回收站
else {
if (!DataUtils.batchMoveToFolder(mContentResolver, mNotesListAdapter
.getSelectedItemIds(), Notes.ID_TRASH_FOLER)) {
@ -891,6 +993,14 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
@Override
/**
* @method onPrepareOptionsMenu
* @description menuAndroid
* @date: 1/2/2024 7:40 PM
* @author: YangYizhe
* @param [menu]
* @return boolean
*/
public boolean onPrepareOptionsMenu(Menu menu) {
menu.clear();
if (mState == ListEditState.NOTE_LIST) {
@ -905,10 +1015,29 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
} else {
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;
}
@Override
/**
* @method onOptionsItemSelected
* @description
* @date: 1/2/2024 7:41 PM
* @author: YangYizhe
* @param [item]
* @return boolean
*/
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
if (itemId == R.id.menu_new_folder) {
@ -931,6 +1060,16 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
createNewNote();
} else if (itemId == R.id.menu_search) {
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;
}

@ -26,7 +26,7 @@ public class NotesListItem extends LinearLayout {
private ImageView mAlert;//闹钟图片
private TextView mTitle; //标题
private TextView mTime; //时间
private TextView mCallName; //
private TextView mCallName;
private NoteItemData mItemData; //标签数据
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
};
public static final int COLUMN_ID = 0;
public static final int COLUMN_BG_COLOR_ID = 1;
public static final int COLUMN_SNIPPET = 2;

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

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: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 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:layout_width="fill_parent"
android:layout_height="wrap_content">
<!-- 字符统计 -->
<TextView
android:id="@+id/tv_modified_date"
@ -56,6 +57,13 @@
android:layout_marginRight="8dip"
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
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -77,34 +85,34 @@
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_gravity="left|top"
android:layout_weight="1"
android:scrollbars="none"
android:fadingEdgeLength="0dip"
android:overScrollMode="never"
android:layout_gravity="left|top"
android:fadingEdgeLength="0dip">
android:scrollbars="none">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<net.micode.notes.ui.NoteEditText
<jp.wasabeef.richeditor.RichEditor
android:id="@+id/note_edit_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left|top"
android:background="@null"
android:autoLink="all"
android:background="@null"
android:gravity="left|top"
android:lineSpacingMultiplier="1.2"
android:linksClickable="false"
android:minLines="12"
android:textAppearance="@style/TextAppearancePrimaryItem"
android:lineSpacingMultiplier="1.2" />
android:textAppearance="@style/TextAppearancePrimaryItem" />
<LinearLayout
android:id="@+id/note_edit_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="-10dip"
android:orientation="vertical"
android:visibility="gone" />
</LinearLayout>
</ScrollView>
@ -387,14 +395,249 @@
<ImageView
android:id="@+id/iv_super_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom|right"
android:focusable="false"
android:visibility="gone"
android:layout_marginRight="6dip"
android:layout_marginBottom="-7dip"
android:src="@drawable/selected" />
android:focusable="false"
android:src="@drawable/selected"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="@+id/action_undo"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/undo" />
<ImageButton
android:id="@+id/action_redo"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/redo" />
<ImageButton
android:id="@+id/action_bold"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/bold" />
<ImageButton
android:id="@+id/action_italic"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/italic" />
<ImageButton
android:id="@+id/action_subscript"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/subscript" />
<ImageButton
android:id="@+id/action_superscript"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/superscript" />
<ImageButton
android:id="@+id/action_strikethrough"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/strikethrough" />
<ImageButton
android:id="@+id/action_underline"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/underline" />
<ImageButton
android:id="@+id/action_heading1"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/h1" />
<ImageButton
android:id="@+id/action_heading2"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/h2" />
<ImageButton
android:id="@+id/action_heading3"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/h3" />
<ImageButton
android:id="@+id/action_heading4"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/h4" />
<ImageButton
android:id="@+id/action_heading5"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/h5" />
<ImageButton
android:id="@+id/action_heading6"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/h6" />
<ImageButton
android:id="@+id/action_indent"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/indent" />
<ImageButton
android:id="@+id/action_outdent"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/outdent" />
<ImageButton
android:id="@+id/action_align_left"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/justify_left" />
<ImageButton
android:id="@+id/action_align_center"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/justify_center" />
<ImageButton
android:id="@+id/action_align_right"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/justify_right" />
<ImageButton
android:id="@+id/action_insert_bullets"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/bullets" />
<ImageButton
android:id="@+id/action_insert_numbers"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/numbers" />
<ImageButton
android:id="@+id/action_blockquote"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/blockquote" />
<!--ImageButton
android:id="@+id/action_insert_image"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/insert_image" /-->
<!--ImageButton
android:id="@+id/action_insert_audio"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/music" />
<ImageButton
android:id="@+id/action_insert_video"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/video" />
<ImageButton
android:id="@+id/action_insert_youtube"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/youtube" />
<ImageButton
android:id="@+id/action_insert_link"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/insert_link" /-->
<ImageButton
android:id="@+id/action_insert_checkbox"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@android:drawable/checkbox_on_background" />
</LinearLayout>
</HorizontalScrollView>
</FrameLayout>

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

@ -36,4 +36,24 @@
<item
android:id="@+id/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>

@ -21,4 +21,20 @@
<item
android:id="@+id/menu_new_note"
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>

@ -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="datetime_dialog_ok">设置</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">
<item quantity="other"><xliff:g id="NUMBER">%1$s</xliff:g> 条符合“<xliff:g id="SEARCH">%2$s</xliff:g>”的搜索结果</item>
</plurals>

@ -120,6 +120,14 @@
<string name="search">便籤</string>
<string name="datetime_dialog_ok">設置</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">
<item quantity="other"><xliff:g id="NUMBER">%1$s</xliff:g> 條符合”<xliff:g id="SEARCH">%2$s</xliff:g>“的搜尋結果</item>
</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>
<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>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="menu_voice" type="id" />
</resources>

@ -15,8 +15,7 @@
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">Notes</string>
<string name="app_widget2x2">Notes 2x2</string>
<string name="app_widget4x4">Notes 4x4</string>
@ -126,10 +125,24 @@
<string name="search">Notes</string>
<string name="datetime_dialog_ok">set</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">
<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. -->
<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>
</resources>

@ -16,18 +16,22 @@
-->
<resources>
<style name="TextAppearanceSuper">
<item name="android:textSize">@dimen/text_font_size_super</item>
<item name="android:textColorLink">#0000ff</item>
</style>
<style name="TextAppearanceLarge">
<item name="android:textSize">@dimen/text_font_size_large</item>
<item name="android:textColorLink">#0000ff</item>
</style>
<style name="TextAppearanceMedium">
<item name="android:textSize">@dimen/text_font_size_medium</item>
<item name="android:textColorLink">#0000ff</item>
</style>
<style name="TextAppearanceNormal">
<item name="android:textSize">@dimen/text_font_size_normal</item>
<item name="android:textColorLink">#0000ff</item>
@ -66,4 +70,13 @@
<item name="android:displayOptions" />
<item name="android:visibility">visible</item>
</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>

@ -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