Skip to content

Commit

Permalink
fix(layout): layout fixed with constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrucesdeveloper committed Aug 13, 2022
1 parent 6affcc8 commit 47d072e
Showing 1 changed file with 123 additions and 97 deletions.
220 changes: 123 additions & 97 deletions app/src/main/res/layout/activity_play_game.xml
Original file line number Diff line number Diff line change
@@ -1,121 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10"
tools:context=".activities.PlayGameActivity">


<ImageView
android:id="@+id/imageView"
android:layout_width="64dp"
android:layout_height="55dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="331dp"
android:onClick="goBackToMenu"
android:contentDescription="Button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@android:drawable/ic_menu_revert" />
<TextView
android:id="@+id/textViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif-light"
android:text="Lineas Metro"
android:textSize="34sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textViewAlternative4"
android:layout_width="150dp"
android:layout_height="93dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="24dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="SAN PEDRO"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/textViewAlternative3" />

<TextView
android:id="@+id/textViewAlternative3"
android:layout_width="150dp"
android:layout_height="93dp"
android:layout_marginStart="52dp"
android:layout_marginBottom="24dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="SAN PEDRO"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/textViewAlternative1"
android:layout_width="150dp"
android:layout_height="93dp"
android:layout_marginStart="52dp"
android:layout_marginBottom="8dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="SAN PEDRO"
app:layout_constraintBottom_toTopOf="@+id/textViewAlternative3"
app:layout_constraintStart_toStartOf="parent" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="180dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="181dp"
android:orientation="horizontal"
tools:layout_marginTop="16dp">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewCurrentStation">

<ImageView
android:id="@+id/imageView2"
<TextView
android:id="@+id/textViewCurrentPosition"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_weight="1"
app:srcCompat="@android:drawable/ic_menu_revert"
tools:layout_weight="0.3" />
android:layout_height="wrap_content"
android:text="0"
android:textSize="24sp" />

<TextView
android:id="@+id/textViewTitle"
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="sans-serif-light"
android:lineSpacingExtra="8sp"
android:text="Linea Metro"
android:textAlignment="center"
android:textSize="34sp"
tools:layout_marginRight="30dp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="vertical">
android:text="/"
android:textSize="24sp" />

<TextView
android:id="@+id/textViewCurrentStation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal|center_vertical"
android:text="CURRENT LINEA" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:gravity="clip_vertical|center_horizontal|center_vertical"
android:orientation="horizontal">

<TableLayout
android:layout_width="match_parent"
android:id="@+id/textViewMaxPosition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:padding="30dp"
android:stretchColumns="*">

<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<TextView
android:id="@+id/textViewAlternative1"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="2dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="TEST"
android:textAlignment="center" />

<TextView
android:id="@+id/textViewAlternative2"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="2dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="TEST"
android:textAlignment="center" />

</TableRow>

<TableRow>
android:text="20"
android:textSize="24sp" />
</LinearLayout>

<TextView
android:id="@+id/textViewAlternative3"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="2dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="TEST"
android:textAlignment="center" />
<TextView
android:id="@+id/textViewAlternative2"
android:layout_width="150dp"
android:layout_height="93dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="8dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="SAN PEDRO"
app:layout_constraintBottom_toTopOf="@+id/textViewAlternative4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/textViewAlternative1" />

<TextView
android:id="@+id/textViewCurrentStation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="240dp"
android:text="CURRENT LINEA"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.48"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textViewAlternative4"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_margin="2dp"
android:background="@android:drawable/editbox_dropdown_light_frame"
android:gravity="center_horizontal|center_vertical"
android:text="TEST"
android:textAlignment="center" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="180dp"
android:layout_marginTop="150dp"
android:layout_marginEnd="181dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewCurrentStation">

</TableRow>
</TableLayout>
</LinearLayout>

</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 47d072e

Please sign in to comment.