Skip to content
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
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ dependencies {
}
}

implementation("androidx.webkit:webkit:1.9.0")
implementation(libs.androidx.core)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.legacy.support)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ class IntroLanguageResource {
"Sei sicuro di voler cambiare la lingua in italiano?",
Language.ITALIAN
),
IntroLanguage(
Language.BLANK.code,
Language.BLANK.title,
" ",
R.raw.english,
" ",
Language.BLANK
),
)
}

Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/brainwallet/data/model/Language.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ enum class Language(
CHINESE_SIMPLIFIED("zh-CN", "简化字", "选择语言"),
HINDI("hi", "हिंदी", "भाषा चुने"),
ITALIAN("it", "Italiano", "Seleziona la lingua"),
BLANK(" ", " ", " "),
;

companion object {
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/com/brainwallet/navigation/MainNav.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.navigation.toRoute
import com.brainwallet.ui.screens.inputwords.InputWordsScreen
import com.brainwallet.ui.screens.ready.ReadyScreen
import com.brainwallet.ui.screens.setpasscode.SetPasscodeScreen
import com.brainwallet.ui.screens.topup.TopUpScreen
import com.brainwallet.ui.screens.unlock.UnLockScreen
import com.brainwallet.ui.screens.welcome.WelcomeScreen
import com.brainwallet.ui.screens.yourseedproveit.YourSeedProveItScreen
Expand Down Expand Up @@ -65,6 +66,12 @@ fun NavGraphBuilder.mainNavGraph(
composable<Route.Ready> {
ReadyScreen(onNavigate = onNavigate)
}

composable<Route.TopUp> { navBackStackEntry ->
val route: Route.TopUp = navBackStackEntry.toRoute()
TopUpScreen(onNavigate = onNavigate)
}

composable<Route.SetPasscode> { navBackStackEntry ->
val route: Route.SetPasscode = navBackStackEntry.toRoute()
SetPasscodeScreen(onNavigate = onNavigate, passcode = route.passcode)
Expand All @@ -90,6 +97,8 @@ fun NavGraphBuilder.mainNavGraph(
seedWords = route.seedWords
)
}


/**
* for now, still using old activity & fragment [com.brainwallet.presenter.activities.BreadActivity]
*/
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/brainwallet/navigation/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ sealed class Route : JavaSerializable {
@Serializable
object Ready : Route()

@Serializable
object TopUp : Route()

@Serializable
data class SetPasscode(
val passcode: List<Int> = emptyList()
Expand All @@ -37,4 +40,5 @@ sealed class Route : JavaSerializable {

@Serializable
object UnLock : Route()

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import android.os.Bundle
import androidx.compose.ui.platform.ViewCompositionStrategy
import com.brainwallet.databinding.ActivityPaperKeyProveBinding
import com.brainwallet.presenter.activities.util.BRActivity
import com.brainwallet.tools.animation.BRAnimator
import com.brainwallet.tools.manager.BRSharedPrefs
import com.brainwallet.ui.screens.yourseedproveit.YourSeedProveItEvent
import com.brainwallet.ui.screens.yourseedproveit.YourSeedProveItScreen
import com.brainwallet.ui.theme.setContentWithTheme

@Deprecated(message = "move to compose")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public View onCreateView(LayoutInflater inflater,
itemList.add(new BRMenuItem(getString(R.string.MenuButton_support), R.drawable.faq_question_black, v -> {
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(getContext(), Uri.parse(BRConstants.CUSTOMER_SUPPORT_LINK));
customTabsIntent.launchUrl(getContext(), Uri.parse(BRConstants.WEB_LINK));
AnalyticsManager.logCustomEvent(BRConstants._20201118_DTGS);
}));

Expand Down
27 changes: 8 additions & 19 deletions app/src/main/java/com/brainwallet/tools/manager/BRApiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,8 @@ public void startTimer(Context context) {
timer.schedule(timerTask, 0, 4000);
}

public void stopTimerTask() {
//stop the timer, if it's not already null
if (timer != null) {
timer.cancel();
timer = null;
}
}

public JSONArray fetchRates(Activity activity) {
String jsonString = createGETRequestURL(activity, getBaseUrlProd() + "/api/v1/rates");
String jsonString = createGETRequestURL(activity, BW_API_PROD_HOST + "/api/v1/rates");
JSONArray jsonArray = null;
if (jsonString == null) return null;
try {
Expand Down Expand Up @@ -180,17 +172,14 @@ private String createGETRequestURL(Context app, String myURL) {
Timber.i("timber: urlGET: %s resp is null", myURL);
return null;
}
response = resp.body().string();
String strDate = resp.header("date");
if (strDate == null) {
Timber.i("timber: urlGET: strDate is null!");
return response;
}
SimpleDateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
Date date = formatter.parse(strDate);
long timeStamp = date.getTime();
///Set timestamp to prefs
long timeStamp = new Date().getTime();
BRSharedPrefs.putSecureTime(app, timeStamp);
} catch (ParseException | IOException e) {

assert resp.body() != null;
response = resp.body().string();

} catch (IOException e) {
Timber.e(e);
} finally {
if (resp != null) resp.close();
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/brainwallet/tools/util/BRConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ private BRConstants() {
public static final String TWITTER_LINK = "https://twitter.com/Brainwallet_App";
public static final String INSTAGRAM_LINK = "https://www.instagram.com/brainwalletapp";
public static final String WEB_LINK = "https://brainwallet.co";
public static final String TOS_LINK = "https://brainwallet.co/privacy";
public static String CUSTOMER_SUPPORT_LINK = "https://support.brainwallet.co/hc/en-us/requests/new";
public static final String TOS_LINK = "https://brainwallet.co/privacy-policy.html";
public static final String MOBILE_MP_LINK = "https://brainwallet.co/mobile-top-up.html";
public static String BITREFILL_AFFILIATE_LINK = "https://www.bitrefill.com/";

/**
Expand Down
75 changes: 0 additions & 75 deletions app/src/main/java/com/brainwallet/ui/composable/FiatDropdown.kt

This file was deleted.

This file was deleted.

54 changes: 54 additions & 0 deletions app/src/main/java/com/brainwallet/ui/composable/MediumButton.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.brainwallet.ui.composable

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.FilledTonalButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.drawscope.ContentDrawScope
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.brainwallet.ui.screens.welcome.WelcomeScreen
import com.brainwallet.ui.theme.BrainwalletColors
import com.brainwallet.ui.theme.BrainwalletTheme

@Composable
fun MediumTextButton(
modifier: Modifier = Modifier,
onClick: () -> Unit,
colors: ButtonColors = ButtonDefaults.buttonColors(
containerColor = BrainwalletTheme.colors.surface,
contentColor = BrainwalletTheme.colors.content
),
shape: Shape = ButtonDefaults.shape,
content: @Composable RowScope.() -> Unit
) {
FilledTonalButton(
modifier = modifier
.fillMaxWidth()
.height(45.dp),
onClick = onClick,
colors = colors,
shape = shape,
content = content
)
}
@Preview
@Composable
fun MediumTextButtonPreview() {
MediumTextButton(
modifier = TODO(),
onClick = TODO(),
colors = TODO(),
shape = TODO(),
content = TODO()
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fun ReadyScreen(

BorderedLargeButton(
onClick = {
onNavigate.invoke(UiEffect.Navigate(Route.SetPasscode()))
onNavigate.invoke(UiEffect.Navigate(Route.SetPasscode()))
},
modifier = Modifier.fillMaxWidth()

Expand All @@ -134,7 +134,6 @@ fun ReadyScreen(
style = MaterialTheme.typography.bodyLarge
)
}

Spacer(modifier = Modifier.weight(0.05f))
}
}
Expand Down
Loading