Skip to content

Commit

Permalink
More TabView support work
Browse files Browse the repository at this point in the history
  • Loading branch information
aabewhite committed Sep 26, 2023
1 parent b4018e9 commit a1869d0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/SkipUI/SkipUI/Commands/Actions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public struct RenameAction {
public struct RenameButton<LabelX> : View where LabelX : View {

/// Creates a rename button.
public init() where LabelX == Label<Text, Image> { fatalError() }
public init() where LabelX == Label /*<Text, Image>*/ { fatalError() }

@MainActor public var body: some View { get { return stubView() } }

Expand Down
8 changes: 7 additions & 1 deletion Sources/SkipUI/SkipUI/Containers/TabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
#endif

Expand Down Expand Up @@ -44,7 +50,7 @@ public struct TabView<Content> : View where Content : View {
for tabIndex in 0..<tabCount {
// Use a custom composer to get the tabIndex'th tab item
var composeIndex = 0
var tabItem: TabItem = nil
var tabItem: TabItem? = nil
content.Compose(context: context.content(composer: { view, _ in
if composeIndex == tabIndex {
tabItem = view.strippingModifiers { $0 as? TabItem }
Expand Down
2 changes: 1 addition & 1 deletion Sources/SkipUI/SkipUI/System/ContentUnavailableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public struct ContentUnavailableView<LabelX, Description, Actions> : View where
}

@available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *)
extension ContentUnavailableView where LabelX == Label<Text, Image>, Description == Text?, Actions == EmptyView {
extension ContentUnavailableView where LabelX == Label /*<Text, Image>*/, Description == Text?, Actions == EmptyView {

/// Creates an interface, consisting of a title generated from a localized
/// string, an image and additional content, that you display when the
Expand Down
2 changes: 1 addition & 1 deletion Sources/SkipUI/SkipUI/System/UIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ extension ContentSizeCategory {
}

@available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *)
extension Label where Title == Text, Icon == Image {
extension Label /* where Title == Text, Icon == Image */ {

/// Creates a label with an icon image and a title generated from a
/// localized string.
Expand Down
4 changes: 3 additions & 1 deletion Sources/SkipUI/SkipUI/Text/Label.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height
import androidx.compose.material3.LocalTextStyle
import androidx.compose.runtime.Composable
import androidx.compose.ui.LocalDensity
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
#endif

Expand Down

0 comments on commit a1869d0

Please sign in to comment.