Skip to content

Commit e87cd7e

Browse files
authored
Merge pull request #315 from SPOTeam/SPOT-231-FEAT-신청승인UI수정
FIX: popupWindow font 수정 및 위치 수정
2 parents ff9c1f3 + 696258c commit e87cd7e

File tree

6 files changed

+56
-14
lines changed

6 files changed

+56
-14
lines changed

SPOTeam_android/app/src/main/java/com/example/spoteam_android/ui/community/CommunityContentActivity.kt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import android.os.Bundle
66
import android.text.Editable
77
import android.text.TextWatcher
88
import android.util.Log
9+
import android.util.TypedValue
10+
import android.view.Gravity
911
import android.view.LayoutInflater
1012
import android.view.View
1113
import android.view.ViewGroup
@@ -273,7 +275,7 @@ class CommunityContentActivity : AppCompatActivity() {
273275
anonymous = false,
274276
parentCommentId = if (parentCommentId == 0) null else parentCommentId
275277
)
276-
Log.d("WriteComment", commentContent)
278+
// Log.d("WriteComment", commentContent)
277279
// 서버에 댓글 전송
278280

279281
sendCommentToServer(requestBody)
@@ -402,7 +404,18 @@ class CommunityContentActivity : AppCompatActivity() {
402404
popupWindow.isFocusable = true
403405
popupWindow.setBackgroundDrawable(view.context.getDrawable(R.drawable.custom_popup_background))
404406

405-
popupWindow.showAsDropDown(view, 0,0)
407+
val location = IntArray(2)
408+
view.getLocationOnScreen(location)
409+
val x = location[0]
410+
val y = location[1]
411+
412+
val offsetX = TypedValue.applyDimension(
413+
TypedValue.COMPLEX_UNIT_DIP,
414+
75f,
415+
view.resources.displayMetrics
416+
).toInt()
417+
418+
popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, x - offsetX, y + 50)
406419

407420
}
408421

SPOTeam_android/app/src/main/java/com/example/spoteam_android/ui/mypage/BoardAdapter.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import StudyFormMode
44
import android.content.Context
55
import android.os.Bundle
66
import android.util.Log
7+
import android.util.TypedValue
78
import android.view.Gravity
89
import android.view.LayoutInflater
910
import android.view.View
@@ -12,7 +13,6 @@ import android.widget.ImageView
1213
import android.widget.PopupWindow
1314
import android.widget.TextView
1415
import androidx.appcompat.app.AppCompatActivity
15-
import androidx.fragment.app.FragmentActivity
1616
import androidx.recyclerview.widget.RecyclerView
1717
import com.bumptech.glide.Glide
1818
import com.example.spoteam_android.BoardItem
@@ -28,6 +28,7 @@ import retrofit2.Call
2828
import retrofit2.Callback
2929
import retrofit2.Response
3030

31+
3132
class BoardAdapter(
3233
private val itemList: ArrayList<BoardItem>,
3334
private val onItemClick: (BoardItem) -> Unit,
@@ -96,7 +97,7 @@ class BoardAdapter(
9697
if (hostResult != null) {
9798
val isHost = hostResult.isOwned // ✅ 호스트 여부 확인
9899

99-
Log.d("BoardAdapter", "StudyId : ${studyId}")
100+
// Log.d("BoardAdapter", "StudyId : ${studyId}")
100101

101102
val popupView = LayoutInflater.from(view.context)
102103
.inflate(R.layout.modify_study_popup_menu, null)
@@ -198,10 +199,17 @@ class BoardAdapter(
198199
popupWindow.setBackgroundDrawable(view.context.getDrawable(R.drawable.custom_popup_background))
199200

200201
val location = IntArray(2)
201-
view.getLocationOnScreen(location) // 화면 전체 기준 좌표 가져오기
202+
view.getLocationOnScreen(location)
202203
val x = location[0]
203204
val y = location[1]
204-
popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, x-100, y + 100)
205+
206+
val offsetX = TypedValue.applyDimension(
207+
TypedValue.COMPLEX_UNIT_DIP,
208+
75f,
209+
view.resources.displayMetrics
210+
).toInt()
211+
212+
popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, x - offsetX, y + 50)
205213
}
206214
}
207215
}

