Skip to content

Commit

Permalink
Moving ToolTipWrapper into its own file
Browse files Browse the repository at this point in the history
Changing the ExtensionListScreen.kt to use ListDetailScaffold, hopefully this fixes rtl problems
  • Loading branch information
jakepurple13 committed Jan 24, 2024
1 parent 4d31413 commit 2b4b7a3
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import com.programmersbox.uiviews.GenericInfo
import com.programmersbox.uiviews.R
import com.programmersbox.uiviews.lists.ListChoiceScreen
import com.programmersbox.uiviews.utils.Screen
import com.programmersbox.uiviews.utils.components.ToolTipWrapper
import com.programmersbox.uiviews.utils.launchCatching
import com.programmersbox.uiviews.utils.showErrorToast
import com.programmersbox.uiviews.utils.toComposeColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,13 @@ import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalDrawerSheet
import androidx.compose.material3.ModalNavigationDrawer
import androidx.compose.material3.RichTooltip
import androidx.compose.material3.Snackbar
import androidx.compose.material3.SnackbarDefaults
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TooltipBox
import androidx.compose.material3.TooltipDefaults
import androidx.compose.material3.TooltipState
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.rememberDrawerState
import androidx.compose.material3.rememberTooltipState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.derivedStateOf
Expand Down Expand Up @@ -84,6 +79,7 @@ import com.programmersbox.uiviews.utils.LocalNavHostPadding
import com.programmersbox.uiviews.utils.NotificationLogo
import com.programmersbox.uiviews.utils.animate
import com.programmersbox.uiviews.utils.components.OtakuScaffold
import com.programmersbox.uiviews.utils.components.ToolTipWrapper
import com.programmersbox.uiviews.utils.components.minus
import com.programmersbox.uiviews.utils.toComposeColor
import dev.chrisbanes.haze.HazeState
Expand Down Expand Up @@ -396,20 +392,3 @@ fun DetailsView(
}
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun ToolTipWrapper(
info: @Composable () -> Unit,
modifier: Modifier = Modifier,
tooltipState: TooltipState = rememberTooltipState(),
content: @Composable () -> Unit,
) {
TooltipBox(
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
tooltip = { RichTooltip { info() } },
state = tooltipState,
modifier = modifier,
content = content
)
}
Loading

0 comments on commit 2b4b7a3

Please sign in to comment.