Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀[ Release v.2.6.0] Merge into Main #12

Merged
merged 5 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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