diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..fb7f4a8
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml
new file mode 100644
index 0000000..70f212e
--- /dev/null
+++ b/.idea/dbnavigator.xml
@@ -0,0 +1,414 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..909c0df
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..bdd9278
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..d2fda44
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,44 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ namespace 'com.example.translate_code'
+ compileSdk 33
+
+ defaultConfig {
+ applicationId "com.example.translate_code"
+ minSdk 24
+ targetSdk 33
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.4.1'
+ implementation 'com.google.android.material:material:1.5.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+ implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
+ implementation 'org.projectlombok:lombok:1.18.12'
+ implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
+
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/example/translate_code/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/translate_code/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..a8e1706
--- /dev/null
+++ b/app/src/androidTest/java/com/example/translate_code/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.translate_code;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.translate_code", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..bc75d93
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/translate_code/MainActivity.java b/app/src/main/java/com/example/translate_code/MainActivity.java
new file mode 100644
index 0000000..0840b26
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/MainActivity.java
@@ -0,0 +1,248 @@
+package com.example.translate_code;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.DialogInterface;
+import android.os.Bundle;
+
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.drawerlayout.widget.DrawerLayout;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.translate_code.adapter.Myadapter;
+import com.example.translate_code.utility.Choose;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class MainActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
+ RecyclerView mRView;
+ Myadapter myadapter;
+ List itemList=new ArrayList<>();
+
+ /* @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);*/
+ /*mRView= findViewById(R.id.spinning_left);
+ for (int i=0;i<10;i++)
+ {
+ Choose choose = new Choose();
+ choose.title="选项"+i;
+ choose.content="功能"+i;
+ relist.add(choose);
+
+ }
+ myadapter = new Myadapter(MainActivity.this,relist);
+ LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
+ mRView.setLayoutManager(linearLayoutManager);
+ mRView.setAdapter(myadapter);*/
+
+
+ TextView transTv, expTv;
+ EditText trans;
+ Button search;
+
+ Button clean;
+ LinearLayout transLi, expLi;
+ String exp, tran, pho;
+ String from = "auto", to = "auto", q;
+ generate tr;
+ Spinner spinner;
+ private DrawerLayout drawerLayout;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ init();
+ clickAndListener();
+ drawerLayout=findViewById(R.id.drawer_layout);
+ mRView= findViewById(R.id.list_left_drawer);
+ LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
+ mRView.setLayoutManager(linearLayoutManager);
+
+ }
+
+ private void init() {
+ trans = findViewById(R.id.trans);
+ transTv = findViewById(R.id.trans_tv);
+ expTv = findViewById(R.id.exp_tv);
+ search = findViewById(R.id.search);
+ clean=findViewById(R.id.clean);
+ transLi = findViewById(R.id.trans_l);
+ expLi = findViewById(R.id.exp_l);
+ spinner = findViewById(R.id.lan_spinner);
+ }
+
+ private void clickAndListener() {
+ search.setOnClickListener(v -> textResult());
+ clean.setOnClickListener(this::onClick);
+ trans.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 (s.length() == 0) {
+ transLi.setVisibility(View.GONE);
+ expLi.setVisibility(View.GONE);
+ }
+ search.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ }
+ });
+
+ spinnerListener();
+ }
+
+ private void textResult() {
+ q = trans.getText().toString().trim();
+ generate_intimpl t = new generate_intimpl(q);
+ Call call = t.getCall(from, to);
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(@NonNull Call call, @NonNull Response response) {
+ tr = response.body();
+ if (tr != null) {
+ int code =tr.getErrorCode();
+ if (0 == code) {
+ exp = tr.getExplains();
+ tran = String.valueOf(tr.getTranslation());
+ pho = tr.getUkPho();
+ if (pho != null) {
+ transTv.setText(tran + pho);
+ } else {
+ transTv.setText(tran);
+ }
+ transLi.setVisibility(View.VISIBLE);
+ search.setVisibility(View.GONE);
+ if (!tran.equals(exp) && exp != null) {
+ expTv.setText(exp);
+ expLi.setVisibility(View.VISIBLE);
+ }
+ } else if (113 == code) {
+ toaPrint("请输入翻译内容");
+ } else toaPrint("请求错误,错误码为:" + tr.getErrorCode());
+ }
+ }
+
+ @Override
+ public void onFailure(@NonNull Call call, @NonNull Throwable t) {
+ Log.i("TAG", "onFailure");
+ toaPrint("请检查网络设置!");
+ }
+ });
+ }
+
+ private void toaPrint(String s) {
+ Toast.makeText(this, s, Toast.LENGTH_SHORT).show();
+ }
+
+ private void spinnerListener() {
+ spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ switch (position) {
+ case 1://英文 → 中文
+ from = "en";
+ to = "zh-CHS";
+ break;
+ case 2://中文 → 英文
+ from = "zh-CHS";
+ to = "en";
+ break;
+ case 3://中文 → 日语
+ from = "zh-CHS";
+ to = "ja";
+ break;
+ case 4://中文 → 韩语
+ from = "zh-CHS";
+ to = "ko";
+ break;
+ case 5://中文 → 法语
+ from = "zh-CHS";
+ to = "fr";
+ break;
+ case 6://中文 → 俄语
+ from = "zh-CHS";
+ to = "ru";
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+ }
+
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ public void onClick(View v)
+ {
+ switch (v.getId()) {
+ case R.id.clean:
+ String s = trans.getText().toString();
+ Toast.makeText(this, "你搜索的词为"+s, Toast.LENGTH_SHORT).show();
+ if (s !=null) {
+ String s1 = transTv.getText().toString();
+ SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间
+ sdf.applyPattern("yyyy-MM-dd HH:mm:ss a");// a为am/pm的标记
+ Date date = new Date();// 获取当前时间
+ Choose ch = new Choose();
+ ch.yuanwen = s;
+ ch.fanyi = s1;
+ ch.time = "查询时间" + sdf.format(date);
+ itemList.add(ch);
+ setAdapter(itemList);
+ }
+ trans.setText("");
+ break;
+ case R.id.search:
+
+
+ break;
+
+
+ }
+ }
+ void setAdapter(ListitemList)
+ {
+ myadapter = new Myadapter(this, itemList);
+ mRView.setAdapter(myadapter);
+ }
+
+}
diff --git a/app/src/main/java/com/example/translate_code/ReadActivity.java b/app/src/main/java/com/example/translate_code/ReadActivity.java
new file mode 100644
index 0000000..0bdeebb
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/ReadActivity.java
@@ -0,0 +1,75 @@
+package com.example.translate_code;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.GridView;
+import android.widget.ImageButton;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.translate_code.adapter.GridAdapter;
+import com.example.translate_code.utility.Writing;
+import com.example.translate_code.utility.WrtingBean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ReadActivity extends AppCompatActivity {
+ private Listwriting=new ArrayList<>();
+/* private Listcontent=new ArrayList<>();*/
+ private GridView gridView;
+
+
+ private int []image={R.drawable.narture,R.drawable.img_4,R.drawable.img_5};
+ private String name[]={"nature","sea","mountain"};
+
+ private String allContent[]={"Stray birds of summer come to my window to sing and fly away.\n" +
+ "And yellow leaves of autumn, which have no songs, flutter and fall\n" +
+ "there with a sign.","What language is thine, O sea?\n" +
+ "The language of eternal question.\n" +
+ "What language is thy answer, O sky?\n" +
+ "The language of eternal silence.","The fish in the water is silent, the animal on the earth is noisy,\n" +
+ "the bird in the air is singing.\n" +
+ "But Man has in him the silence of the sea, the noise of the earth and\n" +
+ "the music of the air."};
+private int music[]={R.raw.one,R.raw.two,R.raw.three};
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.read_layout);
+ initlist();
+ gridView= findViewById(R.id.read_gv);
+ GridAdapter gridAdapter = new GridAdapter( writing,this);
+ gridView.setAdapter(gridAdapter);
+ setListener();
+
+ }
+ public void initlist()
+ {
+ for(int i=0;i parent, View view, int position, long id) {
+ Writing writing1 = writing.get(position);
+ Intent intent = new Intent(ReadActivity.this, WritingActivity.class);
+ intent.putExtra("writing", writing1);
+ startActivity(intent);
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/example/translate_code/WelcomeActivity.java b/app/src/main/java/com/example/translate_code/WelcomeActivity.java
new file mode 100644
index 0000000..c8d20a2
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/WelcomeActivity.java
@@ -0,0 +1,52 @@
+package com.example.translate_code;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class WelcomeActivity extends AppCompatActivity {
+ ImageButton searchView;
+ ImageButton readView;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.welcome_activity);
+ searchView=findViewById(R.id.gotosearch);
+ readView=findViewById(R.id.gotoread);
+ searchView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ toSearch();
+ }
+ });
+ readView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ toRead();
+ }
+ });
+ }
+
+ public void toSearch()
+ {
+ Intent intent = new Intent();
+ intent.setClass(WelcomeActivity.this,MainActivity.class);
+ startActivity(intent);
+
+
+ }
+ public void toRead()
+ {
+ Intent intent = new Intent();
+ intent.setClass(WelcomeActivity.this,ReadActivity.class);
+ startActivity(intent);
+
+ }
+}
diff --git a/app/src/main/java/com/example/translate_code/WritingActivity.java b/app/src/main/java/com/example/translate_code/WritingActivity.java
new file mode 100644
index 0000000..687aa65
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/WritingActivity.java
@@ -0,0 +1,83 @@
+package com.example.translate_code;
+
+import android.content.Intent;
+import android.media.MediaPlayer;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.example.translate_code.utility.Writing;
+
+public class WritingActivity extends AppCompatActivity {
+ private Button mButton01, mButton02;
+ MediaPlayer mediaPlayer;
+
+
+
+ TextView titleTv2, descTv;
+ ImageView bigPicIv;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.item_rv);
+ initView();
+//结合搜上一级界面传来的数据
+ Intent intent = getIntent();
+ Writing writing = (Writing) intent.getSerializableExtra("writing");
+ titleTv2.setText(writing.getName());
+ descTv.setText(writing.getDesc());
+ bigPicIv.setImageResource(writing.getWritePicture());
+ mediaPlayer = MediaPlayer.create(this,writing.getMusicId());
+ mButton01.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ start();
+
+ }
+ });
+ mButton02.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ pause();
+ }
+ });
+ }
+
+ public void start() {
+
+ mediaPlayer.start();
+
+
+ //1.等多久再执行什么
+ //2.每隔多久执行一次什么
+
+ }
+
+ public void pause() {
+ String pause1 = mButton02.getText().toString().trim();
+ if ("暂停".equals(pause1)) {
+ mediaPlayer.pause();
+ mButton02.setText("继续");
+ } else {
+ mediaPlayer.start();
+ mButton02.setText("暂停");
+ }
+ }
+
+ private void initView() {
+ titleTv2 = findViewById(R.id.wt_title);
+ descTv = findViewById(R.id.wt_content);
+ bigPicIv = findViewById(R.id.wt_picture);
+ mButton01 = findViewById(R.id.player);
+ mButton02 = findViewById(R.id.pause);
+
+ }
+
+
+ }
diff --git a/app/src/main/java/com/example/translate_code/adapter/GridAdapter.java b/app/src/main/java/com/example/translate_code/adapter/GridAdapter.java
new file mode 100644
index 0000000..12b13be
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/adapter/GridAdapter.java
@@ -0,0 +1,77 @@
+package com.example.translate_code.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.BaseAdapter;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
+
+import com.example.translate_code.R;
+import com.example.translate_code.holder.MyWrtingHolder;
+import com.example.translate_code.utility.Writing;
+
+import java.util.List;
+
+public class GridAdapter extends BaseAdapter {
+ private Listlist;
+ private Context context;
+
+ public GridAdapter(List list, Context context) {
+ this.list = list;
+ this.context=context;
+ }
+
+ @Override
+ public int getCount() {
+ return list.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return list.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ MyWrtingHolder myWrtingHolder;
+ if (convertView == null){
+ convertView = View.inflate(context, R.layout.item_gv,null);
+ myWrtingHolder= new MyWrtingHolder(convertView);
+ convertView.setTag(myWrtingHolder);
+
+ }
+ else {
+ myWrtingHolder= (MyWrtingHolder) convertView.getTag();
+ }
+
+ Writing writing = list.get(position);
+ myWrtingHolder.writingpicture.setImageResource(writing.getWritePicture());
+ myWrtingHolder.writingname.setText(writing.getName());
+
+ return convertView;
+
+ }
+
+ class MyWrtingHolder {
+ ImageView writingpicture;
+ TextView writingname;
+
+ public MyWrtingHolder(View view) {
+ this.writingpicture = view.findViewById(R.id.read_image);
+ this.writingname = view.findViewById(R.id.read_name);
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/translate_code/adapter/Myadapter.java b/app/src/main/java/com/example/translate_code/adapter/Myadapter.java
new file mode 100644
index 0000000..a070566
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/adapter/Myadapter.java
@@ -0,0 +1,49 @@
+package com.example.translate_code.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.translate_code.MainActivity;
+import com.example.translate_code.R;
+import com.example.translate_code.holder.MyViewholder;
+import com.example.translate_code.utility.Choose;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Myadapter extends RecyclerView.Adapter {
+ private Context mcontext;
+ Listrelist;
+
+ public Myadapter(Context mcontext,Listre) {
+ this.mcontext = mcontext;
+ this.relist=re;
+ }
+
+ @NonNull
+ @Override
+ public MyViewholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = View.inflate(mcontext, R.layout.item_list, null);
+ MyViewholder myViewholder = new MyViewholder(view);
+ return myViewholder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull MyViewholder holder, int position) {
+ Choose choose = relist.get(position);
+ holder.mTitle.setText(choose.yuanwen);
+ holder.mContent.setText(choose.fanyi);
+ holder.mTime.setText(choose.time);
+
+
+ }
+
+ @Override
+ public int getItemCount() {
+ return relist.size();
+ }
+}
diff --git a/app/src/main/java/com/example/translate_code/generate.java b/app/src/main/java/com/example/translate_code/generate.java
new file mode 100644
index 0000000..3586d85
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/generate.java
@@ -0,0 +1,81 @@
+package com.example.translate_code;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+public class generate {
+
+ @SerializedName("translation")
+ private List translation;
+ @SerializedName("basic")
+ private Basic basic;
+ @SerializedName("errorCode")
+ private Integer errorCode;
+ @SerializedName("tSpeakUrl")
+ private String tSpeakUrl;
+
+ public List getTranslation() {
+ return translation;
+ }
+
+ public Integer getErrorCode() {
+ return errorCode;
+ }
+
+ public static class Basic {
+ @SerializedName("us-phonetic")
+ private String usphonetic;
+ @SerializedName("uk-speech")
+ private String ukspeech;
+ @SerializedName("speech")
+ private String speech;
+ @SerializedName("phonetic")
+ private String phonetic;
+ @SerializedName("uk-phonetic")
+ private String ukphonetic;
+ @SerializedName("us-speech")
+ private String usspeech;
+ @SerializedName("explains")
+ private List explains;
+ }
+
+ public String getTrans() {
+ return translation.get(0);
+ }
+
+ public String getExplains() {
+ if (basic != null && basic.explains != null) {
+ return basic.explains.get(0);
+ }
+ return null;
+ }
+
+ public String getUkPho() {
+ if (basic != null && basic.ukphonetic != null)
+ return " 英:[" + basic.ukphonetic + "]";
+ return null;
+ }
+
+ public String getUsPho() {
+ if (basic != null && basic.usphonetic != null)
+ return " 美:[" + basic.usphonetic + "]";
+ return null;
+ }
+
+ public String getUkSpeech() {
+ if (basic != null)
+ return basic.ukspeech;
+ return null;
+ }
+
+ public String getUsSpeech() {
+ if (basic != null)
+ return basic.usspeech;
+ return null;
+ }
+
+ public String gettSpeakUrl() {
+ return tSpeakUrl;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/translate_code/generate_int.java b/app/src/main/java/com/example/translate_code/generate_int.java
new file mode 100644
index 0000000..127ee05
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/generate_int.java
@@ -0,0 +1,15 @@
+package com.example.translate_code;
+
+import retrofit2.Call;
+import retrofit2.http.POST;
+import retrofit2.http.Query;
+
+public interface generate_int {
+
+ @POST("api")
+ Call getTextRes(@Query("from") String from, @Query("to") String to,
+ @Query("appKey") String ID, @Query("salt") String salt,
+ @Query("sign") String sign, @Query("signType") String signType,
+ @Query("curtime") String curtime, @Query("q") String q);
+
+}
diff --git a/app/src/main/java/com/example/translate_code/generate_intimpl.java b/app/src/main/java/com/example/translate_code/generate_intimpl.java
new file mode 100644
index 0000000..3b6834e
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/generate_intimpl.java
@@ -0,0 +1,65 @@
+package com.example.translate_code;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+import retrofit2.Call;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+public class generate_intimpl{
+ String q;
+
+ public generate_intimpl(String q) {
+ this.q = q;
+ }
+
+ static String APP_KEY = "26c4025114f37897", signType = "v3";
+ static final String APP_SECRET = "j3f4oDFH4e5ujKlgyZn3J9ollgIgl2QC";
+ static String BASE_URL = "https://openapi.youdao.com/";
+
+ public Call getCall(String from, String to) {
+ Retrofit retrofit = new Retrofit.Builder()
+ .baseUrl(BASE_URL)
+ .addConverterFactory(GsonConverterFactory.create())
+ .build();
+ final generate_int getR = retrofit.create(generate_int.class);
+
+ String salt = String.valueOf(System.currentTimeMillis());
+ String curtime = String.valueOf(System.currentTimeMillis() / 1000);
+ String sign = getDigest(APP_KEY + truncate(q) + salt + curtime + APP_SECRET);
+ return getR.getTextRes(from, to, APP_KEY, salt, sign, signType, curtime, q);
+ }
+
+ private static String truncate(String q) {
+ if (q == null) {
+ return null;
+ }
+ int len = q.length();
+ return len <= 20 ? q : (q.substring(0, 10) + len + q.substring(len - 10, len));
+ }
+
+ private static String getDigest(String string) {
+ if (string == null) {
+ return null;
+ }
+ char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8',
+ '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+ byte[] btInput = string.getBytes(StandardCharsets.UTF_8);
+ try {
+ MessageDigest mdInst = MessageDigest.getInstance("SHA-256");
+ mdInst.update(btInput);
+ byte[] md = mdInst.digest();
+ int j = md.length;
+ char[] str = new char[j * 2];
+ int k = 0;
+ for (byte byte0 : md) {
+ str[k++] = hexDigits[byte0 >>> 4 & 0xf];
+ str[k++] = hexDigits[byte0 & 0xf];
+ }
+ return new String(str);
+ } catch (NoSuchAlgorithmException e) {
+ return null;
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/translate_code/holder/MyViewholder.java b/app/src/main/java/com/example/translate_code/holder/MyViewholder.java
new file mode 100644
index 0000000..c59e5da
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/holder/MyViewholder.java
@@ -0,0 +1,22 @@
+package com.example.translate_code.holder;
+
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.translate_code.R;
+
+public class MyViewholder extends RecyclerView.ViewHolder {
+ public TextView mTitle;
+ public TextView mContent;
+ public TextView mTime;
+ public MyViewholder(@NonNull View itemView) {
+ super(itemView);
+ mTitle = itemView.findViewById(R.id.yuanwen);
+ mContent=itemView.findViewById(R.id.fanyi);
+ mTime=itemView.findViewById(R.id.time);
+ }
+}
diff --git a/app/src/main/java/com/example/translate_code/holder/MyWrtingHolder.java b/app/src/main/java/com/example/translate_code/holder/MyWrtingHolder.java
new file mode 100644
index 0000000..5cc41d4
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/holder/MyWrtingHolder.java
@@ -0,0 +1,25 @@
+package com.example.translate_code.holder;
+
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.translate_code.R;
+
+public class MyWrtingHolder extends RecyclerView.ViewHolder {
+ public TextView wTtitle;
+ public ImageView wPicture;
+ public TextView wContent;
+ public MyWrtingHolder(@NonNull View itemView) {
+ super(itemView);
+ wTtitle=itemView.findViewById(R.id.wt_title);
+ wContent=itemView.findViewById(R.id.wt_content);
+ wPicture=itemView.findViewById(R.id.read_image);
+ }
+
+
+}
diff --git a/app/src/main/java/com/example/translate_code/transfragment.java b/app/src/main/java/com/example/translate_code/transfragment.java
new file mode 100644
index 0000000..d670e4f
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/transfragment.java
@@ -0,0 +1,6 @@
+package com.example.translate_code;
+
+import androidx.fragment.app.Fragment;
+
+public class transfragment extends Fragment {
+}
diff --git a/app/src/main/java/com/example/translate_code/utility/Choose.java b/app/src/main/java/com/example/translate_code/utility/Choose.java
new file mode 100644
index 0000000..a85ef41
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/utility/Choose.java
@@ -0,0 +1,7 @@
+package com.example.translate_code.utility;
+
+public class Choose {
+ public String yuanwen;
+ public String fanyi;
+ public String time;
+ }
diff --git a/app/src/main/java/com/example/translate_code/utility/Writing.java b/app/src/main/java/com/example/translate_code/utility/Writing.java
new file mode 100644
index 0000000..f0554f2
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/utility/Writing.java
@@ -0,0 +1,51 @@
+package com.example.translate_code.utility;
+
+import java.io.Serializable;
+
+public class Writing implements Serializable {
+ int writePicture;
+ String name;
+
+ private String desc;
+
+ int musicId;
+
+ public Writing(int writePicture, String name, String desc, int musicId) {
+ this.writePicture = writePicture;
+ this.name = name;
+ this.desc = desc;
+ this.musicId = musicId;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public int getWritePicture() {
+ return writePicture;
+ }
+
+ public void setWritePicture(int writePicture) {
+ this.writePicture = writePicture;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public int getMusicId() {
+ return musicId;
+ }
+
+ public void setMusicId(int musicId) {
+ this.musicId = musicId;
+ }
+}
diff --git a/app/src/main/java/com/example/translate_code/utility/WrtingBean.java b/app/src/main/java/com/example/translate_code/utility/WrtingBean.java
new file mode 100644
index 0000000..aea541d
--- /dev/null
+++ b/app/src/main/java/com/example/translate_code/utility/WrtingBean.java
@@ -0,0 +1,39 @@
+package com.example.translate_code.utility;
+
+import java.io.Serializable;
+
+public class WrtingBean implements Serializable {
+ private String title;
+ private String desc;
+ private int picid;
+
+ public WrtingBean(String title, String desc, int picid) {
+ this.title = title;
+ this.desc = desc;
+ this.picid = picid;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public int getPicid() {
+ return picid;
+ }
+
+ public void setPicid(int picid) {
+ this.picid = picid;
+ }
+}
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/edit_border.xml b/app/src/main/res/drawable/edit_border.xml
new file mode 100644
index 0000000..9bfa4ce
--- /dev/null
+++ b/app/src/main/res/drawable/edit_border.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/img.png b/app/src/main/res/drawable/img.png
new file mode 100644
index 0000000..51f63ea
Binary files /dev/null and b/app/src/main/res/drawable/img.png differ
diff --git a/app/src/main/res/drawable/img_1.png b/app/src/main/res/drawable/img_1.png
new file mode 100644
index 0000000..4b79703
Binary files /dev/null and b/app/src/main/res/drawable/img_1.png differ
diff --git a/app/src/main/res/drawable/img_2.png b/app/src/main/res/drawable/img_2.png
new file mode 100644
index 0000000..3efcf39
Binary files /dev/null and b/app/src/main/res/drawable/img_2.png differ
diff --git a/app/src/main/res/drawable/img_3.png b/app/src/main/res/drawable/img_3.png
new file mode 100644
index 0000000..3efcf39
Binary files /dev/null and b/app/src/main/res/drawable/img_3.png differ
diff --git a/app/src/main/res/drawable/img_4.png b/app/src/main/res/drawable/img_4.png
new file mode 100644
index 0000000..c392879
Binary files /dev/null and b/app/src/main/res/drawable/img_4.png differ
diff --git a/app/src/main/res/drawable/img_5.png b/app/src/main/res/drawable/img_5.png
new file mode 100644
index 0000000..ad696ec
Binary files /dev/null and b/app/src/main/res/drawable/img_5.png differ
diff --git a/app/src/main/res/drawable/img_6.png b/app/src/main/res/drawable/img_6.png
new file mode 100644
index 0000000..d45de6e
Binary files /dev/null and b/app/src/main/res/drawable/img_6.png differ
diff --git a/app/src/main/res/drawable/iv_menu_shoucang.png b/app/src/main/res/drawable/iv_menu_shoucang.png
new file mode 100644
index 0000000..94f1ade
Binary files /dev/null and b/app/src/main/res/drawable/iv_menu_shoucang.png differ
diff --git a/app/src/main/res/drawable/narture.png b/app/src/main/res/drawable/narture.png
new file mode 100644
index 0000000..1294030
Binary files /dev/null and b/app/src/main/res/drawable/narture.png differ
diff --git a/app/src/main/res/drawable/read.png b/app/src/main/res/drawable/read.png
new file mode 100644
index 0000000..d700960
Binary files /dev/null and b/app/src/main/res/drawable/read.png differ
diff --git a/app/src/main/res/drawable/search.png b/app/src/main/res/drawable/search.png
new file mode 100644
index 0000000..b489382
Binary files /dev/null and b/app/src/main/res/drawable/search.png differ
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..8d40646
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ />
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_gv.xml b/app/src/main/res/layout/item_gv.xml
new file mode 100644
index 0000000..6a0f5f1
--- /dev/null
+++ b/app/src/main/res/layout/item_gv.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/item_list.xml b/app/src/main/res/layout/item_list.xml
new file mode 100644
index 0000000..a145661
--- /dev/null
+++ b/app/src/main/res/layout/item_list.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_rv.xml b/app/src/main/res/layout/item_rv.xml
new file mode 100644
index 0000000..1d02f9a
--- /dev/null
+++ b/app/src/main/res/layout/item_rv.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/read_layout.xml b/app/src/main/res/layout/read_layout.xml
new file mode 100644
index 0000000..95ff7d4
--- /dev/null
+++ b/app/src/main/res/layout/read_layout.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/welcome_activity.xml b/app/src/main/res/layout/welcome_activity.xml
new file mode 100644
index 0000000..4b3746d
--- /dev/null
+++ b/app/src/main/res/layout/welcome_activity.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-hdpi/iv_menu_shoucang.png b/app/src/main/res/mipmap-hdpi/iv_menu_shoucang.png
new file mode 100644
index 0000000..94f1ade
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/iv_menu_shoucang.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/app/src/main/res/raw/one.m4a b/app/src/main/res/raw/one.m4a
new file mode 100644
index 0000000..010647f
Binary files /dev/null and b/app/src/main/res/raw/one.m4a differ
diff --git a/app/src/main/res/raw/three.m4a b/app/src/main/res/raw/three.m4a
new file mode 100644
index 0000000..2d27ffb
Binary files /dev/null and b/app/src/main/res/raw/three.m4a differ
diff --git a/app/src/main/res/raw/two.m4a b/app/src/main/res/raw/two.m4a
new file mode 100644
index 0000000..06c1006
Binary files /dev/null and b/app/src/main/res/raw/two.m4a differ
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..b993402
--- /dev/null
+++ b/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
new file mode 100644
index 0000000..50aab7c
--- /dev/null
+++ b/app/src/main/res/values/arrays.xml
@@ -0,0 +1,18 @@
+
+
+
+ - 自动检测
+ - 英文 → 中文
+ - 中文 → 英文
+ - 中文 → 日语
+ - 中文 → 韩语
+ - 中文 → 法语
+ - 中文 → 俄语
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..5a4205f
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF018786
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #ffffffff
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..1ac95dc
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ 快乐学英语
+
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..a73b335
--- /dev/null
+++ b/app/src/main/res/values/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000..fa0f996
--- /dev/null
+++ b/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000..9ee9997
--- /dev/null
+++ b/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/example/translate_code/ExampleUnitTest.java b/app/src/test/java/com/example/translate_code/ExampleUnitTest.java
new file mode 100644
index 0000000..28f5d52
--- /dev/null
+++ b/app/src/test/java/com/example/translate_code/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.translate_code;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..f05eacf
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,5 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ id 'com.android.application' version '7.4.2' apply false
+ id 'com.android.library' version '7.4.2' apply false
+}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..3e927b1
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# 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
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e708b1c
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..18803a5
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat May 13 19:54:18 CST 2023
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..4f906e0
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..107acd3
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..83576d3
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,16 @@
+pluginManagement {
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+rootProject.name = "Translate_code"
+include ':app'