Delete BraveRewardsDonationSentActivity
This commit is contained in:
@@ -161,7 +161,6 @@ brave_java_resources = [
|
||||
"java/res/drawable-nodpi/eth.png",
|
||||
"java/res/drawable-nodpi/fee_icon.png",
|
||||
"java/res/drawable-nodpi/ic_quick_action_search_and_bookmark_widget_preview.png",
|
||||
"java/res/drawable-nodpi/loader0.png",
|
||||
"java/res/drawable-nodpi/loader0_orange.png",
|
||||
"java/res/drawable-xhdpi/bat_unverified.png",
|
||||
"java/res/drawable-xhdpi/bat_verified.png",
|
||||
@@ -651,9 +650,7 @@ brave_java_resources = [
|
||||
"java/res/drawable/orange_rounded_button.xml",
|
||||
"java/res/drawable/p2p_rewards_inside_background.xml",
|
||||
"java/res/drawable/pending_tx_placeholder.xml",
|
||||
"java/res/drawable/progress_indeterminate.xml",
|
||||
"java/res/drawable/progress_indeterminate_orange.xml",
|
||||
"java/res/drawable/publisher_favicon_background.xml",
|
||||
"java/res/drawable/quick_action_search_and_bookmark_widget_background.xml",
|
||||
"java/res/drawable/quick_action_search_and_bookmark_widget_bookmark_bg.xml",
|
||||
"java/res/drawable/quick_action_search_and_bookmark_widget_search_bg.xml",
|
||||
@@ -804,7 +801,6 @@ brave_java_resources = [
|
||||
"java/res/layout/brave_rating_dialog_fragment.xml",
|
||||
"java/res/layout/brave_rating_news_layout.xml",
|
||||
"java/res/layout/brave_rating_thanks_feedback_dialog.xml",
|
||||
"java/res/layout/brave_rewards_donation_sent.xml",
|
||||
"java/res/layout/brave_rewards_onboarding_ac_layout.xml",
|
||||
"java/res/layout/brave_rewards_onboarding_item_layout.xml",
|
||||
"java/res/layout/brave_rewards_onboarding_layout.xml",
|
||||
|
||||
@@ -29,7 +29,6 @@ brave_java_sources = [
|
||||
"../../brave/android/java/org/chromium/chrome/browser/BraveLocalState.java",
|
||||
"../../brave/android/java/org/chromium/chrome/browser/BraveRelaunchUtils.java",
|
||||
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsBalance.java",
|
||||
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsDonationSentActivity.java",
|
||||
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsExternalWallet.java",
|
||||
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java",
|
||||
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsNativeWorker.java",
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
android:exported="false">
|
||||
</receiver>
|
||||
|
||||
<activity android:name="org.chromium.chrome.browser.BraveRewardsDonationSentActivity"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" />
|
||||
|
||||
<activity
|
||||
android:name="org.chromium.chrome.browser.rewards.tipping.RewardsTippingBannerActivity"
|
||||
android:theme="@style/TippingBraveTranslucent"
|
||||
|
||||
@@ -1,211 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2023 The Brave Authors. All rights reserved.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package org.chromium.chrome.browser;
|
||||
|
||||
import static java.util.Locale.getDefault;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.view.animation.Animation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.chromium.base.IntentUtils;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.BraveRewardsHelper;
|
||||
import org.chromium.chrome.browser.BraveRewardsNativeWorker;
|
||||
import org.chromium.chrome.browser.BraveRewardsObserver;
|
||||
import org.chromium.chrome.browser.rewards.tipping.RewardsTippingBannerActivity;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
|
||||
import java.text.DateFormat;
|
||||
|
||||
public class BraveRewardsDonationSentActivity extends Activity implements BraveRewardsHelper.LargeIconReadyCallback, BraveRewardsObserver {
|
||||
|
||||
private final int SLIDE_UP_DURATION = 2000;
|
||||
private final int PUBLISHER_ICON_SIDE_LEN= 70;
|
||||
private int currentTabId_ = -1;
|
||||
private BraveRewardsNativeWorker mBraveRewardsNativeWorker;
|
||||
private BraveRewardsHelper mIconFetcher;
|
||||
private int mAmount_;
|
||||
private boolean mMonthly_tip_;
|
||||
private String mPublisher_name_;
|
||||
private java.util.Date mReconcileStamp_;
|
||||
private final Handler mHandler = new Handler(); //fadeout handler
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.brave_rewards_donation_sent);
|
||||
currentTabId_ = IntentUtils.safeGetIntExtra(
|
||||
getIntent(), RewardsTippingBannerActivity.TAB_ID_EXTRA, -1);
|
||||
mBraveRewardsNativeWorker = BraveRewardsNativeWorker.getInstance();
|
||||
mBraveRewardsNativeWorker.AddObserver(this);
|
||||
|
||||
String publisherFavIconURL =
|
||||
mBraveRewardsNativeWorker.GetPublisherFavIconURL(currentTabId_);
|
||||
Tab currentActiveTab = BraveRewardsHelper.currentActiveChromeTabbedActivityTab();
|
||||
String url = currentActiveTab != null ? currentActiveTab.getUrl().getSpec() : "";
|
||||
String favicon_url = (publisherFavIconURL.isEmpty()) ? url : publisherFavIconURL;
|
||||
mIconFetcher = new org.chromium.chrome.browser.BraveRewardsHelper(currentActiveTab);
|
||||
mIconFetcher.retrieveLargeIcon(favicon_url, this);
|
||||
SetData();
|
||||
SetAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
if (null != mBraveRewardsNativeWorker) {
|
||||
mBraveRewardsNativeWorker.RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SetAnimation() {
|
||||
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||
int height = metrics.heightPixels;
|
||||
View floater = findViewById(R.id.floater);
|
||||
|
||||
|
||||
Animation fadeIn = new AlphaAnimation(0, 1);
|
||||
fadeIn.setInterpolator(new AccelerateInterpolator());
|
||||
fadeIn.setStartOffset(0);
|
||||
fadeIn.setDuration(BraveRewardsHelper.THANKYOU_FADE_IN_DURATION);
|
||||
|
||||
|
||||
fadeIn.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation arg0) { }
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation arg0) {}
|
||||
@Override
|
||||
public void onAnimationEnd(Animation arg0) {
|
||||
//stay and then fade out
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//fade out animation
|
||||
Animation fadeOut = new AlphaAnimation(1, 0);
|
||||
fadeOut.setInterpolator(new AccelerateInterpolator());
|
||||
fadeOut.setStartOffset(0);
|
||||
fadeOut.setDuration(BraveRewardsHelper.THANKYOU_FADE_OUT_DURATION);
|
||||
|
||||
fadeOut.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation arg0) {}
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation arg0) {}
|
||||
@Override
|
||||
public void onAnimationEnd(Animation arg0) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.floater).startAnimation(fadeOut);
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}, BraveRewardsHelper.THANKYOU_STAY_DURATION);
|
||||
|
||||
}
|
||||
});
|
||||
floater.startAnimation(fadeIn);
|
||||
}
|
||||
|
||||
|
||||
private void SetData() {
|
||||
Intent intent = getIntent();
|
||||
if (-1 == currentTabId_) {
|
||||
currentTabId_ = IntentUtils.safeGetIntExtra(
|
||||
intent, RewardsTippingBannerActivity.TAB_ID_EXTRA, -1);
|
||||
}
|
||||
|
||||
mPublisher_name_ = mBraveRewardsNativeWorker.GetPublisherName(currentTabId_);
|
||||
mAmount_ = IntentUtils.safeGetIntExtra(
|
||||
intent, RewardsTippingBannerActivity.TIP_AMOUNT_EXTRA, 0);
|
||||
mMonthly_tip_ = IntentUtils.safeGetBooleanExtra(
|
||||
intent, RewardsTippingBannerActivity.TIP_MONTHLY_EXTRA, false);
|
||||
|
||||
//set the data
|
||||
String strAmount = String.format(
|
||||
getDefault(), "%.3f " + BraveRewardsHelper.BAT_TEXT, (float) mAmount_);
|
||||
((TextView)findViewById(R.id.txt_pub_name)).setText(mPublisher_name_);
|
||||
|
||||
if (true == mMonthly_tip_) {
|
||||
//change `txt_you_sent` message
|
||||
String monthly_send_msg = getResources().getString(R.string.brave_ui_auto_tip_text);
|
||||
((TextView)findViewById(R.id.txt_you_sent)).setText(monthly_send_msg);
|
||||
|
||||
//add 'Monthly' to amount
|
||||
strAmount += ", ";
|
||||
String monthly = getResources().getString(R.string.brave_ui_monthly_text);
|
||||
strAmount += monthly;
|
||||
|
||||
//get next reconcile stamp
|
||||
//the `txt_tip_will_be_sent` and `txt_send_date` will be made visible in OnGetReconcileStamp
|
||||
mBraveRewardsNativeWorker.GetReconcileStamp();
|
||||
|
||||
}
|
||||
((TextView)findViewById(R.id.txt_amount)).setText(strAmount);
|
||||
}
|
||||
|
||||
|
||||
private void SetFavIcon(Bitmap bmp) {
|
||||
if (bmp != null) {
|
||||
runOnUiThread(
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImageView iv = (ImageView) findViewById(R.id.publisher_favicon);
|
||||
int nPx = BraveRewardsHelper.dp2px(PUBLISHER_ICON_SIDE_LEN);
|
||||
Bitmap resized = Bitmap.createScaledBitmap(bmp, nPx, nPx, true);
|
||||
|
||||
View fadeout = findViewById(R.id.publisher_favicon_update);
|
||||
BraveRewardsHelper.crossfade(fadeout, iv, View.GONE, 1f, BraveRewardsHelper.CROSS_FADE_DURATION);
|
||||
iv.setImageBitmap(BraveRewardsHelper.getCircularBitmap(resized));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLargeIconReady(Bitmap icon) {
|
||||
SetFavIcon(icon);
|
||||
}
|
||||
|
||||
|
||||
// BraveRewardsObserver/////////////////////////////////////
|
||||
@Override
|
||||
public void OnGetReconcileStamp(long timestamp) {
|
||||
//make reconcile date views visible
|
||||
if (true == mMonthly_tip_) {
|
||||
findViewById(R.id.txt_tip_will_be_sent).setVisibility(View.VISIBLE);
|
||||
|
||||
TextView send_date = (TextView) findViewById(R.id.txt_send_date);
|
||||
send_date.setVisibility(View.VISIBLE);
|
||||
mReconcileStamp_ = new java.util.Date(timestamp * 1000); //ms
|
||||
DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT, getDefault());
|
||||
send_date.setText(formatter.format (mReconcileStamp_));
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 553 B |
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/loader0"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%" />
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval" android:innerRadius="90dp">
|
||||
<corners android:radius="100dp" />
|
||||
<solid android:color="@android:color/white"/>
|
||||
</shape>
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".site_banner2"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/transparent"
|
||||
android:id="@+id/floater">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#E62F3140"
|
||||
tools:fontFamily="@font/poppins_600"
|
||||
android:gravity="center">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_centerHorizontal="true"
|
||||
android:id="@+id/frame_publisher_favicon"
|
||||
android:layout_height="80dp"
|
||||
android:layout_width="80dp"
|
||||
android:background="@drawable/publisher_favicon_background">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_publisher_favicon"
|
||||
android:indeterminateDrawable="@drawable/progress_indeterminate"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/publisher_favicon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
android:visibility="gone"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_thank_you"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/frame_publisher_favicon"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:paddingTop="10dp"
|
||||
android:text="@string/brave_ui_thank_you"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_you_sent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/brave_ui_tip_text"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_below="@id/txt_thank_you"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_pub_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:text="@string/brave_ui_auto_tip_text"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_below="@id/txt_you_sent"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_amount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/brave_ui_monthly_text"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_below="@id/txt_pub_name"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_tip_will_be_sent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:text="@string/brave_ui_first_tip_text"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_below="@id/txt_amount"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_send_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/brave_ui_thank_you"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_below="@id/txt_tip_will_be_sent"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="#cb5737"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -876,21 +876,6 @@ This file contains all "about" strings. It is set to NOT be translated, in tran
|
||||
<message name="IDS_MENU_BRAVE_REWARDS" desc="Title for brave rewards menu item">
|
||||
Brave Rewards
|
||||
</message>
|
||||
<message name="IDS_BRAVE_UI_THANK_YOU" desc="A message that appears after tipping">
|
||||
Thank you
|
||||
</message>
|
||||
<message name="IDS_BRAVE_UI_TIP_TEXT" desc="string from Thank you screen">
|
||||
You've just sent a contribution to:
|
||||
</message>
|
||||
<message name="IDS_BRAVE_UI_AUTO_TIP_TEXT" desc="string from Thank you screen">
|
||||
You are automatically sending a contribution to:
|
||||
</message>
|
||||
<message name="IDS_BRAVE_UI_MONTHLY_TEXT" desc="string from Thank you screen">
|
||||
Monthly
|
||||
</message>
|
||||
<message name="IDS_BRAVE_UI_FIRST_TIP_TEXT" desc="string from Thank you screen">
|
||||
Your first monthly contribution will be sent on:
|
||||
</message>
|
||||
<message name="IDS_LOGGED_OUT_STATE_DIALOG_TEXT" desc="Rewards logged out state text">
|
||||
Log in to <ph name="WALLET_PROVIDER">%1$s</ph> to see your balance
|
||||
</message>
|
||||
|
||||
Reference in New Issue
Block a user