diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c6cbe56
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..feb13c7
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+Translator
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..96cc43e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..e7bedf3
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..082e4ae
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..a950918
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..3b31283
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..c60d22d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.7
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..370b494
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..38699dc
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,31 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
+
+ defaultConfig {
+ applicationId "com.marktony.translator"
+ minSdkVersion 15
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:appcompat-v7:23.1.1'
+ compile 'com.android.support:design:23.1.1'
+ compile files('src/libs/library-1.0.19.jar')
+ compile('com.github.afollestad.material-dialogs:core:0.8.5.4@aar') {
+ transitive = true
+ }
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..fe922da
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in D:\AndroidSDK/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# 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 *;
+#}
diff --git a/app/src/androidTest/java/com/marktony/translator/ApplicationTest.java b/app/src/androidTest/java/com/marktony/translator/ApplicationTest.java
new file mode 100644
index 0000000..94fd8fd
--- /dev/null
+++ b/app/src/androidTest/java/com/marktony/translator/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.marktony.translator;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * Testing Fundamentals
+ */
+public class ApplicationTest extends ApplicationTestCase {
+ public ApplicationTest() {
+ super(Application.class);
+ }
+}
\ No newline at end of file
diff --git a/app/src/libs/library-1.0.19.jar b/app/src/libs/library-1.0.19.jar
new file mode 100644
index 0000000..fbcc9d0
Binary files /dev/null and b/app/src/libs/library-1.0.19.jar differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..1073a57
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/marktony/translator/API/Constants.java b/app/src/main/java/com/marktony/translator/API/Constants.java
new file mode 100644
index 0000000..ebe33aa
--- /dev/null
+++ b/app/src/main/java/com/marktony/translator/API/Constants.java
@@ -0,0 +1,10 @@
+package com.marktony.translator.API;
+
+/**
+ * Created by lizhaotailang on 2016/2/18.
+ */
+public class Constants {
+
+ public static final String JUHE_APPKEY = "b386d3f343bef4ab54602f9c4297cdda";
+ public static final String JUHE_INTERFACE = "http://japi.juhe.cn/youdao/dictionary.from";
+}
diff --git a/app/src/main/java/com/marktony/translator/Activities/AboutActivity.java b/app/src/main/java/com/marktony/translator/Activities/AboutActivity.java
new file mode 100644
index 0000000..76322ad
--- /dev/null
+++ b/app/src/main/java/com/marktony/translator/Activities/AboutActivity.java
@@ -0,0 +1,123 @@
+package com.marktony.translator.Activities;
+
+import android.content.ClipData;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.content.ClipData;
+import android.content.ClipboardManager;
+import android.view.View;
+import android.widget.TextView;
+
+import com.afollestad.materialdialogs.DialogAction;
+import com.afollestad.materialdialogs.MaterialDialog;
+import com.marktony.translator.R;
+
+public class AboutActivity extends AppCompatActivity {
+
+ private Toolbar toolbar;
+ private TextView tvThanks;
+ private TextView tvFeedback;
+ private TextView tvDonate;
+ private TextView tvScore;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_about);
+
+ initViews();
+
+ tvThanks.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ MaterialDialog.Builder dialog = new MaterialDialog.Builder(AboutActivity.this);
+ dialog.title(R.string.thanksto);
+ dialog.content(R.string.thanksto_content);
+ dialog.neutralText(R.string.got_it);
+ dialog.onNeutral(new MaterialDialog.SingleButtonCallback() {
+ @Override
+ public void onClick(MaterialDialog dialog, DialogAction which) {
+ dialog.dismiss();
+ }
+ });
+ dialog.show();
+ }
+ });
+
+ tvFeedback.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Uri uri = Uri.parse(getString(R.string.sendto));
+ Intent intent = new Intent(Intent.ACTION_SENDTO,uri);
+ intent.putExtra(Intent.EXTRA_SUBJECT,getString(R.string.topic));
+ intent.putExtra(Intent.EXTRA_TEXT,
+ getString(R.string.phone_modle) + Build.MODEL
+ + "\n" + getString(R.string.sdk_version) + Build.VERSION.RELEASE + "\n");
+ startActivity(intent);
+ }
+ });
+
+ tvDonate.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ MaterialDialog.Builder dialog = new MaterialDialog.Builder(AboutActivity.this);
+ dialog.title(R.string.donate_title);
+ dialog.content(R.string.donate_content);
+ dialog.positiveText(R.string.OK);
+ dialog.negativeText(R.string.cancle);
+ dialog.onPositive(new MaterialDialog.SingleButtonCallback() {
+ @Override
+ public void onClick(MaterialDialog dialog, DialogAction which) {
+ //将指定账号添加到剪切板
+ ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
+ ClipData clipData = ClipData.newPlainText("text", getString(R.string.donate_account));
+ manager.setPrimaryClip(clipData);
+
+ dialog.dismiss();
+ }
+ });
+ dialog.onNegative(new MaterialDialog.SingleButtonCallback() {
+ @Override
+ public void onClick(MaterialDialog dialog, DialogAction which) {
+ dialog.dismiss();
+ }
+ });
+
+ dialog.show();
+
+ }
+ });
+
+ tvScore.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ Uri uri = Uri.parse("market://details?id="+getPackageName());
+ Intent intent = new Intent(Intent.ACTION_VIEW,uri);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(intent);
+
+ }
+ });
+
+ }
+
+ private void initViews() {
+
+ toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
+ tvThanks = (TextView) findViewById(R.id.tv_thanks);
+ tvFeedback = (TextView) findViewById(R.id.tv_feedback);
+ tvDonate = (TextView) findViewById(R.id.tv_donate);
+ tvScore = (TextView) findViewById(R.id.tv_score);
+
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/marktony/translator/Activities/MainActivity.java b/app/src/main/java/com/marktony/translator/Activities/MainActivity.java
new file mode 100644
index 0000000..0ae1ab1
--- /dev/null
+++ b/app/src/main/java/com/marktony/translator/Activities/MainActivity.java
@@ -0,0 +1,214 @@
+package com.marktony.translator.Activities;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.provider.Settings;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.util.Log;
+import android.view.View;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.android.volley.Request;
+import com.android.volley.RequestQueue;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.JsonObjectRequest;
+import com.android.volley.toolbox.Volley;
+import com.marktony.translator.API.Constants;
+import com.marktony.translator.R;
+import com.marktony.translator.Utils.NetworkUtil;
+import com.marktony.translator.Utils.UTF8Encoder;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MainActivity extends AppCompatActivity {
+
+ private Toolbar toolbar;
+ private FloatingActionButton fab;
+ private EditText etInput;
+ private TextView tvResult;
+
+ private RequestQueue queue;
+
+ private static final int SUCCESS = 1;
+
+ private Handler handler = new Handler(){
+ @Override
+ public void handleMessage(Message msg) {
+ if (msg.what == SUCCESS){
+ String tmp = "";
+ for (int i=0;!msg.getData().isEmpty();i++){
+ tmp = msg.getData().getString("translation"+i) + "\n";
+ msg.getData().remove("translation"+i);
+ }
+ tvResult.setText(tmp);
+ }
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ initViews();
+
+ queue = Volley.newRequestQueue(getApplicationContext());
+
+ //在这里进行网络连接的判断,如果没有连接,则进行snackbar的提示
+ //如果有网络连接,则不会有任何的操作
+ if (!NetworkUtil.isNetworkConnected(MainActivity.this)){
+ Snackbar.make(fab,R.string.no_network_connected,Snackbar.LENGTH_LONG)
+ .setAction(R.string.setting, new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(Settings.ACTION_SETTINGS));
+ }
+ }).show();
+ }
+
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+
+ if (!NetworkUtil.isNetworkConnected(MainActivity.this)){
+ Snackbar.make(fab,R.string.no_network_connected,Snackbar.LENGTH_LONG)
+ .setAction(R.string.setting, new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(Settings.ACTION_SETTINGS));
+ }
+ }).show();
+ } else if (etInput.getText() == null || etInput.getText().length() == 0){
+ Snackbar.make(fab,getString(R.string.no_input),Snackbar.LENGTH_SHORT).show();
+ } else {
+
+ sendReq();
+
+ }
+ }
+ });
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+ return true;
+
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+
+ //noinspection SimplifiableIfStatement
+ if (id == R.id.action_about) {
+
+ Intent intent = new Intent(MainActivity.this,AboutActivity.class);
+ startActivity(intent);
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+ private void initViews() {
+
+ toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ fab = (FloatingActionButton) findViewById(R.id.fab);
+
+ etInput = (EditText) findViewById(R.id.et_main_input);
+ tvResult = (TextView) findViewById(R.id.tv_show_result);
+
+ }
+
+ private void sendReq(){
+
+ JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET,
+ Constants.JUHE_INTERFACE + "?key=" + Constants.JUHE_APPKEY + "&word=" + UTF8Encoder.encode(String.valueOf(etInput.getText())),
+ new Response.Listener() {
+ @Override
+ public void onResponse(JSONObject jsonObject) {
+
+ try {
+ switch (jsonObject.getInt("error_code")){
+
+ case 0:
+ JSONArray transObj = jsonObject.getJSONObject("result").getJSONObject("data").getJSONArray("translation");
+
+ Bundle bundle = new Bundle();
+ for (int i=0;i getHeaders() {
+ HashMap headers = new HashMap();
+ headers.put("Accept","application/json");
+ headers.put("Content-Type","appliction/json,charset=UTF-8");
+ return headers;
+ }
+ };
+
+ queue.add(request);
+
+ }
+
+}
+
diff --git a/app/src/main/java/com/marktony/translator/Utils/NetworkUtil.java b/app/src/main/java/com/marktony/translator/Utils/NetworkUtil.java
new file mode 100644
index 0000000..0df4481
--- /dev/null
+++ b/app/src/main/java/com/marktony/translator/Utils/NetworkUtil.java
@@ -0,0 +1,25 @@
+package com.marktony.translator.Utils;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+/**
+ * Created by lizhaotailang on 2016/2/18.
+ */
+public class NetworkUtil {
+
+ public static boolean isNetworkConnected(Context context){
+
+ if (context != null){
+ ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo info = manager.getActiveNetworkInfo();
+ if (info != null){
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/app/src/main/java/com/marktony/translator/Utils/UTF8Encoder.java b/app/src/main/java/com/marktony/translator/Utils/UTF8Encoder.java
new file mode 100644
index 0000000..dbdb15f
--- /dev/null
+++ b/app/src/main/java/com/marktony/translator/Utils/UTF8Encoder.java
@@ -0,0 +1,24 @@
+package com.marktony.translator.Utils;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+/**
+ * Created by lizhaotailang on 2016/2/18.
+ */
+public class UTF8Encoder {
+
+ public static String encode(String url){
+ if (url == null){
+ return null;
+ }
+ try {
+ url = URLEncoder.encode(url,"UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+
+ return url;
+ }
+
+}
diff --git a/app/src/main/res/drawable/logo.png b/app/src/main/res/drawable/logo.png
new file mode 100644
index 0000000..9e61b9c
Binary files /dev/null and b/app/src/main/res/drawable/logo.png differ
diff --git a/app/src/main/res/drawable/ok.png b/app/src/main/res/drawable/ok.png
new file mode 100644
index 0000000..3aebc05
Binary files /dev/null and b/app/src/main/res/drawable/ok.png differ
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
new file mode 100644
index 0000000..92e89ba
--- /dev/null
+++ b/app/src/main/res/layout/activity_about.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
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..210bb2e
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/content_about.xml b/app/src/main/res/layout/content_about.xml
new file mode 100644
index 0000000..f164fb4
--- /dev/null
+++ b/app/src/main/res/layout/content_about.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
new file mode 100644
index 0000000..d7dd51f
--- /dev/null
+++ b/app/src/main/res/layout/content_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
new file mode 100644
index 0000000..a611c32
--- /dev/null
+++ b/app/src/main/res/menu/menu_main.xml
@@ -0,0 +1,10 @@
+
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..7573659
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..cdcc6c8
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..08357c7
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..6a118c4
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..9e61b9c
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
new file mode 100644
index 0000000..822f5b8
--- /dev/null
+++ b/app/src/main/res/values-en/strings.xml
@@ -0,0 +1,44 @@
+
+
+ Translator
+ About
+ Please input what you want to translate here.
+ Tap the floating action button to translate.
+ No network connected
+
+ No input
+ About
+ Version:1.0.0
+
+ Credits
+
+ Developer:Tony,student\nThanks to Juhe.cn and open source project:Material Dialogs!
+
+ Got it
+
+ Feedback and advice
+ Choose mail apps
+ Translator feedback and advice
+ Phone model:
+ SDK version:
+ mailto:marktonymengyi@gmail.com
+
+ Donate us
+ Donate
+ 18627441225
+
+ Alipay account will be copied to clipboard.Launch Alipay and paste it to finish donating.Thank you!
+
+ YES
+ CANCLE
+
+ Rate this app in Store
+
+ No results
+ Only support English and Chinese
+ No more than 200 charactors
+ Unable to analyze the input
+ Invalid arguments
+ Network Exception
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..b31edcb
--- /dev/null
+++ b/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,10 @@
+>
+
+
+
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..fb4fecc
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,7 @@
+
+
+ #009688
+ #009688
+ #009688
+ #009688
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..812cb7b
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 16dp
+ 16dp
+ 16dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..b14eaed
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,39 @@
+
+ 简单翻译
+ 关于
+ 请输入要翻译的文字
+ 点击屏幕右下方按钮开始翻译
+ 当前没有网络连接
+ 输入为空
+ 设置
+ 关于
+ 版本:1.0.0
+ 开发者和致谢名单
+
+ 开发者:蒙大牛和伊小利,学生\n简单翻译的开发离不开 聚合数据 和 开源项目:Material Dialogs 的支持!
+
+ 知道了
+ 反馈和建议
+ 简单翻译使用反馈
+ 手机型号:
+ SDK版本:
+ 选择邮件类应用
+ mailto:marktonymengyi@gmail.com
+
+ 捐赠开发者
+ 支付宝账号将会复制到粘贴板,进入支付宝可直接粘贴完成捐赠,感谢您的支持!
+ 感谢您的捐赠
+ 18627441225
+ 确定
+ 取消
+
+ 为此应用评分
+
+ 查询无结果
+ 仅支持中英文互译
+ 字符长度不能超过200个字符
+ 输入的文本无法解析(数据源网络异常)
+ URI参数word错误或者为空
+ 网络异常无结果
+
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..545b9c6
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/marktony/translator/ExampleUnitTest.java b/app/src/test/java/com/marktony/translator/ExampleUnitTest.java
new file mode 100644
index 0000000..f099fb2
--- /dev/null
+++ b/app/src/test/java/com/marktony/translator/ExampleUnitTest.java
@@ -0,0 +1,15 @@
+package com.marktony.translator;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..f83b67d
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,24 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.5.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ maven { url "https://jitpack.io" }
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..1d3591c
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,18 @@
+# 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.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -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
\ 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..05ef575
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..f23df6e
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Oct 21 11:34:03 PDT 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# 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
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# 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
+
+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" ] ; 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, switch paths to Windows format before running java
+if $cygwin ; 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=$((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
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,90 @@
+@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
+
+@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=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@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 init
+
+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 init
+
+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
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+: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 %CMD_LINE_ARGS%
+
+: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..e7b4def
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'