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

[MOD/#260] 로티, 이미지 변경 및 탐색뷰 광고 배너 링크 연결 #261

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/assets/terning_scrap_cancel.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.terning.feature.search.search

import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -13,8 +14,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand All @@ -33,6 +36,9 @@ import com.terning.feature.search.search.component.InternListType
import com.terning.feature.search.search.component.SearchInternList
import okhttp3.internal.toImmutableList

const val ADVERTISEMENT_URL =
"https://www.instagram.com/terning_official?igsh=NnNma245bnUzbWNm&utm_source=qr"

@Composable
fun SearchRoute(
modifier: Modifier,
Expand All @@ -41,6 +47,7 @@ fun SearchRoute(
viewModel: SearchViewModel = hiltViewModel(),
) {
val lifecycleOwner = LocalLifecycleOwner.current
val context = LocalContext.current

val viewState by viewModel.viewState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner)
val scrapState by viewModel.scrapState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner)
Expand Down Expand Up @@ -77,6 +84,9 @@ fun SearchRoute(
searchScrapsList = searchScrapsList,
navigateToSearchProcess = navigateToSearchProcess,
navigateToIntern = navigateToIntern,
onAdvertisementClick = {
CustomTabsIntent.Builder().build().launchUrl(context, ADVERTISEMENT_URL.toUri())
}
)
}

Expand All @@ -87,6 +97,7 @@ fun SearchScreen(
searchScrapsList: List<SearchPopularAnnouncement>,
navigateToSearchProcess: () -> Unit,
navigateToIntern: (Long) -> Unit,
onAdvertisementClick: () -> Unit,
) {

val images = listOf(
Expand Down Expand Up @@ -128,7 +139,10 @@ fun SearchScreen(

LazyColumn {
item {
ImageSlider(images = images)
ImageSlider(
images = images,
onAdvertisementClick = onAdvertisementClick,
)

Spacer(modifier = Modifier.padding(top = 20.dp))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.theme.Grey200
import com.terning.core.extension.noRippleClickable
import kotlinx.coroutines.delay

@Composable
fun ImageSlider(
modifier: Modifier = Modifier,
images: List<Int>,
onAdvertisementClick: () -> Unit,
) {
val pagerState = rememberPagerState(pageCount = { images.size })
val autoScroll = remember { mutableStateOf(true) }
Expand Down Expand Up @@ -59,8 +61,9 @@ fun ImageSlider(
contentDescription = null,
modifier = modifier
.fillMaxWidth()
.height(112.dp),
contentScale = ContentScale.Crop
.height(112.dp)
.noRippleClickable(onAdvertisementClick),
contentScale = ContentScale.Crop,
)
}
DotsIndicator(
Expand Down
Binary file modified feature/src/main/res/drawable/img_ad_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading