Skip to content

Commit

Permalink
[BUD-32] feat : 신규 Buddy 등록 구현 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
KDW03 committed Mar 21, 2023
1 parent be747d4 commit dbb25cd
Show file tree
Hide file tree
Showing 33 changed files with 681 additions and 263 deletions.
2 changes: 1 addition & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Base application theme. -->
<style name="Theme.Buddyvet" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimary">@color/butter</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.bumptech.glide.Glide
fun bindImageView(imageView: ImageView, photoUrl: String?) {
Glide.with(imageView.context)
.load(photoUrl)
.placeholder(R.drawable.img_person)
.into(imageView)
}

Expand Down
4 changes: 4 additions & 0 deletions common-ui/src/main/res/drawable/imageview_shape.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="50dp"/>
</shape>
21 changes: 21 additions & 0 deletions common-ui/src/main/res/drawable/img_camera.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="26dp"
android:height="26dp"
android:viewportWidth="26"
android:viewportHeight="26">
<path
android:strokeWidth="1"
android:pathData="M13,13m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"
android:fillColor="#545454"
android:strokeColor="#ffffff"/>
<group>
<clip-path
android:pathData="M7.167,7.167h11.667v11.667h-11.667z"/>
<path
android:pathData="M16.403,9.111H16.156L15.094,7.734C14.957,7.558 14.782,7.416 14.582,7.317C14.382,7.219 14.162,7.168 13.939,7.167H12.061C11.838,7.168 11.618,7.219 11.418,7.317C11.218,7.416 11.043,7.558 10.906,7.734L9.844,9.111H9.597C8.953,9.112 8.335,9.368 7.879,9.824C7.424,10.28 7.167,10.897 7.167,11.542V16.403C7.167,17.047 7.424,17.665 7.879,18.121C8.335,18.576 8.953,18.833 9.597,18.833H16.403C17.047,18.833 17.665,18.576 18.121,18.121C18.576,17.665 18.833,17.047 18.833,16.403V11.542C18.833,10.897 18.576,10.28 18.121,9.824C17.665,9.368 17.047,9.112 16.403,9.111ZM11.676,8.328C11.721,8.27 11.78,8.222 11.846,8.189C11.913,8.156 11.986,8.139 12.061,8.139H13.939C14.014,8.139 14.087,8.156 14.153,8.189C14.22,8.222 14.279,8.27 14.324,8.328L14.928,9.111H11.072L11.676,8.328ZM17.861,16.403C17.861,16.79 17.708,17.16 17.434,17.434C17.16,17.708 16.79,17.861 16.403,17.861H9.597C9.21,17.861 8.84,17.708 8.566,17.434C8.293,17.16 8.139,16.79 8.139,16.403V11.542C8.139,11.155 8.293,10.784 8.566,10.51C8.84,10.237 9.21,10.083 9.597,10.083H16.403C16.79,10.083 17.16,10.237 17.434,10.51C17.708,10.784 17.861,11.155 17.861,11.542V16.403Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M13,11.056C12.423,11.056 11.859,11.227 11.38,11.547C10.9,11.868 10.526,12.323 10.305,12.856C10.085,13.389 10.027,13.976 10.139,14.541C10.252,15.107 10.53,15.627 10.938,16.035C11.346,16.443 11.865,16.72 12.431,16.833C12.997,16.945 13.583,16.888 14.116,16.667C14.649,16.446 15.105,16.072 15.425,15.593C15.746,15.113 15.917,14.549 15.917,13.972C15.916,13.199 15.608,12.458 15.062,11.911C14.515,11.364 13.773,11.056 13,11.056ZM13,15.917C12.616,15.917 12.24,15.803 11.92,15.589C11.6,15.375 11.351,15.072 11.204,14.716C11.056,14.361 11.018,13.97 11.093,13.593C11.168,13.216 11.353,12.869 11.625,12.597C11.897,12.325 12.243,12.14 12.621,12.065C12.998,11.99 13.389,12.029 13.744,12.176C14.099,12.323 14.403,12.572 14.617,12.892C14.83,13.212 14.944,13.588 14.944,13.972C14.944,14.488 14.74,14.983 14.375,15.347C14.01,15.712 13.516,15.917 13,15.917Z"
android:fillColor="#ffffff"/>
</group>
</vector>
Binary file added common-ui/src/main/res/drawable/img_person.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions common-ui/src/main/res/layout/item_image_select.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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>

<variable
name="imageUri"
type="String" />
</data>


<FrameLayout
android:layout_width="65dp"
android:layout_height="65dp">

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/main_iv"
photoUrl="@{imageUri}"
android:layout_width="60dp"
android:layout_height="60dp"
app:civ_border_overlay="false"
tools:src="@drawable/img_person" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:src="@drawable/img_camera" />

