Skip to content

Commit

Permalink
Merge pull request #213 from touchlab/serbelga-migrate_to_material3
Browse files Browse the repository at this point in the history
Serbelga migrate to material3
  • Loading branch information
kpgalligan authored Nov 3, 2023
2 parents 999563d + 36f48be commit 70d5658
Show file tree
Hide file tree
Showing 38 changed files with 590 additions and 374 deletions.
33 changes: 30 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,34 @@ captures/
*.iml
.gradle
/local.properties
.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/encodings.xml
.idea/saveactions_settings.xml
.idea/deploymentTargetDropDown.xml
.idea/gradle.xml
.idea/misc.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx

# Keystore files
*.jks

# Eclipse project files
.classpath
.project

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
Expand All @@ -57,10 +78,16 @@ fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

#Because ugh
.DS_Store

buildboth.sh
google-services.json
GoogleService-Info.plist
GoogleService-Info.plist
Pods/
*.xcworkspace

.DS_Store
.idea/inspectionProfiles/profiles_settings.xml
.idea/inspectionProfiles/Project_Default.xml
.idea/dictionaries/matyas.xml
/.idea/
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ class MainActivity : ComponentActivity(), KoinComponent {
WindowCompat.setDecorFitsSystemWindows(window, false)

setContent {
Box(modifier = Modifier.background(Colors.primary)) {
MainView(viewModel = applicationViewModel)
}
MainView(viewModel = applicationViewModel)

val showSplashScreen by applicationViewModel.showSplashScreen.collectAsState()
Crossfade(targetState = showSplashScreen) { shouldShowSplashScreen ->
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/res/drawable/ic_splash_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<path
android:pathData="m437.1,339.9h5.2v78.8h-5.2v-78.8Z"
android:strokeWidth="0"
android:fillColor="#3fe4c5"/>
android:fillColor="#fff"/>
<path
android:pathData="m471.5,415.5c-4.3,-2.5 -7.5,-5.7 -10,-10 -2.5,-4.3 -3.6,-9.1 -3.6,-14.5s1.1,-10.2 3.6,-14.5c2.5,-4.3 5.7,-7.7 10,-10 4.3,-2.5 8.8,-3.6 14.3,-3.6s10,1.1 14.3,3.6c4.3,2.5 7.5,5.7 10,10 2.5,4.3 3.6,9.1 3.6,14.5s-1.1,10.2 -3.6,14.5c-2.5,4.3 -5.7,7.7 -10,10 -4.3,2.5 -9.1,3.6 -14.3,3.6s-10,-1.1 -14.3,-3.6ZM497.1,411.4c3.4,-2 6.1,-4.8 7.9,-8.4 1.8,-3.6 2.9,-7.5 2.9,-12s-0.9,-8.6 -2.9,-12c-2,-3.6 -4.5,-6.3 -7.9,-8.4s-7.3,-2.9 -11.3,-2.9 -8.1,0.9 -11.3,2.9c-3.2,2 -6.1,4.8 -7.9,8.4 -2,3.6 -2.9,7.5 -2.9,12s0.9,8.6 2.9,12c2,3.6 4.5,6.3 7.9,8.4 3.4,2 7.3,2.9 11.3,2.9s8.1,-0.9 11.3,-2.9Z"
android:strokeWidth="0"
Expand Down
3 changes: 1 addition & 2 deletions android/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.Droidcon.Starting" parent="Theme.SplashScreen">
<!-- Set the splash screen background. -->
<item name="windowSplashScreenBackground">@color/background</item>
Expand All @@ -12,8 +13,6 @@
</style>

<style name="Theme.Droidcon" parent="Theme.Material.DayNight.NoActionBar">
<item name="android:statusBarColor">#33fa6e50</item>
<item name="android:navigationBarColor">#33fa6e50</item>
</style>

<style name="Theme.Material.DayNight.NoActionBar" parent="@android:style/Theme.Material.Light.NoActionBar" />
Expand Down
42 changes: 19 additions & 23 deletions ios/Droidcon/Droidcon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -46,7 +46,6 @@
8404D80E26C64B9E00AE200F /* IOSAnalyticsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8404D80D26C64B9E00AE200F /* IOSAnalyticsService.swift */; };
A357C7EE28AA7861004EF059 /* FilledButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A357C7ED28AA7860004EF059 /* FilledButtonStyle.swift */; };
A35DC2DF28AB6B2600C7B298 /* SwitchingRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A35DC2DE28AB6B2600C7B298 /* SwitchingRootView.swift */; };
A35DC2E128AB6BF700C7B298 /* BackgroundCrashWorkaroundController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A35DC2E028AB6BF700C7B298 /* BackgroundCrashWorkaroundController.swift */; };
A35DC2E328AB6C6F00C7B298 /* ComposeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A35DC2E228AB6C6F00C7B298 /* ComposeController.swift */; };
A35DEF2228AA265C0072605A /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A35DEF2128AA265C0072605A /* Settings.bundle */; };
A35DEF2428AA26C80072605A /* SettingsBundleHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A35DEF2328AA26C80072605A /* SettingsBundleHelper.swift */; };
Expand Down Expand Up @@ -94,7 +93,6 @@
9EBC9F516E487D20266C9746 /* Pods_Droidcon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Droidcon.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A357C7ED28AA7860004EF059 /* FilledButtonStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilledButtonStyle.swift; sourceTree = "<group>"; };
A35DC2DE28AB6B2600C7B298 /* SwitchingRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchingRootView.swift; sourceTree = "<group>"; };
A35DC2E028AB6BF700C7B298 /* BackgroundCrashWorkaroundController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundCrashWorkaroundController.swift; sourceTree = "<group>"; };
A35DC2E228AB6C6F00C7B298 /* ComposeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeController.swift; sourceTree = "<group>"; };
A35DEF2128AA265C0072605A /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
A35DEF2328AA26C80072605A /* SettingsBundleHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsBundleHelper.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -271,7 +269,6 @@
A35DEF2128AA265C0072605A /* Settings.bundle */,
A35DEF2328AA26C80072605A /* SettingsBundleHelper.swift */,
A35DC2DE28AB6B2600C7B298 /* SwitchingRootView.swift */,
A35DC2E028AB6BF700C7B298 /* BackgroundCrashWorkaroundController.swift */,
A35DC2E228AB6C6F00C7B298 /* ComposeController.swift */,
);
path = Droidcon;
Expand All @@ -290,7 +287,7 @@
F1465EFB23AA94BF0055F7C3 /* Resources */,
F6AA88266EBC1B414A6C4232 /* [CP] Embed Pods Frameworks */,
A33EA3A8289D4DFD008850F7 /* Crashlytics Script */,
FE76281BA025B52CEB43B424 /* [CP] Copy Pods Resources */,
CB56A5C0D5CE0AC28D5D2D18 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -375,6 +372,23 @@
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${PODS_ROOT}/FirebaseCrashlytics/run\"\n";
};
CB56A5C0D5CE0AC28D5D2D18 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Droidcon/Pods-Droidcon-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Droidcon/Pods-Droidcon-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Droidcon/Pods-Droidcon-resources.sh\"\n";
showEnvVarsInLog = 0;
};
DE3B37D33D11C1968D62DBBA /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -414,23 +428,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Droidcon/Pods-Droidcon-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FE76281BA025B52CEB43B424 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Droidcon/Pods-Droidcon-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Droidcon/Pods-Droidcon-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Droidcon/Pods-Droidcon-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand All @@ -451,7 +448,6 @@
689DD2FB26B40F1800A9B009 /* LazyView.swift in Sources */,
689DD30526B438CA00A9B009 /* Avatar.swift in Sources */,
681C95A126C555D90011330B /* VisualEffectView.swift in Sources */,
A35DC2E128AB6BF700C7B298 /* BackgroundCrashWorkaroundController.swift in Sources */,
1833221026B0CF5600D79482 /* DroidconApp.swift in Sources */,
684FAA7426B2A4D400673AFF /* ScheduleView.swift in Sources */,
46B5284D249C5CF400A7725D /* Koin.swift in Sources */,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 0 additions & 31 deletions ios/Droidcon/Droidcon/BackgroundCrashWorkaroundController.swift

