add new function : show length of the notes
This commit is contained in:
parent
bad253c27f
commit
c415aae208
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
#Thu Oct 17 22:05:25 CST 2019
|
||||
#Fri Oct 18 00:06:03 CST 2019
|
||||
base.0=C\:\\Project\\minote\\src\\app\\build\\intermediates\\dex\\debug\\mergeDexDebug\\out\\classes.dex
|
||||
path.0=classes.dex
|
||||
renamed.0=classes.dex
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -30,9 +30,11 @@ import android.content.SharedPreferences;
|
|||
import android.graphics.Paint;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.Editable;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.format.DateUtils;
|
||||
import android.text.style.BackgroundColorSpan;
|
||||
import android.util.Log;
|
||||
|
@ -161,6 +163,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|||
//保存便签字符数量
|
||||
private int mNoteLength;
|
||||
|
||||
private String mFormateDataTime;
|
||||
|
||||
//记录默认字体大小
|
||||
private static final String PREFERENCE_FONT_SIZE = "pref_font_size";
|
||||
|
||||
|
@ -297,7 +301,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
@ -326,10 +329,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|||
//获取已保存便签的字符数
|
||||
mNoteLength = mNoteEditor.getText().toString().length();
|
||||
|
||||
mNoteHeaderHolder.tvModified.setText(DateUtils.formatDateTime(this,
|
||||
mFormateDataTime = DateUtils.formatDateTime(this,
|
||||
mWorkingNote.getModifiedDate(), DateUtils.FORMAT_SHOW_DATE
|
||||
| DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME
|
||||
| DateUtils.FORMAT_SHOW_YEAR)
|
||||
| DateUtils.FORMAT_SHOW_YEAR);
|
||||
|
||||
mNoteHeaderHolder.tvModified.setText(mFormateDataTime
|
||||
+ space_after_title_time +getResources().getString(R.string.note_length) + " : "
|
||||
+ mNoteLength);
|
||||
|
||||
|
@ -416,7 +421,34 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|||
mNoteHeaderHolder.tvAlertDate = (TextView) findViewById(R.id.tv_alert_date);
|
||||
mNoteHeaderHolder.ibSetBgColor = (ImageView) findViewById(R.id.btn_set_bg_color);
|
||||
mNoteHeaderHolder.ibSetBgColor.setOnClickListener(this);
|
||||
mFormateDataTime = DateUtils.formatDateTime(this,
|
||||
mWorkingNote.getModifiedDate(), DateUtils.FORMAT_SHOW_DATE
|
||||
| DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME
|
||||
| DateUtils.FORMAT_SHOW_YEAR);
|
||||
mNoteEditor = (EditText) findViewById(R.id.note_edit_view);
|
||||
mNoteEditor.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if(count == 0){
|
||||
mNoteLength -= before;
|
||||
}else{
|
||||
mNoteLength += count;
|
||||
}
|
||||
mNoteHeaderHolder.tvModified.setText(mFormateDataTime
|
||||
+ space_after_title_time +getResources().getString(R.string.note_length) + " : "
|
||||
+ mNoteLength);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
mNoteLength = mNoteEditor.getText().toString().length();
|
||||
mNoteEditorPanel = findViewById(R.id.sv_note_edit);
|
||||
mNoteBgColorSelector = findViewById(R.id.note_bg_color_selector);
|
||||
|
|
Loading…
Reference in New Issue