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

[feat] 검색 뷰 구현 #188

Merged
merged 10 commits into from
Feb 24, 2024
14 changes: 10 additions & 4 deletions app/src/main/AndroidManifest.xml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모지 이거 걍 순서 때문에 수정한거죠??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

순서 정렬 + 새 액티비티 생성 때문에 수정하였습니당

Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,26 @@
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.plan.PlanActivity"
android:name=".presentation.ui.onboarding.OnBoardingActivity"
android:exported="false"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.onboarding.OnBoardingActivity"
android:name=".presentation.ui.participant.ParticipantActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.participant.ParticipantActivity"
android:name=".presentation.ui.plan.PlanActivity"
android:exported="false"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.search.SearchActivity"
android:exported="false"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysVisible"
tools:ignore="LockedOrientationActivity" />

<meta-data
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.sopt.pingle.presentation.ui.search

import android.os.Bundle
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivitySearchBinding
import org.sopt.pingle.util.base.BindingActivity
import org.sopt.pingle.util.context.hideKeyboard

class SearchActivity : BindingActivity<ActivitySearchBinding>(R.layout.activity_search) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

initLayout()
addListeners()
}

private fun initLayout() {
binding.pingleSearchSearch.editText.requestFocus()
}

private fun addListeners() {
binding.root.setOnClickListener {
hideKeyboard(binding.pingleSearchSearch.editText)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.sopt.pingle.presentation.ui.common.WebViewActivity.Companion.WEB_VIEW
fun Context.hideKeyboard(view: View) {
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
view.clearFocus()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헐 이런게 있따니 나 안그래도 오늘 ㅜ 타프젝 작업하면서 포커스가 넘 거슬렸는데ㅠㅠ 바로 적용해야딩 우헤헤

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음하하

}

fun Context.stringOf(@StringRes resId: Int) = getString(resId)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions app/src/main/res/layout/activity_search.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.ui.search.SearchActivity">

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="@dimen/spacing16" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="@dimen/spacing16" />

<org.sopt.pingle.util.component.PingleSearch
android:id="@+id/pingle_search_search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toStartOf="@id/gl_start"
app:layout_constraintTop_toTopOf="parent"
app:pingleSearchHint="@string/search_search_bar_hint" />

<ImageView
android:id="@+id/iv_search_search_pingle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="145dp"
android:src="@drawable/img_search_pingle_graphic"
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toStartOf="@id/gl_start"
app:layout_constraintTop_toBottomOf="@id/pingle_search_search" />

<TextView
android:id="@+id/tv_search_search_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/search_description"
android:textAppearance="@style/TextAppearance.Pingle.Body.Med.16"
android:textColor="@color/g_02"
app:layout_constraintEnd_toStartOf="@id/gl_end"
app:layout_constraintStart_toStartOf="@id/gl_start"
app:layout_constraintTop_toBottomOf="@id/iv_search_search_pingle" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중앙 정렬로 수정 (키보드 올라왔을 때 안 가리도록 수정)


</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_my_pingle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
android:id="@+id/iv_my_pingle_owner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/img_my_56"
android:src="@drawable/ic_my_my_56"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
Expand Down
24 changes: 14 additions & 10 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@
<string name="setting_withdraw_modal_detail">탈퇴 시 계정은 삭제되며 복구할 수 없어요</string>
<string name="setting_withdraw_modal_btn_text">탈퇴하기</string>

<!-- my pingle -->
<string name="my_pingle_chat">대화하기</string>
<string name="my_pingle_cancel">참여 취소하기</string>
<string name="my_pingle_delete">핑글 삭제하기</string>
<string name="my_pingle_topbar">마이핑글</string>
<string name="my_pingle_soon">홈으로 이동해\n내 주변 핑글을 찾아보세요!</string>
<string name="my_pingle_done">아직 참여한 핑글이 없어요\n첫 핑글과 함께 네트워킹을 시작해보세요!</string>
<string name="my_pingle_tab_soon">\t\t\t\t\t\t\t예정된\t\t\t\t\t\t\t\t</string>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 웃기다 \t 작렬 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 이거 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 커스텀 안 하려고 ㅋㅋㅋㅋㅋㅋㅋㅋ 민우핑이 나중에 리팩 해줄 거에요,, (아마도)
@Doreminwoo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<string name="my_pingle_tab_done">\t\t\t\t\t\t참여완료\t\t\t\t\t\t</string>
<string name="my_pingle_participant">%d/%d명</string>

<!-- on boarding -->
<string name="on_boarding_title">핑글에 오신걸\n환영합니다!</string>
<string name="on_boarding_original_group">이미 등록된\n 단체가 있어요</string>
Expand All @@ -181,14 +192,7 @@
<string name="participant_topbar">참여현황</string>
<string name="participant_owner">개최자</string>

<!-- my pingle -->
<string name="my_pingle_chat">대화하기</string>
<string name="my_pingle_cancel">참여 취소하기</string>
<string name="my_pingle_delete">핑글 삭제하기</string>
<string name="my_pingle_topbar">마이핑글</string>
<string name="my_pingle_soon">홈으로 이동해\n내 주변 핑글을 찾아보세요!</string>
<string name="my_pingle_done">아직 참여한 핑글이 없어요\n첫 핑글과 함께 네트워킹을 시작해보세요!</string>
<string name="my_pingle_tab_soon">\t\t\t\t\t\t\t예정된\t\t\t\t\t\t\t\t</string>
<string name="my_pingle_tab_done">\t\t\t\t\t\t참여완료\t\t\t\t\t\t</string>
<string name="my_pingle_participant">%d/%d명</string>
<!-- search -->
<string name="search_search_bar_hint">핑글 이름, 장소 이름 검색</string>
<string name="search_description">원하는 핑글을 검색해보세요!</string>
</resources>
Loading