</FrameLayout>

</layout>
11 changes: 11 additions & 0 deletions common-ui/src/main/res/layout/list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?attr/textAppearanceSubtitle1"
android:textSize="17sp"
/>
1 change: 1 addition & 0 deletions common-ui/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<dimen name="basic_parent_padding">21dp</dimen>
<dimen name="basic_horizontal_margin">21dp</dimen>
<dimen name="basic_bottom_btn_margin">43dp</dimen>
<dimen name="basic_bottom_btn_margin_non_padding">22dp</dimen>
<dimen name="basic_btn_textSize">17sp</dimen>
<dimen name="basic_main_textSize">17sp</dimen>
<dimen name="dialog_radius">17dp</dimen>
Expand Down
5 changes: 5 additions & 0 deletions common/src/main/java/com/nocapstone/common/util/BuddyBreed.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.nocapstone.common.util

class BuddyBreed {

}
28 changes: 28 additions & 0 deletions common/src/main/res/values/Array.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="DogBreed">
<item>개 종류1</item>
<item>개 종류2</item>
<item>개 종류3</item>
<item>개 종류4</item>
<item>개 종류5</item>
<item>개 종류6</item>
<item>개 종류7</item>
<item>개 종류8</item>
<item>개 종류9</item>
</string-array>

<string-array name="CatBreed">
<item>고양이 종류1</item>
<item>고양이 종류2</item>
<item>고양이 종류3</item>
<item>고양이 종류4</item>
<item>고양이 종류5</item>
<item>고양이 종류6</item>
<item>고양이 종류7</item>
<item>고양이 종류8</item>
<item>고양이 종류9</item>
</string-array>


</resources>
2 changes: 2 additions & 0 deletions home/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ dependencies {

implementation 'io.github.ParkSangGwon:tedimagepicker:1.2.8'

implementation 'de.hdodenhof:circleimageview:3.1.0'


// Hilt
implementation "com.google.dagger:hilt-android:$rootProject.hiltVersion"
Expand Down
7 changes: 1 addition & 6 deletions home/src/main/res/layout/item_buddy_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@

<data>


<import type="android.view.View"/>


<variable
name="viewModel"
type="com.nocapstone.home.HomeViewModel" />

<import type="com.nocapstone.home.dto.BuddyData" />

<variable
name="buddyData"
type="BuddyData" />

</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
2 changes: 2 additions & 0 deletions onboarding/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencies {
api project(path: ':common-ui')
api project(path: ':common')

implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'io.github.ParkSangGwon:tedimagepicker:1.2.8'

// Hilt
implementation "com.google.dagger:hilt-android:$rootProject.hiltVersion"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.nocapstone.onboarding.domain

data class BuddyRequest(
val kind : String,
var name : String = "name",
var bread : String = "bread",
var birthDay : String = "birthday",
var adoptDay : String = "adoptDay",
var isNeutered : Boolean = false,
var gender : String = "gender"
)

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import com.nocapstone.common_ui.MainActivityUtil
import com.nocapstone.onboarding.R
import com.nocapstone.onboarding.databinding.FragmentInputUserInfoBinding
Expand All @@ -26,15 +27,15 @@ class InputUserInfoFragment : Fragment() {
): View? {
// Inflate the layout for this fragment
_binding = FragmentInputUserInfoBinding.inflate(inflater, container, false)

return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.next.setOnClickListener {
splashViewModel.postUserInfo(binding.nameEt.text.toString())
splashViewModel.postUserInfo(binding.nameEt.toString())
findNavController().navigate(R.id.next)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ import javax.inject.Inject

@AndroidEntryPoint
class LoginFragment : Fragment() {


@Inject
lateinit var mainActivityClass: Class<*>


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

private val splashViewModel: SplashViewModel by viewModels()
private val splashViewModel: SplashViewModel by viewModels({ requireActivity() })

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
Expand All @@ -53,7 +50,9 @@ class LoginFragment : Fragment() {
binding.kakaoLoginBtn.setOnClickListener {
LoginUtil.loginWithKaKao(requireContext()) { token ->
splashViewModel.signup(token!!, {
LoginUtil.startMainActivity(requireActivity(), mainActivityClass) }, { findNavController().navigate(R.id.next) })
findNavController().navigate(R.id.next)
//LoginUtil.startMainActivity(requireActivity(), mainActivityClass)
}, { findNavController().navigate(R.id.next) })
}
}
}
Expand Down
Loading

0 comments on commit dbb25cd

Please sign in to comment.