Skip to content

Commit

Permalink
chore/#9 : 패키지 구조 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
youjin09222 committed Jun 6, 2024
1 parent 54bbdf7 commit 8f97d65
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 36 deletions.
9 changes: 4 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
tools:targetApi="31">
<activity
android:name=".test.presentation.MainActivity"
android:exported="false">
</activity>
android:exported="false"></activity>
<activity
android:name=".test.presentation.LoginActivity"
android:name=".test.presentation.login.LoginActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -29,7 +28,7 @@
</intent-filter>
</activity>
<activity
android:name=".test.presentation.SignUpActivity"
android:exported="false"/>
android:name=".test.presentation.signup.SignUpActivity"
android:exported="false" />
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import com.sopt.now.R
import com.sopt.now.databinding.ActivityMainBinding
import com.sopt.now.test.presentation.home.HomeFragment
import com.sopt.now.test.presentation.mypage.MyPageFragment
import com.sopt.now.test.presentation.search.SearchFragment

class MainActivity : AppCompatActivity() {

Expand All @@ -16,7 +19,7 @@ class MainActivity : AppCompatActivity() {
setContentView(binding.root)

val currentFragment = supportFragmentManager.findFragmentById(binding.fcvHome.id)
if (currentFragment == null){
if (currentFragment == null) {
supportFragmentManager.beginTransaction()
.add(R.id.fcv_home, HomeFragment())
.commit()
Expand All @@ -25,7 +28,7 @@ class MainActivity : AppCompatActivity() {
}

private fun clickBottomNavigation() {
binding.bnvHome.setOnItemSelectedListener{
binding.bnvHome.setOnItemSelectedListener {
when (it.itemId) {
R.id.menu_home -> {
replaceFragment(HomeFragment())
Expand All @@ -41,6 +44,7 @@ class MainActivity : AppCompatActivity() {
replaceFragment(MyPageFragment())
true
}

else -> false
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.now.test.presentation
package com.sopt.now.test.presentation.search

import android.os.Bundle
import android.view.LayoutInflater
Expand All @@ -7,7 +7,7 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.sopt.now.databinding.FragmentSearchBinding

class SearchFragment: Fragment() {
class SearchFragment : Fragment() {
private var _binding: FragmentSearchBinding? = null
private val binding: FragmentSearchBinding
get() = requireNotNull(_binding) { "바인딩 객체 좀 생성해주세요 제발!!" }
Expand Down
25 changes: 12 additions & 13 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
tools:context=".test.presentation.LoginActivity">
tools:context=".test.presentation.login.LoginActivity">

<TextView
android:id="@+id/tv_login_title"
Expand All @@ -19,7 +18,7 @@
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_login_id"
Expand All @@ -29,7 +28,7 @@
android:text="@string/tv_id"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_login_title"/>
app:layout_constraintTop_toBottomOf="@+id/tv_login_title" />

<EditText
android:id="@+id/et_login_id"
Expand All @@ -38,7 +37,7 @@
android:hint="@string/hint_id"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_login_id"/>
app:layout_constraintTop_toBottomOf="@+id/tv_login_id" />

<TextView
android:id="@+id/tv_login_pw"
Expand All @@ -48,7 +47,7 @@
android:text="@string/tv_pw"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_login_id"/>
app:layout_constraintTop_toBottomOf="@+id/et_login_id" />

<EditText
android:id="@+id/et_login_pw"
Expand All @@ -58,18 +57,18 @@
android:inputType="textPassword"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_login_pw"/>
app:layout_constraintTop_toBottomOf="@+id/tv_login_pw" />

<Button
android:id="@+id/btn_login"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/btn_login"
android:backgroundTint="@color/blue"
android:layout_marginBottom="10dp"
android:backgroundTint="@color/blue"
android:text="@string/btn_login"
app:layout_constraintBottom_toTopOf="@+id/tv_sign_up"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/tv_sign_up"
Expand All @@ -79,5 +78,5 @@
android:text="@string/btn_sign_up"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
22 changes: 11 additions & 11 deletions app/src/main/res/layout/activity_sign_up.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="30dp"
tools:context=".test.presentation.SignUpActivity">
tools:context=".test.presentation.signup.SignUpActivity">

<TextView
android:id="@+id/tv_sign_up_title"
Expand All @@ -18,7 +18,7 @@
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_sign_up_id"
Expand All @@ -28,7 +28,7 @@
android:text="@string/tv_id"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_title"/>
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_title" />

<EditText
android:id="@+id/et_sign_up_id"
Expand All @@ -37,7 +37,7 @@
android:hint="@string/hint_id"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_id"/>
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_id" />

<TextView
android:id="@+id/tv_sign_up_pw"
Expand All @@ -47,7 +47,7 @@
android:text="@string/tv_pw"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_sign_up_id"/>
app:layout_constraintTop_toBottomOf="@+id/et_sign_up_id" />

<EditText
android:id="@+id/et_sign_up_pw"
Expand All @@ -57,7 +57,7 @@
android:inputType="textPassword"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_pw"/>
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_pw" />

<TextView
android:id="@+id/tv_sign_up_name"
Expand All @@ -67,7 +67,7 @@
android:text="@string/tv_user_name"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_sign_up_pw"/>
app:layout_constraintTop_toBottomOf="@+id/et_sign_up_pw" />

<EditText
android:id="@+id/et_sign_up_name"
Expand All @@ -76,7 +76,7 @@
android:hint="@string/hint_user_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_name"/>
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_name" />

<TextView
android:id="@+id/tv_sign_up_description"
Expand All @@ -86,7 +86,7 @@
android:text="@string/tv_user_phone"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_sign_up_name"/>
app:layout_constraintTop_toBottomOf="@+id/et_sign_up_name" />

<EditText
android:id="@+id/et_sign_up_phone"
Expand All @@ -95,7 +95,7 @@
android:hint="@string/hint_user_phone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_description"/>
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_description" />

<Button
android:id="@+id/btn_sign_up"
Expand All @@ -106,5 +106,5 @@
android:text="@string/btn_sign_up"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/fragment_search.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".test.presentation.SearchFragment">
tools:context=".test.presentation.search.SearchFragment">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_friends"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/item_friend" />
</FrameLayout>

0 comments on commit 8f97d65

Please sign in to comment.