Skip to content

Commit

Permalink
use constraint layout
Browse files Browse the repository at this point in the history
  • Loading branch information
berdosi committed Oct 22, 2020
1 parent 829391b commit 6c7c134
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 34 deletions.
78 changes: 44 additions & 34 deletions app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,58 @@
tools:context=".MainActivity"
tools:showIn="@layout/activity_main">

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="409dp"
android:layout_height="673dp"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.14"
app:layout_constraintStart_toStartOf="parent"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/camera_view_height"
app:layout_constraintTop_toTopOf="parent">

<TextureView
android:id="@+id/textureView2"
android:layout_width="@dimen/camera_view_width"
android:layout_height="@dimen/camera_view_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="73dp"
android:layout_gravity="center_vertical"
android:gravity="fill_vertical"
android:layout_height="match_parent"
android:textAlignment="center"
android:textAllCaps="false"
android:textIsSelectable="false" />
android:textIsSelectable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imageButton"
app:layout_constraintStart_toEndOf="@+id/textureView2"
app:layout_constraintTop_toTopOf="parent" />

<TextureView
android:id="@+id/textureView2"
android:layout_width="32dp"
android:layout_height="32dp" />
<ImageButton
android:id="@+id/imageButton"
android:layout_width="@dimen/camera_view_width"
android:layout_height="@dimen/camera_view_height"
android:contentDescription="@string/share_button_description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@android:drawable/ic_menu_share" />
</androidx.constraintlayout.widget.ConstraintLayout>

<TextureView
android:id="@+id/graphTextureView"
android:layout_width="match_parent"
android:layout_height="59dp" />
<TextureView
android:id="@+id/graphTextureView"
android:layout_width="match_parent"
android:layout_height="59dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />

<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="613dp"
android:ems="10"
android:hint="@string/output_hint"
android:importantForAutofill="no"
android:inputType="none" />
<EditText
android:id="@+id/editText"
android:layout_width="0dp"
android:layout_height="0dp"
android:ems="10"
android:hint="@string/output_hint"
android:importantForAutofill="no"
android:inputType="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/graphTextureView" />

</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
5 changes: 5 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="camera_view_width">32dp</dimen>
<dimen name="camera_view_height">32dp</dimen>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<string name="separator">,</string>
<string name="row_separator">\n</string>
<string name="raw_values">Measurements (Timestamp, Value)</string>
<string name="share_button_description">Share</string>
<plurals name="measurement_output_template">
<item quantity="zero">Pulse: %2.1f (%d cycle in %2.1f seconds)</item>
<item quantity="one">Pulse: %2.1f (%d cycle in %2.1f seconds)</item>
Expand Down

0 comments on commit 6c7c134

Please sign in to comment.