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

View File

@ -30,6 +30,7 @@
</string-array>
<string name="TCMotorSearchFormSubmit">Submit</string>
<string name="TCMotorSearchFormTitle">Thrustcurve.org Search Criteria</string>
<string name="overviewConfigurationSpinnerPrompt">Select Configuration</string>
<string name="simulationSeries1Label">Series 1</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.ErrorDialogFragment;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
public class TCQueryActivity extends FragmentActivity
import com.actionbarsherlock.app.SherlockFragmentActivity;
public class TCQueryActivity extends SherlockFragmentActivity
implements TCQueryAction.OnTCQueryCompleteListener
{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(R.string.TCMotorSearchFormTitle);
setContentView(R.layout.tcqueryform);
final Spinner manufacturerField = (Spinner) findViewById(R.id.TCMotorSearchFormManufacturerField);