diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index d3dc1ee0e..a6e57b7dc 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser index ccc6ef171..5099678f9 100644 Binary files a/.idea/caches/gradle_models.ser and b/.idea/caches/gradle_models.ser differ diff --git a/app/build.gradle b/app/build.gradle index 44488d538..a5ea9256c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId = 'com.wagerrwallet' minSdkVersion 23 targetSdkVersion 28 - versionCode 235 - versionName "235" + versionCode 236 + versionName "236" multiDexEnabled true // Similar to other properties in the defaultConfig block, diff --git a/app/src/main/java/com/wagerrwallet/presenter/activities/HomeActivity.java b/app/src/main/java/com/wagerrwallet/presenter/activities/HomeActivity.java index bfa5a1c9f..10340e721 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/activities/HomeActivity.java +++ b/app/src/main/java/com/wagerrwallet/presenter/activities/HomeActivity.java @@ -184,6 +184,9 @@ public void hidePrompt() { if (mCurrentPrompt == PromptManager.PromptItem.SHARE_DATA) { BRSharedPrefs.putShareDataDismissed(app, true); } + if (mCurrentPrompt == PromptManager.PromptItem.FINGER_PRINT) { + BRSharedPrefs.putFingerprintDismissed(app, true); + } if (mCurrentPrompt != null) BREventManager.getInstance().pushEvent("prompt." + PromptManager.getInstance().getPromptName(mCurrentPrompt) + ".dismissed"); mCurrentPrompt = null; diff --git a/app/src/main/java/com/wagerrwallet/presenter/activities/settings/AboutActivity.java b/app/src/main/java/com/wagerrwallet/presenter/activities/settings/AboutActivity.java index bdaced8da..40fe8830c 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/activities/settings/AboutActivity.java +++ b/app/src/main/java/com/wagerrwallet/presenter/activities/settings/AboutActivity.java @@ -98,7 +98,7 @@ public void onClick(View v) { policyText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.wagerr.com/privacy/")); + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/wagerr/WagerrWalletAndroid/blob/master/PrivacyPolicy.md")); startActivity(browserIntent); app.overridePendingTransition(R.anim.enter_from_bottom, R.anim.empty_300); } diff --git a/app/src/main/java/com/wagerrwallet/presenter/activities/settings/FingerprintActivity.java b/app/src/main/java/com/wagerrwallet/presenter/activities/settings/FingerprintActivity.java index 077153b5c..c84418697 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/activities/settings/FingerprintActivity.java +++ b/app/src/main/java/com/wagerrwallet/presenter/activities/settings/FingerprintActivity.java @@ -140,11 +140,11 @@ private String getLimitText() { BigDecimal satoshis = new BigDecimal(BRKeyStore.getSpendLimit(this)); WalletsMaster master = WalletsMaster.getInstance(this); //amount in BTC, mBTC or bits - BigDecimal amount = master.getCurrentWallet(this).getFiatForSmallestCrypto(this, satoshis, null); + BigDecimal amount = satoshis.divide( new BigDecimal(BRConstants.ONE_BITCOIN)); // master.getCurrentWallet(this).getFiatForSmallestCrypto(this, satoshis, null); //amount in user preferred ISO (e.g. USD) BigDecimal curAmount = master.getCurrentWallet(this).getFiatForSmallestCrypto(this, satoshis, null); //formatted string for the label - return String.format(getString(R.string.TouchIdSettings_spendingLimit), CurrencyUtils.getFormattedAmount(this, "WGR", amount), CurrencyUtils.getFormattedAmount(this, iso, curAmount)); + return String.format(getString(R.string.TouchIdSettings_spendingLimit), CurrencyUtils.getFormattedAmount(this, "WGR", satoshis), CurrencyUtils.getFormattedAmount(this, iso, curAmount)); } @Override diff --git a/app/src/main/java/com/wagerrwallet/presenter/activities/settings/SettingsActivity.java b/app/src/main/java/com/wagerrwallet/presenter/activities/settings/SettingsActivity.java index cd5240455..b94563149 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/activities/settings/SettingsActivity.java +++ b/app/src/main/java/com/wagerrwallet/presenter/activities/settings/SettingsActivity.java @@ -253,6 +253,7 @@ public void onClick(View v) { } }, false)); */ +/* remove this option upon request items.add(new BRSettingsItem(getString(R.string.Settings_review), "", new View.OnClickListener() { @Override public void onClick(View v) { @@ -267,7 +268,7 @@ public void onClick(View v) { overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left); } }, false)); - +*/ items.add(new BRSettingsItem(getString(R.string.Settings_aboutBread), "", new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java index e91dc149a..b4d6f7207 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java +++ b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentEventDetails.java @@ -6,6 +6,8 @@ import android.os.Bundle; import android.os.Handler; import android.support.annotation.Nullable; +import android.text.Editable; +import android.text.TextWatcher; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -39,6 +41,7 @@ import com.wagerrwallet.tools.manager.BRClipboardManager; import com.wagerrwallet.tools.manager.BRSharedPrefs; import com.wagerrwallet.tools.manager.SendManager; +import com.wagerrwallet.tools.util.BRConstants; import com.wagerrwallet.tools.util.BRDateUtil; import com.wagerrwallet.tools.util.CurrencyUtils; import com.wagerrwallet.tools.util.Utils; @@ -122,6 +125,7 @@ public class FragmentEventDetails extends DialogFragment implements View.OnClick private ImageButton mAcceptBet; private ImageButton mCancelBet; private View mCurrentSelectedBetOption = null; + private ImageButton faq; private BRText mPotentialReward; @@ -153,6 +157,16 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, View rootView = inflater.inflate(R.layout.event_details, container, false); + faq = (ImageButton) rootView.findViewById(R.id.faq_button); + + faq.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (!BRAnimator.isClickAllowed()) return; + BRAnimator.showSupportFragment(getActivity(), BRConstants.betSlip); + } + }); + mMainLayout = rootView.findViewById(R.id.dynamic_container); mTxEventHeader = rootView.findViewById(R.id.tx_eventheader); mTxEventDate= rootView.findViewById(R.id.tx_eventdate); @@ -229,6 +243,33 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { } }); + + mTxAmount.addTextChangedListener(new TextWatcher() { + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + String oddTx = ((BRText)mCurrentSelectedBetOption).getText().toString(); + float odds = 0; + int value = getContext().getResources().getInteger(R.integer.min_bet_amount); + int minvalue = value; + Float fValue = 0.0f; + try { + odds = Float.parseFloat( oddTx ); + fValue = Float.parseFloat(mTxAmount.getText().toString()); + value = Math.max(minvalue, fValue.intValue()); + } catch (NumberFormatException e) { + } + setRewardAmount(value, odds); + } + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + // TODO Auto-generated method stub + } + @Override + public void afterTextChanged(Editable s) { + // TODO Auto-generated method stub + } + }); + mSpreadsContainer = rootView.findViewById(R.id.spreads_container); mSpreadsLayout = rootView.findViewById(R.id.spreads_layout); mTxSpreadPoints= rootView.findViewById(R.id.tx_spread_points); @@ -266,7 +307,7 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { mTxLastDate = rootView.findViewById(R.id.tx_last_date); mToFrom = rootView.findViewById(R.id.tx_to_from); mToFromAddress = rootView.findViewById(R.id.tx_to_from_address); - mMemoText = rootView.findViewById(R.id.memo); + //mMemoText = rootView.findViewById(R.id.memo); mStartingBalance = rootView.findViewById(R.id.tx_starting_balance); mEndingBalance = rootView.findViewById(R.id.tx_ending_balance); mExchangeRate = rootView.findViewById(R.id.exchange_rate); @@ -333,11 +374,7 @@ protected void updateSeekBar( int amount, int posX ) { try { odds = Float.parseFloat( oddTx ); stake = amount; - long rewardAmount = stake + (long)((stake * (odds - 1)) * 0.94); - BigDecimal rewardCryptoAmount = new BigDecimal((long)rewardAmount*UNIT_MULTIPLIER); - BigDecimal rewardFiatAmount = walletManager.getFiatForSmallestCrypto(getActivity(), rewardCryptoAmount.abs(), null); - String rewardFiatAmountStr = CurrencyUtils.getFormattedAmount(getContext(), BRSharedPrefs.getPreferredFiatIso(getContext()), rewardFiatAmount); - mPotentialReward.setText("" + rewardAmount + " WGR (" + rewardFiatAmountStr +")" ); + setRewardAmount(stake, odds); } catch (NumberFormatException e) { mPotentialReward.setText("---"); @@ -349,6 +386,21 @@ protected void updateSeekBar( int amount, int posX ) { //mTxAmount.setX(seekBar.getX() + posX); } + protected void setRewardAmount(long stake, float odds) { + BaseWalletManager walletManager = WalletsMaster.getInstance(getActivity()).getCurrentWallet(getActivity()); + + try { + long rewardAmount = stake + (long)((stake * (odds - 1)) * 0.94); + BigDecimal rewardCryptoAmount = new BigDecimal((long)rewardAmount*UNIT_MULTIPLIER); + BigDecimal rewardFiatAmount = walletManager.getFiatForSmallestCrypto(getActivity(), rewardCryptoAmount.abs(), null); + String rewardFiatAmountStr = CurrencyUtils.getFormattedAmount(getContext(), BRSharedPrefs.getPreferredFiatIso(getContext()), rewardFiatAmount); + mPotentialReward.setText("" + rewardAmount + " WGR (" + rewardFiatAmountStr +")" ); + } + catch (NumberFormatException e) { + mPotentialReward.setText("---"); + } + } + protected void AcceptBet() { int min = getContext().getResources().getInteger(R.integer.min_bet_amount); BetEntity.BetTxType betType = (mTransaction.getType()== BetEventEntity.BetTxType.PEERLESS)? BetEntity.BetTxType.PEERLESS:BetEntity.BetTxType.CHAIN_LOTTO; @@ -370,7 +422,7 @@ public void onClick(BRDialogView brDialogView) { CryptoRequest item = new CryptoRequest(tx, null, false, "", "", new BigDecimal(amount)); SendManager.sendTransaction(getActivity(), item, wallet); - BRAnimator.showFragmentEvent = mTransaction; + //BRAnimator.showFragmentEvent = mTransaction; dismiss(); // close fragment } } diff --git a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentRequestAmount.java b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentRequestAmount.java index 4319d59cc..6dff115fc 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentRequestAmount.java +++ b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentRequestAmount.java @@ -23,6 +23,7 @@ import com.wagerrwallet.presenter.customviews.BRButton; import com.wagerrwallet.presenter.customviews.BRKeyboard; import com.wagerrwallet.presenter.customviews.BRLinearLayoutWithCaret; +import com.wagerrwallet.presenter.entities.CryptoRequest; import com.wagerrwallet.tools.animation.BRAnimator; import com.wagerrwallet.tools.animation.SlideDetector; import com.wagerrwallet.tools.manager.BRClipboardManager; @@ -232,6 +233,7 @@ public void onClick(View v) { QRUtils.share("sms:", getActivity(), bitcoinUri.toString()); } }); +/* shareButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -241,6 +243,21 @@ public void onClick(View v) { showKeyboard(false); } }); +*/ + shareButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (!BRAnimator.isClickAllowed()) { + return; + } + showKeyboard(false); + BaseWalletManager walletManager = WalletsMaster.getInstance(getActivity()).getCurrentWallet(getActivity()); + CryptoRequest cryptoRequest = new CryptoRequest.Builder().setAddress(walletManager.decorateAddress(getActivity(), mReceiveAddress)).setAmount(new BigDecimal(getAmount())).build(); + Uri cryptoUri = CryptoUriParser.createCryptoUrl(getActivity(), walletManager, cryptoRequest); + QRUtils.sendShareIntent(getActivity(), cryptoUri.toString(), cryptoRequest.getAddress(true)); + } + }); + mAddress.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentTxDetails.java b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentTxDetails.java index 0fc02513c..920257bc2 100644 --- a/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentTxDetails.java +++ b/app/src/main/java/com/wagerrwallet/presenter/fragments/FragmentTxDetails.java @@ -30,6 +30,7 @@ import com.wagerrwallet.tools.manager.BRSharedPrefs; import com.wagerrwallet.tools.sqlite.BetEventTxDataStore; import com.wagerrwallet.tools.sqlite.BetResultTxDataStore; +import com.wagerrwallet.tools.util.BRConstants; import com.wagerrwallet.tools.util.BRDateUtil; import com.wagerrwallet.tools.util.CurrencyUtils; import com.wagerrwallet.tools.util.Utils; @@ -62,6 +63,7 @@ public class FragmentTxDetails extends DialogFragment { private BRText mToFromAddress2; private BRText mToFromAddress3; private BRText mMemoText; + private BRText mLinkOpenInExplorer; private BRText mStartingBalance; private BRText mEndingBalance; @@ -108,7 +110,8 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, mToFromAddress = rootView.findViewById(R.id.tx_to_from_address); mToFromAddress2 = rootView.findViewById(R.id.tx_to_from_address2); mToFromAddress3 = rootView.findViewById(R.id.tx_to_from_address3); - mMemoText = rootView.findViewById(R.id.memo); + //mMemoText = rootView.findViewById(R.id.memo); + mLinkOpenInExplorer = rootView.findViewById(R.id.link_open_in_explorer); mStartingBalance = rootView.findViewById(R.id.tx_starting_balance); mEndingBalance = rootView.findViewById(R.id.tx_ending_balance); mExchangeRate = rootView.findViewById(R.id.exchange_rate); @@ -200,9 +203,9 @@ private void updateUi() { BigDecimal tmpStartingBalance = new BigDecimal(mTransaction.getBalanceAfterTx()).subtract(cryptoAmount.abs()).subtract(new BigDecimal(mTransaction.getFee()).abs()); - BigDecimal startingBalance = isCryptoPreferred ? walletManager.getCryptoForSmallestCrypto(getActivity(), tmpStartingBalance) : walletManager.getFiatForSmallestCrypto(getActivity(), tmpStartingBalance, null); + BigDecimal startingBalance = isCryptoPreferred ? walletManager.getCryptoForSmallestCrypto(getActivity(), tmpStartingBalance).multiply(new BigDecimal(BRConstants.ONE_BITCOIN)) : walletManager.getFiatForSmallestCrypto(getActivity(), tmpStartingBalance, null); - BigDecimal endingBalance = isCryptoPreferred ? walletManager.getCryptoForSmallestCrypto(getActivity(), new BigDecimal(mTransaction.getBalanceAfterTx())) : walletManager.getFiatForSmallestCrypto(getActivity(), new BigDecimal(mTransaction.getBalanceAfterTx()), null); + BigDecimal endingBalance = isCryptoPreferred ? walletManager.getCryptoForSmallestCrypto(getActivity(), new BigDecimal(mTransaction.getBalanceAfterTx())).multiply(new BigDecimal(BRConstants.ONE_BITCOIN)) : walletManager.getFiatForSmallestCrypto(getActivity(), new BigDecimal(mTransaction.getBalanceAfterTx()), null); mStartingBalance.setText(CurrencyUtils.getFormattedAmount(getActivity(), iso, startingBalance == null ? null : startingBalance.abs())); mEndingBalance.setText(CurrencyUtils.getFormattedAmount(getActivity(), iso, endingBalance == null ? null : endingBalance.abs())); @@ -299,6 +302,7 @@ public void onClick(View v) { mTxAmount.setTextColor(getContext().getColor(R.color.transaction_amount_received_color)); // Set the memo text if one is available +/* disable memo upon request String memo; TxMetaData txMetaData = KVStoreManager.getInstance().getTxMetaData(getActivity(), mTransaction.getTxHash()); @@ -320,7 +324,7 @@ public void onClick(View v) { } else { mMemoText.setText(""); } - +*/ // timestamp is 0 if it's not confirmed in a block yet so make it now mTxDate.setText(BRDateUtil.getMidDate(mTransaction.getTimeStamp() == 0 ? System.currentTimeMillis() : (mTransaction.getTimeStamp() * 1000))); @@ -350,6 +354,15 @@ public void run() { } }); + mLinkOpenInExplorer.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("https://explorer.wagerr.com/#/tx/%s", mTransaction.getTxHashHexReversed()))); + startActivity(browserIntent); + getActivity().overridePendingTransition(R.anim.enter_from_bottom, R.anim.empty_300); + } + }); + // Set the transaction block number mConfirmedInBlock.setText(String.valueOf(mTransaction.getBlockHeight())); diff --git a/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java b/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java index 04fb3bced..d2b959f88 100644 --- a/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java +++ b/app/src/main/java/com/wagerrwallet/tools/adapter/TransactionListAdapter.java @@ -181,7 +181,7 @@ private void setTexts(final TxHolder convertView, int position) { if (received) convertView.transactionAmount.setTextColor(mContext.getResources().getColor(R.color.transaction_amount_received_color, null)); else - convertView.transactionAmount.setTextColor(mContext.getResources().getColor(R.color.total_assets_usd_color, null)); + convertView.transactionAmount.setTextColor(mContext.getResources().getColor(R.color.transaction_amount_sent_color, null)); // If this transaction failed, show the "FAILED" indicator in the cell if (!item.isValid()) @@ -251,30 +251,38 @@ else if (confirms == 3) long nCurrentHeight = BRSharedPrefs.getLastBlockHeight(mContext, wallet.getIso(mContext)); boolean isNormalTx = true; - if (item.isCoinbase() && item.getBlockHeight() != Integer.MAX_VALUE) { // then payout reward - boolean immature = (nCurrentHeight-item.getBlockHeight()) <= PAYOUT_MATURITY; - String strMatureInfo = String.format( "%d/%d", (nCurrentHeight-item.getBlockHeight()), PAYOUT_MATURITY ); - int amountColor = ( !immature ) ? R.color.transaction_amount_payout_color:R.color.transaction_amount_inmature_color; - convertView.transactionAmount.setTextColor(mContext.getResources().getColor(amountColor, null)); - BetResultTxDataStore brds = BetResultTxDataStore.getInstance(mContext); - BetResultEntity br = brds.getByBlockHeight(mContext, wallet.getIso(mContext), item.getBlockHeight() - 1); - if (br != null) { - eventID = br.getEventID(); - EventTxUiHolder ev = BetEventTxDataStore.getInstance(mContext).getTransactionByEventId(mContext, "wgr", eventID); - if (ev != null) { - txDescription = String.format("%s - %s", ev.getTxHomeTeam(), ev.getTxAwayTeam()); + if (item.getBetEntity()==null) { + if (item.isCoinbase() && item.getBlockHeight() != Integer.MAX_VALUE) { // then payout reward + boolean immature = (nCurrentHeight - item.getBlockHeight()) <= PAYOUT_MATURITY; + String strMatureInfo = String.format("%d/%d", (nCurrentHeight - item.getBlockHeight()), PAYOUT_MATURITY); + int amountColor = (!immature) ? R.color.transaction_amount_payout_color : R.color.transaction_amount_inmature_color; + convertView.transactionAmount.setTextColor(mContext.getResources().getColor(amountColor, null)); + BetResultTxDataStore brds = BetResultTxDataStore.getInstance(mContext); + BetResultEntity br = brds.getByBlockHeight(mContext, wallet.getIso(mContext), item.getBlockHeight() - 1); + if (br != null) { + eventID = br.getEventID(); + EventTxUiHolder ev = BetEventTxDataStore.getInstance(mContext).getTransactionByEventId(mContext, "wgr", eventID); + if (ev != null) { + txDescription = String.format("%s - %s", ev.getTxHomeTeam(), ev.getTxAwayTeam()); + } else { + txDescription = String.format("Event #%d: info not avalable", eventID); + } + txDate = String.format("PAYOUT Event #%d", eventID); } else { - txDescription = String.format("Event #%d: info not avalable", eventID); + txDescription = String.format("Result not avalable at height %d", item.getBlockHeight() - 1); + txDate = "PAYOUT"; } - txDate = String.format("PAYOUT Event #%d", eventID); + isNormalTx = false; + if (immature) txDate += " " + strMatureInfo; } else { - txDescription = String.format("Result not avalable at height %d", item.getBlockHeight() - 1); - txDate = "PAYOUT"; + if (level > 4) { + txDescription = !commentString.isEmpty() ? commentString : (!received ? "sent to " : "received via ") + wallet.decorateAddress(mContext, item.getToRecipient(wallet, received)); + } else { + txDescription = !commentString.isEmpty() ? commentString : (!received ? "sending to " : "receiving via ") + wallet.decorateAddress(mContext, item.getToRecipient(wallet, received)); + } } - isNormalTx=false; - if (immature) txDate+=" " + strMatureInfo; - } else if (item.getBetEntity()!=null) { // outgoing bet + } else { // outgoing bet eventID = item.getBetEntity().getEventID(); EventTxUiHolder ev = BetEventTxDataStore.getInstance(mContext).getTransactionByEventId(mContext, "wgr", eventID); if (ev != null) { @@ -287,14 +295,6 @@ else if (confirms == 3) isNormalTx=false; } - - if (isNormalTx) { // regular tx - if (level > 4) { - txDescription = !commentString.isEmpty() ? commentString : (!received ? "sent to " : "received via ") + wallet.decorateAddress(mContext, item.getToRecipient(wallet, received)); - } else { - txDescription = !commentString.isEmpty() ? commentString : (!received ? "sending to " : "receiving via ") + wallet.decorateAddress(mContext, item.getToRecipient(wallet, received)); - } - } convertView.transactionDetail.setText(txDescription); convertView.transactionDate.setText(shortDate + " " + txDate); } diff --git a/app/src/main/java/com/wagerrwallet/tools/animation/BRAnimator.java b/app/src/main/java/com/wagerrwallet/tools/animation/BRAnimator.java index 78d2e898c..1cc24fa76 100644 --- a/app/src/main/java/com/wagerrwallet/tools/animation/BRAnimator.java +++ b/app/src/main/java/com/wagerrwallet/tools/animation/BRAnimator.java @@ -170,7 +170,73 @@ public void run() { public static void showSupportFragment(Activity app, String articleId) { - Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/Wagerrpublictest")); + String URL = "https://wagerr.zendesk.com/hc/en-us/"; + + switch (articleId) { + + case BRConstants.walletDisabled: + URL += "articles/360035353391-Why-is-my-wallet-disabled-"; + break; + + case BRConstants.receive: + URL += "articles/360035353511-How-do-I-receive-Wagerr-WGR-"; + break; + + case BRConstants.setPin: + URL += "/articles/360035353791-Why-do-i-need-a-PIN-"; + break; + + case BRConstants.enableFingerprint: + URL += "articles/360035353591-What-is-fingerprint-authentication-"; + break; + + case BRConstants.fingerprintSpendingLimit: + URL += "articles/360035353631-What-is-the-fingerprint-touch-ID-spending-limit-"; + break; + + case BRConstants.wipeWallet: + URL += "articles/360035358811-How-do-I-wipe-my-wallet-"; + break; + + case BRConstants.paperKey: + case BRConstants.writePhrase: + case BRConstants.recoverWallet: + URL += "articles/360035353811-What-is-a-recovery-key-"; + break; + + case BRConstants.importWallet: + URL += "articles/360034979472-What-happens-when-I-import-a-Wagerr-private-key-"; + break; + + case BRConstants.displayCurrency: + URL += "articles/360035353871-How-does-the-Wagerr-wallet-app-show-my-balance-in-my-local-currency-"; + break; + + case BRConstants.reScan: + URL += "articles/360034979492-When-should-I-re-sync-my-Wagerr-wallet-with-the-blockchain-"; + break; + + case BRConstants.securityCenter: + URL += "articles/360035353831-What-is-the-Security-Center-"; + break; + + case BRConstants.send: + URL += "articles/360034979232-How-can-I-send-Wagerr-WGR-"; + break; + + case BRConstants.requestAmount: + URL += "articles/360034983592-How-do-I-use-the-Request-an-Amount-screen-in-my-Wagerr-wallet-"; + break; + + case BRConstants.betSlip: + URL += "articles/360035358891-Betting-Slip"; + break; + + default: + URL += "categories/360002247832-Mobile-Application"; + break; + } + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(URL)); app.startActivity(browserIntent); app.overridePendingTransition(R.anim.enter_from_bottom, R.anim.empty_300); diff --git a/app/src/main/java/com/wagerrwallet/tools/manager/BRSharedPrefs.java b/app/src/main/java/com/wagerrwallet/tools/manager/BRSharedPrefs.java index d3637b139..75646b9ae 100644 --- a/app/src/main/java/com/wagerrwallet/tools/manager/BRSharedPrefs.java +++ b/app/src/main/java/com/wagerrwallet/tools/manager/BRSharedPrefs.java @@ -458,6 +458,19 @@ public static void putShareDataDismissed(Context context, boolean dismissed) { editor.apply(); } + public static boolean getFingerprintDismissed(Context context) { + SharedPreferences settingsToGet = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); + return settingsToGet.getBoolean("FingerprintDismissed", false); + } + + public static void putFingerprintDismissed(Context context, boolean dismissed) { + if (context == null) return; + SharedPreferences settings = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.putBoolean("FingerprintDismissed", dismissed); + editor.apply(); + } + public static String getTrustNode(Context context, String iso) { SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); return prefs.getString("trustNode_" + iso.toUpperCase(), ""); diff --git a/app/src/main/java/com/wagerrwallet/tools/manager/PromptManager.java b/app/src/main/java/com/wagerrwallet/tools/manager/PromptManager.java index 5e10e871a..27d471a5a 100644 --- a/app/src/main/java/com/wagerrwallet/tools/manager/PromptManager.java +++ b/app/src/main/java/com/wagerrwallet/tools/manager/PromptManager.java @@ -86,7 +86,7 @@ public boolean shouldPrompt(Context app, PromptItem item) { assert (app != null); switch (item) { case FINGER_PRINT: - return !BRSharedPrefs.getUseFingerprint(app) && Utils.isFingerprintAvailable(app); + return !BRSharedPrefs.getUseFingerprint(app) && Utils.isFingerprintAvailable(app) && !BRSharedPrefs.getFingerprintDismissed(app); case PAPER_KEY: return !BRSharedPrefs.getPhraseWroteDown(app); case UPGRADE_PIN: @@ -95,7 +95,7 @@ public boolean shouldPrompt(Context app, PromptItem item) { BaseWalletManager wallet = WalletsMaster.getInstance(app).getCurrentWallet(app); return wallet != null && BRSharedPrefs.getScanRecommended(app, wallet.getIso(app)); case SHARE_DATA: - return !BRSharedPrefs.getShareData(app) && !BRSharedPrefs.getShareDataDismissed(app); + return false; /*!BRSharedPrefs.getShareData(app) && !BRSharedPrefs.getShareDataDismissed(app);*/ // disabled by request } return false; diff --git a/app/src/main/java/com/wagerrwallet/tools/util/BRConstants.java b/app/src/main/java/com/wagerrwallet/tools/util/BRConstants.java index e39a9e4bc..7713716f4 100644 --- a/app/src/main/java/com/wagerrwallet/tools/util/BRConstants.java +++ b/app/src/main/java/com/wagerrwallet/tools/util/BRConstants.java @@ -117,6 +117,8 @@ public class BRConstants { public static final String loopBug = "android-loop-bug"; public static final String bchFaq = "bitcoin-cash"; + public static final String betSlip = "bet-slip"; + private BRConstants() { } diff --git a/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java b/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java index 48695498c..6d43c56ff 100644 --- a/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java +++ b/app/src/main/java/com/wagerrwallet/wallet/wallets/wagerr/WalletWagerrManager.java @@ -287,7 +287,7 @@ public List getTxUiHolders() { tx.getOutputAddresses(), tx.getInputAddresses(), getWallet().getBalanceAfterTransaction(tx), (int) tx.getSize(), getWallet().getTransactionAmount(tx), getWallet().transactionIsValid(tx) - , (tx.getInputAddresses().length==1 && tx.getOutputAddresses().length>=1 && tx.getInputAddresses()[0].length()==0 && tx.getOutputAddresses()[0].length()==0) ); // is coinbase or POS + , (tx.getInputAddresses().length==1 && tx.getOutputAddresses().length>=1 && tx.getOutputAddresses()[0].length()==0) ); // is coinbase or POS BetEntity be = WagerrOpCodeManager.getEventIdFromCoreTx(tx); txUiHolder.setBetEntity(be); diff --git a/app/src/main/jni/breadwallet-core b/app/src/main/jni/breadwallet-core index d477b76e9..867b82ecc 160000 --- a/app/src/main/jni/breadwallet-core +++ b/app/src/main/jni/breadwallet-core @@ -1 +1 @@ -Subproject commit d477b76e982749429ec2dd287cef7b3c8f4ca446 +Subproject commit 867b82ecc10ca4f83142db5d663fb022aaab7335 diff --git a/app/src/main/res/layout/event_details.xml b/app/src/main/res/layout/event_details.xml index e66aeec6d..3c2d675ca 100644 --- a/app/src/main/res/layout/event_details.xml +++ b/app/src/main/res/layout/event_details.xml @@ -20,11 +20,22 @@ android:layout_height="28dp" android:layout_marginBottom="-35dp" android:layout_above="@+id/tx_eventheader" - android:layout_alignParentRight="true" - android:layout_marginRight="30dp" + android:layout_alignParentLeft="true" + android:layout_marginLeft="15dp" android:padding="50dp" android:background="@drawable/ic_close_light_grey"/> + + diff --git a/app/src/main/res/layout/transaction_details.xml b/app/src/main/res/layout/transaction_details.xml index f22776341..996762c28 100644 --- a/app/src/main/res/layout/transaction_details.xml +++ b/app/src/main/res/layout/transaction_details.xml @@ -199,47 +199,14 @@ android:textSize="12sp" app:customTFont="CircularPro-Book.otf" /> - - - - - @@ -383,6 +350,22 @@ android:textColor="@color/settings_chevron_right" app:customTFont="CircularPro-Book.otf"/> + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index dda68b4e3..8643fd48e 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -74,7 +74,8 @@ #e0e5e8 #b3c0c8 #4cbf2c - #df001c + #4cbf2c + #df001c #cccccc #f46b41 #70ffffff