Skip to content

Commit

Permalink
Component upgrade (#1657)
Browse files Browse the repository at this point in the history
ActionSheet Implementation first stage.
  • Loading branch information
JamesSmartCell authored Jan 28, 2021
1 parent 2384417 commit 51f86fa
Show file tree
Hide file tree
Showing 398 changed files with 13,717 additions and 6,214 deletions.
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ android {
}
}
defaultConfig {
versionCode 133
versionName "3.20.5"
versionCode 138
versionName "3.24.0"

applicationId "io.stormbird.wallet"
minSdkVersion 23
Expand All @@ -46,7 +46,7 @@ android {
//Put your Infura key here, NB with over 30 - 40 users this API key will rate limit, it's only here for bootstrapping a free build
def DEFAULT_INFURA_API_KEY = "\"da3717f25f824cc1baa32d812386d93f\"";

buildConfigField 'int', 'DB_VERSION', '15'
buildConfigField 'int', 'DB_VERSION', '22'
buildConfigField "String", XInfuraAPI, DEFAULT_INFURA_API_KEY

ndk {
Expand Down Expand Up @@ -107,7 +107,7 @@ android {
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
dependencies {
implementation 'com.google.firebase:firebase-analytics:17.6.0'
implementation 'com.google.firebase:firebase-analytics:18.0.1'
implementation 'com.mixpanel.android:mixpanel-android:5.8.4'
}
}
Expand Down Expand Up @@ -135,7 +135,7 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:4.3.1"
implementation "com.google.code.gson:gson:2.8.6"
implementation "com.squareup.picasso:picasso:2.71828"
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.2.0'
Expand All @@ -149,7 +149,7 @@ dependencies {
implementation 'com.google.zxing:core:3.3.2'

// Sugar
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.github.apl-devs:appintro:v4.2.2'
implementation 'com.romandanylyk:pageindicatorview:1.0.0'

Expand Down Expand Up @@ -193,7 +193,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})

implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'

implementation "com.trustwallet:wallet-core:0.12.31"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;

import com.alphawallet.app.BuildConfig;
import com.alphawallet.app.C;
import com.alphawallet.app.entity.AnalyticsProperties;
import com.google.firebase.analytics.FirebaseAnalytics;
Expand Down Expand Up @@ -50,11 +52,18 @@ public void track(String eventName, T event)
private void trackFirebase(AnalyticsProperties analyticsProperties, String eventName)
{
Bundle props = new Bundle();
if(!analyticsProperties.getWalletType().isEmpty())
if(!TextUtils.isEmpty(analyticsProperties.getWalletType()))
{
props.putString(C.AN_WALLET_TYPE, analyticsProperties.getWalletType());
}

if(!TextUtils.isEmpty(analyticsProperties.getData()))
{
props.putString(C.AN_USE_GAS, analyticsProperties.getData());
}

props.putString(C.APP_NAME, BuildConfig.APPLICATION_ID);

firebaseAnalytics.logEvent(eventName, props);
}

Expand All @@ -64,11 +73,16 @@ private void trackMixpanel(AnalyticsProperties analyticsProperties, String event
{
JSONObject props = new JSONObject();

if(analyticsProperties.getWalletType() != null)
if (!TextUtils.isEmpty(analyticsProperties.getWalletType()))
{
props.put(C.AN_WALLET_TYPE, analyticsProperties.getWalletType());
}

if (!TextUtils.isEmpty(analyticsProperties.getData()))
{
props.put(C.AN_USE_GAS, analyticsProperties.getData());
}

mixpanelAPI.track(eventName, props);
}
catch(JSONException e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.alphawallet.app;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.runner.AndroidJUnit4;

import org.junit.runner.RunWith;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.alphawallet.app;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;

import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import com.alphawallet.app.entity.Wallet;
import com.alphawallet.app.service.AccountKeystoreService;
import com.alphawallet.app.service.KeyService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.alphawallet.app;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.runner.AndroidJUnit4;

import org.junit.runner.RunWith;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.alphawallet.app;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.runner.AndroidJUnit4;

import org.junit.runner.RunWith;

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@
<activity
android:name=".ui.WalletConnectSessionActivity"
android:label="WalletConnect Sessions" />

<activity
android:name=".ui.TransactionSuccessActivity"
android:label="Transaction Success" />

</application>

</manifest>
2 changes: 1 addition & 1 deletion app/src/main/cpp/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Java_com_alphawallet_app_service_AnalyticsService_getAnalyticsKey( JNIEnv* env,
#if (HAS_KEYS == 1)
return getDecryptedKey(env, mixpanelKey);
#else
const jstring key = "3d1724375414474d7aa4cc3d8be074af";
const jstring key = "d4c1140e21f6204184bb1ea02eb84412";
return (*env)->NewStringUTF(env, key);
#endif
}
26 changes: 16 additions & 10 deletions app/src/main/java/com/alphawallet/app/C.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public abstract class C {
public static final int UPDATE_CURRENCY = 1014;
public static final int REQUEST_UNIVERSAL_SCAN = 1015;

public static final int BARCODE_READER_REQUEST_CODE = 1;
public static final int SET_GAS_SETTINGS = 2;
public static final int COMPLETED_TRANSACTION = 3;

public static final String ETHEREUM_NETWORK_NAME = "Ethereum";
public static final String CLASSIC_NETWORK_NAME = "Ethereum Classic";
public static final String POA_NETWORK_NAME = "POA";
Expand All @@ -23,7 +27,7 @@ public abstract class C {
public static final String GOERLI_NETWORK_NAME = "Görli (Test)";
public static final String ARTIS_SIGMA1_NETWORK = "ARTIS sigma1";
public static final String ARTIS_TAU1_NETWORK = "ARTIS tau1 (Test)";
public static final String BINANCE_TEST_NETWORK = "Binance (Test)";
public static final String BINANCE_TEST_NETWORK = "BSC TestNet";
public static final String BINANCE_MAIN_NETWORK = "Binance";

public static final String ETHEREUM_TICKER_NAME = "ethereum";
Expand Down Expand Up @@ -60,6 +64,8 @@ public abstract class C {
public static final String EXTRA_AMOUNT = "AMOUNT";
public static final String EXTRA_GAS_PRICE = "GAS_PRICE";
public static final String EXTRA_GAS_LIMIT = "GAS_LIMIT";
public static final String EXTRA_CUSTOM_GAS_LIMIT = "CUSTOM_GAS_LIMIT";
public static final String EXTRA_GAS_LIMIT_PRESET = "GAS_LIMIT_PRESET";
public static final String EXTRA_ACTION_NAME = "NAME";
public static final String EXTRA_TOKEN_ID = "TID";
public static final String EXTRA_TOKEN_BALANCE = "BALANCE";
Expand Down Expand Up @@ -116,13 +122,10 @@ public abstract class C {
"com.stormbird.wallet.CHANGE_CURRENCY";
public static final String RESET_TRANSACTIONS =
"com.stormbird.wallet.RESET_TRANSACTIONS";
public static final String WALLET_CONNECT_REQUEST =
"com.stormbird.wallet.WALLET_CONNECT";

public static final String COINBASE_WIDGET_CODE = "88d6141a-ff60-536c-841c-8f830adaacfd";
public static final String SHAPESHIFT_KEY = "c4097b033e02163da6114fbbc1bf15155e759ddfd8352c88c55e7fef162e901a800e7eaecf836062a0c075b2b881054e0b9aa2324be7bc3694578493faf59af4";
public static final String CHANGELLY_REF_ID = "968d4f0f0bf9";
public static final String DONATION_ADDRESS = "0xb1aD48527d694D30401D082bcD21a33F41811501";

public static final String DEFAULT_GAS_PRICE = "30000000000";
public static final String DEFAULT_GAS_PRICE = "10000000000";
public static final String DEFAULT_XDAI_GAS_PRICE = "1000000000";
public static final String DEFAULT_GAS_LIMIT = "90000";
public static final String DEFAULT_GAS_LIMIT_FOR_TOKENS = "144000";
Expand All @@ -132,9 +135,9 @@ public abstract class C {
public static final long GAS_PER_BYTE = 310; //from experimentation
public static final long GAS_LIMIT_MIN = 21000L;
public static final long GAS_LIMIT_DEFAULT = 90000L;
public static final long GAS_LIMIT_MAX = 900000L;
public static final long GAS_PRICE_MIN = 1000000000L;
public static final long NETWORK_FEE_MAX = 90000000000000000L;
public static final long GAS_LIMIT_CONTRACT = 1000000L;
public static final long GAS_LIMIT_MAX = 1300000L;
public static final long GAS_PRICE_MIN = 400000000L;
public static final int ETHER_DECIMALS = 18;

//FOR DEMOS ETC
Expand Down Expand Up @@ -201,4 +204,7 @@ public enum TokenStatus {
public static final String AN_SEED_PHRASE = "Seed Phrase";
public static final String AN_KEYSTORE = "Keystore";
public static final String AN_PRIVATE_KEY = "Private Key";
public static final String AN_USE_GAS = "Gas Settings";
public static final String AN_CALL_ACTIONSHEET = "Use ActionSheet";
public static final String APP_NAME = "PACKAGE_NAME";
}
12 changes: 2 additions & 10 deletions app/src/main/java/com/alphawallet/app/di/DappBrowserModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import com.alphawallet.app.repository.EthereumNetworkRepositoryType;
import com.alphawallet.app.repository.TransactionRepositoryType;
import com.alphawallet.app.repository.WalletRepositoryType;
import com.alphawallet.app.router.ConfirmationRouter;
import com.alphawallet.app.service.AssetDefinitionService;
import com.alphawallet.app.service.GasService;
import com.alphawallet.app.service.GasService2;
import com.alphawallet.app.service.KeyService;
import com.alphawallet.app.service.TokensService;
import com.alphawallet.app.viewmodel.DappBrowserViewModelFactory;
Expand All @@ -25,17 +24,15 @@ DappBrowserViewModelFactory provideWalletViewModelFactory(
AssetDefinitionService assetDefinitionService,
CreateTransactionInteract createTransactionInteract,
TokensService tokensService,
ConfirmationRouter confirmationRouter,
EthereumNetworkRepositoryType ethereumNetworkRepository,
KeyService keyService,
GasService gasService) {
GasService2 gasService) {
return new DappBrowserViewModelFactory(
findDefaultNetworkInteract,
genericWalletInteract,
assetDefinitionService,
createTransactionInteract,
tokensService,
confirmationRouter,
ethereumNetworkRepository,
keyService,
gasService);
Expand All @@ -47,11 +44,6 @@ FindDefaultNetworkInteract provideFindDefaultNetworkInteract(
return new FindDefaultNetworkInteract(ethereumNetworkRepositoryType);
}

@Provides
ConfirmationRouter provideConfirmationRouter() {
return new ConfirmationRouter();
}

@Provides
GenericWalletInteract provideFindDefaultWalletInteract(WalletRepositoryType walletRepository)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.alphawallet.app.interact.FindDefaultNetworkInteract;
import com.alphawallet.app.repository.EthereumNetworkRepositoryType;
import com.alphawallet.app.service.TokensService;
import com.alphawallet.app.viewmodel.GasSettingsViewModelFactory;

import dagger.Module;
Expand All @@ -12,8 +13,8 @@
public class GasSettingsModule {

@Provides
public GasSettingsViewModelFactory provideGasSettingsViewModelFactory(FindDefaultNetworkInteract findDefaultNetworkInteract) {
return new GasSettingsViewModelFactory(findDefaultNetworkInteract);
public GasSettingsViewModelFactory provideGasSettingsViewModelFactory(FindDefaultNetworkInteract findDefaultNetworkInteract, TokensService svs) {
return new GasSettingsViewModelFactory(findDefaultNetworkInteract, svs);
}

@Provides
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/alphawallet/app/di/MyAddressModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.alphawallet.app.interact.FindDefaultNetworkInteract;
import com.alphawallet.app.repository.EthereumNetworkRepositoryType;
import com.alphawallet.app.repository.TokenRepositoryType;
import com.alphawallet.app.service.TokensService;
import com.alphawallet.app.viewmodel.MyAddressViewModelFactory;

@Module
Expand All @@ -13,11 +14,11 @@ class MyAddressModule {
MyAddressViewModelFactory provideMyAddressViewModelFactory(
FindDefaultNetworkInteract findDefaultNetworkInteract,
EthereumNetworkRepositoryType ethereumNetworkRepository,
TokenRepositoryType tokenRepository) {
TokensService tokensService) {
return new MyAddressViewModelFactory(
findDefaultNetworkInteract,
ethereumNetworkRepository,
tokenRepository);
tokensService);
}

@Provides
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/com/alphawallet/app/di/RepositoriesModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.alphawallet.app.service.AnalyticsServiceType;
import com.alphawallet.app.service.AssetDefinitionService;
import com.alphawallet.app.service.GasService;
import com.alphawallet.app.service.GasService2;
import com.alphawallet.app.service.KeyService;
import com.alphawallet.app.service.KeystoreAccountService;
import com.alphawallet.app.service.MarketQueueService;
Expand Down Expand Up @@ -151,8 +152,9 @@ TokensService provideTokensService(EthereumNetworkRepositoryType ethereumNetwork
PreferenceRepositoryType preferenceRepository,
Context context,
TickerService tickerService,
OpenseaService openseaService) {
return new TokensService(ethereumNetworkRepository, tokenRepository, preferenceRepository, context, tickerService, openseaService);
OpenseaService openseaService,
AnalyticsServiceType analyticsService) {
return new TokensService(ethereumNetworkRepository, tokenRepository, preferenceRepository, context, tickerService, openseaService, analyticsService);
}

@Singleton
Expand All @@ -172,6 +174,12 @@ GasService provideGasService(EthereumNetworkRepositoryType ethereumNetworkReposi
return new GasService(ethereumNetworkRepository);
}

@Singleton
@Provides
GasService2 provideGasService2(EthereumNetworkRepositoryType ethereumNetworkRepository, OkHttpClient client, RealmManager realmManager) {
return new GasService2(ethereumNetworkRepository, client, realmManager);
}

@Singleton
@Provides
MarketQueueService provideMarketQueueService(Context ctx, OkHttpClient okHttpClient,
Expand Down
Loading

0 comments on commit 51f86fa

Please sign in to comment.