Skip to content

Commit

Permalink
Merge branch 'develop' into feat-joingroupcode-view
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/res/values/strings.xml
  • Loading branch information
Doreminwoo committed Jan 6, 2024
2 parents 99777da + 0440be3 commit 6354b70
Show file tree
Hide file tree
Showing 44 changed files with 1,269 additions and 37 deletions.
7 changes: 7 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "BASE_URL", properties["base.url"].toString())
buildConfigField("String", "ACCESS_TOKEN", properties["access.token"].toString())
buildConfigField("String", "NAVER_MAP_CLIENT_ID", properties["naver.map.client.id"].toString())
manifestPlaceholders["IO_SENTRY_DSN"] = properties["io.sentry.dsn"] as String
}

Expand Down Expand Up @@ -89,6 +90,12 @@ dependencies {
implementation(libs.bundles.okhttp)
implementation(libs.bundles.retrofit)
implementation(libs.kotlin.serialization.json)

// Naver Map
implementation(libs.naver.maps)

// Location
implementation(libs.play.services.location)
}

ktlint {
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:name=".PingleApp"
Expand All @@ -18,6 +20,11 @@
tools:targetApi="31">
<activity
android:name=".presentation.ui.joingroup.JoinGroupCodeActivity"
android:exported="true"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.common.WebViewActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
Expand All @@ -42,6 +49,11 @@
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.joingroup.JoinGroupSuccessActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.main.MainActivity"
android:exported="false"
Expand Down Expand Up @@ -72,5 +84,4 @@
android:name="io.sentry.traces.profiling.sample-rate"
android:value="1.0" />
</application>

</manifest>
8 changes: 8 additions & 0 deletions app/src/main/java/org/sopt/pingle/PingleApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package org.sopt.pingle

import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import com.naver.maps.map.NaverMapSdk
import dagger.hilt.android.HiltAndroidApp
import org.sopt.pingle.BuildConfig.NAVER_MAP_CLIENT_ID
import org.sopt.pingle.util.PingleDebugTree
import timber.log.Timber

Expand All @@ -13,6 +15,7 @@ class PingleApp : Application() {

setTimber()
setDarkMode()
setNaverMap()
}

private fun setTimber() {
Expand All @@ -22,4 +25,9 @@ class PingleApp : Application() {
private fun setDarkMode() {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}

private fun setNaverMap() {
NaverMapSdk.getInstance(this).client =
NaverMapSdk.NaverCloudPlatformClient(NAVER_MAP_CLIENT_ID)
}
}
9 changes: 9 additions & 0 deletions app/src/main/java/org/sopt/pingle/domain/model/PinEntity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.sopt.pingle.domain.model

data class PinEntity(
val id: Long,
val x: Double,
val y: Double,
val category: String,
val meetingCount: Int
)
21 changes: 21 additions & 0 deletions app/src/main/java/org/sopt/pingle/presentation/mapper/PinMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.sopt.pingle.presentation.mapper

import com.naver.maps.geometry.LatLng
import com.naver.maps.map.overlay.Marker
import com.naver.maps.map.overlay.OverlayImage
import org.sopt.pingle.R
import org.sopt.pingle.domain.model.PinEntity
import org.sopt.pingle.presentation.type.CategoryType

fun PinEntity.toMarker(): Marker = Marker().apply {
position = LatLng(y, x)
isHideCollidedMarkers = true
icon = OverlayImage.fromResource(
when (category) {
CategoryType.PLAY.toString() -> R.drawable.ic_map_marker_play_small
CategoryType.STUDY.toString() -> R.drawable.ic_map_marker_study_small
CategoryType.MULTI.toString() -> R.drawable.ic_map_marker_multi_small
else -> R.drawable.ic_map_marker_other_small
}
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package org.sopt.pingle.presentation.ui.common

import android.os.Bundle
import android.view.View
import org.sopt.pingle.R
import org.sopt.pingle.databinding.DialogAllModalBinding
import org.sopt.pingle.util.base.BindingDialogFragment

class AllModalDialogFragment(
private val title: String,
private val detail: String,
private val buttonText: String,
private val textButtonText: String,
private val clickBtn: () -> Unit,
private val clickTextBtn: () -> Unit
) : BindingDialogFragment<DialogAllModalBinding>(R.layout.dialog_all_modal) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

initLayout()
addListeners()
}

private fun initLayout() {
with(binding) {
tvAllModalTitle.text = title
tvAllModalDetail.text = detail
btnAllModalButton.text = buttonText
tvAllModalTextButton.text = textButtonText
}
}

private fun addListeners() {
binding.btnAllModalButton.setOnClickListener {
clickBtn()
dismiss()
}

binding.tvAllModalTextButton.setOnClickListener {
clickTextBtn()
dismiss()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.sopt.pingle.presentation.ui.common

import android.annotation.SuppressLint
import android.os.Bundle
import android.webkit.WebChromeClient
import android.webkit.WebViewClient
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityWebViewBinding
import org.sopt.pingle.util.base.BindingActivity

class WebViewActivity : BindingActivity<ActivityWebViewBinding>(R.layout.activity_web_view) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

initLayout()
loadWebView()
}

@SuppressLint("SetJavaScriptEnabled")
private fun initLayout() {
binding.wvWebView.apply {
webViewClient = WebViewClient()
webChromeClient = WebChromeClient()

settings.apply {
javaScriptEnabled = true
javaScriptCanOpenWindowsAutomatically = true
loadWithOverviewMode = true
useWideViewPort = true
domStorageEnabled = true
}
}
}

private fun loadWebView() {
intent.getStringExtra(WEB_VIEW_LINK)?.let { binding.wvWebView.loadUrl(it) }
}

companion object {
const val WEB_VIEW_LINK = "WebViewLink"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.sopt.pingle.presentation.ui.joingroup

import android.os.Bundle
import android.text.Spannable
import android.text.SpannableString
import android.text.style.ForegroundColorSpan
import android.text.style.TextAppearanceSpan
import androidx.core.content.ContextCompat
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityJoinGroupSuccessBinding
import org.sopt.pingle.util.base.BindingActivity

class JoinGroupSuccessActivity :
BindingActivity<ActivityJoinGroupSuccessBinding>(R.layout.activity_join_group_success) {
private lateinit var groupName: String
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

initLayout()
}

private fun initLayout() {
// TODO 이전 화면에서 Intent를 통해서 groupName을 가져옴
groupName = "SOPT"

binding.tvJoinGroupSuccessDescriptionGroupName.text = SpannableString(
getString(
R.string.join_group_success_description_group_name,
groupName
)
).apply {
setSpan(
TextAppearanceSpan(
this@JoinGroupSuccessActivity,
R.style.TextAppearance_Pingle_Sub_Semi_16
),
GROUP_NAME_START,
groupName.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
setSpan(
ForegroundColorSpan(
ContextCompat.getColor(
this@JoinGroupSuccessActivity,
R.color.g_01
)
),
GROUP_NAME_START,
groupName.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
}

companion object {
const val GROUP_NAME_START = 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ class MainActivity : BindingActivity<ActivityMainBinding>(R.layout.activity_main
}

private inline fun <reified T : Fragment> navigateToFragment() {
supportFragmentManager.commit {
replace<T>(R.id.fcv_main_all_navi, T::class.java.canonicalName)
if (supportFragmentManager.findFragmentById(R.id.fcv_main_all_navi) !is T) {
supportFragmentManager.commit {
replace<T>(R.id.fcv_main_all_navi, T::class.java.canonicalName)
}
}
}
}
Loading

0 comments on commit 6354b70

Please sign in to comment.