From 1d18847c3ca2bc659aa24dcc32be40066bf798d4 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sat, 4 Aug 2018 03:54:45 +0200 Subject: [PATCH] Fix AddExchangeActivity crash for 19-23 SDK - Update the exchange connexion error icon --- .idea/assetWizardSettings.xml | 4 ++-- .../com/herbron/moodl/Activities/AddExchangeActivity.java | 6 +++--- .../CustomAdapters/ExchangeDescriptionListAdapter.java | 1 + app/src/main/res/drawable/ic_error_24dp.xml | 5 +++++ app/src/main/res/drawable/ic_money_off_24dp.xml | 5 ----- app/src/main/res/layout/exchange_cell.xml | 2 +- app/src/main/res/layout/fragment_buy.xml | 1 - app/src/main/res/values/colors.xml | 2 ++ 8 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 app/src/main/res/drawable/ic_error_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_money_off_24dp.xml diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml index 0e83d31..cad50d5 100644 --- a/.idea/assetWizardSettings.xml +++ b/.idea/assetWizardSettings.xml @@ -23,7 +23,7 @@ @@ -34,7 +34,7 @@ diff --git a/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java b/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java index f7aef53..6d56f51 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java +++ b/app/src/main/java/com/herbron/moodl/Activities/AddExchangeActivity.java @@ -34,8 +34,8 @@ public class AddExchangeActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_add_exchange); getApplicationContext().setTheme(R.style.InputActivityTheme); + setContentView(R.layout.activity_add_exchange); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); @@ -85,12 +85,12 @@ public class AddExchangeActivity extends AppCompatActivity { switch (exchangeType) { case DatabaseManager.BINANCE_TYPE: - setupExchangeLayout = (LinearLayout) LayoutInflater.from(getApplicationContext()).inflate(R.layout.binance_exchange_setup_layout, setupExchangeLayout, true); + setupExchangeLayout = (LinearLayout) LayoutInflater.from(getBaseContext()).inflate(R.layout.binance_exchange_setup_layout, setupExchangeLayout, true); bindSetupViews(); break; case DatabaseManager.HITBTC_TYPE: - setupExchangeLayout = (LinearLayout) LayoutInflater.from(getApplicationContext()).inflate(R.layout.hitbtc_exchange_setup_layout, setupExchangeLayout, true); + setupExchangeLayout = (LinearLayout) LayoutInflater.from(getBaseContext()).inflate(R.layout.hitbtc_exchange_setup_layout, setupExchangeLayout, true); bindSetupViews(); break; diff --git a/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java b/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java index cb80593..bf33215 100644 --- a/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java +++ b/app/src/main/java/com/herbron/moodl/CustomAdapters/ExchangeDescriptionListAdapter.java @@ -57,6 +57,7 @@ public class ExchangeDescriptionListAdapter extends ArrayAdapter { Intent editExchangeAccountIntent = new Intent(context, AddExchangeActivity.class); editExchangeAccountIntent.putExtra("isEdit", true); editExchangeAccountIntent.putExtra("exchangeId", exchange.getId()); + editExchangeAccountIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(editExchangeAccountIntent); } }); diff --git a/app/src/main/res/drawable/ic_error_24dp.xml b/app/src/main/res/drawable/ic_error_24dp.xml new file mode 100644 index 0000000..51d5817 --- /dev/null +++ b/app/src/main/res/drawable/ic_error_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_money_off_24dp.xml b/app/src/main/res/drawable/ic_money_off_24dp.xml deleted file mode 100644 index ebcd2f4..0000000 --- a/app/src/main/res/drawable/ic_money_off_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/layout/exchange_cell.xml b/app/src/main/res/layout/exchange_cell.xml index 9080a43..4097a60 100644 --- a/app/src/main/res/layout/exchange_cell.xml +++ b/app/src/main/res/layout/exchange_cell.xml @@ -92,7 +92,7 @@ android:id="@+id/exchange_account_off_imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/ic_money_off_24dp" + android:src="@drawable/ic_error_24dp" android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:visibility="gone"/> diff --git a/app/src/main/res/layout/fragment_buy.xml b/app/src/main/res/layout/fragment_buy.xml index a307893..1dab24f 100644 --- a/app/src/main/res/layout/fragment_buy.xml +++ b/app/src/main/res/layout/fragment_buy.xml @@ -1,5 +1,4 @@ - #66FFFFFF #88FFFFFF + #FFB00020 + #FFF5BC00 \ No newline at end of file