Skip to content
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
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {

defaultConfig {
applicationId = "org.sopt.linkmind"
versionCode = 11
versionName = "1.1.0"
versionCode = 12
versionName = "1.2.0"
}
viewBinding.enable = true
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import org.sopt.ui.view.onThrottleClick

class DeleteLinkBottomSheetFragment() :
BindingBottomSheetDialogFragment<FragmentDeleteLinkBottomSheetBinding>({ FragmentDeleteLinkBottomSheetBinding.inflate(it) }) {
var clipId: Long? = null
var isFullClipSize: Boolean? = null
var tooltip: Boolean? = null
private var clipId: Long? = null
private var isFullClipSize: Boolean? = null
private var tooltip: Boolean? = null
private var handleDelete: () -> Unit = {}
private var handleChange: () -> Unit = {}
private var handleModify: () -> Unit = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import org.sopt.clip.SelectedToggle
import org.sopt.datastore.datastore.SecurityDataStore
import org.sopt.domain.category.category.usecase.GetCategoryAllUseCase
import org.sopt.domain.category.category.usecase.GetCategoryLinkUseCase
Expand Down Expand Up @@ -53,27 +52,27 @@ class ClipLinkViewModel @Inject constructor(
private val _patchLinkCategory = MutableStateFlow<UiState<Long>>(UiState.Empty)
val patchLinkCategory: StateFlow<UiState<Long>> = _patchLinkCategory.asStateFlow()

var toggleSelectedPast: SelectedToggle = SelectedToggle.ALL
init {
showThenHide()
}

val tooltip = MutableStateFlow(false)
fun showThenHide(showDelay: Long = 500, duration: Long = 2000) = viewModelScope.launch(Dispatchers.IO) {
private fun showThenHide(showDelay: Long = 500, duration: Long = 2000) = viewModelScope.launch(Dispatchers.IO) {
runCatching {
val booleanListFlow =
dataStore.flowTooltip().first().toString()
val stringValue = booleanListFlow.split(",").map { it.toBoolean() }
if (stringValue[3]) {
if (stringValue.getOrElse(3) { true }) {
delay(showDelay)
tooltip.emit(stringValue[3])
tooltip.emit(true)
delay(duration)
tooltip.emit(false)
dataStore.setTooltip(
listOf(
stringValue[0],
stringValue[1],
stringValue[2],
!stringValue[3],
stringValue.getOrElse(1) { true },
stringValue.getOrElse(2) { true },
false,
).joinToString(","),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,28 @@ class WebViewViewModel @Inject constructor(
Log.e("실패", it.message.toString())
}
}

fun showThenHide(showDelay: Long = 500, duration: Long = 2000) = viewModelScope.launch(Dispatchers.IO) {
runCatching {
val booleanListFlow =
dataStore.flowTooltip().first().toString()
val stringValue = booleanListFlow.split(",").map { it.toBoolean() }
if (stringValue[2]) {
if (stringValue.getOrElse(2) { true }) {
delay(showDelay)
tooltip.emit(true)
delay(duration)
tooltip.emit(false)
tooltip2.emit(true)
delay(duration)
tooltip2.emit(false)
dataStore.setTooltip(listOf(stringValue[0], stringValue[1], !stringValue[2], stringValue[3]).joinToString(","))
dataStore.setTooltip(
listOf(
stringValue[0],
stringValue.getOrElse(1) { true },
false,
stringValue.getOrElse(3) { true },
).joinToString(","),
)
}
}
}
Expand Down
179 changes: 91 additions & 88 deletions feature/clip/src/main/res/layout/fragment_delete_link_bottom_sheet.xml
Original file line number Diff line number Diff line change
@@ -1,104 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_neutrals_fill_top20_rect">

<TextView
android:id="@+id/tv_delete_link_bottom_sheet_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="21dp"
android:text="@string/clip_link_bottom_sheet_title"
android:textAppearance="@style/Typography.suit.bold_18"
android:textColor="@color/neutrals_black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/iv_delete_link_bottom_sheet_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:padding="13dp"
android:src="@drawable/ic_close_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_delete_link_select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_neutrals_fill_top20_rect">
android:layout_marginHorizontal="20dp"
android:layout_marginTop="21dp"
android:layout_marginBottom="24dp"
android:background="@drawable/shape_white_fill_12_rect"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delete_link_bottom_sheet_title"
app:layout_constraintVertical_bias="0.0">

<TextView
android:id="@+id/tv_delete_link_bottom_sheet_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="21dp"
android:text="@string/clip_link_bottom_sheet_title"
android:textAppearance="@style/Typography.suit.bold_18"
android:textColor="@color/neutrals_black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:id="@+id/tv_delete_link_modify"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingTop="17dp"
android:paddingBottom="17dp"
android:text="제목 편집"
android:textAppearance="@style/Typography.suit.medium_16"
android:textColor="@color/neutrals900"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_delete_link_select"
app:layout_constraintTop_toTopOf="@id/cl_delete_link_select" />

<ImageView
android:id="@+id/iv_delete_link_bottom_sheet_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:padding="13dp"
android:src="@drawable/ic_close_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_delete_link_select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="21dp"
android:layout_marginBottom="24dp"
android:background="@drawable/shape_white_fill_12_rect"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delete_link_bottom_sheet_title"
app:layout_constraintVertical_bias="0.0">
<TextView
android:id="@+id/tv_delete_link_change"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingTop="17dp"
android:paddingBottom="17dp"
android:text="클립 이동"
android:textAppearance="@style/Typography.suit.medium_16"
android:textColor="@color/neutrals900"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delete_link_modify" />

<TextView
android:id="@+id/tv_delete_link_modify"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingTop="17dp"
android:paddingBottom="17dp"
android:text="제목 편집"
android:textAppearance="@style/Typography.suit.medium_16"
android:textColor="@color/neutrals900"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cl_delete_link_select"
app:layout_constraintTop_toTopOf="@id/cl_delete_link_select" />
<TextView
android:id="@+id/tv_delete_link_delete"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingTop="17dp"
android:paddingBottom="17dp"
android:text="@string/clip_link_bottom_sheet_delete"
android:textAppearance="@style/Typography.suit.medium_16"
android:textColor="@color/error"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delete_link_change" />

<TextView
android:id="@+id/tv_delete_link_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingTop="17dp"
android:paddingBottom="17dp"
android:text="클립 이동"
android:textAppearance="@style/Typography.suit.medium_16"
android:textColor="@color/neutrals900"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delete_link_modify" />
<ImageView
android:id="@+id/test_coach"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
app:layout_constraintStart_toEndOf="@id/tv_delete_link_change"
android:layout_marginStart="5dp"
android:src="@drawable/tooltip_move_clip"
app:layout_constraintTop_toTopOf="@id/tv_delete_link_change"
app:layout_constraintBottom_toBottomOf="@id/tv_delete_link_change"
android:layout_marginBottom="5dp" />
<TextView
android:id="@+id/tv_delete_link_delete"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingTop="17dp"
android:paddingBottom="17dp"
android:text="@string/clip_link_bottom_sheet_delete"
android:textAppearance="@style/Typography.suit.medium_16"
android:textColor="@color/error"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delete_link_change" />
<ImageView
android:id="@+id/test_coach"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="90dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="3dp"
android:src="@drawable/tooltip_move_clip"
app:layout_constraintBottom_toBottomOf="@id/tv_delete_link_change"
app:layout_constraintStart_toStartOf="@id/tv_delete_link_change"
app:layout_constraintTop_toTopOf="@id/tv_delete_link_change" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

<View
android:id="@+id/v_snack"
android:layout_width="match_parent"
android:layout_height="20dp"
app:layout_constraintBottom_toBottomOf="parent"/>
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
15 changes: 6 additions & 9 deletions feature/home/src/main/java/org/sopt/home/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import org.orbitmvi.orbit.syntax.simple.postSideEffect
import org.orbitmvi.orbit.syntax.simple.reduce
import org.orbitmvi.orbit.viewmodel.container
import org.sopt.datastore.datastore.SecurityDataStore
import org.sopt.domain.category.category.usecase.PostAddCategoryTitleUseCase
import org.sopt.home.model.UpdatePriority
import org.sopt.home.usecase.GetMainPageUserClip
import org.sopt.home.usecase.GetPopupInfo
Expand All @@ -40,7 +39,6 @@ class HomeViewModel @Inject constructor(
private val getRecommendSite: GetRecommendSite,
private val getWeekBestLink: GetWeekBestLink,
private val getRecentSavedLink: GetRecentSavedLink,
private val postAddCategoryTitle: PostAddCategoryTitleUseCase,
private val patchPopupInvisible: PatchPopupInvisible,
private val getPopupInfo: GetPopupInfo,
private val dataStore: SecurityDataStore,
Expand Down Expand Up @@ -80,10 +78,9 @@ class HomeViewModel @Inject constructor(

fun showThenHide(showDelay: Long = 500, duration: Long = 2000) = intent {
runCatching {
val booleanListFlow =
dataStore.flowTooltip().first().toString()
val booleanListFlow = dataStore.flowTooltip().first().toString()
val stringValue = booleanListFlow.split(",").map { it.toBoolean() }
if (stringValue[1]) {
if (stringValue.getOrElse(1) { true }) {
delay(showDelay)
reduce {
state.copy(visibleBubbleMark = true)
Expand All @@ -94,10 +91,10 @@ class HomeViewModel @Inject constructor(
}
dataStore.setTooltip(
listOf(
stringValue[0],
!stringValue[1],
stringValue[2],
stringValue[3],
true,
false,
stringValue.getOrElse(2) { true },
stringValue.getOrElse(3) { true },
).joinToString(","),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class LoginActivity : AppCompatActivity() {
private fun initMarketUpdateVisible() {
lifecycleScope.launch {
dataStore.setMarketUpdate(true)
dataStore.setTooltip(listOf(true, true, true, true).joinToString(","))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MainViewModel @Inject constructor(
val booleanListFlow =
dataStore.flowTooltip().first().toString()
val stringValue = booleanListFlow.split(",").map { it.toBoolean() }
if (stringValue[0]) {
if (!stringValue[0]) {
delay(showDelay)
reduce {
state.copy(visibleBubbleMark = true)
Expand All @@ -34,17 +34,10 @@ class MainViewModel @Inject constructor(
reduce {
state.copy(visibleBubbleMark = false)
}
dataStore.setTooltip(
listOf(
!stringValue[0],
!stringValue[1],
stringValue[2],
stringValue[3],
).joinToString(","),
)
}
}
}

fun updateClipBoard(clipboard: String) = intent {
reduce {
state.copy(clipboard = clipboard)
Expand Down
Loading