update review comments
This commit is contained in:
@@ -54,7 +54,7 @@ public class BraveRewardsSiteBannerActivity
|
||||
public static final int TIP_SUCCESS = 2;
|
||||
public static final int TIP_PENDING = 3;
|
||||
|
||||
private View progressBar;
|
||||
private View mProgressBar;
|
||||
private boolean mIsActivityIsActive;
|
||||
|
||||
private static final String TAG = "TippingBanner";
|
||||
@@ -66,14 +66,13 @@ public class BraveRewardsSiteBannerActivity
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.brave_rewards_site_banner);
|
||||
mIsActivityIsActive = true;
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
mProgressBar = findViewById(R.id.progressBar);
|
||||
mBraveRewardsNativeWorker = BraveRewardsNativeWorker.getInstance();
|
||||
mBraveRewardsNativeWorker.AddObserver(this);
|
||||
|
||||
currentTabId_ = IntentUtils.safeGetIntExtra(getIntent(), TAB_ID_EXTRA, -1);
|
||||
mIsMonthlyContribution =
|
||||
IntentUtils.safeGetBooleanExtra(getIntent(), IS_MONTHLY_CONTRIBUTION, false);
|
||||
mBannerInfo = null;
|
||||
if (savedInstanceState == null) {
|
||||
mBraveRewardsNativeWorker.GetPublisherBanner(
|
||||
mBraveRewardsNativeWorker.GetPublisherId(currentTabId_));
|
||||
@@ -90,10 +89,12 @@ public class BraveRewardsSiteBannerActivity
|
||||
try {
|
||||
mBannerInfo = new BraveRewardsBannerInfo(jsonBannerInfo);
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, "BraveRewardsSiteBannerActivity:onPublisherBanner JSONException error " + e);
|
||||
Log.e(TAG,
|
||||
"BraveRewardsSiteBannerActivity:onPublisherBanner JSONException error "
|
||||
+ e);
|
||||
}
|
||||
|
||||
progressBar.setVisibility(View.GONE);
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
|
||||
BraveRewardsCreatorPanelFragment creatorPanelFragment =
|
||||
BraveRewardsCreatorPanelFragment.newInstance(
|
||||
@@ -131,13 +132,13 @@ public class BraveRewardsSiteBannerActivity
|
||||
mAmount = amount;
|
||||
mIsMonthly = isMonthly;
|
||||
mTipUpdated = false;
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
enableTimeout(); // wait for 3 seconds
|
||||
}
|
||||
|
||||
private void tipConfirmation(int status, double amount, boolean isMonthly) {
|
||||
if (!mIsActivityIsActive) return;
|
||||
progressBar.setVisibility(View.GONE);
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
|
||||
String publisherName = "";
|
||||
if (mBannerInfo != null) publisherName = mBannerInfo.getName();
|
||||
|
||||
@@ -74,7 +74,6 @@ public class BraveRewardsCreatorPanelFragment extends Fragment
|
||||
|
||||
private static final String TAG = "TippingBanner";
|
||||
|
||||
|
||||
public static BraveRewardsCreatorPanelFragment newInstance(
|
||||
int tabId, boolean isMonthlyContribution, String bannerInfo) {
|
||||
BraveRewardsCreatorPanelFragment fragment = new BraveRewardsCreatorPanelFragment();
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -118,7 +119,7 @@ public class BraveRewardsCustomTipFragment extends Fragment {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (s == null || s.toString().isEmpty()) s = "0";
|
||||
if (TextUtils.isEmpty(s)) s = "0";
|
||||
Double batValue = getBatValue(s.toString());
|
||||
Double usdValue = exchangeRate * batValue;
|
||||
|
||||
@@ -156,7 +157,7 @@ public class BraveRewardsCustomTipFragment extends Fragment {
|
||||
*
|
||||
* @param inputValue : editText string passed here
|
||||
* @return
|
||||
* convert to bat value if current editText is usd
|
||||
* convert to bat value if current editText is USD
|
||||
* It will return multiple 0.25
|
||||
* And also return which is lower between Max and value
|
||||
* decimal points always roundedOff to floor value.
|
||||
@@ -164,7 +165,7 @@ public class BraveRewardsCustomTipFragment extends Fragment {
|
||||
private double getBatValue(String inputValue) {
|
||||
double rawValue = Double.parseDouble(inputValue);
|
||||
if (!isBatCurrencyMode) {
|
||||
// from usd to BAT
|
||||
// from USD to BAT
|
||||
rawValue = rawValue / exchangeRate;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -44,7 +44,6 @@ public class BraveRewardsTipConfirmationFragment extends Fragment implements Bra
|
||||
|
||||
private static final String TAG = "TippingBanner";
|
||||
|
||||
|
||||
public static BraveRewardsTipConfirmationFragment newInstance(
|
||||
int status, String name, double amount, boolean isMonthly) {
|
||||
BraveRewardsTipConfirmationFragment fragment = new BraveRewardsTipConfirmationFragment();
|
||||
@@ -125,7 +124,8 @@ public class BraveRewardsTipConfirmationFragment extends Fragment implements Bra
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
||||
} else {
|
||||
// error
|
||||
Log.e(TAG, "BraveRewardsTipConfirmationFragment -> setTweetClickListener invalid status ");
|
||||
Log.e(TAG,
|
||||
"BraveRewardsTipConfirmationFragment -> setTweetClickListener invalid status ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
<translation id="6306631474379759382">Next tip date:</translation>
|
||||
<translation id="3593485149443019592">Not enough tokens. Please <ph name="LINK_BEGIN"/>add funds<ph name="LINK_END"/>.</translation>
|
||||
<translation id="3586352807094428968">Brave collects 5% of the tip amount as a processing fee.</translation>
|
||||
<translation id="207268487070188114">One-Time Tip</translation>
|
||||
<translation id="207268487070188114">One-time tip</translation>
|
||||
<translation id="69861679024013299">One-time tip amount:</translation>
|
||||
<translation id="3669086939205397942">Hold on, you can’t tip yet</translation>
|
||||
<translation id="3288812755711687300"><ph name="USER"/>’s post</translation>
|
||||
|
||||
Reference in New Issue
Block a user