Skip to content

Commit

Permalink
[UI/#8] follower 레이아웃 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed May 12, 2023
1 parent 38648d3 commit aec7577
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ object BindingAdapter {
transformations(RoundedCornersTransformation(50f))
}
}

@JvmStatic
@BindingAdapter("setCircleImage")
fun ImageView.setCircleImage(img: String?) {
load(img) {
placeholder(R.mipmap.ic_go_sopt)
error(R.drawable.ic_image_not_supported)
fallback(R.drawable.ic_image_not_supported)
transformations(RoundedCornersTransformation(1000f))
}
}
}
18 changes: 10 additions & 8 deletions app/src/main/res/layout/fragment_follower.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".presentation.main.follower.FollowerFragment">

<data>
Expand All @@ -13,17 +13,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/tv_follower_fragment"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_follower"
android:layout_width="0dp"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingVertical="10dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:text="@string/follower_fragment"
android:textAppearance="?textAppearanceBodyLarge" />
app:spanCount="2"
tools:listitem="@layout/item_follower" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
22 changes: 22 additions & 0 deletions app/src/main/res/layout/header_follower.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout_repo_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="14dp">

<TextView
android:id="@+id/tv_follower_header_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/follower_header_title"
android:textAppearance="?textAppearanceDisplayMedium"
android:textColor="?colorOnBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
52 changes: 52 additions & 0 deletions app/src/main/res/layout/item_follower.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">

<data>

</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_item_follower"
android:layout_width="wrap_content"
android:layout_marginTop="30dp"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/iv_follower_profile"
android:layout_width="100dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_image_not_supported" />

<TextView
android:id="@+id/tv_follower_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?textAppearanceBodyLarge"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_follower_profile"
tools:text="@string/dummy" />

<TextView
android:id="@+id/tv_follower_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?textAppearanceBodySmall"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_follower_name"
tools:text="@string/dummy" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
9 changes: 4 additions & 5 deletions app/src/main/res/layout/item_gallery_image.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

Expand All @@ -10,15 +9,15 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_gallery"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:layout_height="match_parent">

<ImageView
android:id="@+id/iv_gallery"
android:layout_width="200dp"
android:layout_height="0dp"
android:contentDescription="뭔데 이게..."
android:src="@drawable/img_main_profile"
app:layout_constraintBottom_toBottomOf="parent"
android:contentDescription="뭔데 이게..."
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/item_home_repo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_image_not_supported" />

<TextView
android:id="@+id/tv_repo_name"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<string name="search_fragment">SEARCH FRAGMENT</string>

<!-- follower -->
<string name="follower_fragment">FOLLOWER FRAGMENT</string>
<string name="follower_header_title">Followers</string>

<!-- profile -->
<string name="profile_name">이름 : %s</string>
Expand Down

0 comments on commit aec7577

Please sign in to comment.