Compare commits

..

No commits in common. 'guoziyang_branch' and 'master' have entirely different histories.

@ -0,0 +1,2 @@
# xiaomiweihu

@ -1,5 +1,3 @@
import org.gradle.internal.impldep.org.apache.http.client.methods.RequestBuilder.options
plugins {
alias(libs.plugins.android.application)
}
@ -28,8 +26,8 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
packaging{
resources.excludes.add("META-INF/DEPENDENCIES");
@ -51,18 +49,12 @@ dependencies {
// "include" to listOf("*.aar", "*.jar"),
// "exclude" to listOf("")
// )))
implementation(files("D:\\NotesMaster2\\httpcomponents-client-4.5.14-bin\\lib\\httpclient-osgi-4.5.14.jar"))
implementation(files("D:\\NotesMaster2\\httpcomponents-client-4.5.14-bin\\lib\\httpclient-win-4.5.14.jar"))
implementation(files("D:\\NotesMaster2\\httpcomponents-client-4.5.14-bin\\lib\\httpcore-4.4.16.jar"))
implementation(files("D:\\AndroidStudioProjects\\code\\NotesMaster2\\httpcomponents-client-4.5.14-bin\\lib\\httpclient-osgi-4.5.14.jar"))
implementation(files("D:\\AndroidStudioProjects\\code\\NotesMaster2\\httpcomponents-client-4.5.14-bin\\lib\\httpclient-win-4.5.14.jar"))
implementation(files("D:\\AndroidStudioProjects\\code\\NotesMaster2\\httpcomponents-client-4.5.14-bin\\lib\\httpcore-4.4.16.jar"))
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
// 网络请求
implementation("com.squareup.okhttp3:okhttp:4.11.0")
// JSON解析
implementation("com.google.code.gson:gson:2.10.1")
// build.gradle 中更新 Glide
// implementation ("com.github.bumptech.glide:glide:4.16.0") // 替换为最新稳定版
}

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE EXTERNAL STORAGE"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL SHORTCUT" />
<uses-permission android:name="android.permission.INTERNET" />
@ -43,7 +43,7 @@
android:name=".ui.NoteEditActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
android:theme="@style/NoteTheme"
android:exported="true">
<intent-filter>
@ -142,15 +142,15 @@
android:name="android.app.default_searchable"
android:value=".ui.NoteEditActivity" />
<!-- <activity-->
<!-- android:name=".MainActivity"-->
<!-- android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <activity-->
<!-- android:name=".MainActivity"-->
<!-- android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
</application>

@ -34,11 +34,7 @@ public class Notes {
public static final int ID_TEMPARAY_FOLDER = -1;
public static final int ID_CALL_RECORD_FOLDER = -2;
public static final int ID_TRASH_FOLER = -3;
// 标记便签是否被删除0=正常1=已删除)
public static final String IS_DELETED = "is_deleted";
// 便签被删除的时间戳(秒)
public static final String DELETE_TIME = "delete_time";
public static final String INTENT_EXTRA_ALERT_DATE = "net.micode.notes.alert_date";
public static final String INTENT_EXTRA_BACKGROUND_ID = "net.micode.notes.background_color_id";
public static final String INTENT_EXTRA_WIDGET_ID = "net.micode.notes.widget_id";

@ -41,6 +41,7 @@ public class NotesDatabaseHelper extends SQLiteOpenHelper {
private static final String TAG = "NotesDatabaseHelper";
private static NotesDatabaseHelper mInstance;
private static final String CREATE_NOTE_TABLE_SQL =
"CREATE TABLE " + TABLE.NOTE + "(" +
NoteColumns.ID + " INTEGER PRIMARY KEY," +

@ -1,43 +0,0 @@
package net.micode.notes.translation;
public class TranslationResponse {
private String error_code;
private String error_msg;
private String from;
private String to;
private TransResult[] trans_result;
public String getError_code() {
return error_code;
}
public String getError_msg() {
return error_msg;
}
public String getFrom() {
return from;
}
public String getTo() {
return to;
}
public TransResult[] getTrans_result() {
return trans_result;
}
public static class TransResult {
private String src;
private String dst;
public String getSrc() {
return src;
}
public String getDst() {
return dst;
}
}
}

@ -1,188 +0,0 @@
package net.micode.notes.translation;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class TranslationService {
private static final String TAG = "TranslationService";
private static final String API_URL = "https://fanyi-api.baidu.com/api/trans/vip/translate";
private static final int MAX_RETRIES = 3; // 最大重试次数
private final Context mContext;
private final OkHttpClient mClient;
private final Handler mMainHandler;
private final Gson gson;
// 替换为你的API凭证
private static final String APP_ID = "20250615002382062";
private static final String SECRET_KEY = "rFAI3vk3j40fd7CkXvb3";
public TranslationService(Context context) {
mContext = context;
mMainHandler = new Handler(Looper.getMainLooper());
gson = new Gson();
// 配置OkHttpClient增加超时和重试
mClient = new OkHttpClient.Builder()
.connectTimeout(15, TimeUnit.SECONDS)
.readTimeout(20, TimeUnit.SECONDS)
.writeTimeout(20, TimeUnit.SECONDS)
.retryOnConnectionFailure(true)
.build();
}
public void translate(String text, String sourceLang, String targetLang, TranslationCallback callback) {
if (text == null || text.isEmpty()) {
callback.onFailure("待翻译文本不能为空");
return;
}
translateWithRetry(text, sourceLang, targetLang, callback, MAX_RETRIES);
}
private void translateWithRetry(String text, String sourceLang, String targetLang,
TranslationCallback callback, int remainingRetries) {
try {
// 生成随机盐(时间戳)
String salt = String.valueOf(System.currentTimeMillis());
// 生成签名
String sign = generateSign(APP_ID, text, salt, SECRET_KEY);
// 构建请求体
FormBody.Builder formBuilder = new FormBody.Builder()
.add("q", text)
.add("from", sourceLang)
.add("to", targetLang)
.add("appid", APP_ID)
.add("salt", salt)
.add("sign", sign);
// 创建请求
Request request = new Request.Builder()
.url(API_URL)
.post(formBuilder.build())
.build();
Log.d(TAG, "发送翻译请求: " + text.substring(0, Math.min(text.length(), 50)) + "...");
// 发送异步请求
mClient.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(@NonNull Call call, @NonNull IOException e) {
Log.e(TAG, "翻译请求失败,剩余重试次数: " + remainingRetries, e);
if (remainingRetries > 0) {
// 网络错误时重试延迟500ms
mMainHandler.postDelayed(() ->
translateWithRetry(text, sourceLang, targetLang, callback, remainingRetries - 1), 500);
} else {
postFailure(callback, "网络错误: " + e.getMessage());
}
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
try {
if (!response.isSuccessful()) {
postFailure(callback, "HTTP错误: " + response.code());
return;
}
String responseData = response.body().string();
Log.d(TAG, "API响应: " + responseData);
// 解析JSON响应
TranslationResponse translationResponse = gson.fromJson(responseData, TranslationResponse.class);
// 检查是否有错误
if (translationResponse.getError_code() != null) {
String errorMsg = "翻译API错误: " + translationResponse.getError_code() +
" - " + translationResponse.getError_msg();
// 特定错误码处理
if (translationResponse.getError_code().equals("52001")) {
// 请求超时,可重试
if (remainingRetries > 0) {
mMainHandler.postDelayed(() ->
translateWithRetry(text, sourceLang, targetLang, callback, remainingRetries - 1), 500);
return;
}
}
postFailure(callback, errorMsg);
return;
}
// 提取翻译结果
if (translationResponse.getTrans_result() != null &&
translationResponse.getTrans_result().length > 0) {
StringBuilder result = new StringBuilder();
for (TranslationResponse.TransResult item : translationResponse.getTrans_result()) {
result.append(item.getDst());
}
postSuccess(callback, result.toString());
} else {
postFailure(callback, "未获取到翻译结果");
}
} catch (Exception e) {
Log.e(TAG, "解析翻译结果失败", e);
postFailure(callback, "解析错误: " + e.getMessage());
}
}
});
} catch (Exception e) {
Log.e(TAG, "构建翻译请求失败", e);
postFailure(callback, "翻译服务异常: " + e.getMessage());
}
}
// 生成签名MD5(appid + q + salt + 密钥)
private String generateSign(String appId, String q, String salt, String secretKey) {
try {
String signString = appId + q + salt + secretKey;
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] digest = md.digest(signString.getBytes(StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder();
for (byte b : digest) {
sb.append(String.format("%02x", b));
}
return sb.toString();
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("MD5算法不可用", e);
}
}
// 切换到主线程回调成功结果
private void postSuccess(TranslationCallback callback, String result) {
mMainHandler.post(() -> callback.onSuccess(result));
}
// 切换到主线程回调失败结果
private void postFailure(TranslationCallback callback, String error) {
mMainHandler.post(() -> callback.onFailure(error));
}
// 翻译回调接口
public interface TranslationCallback {
void onSuccess(String translatedText);
void onFailure(String errorMessage);
}
}

@ -20,7 +20,6 @@ import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.PendingIntent;
import android.app.SearchManager;
import android.appwidget.AppWidgetManager;
@ -30,15 +29,11 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.speech.tts.TextToSpeech;
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;
@ -49,18 +44,14 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.Toolbar;
import net.micode.notes.R;
import net.micode.notes.data.Notes;
@ -70,16 +61,13 @@ import net.micode.notes.model.WorkingNote.NoteSettingChangedListener;
import net.micode.notes.tool.DataUtils;
import net.micode.notes.tool.ResourceParser;
import net.micode.notes.tool.ResourceParser.TextAppearanceResources;
import net.micode.notes.translation.TranslationService;
import net.micode.notes.ui.DateTimePickerDialog.OnDateTimeSetListener;
import net.micode.notes.ui.NoteEditText.OnTextViewChangeListener;
import net.micode.notes.widget.NoteWidgetProvider_2x;
import net.micode.notes.widget.NoteWidgetProvider_4x;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -87,7 +75,6 @@ import java.util.regex.Pattern;
public class NoteEditActivity extends Activity implements OnClickListener,
NoteSettingChangedListener, OnTextViewChangeListener {
private class HeadViewHolder {
public TextView tvModified;
@ -162,201 +149,19 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private String mUserQuery;
private Pattern mPattern;
private EditText mContentEditText;
private TranslationService mTranslationService;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.note_edit);
mContentEditText = findViewById(R.id.note_edit_view);
Button translateButton = findViewById(R.id.btn_translate);
mTranslationService = new TranslationService(this);
if (savedInstanceState == null && !initActivityState(getIntent())) {
finish();
return;
}
initResources();
// 设置翻译按钮点击事件
translateButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showTranslationDialog();
}
});
}
// 显示翻译对话框
private void showTranslationDialog() {
String text = mContentEditText.getText().toString().trim();
if (text.isEmpty()) {
Toast.makeText(this, "请输入需要翻译的内容", Toast.LENGTH_SHORT).show();
return;
}
// 创建语言选择对话框
final String[] languages = {"中文", "英语", "日语", "韩语", "法语", "西班牙语"};
final String[] languageCodes = {"zh", "en", "jp", "kor", "fra", "spa"};
final int[] selectedFromIndex = {1}; // 默认中文
final int[] selectedToIndex = {0}; // 默认英语
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("选择翻译语言");
// 创建语言选择视图
View dialogView = getLayoutInflater().inflate(R.layout.dialog_translate, null);
final androidx.appcompat.widget.AppCompatSpinner fromSpinner = dialogView.findViewById(R.id.spinner_from);
final androidx.appcompat.widget.AppCompatSpinner toSpinner = dialogView.findViewById(R.id.spinner_to);
// 设置语言选择适配器
ArrayAdapter<String> adapter = new ArrayAdapter<>(this,
android.R.layout.simple_spinner_item, languages);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
fromSpinner.setAdapter(adapter);
toSpinner.setAdapter(adapter);
// 设置默认选择
fromSpinner.setSelection(selectedFromIndex[0]);
toSpinner.setSelection(selectedToIndex[0]);
builder.setView(dialogView);
// 设置确定按钮
builder.setPositiveButton("翻译", (dialog, which) -> {
selectedFromIndex[0] = fromSpinner.getSelectedItemPosition();
selectedToIndex[0] = toSpinner.getSelectedItemPosition();
if (selectedFromIndex[0] == selectedToIndex[0]) {
Toast.makeText(NoteEditActivity.this, "源语言和目标语言不能相同", Toast.LENGTH_SHORT).show();
return;
}
String from = languageCodes[selectedFromIndex[0]];
String to = languageCodes[selectedToIndex[0]];
// 显示加载对话框
final AlertDialog loadingDialog = new AlertDialog.Builder(NoteEditActivity.this)
.setMessage("正在翻译...")
.setCancelable(false)
.show();
// 执行翻译
mTranslationService.translate(text, from, to, new TranslationService.TranslationCallback() {
@Override
public void onSuccess(String translatedText) {
loadingDialog.dismiss();
showTranslationResult(text, translatedText);
}
@Override
public void onFailure(String errorMessage) {
loadingDialog.dismiss();
Log.e(TAG, "翻译失败: " + errorMessage); // 加日志
Toast.makeText(NoteEditActivity.this, errorMessage, Toast.LENGTH_SHORT).show();
}
});
});
// 设置取消按钮
builder.setNegativeButton("取消", null);
builder.show();
}
// 显示翻译结果
private void showTranslationResult(String originalText, String translatedText) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("翻译结果");
View dialogView = getLayoutInflater().inflate(R.layout.dialog_translation_result, null);
EditText originalEditText = dialogView.findViewById(R.id.original_text);
EditText translatedEditText = dialogView.findViewById(R.id.translated_text);
originalEditText.setText(originalText);
translatedEditText.setText(translatedText);
builder.setView(dialogView);
// 设置替换按钮
builder.setPositiveButton("替换原文", (dialog, which) -> {
Log.d(TAG, "点击了替换原文"); // 加日志
mContentEditText.setText(translatedText);
mContentEditText.setSelection(translatedText.length());
});
// 设置添加到末尾按钮
builder.setNeutralButton("添加到末尾", (dialog, which) -> {
String currentText = mContentEditText.getText().toString();
if (!currentText.isEmpty() && !currentText.endsWith("\n")) {
currentText += "\n";
}
mContentEditText.setText(currentText + translatedText);
mContentEditText.setSelection(mContentEditText.getText().length());
});
// 设置取消按钮
builder.setNegativeButton("取消", null);
builder.show();
}
public void speech_sum(){
EditText editable = findViewById(R.id.note_edit_view);
//Toast.makeText(NoteEditActivity.this, editable.getText().toString(),
// Toast.LENGTH_SHORT).show();
// final Button speak = findViewById(R.id.iatBtn);
final int[] tmp = new int[1];
final TextToSpeech[] tts = new TextToSpeech[1];
tts[0] = new TextToSpeech(NoteEditActivity.this, new
TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
tts[0].setLanguage(Locale.US);
}
});
editable.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)
{
tmp[0] = cutOfimage(operateText(s.toString())).length();
TextView number_word = findViewById(R.id.num_word);
number_word.setText("字符数:"+ tmp[0]);
final String temp = cutOfimage(s.toString());
// speak.setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View v) {
// tts[0].speak(temp.toString(),TextToSpeech.QUEUE_FLUSH,null);
// }
// });
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
public String operateText(String str){
String dest = "";
Pattern p = Pattern.compile("\\s*|t|r|n");
Matcher m = p.matcher(str);
dest = m.replaceAll("");
return dest;
}
public String cutOfimage(String str){
String dest = str;
int index1 = dest.indexOf("[local]");
int index2 = dest.indexOf("[/local]");
while(index1 != -1 && index2 != -1){
dest = dest.substring(0,index1) + dest.substring(index2+8);
index1 = dest.indexOf("[local]");
index2 = dest.indexOf("[/local]");
}
return dest;
}
/**
* Current activity may be killed when the memory is low. Once it is killed, for another time
* user load this activity, we should restore the former state
@ -409,7 +214,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
}
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN
|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
| WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
} else if(TextUtils.equals(Intent.ACTION_INSERT_OR_EDIT, intent.getAction())) {
// New note
long folderId = intent.getLongExtra(Notes.INTENT_EXTRA_FOLDER_ID, 0);
@ -591,7 +396,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
mFontSizeId = ResourceParser.BG_DEFAULT_FONT_SIZE;
}
mEditTextList = (LinearLayout) findViewById(R.id.note_edit_list);
speech_sum();
}
@Override
@ -627,7 +431,7 @@ 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.VISIBLE);
} else if (sBgSelectorBtnsMap.containsKey(id)) {
findViewById(sBgSelectorSelectionMap.get(mWorkingNote.getBgColorId())).setVisibility(
View.GONE);
@ -701,11 +505,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
}
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.note_edit, menu); // 假设菜单文件是 note_edit.xml
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
@ -748,26 +548,12 @@ public class NoteEditActivity extends Activity implements OnClickListener,
case R.id.menu_delete_remind:
mWorkingNote.setAlertDate(0, false);
break;
case R.id.menu_count_word://数字统计
AlertDialog.Builder builder1 = new AlertDialog.Builder(this);//对话框对象
builder1.setIcon(android.R.drawable.ic_dialog_alert);//对话框图标
TextView content=(TextView)findViewById(R.id.note_edit_view);
int c =content.length();
builder1.setMessage("带符号字数总和统计为:"+ c);
builder1.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
});//确定按钮
builder1.setNegativeButton(android.R.string.cancel, null);//取消按钮
builder1.show();//对话框启动
break;
default:
break;
}
return true;
}
private void setReminder() {
DateTimePickerDialog d = new DateTimePickerDialog(this, System.currentTimeMillis());
d.setOnDateTimeSetListener(new OnDateTimeSetListener() {
@ -826,6 +612,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private boolean isSyncMode() {
return NotesPreferenceActivity.getSyncAccountName(this).trim().length() > 0;
}
public void onClockAlertChanged(long date, boolean set) {
/**
* User could set clock to an unsaved note, so before setting the

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
</selector>

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="源语言:"
android:paddingBottom="8dp"/>
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner_from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="目标语言:"
android:paddingBottom="8dp"/>
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner_to"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="原文:"
android:textStyle="bold"
android:paddingBottom="4dp"/>
<EditText
android:id="@+id/original_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="100dp"
android:maxLines="5"
android:scrollbars="vertical"
android:editable="false"
android:background="@android:color/transparent"
android:paddingBottom="16dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="译文:"
android:textStyle="bold"
android:paddingBottom="4dp"/>
<EditText
android:id="@+id/translated_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="100dp"
android:maxLines="5"
android:scrollbars="vertical"
android:editable="false"
android:background="@android:color/transparent"/>
</LinearLayout>

@ -15,19 +15,12 @@
limitations under the License.
-->
<FrameLayout android:layout_width="fill_parent"
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/list_background"
xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@ -42,9 +35,9 @@
android:id="@+id/tv_modified_date"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:layout_marginRight="8dip"
android:layout_weight="1"
android:textAppearance="@style/TextAppearanceSecondaryItem" />
<ImageView
@ -63,98 +56,61 @@
android:layout_marginRight="8dip"
android:textAppearance="@style/TextAppearanceSecondaryItem" />
<!-- <ImageButton-->
<!-- android:id="@+id/btn_menu"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center"-->
<!-- android:src="@android:drawable/ic_menu_more"-->
<!-- android:background="@android:color/transparent" />-->
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_btn_set_color" />
</LinearLayout>
<LinearLayout
android:id="@+id/sv_note_edit"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="7dip"
android:background="@drawable/bg_color_btn_mask" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left|top"
android:fadingEdgeLength="0dip"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:scrollbars="none"
android:overScrollMode="never"
android:scrollbars="none">
android:layout_gravity="left|top"
android:fadingEdgeLength="0dip">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="Orientation">
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<net.micode.notes.ui.NoteEditText
android:id="@+id/note_edit_view"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="all"
android:background="@null"
android:gravity="left|top"
android:lineSpacingMultiplier="1.2"
android:background="@null"
android:autoLink="all"
android:linksClickable="false"
android:minLines="12"
android:textAppearance="@style/TextAppearancePrimaryItem" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="end"
android:orientation="horizontal">
<Button
android:id="@+id/btn_translate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="翻译" />
<!-- <Button-->
<!-- android:id="@+id/iatBtn"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="4dp"-->
<!-- />-->
</LinearLayout>
<TextView
android:id="@+id/num_word"
android:layout_width="118dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:text="字符数: 0"
android:textColor="#99000000"
android:textSize="20sp" />
android:textAppearance="@style/TextAppearancePrimaryItem"
android:lineSpacingMultiplier="1.2" />
<LinearLayout
android:id="@+id/note_edit_list"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="-10dp"
android:orientation="vertical"
android:layout_marginLeft="-10dip"
android:visibility="gone" />
</LinearLayout>
</ScrollView>
<ImageView
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="7dip"
android:background="@drawable/bg_color_btn_mask" />
</LinearLayout>
@ -162,7 +118,7 @@
<ImageView
android:id="@+id/btn_set_bg_color"
android:layout_height="wrap_content"
android:layout_height="43dip"
android:layout_width="wrap_content"
android:background="@drawable/bg_color_btn_mask"
android:layout_gravity="top|right" />
@ -175,19 +131,17 @@
android:layout_marginTop="30dip"
android:layout_marginRight="8dip"
android:layout_gravity="top|right"
android:orientation="horizontal"
>
android:visibility="gone">
<FrameLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/iv_bg_yellow"
android:layout_width="match_parent"
android:layout_height="50dp"
/>
android:layout_height="match_parent" />
<ImageView
android:id="@+id/iv_bg_yellow_select"
@ -288,7 +242,8 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/font_size_selector_bg"
android:layout_gravity="bottom">
android:layout_gravity="bottom"
android:visibility="gone">
<FrameLayout
android:id="@+id/ll_font_small"
@ -330,22 +285,22 @@
<FrameLayout
android:id="@+id/ll_font_normal"
android:layout_width="wrap_content"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:src="@drawable/font_normal" />
android:src="@drawable/font_normal"
android:layout_marginBottom="5dip" />
<TextView
android:layout_width="wrap_content"
@ -359,11 +314,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:focusable="false"
android:visibility="gone"
android:layout_marginRight="6dip"
android:layout_marginBottom="-7dip"
android:focusable="false"
android:src="@drawable/selected"
android:visibility="gone" />
android:src="@drawable/selected" />
</FrameLayout>
<FrameLayout

@ -15,8 +15,8 @@
limitations under the License.
-->
<menu xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_delete"
@ -45,5 +45,4 @@
<item
android:id="@+id/menu_delete_remind"
android:title="@string/menu_remove_remind" />
</menu>

@ -15,8 +15,8 @@
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
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_note"
@ -28,8 +28,7 @@
<item
android:id="@+id/menu_font_size"
android:title="@string/menu_font_size"
app:showAsAction="ifRoom"/>
android:title="@string/menu_font_size"/>
<item
android:id="@+id/menu_list_mode"
@ -37,8 +36,7 @@
<item
android:id="@+id/menu_share"
android:title="@string/menu_share"
app:showAsAction="never"/>
android:title="@string/menu_share"/>
<item
android:id="@+id/menu_send_to_desktop"
@ -51,7 +49,4 @@
<item
android:id="@+id/menu_delete_remind"
android:title="@string/menu_remove_remind" />
<item
android:id="@+id/menu_count_word"
android:title="@string/menu_count_word" />
</menu>

@ -122,18 +122,5 @@
<plurals name="search_results_title">
<item quantity="other"><xliff:g id="NUMBER">%1$s</xliff:g> 条符合“<xliff:g id="SEARCH">%2$s</xliff:g>”的搜索结果</item>
</plurals>
<string name="confirm_delete_forever">确认彻底删除?</string>
<string name="delete_forever_warning" >此操作不可恢复,便签将被永久删除。</string>
<string name="note_deleted_forever" >便签已永久删除</string>
<string name="clean_trash" >清空回收站</string>
<string name="clean_trash_confirm" >将删除所有超过30天的便签此操作不可恢复。</string>
<string name="trash_cleaned" >回收站已清空</string>
<string name="cancel">取消</string>
<string name="translate_note">翻译便签</string>
<string name="translation_settings">翻译设置</string>
<string name="select_source_language">选择源语言</string>
<string name="select_target_language">选择目标语言</string>
<string name="translation_result">翻译结果</string>
<string name="replace_original">替换原文</string>
<string name="add_to_end">添加到末尾</string>
</resources>

@ -15,8 +15,8 @@
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">Notes</string>
<string name="app_widget2x2">Notes 2x2</string>
<string name="app_widget4x4">Notes 4x4</string>
@ -52,7 +52,6 @@
<string name="menu_select_none">Nothing selected, the operation is invalid</string>
<string name="menu_select_all">Select all</string>
<string name="menu_deselect_all">Deselect all</string>
<string name="menu_count_word" translatable="false">Count Word</string>
<string name="menu_font_size">Font size</string>
<string name="menu_font_small">Small</string>
<string name="menu_font_normal">Medium</string>
@ -102,7 +101,7 @@
<string name="preferences_account_title">Sync account</string>
<string name="preferences_account_summary">Sync notes with google task</string>
<string name="preferences_last_sync_time">Last sync time %1$s</string>
<string name="preferences_last_sync_time_format" translatable="false">yyyy-MM-dd hh:mm:ss</string>
<string name="preferences_last_sync_time_format">yyyy-MM-dd hh:mm:ss</string>
<string name="preferences_add_account">Add account</string>
<string name="preferences_menu_change_account">Change sync account</string>
<string name="preferences_menu_remove_account">Remove sync account</string>
@ -127,32 +126,10 @@
<string name="search">Notes</string>
<string name="datetime_dialog_ok">set</string>
<string name="datetime_dialog_cancel">cancel</string>
<string name="trash" translatable="false">回收站</string>
<plurals name="search_results_title">
<item quantity="one"><xliff:g id="number" example="1">%1$s</xliff:g> result for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
<!-- Case of 0 or 2 or more results. -->
<item quantity="other"><xliff:g id="number" example="15">%1$s</xliff:g> results for \"<xliff:g id="search" example="???">%2$s</xliff:g>\"</item>
</plurals>
<!-- 回收站相关字符串 -->
<string name="days_in_trash" translatable="false">已删除 %1$d 天</string>
<string name="restore" translatable="false">恢复</string>
<string name="delete_forever" translatable="false">彻底删除</string>
<string name="note_restored" translatable="false">便签已恢复</string>
<string name="confirm_delete_forever">确认彻底删除?</string>
<string name="delete_forever_warning" >此操作不可恢复,便签将被永久删除。</string>
<string name="note_deleted_forever" >便签已永久删除</string>
<string name="clean_trash" >清空回收站</string>
<string name="clean_trash_confirm" >将删除所有超过30天的便签此操作不可恢复。</string>
<string name="trash_cleaned" >回收站已清空</string>
<string name="cancel">取消</string>
<string name="translate_note">翻译便签</string>
<string name="translation_settings">翻译设置</string>
<string name="select_source_language">选择源语言</string>
<string name="select_target_language">选择目标语言</string>
<string name="translation_result">翻译结果</string>
<string name="replace_original">替换原文</string>
<string name="add_to_end">添加到末尾</string>
<!-- 其他字符串... -->
</resources>

@ -19,4 +19,5 @@ android.useAndroidX=true
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonFinalResIds=false
android.nonFinalResIds=false
android.overridePathCheck=true

@ -4,4 +4,3 @@ distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
org.gradle.java.home=D://java//jdk-17 # ?????JDK??
Loading…
Cancel
Save