Commit 31ce8e80 authored by Craig Earley's avatar Craig Earley
Browse files

abstracts styles that recur in different objects

parent 66abd4bb
......@@ -12,72 +12,47 @@
android:gravity="start">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:id="@+id/serverIp"
android:text=""
android:hint="@string/server_ip"
android:singleLine="true"
android:textColorHint="@color/dark_gray_blue"
android:textColor="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:id="@+id/database"
android:singleLine="true"
android:text=""
android:hint="@string/database_name"
android:textColorHint="@color/dark_gray_blue"
android:textColor="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:id="@+id/username"
android:text=""
android:hint="@string/username"
android:textColorHint="@color/dark_gray_blue"
android:textColor="@color/dark_gray_blue"
android:singleLine="true"
android:textCursorDrawable="@null"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:id="@+id/password"
android:text=""
android:inputType="textPassword"
android:hint="@string/password"
android:textColorHint="@color/dark_gray_blue"
android:singleLine="true"
android:textColor="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:id="@+id/port"
android:text="@string/default_port"
android:hint="@string/port_of_db"
android:singleLine="true"
android:textColorHint="@color/dark_gray_blue"
android:textColor="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:fontFamily="sans-serif"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
......@@ -128,43 +103,31 @@
android:orientation="vertical"
android:gravity="end">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/connect"
android:id="@+id/setupDbButton"
android:textAllCaps="false"/>
style="@style/database_button_landscape" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/upload_tables"
android:id="@+id/uploadButton"
android:textAllCaps="false" />
style="@style/database_button_landscape" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/wipeDB"
android:id="@+id/wipeDatabase"
android:textAllCaps="false" />
style="@style/database_button_landscape" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/clean_field_data"
android:id="@+id/wipeFieldData"
android:textAllCaps="false"/>
style="@style/database_button_landscape" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/clean_readings_table"
android:id="@+id/wipeReadingsTable"
android:textAllCaps="false"/>
style="@style/database_button_landscape" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/clean_streaming_table"
android:id="@+id/wipeStreamingTable"
android:textAllCaps="false"/>
style="@style/database_button_landscape" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -98,62 +98,42 @@
android:id="@+id/interval">
<RadioButton
android:id="@+id/oneSecond"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
style="@style/intervalButtons"
android:checked="true"
android:onClick="changeInterval"
android:padding="10dp"
android:text="@string/oneSecond"
android:textColor="#FFFFFF"
android:visibility="invisible"
tools:visibility="visible" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
android:id="@+id/threeSeconds"
android:onClick="changeInterval"
style="@style/intervalButtons"
android:checked="true"
android:padding="10dp"
android:onClick="changeInterval"
android:text="@string/threeSeconds" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/fiveSeconds"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
android:padding="10dp"
android:text="@string/fiveSeconds" />
android:text="@string/fiveSeconds"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tenSeconds"
android:background="@drawable/intervalbuttonselector"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:button="@android:color/transparent"
android:padding="10dp"
android:text="@string/tenSeconds" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/thirtySeconds"
android:background="@drawable/intervalbuttonselector"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:button="@android:color/transparent"
android:padding="10dp"
android:text="@string/thirtySeconds" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/sixtySeconds"
android:background="@drawable/intervalbuttonselector"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:button="@android:color/transparent"
android:padding="10dp"
android:text="@string/sixtySeconds" />
</RadioGroup>
......@@ -190,36 +170,18 @@
android:layout_marginStart="23dp" />
<Button
android:id="@+id/addPictureButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/noteAndImagebuttons"
android:layout_above="@+id/streamButton"
android:layout_margin="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:layout_toStartOf="@+id/addNotesButton"
android:background="#E6FFFFFF"
android:backgroundTint="#FFFFFF"
android:onClick="takePicture"
android:padding="5dp"
android:textAllCaps="false"
android:text="@string/add_picture_text" />
<Button
android:id="@+id/addNotesButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/noteAndImagebuttons"
android:layout_above="@+id/streamButton"
android:layout_alignEnd="@+id/satellites"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="#E6FFFFFF"
android:onClick="addNotes"
android:padding="5dp"
android:textAllCaps="false"
android:text="@string/add_notes" />
<Button
......
......@@ -12,40 +12,25 @@
android:orientation="horizontal" >
<Button
android:id="@+id/buttonAbout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="activityStart"
app:srcCompat="@drawable/about_icon"
android:text="@string/about_text"
android:fontFamily="@font/comfortaaregular"
style="@style/Widget.AppCompat.Button.Colored"
android:textAllCaps="false"
style="@style/miniButtons"
android:contentDescription="@string/aboutButtonMain"/>
<Button
android:id="@+id/buttonSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="activityStart"
app:srcCompat="@drawable/settings_icon"
android:text="@string/settings_text"
android:fontFamily="@font/comfortaaregular"
style="@style/Widget.AppCompat.Button.Colored"
android:textAllCaps="false"
style="@style/miniButtons"
android:contentDescription="@string/settingsButtonMain"/>
<Button
android:id="@+id/buttonNotebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="activityStart"
android:contentDescription="@string/labNotebookButtonMain"
app:srcCompat="@drawable/lab_notebook_icon"
style="@style/Widget.AppCompat.Button.Colored"
android:textAllCaps="false"
style="@style/miniButtons"
android:text="@string/notebook_text"
android:fontFamily="@font/comfortaaregular"
/>
</LinearLayout>
<Button
......@@ -64,44 +49,25 @@
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/imageButtonBluetooth"
style="@style/mainScreenButtons"
android:drawableTop="@drawable/bluetooth_devices"
android:contentDescription="@string/bluetoothSensor"
android:background="@null"
android:textSize="@dimen/sample_button_font_size"
android:text="@string/bluetooth_devices_text"
android:fontFamily="@font/comfortaaregular"
android:textAllCaps="false"
android:onClick="startSampleActivity"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/imageButtonBuiltIn"
style="@style/mainScreenButtons"
android:drawableTop="@drawable/builtin_sensors_icon"
android:contentDescription="@string/builtinSensors"
android:background="@null"
android:textSize="@dimen/sample_button_font_size"
android:text="@string/builtin_sensors_text"
android:fontFamily="@font/comfortaaregular"
android:textAllCaps="false"
android:onClick="startSampleActivity" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:drawableTop="@drawable/bench_icon"
android:contentDescription="@string/benchSample"
android:background="@null"
android:textSize="@dimen/sample_button_font_size"
android:id="@+id/imageButtonBenchSample"
style="@style/mainScreenButtons"
android:text="@string/bench_sample_text"
android:fontFamily="@font/comfortaaregular"
android:textAllCaps="false"
android:onClick="startSampleActivity" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -6,156 +6,111 @@
<EditText
android:id="@+id/serverIp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:layout_marginTop="31dp"
android:layout_alignEnd="@id/serverIp"
android:layout_alignParentTop="true"
android:layout_alignStart="@id/serverIp"
android:layout_centerHorizontal="true"
android:layout_marginTop="31dp"
android:hint="@string/server_ip"
android:singleLine="true"
android:text="@string/default_ip"
android:textColor="@color/dark_gray_blue"
android:textColorHint="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:id="@+id/database"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:layout_alignEnd="@id/serverIp"
android:layout_alignStart="@id/serverIp"
android:layout_below="@+id/serverIp"
android:layout_centerHorizontal="true"
android:hint="@string/database_name"
android:singleLine="true"
android:text="@string/default_database_name"
android:textColor="@color/dark_gray_blue"
android:textColorHint="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:layout_alignEnd="@id/serverIp"
android:layout_alignStart="@id/serverIp"
android:layout_below="@+id/database"
android:layout_centerHorizontal="true"
android:hint="@string/username"
android:singleLine="true"
android:text="@string/default_username"
android:textColor="@color/dark_gray_blue"
android:textColorHint="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:id="@+id/password"
android:text=""
android:inputType="textPassword"
android:hint="@string/password"
android:textColorHint="@color/dark_gray_blue"
android:textColor="@color/dark_gray_blue"
android:layout_alignStart="@id/serverIp"
android:singleLine="true"
android:layout_alignEnd="@id/serverIp"
android:textCursorDrawable="@null"
android:layout_below="@+id/username"
android:layout_centerHorizontal="true"
android:autofillHints=""
tools:targetApi="o" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/credentialBoxes"
android:id="@+id/port"
android:text="@string/default_port"
android:textColorHint="@color/dark_gray_blue"
android:textColor="@color/dark_gray_blue"
android:textCursorDrawable="@null"
android:hint="@string/port_of_db"
android:layout_alignStart="@id/serverIp"
android:layout_alignEnd="@id/serverIp"
android:singleLine="true"
android:fontFamily="sans-serif"
android:layout_below="@+id/password"
android:layout_centerHorizontal="true"
android:inputType=""
android:autofillHints=""
tools:targetApi="o" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connect"
android:id="@+id/setupDbButton"
android:textAllCaps="false"
android:layout_below="@+id/port"
android:layout_centerHorizontal="true" />
android:layout_centerHorizontal="true"
style="@style/database_button_portrait" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/upload_tables"
android:id="@+id/uploadButton"
android:textAllCaps="false"
android:layout_below="@id/setupDbButton"
android:layout_alignParentStart="true" />
android:layout_alignParentStart="true"
style="@style/database_button_portrait" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/copy_to_sd_card"
android:id="@+id/exportDatabaseButton"
android:textAllCaps="false"
android:layout_below="@id/setupDbButton"
android:layout_alignParentEnd="true"
android:onClick="exportDatabase"/>
android:onClick="exportDatabase"
style="@style/database_button_portrait" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/wipeDB"
android:id="@+id/wipeDatabase"
android:textAllCaps="false"
android:layout_below="@id/exportDatabaseButton"
android:layout_alignParentEnd="true"/>
android:layout_alignParentEnd="true"
style="@style/database_button_portrait" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/clean_field_data"
android:id="@+id/wipeFieldData"
android:textAllCaps="false"
android:layout_below="@id/exportDatabaseButton"
android:layout_alignParentStart="true"/>
android:layout_alignParentStart="true"
style="@style/database_button_portrait" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/clean_readings_table"
android:id="@+id/wipeReadingsTable"
android:layout_below="@id/wipeDatabase"
android:textAllCaps="false"
android:layout_alignParentStart="true"/>
android:layout_alignParentStart="true"
style="@style/database_button_portrait" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/clean_streaming_table"
android:id="@+id/wipeStreamingTable"
android:textAllCaps="false"
android:layout_below="@id/wipeDatabase"
android:layout_alignParentEnd="true"/>
android:layout_alignParentEnd="true"
style="@style/database_button_portrait" />
<TextView
android:layout_width="wrap_content"
......
......@@ -102,73 +102,43 @@
<RadioButton
android:id="@+id/oneSecond"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
style="@style/intervalButtons"
android:checked="true"
android:onClick="changeInterval"
android:padding="10dp"
android:text="@string/oneSecond"
android:textColor="#FFFFFF"
android:visibility="invisible"
tools:visibility="visible" />
<RadioButton
android:id="@+id/threeSeconds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
style="@style/intervalButtons"
android:checked="true"
android:onClick="changeInterval"
android:padding="10dp"
android:text="@string/threeSeconds"
android:textColor="#FFFFFF" />
android:text="@string/threeSeconds" />
<RadioButton
android:id="@+id/fiveSeconds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:padding="10dp"
android:text="@string/fiveSeconds"
android:textColor="#FFFFFF" />
android:text="@string/fiveSeconds"/>
<RadioButton
android:id="@+id/tenSeconds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:padding="10dp"
android:text="@string/tenSeconds"
android:textColor="#FFFFFF" />
android:text="@string/tenSeconds" />
<RadioButton
android:id="@+id/thirtySeconds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:padding="10dp"
android:text="@string/thirtySeconds"
android:textColor="#FFFFFF" />
android:text="@string/thirtySeconds" />
<RadioButton
android:id="@+id/sixtySeconds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/intervalbuttonselector"
android:button="@android:color/transparent"
style="@style/intervalButtons"
android:onClick="changeInterval"
android:padding="10dp"
android:text="@string/sixtySeconds"
android:textColor="#FFFFFF" />
android:text="@string/sixtySeconds" />
</RadioGroup>
<ListView
......@@ -205,36 +175,18 @@
<Button
android:id="@+id/addPictureButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/noteAndImagebuttons"
android:layout_above="@+id/streamButton"
android:layout_margin="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:layout_toStartOf="@+id/addNotesButton"
android:background="#E6FFFFFF"