Skip to content

Commit

Permalink
🚀[ Release v.2.6.0] Merge into Main (#12)
Browse files Browse the repository at this point in the history
* 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 <vic.sima@gmail.com>

* 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 <mrkerrywashington@icloud.com>

Co-authored-by: Victor Sima <vic.sima@gmail.com>
  • Loading branch information
kcw-grunt and vsima authored May 24, 2022
1 parent 0e3928b commit d276ce5
Show file tree
Hide file tree
Showing 25 changed files with 887 additions and 2,332 deletions.
17 changes: 10 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ android {
applicationId = 'com.loafwallet'
minSdkVersion 27
targetSdkVersion 31
versionCode 671
versionName "v2.5.0"
versionCode 673
versionName "v2.6.0"
multiDexEnabled true
archivesBaseName = "${versionName}(${versionCode})"

Expand All @@ -90,7 +90,9 @@ android {
unitTests.returnDefaultValues = true
}
packagingOptions {
pickFirst 'protobuf.meta'
resources {
pickFirsts += ['protobuf.meta']
}
}
externalNativeBuild {
cmake {
Expand Down Expand Up @@ -300,15 +302,16 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.3.1'

// Firebase
implementation 'com.google.firebase:firebase-analytics:20.1.0'
implementation 'com.google.firebase:firebase-crashlytics:18.2.8'
implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.8'
implementation platform('com.google.firebase:firebase-bom:29.3.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-crashlytics-ndk'

// Timber
implementation 'com.jakewharton.timber:timber:5.0.1'

// Unstoppable domain
implementation 'com.unstoppabledomains:resolution:2.0.0'
implementation 'com.unstoppabledomains:resolution:5.0.0'

// Progress Button
implementation 'com.github.razir.progressbutton:progressbutton:2.1.0'
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/com/breadwallet/entities/Language.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ package com.breadwallet.entities
* Copyright © 2021 Litecoin Foundation. All rights reserved.
*/
enum class Language(val code: String, val title: String, val desc: String) {
DANISH("da", "Dansk", "Vælg sprog"),
GERMAN("de", "Deutsch", "Sprache auswählen"),
ENGLISH("en", "English", "Select language"),
SPANISH("es", "Español", "Seleccione el idioma"),
FRENCH("fr", "Français", "Sélectionner la langue"),
INDONESIAN("in", "Indonesia", "Pilih bahasa"),
ITALIAN("it", "Italiano", "Seleziona la lingua"),
DUTCH("nl", "Nederlands", "Selecteer taal"),
PORTUGUESE("pt", "Português", "Selecione o idioma"),
SWEDISH("sv", "Svenska", "Välj språk"),
TURKISH("tr", "Türkçe", "Dil Seçin"),
UKRAINIAN("uk", "Yкраїнський", "Оберіть мову"),
RUSSIAN("ru", "Pусский", "Выберите язык"),
KOREAN("ko", "한국어", "언어 선택"),
JAPANESE("ja", "日本語", "言語を選択する"),
CHINESE_SIMPLIFIED("zh-CN", "简化字", "选择语言"),
CHINESE_TRADITIONAL("zh-TW", "繁體字", "選擇語言");

companion object {
fun find(code: String?): Language = values().find { it.code == code } ?: ENGLISH
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.os.Build;

import androidx.core.app.NotificationCompat;

import com.breadwallet.presenter.activities.BreadActivity;
Expand All @@ -31,10 +33,12 @@ public static void sendNotification(Context ctx, int icon, String title, String
stackBuilder.addParentStack(BreadActivity.class);
// Adds the Intent that starts the Activity to the top of the stack
stackBuilder.addNextIntent(resultIntent);
int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ?
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_UPDATE_CURRENT;
PendingIntent resultPendingIntent =
stackBuilder.getPendingIntent(
0,
PendingIntent.FLAG_UPDATE_CURRENT
flags
);
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ import com.unstoppabledomains.resolution.Resolution
import com.unstoppabledomains.resolution.naming.service.NamingServiceType
import timber.log.Timber


/** Litewallet
* Created by Mohamed Barry on 12/23/20
* email: mosadialiou@gmail.com
* Copyright © 2020 Litecoin Foundation. All rights reserved.
*/
data class ResolutionResult(val error: NamingServiceException?, val address: String?)

class UDResolution {
private val tool: DomainResolution = Resolution.builder()
.infura(NamingServiceType.CNS, Network.MAINNET, BuildConfig.INFURA_KEY)
// .infura(NamingServiceType.CNS, Network.MAINNET, BuildConfig.INFURA_KEY)
.build()

fun resolve(domain: String): ResolutionResult {
Expand All @@ -29,4 +23,23 @@ class UDResolution {
ResolutionResult(err, null)
}
}
}
}

//https://github.com/unstoppabledomains/resolution-java/blob/master/samples.md
//data class ResolutionResult(val error: NamingServiceException?, val address: String?) {}
//
//class AsyncResolution : AsyncTask<String, String, ResolutionResult>() {
// private val tool: DomainResolution = Resolution()
//
// override fun doInBackground(vararg params: String?): ResolutionResult {
// val domain = params[0]
// val currency = params[1]
// return try {
// val address = this.tool.addr(domain, currency)
// ResolutionResult(null, address)
// } catch(err: NamingServiceException) {
// err.printStackTrace();
// ResolutionResult(err, null)
// }
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;

import com.breadwallet.presenter.activities.BreadActivity;
import com.breadwallet.tools.listeners.SyncReceiver;
Expand All @@ -29,10 +30,13 @@ private SyncManager() {
}

private void createAlarm(Context app, long time) {
//Add another flag
AlarmManager alarmManager = (AlarmManager) app.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(app, SyncReceiver.class);
intent.setAction(SyncReceiver.SYNC_RECEIVER);//my custom string action name
PendingIntent pendingIntent = PendingIntent.getService(app, 1001, intent, PendingIntent.FLAG_UPDATE_CURRENT);
int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ?
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_UPDATE_CURRENT;
PendingIntent pendingIntent = PendingIntent.getService(app, 1001, intent, flags);
alarmManager.setWindow(AlarmManager.RTC_WAKEUP, time, time + TimeUnit.MINUTES.toMillis(1), pendingIntent);//first start will start asap
}

Expand Down
9 changes: 4 additions & 5 deletions app/src/main/res/layout/fragment_send.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,17 @@
<EditText
android:id="@+id/ud_address_edit"
style="@style/BREditStyle"
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_width="wrap_content"
android:layout_height="65dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:ellipsize="middle"
android:ems="10"
android:ems="8"
android:hint="@string/Send.UnstoppableDomains.placeholder"
android:inputType="textPersonName"
android:singleLine="true" />
tools:ignore="TextContrastCheck" />

<com.breadwallet.presenter.customviews.BRButton
android:id="@+id/ud_lookup_button"
Expand Down
Loading

0 comments on commit d276ce5

Please sign in to comment.