Froyo had troubles with the old table layout. Changed instead to the same layout style as used in the simulation edit/run dialog. Added a localizable title string.

This commit is contained in:
Kevin Ruland 2012-07-19 14:44:39 +00:00
parent 4b9cc99710
commit 51f98b71aa
3 changed files with 50 additions and 66 deletions

View File

@ -2,83 +2,64 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:minWidth="250dp"
android:orientation="vertical" > android:orientation="vertical" >
<!-- this is just here so the edittext doesn't get focus --> <TextView
android:id="@+id/textView1"
<LinearLayout style="@style/labelTextStyle"
android:layout_width="0px" android:layout_width="wrap_content"
android:layout_height="0px"
android:focusable="true"
android:focusableInTouchMode="true" />
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
> android:text="@string/motor_manufacturer" />
<TableRow> <Spinner
android:id="@+id/TCMotorSearchFormManufacturerField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/TCMotorSearchManufacturerList" />
<TextView <TextView
android:id="@+id/textView1" style="@style/labelTextStyle"
android:text="@string/motor_manufacturer" android:layout_width="wrap_content"
android:layout_weight="0" /> android:layout_height="wrap_content"
android:text="@string/motor_impulseclass" />
<Spinner <Spinner
android:id="@+id/TCMotorSearchFormManufacturerField" android:id="@+id/TCMotorSearchFormImpulseField"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:entries="@array/TCMotorSearchImpulseList" />
android:entries="@array/TCMotorSearchManufacturerList" />
</TableRow>
<TableRow> <TextView
style="@style/labelTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/motor_commonname" />
<TextView <EditText
android:text="@string/motor_impulseclass" android:id="@+id/TCMotorSearchFormCommonNameField"
android:layout_weight="0"/> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:text="" />
<Spinner <TextView
android:id="@+id/TCMotorSearchFormImpulseField" style="@style/labelTextStyle"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:text="@string/motor_diameter" />
android:entries="@array/TCMotorSearchImpulseList" />
</TableRow>
<TableRow> <Spinner
android:id="@+id/TCMotorSearchFormDiameterField"
<TextView android:layout_width="match_parent"
android:text="@string/motor_commonname" android:layout_height="wrap_content"
android:layout_weight="0"/> android:entries="@array/TCMotorSearchDiameterList" />
<EditText
android:inputType="text"
android:id="@+id/TCMotorSearchFormCommonNameField"
android:layout_width="0dp"
android:layout_weight="1"
android:text="" />
</TableRow>
<TableRow>
<TextView
android:text="@string/motor_diameter"
android:layout_weight="0"/>
<Spinner
android:id="@+id/TCMotorSearchFormDiameterField"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:entries="@array/TCMotorSearchDiameterList" />
</TableRow>
</TableLayout>
<Button <Button
android:id="@+id/TCMotorSearchFromSubmitButton" android:id="@+id/TCMotorSearchFromSubmitButton"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:text="@string/TCMotorSearchFormSubmit" /> android:text="@string/TCMotorSearchFormSubmit" />

View File

@ -30,6 +30,7 @@
</string-array> </string-array>
<string name="TCMotorSearchFormSubmit">Submit</string> <string name="TCMotorSearchFormSubmit">Submit</string>
<string name="TCMotorSearchFormTitle">Thrustcurve.org Search Criteria</string>
<string name="overviewConfigurationSpinnerPrompt">Select Configuration</string> <string name="overviewConfigurationSpinnerPrompt">Select Configuration</string>
<string name="simulationSeries1Label">Series 1</string> <string name="simulationSeries1Label">Series 1</string>
<string name="simulationSeries2Label">Series 2</string> <string name="simulationSeries2Label">Series 2</string>

View File

@ -4,19 +4,21 @@ import net.sf.openrocket.R;
import net.sf.openrocket.android.util.AndroidLogWrapper; import net.sf.openrocket.android.util.AndroidLogWrapper;
import net.sf.openrocket.android.util.ErrorDialogFragment; import net.sf.openrocket.android.util.ErrorDialogFragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Spinner; import android.widget.Spinner;
public class TCQueryActivity extends FragmentActivity import com.actionbarsherlock.app.SherlockFragmentActivity;
public class TCQueryActivity extends SherlockFragmentActivity
implements TCQueryAction.OnTCQueryCompleteListener implements TCQueryAction.OnTCQueryCompleteListener
{ {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setTitle(R.string.TCMotorSearchFormTitle);
setContentView(R.layout.tcqueryform); setContentView(R.layout.tcqueryform);
final Spinner manufacturerField = (Spinner) findViewById(R.id.TCMotorSearchFormManufacturerField); final Spinner manufacturerField = (Spinner) findViewById(R.id.TCMotorSearchFormManufacturerField);