diff --git a/README.md b/README.md index de27ecf..138d9c3 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Official Address: | :-: |:-:| | EOS | [tpopensource](https://eosflare.io/account/tpopensource) | | SWTC | [jGj83Xe4GEyDKXBDrFBGXdMWHKTSy29XUp](http://state.jingtum.com/#!/wallet/jGj83Xe4GEyDKXBDrFBGXdMWHKTSy29XUp) | -| MOAC | [0x77e7b7b5ea39bf1103f191e58ef44b1f74ccef1b](http://47.75.53.185/addr/0x77e7b7b5ea39bf1103f191e58ef44b1f74ccef1b) | +| MOAC | [0x77e7b7b5ea39bf1103f191e58ef44b1f74ccef1b](http://explorer.moac.io/addr/0x77e7b7b5ea39bf1103f191e58ef44b1f74ccef1b) | ## License diff --git a/app/build.gradle b/app/build.gradle index c12c587..dba609e 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,6 +10,7 @@ android { versionCode 1 versionName "1.0.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + vectorDrawables.useSupportLibrary = true } buildTypes { release { @@ -21,15 +22,18 @@ android { dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.support:support-v4:26.1.0' + implementation 'com.android.support:support-vector-drawable:26.1.0' + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile 'com.android.support:appcompat-v7:26.1.0' - compile 'com.android.support.constraint:constraint-layout:1.0.2' - testCompile 'junit:junit:4.12' - compile 'com.mcxiaoke.volley:library:1.0.+' - compile files('libs/gson-2.3.1.jar') - compile 'com.android.support:design:26.1.0' - compile 'com.google.zxing:core:3.3.0' -} \ No newline at end of file + implementation 'com.android.support:appcompat-v7:26.1.0' + implementation 'com.android.support.constraint:constraint-layout:1.0.2' + testImplementation 'junit:junit:4.12' + implementation 'com.mcxiaoke.volley:library:1.0.+' + implementation files('libs/gson-2.3.1.jar') + implementation 'com.android.support:design:26.1.0' + implementation 'com.google.zxing:core:3.3.0' + implementation 'org.greenrobot:eventbus:3.0.0' +} diff --git a/app/gradle/wrapper/gradle-wrapper.jar b/app/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f6b961f Binary files /dev/null and b/app/gradle/wrapper/gradle-wrapper.jar differ diff --git a/app/gradle/wrapper/gradle-wrapper.properties b/app/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..9a4163a --- /dev/null +++ b/app/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/app/gradlew b/app/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/app/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## 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="" + +# 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, 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 + +# 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" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/app/gradlew.bat b/app/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/app/gradlew.bat @@ -0,0 +1,84 @@ +@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 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= + +@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 Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_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=%* + +: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/app/proguard-rules.pro b/app/proguard-rules.pro index 8e7caea..137e63c 100755 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -146,3 +146,13 @@ public static *** i(...); public static *** w(...); } + + -keepclassmembers class ** { + @org.greenrobot.eventbus.Subscribe ; + } + -keep enum org.greenrobot.eventbus.ThreadMode { *; } + + # Only required if you use AsyncExecutor + -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent { + (java.lang.Throwable); + } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8c6b9b5..84078b4 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,6 +28,7 @@ + android:screenOrientation="portrait" /> @@ -106,6 +106,9 @@ + \ No newline at end of file diff --git a/app/src/main/java/com/tokenbank/TApplication.java b/app/src/main/java/com/tokenbank/TApplication.java index 4076d21..0e508dd 100755 --- a/app/src/main/java/com/tokenbank/TApplication.java +++ b/app/src/main/java/com/tokenbank/TApplication.java @@ -1,6 +1,8 @@ package com.tokenbank; import android.app.Application; +import android.content.Context; +import android.os.Build; import com.tokenbank.activity.BaseActivity; import com.tokenbank.base.BlockChainData; @@ -8,9 +10,11 @@ import com.tokenbank.base.WalletInfoManager; import com.tokenbank.base.TBController; import com.tokenbank.config.AppConfig; +import com.tokenbank.utils.LanguageUtil; import java.util.ArrayList; import java.util.List; +import java.util.Locale; public class TApplication extends Application { @@ -37,7 +41,7 @@ public void addActivity(BaseActivity activity) { public void popActivity(BaseActivity activity) { mActivities.remove(activity); - if(!activity.isFinishing()) { + if (!activity.isFinishing()) { activity.finish(); } } @@ -50,4 +54,14 @@ public void clearActivity() { } } } + + @Override + protected void attachBaseContext(Context base) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + Locale locale = LanguageUtil.getUserLocale(base); + super.attachBaseContext(LanguageUtil.updateLocale(base, locale)); + } else { + super.attachBaseContext(base); + } + } } diff --git a/app/src/main/java/com/tokenbank/activity/AboutActivity.java b/app/src/main/java/com/tokenbank/activity/AboutActivity.java index ae5d871..00692e8 100755 --- a/app/src/main/java/com/tokenbank/activity/AboutActivity.java +++ b/app/src/main/java/com/tokenbank/activity/AboutActivity.java @@ -31,12 +31,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { mTitleBar = (TitleBar) findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("关于我们"); + mTitleBar.setTitle(getString(R.string.titleBar_about)); mTitleBar.setRightTextColor(R.color.white); mTitleBar.setTitleBarClickListener(this); mTvVersion = (TextView) findViewById(R.id.tv_version); - mTvVersion.setText("当前版本:" + DeviceUtil.getVersionName()); + mTvVersion.setText(getString(R.string.content_version) + DeviceUtil.getVersionName()); mLayoutUserTerms = (RelativeLayout) findViewById(R.id.layout_use_terms); mLayoutUserTerms.setOnClickListener(this); @@ -51,13 +51,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { @Override public void onClick(View view) { if (view == mLayoutUserTerms) { - WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, "使用协议", Constant.service_term_url); + WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, getString(R.string.titleBar_agreement), Constant.service_term_url); } else if (view == mLayoutPrivliTerms) { - WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, "隐私条款", Constant.privilege_url); + WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, getString(R.string.titleBar_privacy), Constant.privilege_url); } else if (view == mLayoutCheckUpdate) { - ToastUtil.toast(AboutActivity.this, "已经是最新版本"); + ToastUtil.toast(AboutActivity.this, getString(R.string.toast_latest_version)); } } diff --git a/app/src/main/java/com/tokenbank/activity/BWDInfoActivity.java b/app/src/main/java/com/tokenbank/activity/BWDInfoActivity.java index dbc532a..eb253a5 100755 --- a/app/src/main/java/com/tokenbank/activity/BWDInfoActivity.java +++ b/app/src/main/java/com/tokenbank/activity/BWDInfoActivity.java @@ -66,7 +66,7 @@ public void onClick(View v) { private void initView() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setTitleTextColor(R.color.white); - mTitleBar.setTitle("备份钱包"); + mTitleBar.setTitle(getString(R.string.titleBar_backup_wallet)); mTvBakupTitle = findViewById(R.id.tv_bakup_title); mTvBakupContent = findViewById(R.id.tv_bakup_content); @@ -116,14 +116,14 @@ private void updateUIContent() { if (mType == PK_TYPE) { mScrollViewWords.setVisibility(View.GONE); mTvPk.setVisibility(View.VISIBLE); - mTvBakupTitle.setText("立即备份你的私钥"); - mTvBakupContent.setText("备份钱包:抄写私钥,并保存在安全的地方。千万不要保存在网络上。然后尝试转入转出小额资产开始使用。"); + mTvBakupTitle.setText(getString(R.string.title_backup_private_key)); + mTvBakupContent.setText(getString(R.string.content_backup_private_kye)); mTvPk.setText(mWalletData.wpk); } else if (mType == WORDS_TYPE) { mScrollViewWords.setVisibility(View.VISIBLE); mTvPk.setVisibility(View.GONE); - mTvBakupTitle.setText("立即备份你的助记词"); - mTvBakupContent.setText("备份钱包:抄写助记词,并保存在安全的地方。千万不要保存在网络上。然后尝试转入转出小额资产开始使用。"); + mTvBakupTitle.setText(getString(R.string.title_backup_mnemonic)); + mTvBakupContent.setText(getString(R.string.content_backup_mnemonic)); } } diff --git a/app/src/main/java/com/tokenbank/activity/BaseActivity.java b/app/src/main/java/com/tokenbank/activity/BaseActivity.java index c206cff..d0886dd 100755 --- a/app/src/main/java/com/tokenbank/activity/BaseActivity.java +++ b/app/src/main/java/com/tokenbank/activity/BaseActivity.java @@ -1,12 +1,22 @@ package com.tokenbank.activity; +import android.content.Intent; +import android.content.res.Configuration; +import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import com.tokenbank.TApplication; +import com.tokenbank.utils.LanguageUtil; import com.tokenbank.utils.PermissionUtil; +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.Locale; + public class BaseActivity extends AppCompatActivity { @@ -20,14 +30,55 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - TApplication application = (TApplication)getApplication(); + TApplication application = (TApplication) getApplication(); application.addActivity(this); + EventBus.getDefault().register(this); } @Override protected void onDestroy() { super.onDestroy(); - TApplication application = (TApplication)getApplication(); + TApplication application = (TApplication) getApplication(); application.popActivity(this); + EventBus.getDefault().unregister(this); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + Locale userLocale = LanguageUtil.getUserLocale(this); + //系统语言改变了应用保持之前设置的语言 + if (userLocale != null) { + Locale.setDefault(userLocale); + Configuration configuration = new Configuration(newConfig); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + configuration.setLocale(userLocale); + createConfigurationContext(configuration); + } else { + configuration.locale = userLocale; + } + getResources().updateConfiguration(configuration, getResources().getDisplayMetrics()); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onEvent(String str) { + switch (str) { + case "EVENT_REFRESH_LANGUAGE": + Locale locale = LanguageUtil.getUserLocale(this); + LanguageUtil.updateLocale(this, locale); +// recreate();//刷新界面 + Intent intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + overridePendingTransition(0, 0); + break; + } + } + } diff --git a/app/src/main/java/com/tokenbank/activity/ChangeWalletActivity.java b/app/src/main/java/com/tokenbank/activity/ChangeWalletActivity.java index fbda1c8..656f148 100755 --- a/app/src/main/java/com/tokenbank/activity/ChangeWalletActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ChangeWalletActivity.java @@ -48,7 +48,7 @@ public static void startChangeWalletActivity(Context context) { private void init() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("切换账号"); + mTitleBar.setTitle(getString(R.string.titleBar_switch_account)); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { diff --git a/app/src/main/java/com/tokenbank/activity/ChooseTokenTransferActivity.java b/app/src/main/java/com/tokenbank/activity/ChooseTokenTransferActivity.java index 93a45aa..a69bfe6 100755 --- a/app/src/main/java/com/tokenbank/activity/ChooseTokenTransferActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ChooseTokenTransferActivity.java @@ -22,7 +22,7 @@ import com.tokenbank.utils.ViewUtil; import com.tokenbank.view.TitleBar; -public class ChooseTokenTransferActivity extends BaseActivity implements BaseRecycleAdapter.OnDataLodingFinish{ +public class ChooseTokenTransferActivity extends BaseActivity implements BaseRecycleAdapter.OnDataLodingFinish { private final static String TAG = "ChooseTokenTransferActivity"; @@ -61,10 +61,10 @@ private void initView() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("选择代币"); + mTitleBar.setTitle(getString(R.string.titleBar_select_token)); mTitleBar.setBackgroundColor(getResources().getColor(R.color.common_blue)); - mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener(){ + mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { onBackPressed(); @@ -113,6 +113,7 @@ private boolean isReadyForPullEnd() { return false; } + class ChooseTokenAdapter extends BaseRecycleAdapter { private boolean mHasMore = true; diff --git a/app/src/main/java/com/tokenbank/activity/ChooseWalletBlockActivity.java b/app/src/main/java/com/tokenbank/activity/ChooseWalletBlockActivity.java index 3802e1f..5f1d9c2 100755 --- a/app/src/main/java/com/tokenbank/activity/ChooseWalletBlockActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ChooseWalletBlockActivity.java @@ -34,7 +34,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { private void initView() { TitleBar mTitleBar = findViewById(R.id.title_bar); - mTitleBar.setTitle("选择币种体系"); + mTitleBar.setTitle(getString(R.string.titleBar_select_block)); mTitleBar.setLeftDrawable(R.drawable.ic_back); mTitleBar.setRightDrawable(R.drawable.ic_walletutil_help); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @@ -64,7 +64,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) int hid = (int) adapter.getList().get(position).hid; if (hid == -1) { - ToastUtil.toast(ChooseWalletBlockActivity.this, "数据异常:" + hid); + ToastUtil.toast(ChooseWalletBlockActivity.this, getString(R.string.toast_abnormal_data) + hid); return; } diff --git a/app/src/main/java/com/tokenbank/activity/ConfirmWalletBakupInfoActivity.java b/app/src/main/java/com/tokenbank/activity/ConfirmWalletBakupInfoActivity.java index 36dc2cf..1ea8073 100755 --- a/app/src/main/java/com/tokenbank/activity/ConfirmWalletBakupInfoActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ConfirmWalletBakupInfoActivity.java @@ -88,7 +88,7 @@ public void onClick(View v) { WalletInfoManager.getInstance().updateWalletBaked(mWalletData.waddress, true); gotoMainActivity(); } else { - ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, "私钥输入错误,请确认"); + ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, getString(R.string.toast_private_key_incorrect)); } } else if (mType == WORDS_TYPE) { if (verifyWords()) { @@ -96,7 +96,8 @@ public void onClick(View v) { WalletInfoManager.getInstance().updateWalletBaked(mWalletData.waddress, true); gotoMainActivity(); } else { - ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, "助记词顺错误,请确认"); + ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, getString(R.string.toast_mnemonic_incorrect)) + ; } } } @@ -117,7 +118,7 @@ private void resortWords() { private void initView() { mTitleBar = findViewById(R.id.title_bar); - mTitleBar.setTitle("确认备份信息"); + mTitleBar.setTitle(getString(R.string.titleBar_verify)); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { @@ -207,13 +208,13 @@ private void updateUIContent() { if (mType == PK_TYPE) { mLayoutWords.setVisibility(View.GONE); mEdtPk.setVisibility(View.VISIBLE); - mTvBakupTitle.setText("确认你的钱包私钥"); - mTvBakupContent.setText("请按抄写的私钥填入输入框,确认你备份的私钥正确"); + mTvBakupTitle.setText(getString(R.string.title_verify_private_key)); + mTvBakupContent.setText(getString(R.string.content_verify_private_key)); } else if (mType == WORDS_TYPE) { mLayoutWords.setVisibility(View.VISIBLE); mEdtPk.setVisibility(View.GONE); - mTvBakupTitle.setText("确认你的钱包助记词"); - mTvBakupContent.setText("请按抄写的顺序点击助记词,确认你的备份助记词正确"); + mTvBakupTitle.setText(getString(R.string.title_verify_mnemonic)); + mTvBakupContent.setText(getString(R.string.content_verify_mnemonic)); } } diff --git a/app/src/main/java/com/tokenbank/activity/CreateWalletActivity.java b/app/src/main/java/com/tokenbank/activity/CreateWalletActivity.java index 4bf63dc..23c4d52 100755 --- a/app/src/main/java/com/tokenbank/activity/CreateWalletActivity.java +++ b/app/src/main/java/com/tokenbank/activity/CreateWalletActivity.java @@ -6,6 +6,7 @@ import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; +import android.text.Html; import android.text.TextUtils; import android.view.View; import android.widget.Button; @@ -59,7 +60,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { private void initView() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle(R.string.str_create_wallet); + mTitleBar.setTitle(R.string.btn_create_wallet); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { @@ -75,6 +76,7 @@ public void onLeftClick(View view) { mImgServiceTerms = findViewById(R.id.img_service_terms); mImgServiceTerms.setOnClickListener(this); mTvServiceTerms = findViewById(R.id.tv_service_terms); + mTvServiceTerms.setText(Html.fromHtml(getString(R.string.content_read_service))); mTvServiceTerms.setOnClickListener(this); mBtnConfirm = findViewById(R.id.btn_confirm); @@ -157,7 +159,7 @@ public static void navToActivity(Context context, BlockChainData.Block block, in private boolean paramCheck() { if (mBlock == null) { - ViewUtil.showSysAlertDialog(this, "请选择币种体系", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_block), "OK"); return false; } @@ -167,29 +169,29 @@ private boolean paramCheck() { boolean readedTerms = mImgServiceTerms.isSelected(); if (TextUtils.isEmpty(walletName)) { - ViewUtil.showSysAlertDialog(this, "钱包名称不能为空", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_wallet_name), "OK"); return false; } if (TextUtils.isEmpty(walletPwd)) { - ViewUtil.showSysAlertDialog(this, "密码不能为空", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_password), "OK"); return false; } if (TextUtils.isEmpty(walletPwdRepeat)) { - ViewUtil.showSysAlertDialog(this, "密码重复不能为空", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_verify_password), "OK"); return false; } if (!TextUtils.equals(walletPwdRepeat, walletPwd)) { - ViewUtil.showSysAlertDialog(this, "两次密码不同,请重新输入", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_passwords_unmatch), "OK"); return false; } if (walletPwd.length() < 8) { - ViewUtil.showSysAlertDialog(this, "密码长度不能小于8位", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_short_password), "OK"); return false; } if (!readedTerms) { - ViewUtil.showSysAlertDialog(this, "您尚未阅读并同意服务和隐私条款", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_read_service), "OK"); return false; } @@ -226,7 +228,7 @@ private void recordWallet(final String name, final int walletType, final String final String words, String tips, final String address) { long walletID = System.currentTimeMillis(); storeWallet(walletID, walletType, name, address, hash, privateKey, words); - ToastUtil.toast(CreateWalletActivity.this, "钱包创建成功"); + ToastUtil.toast(CreateWalletActivity.this, getString(R.string.toast_wallet_created)); gotoBakup(); } @@ -244,12 +246,12 @@ private void storeWallet(long walletId, int walletType, String walletName, Strin private void resetBtn() { - mBtnConfirm.setText("创建钱包"); + mBtnConfirm.setText(getString(R.string.btn_create_wallet_done)); mBtnConfirm.setEnabled(true); } private void setBtnStateToCreating() { - mBtnConfirm.setText("正在创建钱包"); + mBtnConfirm.setText(getString(R.string.btn_creating_wallet)); mBtnConfirm.setEnabled(false); } @@ -265,6 +267,6 @@ private void gotoBakup() { } private void gotoServiceTermPage() { - WebBrowserActivity.startWebBrowserActivity(this, "服务条款", Constant.service_term_url); + WebBrowserActivity.startWebBrowserActivity(this, getString(R.string.titleBar_service_terms), Constant.service_term_url); } } diff --git a/app/src/main/java/com/tokenbank/activity/ImportWalletActivity.java b/app/src/main/java/com/tokenbank/activity/ImportWalletActivity.java index 2d1d9d6..77e275d 100755 --- a/app/src/main/java/com/tokenbank/activity/ImportWalletActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ImportWalletActivity.java @@ -89,7 +89,7 @@ private void initView() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("导入钱包"); + mTitleBar.setTitle(getString(R.string.titleBar_import_wallet)); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { diff --git a/app/src/main/java/com/tokenbank/activity/LanguageActivity.java b/app/src/main/java/com/tokenbank/activity/LanguageActivity.java new file mode 100644 index 0000000..9ddc184 --- /dev/null +++ b/app/src/main/java/com/tokenbank/activity/LanguageActivity.java @@ -0,0 +1,121 @@ +package com.tokenbank.activity; + +import android.content.Context; +import android.content.Intent; +import android.content.res.Configuration; +import android.content.res.Resources; +import android.os.Build; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; +import android.widget.RelativeLayout; + +import com.tokenbank.R; +import com.tokenbank.utils.LanguageUtil; +import com.tokenbank.view.TitleBar; + +import java.util.Locale; + +public class LanguageActivity extends BaseActivity implements View.OnClickListener, TitleBar.TitleBarClickListener { + + private TitleBar mTitleBar; + + private RelativeLayout mLayoutAuto; + private RelativeLayout mLayoutLanguageZh; + private RelativeLayout mLayoutLanguageEn; + private ImageView mImageAuto; + private ImageView mImageChinese; + private ImageView mImageEnglish; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_language); + + mTitleBar = (TitleBar) findViewById(R.id.title_bar); + mTitleBar.setTitle(getString(R.string.title_languages)); + mTitleBar.setLeftDrawable(R.drawable.ic_back); + mTitleBar.setRightTextColor(R.color.white); + mTitleBar.setTitleBarClickListener(this); + + mLayoutAuto = (RelativeLayout) findViewById(R.id.layout_auto); + mLayoutAuto.setOnClickListener(this); + mImageAuto = (ImageView) mLayoutAuto.findViewById(R.id.img_auto); + mLayoutLanguageZh = (RelativeLayout) findViewById(R.id.layout_chinese); + mImageChinese = (ImageView) mLayoutLanguageZh.findViewById(R.id.img_chinese); + mLayoutLanguageZh.setOnClickListener(this); + mLayoutLanguageEn = (RelativeLayout) findViewById(R.id.layout_english); + mImageEnglish = (ImageView) mLayoutLanguageEn.findViewById(R.id.img_english); + mLayoutLanguageEn.setOnClickListener(this); + + String select = LanguageUtil.getUserSelect(this); + imageShow(select); + + } + + @Override + public void onClick(View view) { + if (view == mLayoutLanguageZh) { + LanguageUtil.saveUserSelect(this, Locale.CHINESE.getLanguage()); + imageShow(Locale.CHINESE.getLanguage()); + LanguageUtil.saveUserLocale(this, Locale.CHINESE); + } else if (view == mLayoutLanguageEn) { + LanguageUtil.saveUserSelect(this, Locale.ENGLISH.getLanguage()); + imageShow(Locale.ENGLISH.getLanguage()); + LanguageUtil.saveUserLocale(this, Locale.ENGLISH); + } else { + LanguageUtil.saveUserSelect(this, "auto"); + imageShow("auto"); + Locale locale; + Configuration configuration = Resources.getSystem().getConfiguration(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + locale = configuration.getLocales().get(0); + } else { + locale = configuration.locale; + } + LanguageUtil.saveUserLocale(this, locale); + } + } + + @Override + public void onLeftClick(View v) { + finish(); + } + + + @Override + public void onRightClick(View v) { + + } + + @Override + public void onMiddleClick(View v) { + + } + + public static void startLanguageActivity(Context from) { + Intent intent = new Intent(from, LanguageActivity.class); + intent.addFlags(from instanceof BaseActivity ? 0 : Intent.FLAG_ACTIVITY_NEW_TASK); + from.startActivity(intent); + } + + private void imageShow(String select) { + switch (select) { + case "zh": + mImageAuto.setVisibility(View.GONE); + mImageChinese.setVisibility(View.VISIBLE); + mImageEnglish.setVisibility(View.GONE); + break; + case "en": + mImageAuto.setVisibility(View.GONE); + mImageChinese.setVisibility(View.GONE); + mImageEnglish.setVisibility(View.VISIBLE); + break; + case "auto": + mImageAuto.setVisibility(View.VISIBLE); + mImageChinese.setVisibility(View.GONE); + mImageEnglish.setVisibility(View.GONE); + break; + } + } +} diff --git a/app/src/main/java/com/tokenbank/activity/MainActivity.java b/app/src/main/java/com/tokenbank/activity/MainActivity.java index 4a83d1d..c9a9719 100755 --- a/app/src/main/java/com/tokenbank/activity/MainActivity.java +++ b/app/src/main/java/com/tokenbank/activity/MainActivity.java @@ -5,7 +5,6 @@ import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; - import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; @@ -57,8 +56,7 @@ protected void onResume() { public void onClick(View view) { if (view == mLayoutTabWallet) { mMainViewPager.setCurrentItem(WALLET_INDEX); - } - else if (view == mLayoutTabMine) { + } else if (view == mLayoutTabMine) { mMainViewPager.setCurrentItem(MINE_INDEX); } } @@ -154,5 +152,4 @@ public int getCount() { return mFragments.length; } } - } diff --git a/app/src/main/java/com/tokenbank/activity/ManageWalletActivity.java b/app/src/main/java/com/tokenbank/activity/ManageWalletActivity.java index 113d858..5c85d41 100755 --- a/app/src/main/java/com/tokenbank/activity/ManageWalletActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ManageWalletActivity.java @@ -54,7 +54,7 @@ private void initView() { mTitleBar = (TitleBar) findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("管理钱包"); + mTitleBar.setTitle(getString(R.string.titleBar_manage_wallet)); mTitleBar.setTitleTextColor(R.color.white); mTitleBar.setBackgroundColor(getResources().getColor(R.color.common_blue)); mTitleBar.setTitleBarClickListener(this); diff --git a/app/src/main/java/com/tokenbank/activity/ModifyPwdActivity.java b/app/src/main/java/com/tokenbank/activity/ModifyPwdActivity.java index fda7c0d..a21fa12 100755 --- a/app/src/main/java/com/tokenbank/activity/ModifyPwdActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ModifyPwdActivity.java @@ -56,37 +56,37 @@ public void onLeftClick(View view) { @Override public void onRightClick(View view) { if (TextUtils.isEmpty(mEdtOldPwd.getText().toString())) { - showTipAlertDialog("旧密码不能为空"); + showTipAlertDialog(getString(R.string.dialog_content_no_old_password)); return; } if (TextUtils.isEmpty(mEdtNewPwd.getText().toString())) { - showTipAlertDialog("新密码不能为空"); + showTipAlertDialog(getString(R.string.dialog_content_no_new_password)); return; } if (TextUtils.isEmpty(mEdtReaptNewPwd.getText().toString())) { - showTipAlertDialog("新密码确认不能为空"); + showTipAlertDialog(getString(R.string.dialog_content_no_verify_new_password)); return; } if (!TextUtils.equals(mEdtReaptNewPwd.getText().toString(), mEdtNewPwd.getText().toString())) { - showTipAlertDialog("两次输入的新密码不同,请确认"); + showTipAlertDialog(getString(R.string.dialog_new_passwords_unmatch)); return; } if (mEdtNewPwd.getText().toString().length() < 8) { - showTipAlertDialog("密码长度不能少于8位"); + showTipAlertDialog(getString(R.string.dialog_content_short_password)); return; } if (TextUtils.equals(mEdtNewPwd.getText().toString(), mEdtOldPwd.getText().toString())) { - showTipAlertDialog("新旧密码不能一样,请重新填写"); + showTipAlertDialog(getString(R.string.dialog_content_old_new_same)); return; } String oldHash = FileUtil.getStringContent(mEdtOldPwd.getText().toString()); if (!TextUtils.equals(oldHash, mWalletData.whash)) { - showTipAlertDialog("旧密码错误,请重新输入旧密码"); + showTipAlertDialog(getString(R.string.dialog_content_old_password_incorrect)); mEdtOldPwd.setText(""); return; } - ToastUtil.toast(ModifyPwdActivity.this, "修改密码成功"); + ToastUtil.toast(ModifyPwdActivity.this, getString(R.string.toast_password_changed)); WalletInfoManager.getInstance().updateWalletHash(mWalletData.waddress, FileUtil.getStringContent(mEdtNewPwd.getText().toString())); this.finish(); } @@ -115,17 +115,17 @@ private void initView() { mTitleBar = (TitleBar) findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("更改密码"); + mTitleBar.setTitle(getString(R.string.titleBar_change_pwd)); - mTitleBar.setRightText("完成"); + mTitleBar.setRightText(getString(R.string.titleBar_completed)); mTitleBar.setRightTextColor(R.color.white); mTitleBar.setTitleBarClickListener(this); - mEdtOldPwd = findViewById(R.id.edt_old_pwd); - mEdtNewPwd = findViewById(R.id.edt_new_pwd); - mEdtReaptNewPwd = findViewById(R.id.edt_new_repeat_pwd); - mTvForgetPwdTips = findViewById(R.id.tv_forgetpwd_tip); - mTvForgetPwdTips.setText(Html.fromHtml("忘记密码? 导入助记词或私钥可重置密码。立即导入?")); + mEdtOldPwd = findViewById(R.id.edt_old_pwd); + mEdtNewPwd = findViewById(R.id.edt_new_pwd); + mEdtReaptNewPwd = findViewById(R.id.edt_new_repeat_pwd); + mTvForgetPwdTips = findViewById(R.id.tv_forgetpwd_tip); + mTvForgetPwdTips.setText(Html.fromHtml(getString(R.string.content_forgot_password))); mTvForgetPwdTips.setOnClickListener(this); } diff --git a/app/src/main/java/com/tokenbank/activity/ModifyWalletActivity.java b/app/src/main/java/com/tokenbank/activity/ModifyWalletActivity.java index 61460b6..93900f9 100755 --- a/app/src/main/java/com/tokenbank/activity/ModifyWalletActivity.java +++ b/app/src/main/java/com/tokenbank/activity/ModifyWalletActivity.java @@ -75,7 +75,7 @@ public void onClick(View view) { gotoBak(); } else if (view == mTvWalletAddress) { Util.clipboard(ModifyWalletActivity.this, "", mTvWalletAddress.getText().toString()); - ToastUtil.toast(ModifyWalletActivity.this, "钱包地址已经复制到剪贴板"); + ToastUtil.toast(ModifyWalletActivity.this, getString(R.string.toast_wallet_address_copied)); } } @@ -100,13 +100,13 @@ public void authPwd(String tag, boolean result) { if (result) { realExportPrivateKey(); } else { - ToastUtil.toast(this, "密码错误"); + ToastUtil.toast(this, getString(R.string.toast_password_incorrect)); } } else if (TextUtils.equals(tag, "deletewallet")) { if (result) { deleteWallet(); } else { - ToastUtil.toast(this, "密码错误"); + ToastUtil.toast(this, getString(R.string.toast_password_incorrect)); } } } @@ -122,7 +122,7 @@ private void initView() { mTitleBar = (TitleBar) findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); mTitleBar.setTitle(mWalletData.wname); - mTitleBar.setRightText("保存"); + mTitleBar.setRightText(getString(R.string.titleBar_save)); mTitleBar.setRightTextColor(R.color.white); mTitleBar.setTitleBarClickListener(this); @@ -172,7 +172,7 @@ private void realExportPrivateKey() { private void saveWalletInfo() { String newWalletName = mEdtWalletName.getText().toString(); if (TextUtils.isEmpty(newWalletName)) { - ViewUtil.showSysAlertDialog(this, "钱包名不能为空", "Ok"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_wallet_name), "Ok"); return; } mWalletData.wname = newWalletName; @@ -183,13 +183,13 @@ private void saveWalletInfo() { private void deleteWallet() { if (!mWalletData.isBaked) { if (mWalletData.type == 1) { - ViewUtil.showSysAlertDialog(ModifyWalletActivity.this, "警告", "钱包未备份,删除钱包将导致钱包无法找回", "去备份", new DialogInterface.OnClickListener() { + ViewUtil.showSysAlertDialog(ModifyWalletActivity.this, getString(R.string.dialog_title_warning), getString(R.string.dialog_content_no_wallet_backup), getString(R.string.dialog_btn_backup), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { gotoBak(); dialog.dismiss(); } - }, "继续删除", new DialogInterface.OnClickListener() { + }, getString(R.string.dialog_btn_delete), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { WalletInfoManager.getInstance().deleteWallet(ModifyWalletActivity.this, mWalletData); @@ -198,13 +198,13 @@ public void onClick(DialogInterface dialog, int which) { } }); } else if (mWalletData.type == 2) { - ViewUtil.showSysAlertDialog(ModifyWalletActivity.this, "警告", "钱包未备份,删除钱包将导致钱包无法找回,请备份私钥", "去备份", new DialogInterface.OnClickListener() { + ViewUtil.showSysAlertDialog(ModifyWalletActivity.this, getString(R.string.dialog_title_warning), getString(R.string.dialog_content_no_key_backup), getString(R.string.dialog_btn_backup), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { verifyPwd("exportprivatekey"); dialog.dismiss(); } - }, "继续删除", new DialogInterface.OnClickListener() { + }, getString(R.string.dialog_btn_delete), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { WalletInfoManager.getInstance().deleteWallet(ModifyWalletActivity.this, mWalletData); @@ -223,7 +223,7 @@ private void gotoBak() { String[] words = null; words = mWalletData.words.split(" "); if (words == null || words.length < 12) { - ToastUtil.toast(ModifyWalletActivity.this, "没有助记词,无法备份"); + ToastUtil.toast(ModifyWalletActivity.this, getString(R.string.toast_cant_backup)); return; } StartBakupActivity.startBakupWalletStartActivity(ModifyWalletActivity.this, mWalletData.waddress, 2); diff --git a/app/src/main/java/com/tokenbank/activity/SplashActivity.java b/app/src/main/java/com/tokenbank/activity/SplashActivity.java index 8ef7344..66d9c08 100755 --- a/app/src/main/java/com/tokenbank/activity/SplashActivity.java +++ b/app/src/main/java/com/tokenbank/activity/SplashActivity.java @@ -42,7 +42,7 @@ protected void onCreate(Bundle savedInstanceState) { mTvImportWallet = (TextView) findViewById(R.id.tv_import_wallet); mTvImportWallet.setOnClickListener(this); if (!NetUtil.isNetworkAvailable(this)) { - ToastUtil.toast(this, "网络未连接,请检查"); + ToastUtil.toast(this, getString(R.string.toast_no_network)); } // checkUpgrade(); checkPermission(); diff --git a/app/src/main/java/com/tokenbank/activity/StartBakupActivity.java b/app/src/main/java/com/tokenbank/activity/StartBakupActivity.java index 78316d1..a3d6d07 100755 --- a/app/src/main/java/com/tokenbank/activity/StartBakupActivity.java +++ b/app/src/main/java/com/tokenbank/activity/StartBakupActivity.java @@ -87,7 +87,7 @@ private boolean verifyData() { private void initView() { mTitleBar = findViewById(R.id.title_bar); - mTitleBar.setTitle("备份钱包"); + mTitleBar.setTitle(getString(R.string.titleBar_backup_wallet)); mTvBakupTitle = findViewById(R.id.tv_bakup_title); mTvBakupContent = findViewById(R.id.tv_bakup_content); @@ -99,11 +99,11 @@ private void initView() { private void updateUIContent() { if (mType == PK_TYPE) { - mTvBakupTitle.setText("立即备份你的私钥"); - mTvBakupContent.setText("备份钱包:抄写私钥,并保存在安全的地方。千万不要保存在网络上。然后尝试转入转出小额资产开始使用。"); + mTvBakupTitle.setText(getString(R.string.title_backup_private_key)); + mTvBakupContent.setText(getString(R.string.content_backup_private_kye)); } else if (mType == WORDS_TYPE) { - mTvBakupTitle.setText("立即备份你的助记词"); - mTvBakupContent.setText("备份钱包:抄写助记词,并保存在安全的地方。千万不要保存在网络上。然后尝试转入转出小额资产开始使用。"); + mTvBakupTitle.setText(getString(R.string.title_backup_mnemonic)); + mTvBakupContent.setText(getString(R.string.content_backup_mnemonic)); } } } diff --git a/app/src/main/java/com/tokenbank/activity/TokenReceiveActivity.java b/app/src/main/java/com/tokenbank/activity/TokenReceiveActivity.java index d277ef0..eaab94e 100755 --- a/app/src/main/java/com/tokenbank/activity/TokenReceiveActivity.java +++ b/app/src/main/java/com/tokenbank/activity/TokenReceiveActivity.java @@ -27,7 +27,6 @@ import com.tokenbank.view.TitleBar; - public class TokenReceiveActivity extends BaseActivity { public final static String TAG = "TokenTransferActivity"; @@ -67,7 +66,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { private void initView() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("收款"); + mTitleBar.setTitle(getString(R.string.titleBar_collect)); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { @@ -87,7 +86,7 @@ public void onLeftClick(View view) { @Override public void onClick(View v) { Util.clipboard(TokenReceiveActivity.this, "", mTvAddress.getText().toString()); - ToastUtil.toast(TokenReceiveActivity.this, "钱包地址已经复制到剪贴板"); + ToastUtil.toast(TokenReceiveActivity.this, getString(R.string.toast_wallet_address_copied)); } }); } @@ -111,7 +110,7 @@ public void afterTextChanged(Editable editable) { double amount = Util.parseDouble(mEdtAmount.getText().toString()); double tokenAmount = 0.0f; if (amount < 0) { - ToastUtil.toast(TokenReceiveActivity.this, "请输入正确数目"); + ToastUtil.toast(TokenReceiveActivity.this, getString(R.string.toast_enter_amount)); } else { tokenAmount = amount; } @@ -126,7 +125,7 @@ public void afterTextChanged(Editable editable) { private void generateAddress(String walletAddress, double amount, String token) { if (TextUtils.isEmpty(walletAddress) || amount < 0.0f || TextUtils.isEmpty(token)) { - ToastUtil.toast(TokenReceiveActivity.this, "生成收款码错误, 请检查参数"); + ToastUtil.toast(TokenReceiveActivity.this, getString(R.string.toast_collect_code_err)); mImgQrShadow.setVisibility(View.VISIBLE); return; } @@ -140,7 +139,7 @@ public void onGetWResult(int ret, GsonUtil extra) { createQRCode(receiveAddress); } } else { - ToastUtil.toast(TokenReceiveActivity.this, "生成收款码错误"); + ToastUtil.toast(TokenReceiveActivity.this, getString(R.string.toast_collect_code_err)); mImgQrShadow.setVisibility(View.VISIBLE); } } diff --git a/app/src/main/java/com/tokenbank/activity/TokenTransferActivity.java b/app/src/main/java/com/tokenbank/activity/TokenTransferActivity.java index 4087a24..c28a935 100755 --- a/app/src/main/java/com/tokenbank/activity/TokenTransferActivity.java +++ b/app/src/main/java/com/tokenbank/activity/TokenTransferActivity.java @@ -16,13 +16,11 @@ import com.tokenbank.base.TBController; import com.tokenbank.base.WalletInfoManager; import com.tokenbank.base.WCallback; -import com.tokenbank.config.Constant; import com.tokenbank.dialog.OrderDetailDialog; import com.tokenbank.dialog.PwdDialog; import com.tokenbank.net.api.jtrequest.JTBalanceRequest; import com.tokenbank.net.load.RequestPresenter; import com.tokenbank.utils.GsonUtil; -import com.tokenbank.utils.TLog; import com.tokenbank.utils.ToastUtil; import com.tokenbank.utils.Util; import com.tokenbank.utils.ViewUtil; @@ -31,7 +29,6 @@ import java.text.DecimalFormat; - public class TokenTransferActivity extends BaseActivity implements View.OnClickListener { public final static String TAG = "TokenTransferActivity"; @@ -89,7 +86,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { private void initView() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("转账"); + mTitleBar.setTitle(getString(R.string.titleBar_transfer)); // mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener()); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override @@ -181,7 +178,7 @@ public void onGetWResult(int ret, GsonUtil extra) { } }); break; - case R.id.tv_token_name: + case R.id.tv_token_name: Intent intent = new Intent(TokenTransferActivity.this, ChooseTokenTransferActivity.class); TokenTransferActivity.this.startActivityForResult(intent, 0); } @@ -195,7 +192,7 @@ public void authPwd(String tag, boolean result) { if (result) { pwdRight(); } else { - ToastUtil.toast(TokenTransferActivity.this, "密码错误,请重新确认订单,并输入正确密码"); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_order_password_incorrect)); } } } @@ -218,7 +215,7 @@ public void onRequesResult(int ret, GsonUtil json) { if (ret == 0) { long sequence = json.getLong("sequence", 0); if (sequence <= 0) { - ToastUtil.toast(TokenTransferActivity.this, "转账失败, 错误码:" + 1002); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_transfer_failed) + 1002); } else { GsonUtil dataList = json.getArray("balances", "[]"); int len = dataList.getLength(); @@ -230,7 +227,7 @@ public void onRequesResult(int ret, GsonUtil json) { double value = item.getDouble("value", 0.0f); if (value < mAmount) { resetTranferBtn(); - ToastUtil.toast(TokenTransferActivity.this, "余额不足,转账失败:" + 1003); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_insufficient_balance) + 1003); return; } signedSwtTransaction(mGas, sequence, mWalletData.waddress, @@ -242,7 +239,7 @@ public void onRequesResult(int ret, GsonUtil json) { } else { resetTranferBtn(); - ToastUtil.toast(TokenTransferActivity.this, "转账失败, 错误码:" + 1001); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_transfer_failed) + 1001); } } }); @@ -268,7 +265,7 @@ public void onGetWResult(int ret, GsonUtil extra) { sendSignedTransaction(rawTransaction); } else { resetTranferBtn(); - ToastUtil.toast(TokenTransferActivity.this, "转账失败,错误码:" + 6); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_transfer_failed) + 6); } } }); @@ -278,7 +275,7 @@ public void onGetWResult(int ret, GsonUtil extra) { private void sendSignedTransaction(String rawTransaction) { if (TextUtils.isEmpty(rawTransaction)) { resetTranferBtn(); - ToastUtil.toast(TokenTransferActivity.this, "转账失败,错误码:" + 3); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_transfer_failed) + 3); return; } mWalletUtil.sendSignedTransaction(rawTransaction, new WCallback() { @@ -286,11 +283,11 @@ private void sendSignedTransaction(String rawTransaction) { public void onGetWResult(int ret, GsonUtil extra) { if (ret == 0) { resetTranferBtn(); - ToastUtil.toast(TokenTransferActivity.this, "转账成功"); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_transfer_success)); TokenTransferActivity.this.finish(); } else { resetTranferBtn(); - ToastUtil.toast(TokenTransferActivity.this, "转账失败,错误码:" + 4); + ToastUtil.toast(TokenTransferActivity.this, getString(R.string.toast_transfer_failed) + 4); } } }); @@ -302,27 +299,27 @@ private boolean paramCheck() { String num = mEdtTransferNum.getText().toString(); if (TextUtils.isEmpty(mTvToken.getText().toString())) { - ViewUtil.showSysAlertDialog(this, "请选择代币", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_choose_token), "OK"); return false; } if (TextUtils.isEmpty(address)) { - ViewUtil.showSysAlertDialog(this, "输入或粘贴钱包地址", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_wallet_address), "OK"); return false; } if (TextUtils.equals(address, mWalletData.waddress)) { - ViewUtil.showSysAlertDialog(this, "收款钱包地址不能和转款钱包地址相同", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_receive_address_incorrect), "OK"); return false; } if (!mWalletUtil.checkWalletAddress(address)) { - ViewUtil.showSysAlertDialog(this, "钱包地址格式不正确", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_address_format_incorrect), "OK"); return false; } if ((TextUtils.isEmpty(num) || Util.parseDouble(num) <= 0.0f)) { - ViewUtil.showSysAlertDialog(this, "输入正确的转出数量", "OK"); + ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_amount_incorrect), "OK"); return false; } return true; @@ -330,12 +327,12 @@ private boolean paramCheck() { private void updateBtnToTranferingState() { mBtnNext.setEnabled(false); - mBtnNext.setText("正在转账..."); + mBtnNext.setText(getString(R.string.btn_transferring)); } private void resetTranferBtn() { mBtnNext.setEnabled(true); - mBtnNext.setText("下一步"); + mBtnNext.setText(getString(R.string.btn_next)); } /** diff --git a/app/src/main/java/com/tokenbank/activity/TransactionDetailsActivity.java b/app/src/main/java/com/tokenbank/activity/TransactionDetailsActivity.java index 6e0f388..e648b48 100755 --- a/app/src/main/java/com/tokenbank/activity/TransactionDetailsActivity.java +++ b/app/src/main/java/com/tokenbank/activity/TransactionDetailsActivity.java @@ -53,7 +53,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { } mHash = transactionData.getString("hash", ""); if (TextUtils.isEmpty(mHash)) { - ToastUtil.toast(TransactionDetailsActivity.this, "参数非法"); + ToastUtil.toast(TransactionDetailsActivity.this, getString(R.string.toast_illegal_parameters)); this.finish(); return; } @@ -71,7 +71,7 @@ private void initView() { mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("交易详情"); + mTitleBar.setTitle(getString(R.string.titleBar_transaction_details)); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { @@ -117,15 +117,15 @@ private void updateData(GsonUtil transactionInfo) { int status = transactionInfo.getInt("txreceipt_status", 5); if (status == 1) { //success - mTvTransactionStatus.setText("交易成功"); + mTvTransactionStatus.setText(getString(R.string.content_trading_success)); } else if (status == 2) { //pending - mTvTransactionStatus.setText("交易打包中"); + mTvTransactionStatus.setText(getString(R.string.content_trading_pending)); } else if (status == 0) { //fail - mTvTransactionStatus.setText("交易失败"); + mTvTransactionStatus.setText(getString(R.string.content_trading_failure)); } else { - mTvTransactionStatus.setText("状态未知,请点击交易号查询"); + mTvTransactionStatus.setText(getString(R.string.content_trading_unknown)); } mTvCount.setText(value + ""); mTvSymbol.setText(transactionInfo.getString("tokenSymbol", "")); @@ -139,7 +139,8 @@ public void onGetWResult(int ret, GsonUtil extra) { if (ret == 0) { updateData(extra.getObject("data", "{}")); } else { - ToastUtil.toast(TransactionDetailsActivity.this, "获取交易信息失败,请稍后重试"); + ToastUtil.toast(TransactionDetailsActivity.this, getString(R.string.toast_transaction_info_failure)) + ; TransactionDetailsActivity.this.finish(); } } @@ -167,15 +168,17 @@ public void onClick(View v) { if (v == mTvCopyUrl) { Util.clipboard(TransactionDetailsActivity.this, "", mWalletUtil.getTransactionSearchUrl(mTvTransactionId.getText().toString())); - ToastUtil.toast(TransactionDetailsActivity.this, "查询url已经复制到剪贴板"); + ToastUtil.toast(TransactionDetailsActivity.this, getString(R.string.toast_url_copied)); } else if (v == mTvSender) { Util.clipboard(TransactionDetailsActivity.this, "", mTvSender.getText().toString()); - ToastUtil.toast(TransactionDetailsActivity.this, "发送方地址已经复制到剪贴板"); + ToastUtil.toast(TransactionDetailsActivity.this, getString(R.string.toast_send_address_copied)) + ; } else if (v == mTvReceiver) { Util.clipboard(TransactionDetailsActivity.this, "", mTvReceiver.getText().toString()); - ToastUtil.toast(TransactionDetailsActivity.this, "收款地址已经复制到剪贴板"); + ToastUtil.toast(TransactionDetailsActivity.this, getString(R.string.toast_receive_address_copied)) + ; } else if (v == mTvTransactionId) { - WebBrowserActivity.startWebBrowserActivity(TransactionDetailsActivity.this, "交易查询", + WebBrowserActivity.startWebBrowserActivity(TransactionDetailsActivity.this, getString(R.string.titleBar_transaction_query), mWalletUtil.getTransactionSearchUrl(mTvTransactionId.getText().toString())); } } diff --git a/app/src/main/java/com/tokenbank/activity/TransactionRecordActivity.java b/app/src/main/java/com/tokenbank/activity/TransactionRecordActivity.java index 13d4acc..e249eaa 100755 --- a/app/src/main/java/com/tokenbank/activity/TransactionRecordActivity.java +++ b/app/src/main/java/com/tokenbank/activity/TransactionRecordActivity.java @@ -67,7 +67,7 @@ protected void onResume() { mSwipeRefreshLayout.setRefreshing(true); } if (mFrom == 1) { - mTitleBar.setTitle("消息中心"); + mTitleBar.setTitle(getString(R.string.titleBar_message_center)); } else { mTitleBar.setTitle(WalletInfoManager.getInstance().getWname()); diff --git a/app/src/main/java/com/tokenbank/base/WalletInfoManager.java b/app/src/main/java/com/tokenbank/base/WalletInfoManager.java index 7278387..6a3904c 100755 --- a/app/src/main/java/com/tokenbank/base/WalletInfoManager.java +++ b/app/src/main/java/com/tokenbank/base/WalletInfoManager.java @@ -3,6 +3,7 @@ import android.content.Context; import android.text.TextUtils; +import com.tokenbank.R; import com.tokenbank.activity.SplashActivity; import com.tokenbank.config.AppConfig; import com.tokenbank.config.Constant; @@ -401,7 +402,7 @@ private void updateWalletDefaultSp(WData wallet) { TextUtils.isEmpty(wallet.wpk) || wallet.wid <= 0 || wallet.type <= 0) { - ToastUtil.toast(AppConfig.getContext(), "更新默认钱包失败"); + ToastUtil.toast(AppConfig.getContext(), AppConfig.getContext().getString(R.string.toast_update_default_wallet_failed)); return; } FileUtil.putIntToSp(AppConfig.getContext(), Constant.wallet_def_file, Constant.wtype, wallet.type); diff --git a/app/src/main/java/com/tokenbank/dialog/PKDialog.java b/app/src/main/java/com/tokenbank/dialog/PKDialog.java index 4e13673..bbc4c56 100755 --- a/app/src/main/java/com/tokenbank/dialog/PKDialog.java +++ b/app/src/main/java/com/tokenbank/dialog/PKDialog.java @@ -13,7 +13,7 @@ import com.tokenbank.utils.Util; -public class PKDialog extends BaseDialog implements View.OnClickListener{ +public class PKDialog extends BaseDialog implements View.OnClickListener { private final static String TAG = "PKDialog"; @@ -43,7 +43,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onClick(View view) { - if(view == mTvCopyPrivateKey) { + if (view == mTvCopyPrivateKey) { copyPrivateKey(); dismiss(); } @@ -59,7 +59,7 @@ private void initView() { } private void copyPrivateKey() { - Util.clipboard(getContext(),"", mTvPrivateKey.getText().toString()); - ToastUtil.toast(getContext(), "私钥已经复制到剪贴板"); + Util.clipboard(getContext(), "", mTvPrivateKey.getText().toString()); + ToastUtil.toast(getContext(), getContext().getString(R.string.toast_private_key_copied)); } } diff --git a/app/src/main/java/com/tokenbank/fragment/MainUserFragment.java b/app/src/main/java/com/tokenbank/fragment/MainUserFragment.java index 530541a..5d785e9 100755 --- a/app/src/main/java/com/tokenbank/fragment/MainUserFragment.java +++ b/app/src/main/java/com/tokenbank/fragment/MainUserFragment.java @@ -9,6 +9,7 @@ import com.tokenbank.R; import com.tokenbank.activity.AboutActivity; +import com.tokenbank.activity.LanguageActivity; import com.tokenbank.activity.ManageWalletActivity; import com.tokenbank.activity.TransactionRecordActivity; import com.tokenbank.activity.WebBrowserActivity; @@ -19,9 +20,10 @@ public class MainUserFragment extends BaseFragment implements View.OnClickListen private RelativeLayout mLayoutManageWallet; private RelativeLayout mLayoutRecordTransaction; - private RelativeLayout mLayoutNotifcation; + private RelativeLayout mLayoutNotification; private RelativeLayout mLayoutHelp; private RelativeLayout mLayoutAbout; + private RelativeLayout mLayoutLanguage; public static MainUserFragment newInstance() { Bundle args = new Bundle(); @@ -42,19 +44,37 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { initView(view); } + @Override + public void onResume() { + super.onResume(); + mLayoutManageWallet.setClickable(true); + mLayoutRecordTransaction.setClickable(true); + mLayoutNotification.setClickable(true); + mLayoutHelp.setClickable(true); + mLayoutAbout.setClickable(true); + mLayoutLanguage.setClickable(true); + } @Override public void onClick(View view) { if (view == mLayoutManageWallet) { + mLayoutManageWallet.setClickable(false); ManageWalletActivity.startModifyWalletActivity(getActivity()); } else if (view == mLayoutRecordTransaction) { + mLayoutRecordTransaction.setClickable(false); TransactionRecordActivity.startTransactionRecordActivity(getActivity(), 2); - } else if (view == mLayoutNotifcation) { + } else if (view == mLayoutNotification) { + mLayoutNotification.setClickable(false); TransactionRecordActivity.startTransactionRecordActivity(getActivity(), 1); } else if (view == mLayoutHelp) { - WebBrowserActivity.startWebBrowserActivity(getActivity(), "帮助中心", Constant.help_url); + mLayoutHelp.setClickable(false); + WebBrowserActivity.startWebBrowserActivity(getActivity(), getString(R.string.titleBar_help_center), Constant.help_url); } else if (view == mLayoutAbout) { + mLayoutAbout.setClickable(false); AboutActivity.startAboutActivity(getActivity()); + } else if (view == mLayoutLanguage) { + mLayoutLanguage.setClickable(false); + LanguageActivity.startLanguageActivity(getActivity()); } } @@ -62,15 +82,17 @@ private void initView(View view) { mLayoutManageWallet = view.findViewById(R.id.layout_manage_wallet); mLayoutRecordTransaction = view.findViewById(R.id.layout_transaction_record); - mLayoutNotifcation = view.findViewById(R.id.layout_notication); + mLayoutNotification = view.findViewById(R.id.layout_notication); mLayoutHelp = view.findViewById(R.id.layout_help); mLayoutAbout = view.findViewById(R.id.layout_about); + mLayoutLanguage = view.findViewById(R.id.layout_language); mLayoutManageWallet.setOnClickListener(this); mLayoutRecordTransaction.setOnClickListener(this); - mLayoutNotifcation.setOnClickListener(this); + mLayoutNotification.setOnClickListener(this); mLayoutHelp.setOnClickListener(this); mLayoutAbout.setOnClickListener(this); + mLayoutLanguage.setOnClickListener(this); } } diff --git a/app/src/main/java/com/tokenbank/fragment/MainWalletFragment.java b/app/src/main/java/com/tokenbank/fragment/MainWalletFragment.java index 00400f6..c65859e 100755 --- a/app/src/main/java/com/tokenbank/fragment/MainWalletFragment.java +++ b/app/src/main/java/com/tokenbank/fragment/MainWalletFragment.java @@ -151,7 +151,7 @@ public void onResume() { @Override public void onClick(View view) { if (!NetUtil.isNetworkAvailable(getActivity())) { - ToastUtil.toast(getContext(), "网络未连接,请检查网络"); + ToastUtil.toast(getContext(), getString(R.string.toast_no_network)); return; } switch (view.getId()) { @@ -183,16 +183,16 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { //扫描到地址 String scanResult = data.getStringExtra("result"); if (TextUtils.isEmpty(scanResult)) { - ToastUtil.toast(getContext(), "扫描错误"); + ToastUtil.toast(getContext(), getString(R.string.toast_scan_failure)); } else { if (scanResult.startsWith("iban")) { //eth - ToastUtil.toast(getContext(), "当前不支持以太钱包"); + ToastUtil.toast(getContext(), getString(R.string.toast_not_support_eth_wallet)); } else if (scanResult.startsWith("jingtum")) { //swt handleSwtScanResult(scanResult); } else { - ToastUtil.toast(getContext(), "扫描错误"); + ToastUtil.toast(getContext(), getString(R.string.toast_scan_failure)); } } } @@ -202,7 +202,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { private void handleSwtScanResult(final String scanResult) { if (!WalletInfoManager.getInstance().hasWallet(TBController.SWT_INDEX)) { - ToastUtil.toast(getContext(), "当前没有井通,请创建钱包,再扫描"); + ToastUtil.toast(getContext(), getString(R.string.toast_no_jintum_wallet)); return; } if (WalletInfoManager.getInstance().getWalletType() == TBController.SWT_INDEX) { @@ -214,13 +214,13 @@ private void handleSwtScanResult(final String scanResult) { TokenTransferActivity.startTokenTransferActivity(getContext(), ibanAddress, "", num, token, 0, 0); } else { - ViewUtil.showSysAlertDialog(getContext(), "提示", "扫描到的地址为井通地址,但是当前钱包为非井通钱包,是否切换成井通钱包?", - "不切换", new DialogInterface.OnClickListener() { + ViewUtil.showSysAlertDialog(getContext(), getString(R.string.dialog_title_reminder), getString(R.string.dialog_content_switch_jintum_wallet), + getString(R.string.dialog_btn_not_switch), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } - }, "立即切换", new DialogInterface.OnClickListener() { + }, getString(R.string.dialog_btn_switch), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (WalletInfoManager.getInstance().setCurrentWallet(TBController.SWT_INDEX)) { @@ -313,7 +313,7 @@ public void onDataLoadingFinish(K params, boolean end, boolean loadmore) { } private void update() { - mTvWalletUnit.setText(String.format("我的资产")); + mTvWalletUnit.setText(String.format(getString(R.string.content_my_asset))); setWalletName(); } diff --git a/app/src/main/java/com/tokenbank/fragment/PKFragment.java b/app/src/main/java/com/tokenbank/fragment/PKFragment.java index e05f6d2..b58d7f8 100755 --- a/app/src/main/java/com/tokenbank/fragment/PKFragment.java +++ b/app/src/main/java/com/tokenbank/fragment/PKFragment.java @@ -119,7 +119,7 @@ private void initView(View view) { mImgboxTerms.setOnClickListener(this); mTvTerms = view.findViewById(R.id.tv_service_terms); - mTvTerms.setText(Html.fromHtml("我已经仔细阅读并同意服务及隐私条款")); + mTvTerms.setText(Html.fromHtml(getString(R.string.content_read_service))); mTvTerms.setOnClickListener(this); mTvImportWallet = view.findViewById(R.id.tv_import_wallet); @@ -137,7 +137,7 @@ private void checkPrivateKey() { } private void gotoServiceTermPage() { - WebBrowserActivity.startWebBrowserActivity(getActivity(), "用户使用协议", Constant.service_term_url); + WebBrowserActivity.startWebBrowserActivity(getActivity(), getString(R.string.titleBar_user_agreement), Constant.service_term_url); } private boolean paramCheck() { @@ -147,38 +147,38 @@ private boolean paramCheck() { String walletName = mEdtWalletName.getText().toString(); boolean readedTerms = mImgboxTerms.isSelected(); if (TextUtils.isEmpty(walletName)) { - ViewUtil.showSysAlertDialog(getActivity(), "请输入钱包名字", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.enter_hint_wallet_name), "OK"); return false; } if (TextUtils.isEmpty(walletPrivateKey)) { - ViewUtil.showSysAlertDialog(getActivity(), "私钥不能为空", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_title_no_private_key), "OK"); return false; } if (!walletblockchain.checkWalletPk(walletPrivateKey)) { - ViewUtil.showSysAlertDialog(getActivity(), "私钥格式错误", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_title_key_format_incorrect), "OK"); return false; } if (TextUtils.isEmpty(walletPwd)) { - ViewUtil.showSysAlertDialog(getActivity(), "密码不能为空", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_no_password), "OK"); return false; } if (TextUtils.isEmpty(walletPwdRepeat)) { - ViewUtil.showSysAlertDialog(getActivity(), "密码重复不能为空", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_no_verify_password), "OK"); return false; } if (!TextUtils.equals(walletPwdRepeat, walletPwd)) { - ViewUtil.showSysAlertDialog(getActivity(), "两次密码不同,请重新输入", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_passwords_unmatch), "OK"); return false; } if (walletPwd.length() < 8) { - ViewUtil.showSysAlertDialog(getActivity(), "密码长度不能小于8位", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_short_password), "OK"); return false; } if (!readedTerms) { - ViewUtil.showSysAlertDialog(getActivity(), "您尚未阅读并同意服务和隐私条款", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_no_read_service), "OK"); return false; } return true; @@ -195,7 +195,7 @@ public void onGetWResult(int ret, GsonUtil extra) { if (isWalletExsit(address)) { if (flag == 1) { //导入钱包 - ToastUtil.toast(getActivity(), "钱包已经存在,不需要导入"); + ToastUtil.toast(getActivity(), getString(R.string.toast_wallet_exists)); return; } else if (flag == 2) { //重置密码 @@ -207,7 +207,7 @@ public void onGetWResult(int ret, GsonUtil extra) { uploadWallet(mEdtWalletName.getText().toString(), extra.getInt("blockType", -1), FileUtil.getStringContent(password), privateKey, address); } else { - ToastUtil.toast(getActivity(), "导入钱包失败"); + ToastUtil.toast(getActivity(), getString(R.string.toast_import_wallet_failed)); } } }); @@ -241,7 +241,7 @@ private void storeWallet(long walletId, int walletType, String walletName, Strin } private void gotoPrivateKeyIntroPage() { - WebBrowserActivity.startWebBrowserActivity(getActivity(), "私钥", Constant.privatekey_intro_url); + WebBrowserActivity.startWebBrowserActivity(getActivity(), getString(R.string.titleBar_private_key), Constant.privatekey_intro_url); } private boolean isWalletExsit(String address) { diff --git a/app/src/main/java/com/tokenbank/fragment/WordsFragment.java b/app/src/main/java/com/tokenbank/fragment/WordsFragment.java index 634d627..a1578a3 100755 --- a/app/src/main/java/com/tokenbank/fragment/WordsFragment.java +++ b/app/src/main/java/com/tokenbank/fragment/WordsFragment.java @@ -117,7 +117,7 @@ private void initView(View view) { mImgboxTerms.setOnClickListener(this); mTvTerms = view.findViewById(R.id.tv_service_terms); - mTvTerms.setText(Html.fromHtml("我已经仔细阅读并同意服务及隐私条款")); + mTvTerms.setText(Html.fromHtml(getString(R.string.content_read_service))); mTvTerms.setOnClickListener(this); mTvImportWallet = view.findViewById(R.id.tv_import_wallet); @@ -129,7 +129,7 @@ private void initView(View view) { } private void gotoServiceTermPage() { - WebBrowserActivity.startWebBrowserActivity(getActivity(), "用户服务协议", Constant.service_term_url); + WebBrowserActivity.startWebBrowserActivity(getActivity(), getString(R.string.titleBar_user_agreement), Constant.service_term_url); } private boolean paramCheck() { @@ -139,33 +139,33 @@ private boolean paramCheck() { String walletName = mEdtWalletName.getText().toString(); boolean readedTerms = mImgboxTerms.isSelected(); if (TextUtils.isEmpty(walletName)) { - ViewUtil.showSysAlertDialog(getActivity(), "请输入钱包名字", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.enter_hint_wallet_name), "OK"); return false; } if (TextUtils.isEmpty(walletWords) || walletWords.split(" ") == null || walletWords.split(" ").length < 12) { - ViewUtil.showSysAlertDialog(getActivity(), "助记词不正确", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_title_mnemonic_incorrect), "OK"); return false; } if (TextUtils.isEmpty(walletPwd)) { - ViewUtil.showSysAlertDialog(getActivity(), "密码不能为空", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_no_password), "OK"); return false; } if (TextUtils.isEmpty(walletPwdRepeat)) { - ViewUtil.showSysAlertDialog(getActivity(), "密码重复不能为空", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_no_verify_password), "OK"); return false; } if (!TextUtils.equals(walletPwdRepeat, walletPwd)) { - ViewUtil.showSysAlertDialog(getActivity(), "两次密码不同,请重新输入", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_passwords_unmatch), "OK"); return false; } if (walletPwd.length() < 8) { - ViewUtil.showSysAlertDialog(getActivity(), "密码长度不能小于8位", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_short_password), "OK"); return false; } if (!readedTerms) { - ViewUtil.showSysAlertDialog(getActivity(), "您尚未阅读并同意服务和隐私条款", "OK"); + ViewUtil.showSysAlertDialog(getActivity(), getString(R.string.dialog_content_no_read_service), "OK"); return false; } return true; @@ -183,7 +183,7 @@ public void onGetWResult(int ret, GsonUtil extra) { if (isWalletExsit(address)) { if (flag == 1) { //导入钱包 - ToastUtil.toast(getActivity(), "钱包已经存在,不需要导入"); + ToastUtil.toast(getActivity(), getString(R.string.toast_wallet_exists)); return; } else if (flag == 2) { //重置密码 @@ -195,7 +195,7 @@ public void onGetWResult(int ret, GsonUtil extra) { uploadWallet(mEdtWalletName.getText().toString(), extra.getInt("blockType", -1), FileUtil.getStringContent(password), privateKey, address); } else { - ToastUtil.toast(getActivity(), "导入钱包失败"); + ToastUtil.toast(getActivity(), getString(R.string.toast_import_wallet_failed)); } } }); diff --git a/app/src/main/java/com/tokenbank/net/apirequest/ApiRequest.java b/app/src/main/java/com/tokenbank/net/apirequest/ApiRequest.java index c3e6080..01f2130 100755 --- a/app/src/main/java/com/tokenbank/net/apirequest/ApiRequest.java +++ b/app/src/main/java/com/tokenbank/net/apirequest/ApiRequest.java @@ -4,6 +4,7 @@ import com.android.volley.Response; import com.android.volley.VolleyError; +import com.tokenbank.R; import com.tokenbank.config.AppConfig; import com.tokenbank.net.NetManager; import com.tokenbank.net.volleyext.BaseJsonRequest; @@ -97,13 +98,13 @@ public void onResponse(String s) { @Override public void onErrorResponse(VolleyError volleyError) { TLog.d(TAG, "RxJava request Exception = " + volleyError); - String errMsg = "网络错误"; + String errMsg = AppConfig.getContext().getString(R.string.content_network_err); int errCode = AppConfig.ERR_CODE.NETWORK_ERR; if (volleyError != null && volleyError.networkResponse != null) { errCode = volleyError.networkResponse.statusCode; errMsg = volleyError.toString(); } - subscriber.onError(new Throwable(errMsg + ",错误码:" + errCode)); + subscriber.onError(new Throwable(errMsg + AppConfig.getContext().getString(R.string.content_error_code) + errCode)); } }); request.setShouldCache(shouldCache); diff --git a/app/src/main/java/com/tokenbank/utils/LanguageUtil.java b/app/src/main/java/com/tokenbank/utils/LanguageUtil.java new file mode 100644 index 0000000..cfd833b --- /dev/null +++ b/app/src/main/java/com/tokenbank/utils/LanguageUtil.java @@ -0,0 +1,144 @@ +package com.tokenbank.utils; + +import android.content.Context; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.content.res.Resources; +import android.os.Build; +import android.os.LocaleList; +import android.text.TextUtils; +import android.util.DisplayMetrics; + +import org.greenrobot.eventbus.EventBus; + +import java.util.List; +import java.util.Locale; + +public class LanguageUtil { + private static final String TAG = "LanguageUtil"; + + /** + * language key + */ + private static final String LANGUAGE = "LANGUAGE"; + + /** + * select key + */ + private static final String SELECT = "SELECT"; + + /** + *  get user language + *  @param pContext + *  @return Locale + */ + public static Locale getUserLocale(Context pContext) { + String fileName = pContext.getPackageName() + "_" + "LANGUAGE"; + SharedPreferences preferences = pContext.getSharedPreferences(fileName, Context.MODE_PRIVATE); + String select = preferences.getString(SELECT, "auto"); + if (TextUtils.equals(select, "auto")) { + Locale locale; + Configuration configuration = Resources.getSystem().getConfiguration(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + locale = configuration.getLocales().get(0); + } else { + locale = configuration.locale; + } + return locale; + } + String localeLan = preferences.getString(LANGUAGE, Locale.getDefault().getLanguage()); + return new Locale(localeLan); + } + + /** + *  get user language + *  @param pContext + *  @return Locale + */ + public static String getUserSelect(Context pContext) { + String fileName = pContext.getPackageName() + "_" + "LANGUAGE"; + SharedPreferences preferences = pContext.getSharedPreferences(fileName, Context.MODE_PRIVATE); + String select = preferences.getString(SELECT, "auto"); + return select; + } + + /** + * get app language + * + * @param pContext + * @return Locale + *     + */ + public static Locale getCurrentLocale(Context pContext) { + Locale Locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + Locale = pContext.getResources().getConfiguration().getLocales().get(0); + } else { + Locale = pContext.getResources().getConfiguration().locale; + } + return Locale; + } + + /** + * save the language + * + * @param pContext + * @param pUserLocale     + */ + public static void saveUserLocale(Context pContext, Locale pUserLocale) { + String fileName = pContext.getPackageName() + "_" + LANGUAGE; + SharedPreferences preferences = pContext.getSharedPreferences(fileName, Context.MODE_PRIVATE); + SharedPreferences.Editor Edit = preferences.edit(); + Edit.putString(LANGUAGE, pUserLocale.getLanguage()); + Edit.apply(); + if (needUpdateLocale(pContext, pUserLocale)) { + EventBus.getDefault().post("EVENT_REFRESH_LANGUAGE"); + } + } + + /** + * save the select + * + * @param pContext + * @param pSelect     + */ + public static void saveUserSelect(Context pContext, String pSelect) { + String fileName = pContext.getPackageName() + "_" + LANGUAGE; + SharedPreferences preferences = pContext.getSharedPreferences(fileName, Context.MODE_PRIVATE); + SharedPreferences.Editor Edit = preferences.edit(); + Edit.putString(SELECT, pSelect); + Edit.apply(); + } + + /** + * change language + * + * @param pContext + * @param pNewUserLocale     + */ + public static Context updateLocale(Context pContext, Locale pNewUserLocale) { + Context updateContext; + Configuration configuration = pContext.getResources().getConfiguration(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + configuration.setLocale(pNewUserLocale); + updateContext = pContext.createConfigurationContext(configuration); + } else { + configuration.locale = pNewUserLocale; + updateContext = pContext; + } + pContext.getResources().updateConfiguration(configuration, pContext.getResources().getDisplayMetrics()); + return updateContext; + } + + /** + * need change or not + * + * @param pContext + * @param pNewUserLocale + * @return true / false + *     + */ + public static boolean needUpdateLocale(Context pContext, Locale pNewUserLocale) { + return pNewUserLocale != null && !TextUtils.equals(getCurrentLocale(pContext).getLanguage(), pNewUserLocale.getLanguage()); + } +} diff --git a/app/src/main/java/com/tokenbank/utils/PermissionUtil.java b/app/src/main/java/com/tokenbank/utils/PermissionUtil.java index 419e749..d060af9 100755 --- a/app/src/main/java/com/tokenbank/utils/PermissionUtil.java +++ b/app/src/main/java/com/tokenbank/utils/PermissionUtil.java @@ -14,6 +14,8 @@ import android.text.TextUtils; +import com.tokenbank.R; + import java.util.ArrayList; public class PermissionUtil { @@ -220,7 +222,7 @@ public static void doWithPermissionChecked(Activity activity, String[] permissio public static void showPermSetDialog(final Activity activity, final boolean needFinish, String... permissions) { StringBuilder tips = new StringBuilder(); - tips.append("需要以下权限:"); + tips.append(activity.getString(R.string.dialog_content_require_permissions)); for (int i = 0; i < permissions.length; ++i) { tips.append(getPermissionTip(activity, permissions[i])); @@ -229,13 +231,13 @@ public static void showPermSetDialog(final Activity activity, final boolean need } } - ViewUtil.showSysAlertDialog(activity, "提示", tips.toString(), "取消", new DialogInterface.OnClickListener() { + ViewUtil.showSysAlertDialog(activity, activity.getString(R.string.dialog_title_reminder), tips.toString(), activity.getString(R.string.dialog_btn_cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); activity.finish(); } - }, "去设置", new DialogInterface.OnClickListener() { + }, activity.getString(R.string.dialog_btn_setting), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); @@ -251,15 +253,15 @@ public static String getPermissionTip(Context context, String permission) { return var2; } else { if ("android.permission.CAMERA".equals(permission)) { - var2 = "照相机"; + var2 = context.getString(R.string.dialog_content_camera); } if ("android.permission.WRITE_EXTERNAL_STORAGE".equals(permission)) { - var2 = "SD卡"; + var2 = context.getString(R.string.dialog_content_sd_card); } if (Manifest.permission.READ_PHONE_STATE.equals(permission)) { - var2 = "手机状态"; + var2 = context.getString(R.string.dialog_content_phone_status); } return var2; diff --git a/app/src/main/java/com/tokenbank/utils/ToastUtil.java b/app/src/main/java/com/tokenbank/utils/ToastUtil.java index 6099b99..8c84eca 100755 --- a/app/src/main/java/com/tokenbank/utils/ToastUtil.java +++ b/app/src/main/java/com/tokenbank/utils/ToastUtil.java @@ -4,12 +4,14 @@ import android.text.TextUtils; import android.widget.Toast; +import com.tokenbank.R; + public class ToastUtil { public static void toast(Context context, String msg) { if (TextUtils.isEmpty(msg)) { - Toast.makeText(context, "空信息", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, context.getString(R.string.toast_no_messages), Toast.LENGTH_SHORT).show(); } Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/com/tokenbank/utils/ViewUtil.java b/app/src/main/java/com/tokenbank/utils/ViewUtil.java index 2f1ed1c..98e57c7 100755 --- a/app/src/main/java/com/tokenbank/utils/ViewUtil.java +++ b/app/src/main/java/com/tokenbank/utils/ViewUtil.java @@ -9,6 +9,7 @@ import android.view.View; import android.view.ViewGroup; +import com.tokenbank.R; import com.tokenbank.activity.StartBakupActivity; import com.tokenbank.base.WalletInfoManager; import com.tokenbank.dialog.PwdDialog; @@ -50,7 +51,7 @@ public static void showSysAlertDialog(Context context, String title, String mess } public static void showBakupDialog(final Context context, final WalletInfoManager.WData walletData, boolean canCancel, final boolean needVerifyPwd, final String pwdHash) { - final WarnDialog warnDialog = new WarnDialog(context, "为了您的钱包安全,请备份钱包", "立即备份", canCancel, + final WarnDialog warnDialog = new WarnDialog(context, context.getString(R.string.dialog_content_wallet_security), context.getString(R.string.dialog_btn_backup), canCancel, new WarnDialog.OnConfirmClickListener() { @Override public void onConfirmClick(final Dialog dialog, View view) { @@ -69,7 +70,7 @@ public void authPwd(String tag, boolean result) { } dialog.dismiss(); } else { - ToastUtil.toast(context, "密码错误"); + ToastUtil.toast(context, context.getString(R.string.toast_password_incorrect)); } } }, pwdHash, ""); diff --git a/app/src/main/java/com/tokenbank/view/TitleBar.java b/app/src/main/java/com/tokenbank/view/TitleBar.java index 3dfa1b1..dd5d7ae 100755 --- a/app/src/main/java/com/tokenbank/view/TitleBar.java +++ b/app/src/main/java/com/tokenbank/view/TitleBar.java @@ -14,7 +14,6 @@ import com.tokenbank.utils.ViewUtil; - public class TitleBar extends LinearLayout implements View.OnClickListener { private TextView mTvLeft; private TextView mTvTitle; @@ -72,18 +71,18 @@ protected void onFinishInflate() { super.onFinishInflate(); View view = ViewUtil.inflatView(getContext(), this, R.layout.layout_view_titlebar, true); mTvLeft = view.findViewById(R.id.tv_left); - mLayoutLeft = view.findViewById(R.id.layout_left); - mImgLeft = view.findViewById(R.id.img_left); + mLayoutLeft = view.findViewById(R.id.layout_left); + mImgLeft = view.findViewById(R.id.img_left); mLayoutLeft.setOnClickListener(this); - mTvTitle = view.findViewById(R.id.tv_title); - mLayoutTitle = view.findViewById(R.id.layout_title); - mImgTitle = view.findViewById(R.id.img_title); + mTvTitle = view.findViewById(R.id.tv_title); + mLayoutTitle = view.findViewById(R.id.layout_title); + mImgTitle = view.findViewById(R.id.img_title); mLayoutTitle.setOnClickListener(this); - mTvRight = view.findViewById(R.id.tv_right); - mLayoutRight = view.findViewById(R.id.layout_right); - mImgRight = view.findViewById(R.id.img_right); + mTvRight = view.findViewById(R.id.tv_right); + mLayoutRight = view.findViewById(R.id.layout_right); + mImgRight = view.findViewById(R.id.img_right); mLayoutRight.setOnClickListener(this); mViewSplit = view.findViewById(R.id.view_split); diff --git a/app/src/main/java/com/zxing/activity/CaptureActivity.java b/app/src/main/java/com/zxing/activity/CaptureActivity.java index 260f6c6..38fa056 100755 --- a/app/src/main/java/com/zxing/activity/CaptureActivity.java +++ b/app/src/main/java/com/zxing/activity/CaptureActivity.java @@ -76,7 +76,7 @@ public void onCreate(Bundle savedInstanceState) { TitleBar mTitleBar = findViewById(R.id.title_bar); mTitleBar.setLeftDrawable(R.drawable.ic_back); - mTitleBar.setTitle("扫描"); + mTitleBar.setTitle(getString(R.string.titleBar_scan)); mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() { @Override public void onLeftClick(View view) { @@ -119,7 +119,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { cursor.close(); mProgress = new ProgressDialog(CaptureActivity.this); - mProgress.setMessage("正在扫描..."); + mProgress.setMessage(getString(R.string.dialog_content_scanning)); mProgress.setCancelable(false); mProgress.show(); diff --git a/app/src/main/res/color/selector_tvadd_token_txtcolor.xml b/app/src/main/res/color/selector_tvadd_token_txtcolor.xml deleted file mode 100755 index 5a601ab..0000000 --- a/app/src/main/res/color/selector_tvadd_token_txtcolor.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/ic_about_us.png b/app/src/main/res/drawable-xxhdpi/ic_about_us.png old mode 100755 new mode 100644 index 57dd93f..993dd1d Binary files a/app/src/main/res/drawable-xxhdpi/ic_about_us.png and b/app/src/main/res/drawable-xxhdpi/ic_about_us.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_article_defaultcover.png b/app/src/main/res/drawable-xxhdpi/ic_article_defaultcover.png deleted file mode 100755 index d04b40b..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_article_defaultcover.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_asset_preview.png b/app/src/main/res/drawable-xxhdpi/ic_asset_preview.png deleted file mode 100755 index 7098767..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_asset_preview.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_circle_select.png b/app/src/main/res/drawable-xxhdpi/ic_circle_select.png deleted file mode 100755 index 2a12531..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_circle_select.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_circle_unselect.png b/app/src/main/res/drawable-xxhdpi/ic_circle_unselect.png deleted file mode 100755 index 682a3b9..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_circle_unselect.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_edit.png b/app/src/main/res/drawable-xxhdpi/ic_edit.png deleted file mode 100755 index b16bac3..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_edit.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_help.png b/app/src/main/res/drawable-xxhdpi/ic_help.png old mode 100755 new mode 100644 index 0e3e836..f485b63 Binary files a/app/src/main/res/drawable-xxhdpi/ic_help.png and b/app/src/main/res/drawable-xxhdpi/ic_help.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_asset_addasset.png b/app/src/main/res/drawable-xxhdpi/ic_images_asset_addasset.png deleted file mode 100755 index f5c7dea..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_asset_addasset.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_asset_menu.png b/app/src/main/res/drawable-xxhdpi/ic_images_asset_menu.png deleted file mode 100755 index 2afe1cd..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_asset_menu.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_asset_search.png b/app/src/main/res/drawable-xxhdpi/ic_images_asset_search.png deleted file mode 100755 index 321274b..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_asset_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_asset_sucess.png b/app/src/main/res/drawable-xxhdpi/ic_images_asset_sucess.png deleted file mode 100755 index 58d7070..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_asset_sucess.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_asset_walletaddress.png b/app/src/main/res/drawable-xxhdpi/ic_images_asset_walletaddress.png deleted file mode 100755 index 7c5cc8c..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_asset_walletaddress.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_arrow.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_arrow.png deleted file mode 100755 index 3069dac..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_arrow.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_checkbox_normal.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_checkbox_normal.png deleted file mode 100755 index 7c91d1e..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_checkbox_normal.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_checkbox_normal_disabled.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_checkbox_normal_disabled.png deleted file mode 100755 index 63f15eb..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_checkbox_normal_disabled.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_closedark.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_closedark.png deleted file mode 100755 index a5033a0..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_closedark.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_createwallet.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_createwallet.png deleted file mode 100755 index 35e369d..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_createwallet.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_delete.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_delete.png deleted file mode 100755 index 482104e..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_delete.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_help.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_help.png deleted file mode 100755 index 5159e06..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_help.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_newdark.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_newdark.png deleted file mode 100755 index aee78df..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_newdark.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_reload.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_reload.png deleted file mode 100755 index 794a6d4..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_reload.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_scan.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_scan.png deleted file mode 100755 index d688417..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_scan.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_common_search.png b/app/src/main/res/drawable-xxhdpi/ic_images_common_search.png deleted file mode 100755 index d8f03bb..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_common_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_profile_transaction.png b/app/src/main/res/drawable-xxhdpi/ic_images_profile_transaction.png deleted file mode 100755 index a1b4b9e..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_profile_transaction.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_profile_wallet.png b/app/src/main/res/drawable-xxhdpi/ic_images_profile_wallet.png deleted file mode 100755 index ae0ada0..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_profile_wallet.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_terms_checked_large.png b/app/src/main/res/drawable-xxhdpi/ic_images_terms_checked_large.png deleted file mode 100755 index 56ee612..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_terms_checked_large.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_terms_normal_large.png b/app/src/main/res/drawable-xxhdpi/ic_images_terms_normal_large.png deleted file mode 100755 index 6be5694..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_terms_normal_large.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_images_token_bg.png b/app/src/main/res/drawable-xxhdpi/ic_images_token_bg.png deleted file mode 100755 index e73ef82..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_images_token_bg.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_language.png b/app/src/main/res/drawable-xxhdpi/ic_language.png new file mode 100644 index 0000000..7a70ce3 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_language.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_manage_wallet.png b/app/src/main/res/drawable-xxhdpi/ic_manage_wallet.png deleted file mode 100755 index 6fb600d..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_manage_wallet.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_market_empty.png b/app/src/main/res/drawable-xxhdpi/ic_market_empty.png deleted file mode 100755 index 81e5153..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_market_empty.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_market_sort.png b/app/src/main/res/drawable-xxhdpi/ic_market_sort.png deleted file mode 100755 index d300ac9..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_market_sort.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_notification.png b/app/src/main/res/drawable-xxhdpi/ic_notification.png old mode 100755 new mode 100644 index 0316f41..75e5ef0 Binary files a/app/src/main/res/drawable-xxhdpi/ic_notification.png and b/app/src/main/res/drawable-xxhdpi/ic_notification.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_personal.png b/app/src/main/res/drawable-xxhdpi/ic_personal.png deleted file mode 100755 index ca9c590..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_personal.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_pop_item_add.png b/app/src/main/res/drawable-xxhdpi/ic_pop_item_add.png deleted file mode 100755 index c7b721c..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_pop_item_add.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_record.png b/app/src/main/res/drawable-xxhdpi/ic_record.png old mode 100755 new mode 100644 index 891c200..5f984bb Binary files a/app/src/main/res/drawable-xxhdpi/ic_record.png and b/app/src/main/res/drawable-xxhdpi/ic_record.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_scan.png b/app/src/main/res/drawable-xxhdpi/ic_scan.png deleted file mode 100755 index ce71f03..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_scan.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_search.png b/app/src/main/res/drawable-xxhdpi/ic_search.png deleted file mode 100755 index 18254f5..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_search.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_search_btn.png b/app/src/main/res/drawable-xxhdpi/ic_search_btn.png deleted file mode 100755 index 9adbddd..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_search_btn.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_search_market.png b/app/src/main/res/drawable-xxhdpi/ic_search_market.png deleted file mode 100755 index ff49e75..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_search_market.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_tab_find_selected.png b/app/src/main/res/drawable-xxhdpi/ic_tab_find_selected.png deleted file mode 100755 index a5f9833..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_tab_find_selected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_tab_find_unselected.png b/app/src/main/res/drawable-xxhdpi/ic_tab_find_unselected.png deleted file mode 100755 index 21d4963..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_tab_find_unselected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_tab_market_selected.png b/app/src/main/res/drawable-xxhdpi/ic_tab_market_selected.png deleted file mode 100755 index 79c279a..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_tab_market_selected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_tab_market_unselected.png b/app/src/main/res/drawable-xxhdpi/ic_tab_market_unselected.png deleted file mode 100755 index e251a62..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_tab_market_unselected.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_token_checked.png b/app/src/main/res/drawable-xxhdpi/ic_token_checked.png deleted file mode 100755 index f833e7c..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_token_checked.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_transaction_record.png b/app/src/main/res/drawable-xxhdpi/ic_transaction_record.png deleted file mode 100755 index d417012..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_transaction_record.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_wallet_manage.png b/app/src/main/res/drawable-xxhdpi/ic_wallet_manage.png old mode 100755 new mode 100644 index a9438f9..72beae4 Binary files a/app/src/main/res/drawable-xxhdpi/ic_wallet_manage.png and b/app/src/main/res/drawable-xxhdpi/ic_wallet_manage.png differ diff --git a/app/src/main/res/drawable-xxhdpi/instabug_fab_bg_normal.png b/app/src/main/res/drawable-xxhdpi/instabug_fab_bg_normal.png deleted file mode 100755 index c157df3..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/instabug_fab_bg_normal.png and /dev/null differ diff --git a/app/src/main/res/drawable/drawer_shadow.xml b/app/src/main/res/drawable/drawer_shadow.xml deleted file mode 100755 index e1d5bc5..0000000 --- a/app/src/main/res/drawable/drawer_shadow.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_info_black_24dp.xml b/app/src/main/res/drawable/ic_info_black_24dp.xml new file mode 100644 index 0000000..158e2a7 --- /dev/null +++ b/app/src/main/res/drawable/ic_info_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100755 index 3a37cf6..0000000 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml new file mode 100644 index 0000000..81db489 --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_sync_black_24dp.xml b/app/src/main/res/drawable/ic_sync_black_24dp.xml new file mode 100644 index 0000000..5ede6fb --- /dev/null +++ b/app/src/main/res/drawable/ic_sync_black_24dp.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ripple_bg.xml b/app/src/main/res/drawable/ripple_bg.xml deleted file mode 100755 index 62b9127..0000000 --- a/app/src/main/res/drawable/ripple_bg.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_guide_indicator_bg.xml b/app/src/main/res/drawable/selector_guide_indicator_bg.xml deleted file mode 100755 index d48dfb4..0000000 --- a/app/src/main/res/drawable/selector_guide_indicator_bg.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_market_itemstate.xml b/app/src/main/res/drawable/selector_market_itemstate.xml deleted file mode 100755 index fae26eb..0000000 --- a/app/src/main/res/drawable/selector_market_itemstate.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_terms_bg.xml b/app/src/main/res/drawable/selector_terms_bg.xml deleted file mode 100755 index 4f7515e..0000000 --- a/app/src/main/res/drawable/selector_terms_bg.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_tv_increase_bg.xml b/app/src/main/res/drawable/selector_tv_increase_bg.xml deleted file mode 100755 index e575439..0000000 --- a/app/src/main/res/drawable/selector_tv_increase_bg.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_tvadd_token.xml b/app/src/main/res/drawable/selector_tvadd_token.xml deleted file mode 100755 index ba53949..0000000 --- a/app/src/main/res/drawable/selector_tvadd_token.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_indicator_pointbg.xml b/app/src/main/res/drawable/shape_indicator_pointbg.xml deleted file mode 100755 index 40c3c2f..0000000 --- a/app/src/main/res/drawable/shape_indicator_pointbg.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_ripple.xml b/app/src/main/res/drawable/shape_ripple.xml deleted file mode 100755 index 84ee4d4..0000000 --- a/app/src/main/res/drawable/shape_ripple.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_search_bg.xml b/app/src/main/res/drawable/shape_search_bg.xml deleted file mode 100755 index 1d29d1d..0000000 --- a/app/src/main/res/drawable/shape_search_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_startbtn_bg.xml b/app/src/main/res/drawable/shape_startbtn_bg.xml deleted file mode 100755 index 208d14c..0000000 --- a/app/src/main/res/drawable/shape_startbtn_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/term_checkbox_bg.xml b/app/src/main/res/drawable/term_checkbox_bg.xml deleted file mode 100755 index 46e7441..0000000 --- a/app/src/main/res/drawable/term_checkbox_bg.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index d52e3e1..102076e 100755 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -40,7 +40,7 @@ android:layout_marginTop="10dp" android:textSize="13sp" android:textColor="#333333" - android:text="TokenPocket是一款移动端轻钱包APP,它旨在为普通用户提供一款安全放心,简单好用,功能强大的数字资产钱包应用" /> + android:text="@string/content_about_token_pocket" /> @@ -84,7 +84,7 @@ @@ -111,7 +111,7 @@ diff --git a/app/src/main/res/layout/activity_addtoken.xml b/app/src/main/res/layout/activity_addtoken.xml deleted file mode 100755 index b536b28..0000000 --- a/app/src/main/res/layout/activity_addtoken.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_bakup_wallet_info.xml b/app/src/main/res/layout/activity_bakup_wallet_info.xml index b2080c2..b4ea9de 100755 --- a/app/src/main/res/layout/activity_bakup_wallet_info.xml +++ b/app/src/main/res/layout/activity_bakup_wallet_info.xml @@ -17,7 +17,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="42dp" - android:text="抄下你的钱包助记词" + android:text="@string/title_copy_mnemonic" android:textColor="@color/common_black_fontcolor" android:textSize="18sp" /> @@ -28,7 +28,7 @@ android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginTop="15dp" - android:text="助记词用于恢复钱包和重置钱包密码,将它准确的抄写在纸上,并存放在只有你知道的安全的地方。" + android:text="@string/content_copy_mnemonic" android:textColor="#808080" android:textSize="14sp" /> @@ -74,7 +74,7 @@ android:layout_marginTop="40dp" android:background="@drawable/shape_splash_createwallet_bg" android:gravity="center" - android:text="下一步" + android:text="@string/btn_next" android:textColor="@color/white" android:textSize="17sp" /> diff --git a/app/src/main/res/layout/activity_bakup_wallet_pk.xml b/app/src/main/res/layout/activity_bakup_wallet_pk.xml deleted file mode 100755 index 8d56dea..0000000 --- a/app/src/main/res/layout/activity_bakup_wallet_pk.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_bakup_wallet_start.xml b/app/src/main/res/layout/activity_bakup_wallet_start.xml index ec69494..3477515 100755 --- a/app/src/main/res/layout/activity_bakup_wallet_start.xml +++ b/app/src/main/res/layout/activity_bakup_wallet_start.xml @@ -47,7 +47,7 @@ android:layout_marginTop="35dp" android:background="@drawable/shape_splash_createwallet_bg" android:gravity="center" - android:text="备份钱包" + android:text="@string/btn_backup_wallet" android:textColor="@color/white" android:textSize="17sp" /> diff --git a/app/src/main/res/layout/activity_camera.xml b/app/src/main/res/layout/activity_camera.xml deleted file mode 100755 index 7047b0e..0000000 --- a/app/src/main/res/layout/activity_camera.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_confirm_walletinfo.xml b/app/src/main/res/layout/activity_confirm_walletinfo.xml index c5f462b..b2401ac 100755 --- a/app/src/main/res/layout/activity_confirm_walletinfo.xml +++ b/app/src/main/res/layout/activity_confirm_walletinfo.xml @@ -17,7 +17,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="42dp" - android:text="确认你的钱包助记词" + android:text="@string/title_verify_mnemonic" android:textColor="@color/common_black_fontcolor" android:textSize="18sp" /> @@ -28,7 +28,7 @@ android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginTop="15dp" - android:text="请按抄写的顺序点击助记词,确认你的备份助记词正确" + android:text="@string/content_verify_mnemonic" android:textColor="#808080" android:textSize="14sp" /> @@ -73,7 +73,7 @@ android:layout_marginTop="40dp" android:background="@drawable/shape_splash_createwallet_bg" android:gravity="center" - android:text="完成" + android:text="@string/titleBar_completed" android:textColor="@color/white" android:textSize="17sp" /> diff --git a/app/src/main/res/layout/activity_create_wallet.xml b/app/src/main/res/layout/activity_create_wallet.xml deleted file mode 100755 index f97dd51..0000000 --- a/app/src/main/res/layout/activity_create_wallet.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_create_wallet_new.xml b/app/src/main/res/layout/activity_create_wallet_new.xml index d485156..5006e2b 100755 --- a/app/src/main/res/layout/activity_create_wallet_new.xml +++ b/app/src/main/res/layout/activity_create_wallet_new.xml @@ -22,7 +22,7 @@ + android:text="@string/enter_title_block" /> @@ -42,12 +42,12 @@ + android:text="@string/enter_title_wallet_name" /> + android:hint="@string/enter_hint_wallet_name" /> @@ -56,12 +56,12 @@ + android:text="@string/enter_title_password" /> + android:hint="@string/enter_hint_password" /> @@ -70,12 +70,12 @@ + android:text="@string/enter_title_verify" /> + android:hint="@string/enter_hint_verify" /> @@ -89,13 +89,13 @@ + android:text="@string/enter_title_prompt" /> @@ -107,10 +107,12 @@ + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:layout_marginLeft="10dp" + android:layout_marginRight="10dp" + android:orientation="horizontal"> - + android:layout_marginLeft="10dp" + android:textSize="13sp" />