diff --git a/README.md b/README.md
index 04fcf26..e327f4c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-#验证码助手
+#验证码助手 SmsCodeHelper
是由原「[贝壳单词](http://www.beikedanci.com)」团队开发的一款新的开源轻App.
@@ -16,12 +16,24 @@
-#源代码在GPLv3协议下发布
-###我们开源,我们做好设计,我们不乱使用权限,只求你如果喜欢,可以分享给你的朋友们,好东西需要分享才能让其健康成长,每一次分享都是我们的动力,非常感谢!
+#源代码在 GPLv3 协议下发布
+###我们开源,做好设计,不乱使用权限,只求你如果喜欢,可以分享给你的朋友们,好东西需要分享才能让其健康成长,每一次分享都是我们的动力,非常感谢!
-#下载
+#下载 Download
Google Play:https://play.google.com/store/apps/details?id=me.drakeet.inmessage
-Fir:http://fir.im/codehelper
\ No newline at end of file
+Fir:http://fir.im/codehelper
+
+#English introduction
+SmsCodeHelper, is a new open source and light App.
+
+It can automatically emerge verification code when your phone receives a text message contains a verification code. And automatically copy the code to the user's clipboard. When the user receives the message verification code, just long press the EditText to paste the verification code.
+
+In addition, it can also allow users to bulk delete unwanted SMS verification code; It can also help users Backward inference out what the business is bound (for a new phone number, it is useful).
+
+It is very light, but also adhering to the usual good design and user-friendly, since it does not start at leisure, will not take up any memory (unbelievers or concern, welcome to view the source code) .
+
+
+We open source, good design, not indiscriminately use rights. Just hope if you like it, you can share with your friends, because good things need to share with others in order to let it grow, every share is our power, thanks!
diff --git a/app/build.gradle b/app/build.gradle
index d41f8f6..327bacd 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,9 +11,9 @@ android {
defaultConfig {
applicationId "me.drakeet.inmessage"
minSdkVersion 15
- targetSdkVersion 21
- versionCode 4
- versionName "1.0"
+ targetSdkVersion 22
+ versionCode 20
+ versionName "1.2.0"
}
sourceSets {
main {
@@ -57,8 +57,8 @@ android {
buildConfigField "boolean", "LOG_DEBUG", "false"
debuggable false
- minifyEnabled true
- shrinkResources true
+ minifyEnabled false
+ shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.app1
@@ -123,4 +123,5 @@ dependencies {
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.badoo.mobile:android-weak-handler:1.0'
compile 'com.umeng.analytics:analytics:latest.integration'// Umeng 统计
+
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 757ec6d..c697333 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,15 +1,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -18,21 +18,21 @@
android:allowBackup="true"
android:icon="@mipmap/ic_incode"
android:label="@string/app_name"
- android:theme="@style/MaterialTheme" >
+ android:theme="@style/MaterialTheme">
+ android:label="@string/app_name">
-
+
-
+
-
-
-
-
+
+
+
+
@@ -41,15 +41,17 @@
-
-
-
+
+
+
-
-
+
+
diff --git a/app/src/main/java/me/drakeet/inmessage/AboutActivity.java b/app/src/main/java/me/drakeet/inmessage/AboutActivity.java
index a86594f..228f084 100644
--- a/app/src/main/java/me/drakeet/inmessage/AboutActivity.java
+++ b/app/src/main/java/me/drakeet/inmessage/AboutActivity.java
@@ -7,6 +7,7 @@
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
+import android.widget.TextView;
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView;
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks;
@@ -16,12 +17,17 @@
import butterknife.ButterKnife;
import butterknife.InjectView;
+/**
+ * Created by drakeet on 15/6/5.
+ */
public class AboutActivity extends AppCompatActivity {
@InjectView(R.id.toolbar)
Toolbar mToolbar;
@InjectView(R.id.sv_about)
ObservableScrollView mScrollView;
+ @InjectView(R.id.tv_version)
+ TextView mVersionTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -29,6 +35,8 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_about);
ButterKnife.inject(this);
+ setUpVersionName();
+
final int headerHeight = getResources().getDimensionPixelSize(R.dimen.about_header_height);
mToolbar.setTitle("");
setSupportActionBar(mToolbar);
@@ -66,6 +74,10 @@ public void onUpOrCancelMotionEvent(ScrollState scrollState) {
);
}
+ private void setUpVersionName() {
+ mVersionTextView.setText("Version " + BuildConfig.VERSION_NAME);
+ }
+
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_about, menu);
diff --git a/app/src/main/java/me/drakeet/inmessage/MainActivity.java b/app/src/main/java/me/drakeet/inmessage/MainActivity.java
index a401b5b..111b3be 100755
--- a/app/src/main/java/me/drakeet/inmessage/MainActivity.java
+++ b/app/src/main/java/me/drakeet/inmessage/MainActivity.java
@@ -112,8 +112,10 @@ private void setAdapter() {
new OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
- if (mMessages.get(position).getIsMessage()) {
- showDetailSMS(mMessages.get(position));
+ if (!mIsRefreshing) {
+ if (mMessages.get(position).getIsMessage()) {
+ showDetailSMS(mMessages.get(position));
+ }
}
}
}
@@ -166,42 +168,37 @@ private int getMessageCount() {
@OnClick(R.id.fab_delete_all)
public void deleteAll() {
if (VersionUtils.IS_MORE_THAN_LOLLIPOP) {
- ToastUtils.showShort("Android 5.0 以上暂不支持清空验证码短信!");
+ ToastUtils.showShort(R.string.str_version_morethan_five);
} else {
showConfirmDialog();
}
}
private void showConfirmDialog() {
- AlertDialog alertDialog = new AlertDialog.Builder(this).
- setTitle("清空验证码短信?")
- .
- setMessage(getString(R.string.str_clear_messages_hint))
- .
- setPositiveButton(
- "确定",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(
- DialogInterface dialog,
- int which) {
- showDeleteDialog();
- }
- }
- )
- .
- setNegativeButton(
- "取消",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(
- DialogInterface dialog,
- int which) {
-
- }
- }
- )
- .create();
+ AlertDialog alertDialog = new AlertDialog.Builder(this).setTitle(getString(R.string.empty_verification_code))
+ .setMessage(getString(R.string.str_clear_messages_hint))
+ .setPositiveButton(
+ android.R.string.ok,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(
+ DialogInterface dialog,
+ int which) {
+ showDeleteDialog();
+ }
+ }
+ )
+ .setNegativeButton(
+ android.R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(
+ DialogInterface dialog,
+ int which) {
+
+ }
+ }
+ ).create();
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
}
@@ -211,24 +208,22 @@ private void showDeleteDialog() {
LayoutInflater layoutInflater = LayoutInflater.from(MainActivity.this);
View addLayout = layoutInflater.inflate(R.layout.view_delete_messages, null);
mNumberProgressBar = (NumberProgressBar) addLayout.findViewById(R.id.number_progress_bar);
- AlertDialog deleteDialog = new AlertDialog.Builder(MainActivity.this).
- setTitle(
- "正在删除验证码短信..."
- )
- .setView(addLayout)
- .
- setNegativeButton(
- "停止",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(
- DialogInterface dialog,
- int which) {
- mStopDelete = true;
- }
- }
- )
- .create();
+ AlertDialog deleteDialog = new AlertDialog.Builder(MainActivity.this).setTitle(
+ getString(R.string.deleting_verification_code)
+ )
+ .setView(addLayout)
+ .setNegativeButton(
+ android.R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(
+ DialogInterface dialog,
+ int which) {
+ mStopDelete = true;
+ }
+ }
+ )
+ .create();
deleteDialog.setCanceledOnTouchOutside(false);
deleteDialog.setOnKeyListener(
new DialogInterface.OnKeyListener() {
@@ -252,23 +247,19 @@ public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
private void showBussinessDialog() {
- final AlertDialog alertDialog = new AlertDialog.Builder(this).
- setTitle(getString(R.string.str_check_bussiness_hint))
- .
- setMessage(getString(R.string.str_doing_hint))
- .
- setPositiveButton(
- "确定",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(
- DialogInterface dialog,
- int which) {
- }
- }
- )
- .
- create();
+ final AlertDialog alertDialog = new AlertDialog.Builder(this).setTitle(getString(R.string.str_check_bussiness_hint))
+ .setMessage(getString(R.string.str_doing_hint))
+ .setPositiveButton(
+ android.R.string.ok,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(
+ DialogInterface dialog,
+ int which) {
+ }
+ }
+ )
+ .create();
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
TaskUtils.executeAsyncTask(
@@ -329,23 +320,19 @@ private Boolean isExist(String company, List companys) {
}
private void showDetailSMS(Message message) {
- AlertDialog alertDialog = new AlertDialog.Builder(this).
- setTitle(message.getSender())
- .
- setMessage(message.getContent())
- .
- setPositiveButton(
- "确定",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(
- DialogInterface dialog,
- int which) {
- }
- }
- )
- .
- create();
+ AlertDialog alertDialog = new AlertDialog.Builder(this).setTitle(message.getSender())
+ .setMessage(message.getContent())
+ .setPositiveButton(
+ android.R.string.ok,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(
+ DialogInterface dialog,
+ int which) {
+ }
+ }
+ )
+ .create();
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
}
@@ -382,7 +369,7 @@ protected String doInBackground(Object... params) {
protected void onPostExecute(String o) {
super.onPostExecute(o);
deleteDialog.dismiss();
- ToastUtils.showShort("成功删除" + o + "条验证码短信!");
+ ToastUtils.showShort(String.format(getString(R.string.successfully_delete_verification_code_numbers), o));
getAllMessage();
}
@@ -428,14 +415,14 @@ public boolean onCreateOptionsMenu(Menu menu) {
final MenuItem switchItem = menu.findItem(R.id.menu_show_result);
MenuItemCompat.setActionView(switchItem, R.layout.view_switchcompat);
final SwitchCompat switchCompat = (SwitchCompat) switchItem.getActionView()
- .findViewById(R.id.switchCompat);
+ .findViewById(R.id.switchCompat);
switchCompat.setOnCheckedChangeListener(
new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (mIsRefreshing) {
switchCompat.setChecked(!isChecked);
- ToastUtils.showShort("加载中请勿改变开关状态!");
+ ToastUtils.showShort(getString(R.string.do_not_change_the_switch));
} else {
SharedPreferences sharedPreferences = getSharedPreferences(
"userinfo", Context.MODE_PRIVATE
@@ -446,9 +433,9 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mMainMessageAdapter.setShowResult(isChecked);
mMainMessageAdapter.notifyDataSetChanged();
if (isChecked)
- ToastUtils.showShort("开启验证码内容显示简化");
+ ToastUtils.showShort(getString(R.string.open_simplified));
else
- ToastUtils.showShort("关闭验证码内容显示简化");
+ ToastUtils.showShort(getString(R.string.close_simplified));
}
}
}
@@ -481,7 +468,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
if (!mIsRefreshing) {
showBussinessDialog();
} else {
- ToastUtils.showShort("加载中请勿操作!");
+ ToastUtils.showShort(getString(R.string.do_not_operate_in_load));
}
}
return super.onOptionsItemSelected(item);
@@ -493,7 +480,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
public void onClickShare() {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
- intent.putExtra(Intent.EXTRA_SUBJECT, "分享");
+ intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_just));
intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_text));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(Intent.createChooser(intent, getTitle()));
diff --git a/app/src/main/java/me/drakeet/inmessage/adapter/MainMessageAdapter.java b/app/src/main/java/me/drakeet/inmessage/adapter/MainMessageAdapter.java
index 57633f8..186ff6f 100755
--- a/app/src/main/java/me/drakeet/inmessage/adapter/MainMessageAdapter.java
+++ b/app/src/main/java/me/drakeet/inmessage/adapter/MainMessageAdapter.java
@@ -129,7 +129,7 @@ private void getAvatar(final String phoneNumber, final ImageView imageView, fina
new AsyncTask