Use our own simple_spinner_item layout so we can style it more easily.
This commit is contained in:
parent
3861f21d6d
commit
844f2de727
26
android/res/layout/simple_spinner_item.xml
Normal file
26
android/res/layout/simple_spinner_item.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/* //device/apps/common/assets/res/any/layout/simple_spinner_item.xml
|
||||||
|
**
|
||||||
|
** Copyright 2006, The Android Open Source Project
|
||||||
|
**
|
||||||
|
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
** you may not use this file except in compliance with the License.
|
||||||
|
** You may obtain a copy of the License at
|
||||||
|
**
|
||||||
|
** http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
**
|
||||||
|
** Unless required by applicable law or agreed to in writing, software
|
||||||
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
** See the License for the specific language governing permissions and
|
||||||
|
** limitations under the License.
|
||||||
|
*/
|
||||||
|
style="@style/spinnerStyle"
|
||||||
|
-->
|
||||||
|
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
style="@style/spinnerStyle"
|
||||||
|
android:id="@android:id/text1"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:ellipsize="marquee" />
|
@ -31,4 +31,9 @@
|
|||||||
<item name="android:textColor">@color/actionbar_title_color</item>
|
<item name="android:textColor">@color/actionbar_title_color</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="spinnerStyle" parent="@android:style/Widget.Holo.TextView.SpinnerItem">
|
||||||
|
<item name="android:textSize">22dp</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -8,10 +8,18 @@
|
|||||||
|
|
||||||
<style name="labelTextStyle" parent="@android:style/TextAppearance.Medium" />
|
<style name="labelTextStyle" parent="@android:style/TextAppearance.Medium" />
|
||||||
|
|
||||||
<style name="valueTextStyle" parent="@android:style/TextAppearance.Large" />
|
<style name="valueTextStyle" parent="@android:style/TextAppearance.Large">
|
||||||
|
<item name="android:gravity">right</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.NoTitleBar" parent="@style/AppTheme">
|
<style name="AppTheme.NoTitleBar" parent="@style/AppTheme">
|
||||||
<item name="android:windowNoTitle">true</item>
|
<item name="android:windowNoTitle">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="spinnerStyle" parent="@android:style/Widget.TextView.SpinnerItem">
|
||||||
|
<item name="android:textSize">22dp</item>
|
||||||
|
<item name="android:textColor">#000000</item>
|
||||||
|
<item name="android:layout_height">30dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -82,7 +82,7 @@ implements SharedPreferences.OnSharedPreferenceChangeListener
|
|||||||
Rocket rocket = rocketDocument.getRocket();
|
Rocket rocket = rocketDocument.getRocket();
|
||||||
|
|
||||||
String[] motorConfigs = rocket.getMotorConfigurationIDs();
|
String[] motorConfigs = rocket.getMotorConfigurationIDs();
|
||||||
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(getActivity(),android.R.layout.simple_spinner_item);
|
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(getActivity(),R.layout.simple_spinner_item);
|
||||||
for( String config: motorConfigs ) {
|
for( String config: motorConfigs ) {
|
||||||
spinnerAdapter.add(rocket.getMotorConfigurationNameOrDescription(config));
|
spinnerAdapter.add(rocket.getMotorConfigurationNameOrDescription(config));
|
||||||
}
|
}
|
||||||
|
@ -88,14 +88,14 @@ public class SimulationSeriesDialog extends DialogFragment {
|
|||||||
selectableSeries.add(fdt);
|
selectableSeries.add(fdt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ArrayAdapter<FlightDataType> serieses = new ArrayAdapter<FlightDataType>(getActivity(),android.R.layout.simple_spinner_item,selectableSeries) {
|
ArrayAdapter<FlightDataType> serieses = new ArrayAdapter<FlightDataType>(getActivity(),R.layout.simple_spinner_item,selectableSeries) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
View v = convertView;
|
View v = convertView;
|
||||||
if ( v == null ) {
|
if ( v == null ) {
|
||||||
LayoutInflater li = inflater;
|
LayoutInflater li = inflater;
|
||||||
v = li.inflate(android.R.layout.simple_spinner_item,null);
|
v = li.inflate(R.layout.simple_spinner_item,null);
|
||||||
}
|
}
|
||||||
FlightDataType fdt = this.getItem(position);
|
FlightDataType fdt = this.getItem(position);
|
||||||
((TextView)v.findViewById(android.R.id.text1)).setText( fdt.toString() );
|
((TextView)v.findViewById(android.R.id.text1)).setText( fdt.toString() );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user