Skip to content

Commit 3100e15

Browse files
kcw-gruntvsima
andauthored
🚀[ Release v.2.7.0] Merge into Main (#30)
* Added український language - add uk xml file - removed the nl, sv, da files - Escaped apostrphes in UK strings file - Updated language choices * 💣🐞[Hotbug fix] sharedprefs fb fix (#19) * Added notes * Bugfix - add missing pendingIntent flag for android 13 * Use firebase bom * subproject commit * version bump * Disabled FB send, Added Get Tasks * Patch to hard code fees - Static fees - Removed the dep - Turn crashlytics back on/off/on Co-authored-by: Victor Sima <[email protected]> * 🚀[ Release v.2.6.0] Merge into Develop (#13) * version bump * Hotfix/crashes v2.6.0 (#17) * Added notes * Bugfix - add missing pendingIntent flag for android 13 * Use firebase bom Co-authored-by: kcw-grunt <[email protected]> Co-authored-by: Victor Sima <[email protected]> * 🚀[Release] v2.6.1 (#21) * version code bump * 🚀[ Release v.2.6.0] Merge into Main (#12) * Added український language - add uk xml file - removed the nl, sv, da files - Escaped apostrphes in UK strings file - Updated language choices * 🥳[Feature] Unstoppable ext update (#11) * WIP: DNC Dropped in the UD code prior to testing * Added study link * Fix unstoppable domains dependency * Updated the UD ext text WIP::::Need to refactor once UK and deletion on SV, NL, DA * added UK lang Co-authored-by: Victor Sima <[email protected]> * version bump * Hotfix/crashes v2.6.0 (#17) * Added notes * Bugfix - add missing pendingIntent flag for android 13 * Use firebase bom Co-authored-by: kcw-grunt <[email protected]> Co-authored-by: Victor Sima <[email protected]> Co-authored-by: Victor Sima <[email protected]> * Feature/add bitrefill (#28) * added bitrefill - added kotlin fix * Added localizations - added logo * Added Bitrefill Link * hides fiat scollview from Bitrefill * Adjusted the padding at the buy tab item view * fixe test in Bitrefill detail * fied logo and layout * bump version and version code * Feature/update branding (#29) * added new logo - reset the layout * version code * replaced coin logo * bump versioncode * fixed dep version * added Bitrefill web listener Co-authored-by: Victor Sima <[email protected]>
1 parent 01ebc68 commit 3100e15

30 files changed

+283
-40
lines changed

.idea/assetWizardSettings.xml

+201-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+8-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ android {
6464
applicationId = 'com.loafwallet'
6565
minSdkVersion 27
6666
targetSdkVersion 31
67-
versionCode 674
68-
versionName "v2.6.1"
67+
versionCode 684
68+
versionName "v2.7.0"
6969
multiDexEnabled true
7070
archivesBaseName = "${versionName}(${versionCode})"
7171

@@ -244,6 +244,7 @@ android {
244244
}
245245

246246
}
247+
namespace 'com.breadwallet'
247248
}
248249

249250
task copyResDirectoryToClasses(type: Copy) {
@@ -328,6 +329,11 @@ dependencies {
328329

329330
// Ktlint
330331
ktlint 'com.pinterest:ktlint:0.44.0'
332+
333+
//kotlin https://stackoverflow.com/questions/69817925/problem-duplicate-class-androidx-lifecycle-viewmodel-found-in-modules
334+
def lifecycle_version = "2.4.0"
335+
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
336+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
331337
}
332338

333339
task ktlint(type: JavaExec, group: "verification") {

app/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.breadwallet">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.CAMERA"/>
65
<uses-permission android:name="android.permission.INTERNET"/>

app/src/main/java/com/breadwallet/presenter/fragments/BuyPartnersAdapter.java

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public void onBindViewHolder(@NonNull final PartnerViewHolder holder, int positi
5757
holder.fiatOptionHScrollView.scrollTo((int) option.getX(), (int) option.getY());
5858
});
5959

60+
if (partner.getCode() == FragmentBuy.Partner.BITREFILL) {
61+
holder.fiatOptionHScrollView.setVisibility(View.INVISIBLE);
62+
holder.fiatOptions.setVisibility(View.INVISIBLE);
63+
}
64+
6065
holder.buyPartnerWrapper.setOnClickListener(v -> {
6166
int currencyResId = getCurrencyResId(holder.fiatOptions.getCheckedRadioButtonId());
6267
final Context context = v.getContext();

app/src/main/java/com/breadwallet/presenter/fragments/BuyTabFragment.java

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
5151

5252
private List<Partner> getPartners() {
5353
List<Partner> partners = new ArrayList<>();
54+
partners.add(new Partner(R.drawable.bitrefill_logo, R.string.BuyCenter_bitrefill_Title, R.string.BuyCenter_bitrefill_FinancialDetails, FragmentBuy.Partner.BITREFILL));
5455
partners.add(new Partner(R.drawable.ic_moonpay_logo, R.string.BuyCenter_moonpay_Title, R.string.BuyCenter_moonpay_FinancialDetails, FragmentBuy.Partner.MOONPAY));
5556
partners.add(new Partner(R.drawable.simplex_logo, R.string.BuyCenter_simplex_Title, R.string.BuyCenter_simplex_FinancialDetails, FragmentBuy.Partner.SIMPLEX));
5657
return partners;

app/src/main/java/com/breadwallet/presenter/fragments/FragmentBuy.java

+25-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import android.webkit.WebSettings;
2020
import android.webkit.WebView;
2121
import android.webkit.WebViewClient;
22+
2223
import android.widget.LinearLayout;
2324
import android.widget.ProgressBar;
2425

@@ -31,6 +32,7 @@
3132
import com.breadwallet.R;
3233
import com.breadwallet.tools.animation.BRAnimator;
3334
import com.breadwallet.tools.manager.BRSharedPrefs;
35+
import com.breadwallet.tools.util.BRConstants;
3436
import com.breadwallet.tools.util.Utils;
3537

3638
import java.util.Date;
@@ -91,17 +93,37 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
9193
webSettings.setDomStorageEnabled(true);
9294
webSettings.setJavaScriptEnabled(true);
9395

96+
// App (in Java)
97+
WebMessageListener bitrefillListener = new WebMessageListener() {
98+
@Override
99+
public void onPostMessage(WebView view, WebMessageCompat message, Uri sourceOrigin,
100+
boolean isMainFrame, JavaScriptReplyProxy replyProxy) {
101+
// do something about view, message, sourceOrigin and isMainFrame.
102+
replyProxy.postMessage("Got it!");
103+
}
104+
};
105+
if (WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER)) {
106+
WebViewCompat.addWebMessageListener(webView, "bitrefillPostObj", rules, bitrefillListener);
107+
}
108+
94109

95110
String currency = getArguments().getString(CURRENCY_KEY);
96111
Partner partner = (Partner) getArguments().getSerializable(PARTNER_KEY);
97112

98-
String buyUrl = url(getContext(), partner, currency);
113+
String bitrefillRef = "bAshL935";
114+
String utmSource = "LitewalletAndroid";
115+
String bitrefillUrl = String.format( BRConstants.BITREFILL_AFFILIATE_LINK + "/embed/?paymentMethod=litecoin&ref=%s&utm_source=%s", bitrefillRef,utmSource);
116+
117+
String buyUrl = partner == Partner.BITREFILL ? bitrefillUrl : url(getContext(), partner, currency);
118+
99119
Timber.d("URL %s", buyUrl);
100120
webView.loadUrl(buyUrl);
121+
101122
return rootView;
102123
}
103124

104-
public static String url(Context context, Partner partner, String currency) {
125+
126+
public static String url(Context context, Partner partner, String currency) {
105127
String walletAddress = BRSharedPrefs.getReceiveAddress(context);
106128
Long timestamp = new Date().getTime();
107129
String uuid = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
@@ -230,6 +252,6 @@ public void onPause() {
230252
}
231253

232254
public enum Partner {
233-
SIMPLEX, MOONPAY
255+
SIMPLEX, MOONPAY, BITREFILL
234256
}
235257
}

0 commit comments

Comments
 (0)