From 4f7404fc836983f4a9e80a5fd9c2b44621a81d2a Mon Sep 17 00:00:00 2001 From: peng-u-0807 Date: Thu, 7 Dec 2023 15:27:27 +0900 Subject: [PATCH 1/2] fix: remove sorting option from my created&saved emojis --- .../views/components/CreatedEmojiListView.kt | 50 ------------------- .../views/components/SavedEmojiListView.kt | 50 ------------------- 2 files changed, 100 deletions(-) diff --git a/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt b/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt index 227814bb..f6d27f3b 100644 --- a/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt +++ b/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt @@ -3,27 +3,16 @@ package com.goliath.emojihub.views.components import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid -import androidx.compose.material.Button -import androidx.compose.material.ButtonDefaults -import androidx.compose.material.DropdownMenu -import androidx.compose.material.DropdownMenuItem -import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import androidx.paging.compose.collectAsLazyPagingItems import com.goliath.emojihub.LocalNavController import com.goliath.emojihub.NavigationDestination @@ -49,45 +38,6 @@ fun CreatedEmojiListView( ) Column(Modifier.padding(horizontal = 16.dp)) { - Spacer(Modifier.height(16.dp)) - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically - ) { - Spacer(Modifier.weight(1f)) - Column { - Button( - onClick = { dropDownMenuExpanded = true }, - colors = ButtonDefaults.buttonColors( - backgroundColor = Color.Black, - contentColor = Color.White - ) - ) { - Text(text = "Sort by", fontSize = 12.sp) - } - - DropdownMenu( - expanded = dropDownMenuExpanded, - onDismissRequest = { dropDownMenuExpanded = false } - ) { - DropdownMenuItem(onClick = { - emojiViewModel.sortByDate = 1 - emojiViewModel.fetchEmojiList() - dropDownMenuExpanded = false - }) { - Text(text = "created date") - } - DropdownMenuItem(onClick = { - emojiViewModel.sortByDate = 0 - emojiViewModel.fetchEmojiList() - dropDownMenuExpanded = false - }) { - Text(text = "save count") - } - } - } - } - LazyVerticalGrid( columns = GridCells.Fixed(2), modifier = Modifier.padding(top = 18.dp), diff --git a/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt b/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt index f3352c66..888b99ae 100644 --- a/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt +++ b/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt @@ -3,27 +3,16 @@ package com.goliath.emojihub.views.components import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid -import androidx.compose.material.Button -import androidx.compose.material.ButtonDefaults -import androidx.compose.material.DropdownMenu -import androidx.compose.material.DropdownMenuItem -import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import androidx.paging.compose.collectAsLazyPagingItems import com.goliath.emojihub.LocalNavController import com.goliath.emojihub.NavigationDestination @@ -49,45 +38,6 @@ fun SavedEmojiListView( ) Column(Modifier.padding(horizontal = 16.dp)) { - Spacer(Modifier.height(16.dp)) - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically - ) { - Spacer(Modifier.weight(1f)) - Column { - Button( - onClick = { dropDownMenuExpanded = true }, - colors = ButtonDefaults.buttonColors( - backgroundColor = Color.Black, - contentColor = Color.White - ) - ) { - Text(text = "Sort by", fontSize = 12.sp) - } - - DropdownMenu( - expanded = dropDownMenuExpanded, - onDismissRequest = { dropDownMenuExpanded = false } - ) { - DropdownMenuItem(onClick = { - emojiViewModel.sortByDate = 1 - emojiViewModel.fetchEmojiList() - dropDownMenuExpanded = false - }) { - Text(text = "created date") - } - DropdownMenuItem(onClick = { - emojiViewModel.sortByDate = 0 - emojiViewModel.fetchEmojiList() - dropDownMenuExpanded = false - }) { - Text(text = "save count") - } - } - } - } - LazyVerticalGrid( columns = GridCells.Fixed(2), modifier = Modifier.padding(top = 18.dp), From 6f0e4dbbd5cf9d80fe95463e96cc7cd6a42771a6 Mon Sep 17 00:00:00 2001 From: peng-u-0807 Date: Thu, 7 Dec 2023 15:29:44 +0900 Subject: [PATCH 2/2] fix typo --- .../emojihub/views/components/CreatedEmojiListView.kt | 6 ------ .../goliath/emojihub/views/components/SavedEmojiListView.kt | 6 ------ 2 files changed, 12 deletions(-) diff --git a/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt b/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt index f6d27f3b..af9cf1f9 100644 --- a/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt +++ b/android/app/src/main/java/com/goliath/emojihub/views/components/CreatedEmojiListView.kt @@ -7,10 +7,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.paging.compose.collectAsLazyPagingItems @@ -27,8 +23,6 @@ fun CreatedEmojiListView( val emojiList = emojiViewModel.myCreatedEmojiList.collectAsLazyPagingItems() - var dropDownMenuExpanded by remember { mutableStateOf(false) } - Column ( Modifier.background(Color.White) ) { diff --git a/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt b/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt index 888b99ae..abde7ec7 100644 --- a/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt +++ b/android/app/src/main/java/com/goliath/emojihub/views/components/SavedEmojiListView.kt @@ -7,10 +7,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.paging.compose.collectAsLazyPagingItems @@ -27,8 +23,6 @@ fun SavedEmojiListView( val emojiList = emojiViewModel.mySavedEmojiList.collectAsLazyPagingItems() - var dropDownMenuExpanded by remember { mutableStateOf(false) } - Column ( Modifier.background(Color.White) ) {