diff --git a/app/build.gradle b/app/build.gradle index 6270387..36b5c2e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,5 +44,5 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' - implementation files('C:/Users/Guitoune/Documents/GitHub/Coinfolio/libs/binance-api.jar') + implementation files('../libs/binance-api.jar') } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 150bd0d..2a94e3e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,8 @@ android:name=".Activities.HomeActivity" android:label="@string/app_name" android:screenOrientation="portrait" - android:theme="@style/AppTheme.NoActionBar"> + android:theme="@style/AppTheme.NoActionBar" + android:launchMode="singleTop"> @@ -28,14 +29,26 @@ android:screenOrientation="portrait" /> + android:screenOrientation="portrait"> + + + android:screenOrientation="portrait"> + + + android:screenOrientation="portrait"> + + \ No newline at end of file diff --git a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java index 16c8ffe..25bc71e 100644 --- a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java +++ b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java @@ -5,6 +5,7 @@ import android.graphics.Color; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; +import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity; import android.view.Gravity; import android.view.LayoutInflater; @@ -82,6 +83,17 @@ public class CurrencyDetailsActivity extends AppCompatActivity { finish(); } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + // Respond to the action bar's Up/Home button + case android.R.id.home: + NavUtils.navigateUpFromSameTask(this); + return true; + } + return super.onOptionsItemSelected(item); + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencySelectionActivity.java b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencySelectionActivity.java index 5702aab..e117bad 100644 --- a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencySelectionActivity.java +++ b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencySelectionActivity.java @@ -2,6 +2,7 @@ package com.nauk.coinfolio.Activities; import android.content.Intent; import android.os.Bundle; +import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.view.KeyEvent; @@ -84,6 +85,18 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear listView.setAdapter(adapter); listView.setTextFilterEnabled(false); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + Currency selectedCurrency = (Currency) adapterView.getItemAtPosition(i); + Intent intent = new Intent(CurrencySelectionActivity.this, RecordTransactionActivity.class); + intent.putExtra("coin", selectedCurrency.getName()); + intent.putExtra("symbol", selectedCurrency.getSymbol()); + startActivity(intent); + finish(); + } + }); + filter = adapter.getFilter(); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d75bfa1..5d9741b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -140,5 +140,6 @@ (US$%1$s) US$%1$s %1$s%% + MainActivity