spinner tweaks (#306)

This commit is contained in:
m2049r 2018-06-09 12:42:09 +02:00 committed by GitHub
parent 0bcf156929
commit 843566b820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 9 deletions

View File

@ -101,7 +101,9 @@ public class WalletFragment extends Fragment
ivSynced = (ImageView) view.findViewById(R.id.ivSynced); ivSynced = (ImageView) view.findViewById(R.id.ivSynced);
sCurrency = (Spinner) view.findViewById(R.id.sCurrency); sCurrency = (Spinner) view.findViewById(R.id.sCurrency);
sCurrency.setAdapter(ArrayAdapter.createFromResource(getContext(), R.array.currency, R.layout.item_spinner_balance)); ArrayAdapter currencyAdapter = ArrayAdapter.createFromResource(getContext(), R.array.currency, R.layout.item_spinner_balance);
currencyAdapter.setDropDownViewResource(R.layout.item_spinner_dropdown_item);
sCurrency.setAdapter(currencyAdapter);
bSend = (Button) view.findViewById(R.id.bSend); bSend = (Button) view.findViewById(R.id.bSend);
bReceive = (Button) view.findViewById(R.id.bReceive); bReceive = (Button) view.findViewById(R.id.bReceive);

View File

@ -30,6 +30,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
@ -166,7 +167,11 @@ public class ExchangeView extends LinearLayout
etAmount = (TextInputLayout) findViewById(R.id.etAmount); etAmount = (TextInputLayout) findViewById(R.id.etAmount);
tvAmountB = (TextView) findViewById(R.id.tvAmountB); tvAmountB = (TextView) findViewById(R.id.tvAmountB);
sCurrencyA = (Spinner) findViewById(R.id.sCurrencyA); sCurrencyA = (Spinner) findViewById(R.id.sCurrencyA);
ArrayAdapter adapter = ArrayAdapter.createFromResource(getContext(), R.array.currency, R.layout.item_spinner);
adapter.setDropDownViewResource(R.layout.item_spinner_dropdown_item);
sCurrencyA.setAdapter(adapter);
sCurrencyB = (Spinner) findViewById(R.id.sCurrencyB); sCurrencyB = (Spinner) findViewById(R.id.sCurrencyB);
sCurrencyB.setAdapter(adapter);
evExchange = (ImageView) findViewById(R.id.evExchange); evExchange = (ImageView) findViewById(R.id.evExchange);
pbExchange = (ProgressBar) findViewById(R.id.pbExchange); pbExchange = (ProgressBar) findViewById(R.id.pbExchange);

View File

@ -57,6 +57,7 @@
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:entries="@array/currency" android:entries="@array/currency"
android:gravity="center" android:gravity="center"
android:minWidth="80dp"
android:paddingBottom="2dp" android:paddingBottom="2dp"
android:paddingEnd="4dp" android:paddingEnd="4dp"
android:paddingStart="4dp" android:paddingStart="4dp"

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/text1"
style="?android:attr/spinnerItemStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="true"
tools:text="XMR" />

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/spinnerDropDownItemStyle"
android:layout_width="match_parent"
android:minWidth="64dp"
android:layout_height="match_parent"
android:ellipsize="marquee"
android:padding="4dp"
android:singleLine="true"
android:textAlignment="center" />

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" <merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
tools:showIn="LinearLayout" xmlns:tools="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"> tools:showIn="LinearLayout">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -12,12 +12,12 @@
<Spinner <Spinner
android:id="@+id/sCurrencyA" android:id="@+id/sCurrencyA"
android:layout_width="56dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:entries="@array/currency" android:entries="@array/currency"
android:gravity="center" android:gravity="center"
android:textAlignment="center" /> android:minWidth="56dp" />
<com.m2049r.xmrwallet.widget.CTextInputLayout <com.m2049r.xmrwallet.widget.CTextInputLayout
android:id="@+id/etAmount" android:id="@+id/etAmount"
@ -49,19 +49,18 @@
<Spinner <Spinner
android:id="@+id/sCurrencyB" android:id="@+id/sCurrencyB"
style="@style/MoneroSpinnerGray" style="@style/MoneroSpinnerGray"
android:layout_width="56sp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:entries="@array/currency" android:entries="@array/currency"
android:gravity="center" android:gravity="center"
android:paddingBottom="8dp" android:minWidth="56dp"
android:paddingTop="8dp"
android:textAlignment="center" /> android:textAlignment="center" />
<TextView <TextView
android:id="@+id/tvAmountB" android:id="@+id/tvAmountB"
style="@style/MoneroText" style="@style/MoneroText"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center|start" android:layout_gravity="center|start"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"