|
|
|
@ -89,6 +89,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
public TextView tvAlertDate;
|
|
|
|
|
|
|
|
|
|
public ImageView ibSetBgColor;
|
|
|
|
|
|
|
|
|
|
public ImageView ibSetTextSize;
|
|
|
|
|
}
|
|
|
|
|
// 背景选择器map
|
|
|
|
|
private static final Map<Integer, Integer> sBgSelectorBtnsMap = new HashMap<Integer, Integer>();
|
|
|
|
@ -246,6 +248,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
Notes.TYPE_WIDGET_INVALIDE);
|
|
|
|
|
int bgResId = intent.getIntExtra(Notes.INTENT_EXTRA_BACKGROUND_ID,
|
|
|
|
|
ResourceParser.getDefaultBgId(this));
|
|
|
|
|
int fontResId = intent.getIntExtra(Notes.INTENT_EXTRA_FONT_SIZE_ID,
|
|
|
|
|
ResourceParser.getDefaultBgId(this));
|
|
|
|
|
|
|
|
|
|
// Parse call-record note
|
|
|
|
|
String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
|
|
|
|
@ -265,12 +269,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
mWorkingNote = WorkingNote.createEmptyNote(this, folderId, widgetId,
|
|
|
|
|
widgetType, bgResId);
|
|
|
|
|
widgetType, bgResId,fontResId);
|
|
|
|
|
mWorkingNote.convertToCallNote(phoneNumber, callDate);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
mWorkingNote = WorkingNote.createEmptyNote(this, folderId, widgetId, widgetType,
|
|
|
|
|
bgResId);
|
|
|
|
|
bgResId,fontResId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getWindow().setSoftInputMode(
|
|
|
|
@ -397,7 +401,9 @@ 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.ibSetTextSize = (ImageView) findViewById(R.id.btn_set_text_size);
|
|
|
|
|
mNoteHeaderHolder.ibSetBgColor.setOnClickListener(this);
|
|
|
|
|
mNoteHeaderHolder.ibSetTextSize.setOnClickListener(this);
|
|
|
|
|
mNoteEditor = (EditText) findViewById(R.id.note_edit_view);
|
|
|
|
|
mNoteEditorPanel = findViewById(R.id.sv_note_edit);
|
|
|
|
|
mNoteBgColorSelector = findViewById(R.id.note_bg_color_selector);
|
|
|
|
@ -461,12 +467,17 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
if (id == R.id.btn_set_bg_color) {
|
|
|
|
|
mNoteBgColorSelector.setVisibility(View.VISIBLE);
|
|
|
|
|
findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility(
|
|
|
|
|
-View.VISIBLE);
|
|
|
|
|
View.INVISIBLE);
|
|
|
|
|
} else if (sBgSelectorBtnsMap.containsKey(id)) {
|
|
|
|
|
findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility(
|
|
|
|
|
View.GONE);
|
|
|
|
|
mWorkingNote.setBgColorId(sBgSelectorBtnsMap.get(id));
|
|
|
|
|
mNoteBgColorSelector.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
if(id == R.id.btn_set_text_size) {
|
|
|
|
|
mFontSizeSelector.setVisibility(View.VISIBLE);
|
|
|
|
|
findViewById(sFontSelectorSelectionMap.get(mWorkingNote.getFontSizeId())).setVisibility(
|
|
|
|
|
View.INVISIBLE);
|
|
|
|
|
} else if (sFontSizeBtnsMap.containsKey(id)) {
|
|
|
|
|
findViewById(sFontSelectorSelectionMap.get(mFontSizeId)).setVisibility(View.GONE);
|
|
|
|
|
mFontSizeId = sFontSizeBtnsMap.get(id);
|
|
|
|
@ -479,6 +490,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
mNoteEditor.setTextAppearance(this,
|
|
|
|
|
TextAppearanceResources.getTexAppearanceResource(mFontSizeId));
|
|
|
|
|
}
|
|
|
|
|
mWorkingNote.setFontSizeId(sFontSizeBtnsMap.get(id));
|
|
|
|
|
mFontSizeSelector.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -510,6 +522,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
mNoteEditorPanel.setBackgroundResource(mWorkingNote.getBgColorResId());
|
|
|
|
|
mHeadViewPanel.setBackgroundResource(mWorkingNote.getTitleBgResId());
|
|
|
|
|
}
|
|
|
|
|
// 字体尺寸改变时触发
|
|
|
|
|
@Override
|
|
|
|
|
public void onFontSizeChanged() {
|
|
|
|
|
//TODO 没写好呢,可以考虑加个Toast
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 在准备渲染设置菜单时触发
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
|
|
|
|