Compare commits

..

No commits in common. 'main' and 'llr_branch' have entirely different histories.

@ -190,34 +190,10 @@ public class NoteEditActivity extends Activity implements OnClickListener,
}
public void ReadNow(){
String noteContent = getCurrentNoteContent();
if (noteContent.isEmpty()){
MediaPlayer player=MediaPlayer.create(this,R.raw.pleaseinput);
player.start();
Toast.makeText(NoteEditActivity.this, "请输入内容", Toast.LENGTH_SHORT).show();
return;
}
Toast.makeText(NoteEditActivity.this, "开始阅读", Toast.LENGTH_SHORT).show();
// 开始朗读(使用本地语音)
tts.speak(noteContent, TextToSpeech.QUEUE_ADD, null, "test");
;
}
private String getCurrentNoteContent() {//获取文本
if (mWorkingNote.getCheckListMode() == TextNote.MODE_CHECK_LIST) {
StringBuilder content = new StringBuilder();
for (int i = 0; i < mEditTextList.getChildCount(); i++) {
View itemView = mEditTextList.getChildAt(i);
CheckBox checkBox = itemView.findViewById(R.id.cb_edit_item);
NoteEditText editText = itemView.findViewById(R.id.et_edit_text);
String prefix = checkBox.isChecked() ? "已完成: " : "未完成: ";
content.append(prefix).append(editText.getText()).append("\n");
}
return content.toString();
} else {
return mNoteEditor.getText().toString();
}
}//
/**
* Current activity may be killed when the memory is low. Once it is killed, for another time

@ -331,7 +331,6 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public void onClick(DialogInterface dialog,
int which) {
batchDelete();
//Notesback();
}
});
builder.setNegativeButton(android.R.string.cancel, null);
@ -506,32 +505,6 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}
}.execute();
}
private void Notesback(){
new AsyncTask<Void, Void, HashSet<AppWidgetAttribute>>() {
protected HashSet<AppWidgetAttribute> doInBackground(Void... unused) {
HashSet<AppWidgetAttribute> widgets = mNotesListAdapter.getSelectedWidget();
if (!DataUtils.batchMoveToFolder(mContentResolver, mNotesListAdapter
.getSelectedItemIds(), Notes.ID_ROOT_FOLDER)) {
Log.e(TAG, "Move notes to trash folder error, should not happens");
}
return widgets;
}
@Override
protected void onPostExecute(HashSet<AppWidgetAttribute> widgets) {
if (widgets != null) {
for (AppWidgetAttribute widget : widgets) {
if (widget.widgetId != AppWidgetManager.INVALID_APPWIDGET_ID
&& widget.widgetType != Notes.TYPE_WIDGET_INVALIDE) {
updateWidget(widget.widgetId, widget.widgetType);
}
}
}
mModeCallBack.finishActionMode();
}
}.execute();
//DataUtils.batchMoveToFolder(mContentResolver, mNotesListAdapter.getSelectedItemIds(),Notes.ID_ROOT_FOLDER);
}
private void deleteFolder(long folderId) {
if (folderId == Notes.ID_ROOT_FOLDER) {
@ -606,74 +579,6 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
private void showTimeGet() {//获取倒计时时间
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("请输入倒计时时间");//标题
View view = LayoutInflater.from(this).inflate(R.layout.get_time, null);
final EditText hour = (EditText) view.findViewById(R.id.hour);
final EditText min = (EditText) view.findViewById(R.id.min);
final EditText sec = (EditText) view.findViewById(R.id.sec);
showSoftInput();//打开键盘
builder.setPositiveButton(android.R.string.ok, null);// 确认(逻辑在下方)
builder.setNegativeButton(android.R.string.cancel, null);
final Dialog dialog = builder.setView(view).show();//显示
final Button positive = (Button) dialog.findViewById(android.R.id.button1);
positive.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), net.micode.notes.timer.CountDown.class);
long h=Long.parseLong(hour.getText().toString());
intent.putExtra("hour",h);
long m=Long.parseLong(min.getText().toString());
intent.putExtra("min",m);
long s=Long.parseLong(sec.getText().toString());
intent.putExtra("sec",s);
Toast.makeText(v.getContext(), "正在跳转", Toast.LENGTH_SHORT).show();
startActivity(intent);//跳转页面到倒计时
dialog.dismiss();
}
});
//后面全是监听器
if (TextUtils.isEmpty(hour.getText())) {
positive.setEnabled(false);
}
hour.addTextChangedListener(new TextWatcher() {//监听器
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!TextUtils.isEmpty(hour.getText())&&!TextUtils.isEmpty(min.getText())
&&!TextUtils.isEmpty(sec.getText()))
{positive.setEnabled(true);}
else{positive.setEnabled(false);}
}
public void afterTextChanged(Editable s) {}
});
min.addTextChangedListener(new TextWatcher() {//监听器
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!TextUtils.isEmpty(hour.getText())&&!TextUtils.isEmpty(min.getText())
&&!TextUtils.isEmpty(sec.getText()))
{positive.setEnabled(true);}
else{positive.setEnabled(false);}
}
public void afterTextChanged(Editable s) {}
});
sec.addTextChangedListener(new TextWatcher() {//监听器
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!TextUtils.isEmpty(hour.getText())&&!TextUtils.isEmpty(min.getText())
&&!TextUtils.isEmpty(sec.getText()))
{positive.setEnabled(true);}
else{positive.setEnabled(false);}
}
public void afterTextChanged(Editable s) {}
});
}
private void showCreateOrModifyFolderDialog(final boolean create) {
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.dialog_edit_text, null);
@ -907,9 +812,6 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
case R.id.menu_search:
onSearchRequested();
break;
case R.id.menu_countdown:
showTimeGet();
break;
default:
break;
}

@ -69,17 +69,6 @@
android:layout_height="fill_parent"
android:orientation="vertical">
<Button
android:id="@+id/readnote"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dip"
android:layout_marginLeft="30dip"
android:layout_marginRight="30dip"
style="?android:attr/textAppearanceMedium"
android:text="阅读便签"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="7dip"
@ -94,8 +83,6 @@
android:layout_gravity="left|top"
android:fadingEdgeLength="0dip">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@ -409,7 +396,5 @@
android:layout_marginBottom="-7dip"
android:src="@drawable/selected" />
</FrameLayout>
</LinearLayout>
</FrameLayout>

@ -15,7 +15,7 @@
limitations under the License.
-->
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_new_folder"
@ -35,8 +35,5 @@
<item
android:id="@+id/menu_search"
android:title="@string/menu_search" />
<item
android:id="@+id/menu_countdown"
android:title="countdown" />
android:title="@string/menu_search"/>
</menu>

Binary file not shown.
Loading…
Cancel
Save