Compare commits

...

19 Commits

Author SHA1 Message Date
pjmhoeuy7 088cbebbeb all
3 months ago
pjmhoeuy7 be3505db6d wll
3 months ago
吴丽丽 bfd4ac904e Merge branch 'dev' of https://bdgit.educoder.net/pjmhoeuy7/gitProject into wll_branch
3 months ago
pjmhoeuy7 440e8642f6 hbllr
3 months ago
pjmhoeuy7 16248f2817 hbwyj
3 months ago
吴丽丽 90750844ce ypl
3 months ago
吴丽丽 90f9b050d0 Merge branch 'main' of https://bdgit.educoder.net/pjmhoeuy7/gitProject into dev
3 months ago
dev 3fb21aa887 111
3 months ago
吴丽丽 72c5a725cb wyj
3 months ago
吴丽丽 418a35b571 Merge branch 'main' of https://bdgit.educoder.net/pjmhoeuy7/gitProject into wyj_branch
3 months ago
llr 45a48f48b0 all
3 months ago
吴丽丽 15a7f22c13 111
3 months ago
吴丽丽 ee280379e8 wll
3 months ago
王宇佳 06e159e334 11
3 months ago
王宇佳 8710c7a756 111
3 months ago
dev 72d09fc1f1 111
3 months ago
llr 1857dad8d5 1111
3 months ago
dev 35f2af56bf 0
3 months ago
dev e16ec659da 1
3 months ago

@ -190,10 +190,34 @@ 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,6 +331,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
public void onClick(DialogInterface dialog,
int which) {
batchDelete();
//Notesback();
}
});
builder.setNegativeButton(android.R.string.cancel, null);
@ -505,6 +506,32 @@ 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) {
@ -579,6 +606,74 @@ 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);
@ -812,6 +907,9 @@ 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,6 +69,17 @@
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"
@ -83,6 +94,8 @@
android:layout_gravity="left|top"
android:fadingEdgeLength="0dip">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@ -396,5 +409,7 @@
android:layout_marginBottom="-7dip"
android:src="@drawable/selected" />
</FrameLayout>
</LinearLayout>
</FrameLayout>

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

Binary file not shown.
Loading…
Cancel
Save