|
|
|
@ -74,7 +74,7 @@ import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
NoteSettingChangedListener, OnTextViewChangeListener {
|
|
|
|
|
private class HeadViewHolder {
|
|
|
|
|
private class HeadViewHolder { // 头部视图的持有者
|
|
|
|
|
public TextView tvModified;
|
|
|
|
|
|
|
|
|
|
public ImageView ivAlertIcon;
|
|
|
|
@ -85,7 +85,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final Map<Integer, Integer> sBgSelectorBtnsMap = new HashMap<Integer, Integer>();
|
|
|
|
|
static {
|
|
|
|
|
static { // 背景选择器按钮的映射
|
|
|
|
|
sBgSelectorBtnsMap.put(R.id.iv_bg_yellow, ResourceParser.YELLOW);
|
|
|
|
|
sBgSelectorBtnsMap.put(R.id.iv_bg_red, ResourceParser.RED);
|
|
|
|
|
sBgSelectorBtnsMap.put(R.id.iv_bg_blue, ResourceParser.BLUE);
|
|
|
|
@ -94,7 +94,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final Map<Integer, Integer> sBgSelectorSelectionMap = new HashMap<Integer, Integer>();
|
|
|
|
|
static {
|
|
|
|
|
static { // 背景选择器选择的映射
|
|
|
|
|
sBgSelectorSelectionMap.put(ResourceParser.YELLOW, R.id.iv_bg_yellow_select);
|
|
|
|
|
sBgSelectorSelectionMap.put(ResourceParser.RED, R.id.iv_bg_red_select);
|
|
|
|
|
sBgSelectorSelectionMap.put(ResourceParser.BLUE, R.id.iv_bg_blue_select);
|
|
|
|
@ -103,7 +103,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final Map<Integer, Integer> sFontSizeBtnsMap = new HashMap<Integer, Integer>();
|
|
|
|
|
static {
|
|
|
|
|
static { // 字体大小按钮的映射
|
|
|
|
|
sFontSizeBtnsMap.put(R.id.ll_font_large, ResourceParser.TEXT_LARGE);
|
|
|
|
|
sFontSizeBtnsMap.put(R.id.ll_font_small, ResourceParser.TEXT_SMALL);
|
|
|
|
|
sFontSizeBtnsMap.put(R.id.ll_font_normal, ResourceParser.TEXT_MEDIUM);
|
|
|
|
@ -111,54 +111,54 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final Map<Integer, Integer> sFontSelectorSelectionMap = new HashMap<Integer, Integer>();
|
|
|
|
|
static {
|
|
|
|
|
static {// 字体选择器选择的映射
|
|
|
|
|
sFontSelectorSelectionMap.put(ResourceParser.TEXT_LARGE, R.id.iv_large_select);
|
|
|
|
|
sFontSelectorSelectionMap.put(ResourceParser.TEXT_SMALL, R.id.iv_small_select);
|
|
|
|
|
sFontSelectorSelectionMap.put(ResourceParser.TEXT_MEDIUM, R.id.iv_medium_select);
|
|
|
|
|
sFontSelectorSelectionMap.put(ResourceParser.TEXT_SUPER, R.id.iv_super_select);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final String TAG = "NoteEditActivity";
|
|
|
|
|
private static final String TAG = "NoteEditActivity";// 标签
|
|
|
|
|
|
|
|
|
|
private HeadViewHolder mNoteHeaderHolder;
|
|
|
|
|
private HeadViewHolder mNoteHeaderHolder;// 头部视图的持有者
|
|
|
|
|
|
|
|
|
|
private View mHeadViewPanel;
|
|
|
|
|
private View mHeadViewPanel;// 头部视图面板
|
|
|
|
|
|
|
|
|
|
private View mNoteBgColorSelector;
|
|
|
|
|
private View mNoteBgColorSelector;// 笔记背景颜色选择器
|
|
|
|
|
|
|
|
|
|
private View mFontSizeSelector;
|
|
|
|
|
private View mFontSizeSelector;// 字体大小选择器
|
|
|
|
|
|
|
|
|
|
private EditText mNoteEditor;
|
|
|
|
|
private EditText mNoteEditor;// 笔记编辑器
|
|
|
|
|
|
|
|
|
|
private View mNoteEditorPanel;
|
|
|
|
|
private View mNoteEditorPanel;// 笔记编辑器面板
|
|
|
|
|
|
|
|
|
|
private WorkingNote mWorkingNote;
|
|
|
|
|
private WorkingNote mWorkingNote;// 工作笔记
|
|
|
|
|
|
|
|
|
|
private SharedPreferences mSharedPrefs;
|
|
|
|
|
private int mFontSizeId;
|
|
|
|
|
private SharedPreferences mSharedPrefs;// 共享首选项
|
|
|
|
|
private int mFontSizeId;// 字体大小ID
|
|
|
|
|
|
|
|
|
|
private static final String PREFERENCE_FONT_SIZE = "pref_font_size";
|
|
|
|
|
private static final String PREFERENCE_FONT_SIZE = "pref_font_size";// 字体大小首选项
|
|
|
|
|
|
|
|
|
|
private static final int SHORTCUT_ICON_TITLE_MAX_LEN = 10;
|
|
|
|
|
private static final int SHORTCUT_ICON_TITLE_MAX_LEN = 10;// 快捷方式图标标题的最大长度
|
|
|
|
|
|
|
|
|
|
public static final String TAG_CHECKED = String.valueOf('\u221A');
|
|
|
|
|
public static final String TAG_UNCHECKED = String.valueOf('\u25A1');
|
|
|
|
|
public static final String TAG_CHECKED = String.valueOf('\u221A');// 标签已选中
|
|
|
|
|
public static final String TAG_UNCHECKED = String.valueOf('\u25A1');// 标签未选中
|
|
|
|
|
|
|
|
|
|
private LinearLayout mEditTextList;
|
|
|
|
|
private LinearLayout mEditTextList;// 编辑文本列表
|
|
|
|
|
|
|
|
|
|
private String mUserQuery;
|
|
|
|
|
private Pattern mPattern;
|
|
|
|
|
private String mUserQuery;// 用户查询
|
|
|
|
|
private Pattern mPattern;// 模式
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
this.setContentView(R.layout.note_edit);
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {// 创建
|
|
|
|
|
super.onCreate(savedInstanceState);// 调用超类的方法
|
|
|
|
|
this.setContentView(R.layout.note_edit);// 设置布局
|
|
|
|
|
|
|
|
|
|
if (savedInstanceState == null && !initActivityState(getIntent())) {
|
|
|
|
|
if (savedInstanceState == null && !initActivityState(getIntent())) {// 如果保存的实例状态为空且初始化活动状态失败
|
|
|
|
|
finish();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
initResources();
|
|
|
|
|
initResources();// 初始化资源
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|