Skip to content
This repository was archived by the owner on Mar 1, 2022. It is now read-only.

Commit 2119f8e

Browse files
author
João Pedro Evangelista
committed
Fix excessive margin on cards due to combining top and bottom margins
1 parent dfbd149 commit 2119f8e

File tree

2 files changed

+57
-53
lines changed

2 files changed

+57
-53
lines changed
Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,67 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
4-
android:layout_width="match_parent"
5-
android:layout_height="wrap_content"
6-
android:layout_margin="16dp"
7-
android:clickable="true"
8-
android:foreground="?attr/selectableItemBackground">
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content"
6+
android:layout_marginLeft="16dp"
7+
android:layout_marginRight="16dp"
8+
android:layout_marginTop="16dp"
9+
android:clickable="true"
10+
android:foreground="?attr/selectableItemBackground">
911

10-
<RelativeLayout
11-
android:layout_width="match_parent"
12-
android:layout_height="wrap_content"
13-
android:padding="16dp">
12+
<RelativeLayout
13+
android:layout_width="match_parent"
14+
android:layout_height="wrap_content"
15+
android:padding="16dp">
1416

15-
<LinearLayout
16-
android:id="@+id/first_line_container"
17-
android:layout_width="match_parent"
18-
android:layout_height="wrap_content"
19-
android:orientation="horizontal">
17+
<LinearLayout
18+
android:id="@+id/first_line_container"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:orientation="horizontal">
2022

21-
<TextView
22-
android:id="@+id/text_view_leader_rank"
23-
android:layout_width="wrap_content"
24-
android:layout_height="wrap_content"
25-
android:textColor="@color/colorSecondaryText"
26-
android:textStyle="bold" />
23+
<TextView
24+
android:id="@+id/text_view_leader_rank"
25+
android:layout_width="wrap_content"
26+
android:layout_height="wrap_content"
27+
android:textColor="@color/colorSecondaryText"
28+
android:textStyle="bold"/>
2729

28-
<ImageView
29-
android:layout_width="18dp"
30-
android:layout_height="18dp"
31-
android:contentDescription="@string/badge"
32-
android:tint="@color/trophy"
33-
app:srcCompat="@drawable/trophy_award" />
30+
<ImageView
31+
android:layout_width="18dp"
32+
android:layout_height="18dp"
33+
android:contentDescription="@string/badge"
34+
android:tint="@color/trophy"
35+
app:srcCompat="@drawable/trophy_award"/>
3436

35-
<TextView
36-
android:id="@+id/text_view_leader_name"
37-
android:layout_width="wrap_content"
38-
android:layout_height="wrap_content"
39-
android:layout_marginLeft="16dp"
40-
android:layout_marginStart="16dp"
41-
android:textSize="16sp" />
42-
</LinearLayout>
37+
<TextView
38+
android:id="@+id/text_view_leader_name"
39+
android:layout_width="wrap_content"
40+
android:layout_height="wrap_content"
41+
android:layout_marginLeft="16dp"
42+
android:layout_marginStart="16dp"
43+
android:textSize="16sp"/>
44+
</LinearLayout>
4345

4446

45-
<TextView
46-
android:id="@+id/text_view_leader_time"
47-
android:layout_width="wrap_content"
48-
android:layout_height="wrap_content"
49-
android:layout_below="@id/first_line_container"
50-
android:layout_marginTop="16dp"
51-
android:textColor="@color/colorSecondaryText" />
47+
<TextView
48+
android:id="@+id/text_view_leader_time"
49+
android:layout_width="wrap_content"
50+
android:layout_height="wrap_content"
51+
android:layout_below="@id/first_line_container"
52+
android:layout_marginTop="16dp"
53+
android:textColor="@color/colorSecondaryText"/>
5254

53-
<TextView
54-
android:id="@+id/text_view_leader_languages"
55-
android:layout_width="wrap_content"
56-
android:layout_height="wrap_content"
57-
android:layout_alignParentEnd="true"
58-
android:layout_alignParentRight="true"
59-
android:layout_below="@id/text_view_leader_time"
60-
android:layout_marginTop="16dp"
61-
android:textColor="@color/colorAccent" />
55+
<TextView
56+
android:id="@+id/text_view_leader_languages"
57+
android:layout_width="wrap_content"
58+
android:layout_height="wrap_content"
59+
android:layout_alignParentEnd="true"
60+
android:layout_alignParentRight="true"
61+
android:layout_below="@id/text_view_leader_time"
62+
android:layout_marginTop="16dp"
63+
android:textColor="@color/colorAccent"/>
6264

63-
</RelativeLayout>
65+
</RelativeLayout>
6466

6567
</android.support.v7.widget.CardView>

mobile/src/main/res/layout/fragment_project_item.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="match_parent"
44
android:layout_height="wrap_content"
5-
android:layout_margin="16dp"
5+
android:layout_marginLeft="16dp"
6+
android:layout_marginRight="16dp"
7+
android:layout_marginTop="16dp"
68
android:clickable="true"
79
android:foreground="?attr/selectableItemBackground"
810
android:orientation="horizontal">

0 commit comments

Comments
 (0)