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

[RELEASE/1.1.2->MAIN] release: 앱 버전 1.1.2 릴리즈 #9

Merged
merged 9 commits into from
Feb 22, 2024
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
minSdk = 26
targetSdk = 34
versionCode = 11011
versionName = "1.1.1"
versionName = "1.1.2"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@
<data android:host="no5ing.kr" />
<data android:pathPrefix="/o" />
</intent-filter>

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:host="bibbi.app" />
<data android:pathPrefix="/o" />
</intent-filter>
</activity>
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/no5ing/bbibbi/FirebaseService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class FirebaseService : FirebaseMessagingService() {
}
}
val pendingIntent = PendingIntent
.getActivity(this@FirebaseService, 0, intent, PendingIntent.FLAG_IMMUTABLE
.or(PendingIntent.FLAG_CANCEL_CURRENT))
.getActivity(
this@FirebaseService, 0, intent, PendingIntent.FLAG_IMMUTABLE
.or(PendingIntent.FLAG_CANCEL_CURRENT)
)
val builder = NotificationCompat
.Builder(this@FirebaseService, channel_id)
.setSmallIcon(R.drawable.notification_icon)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import javax.inject.Singleton
class GetCommentsRepository @Inject constructor(
private val memberCacheProvider: MemberCacheProvider,
) : BaseRepository<PagingData<PostCommentUiState>>() {
lateinit var pagingSource: GetCommentsPageSource
private lateinit var pagingSource: GetCommentsPageSource
override fun fetch(arguments: Arguments): Flow<PagingData<PostCommentUiState>> {
return Pager(
config = PagingConfig(
Expand All @@ -36,11 +36,15 @@ class GetCommentsRepository @Inject constructor(
}.flow
}

override fun closeResources() {
super.closeResources()
fun invalidateSource() {
if (::pagingSource.isInitialized)
pagingSource.invalidate()
}

override fun closeResources() {
super.closeResources()
this.invalidateSource()
}
}

class GetCommentsPageSource @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import javax.inject.Singleton
class GetFeedsRepository @Inject constructor(
private val memberCacheProvider: MemberCacheProvider,
) : BaseRepository<PagingData<MainFeedUiState>>() {
lateinit var pagingSource: GetFeedPageSource
private lateinit var pagingSource: GetFeedPageSource
override fun fetch(arguments: Arguments): Flow<PagingData<MainFeedUiState>> {
return Pager(
config = PagingConfig(
Expand All @@ -37,11 +37,15 @@ class GetFeedsRepository @Inject constructor(
}.flow
}

override fun closeResources() {
super.closeResources()
fun invalidateSource() {
if (::pagingSource.isInitialized)
pagingSource.invalidate()
}

override fun closeResources() {
super.closeResources()
this.invalidateSource()
}
}

class GetFeedPageSource @Inject constructor(
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/com/no5ing/bbibbi/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object NetworkModule {
private const val timeout_read = 10L
private const val timeout_connect = 10L
private const val timeout_write = 10L
private const val timeout_read = 20L
private const val timeout_connect = 20L
private const val timeout_write = 20L

val requireUpdateState = MutableStateFlow(false)
val requireTokenInvalidRestart = MutableStateFlow(false)
Expand Down Expand Up @@ -144,7 +144,6 @@ object NetworkModule {
// HttpLoggingInterceptor { message -> Timber.d("%s", message) }
// httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
return client
// .addInterceptor(httpLoggingInterceptor)
.connectTimeout(timeout_connect, TimeUnit.SECONDS)
.readTimeout(timeout_read, TimeUnit.SECONDS)
.writeTimeout(timeout_write, TimeUnit.SECONDS)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.no5ing.bbibbi.presentation.feature.uistate.family

import com.no5ing.bbibbi.data.model.BaseModel
import com.no5ing.bbibbi.data.model.member.Member

data class MainFeedStoryElementUiState(
val member: Member,
val isUploadedToday: Boolean,
) : BaseModel()
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.AlertDialogDefaults
import androidx.compose.material3.BasicAlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
Expand Down Expand Up @@ -60,7 +61,7 @@ fun CustomAlertDialog(
hasCancel: Boolean = true,
) {
if (enabledState.value) {
AlertDialog(
BasicAlertDialog(
onDismissRequest = cancelRequest,
modifier = Modifier,
properties = DialogProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Divider
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand Down Expand Up @@ -217,7 +217,10 @@ fun PostCommentDialog(
style = MaterialTheme.bbibbiTypo.bodyOneBold,
)
Spacer(modifier = Modifier.height(16.dp))
Divider(thickness = 1.dp, color = MaterialTheme.bbibbiScheme.gray600)
HorizontalDivider(
thickness = 1.dp,
color = MaterialTheme.bbibbiScheme.gray600
)
}
}
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,6 @@ fun JoinFamilyWithLinkPage(
}

private fun isValidUrl(input: String): Boolean {
val linkPrefix = "https://no5ing.kr/o/"
return input.startsWith(linkPrefix)
return input.startsWith("https://no5ing.kr/o/")
|| input.startsWith("https://bibbi.app/o/")
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -77,7 +77,10 @@ fun FamilyPage(
onTapShare = onTapShare,
uiState = inviteLinkState,
)
Divider(thickness = 1.dp, color = MaterialTheme.bbibbiScheme.backgroundSecondary)
HorizontalDivider(
thickness = 1.dp,
color = MaterialTheme.bbibbiScheme.backgroundSecondary
)
FamilyPageMemberList(
meId = meId,
meState = meState,
Expand Down Expand Up @@ -110,7 +113,10 @@ fun FamilyPagePreview() {
mutableStateOf(APIResponse.success(DeepLink.mock()))
},
)
Divider(thickness = 1.dp, color = MaterialTheme.bbibbiScheme.backgroundSecondary)
HorizontalDivider(
thickness = 1.dp,
color = MaterialTheme.bbibbiScheme.backgroundSecondary
)
FamilyPageMemberList(
meId = Member.unknown().memberId,
meState = remember { mutableStateOf(APIResponse.success(Member.unknown())) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import com.no5ing.bbibbi.presentation.component.BBiBBiSurface
import com.no5ing.bbibbi.presentation.component.BackToExitHandler
import com.no5ing.bbibbi.presentation.feature.view.common.CustomAlertDialog
import com.no5ing.bbibbi.presentation.feature.view_model.auth.RetrieveMeViewModel
import com.no5ing.bbibbi.presentation.feature.view_model.members.FamilyMembersViewModel
import com.no5ing.bbibbi.presentation.feature.view_model.post.DailyFamilyTopViewModel
import com.no5ing.bbibbi.presentation.feature.view_model.post.IsMeUploadedTodayViewModel
import com.no5ing.bbibbi.presentation.feature.view_model.post.MainPostFeedViewModel
Expand All @@ -43,7 +42,6 @@ fun HomePage(
retrieveMeViewModel: RetrieveMeViewModel = hiltViewModel(),
isMeUploadedTodayViewModel: IsMeUploadedTodayViewModel = hiltViewModel(),
familyPostsViewModel: MainPostFeedViewModel = hiltViewModel(),
familyMembersViewModel: FamilyMembersViewModel = hiltViewModel(),
familyPostTopViewModel: DailyFamilyTopViewModel = hiltViewModel(),
onTapLeft: () -> Unit = {},
onTapRight: () -> Unit = {},
Expand Down Expand Up @@ -81,7 +79,7 @@ fun HomePage(
}

if (familyPostsViewModel.isInitialize()) {
familyMembersViewModel.invoke(Arguments())
// familyMembersViewModel.invoke(Arguments())
retrieveMeViewModel.invoke(Arguments())
familyPostTopViewModel.invoke(Arguments())// TODO
familyPostsViewModel.invoke(
Expand Down Expand Up @@ -114,7 +112,6 @@ fun HomePage(
)
HomePageContent(
contentState = familyPostsViewModel.uiState,
familyListState = familyMembersViewModel.uiState,
postTopState = familyPostTopViewModel.uiState,
meState = retrieveMeViewModel.uiState,
onTapContent = onTapContent,
Expand Down Expand Up @@ -152,8 +149,7 @@ fun HomePagePreview() {
HomePageTopBar()
HomePageContent(
contentState = MutableStateFlow(PagingData.empty()),
familyListState = MutableStateFlow(PagingData.empty()),
postTopState = MutableStateFlow(emptyMap()),
postTopState = MutableStateFlow(APIResponse.idle()),
meState = MutableStateFlow(APIResponse.success(Member.unknown()))
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -30,6 +30,7 @@ import com.no5ing.bbibbi.R
import com.no5ing.bbibbi.data.model.APIResponse
import com.no5ing.bbibbi.data.model.member.Member
import com.no5ing.bbibbi.data.model.post.Post
import com.no5ing.bbibbi.presentation.feature.uistate.family.MainFeedStoryElementUiState
import com.no5ing.bbibbi.presentation.feature.uistate.family.MainFeedUiState
import com.no5ing.bbibbi.presentation.theme.bbibbiScheme
import com.no5ing.bbibbi.util.gapBetweenNow
Expand All @@ -39,21 +40,20 @@ import kotlinx.coroutines.flow.StateFlow
@Composable
fun HomePageContent(
contentState: StateFlow<PagingData<MainFeedUiState>>,
familyListState: StateFlow<PagingData<Member>>,
postTopState: StateFlow<Map<String, Int>>,
//familyListState: StateFlow<PagingData<Member>>,
postTopState: StateFlow<APIResponse<List<MainFeedStoryElementUiState>>>,
meState: StateFlow<APIResponse<Member>>,
onTapContent: (Post) -> Unit = {},
onTapProfile: (Member) -> Unit = {},
onTapInvite: () -> Unit = {},
onRefresh: () -> Unit = {},
) {
val postItems = contentState.collectAsLazyPagingItems()
val memberItems = familyListState.collectAsLazyPagingItems()
// val memberItems = familyListState.collectAsLazyPagingItems()
var isRefreshing by remember { mutableStateOf(false) }
LaunchedEffect(postItems.loadState.refresh, memberItems.loadState.refresh) {
LaunchedEffect(postItems.loadState.refresh) {
if (isRefreshing &&
postItems.loadState.refresh is LoadState.NotLoading &&
memberItems.loadState.refresh is LoadState.NotLoading
postItems.loadState.refresh is LoadState.NotLoading
) {
isRefreshing = false
}
Expand All @@ -64,7 +64,6 @@ fun HomePageContent(
onRefresh = {
if (isRefreshing) return@HomePageFeedGrid
isRefreshing = true
memberItems.refresh()
postItems.refresh()
onRefresh()
}
Expand All @@ -76,12 +75,11 @@ fun HomePageContent(
HomePageStoryBar(
postTopStateFlow = postTopState,
meStateFlow = meState,
familyListStateFlow = familyListState,
onTapProfile = onTapProfile,
onTapInvite = onTapInvite,
)
Spacer(modifier = Modifier.height(24.dp))
Divider(
HorizontalDivider(
thickness = 1.dp,
color = MaterialTheme.bbibbiScheme.backgroundSecondary
)
Expand Down
Loading
Loading