Fixed layout issues

This commit is contained in:
vanitasvitae 2017-05-05 18:34:44 +02:00
parent 8cf9eda715
commit 7001ea0565
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
15 changed files with 46 additions and 146 deletions

View file

@ -7,7 +7,7 @@
android:fullBackupContent="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name" >

View file

@ -139,10 +139,13 @@ public abstract class LayoutContainer
void prepareSpinnerAdapter(Spinner view, int resourceID) {
MainActivity main = (MainActivity) MainActivity.ActivitySingleton.getInstance().getActivity();
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(main, resourceID,
android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
view.setAdapter(adapter);
ArrayAdapter<CharSequence> ad = new ArrayAdapter<CharSequence>(main,
android.R.layout.simple_spinner_item,
main.getResources().getTextArray(resourceID));
ad.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
ad.setDropDownViewTheme(main.getTheme());
view.setAdapter(ad);
}
/**
@ -153,10 +156,11 @@ public abstract class LayoutContainer
void prepareSpinnerAdapter(Spinner view, Character[] array)
{
MainActivity main = (MainActivity) MainActivity.ActivitySingleton.getInstance().getActivity();
ArrayAdapter<Character> adapter = new ArrayAdapter<>(main.getApplicationContext(),
ArrayAdapter<Character> adapter = new ArrayAdapter<>(main,
android.R.layout.simple_spinner_item, array);
adapter.setDropDownViewResource(
android.R.layout.simple_spinner_dropdown_item);
adapter.setDropDownViewTheme(main.getTheme());
view.setAdapter(adapter);
}

View file

@ -103,14 +103,15 @@
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_reflector"
android:text="@string/hint_enigma_reflector_wiring"
android:background="@drawable/button_grey"
tools:ignore="ButtonStyle"/>
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_crypt"
android:onClick="doCrypto"
android:text="@string/button_crypt"

View file

@ -133,7 +133,7 @@
android:layout_alignParentBottom="true">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_crypt"
android:onClick="doCrypto"
android:text="@string/button_crypt"

View file

@ -156,16 +156,17 @@
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:text="@string/title_plugboard_dialog"
android:background="@drawable/button_grey"
android:id="@+id/button_plugboard"
tools:ignore="ButtonStyle"/>
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:id="@+id/button_crypt"
android:onClick="doCrypto"

View file

@ -180,14 +180,15 @@
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_plugboard"
android:text="@string/title_plugboard_dialog"
android:background="@drawable/button_grey"
tools:ignore="ButtonStyle"/>
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_crypt"
android:onClick="doCrypto"
android:text="@string/button_crypt"

View file

@ -104,14 +104,15 @@
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_reflector"
android:text="@string/hint_enigma_reflector_wiring"
android:background="@drawable/button_grey"
tools:ignore="ButtonStyle"/>
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_crypt"
android:onClick="doCrypto"
android:text="@string/button_crypt"

View file

@ -174,12 +174,13 @@
android:layout_weight="50"
android:text="@string/title_plugboard_dialog"
android:id="@+id/button_plugboard"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/button_grey"
tools:ignore="ButtonStyle"/>
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_crypt"
android:onClick="doCrypto"
android:text="@string/button_crypt"

View file

@ -152,14 +152,15 @@
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_reflector"
android:text="@string/hint_enigma_reflector_wiring"
android:background="@drawable/button_grey"
tools:ignore="ButtonStyle"/>
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_crypt"
android:onClick="doCrypto"
android:text="@string/button_crypt"

View file

@ -178,14 +178,16 @@
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_plugboard"
android:text="@string/title_plugboard_dialog"
tools:ignore="ButtonStyle"/>
android:background="@drawable/button_grey"
tools:ignore="ButtonStyle"
/>
<Button
android:layout_width="0dp"
android:layout_weight="50"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_crypt"
android:onClick="doCrypto"
android:text="@string/button_crypt"

View file

@ -1,8 +1,4 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Black">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme" parent="@android:style/Theme.Holo"/>
</resources>