SPOTeam_android/app/src/main/java/com/example/spoteam_android/ui/study/MyStudyPostContentActivity.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.os.Bundle
77
import android.text.Editable
88
import android.text.TextWatcher
99
import android.util.Log
10+
import android.util.TypedValue
1011
import android.view.Gravity
1112
import android.view.LayoutInflater
1213
import android.view.View
@@ -377,7 +378,18 @@ class MyStudyPostContentActivity : AppCompatActivity() {
377378
popupWindow.isFocusable = true
378379
popupWindow.setBackgroundDrawable(view.context.getDrawable(R.drawable.custom_popup_background))
379380

380-
popupWindow.showAsDropDown(view, 0,0)
381+
val location = IntArray(2)
382+
view.getLocationOnScreen(location)
383+
val x = location[0]
384+
val y = location[1]
385+
386+
val offsetX = TypedValue.applyDimension(
387+
TypedValue.COMPLEX_UNIT_DIP,
388+
75f,
389+
view.resources.displayMetrics
390+
).toInt()
391+
392+
popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, x - offsetX, y + 50)
381393
}
382394

383395
private fun deleteStudyPostContent(view: View, fragmentManager: FragmentManager) {

SPOTeam_android/app/src/main/res/layout/fragment_permission_wait.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@
8383
android:layout_width="match_parent"
8484
android:layout_height="wrap_content"
8585
android:layout_marginTop="20dp"
86-
android:layout_marginStart="12dp"
87-
android:layout_marginEnd="15dp"
86+
android:layout_marginHorizontal="18dp"
8887
tools:itemCount="5"
8988
app:layout_constraintEnd_toEndOf="parent"
9089
app:layout_constraintStart_toStartOf="parent"

SPOTeam_android/app/src/main/res/layout/modify_study_community_menu.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
android:background="?android:attr/selectableItemBackground"
1313
android:clickable="true"
1414
android:focusable="true"
15-
android:gravity="center"
15+
android:gravity="start"
1616
android:textColor="@color/black"
1717
android:padding="6dp"
18+
android:fontFamily="@font/suit_variable_font"
19+
android:textFontWeight="500"
1820
android:text="편집하기"
1921
android:textSize="14dp" />
2022
<View
@@ -29,8 +31,10 @@
2931
android:background="?android:attr/selectableItemBackground"
3032
android:clickable="true"
3133
android:focusable="true"
32-
android:gravity="center"
34+
android:gravity="start"
3335
android:padding="6dp"
36+
android:fontFamily="@font/suit_variable_font"
37+
android:textFontWeight="500"
3438
android:textColor="@color/r500"
3539
android:text="신고하기"
3640
android:textSize="14dp" />
@@ -46,7 +50,9 @@
4650
android:background="?android:attr/selectableItemBackground"
4751
android:clickable="true"
4852
android:focusable="true"
49-
android:gravity="center"
53+
android:gravity="start"
54+
android:fontFamily="@font/suit_variable_font"
55+
android:textFontWeight="500"
5056
android:padding="6dp"
5157
android:text="삭제하기"
5258
android:textColor="@color/r500"

SPOTeam_android/app/src/main/res/layout/modify_study_popup_studyone_menu.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
android:background="?android:attr/selectableItemBackground"
1313
android:clickable="true"
1414
android:focusable="true"
15-
android:gravity="center"
15+
android:gravity="start"
1616
android:textColor="@color/black"
17+
android:fontFamily="@font/suit_variable_font"
18+
android:textFontWeight="500"
1719
android:padding="6dp"
1820
android:text="스터디원 신고"
1921
android:textSize="14dp" />
@@ -29,9 +31,11 @@
2931
android:background="?android:attr/selectableItemBackground"
3032
android:clickable="true"
3133
android:focusable="true"
32-
android:gravity="center"
34+
android:gravity="start"
3335
android:padding="6dp"
3436
android:text="스터디 탈퇴"
37+
android:fontFamily="@font/suit_variable_font"
38+
android:textFontWeight="500"
3539
android:textColor="@color/r500"
3640
android:textSize="14dp" />
3741
</LinearLayout>

0 commit comments

Comments
 (0)