Commit 37c70b07 authored by Kristin Muterspaw's avatar Kristin Muterspaw
Browse files

new layouts for the main screen, sensor select screen and lab notebook screen....

new layouts for the main screen, sensor select screen and lab notebook screen. previously the image buttons would get cut off if the screen were smaller. now the layouts use LinearLayouts without hard constants. Tested on charlie's samsung
parent fa8b625a
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_screen_buttons"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical">
<ImageButton
android:id="@+id/imageButtonAbout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/about_icon"
android:background="@null"
android:contentDescription="@string/aboutButtonMain"/>
<ImageButton
android:id="@+id/imageButtonTakeSample"
android:layout_width="wrap_content"
android:layout_marginTop="38dp"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/takeSampleButton"
android:src="@drawable/sampling_icon"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButtonSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/settings_icon"
android:background="@null"
android:contentDescription="@string/settingsButtonMain"/>
<ImageButton
android:id="@+id/imageButtonLabNotebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/labNotebookButtonMain"
android:src="@drawable/lab_notebook_icon"/>
</LinearLayout>
<ImageButton
android:id="@+id/imageButtonAbout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/about_icon"
android:background="@null"
android:contentDescription="@string/aboutButtonMain"
android:layout_marginEnd="299dp"
android:layout_above="@+id/imageButtonTakeSample"
android:layout_toStartOf="@+id/imageButtonSettings" />
<ImageButton
android:id="@+id/imageButtonSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/settings_icon"
android:background="@null"
android:contentDescription="@string/settingsButtonMain"
android:layout_marginEnd="177dp"
android:layout_alignTop="@+id/imageButtonAbout"
android:layout_alignParentEnd="true" />
<ImageButton
android:id="@+id/imageButtonTakeSample"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/takeSampleButton"
android:src="@drawable/sampling_icon"
android:layout_alignBottom="@+id/imageButtonLabNotebook"
android:layout_toEndOf="@+id/imageButtonAbout" />
<ImageButton
android:id="@+id/imageButtonLabNotebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/labNotebookButtonMain"
android:src="@drawable/lab_notebook_icon"
android:layout_marginBottom="96dp"
android:layout_alignParentBottom="true"
android:layout_alignEnd="@+id/imageButtonAbout" />
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sensor_sample_buttons"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/take_a_sample_landscape"
android:focusableInTouchMode="true" >
android:orientation="horizontal" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBuiltIn"
android:src="@drawable/builtin_sensors_icon"
android:contentDescription="@string/builtinSensors"
android:background="@null"
android:onClick="startSampleActivity"
android:layout_marginTop="74dp"
android:layout_marginStart="192dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBluetooth"
android:src="@drawable/bluetooth_devices"
android:contentDescription="@string/bluetoothSensor"
android:background="@null"
android:onClick="startSampleActivity"
android:layout_alignTop="@+id/imageButtonBuiltIn"
android:layout_alignParentEnd="true"
android:layout_marginEnd="248dp" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBuiltIn"
android:src="@drawable/builtin_sensors_icon"
android:contentDescription="@string/builtinSensors"
android:background="@null"
android:onClick="startSampleActivity" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonDbActions"
android:src="@drawable/database_actions_icon"
android:contentDescription="Database Actions"
android:background="@null"
android:onClick="startSampleActivity"
android:layout_below="@+id/imageButtonBuiltIn"
android:layout_toEndOf="@+id/imageButtonBuiltIn"
android:layout_marginTop="73dp" />
</RelativeLayout>
\ No newline at end of file
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBluetooth"
android:src="@drawable/bluetooth_devices"
android:contentDescription="@string/bluetoothSensor"
android:background="@null"
android:onClick="startSampleActivity"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonDbActions"
android:src="@drawable/database_actions_icon"
android:contentDescription="@string/databaseActions"
android:background="@null"
android:onClick="startSampleActivity" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lab_note_screen"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true" >
<ImageButton
android:id="@+id/imageButtonNotePad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="53dp"
android:onClick="labNotebookStart"
android:background="@null"
android:contentDescription="@string/notepadButtonMain"
android:src="@drawable/note_pad_icon"
android:layout_alignTop="@+id/imageButtonLabProtocols"
android:layout_alignParentStart="true"
android:layout_marginStart="103dp" />
<ImageButton
android:id="@id/imageButtonLabProtocols"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="labNotebookStart"
android:background="@null"
android:contentDescription="@string/labButtonMain"
android:src="@drawable/lab_protocols_icon"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/imageButtonNotePad"
android:layout_marginStart="61dp" />
<ImageButton
android:id="@+id/imageButtonDrive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="labNotebookStart"
android:background="@null"
android:contentDescription="Connect to Google Drive"
android:src="@drawable/drive"
android:layout_above="@id/imageButtonLabProtocols"
android:layout_centerHorizontal="true"
android:layout_marginBottom="76dp" />
</RelativeLayout>
\ No newline at end of file
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical">
<ImageButton
android:id="@+id/imageButtonNotePad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="labNotebookStart"
android:background="@null"
android:contentDescription="@string/notepadButtonMain"
android:src="@drawable/note_pad_icon" />
<ImageButton
android:id="@+id/imageButtonLabProtocols"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="labNotebookStart"
android:background="@null"
android:contentDescription="@string/labButtonMain"
android:src="@drawable/lab_protocols_icon"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButtonDrive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="labNotebookStart"
android:background="@null"
android:contentDescription="Connect to Google Drive"
android:src="@drawable/drive" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_screen_buttons"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical">
<ImageButton
android:id="@+id/imageButtonAbout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/about_icon"
android:background="@null"
android:contentDescription="@string/aboutButtonMain"/>
<ImageButton
android:id="@+id/imageButtonTakeSample"
android:layout_width="wrap_content"
android:layout_marginTop="38dp"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/takeSampleButton"
android:src="@drawable/sampling_icon"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButtonSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/settings_icon"
android:background="@null"
android:contentDescription="@string/settingsButtonMain"/>
<ImageButton
android:id="@+id/imageButtonLabNotebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/labNotebookButtonMain"
android:src="@drawable/lab_notebook_icon"/>
</LinearLayout>
<ImageButton
android:id="@+id/imageButtonAbout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/about_icon"
android:background="@null"
android:contentDescription="@string/aboutButtonMain"
android:layout_marginBottom="57dp"
android:layout_marginEnd="79dp"
android:layout_above="@+id/imageButtonTakeSample"
android:layout_toStartOf="@+id/imageButtonSettings" />
<ImageButton
android:id="@+id/imageButtonSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="activityStart"
android:src="@drawable/settings_icon"
android:background="@null"
android:contentDescription="@string/settingsButtonMain"
android:layout_marginEnd="103dp"
android:layout_alignBottom="@+id/imageButtonAbout"
android:layout_alignParentEnd="true" />
<ImageButton
android:id="@+id/imageButtonTakeSample"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/takeSampleButton"
android:src="@drawable/sampling_icon"
android:layout_alignBottom="@+id/imageButtonLabNotebook"
android:layout_toEndOf="@+id/imageButtonAbout" />
<ImageButton
android:id="@+id/imageButtonLabNotebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="activityStart"
android:contentDescription="@string/labNotebookButtonMain"
android:src="@drawable/lab_notebook_icon"
android:layout_centerVertical="true"
android:layout_alignEnd="@+id/imageButtonAbout" />
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sensor_sample_buttons"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/take_a_sample_bg"
android:focusableInTouchMode="true" >
android:orientation="horizontal" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBuiltIn"
android:src="@drawable/builtin_sensors_icon"
android:contentDescription="@string/builtinSensors"
android:background="@null"
android:onClick="startSampleActivity"
android:adjustViewBounds="false"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBluetooth"
android:src="@drawable/bluetooth_devices"
android:contentDescription="@string/bluetoothSensor"
android:background="@null"
android:onClick="startSampleActivity"
android:layout_alignBottom="@+id/imageButtonDbActions"
android:layout_toStartOf="@+id/imageButtonBuiltIn" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBuiltIn"
android:src="@drawable/builtin_sensors_icon"
android:contentDescription="@string/builtinSensors"
android:background="@null"
android:onClick="startSampleActivity" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonDbActions"
android:src="@drawable/database_actions_icon"
android:contentDescription="@string/databaseActions"
android:background="@null"
android:onClick="startSampleActivity"
android:layout_above="@+id/imageButtonBuiltIn"
android:layout_toEndOf="@+id/imageButtonBuiltIn"
android:layout_marginBottom="84dp" />
</RelativeLayout>
\ No newline at end of file
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonBluetooth"
android:src="@drawable/bluetooth_devices"
android:contentDescription="@string/bluetoothSensor"
android:background="@null"
android:onClick="startSampleActivity"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonDbActions"
android:src="@drawable/database_actions_icon"
android:contentDescription="@string/databaseActions"
android:background="@null"
android:onClick="startSampleActivity" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment