-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12d0af1
commit 2291e54
Showing
5 changed files
with
179 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 84 additions & 9 deletions
93
app/src/main/java/org/memento/presentation/plusbottomsheet/MainPlusBottomSheet.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,99 @@ | ||
package org.memento.presentation.plusbottomsheet | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.imePadding | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
import androidx.compose.foundation.layout.wrapContentWidth | ||
import androidx.compose.foundation.pager.HorizontalPager | ||
import androidx.compose.foundation.pager.rememberPagerState | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Tab | ||
import androidx.compose.material3.TabRow | ||
import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.rememberModalBottomSheetState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.rememberCoroutineScope | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.unit.dp | ||
import kotlinx.coroutines.launch | ||
import org.memento.R | ||
import org.memento.presentation.util.noRippleClickable | ||
import org.memento.ui.MementoBottomSheet | ||
import org.memento.ui.RepeatSelectorContent | ||
import org.memento.ui.theme.darkModeColors | ||
|
||
@Composable | ||
fun MainPlusBottomSheet() { | ||
Column( | ||
modifier = | ||
Modifier | ||
.fillMaxWidth() | ||
.padding(16.dp), | ||
fun MainPlusBottomSheet( | ||
tagColor: String, | ||
deadLineText : String, | ||
onNavigateDeadLineSetting: () -> Unit, | ||
onNavigateTagSetting: () -> Unit | ||
) { | ||
val pages = listOf(R.drawable.ic_check_tab, R.drawable.ic_check_tab, R.drawable.ic_check_tab) | ||
val pagerState = rememberPagerState( | ||
pageCount = { 3 } | ||
) | ||
val coroutineScope = rememberCoroutineScope() | ||
|
||
TabRow( | ||
selectedTabIndex = pagerState.currentPage, | ||
modifier = Modifier | ||
.padding(vertical = 13.dp), | ||
containerColor = darkModeColors.gray09, | ||
indicator = { tabPositions -> | ||
Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage]) | ||
}, | ||
divider = { } | ||
) { | ||
Text(text = "바텀시트 내용") | ||
Spacer(modifier = Modifier.height(100.dp)) | ||
pages.forEachIndexed { index, _ -> | ||
Tab( | ||
selected = pagerState.currentPage == index, | ||
onClick = { | ||
coroutineScope.launch { | ||
pagerState.scrollToPage(index) | ||
} | ||
}, | ||
modifier = Modifier.padding(all = 3.dp) | ||
) { | ||
Image( | ||
painter = painterResource(pages[index]), | ||
contentDescription = "탭 아이콘", | ||
modifier = Modifier.padding(all = 3.dp) | ||
) | ||
} | ||
} | ||
} | ||
|
||
HorizontalPager( | ||
state = pagerState, | ||
) { page -> | ||
when (page) { | ||
0 -> AddToDoScreen ( | ||
deadLineText = deadLineText, | ||
tagColor = tagColor, | ||
onNavigateDeadLineSetting = onNavigateDeadLineSetting, | ||
onNavigateTagSetting = onNavigateTagSetting | ||
) | ||
1 -> AddPlanScreen() | ||
2 -> BrainDumpScreen() | ||
else -> AddToDoScreen( | ||
deadLineText = deadLineText, | ||
tagColor = tagColor, | ||
onNavigateDeadLineSetting = onNavigateDeadLineSetting, | ||
onNavigateTagSetting = onNavigateTagSetting | ||
) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters