From 6c66cf520a72962f0c504d67769a5dda40dc483c Mon Sep 17 00:00:00 2001 From: kimheeje Date: Tue, 6 Dec 2022 17:03:44 +0900 Subject: [PATCH 1/4] [APP-641] Mnemonic add dialog cancel button position change --- .../activities/txs/kava/CdpDetailActivity.java | 2 +- .../activities/txs/kava/HardDetailActivity.java | 2 +- .../java/wannabit/io/cosmostaion/base/BaseActivity.java | 8 +++----- .../widget/mainWallet/WalletBinanceHolder.java | 3 +-- .../cosmostaion/widget/mainWallet/WalletChainHolder.java | 3 +-- .../cosmostaion/widget/mainWallet/WalletOkexHolder.java | 6 +++--- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java index 9385dfc989..0581d9a31d 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java +++ b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java @@ -307,7 +307,7 @@ public void onCheckStartRepayCdp() { private boolean onCommonCheck() { if (!mAccount.hasPrivateKey) { CommonAlertDialog.showDoubleButton(this, getString(R.string.str_only_observe_title), getString(R.string.str_only_observe_msg), - getString(R.string.str_close), null, getString(R.string.str_add_mnemonics), view -> onAddMnemonicForAccount()); + getString(R.string.str_add_mnemonics), view -> onAddMnemonicForAccount(), getString(R.string.str_close), null); return false; } diff --git a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java index 93a6a5c91c..f8866a00fd 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java +++ b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java @@ -255,7 +255,7 @@ public void onHardRepay() { private boolean onCommonCheck() { if (!mAccount.hasPrivateKey) { CommonAlertDialog.showDoubleButton(this, getString(R.string.str_only_observe_title), getString(R.string.str_only_observe_msg), - getString(R.string.str_close), null, getString(R.string.str_add_mnemonics), view -> onAddMnemonicForAccount()); + getString(R.string.str_add_mnemonics), view -> onAddMnemonicForAccount(), getString(R.string.str_close), null); return false; } return true; diff --git a/app/src/main/java/wannabit/io/cosmostaion/base/BaseActivity.java b/app/src/main/java/wannabit/io/cosmostaion/base/BaseActivity.java index 4e17a2e92c..51e904bd1f 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/base/BaseActivity.java +++ b/app/src/main/java/wannabit/io/cosmostaion/base/BaseActivity.java @@ -788,9 +788,7 @@ else if (result.taskType == TASK_GRPC_FETCH_NODE_INFO) { getBaseDao().mGrpcStarNameConfig = ((starnamed.x.configuration.v1beta1.Types.Config) result.resultData); } - } - - else if (result.taskType == TASK_FETCH_KAVA_INCENTIVE_REWARD) { + } else if (result.taskType == TASK_FETCH_KAVA_INCENTIVE_REWARD) { if (result.isSuccess && result.resultData != null) { getBaseDao().mIncentiveRewards = (IncentiveReward) result.resultData; } @@ -939,7 +937,7 @@ else if (result.taskType == TASK_FETCH_MINTSCAN_CW20_ASSETS) { public void onShowBuyWarnNoKey() { CommonAlertDialog.showDoubleButton(this, getString(R.string.str_only_observe_title), getString(R.string.str_buy_without_key_msg), - getString(R.string.str_cancel), null, getString(R.string.str_continue), view -> onShowCryptoPay()); + getString(R.string.str_continue), view -> onShowCryptoPay(), getString(R.string.str_cancel), null); } public void onShowCryptoPay() { @@ -958,7 +956,7 @@ public void onShowCryptoPay() { public void onShowBuyKado() { String query = "?apiKey=" + getString(R.string.kado_money_public_key) + "&network=" + mChainConfig.chainName() + "&networkList=" + mChainConfig.chainName() + "&onToAddress=" + mAccount.address; - if(mChainConfig.baseChain().equals(INJ_MAIN)) { + if (mChainConfig.baseChain().equals(INJ_MAIN)) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.url_kado_money) + query + "&onRevCurrency=" + "USDT")); startActivity(intent); } else { diff --git a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java index 0dcc0b2f90..85b876c746 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java +++ b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java @@ -64,8 +64,7 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { mBtnWalletConnect.setOnClickListener(v -> { if (!mainActivity.mAccount.hasPrivateKey) { CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - mainActivity.getString(R.string.str_close), null, - Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount()); + Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), mainActivity.getString(R.string.str_close), null); return; } new TedPermission(mainActivity).setPermissionListener(new PermissionListener() { diff --git a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java index e465bc36ab..3e5c954280 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java +++ b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java @@ -126,8 +126,7 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { mBtnWalletConnect.setOnClickListener(v -> { if (!mainActivity.mAccount.hasPrivateKey) { CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - mainActivity.getString(R.string.str_close), null, - Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount()); + Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), mainActivity.getString(R.string.str_close), null); return; } else { new TedPermission(mainActivity).setPermissionListener(new PermissionListener() { diff --git a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java index 072944a183..31646830db 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java +++ b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java @@ -69,8 +69,8 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { return; if (!mainActivity.mAccount.hasPrivateKey) { CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - mainActivity.getString(R.string.str_close), null, - Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount()); + Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), + mainActivity.getString(R.string.str_close), null); return; } @@ -92,7 +92,7 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { return; if (!mainActivity.mAccount.hasPrivateKey) { CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - mainActivity.getString(R.string.str_close), null, Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount()); + Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), mainActivity.getString(R.string.str_close), null); return; } From 28977fe74ab04631fdaaa4cba5906ee881e61e7f Mon Sep 17 00:00:00 2001 From: kimheeje Date: Tue, 6 Dec 2022 17:15:57 +0900 Subject: [PATCH 2/4] [APP-641] method change --- .../io/cosmostaion/activities/txs/kava/CdpDetailActivity.java | 3 +-- .../io/cosmostaion/activities/txs/kava/HardDetailActivity.java | 3 +-- .../io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java | 3 +-- .../io/cosmostaion/widget/mainWallet/WalletChainHolder.java | 3 +-- .../io/cosmostaion/widget/mainWallet/WalletOkexHolder.java | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java index 0581d9a31d..fe713d8fb9 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java +++ b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/CdpDetailActivity.java @@ -306,8 +306,7 @@ public void onCheckStartRepayCdp() { private boolean onCommonCheck() { if (!mAccount.hasPrivateKey) { - CommonAlertDialog.showDoubleButton(this, getString(R.string.str_only_observe_title), getString(R.string.str_only_observe_msg), - getString(R.string.str_add_mnemonics), view -> onAddMnemonicForAccount(), getString(R.string.str_close), null); + onInsertKeyDialog(); return false; } diff --git a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java index f8866a00fd..9dc8152e84 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java +++ b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/kava/HardDetailActivity.java @@ -254,8 +254,7 @@ public void onHardRepay() { private boolean onCommonCheck() { if (!mAccount.hasPrivateKey) { - CommonAlertDialog.showDoubleButton(this, getString(R.string.str_only_observe_title), getString(R.string.str_only_observe_msg), - getString(R.string.str_add_mnemonics), view -> onAddMnemonicForAccount(), getString(R.string.str_close), null); + onInsertKeyDialog(); return false; } return true; diff --git a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java index 85b876c746..75a5c05f21 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java +++ b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletBinanceHolder.java @@ -63,8 +63,7 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { mBtnWalletConnect.setOnClickListener(v -> { if (!mainActivity.mAccount.hasPrivateKey) { - CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), mainActivity.getString(R.string.str_close), null); + mainActivity.onInsertKeyDialog(); return; } new TedPermission(mainActivity).setPermissionListener(new PermissionListener() { diff --git a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java index 3e5c954280..da322b105b 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java +++ b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletChainHolder.java @@ -125,8 +125,7 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { } mBtnWalletConnect.setOnClickListener(v -> { if (!mainActivity.mAccount.hasPrivateKey) { - CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), mainActivity.getString(R.string.str_close), null); + mainActivity.onInsertKeyDialog(); return; } else { new TedPermission(mainActivity).setPermissionListener(new PermissionListener() { diff --git a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java index 31646830db..beb96ceb51 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java +++ b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java @@ -91,8 +91,7 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { if (mainActivity.getBaseDao().mTopValidators == null && mainActivity.getBaseDao().mTopValidators.size() == 0) return; if (!mainActivity.mAccount.hasPrivateKey) { - CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), mainActivity.getString(R.string.str_close), null); + mainActivity.onInsertKeyDialog(); return; } From ea3805ced675330ff175070cdd5026f8fc16ce4a Mon Sep 17 00:00:00 2001 From: kimheeje Date: Tue, 6 Dec 2022 17:23:34 +0900 Subject: [PATCH 3/4] [APP-641] method change --- .../io/cosmostaion/activities/txs/nft/NFTListActivity.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/nft/NFTListActivity.java b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/nft/NFTListActivity.java index 2093a596a0..be36737be5 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/activities/txs/nft/NFTListActivity.java +++ b/app/src/main/java/wannabit/io/cosmostaion/activities/txs/nft/NFTListActivity.java @@ -85,8 +85,7 @@ protected void onCreate(Bundle savedInstanceState) { mBtnCreateNft.setOnClickListener(v -> { if (mAccount == null) return; if (!mAccount.hasPrivateKey) { - CommonAlertDialog.showDoubleButton(NFTListActivity.this, getString(R.string.str_only_observe_title), getString(R.string.str_only_observe_msg), - Html.fromHtml("" + getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> onAddMnemonicForAccount(), getString(R.string.str_close), null); + onInsertKeyDialog(); return; } if (!WDp.isTxFeePayable(NFTListActivity.this, getBaseDao(), mChainConfig)) { From f1564049ef0224b245f2a83bfe6798b1dbb2f842 Mon Sep 17 00:00:00 2001 From: kimheeje Date: Tue, 6 Dec 2022 17:24:52 +0900 Subject: [PATCH 4/4] [APP-641] method change --- .../io/cosmostaion/widget/mainWallet/WalletOkexHolder.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java index beb96ceb51..40d6947649 100644 --- a/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java +++ b/app/src/main/java/wannabit/io/cosmostaion/widget/mainWallet/WalletOkexHolder.java @@ -68,9 +68,7 @@ public void onBindHolder(@NotNull MainActivity mainActivity) { if (mainActivity.getBaseDao().mTopValidators == null && mainActivity.getBaseDao().mTopValidators.size() == 0) return; if (!mainActivity.mAccount.hasPrivateKey) { - CommonAlertDialog.showDoubleButton(mainActivity, mainActivity.getString(R.string.str_only_observe_title), mainActivity.getString(R.string.str_only_observe_msg), - Html.fromHtml("" + mainActivity.getString(R.string.str_add_mnemonics) + "", Html.FROM_HTML_MODE_COMPACT), view -> mainActivity.onAddMnemonicForAccount(), - mainActivity.getString(R.string.str_close), null); + mainActivity.onInsertKeyDialog(); return; }