master
eazzy 11 months ago
parent 798416e7c4
commit 6b0b1950aa

@ -25,6 +25,7 @@ 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:
@ -36,6 +37,29 @@ 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 "

@ -67,6 +67,12 @@ 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;
@ -288,6 +294,7 @@ 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
@ -299,6 +306,9 @@ 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();
@ -410,12 +420,15 @@ 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) {
@ -664,6 +677,7 @@ 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
*/ */
@ -678,6 +692,11 @@ 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) {
@ -703,6 +722,7 @@ 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
@ -711,6 +731,8 @@ 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
@ -729,6 +751,7 @@ 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
@ -736,6 +759,8 @@ 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");
@ -752,6 +777,7 @@ 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
@ -761,6 +787,8 @@ 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)) {
@ -777,6 +805,7 @@ 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
@ -786,6 +815,8 @@ 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);
@ -816,6 +847,7 @@ 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
@ -824,6 +856,8 @@ 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");
@ -835,6 +869,7 @@ 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
@ -843,6 +878,9 @@ 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());
@ -856,6 +894,7 @@ 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
@ -863,6 +902,8 @@ 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) {
@ -902,6 +943,11 @@ 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();
@ -926,6 +972,11 @@ 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() {
/** /**
@ -961,6 +1012,7 @@ 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
@ -969,6 +1021,8 @@ 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,12 +46,28 @@ 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);
@ -96,9 +112,13 @@ 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;
} }
@ -124,6 +144,17 @@ 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
@ -235,6 +266,17 @@ 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

Loading…
Cancel
Save