Skip to content

Commit

Permalink
Refactor repository view
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandr7035 committed Jan 4, 2022
1 parent c97484a commit 23ce792
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
20 changes: 11 additions & 9 deletions app/src/main/res/drawable/background_repository_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@

<item android:state_pressed="true">
<shape>
<solid
android:color="@color/gray_50"/>
<corners
android:radius="20dp"/>
<solid android:color="@color/gray_50"/>
<corners android:radius="20dp"/>
</shape>
</item>

<item android:state_focused="true">
<shape>
<solid android:color="@color/white"/>
<corners android:radius="20dp"/>
<stroke android:width="1dp" android:color="@color/gray_200"/>
</shape>
</item>

<item>
<shape>
<solid
android:color="@color/white"/>
<corners
android:radius="20dp"/>
<solid android:color="@color/white"/>
<corners android:radius="20dp"/>
</shape>

</item>

</selector>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/view_repository.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/RepositoryViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:padding="10dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:elevation="5dp"
android:background="@drawable/background_repository_item"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
<dimen name="profile_card_label_margin">8dp</dimen>
<dimen name="profile_fields_vertical_spacing">4dp</dimen>
<dimen name="decoration_repository_item_spacing">16dp</dimen>

<dimen name="default_element_elevation">4dp</dimen>
</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@
<item name="android:textColor">@color/blue_500</item>
</style>

<style name="RepositoryViewStyle">
<item name="android:background">@drawable/background_repository_item</item>
<item name="android:elevation">@dimen/default_element_elevation</item>
</style>

<style name="RepositoryTopicTagStyle">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/blue_100</item>
Expand Down

0 comments on commit 23ce792

Please sign in to comment.