Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 3973210

Browse files
committed
[UPDATE] [#102] Layout to be more pleasing to eye and consistent positioning of play icon.
1 parent 803efbf commit 3973210

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "com.hossainkhan.android.constraintlayout"
1111
minSdkVersion rootProject.ext.androidMinSdkVersion
1212
targetSdkVersion rootProject.ext.androidTargetSdkVersion
13-
versionCode 109
14-
versionName "1.9-constraint-layout-demo"
13+
versionCode 200
14+
versionName "2.0-constraint-layout-demo"
1515
versionNameSuffix "-${gitSha()}"
1616

1717
buildConfigField "String", "GIT_SHA", "\"${gitSha()}\""
@@ -103,7 +103,7 @@ dependencies {
103103
androidTestImplementation("androidx.test.espresso:espresso-core:$rootProject.espressoVersion", {
104104
exclude group: 'com.android.support', module: 'support-annotations'
105105
})
106-
androidTestImplementation 'androidx.test:runner:1.1.1'
106+
androidTestImplementation 'androidx.test:runner:1.2.0'
107107
testImplementation "androidx.arch.core:core-testing:$rootProject.archComponentVersion"
108108
}
109109

app/src/main/res/layout/list_item_resource_tech_talk.xml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
android:layout_width="64dp"
4040
android:layout_height="wrap_content"
4141
android:tint="@color/md_red_500"
42-
app:layout_constraintBottom_toBottomOf="@+id/resource_summary"
43-
app:layout_constraintEnd_toEndOf="parent"
42+
app:layout_constraintStart_toStartOf="@+id/guideline_vertical_start"
4443
app:layout_constraintTop_toTopOf="@+id/resource_title"
4544
app:srcCompat="@drawable/ic_play_circle_filled_black_42dp" />
4645

@@ -51,7 +50,7 @@
5150
android:layout_height="wrap_content"
5251
android:layout_marginTop="@dimen/material_content_distance_small"
5352
android:text="@{data.summary}"
54-
app:layout_constraintEnd_toStartOf="@+id/action_play"
53+
app:layout_constraintEnd_toEndOf="@id/guideline_vertical_end"
5554
app:layout_constraintStart_toStartOf="@+id/guideline_vertical_start"
5655
app:layout_constraintTop_toBottomOf="@+id/resource_author"
5756
tools:text="In this session you will learn best practices of using ConstraintLayout on Android, particularly covering tips and tricks in the Layout Editor and new features introduced in the 2.0 version. We will go over how to take advantage of those to create UI more efficiently." />
@@ -75,10 +74,10 @@
7574
android:layout_height="wrap_content"
7675
android:layout_marginTop="@dimen/material_vertical_margin"
7776
android:text="@{data.title}"
78-
app:layout_constraintEnd_toStartOf="@+id/action_play"
79-
app:layout_constraintStart_toStartOf="@+id/guideline_vertical_start"
77+
app:layout_constraintEnd_toEndOf="@id/guideline_vertical_end"
78+
app:layout_constraintStart_toEndOf="@id/action_play"
8079
app:layout_constraintTop_toTopOf="parent"
81-
tools:text="This is the title of the talk." />
80+
tools:text="This is the title of the talk. This can become multi line" />
8281

8382

8483
<TextView
@@ -89,8 +88,8 @@
8988
android:layout_marginTop="@dimen/material_content_distance_small"
9089
android:gravity="end"
9190
android:text="@{@string/tech_talk_author_and_venue(data.author, data.event)}"
92-
app:layout_constraintEnd_toStartOf="@+id/action_play"
93-
app:layout_constraintStart_toStartOf="@+id/guideline_vertical_start"
91+
app:layout_constraintEnd_toEndOf="@id/guideline_vertical_end"
92+
app:layout_constraintStart_toEndOf="@+id/action_play"
9493
app:layout_constraintTop_toBottomOf="@+id/resource_title"
9594
tools:text="by Author of the talk." />
9695

@@ -99,7 +98,14 @@
9998
android:layout_width="0dp"
10099
android:layout_height="0dp"
101100
android:orientation="vertical"
102-
app:layout_constraintGuide_begin="16dp" />
101+
app:layout_constraintGuide_begin="@dimen/material_horizontal_margin" />
102+
103+
<androidx.constraintlayout.widget.Guideline
104+
android:id="@+id/guideline_vertical_end"
105+
android:layout_width="0dp"
106+
android:layout_height="0dp"
107+
android:orientation="vertical"
108+
app:layout_constraintGuide_end="@dimen/material_horizontal_margin" />
103109

104110
</androidx.constraintlayout.widget.ConstraintLayout>
105111
</androidx.cardview.widget.CardView>

0 commit comments

Comments
 (0)