变更分支结构

master
eazzy 11 months ago committed by SheYu
parent 87b03f490e
commit 6e4eccc89a

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

@ -71,18 +71,9 @@ 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
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
========
/** /**
* *
*/ */
>>>>>>>> b654a61 (code):src/Notes/app/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;
@ -397,7 +388,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
showAlertHeader(); showAlertHeader();
convertToImage();//将路径转化未图片 convertToImage();//将路径转化未图片
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method showAlertHeader * @method showAlertHeader
* @description * @description
@ -409,12 +399,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
*/ */
========
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
========
>>>>>>>> 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();
@ -527,18 +511,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
} }
clearSettingState(); clearSettingState();
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
<<<<<<<< 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
========
>>>>>>>> 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) {
@ -661,12 +639,8 @@ 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();
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
} else if (itemId == R.id.menu_delete) {
========
} }
else if (itemId == R.id.menu_delete) { else if (itemId == R.id.menu_delete) {
>>>>>>>> b654a61 (code):src/Notes/app/src/main/java/net/micode/notes/ui/NoteEditActivity.java
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);
@ -791,9 +765,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
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* updateWidget * updateWidget
*/ */
@ -808,16 +779,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 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) {
@ -843,8 +804,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
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method onEditTextEnter * @method onEditTextEnter
* @description * @description
@ -853,10 +812,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
========
>>>>>>>> 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
@ -875,8 +830,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
.setIndex(i); .setIndex(i);
} }
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method switchToListMode * @method switchToListMode
* @description * @description
@ -884,10 +837,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
========
>>>>>>>> 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");
@ -904,8 +853,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
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method getHighlightQueryResult * @method getHighlightQueryResult
* @description * @description
@ -915,10 +862,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
========
>>>>>>>> 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)) {
@ -935,8 +878,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
} }
return spannable; return spannable;
} }
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method getListItem * @method getListItem
* @description * @description
@ -946,10 +887,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
========
>>>>>>>> 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);
@ -980,8 +917,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
<<<<<<<< HEAD:src/main/java/net/micode/notes/ui/NoteEditActivity.java
/** /**
* @method onTextChange * @method onTextChange
* @description * @description
@ -990,10 +925,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
========
>>>>>>>> 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");
@ -1005,7 +936,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);
} }
} }
/** /**
* @method onCheckListModeChanged * @method onCheckListModeChanged
* @description * @description
@ -1039,7 +969,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* @return * @return
*/ */
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) {
/** /**
* CHECK_LIST * CHECK_LIST
@ -1047,8 +978,10 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* *
*/ */
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
//创建可变字符串
for (int i = 0; i < mEditTextList.getChildCount(); i++) { for (int i = 0; i < mEditTextList.getChildCount(); i++) {
View view = mEditTextList.getChildAt(i); View view = mEditTextList.getChildAt(i);
//遍历所有子编辑框的视图
NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text); NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text);
if (!TextUtils.isEmpty(edit.getText())) { if (!TextUtils.isEmpty(edit.getText())) {
/** /**
@ -1057,8 +990,10 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* true * true
*/ */
if (((CheckBox) view.findViewById(R.id.cb_edit_item)).isChecked()) { if (((CheckBox) view.findViewById(R.id.cb_edit_item)).isChecked()) {
//该选项框已打钩
sb.append(TAG_CHECKED).append(" ").append(edit.getText()).append("\n"); sb.append(TAG_CHECKED).append(" ").append(edit.getText()).append("\n");
hasChecked = true; hasChecked = true;
//扩展字符串为已打钩并把标记置true
} else { } else {
//扩展字符串添加未打钩 //扩展字符串添加未打钩
sb.append(TAG_UNCHECKED).append(" ").append(edit.getText()).append("\n"); sb.append(TAG_UNCHECKED).append(" ").append(edit.getText()).append("\n");
@ -1082,8 +1017,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
* @param
* @return
*/ */
private boolean saveNote() { private boolean saveNote() {
getWorkingText(); getWorkingText();
@ -1108,8 +1041,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
* @param
* @return
*/ */
private void sendToDesktop() { private void sendToDesktop() {
/** /**

@ -46,19 +46,12 @@ import java.util.Map;
* @Version: 1.0 * @Version: 1.0
*/ */
public class NoteEditText extends EditText { public class NoteEditText extends EditText {
//常量标识
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 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);
@ -103,7 +96,9 @@ public class NoteEditText extends EditText {
mIndex = 0; mIndex = 0;
} }
//设置索引号 /**
*
*/
public void setIndex(int index) { public void setIndex(int index) {
mIndex = index; mIndex = index;
} }
@ -129,15 +124,15 @@ public class NoteEditText extends EditText {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
@Override
/** /**
* @method onTouchEvent * @method onTouchEvent
* @description * @description
* @date: 12/21/2023 12:41 AM * @date: 12/24/2023 6:07 PM
* @author: YangYizhe * @author: YangYizhe
* @param * @param [event]
* @return * @return boolean
*/ */
@Override
public boolean onTouchEvent(MotionEvent event) { public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) { switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_DOWN:
@ -240,15 +235,15 @@ public class NoteEditText extends EditText {
super.onFocusChanged(focused, direction, previouslyFocusedRect); super.onFocusChanged(focused, direction, previouslyFocusedRect);
} }
@Override
/** /**
* @method onCreateContextMenu * @method onCreateContextMenu
* @description * @description
* @date: 12/21/2023 12:39 AM * @date: 12/24/2023 6:08 PM
* @author: YangYizhe * @author: YangYizhe
* @param * @param [menu]
* @return * @return void
*/ */
@Override
protected void onCreateContextMenu(ContextMenu menu) { protected void onCreateContextMenu(ContextMenu menu) {
if (getText() instanceof Spanned) { if (getText() instanceof Spanned) {
int selStart = getSelectionStart(); int selStart = getSelectionStart();

@ -25,7 +25,14 @@ import net.micode.notes.data.Notes;
import net.micode.notes.data.Notes.NoteColumns; import net.micode.notes.data.Notes.NoteColumns;
import net.micode.notes.tool.DataUtils; import net.micode.notes.tool.DataUtils;
/**
* @Package: net.micode.notes.ui
* @ClassName: NoteItemData
* @Description:
* @Author: YangYizhe
* @CreateDate: 12/24/2023 6:00 PM
* @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,
@ -75,7 +82,16 @@ public class NoteItemData {
private boolean mIsOnlyOneItem; private boolean mIsOnlyOneItem;
private boolean mIsOneNoteFollowingFolder; private boolean mIsOneNoteFollowingFolder;
private boolean mIsMultiNotesFollowingFolder; private boolean mIsMultiNotesFollowingFolder;
/**
* @method NoteItemData
* @description
*
*
* @date: 12/24/2023 6:00 PM
* @author: YangYizhe
* @param context
* @param cursor
*/
public NoteItemData(Context context, Cursor cursor) { public NoteItemData(Context context, Cursor cursor) {
mId = cursor.getLong(ID_COLUMN); mId = cursor.getLong(ID_COLUMN);
mAlertDate = cursor.getLong(ALERTED_DATE_COLUMN); mAlertDate = cursor.getLong(ALERTED_DATE_COLUMN);
@ -108,7 +124,13 @@ public class NoteItemData {
} }
checkPostion(cursor); checkPostion(cursor);
} }
/**
* @method checkPostion
* @description
* @date: 12/24/2023 6:00 PM
* @author: YangYizhe
* @param cursor
*/
private void checkPostion(Cursor cursor) { private void checkPostion(Cursor cursor) {
mIsLastItem = cursor.isLast() ? true : false; mIsLastItem = cursor.isLast() ? true : false;
mIsFirstItem = cursor.isFirst() ? true : false; mIsFirstItem = cursor.isFirst() ? true : false;
@ -133,59 +155,87 @@ public class NoteItemData {
} }
} }
} }
/**
*
*/
public boolean isOneFollowingFolder() { public boolean isOneFollowingFolder() {
return mIsOneNoteFollowingFolder; return mIsOneNoteFollowingFolder;
} }
/**
*
*/
public boolean isMultiFollowingFolder() { public boolean isMultiFollowingFolder() {
return mIsMultiNotesFollowingFolder; return mIsMultiNotesFollowingFolder;
} }
/**
*
*/
public boolean isLast() { public boolean isLast() {
return mIsLastItem; return mIsLastItem;
} }
/**
*
*/
public String getCallName() { public String getCallName() {
return mName; return mName;
} }
/**
*
*/
public boolean isFirst() { public boolean isFirst() {
return mIsFirstItem; return mIsFirstItem;
} }
/**
*
*/
public boolean isSingle() { public boolean isSingle() {
return mIsOnlyOneItem; return mIsOnlyOneItem;
} }
/**
* ID
*/
public long getId() { public long getId() {
return mId; return mId;
} }
/**
*
*/
public long getAlertDate() { public long getAlertDate() {
return mAlertDate; return mAlertDate;
} }
/**
*
*/
public long getCreatedDate() { public long getCreatedDate() {
return mCreatedDate; return mCreatedDate;
} }
/**
*
*/
public boolean hasAttachment() { public boolean hasAttachment() {
return mHasAttachment; return mHasAttachment;
} }
/**
*
*/
public long getModifiedDate() { public long getModifiedDate() {
return mModifiedDate; return mModifiedDate;
} }
/**
* ID
*/
public int getBgColorId() { public int getBgColorId() {
return mBgColorId; return mBgColorId;
} }
/**
* ID
*/
public long getParentId() { public long getParentId() {
return mParentId; return mParentId;
} }
/**
*
*/
public int getNotesCount() { public int getNotesCount() {
return mNotesCount; return mNotesCount;
} }

Loading…
Cancel
Save