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

Commit 906d80d

Browse files
authored
Merge pull request #106 from amardeshbd/new-release
[UPDATE] [#102] Layout to be more pleasing to eye and consistent positioning of play icon.
2 parents 803efbf + 69caf36 commit 906d80d

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

app/build.gradle

+3-3
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

+16-9
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." />
@@ -72,13 +71,14 @@
7271
android:id="@+id/resource_title"
7372
style="@style/TextAppearance.AppCompat.Title"
7473
android:layout_width="0dp"
74+
android:gravity="end"
7575
android:layout_height="wrap_content"
7676
android:layout_marginTop="@dimen/material_vertical_margin"
7777
android:text="@{data.title}"
78-
app:layout_constraintEnd_toStartOf="@+id/action_play"
79-
app:layout_constraintStart_toStartOf="@+id/guideline_vertical_start"
78+
app:layout_constraintEnd_toEndOf="@id/guideline_vertical_end"
79+
app:layout_constraintStart_toEndOf="@id/action_play"
8080
app:layout_constraintTop_toTopOf="parent"
81-
tools:text="This is the title of the talk." />
81+
tools:text="This is the title of the talk. This can become multi line" />
8282

8383

8484
<TextView
@@ -89,8 +89,8 @@
8989
android:layout_marginTop="@dimen/material_content_distance_small"
9090
android:gravity="end"
9191
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"
92+
app:layout_constraintEnd_toEndOf="@id/guideline_vertical_end"
93+
app:layout_constraintStart_toEndOf="@+id/action_play"
9494
app:layout_constraintTop_toBottomOf="@+id/resource_title"
9595
tools:text="by Author of the talk." />
9696

@@ -99,7 +99,14 @@
9999
android:layout_width="0dp"
100100
android:layout_height="0dp"
101101
android:orientation="vertical"
102-
app:layout_constraintGuide_begin="16dp" />
102+
app:layout_constraintGuide_begin="@dimen/material_horizontal_margin" />
103+
104+
<androidx.constraintlayout.widget.Guideline
105+
android:id="@+id/guideline_vertical_end"
106+
android:layout_width="0dp"
107+
android:layout_height="0dp"
108+
android:orientation="vertical"
109+
app:layout_constraintGuide_end="@dimen/material_horizontal_margin" />
103110

104111
</androidx.constraintlayout.widget.ConstraintLayout>
105112
</androidx.cardview.widget.CardView>

0 commit comments

Comments
 (0)