This file was deleted.

6 changes: 2 additions & 4 deletions ios/Droidcon/Droidcon/ComposeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ struct ComposeController: UIViewControllerRepresentable {
let viewModel: ApplicationViewModel

func makeUIViewController(context: Context) -> some UIViewController {
BackgroundCrashWorkaroundController(viewModel: viewModel)
ComposeRootControllerKt.getRootController(viewModel: viewModel)
}

func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {
uiViewController.view.setNeedsLayout()
}
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {}
}
2 changes: 1 addition & 1 deletion ios/Droidcon/Droidcon/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<string>UIStatusBarStyleDefault</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
8 changes: 2 additions & 6 deletions ios/Droidcon/Droidcon/SwitchingRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ struct SwitchingRootView: View {
var body: some View {
Group {
if viewModel.useCompose {
ZStack {
Color("NavBar_Background")
.ignoresSafeArea()

ComposeController(viewModel: viewModel)
}
ComposeController(viewModel: viewModel)
.ignoresSafeArea()
} else {
MainView(viewModel: viewModel)
}
Expand Down
5 changes: 3 additions & 2 deletions shared-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {

namespace = "co.touchlab.droidcon.sharedui"
compileSdk = androidCompileSdk.toInt()
namespace = "co.touchlab.droidcon.shared.ui"

defaultConfig {
minSdk = androidMinSdk.toInt()
targetSdk = androidTargetSdk.toInt()
Expand Down Expand Up @@ -85,7 +85,8 @@ kotlin {

implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.material3)
implementation(compose.materialIconsExtended)
implementation(compose.runtime)

implementation(libs.hyperdrive.multiplatformx.api)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package co.touchlab.droidcon.ui.theme

import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import co.touchlab.droidcon.sharedui.R

internal val montserratLightFont = Font(R.font.montserrat_regular, FontWeight.Light)
internal val montserratRegularFont = Font(R.font.montserrat_regular, FontWeight.Normal)
internal val montserratMediumFont = Font(R.font.montserrat_medium, FontWeight.Medium)
internal val montserratSemiBoldFont = Font(R.font.montserrat_semi_bold, FontWeight.SemiBold)
internal val montserratBoldFont = Font(R.font.montserrat_semi_bold, FontWeight.Bold)

actual val montserratFontFamily: FontFamily = FontFamily(
montserratLightFont,
montserratRegularFont,
montserratMediumFont,
montserratSemiBoldFont,
montserratBoldFont
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -36,7 +36,7 @@ internal actual fun __LocalImage(imageResourceName: String, modifier: Modifier,
)
} else {
Row(
modifier = modifier.background(MaterialTheme.colors.primary, RoundedCornerShape(Dimensions.Padding.half)),
modifier = modifier.background(MaterialTheme.colorScheme.primary, RoundedCornerShape(Dimensions.Padding.half)),
verticalAlignment = Alignment.CenterVertically
) {
Spacer(modifier = Modifier.weight(1f))
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ package co.touchlab.droidcon.ui

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material.BottomNavigation
import androidx.compose.material.BottomNavigationItem
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.NavigationBarItemDefaults
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import co.touchlab.droidcon.ui.icons.CalendarMonth
import co.touchlab.droidcon.ui.icons.LocalFireDepartment
import co.touchlab.droidcon.ui.icons.Schedule
Expand All @@ -30,27 +30,32 @@ internal fun BottomNavigationView(viewModel: ApplicationViewModel, modifier: Mod
Scaffold(
modifier = modifier,
bottomBar = {
BottomNavigation(elevation = 0.dp, backgroundColor = MaterialTheme.colors.primary) {
NavigationBar {
viewModel.tabs.forEach { tab ->
val (title, icon) = when (tab) {
ApplicationViewModel.Tab.Schedule -> "Schedule" to Icons.Filled.CalendarMonth
ApplicationViewModel.Tab.MyAgenda -> "My Agenda" to Icons.Filled.Schedule
ApplicationViewModel.Tab.Sponsors -> "Sponsors" to Icons.Filled.LocalFireDepartment
ApplicationViewModel.Tab.Settings -> "Settings" to Icons.Filled.Settings
}
BottomNavigationItem(
NavigationBarItem(
icon = { Icon(imageVector = icon, contentDescription = null) },
label = { Text(text = title) },
selected = selectedTab == tab,
onClick = {
viewModel.selectedTab = tab
}
},
colors = NavigationBarItemDefaults.colors(
indicatorColor = MaterialTheme.colorScheme.primary,
selectedIconColor = MaterialTheme.colorScheme.onPrimary,
selectedTextColor = MaterialTheme.colorScheme.primary
)
)
}
}
}
) { innerPadding ->
Box(modifier = Modifier.padding(innerPadding)) {
) { paddingValues ->
Box(modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding())) {
when (selectedTab) {
ApplicationViewModel.Tab.Schedule -> SessionListView(viewModel.schedule)
ApplicationViewModel.Tab.MyAgenda -> SessionListView(viewModel.agenda)
Expand Down
Loading

0 comments on commit 70d5658

Please sign in to comment.