Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design] 즐겨찾기 화면 제작 #94

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {
implementation(projects.feature.documents)
implementation(projects.feature.settings)
implementation(projects.feature.userInfo)
implementation(projects.feature.favorites)
// Test dependencies
androidTestImplementation(libs.androidx.test.ext)
androidTestImplementation(libs.androidx.test.espresso.core)
Expand Down
7 changes: 7 additions & 0 deletions core/ui/src/main/java/com/iguana/ui/BaseActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.iguana.dashBoard.DashBoardFragment
import com.iguana.documents.DocumentsFragment
import com.iguana.favorites.FavoritesFragment
import com.iguana.settings.SettingsFragment
import com.iguana.ui.databinding.ActivityBaseBinding
import com.iguana.userinfo.UserInfoFragment
Expand Down Expand Up @@ -49,4 +50,10 @@ class BaseActivity : AppCompatActivity() {
.replace(R.id.content_frame, UserInfoFragment())
.commit()
}

fun showFavorites() {
supportFragmentManager.beginTransaction()
.replace(R.id.content_frame, FavoritesFragment())
.commit()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class SideTabLayoutFragment : Fragment() {

fun onFavoritesClick() {
_selectedItem.value = 2
(activity as? BaseActivity)?.showFavorites()
}

fun onProfileClick() {
Expand Down
12 changes: 12 additions & 0 deletions feature/favorites/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ plugins {
id("iguana.android.hilt")
id("iguana.kotlin.hilt")
id("iguana.android.feature")
alias(libs.plugins.kotlin.android)
id("kotlin-kapt")
}

android {
namespace = "com.iguana.favorites"

buildFeatures {
dataBinding = true
viewBinding = true
buildConfig = true
}
}
dependencies {
implementation(projects.core.domain)
implementation(projects.core.designsystem)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)

// Test dependencies
androidTestImplementation(libs.androidx.test.ext)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.iguana.favorites

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.iguana.favorites.databinding.FragmentFavoritesBinding

class FavoritesFragment : Fragment() {

private var _binding: FragmentFavoritesBinding? = null
private val binding get() = _binding!!

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragmentFavoritesBinding.inflate(inflater, container, false)
return binding.root
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<Space
android:layout_width="match_parent"
android:layout_height="96dp" />

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@android:color/white"
app:contentInsetStart="0dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="즐겨찾기"
android:textColor="@android:color/black"
style="@style/Bold24"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="16dp"/>


</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.appcompat.widget.Toolbar>

<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="wrap_content"
android:maxWidth="1700dp"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2" />

</LinearLayout>
55 changes: 55 additions & 0 deletions feature/favorites/src/main/res/layout/fragment_favorites.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<Space
android:layout_width="match_parent"
android:layout_height="96dp" />

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@android:color/white"
app:contentInsetStart="0dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="즐겨찾기"
android:textColor="@android:color/black"
style="@style/Bold24"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="16dp"/>


</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.appcompat.widget.Toolbar>

<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="wrap_content"
android:maxWidth="1700dp"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="2" />

</LinearLayout>