diff --git a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java index 98b08f9..8449084 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java +++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Summary.java @@ -336,7 +336,6 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface, } lastTimestamp = System.currentTimeMillis() / 1000; - balanceManager.updateExchangeKeys(); resetCounters(); DataUpdater updater = new DataUpdater(); diff --git a/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java b/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java index b4a2f02..a6b5297 100644 --- a/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java +++ b/app/src/main/java/com/herbron/moodl/DataManagers/DatabaseManager.java @@ -443,7 +443,7 @@ public class DatabaseManager extends SQLiteOpenHelper{ public List getHitBtcAccounts(Context context) { - String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + " = " + HITBTC_TYPE + " AND " + KEY_EXCHANGE_IS_ENABLED + " = '1'"; + String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + " = " + HITBTC_TYPE + " AND " + KEY_EXCHANGE_IS_ENABLED + " = 1"; SQLiteDatabase db = this.getWritableDatabase(); Cursor resultList = db.rawQuery(searchQuerry, null); @@ -466,7 +466,7 @@ public class DatabaseManager extends SQLiteOpenHelper{ public List getBinanceAccounts() { - String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + " = " + BINANCE_TYPE + " AND " + KEY_EXCHANGE_IS_ENABLED + " = '1'"; + String searchQuerry = "SELECT * FROM " + TABLE_EXCHANGE_KEYS + " WHERE " + KEY_EXCHANGE_TYPE + " = " + BINANCE_TYPE + " AND " + KEY_EXCHANGE_IS_ENABLED + " = 1"; SQLiteDatabase db = this.getWritableDatabase(); Cursor resultList = db.rawQuery(searchQuerry, null); diff --git a/app/src/main/java/com/herbron/moodl/LayoutManagers/ExchangeListAdapter.java b/app/src/main/java/com/herbron/moodl/LayoutManagers/ExchangeListAdapter.java index 75759c5..fab4b07 100644 --- a/app/src/main/java/com/herbron/moodl/LayoutManagers/ExchangeListAdapter.java +++ b/app/src/main/java/com/herbron/moodl/LayoutManagers/ExchangeListAdapter.java @@ -2,8 +2,12 @@ package com.herbron.moodl.LayoutManagers; import android.content.Context; import android.content.Intent; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -11,6 +15,8 @@ import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; +import android.widget.ImageView; +import android.widget.ProgressBar; import android.widget.TextView; import com.herbron.moodl.Activities.AddExchangeActivity; @@ -47,17 +53,16 @@ public class ExchangeListAdapter extends ArrayAdapter { convertView = LayoutInflater.from(getContext()).inflate(R.layout.exchange_cell, parent, false); } - final View finalConvertView = convertView; - TextView exchangeNameTextView = convertView.findViewById(R.id.exchange_name); TextView exchangeDescriptionTextView = convertView.findViewById(R.id.exchange_description); + ImageView accountOffImageView = convertView.findViewById(R.id.exchange_account_off_imageView); exchangeNameTextView.setText(exchange.getName()); exchangeDescriptionTextView.setText(exchange.getDescription()); if(!exchange.isEnabled()) { - convertView.findViewById(R.id.exchange_account_off_imageView).setVisibility(View.VISIBLE); + accountOffImageView.setVisibility(View.VISIBLE); } convertView.findViewById(R.id.editExchangeInfosLayout).setOnClickListener(new View.OnClickListener() { @@ -75,7 +80,8 @@ public class ExchangeListAdapter extends ArrayAdapter { public void onClick(View v) { DatabaseManager databaseManager = new DatabaseManager(getContext()); databaseManager.deleteExchangeAccountFromId(exchange.getId()); - MoodlBox.collapseH(finalConvertView); + remove(exchange); + notifyDataSetChanged(); } }); diff --git a/app/src/main/res/layout/exchange_cell.xml b/app/src/main/res/layout/exchange_cell.xml index 8049938..7ae26fe 100644 --- a/app/src/main/res/layout/exchange_cell.xml +++ b/app/src/main/res/layout/exchange_cell.xml @@ -93,10 +93,10 @@ android:id="@+id/exchange_account_off_imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/ic_money_off_24dp" + android:src="@drawable/ic_money_off_24dp" android:layout_alignParentEnd="true" android:layout_centerVertical="true" - android:visibility="invisible"/> + android:visibility="gone"/>