Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(228): Handle safe area on iOS #230

Merged
merged 3 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"originHash" : "a1569f9895aa2be8e24832f98525d5da4eb90b5d158a82691c15b47eb72a13d7",
"pins" : [
{
"identity" : "abseil-cpp-binary",
Expand Down Expand Up @@ -42,17 +41,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "a732a4b47f59e4f725a2ea10f0c77e93a7131117",
"version" : "9.3.0"
"revision" : "a637d318ae7ae246b02d7305121275bc75ed5565",
"version" : "9.4.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "bc27fad73504f3d4af235de451f02ee22586ebd3",
"version" : "7.12.1"
"revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55",
"version" : "7.13.1"
}
},
{
Expand All @@ -69,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "76135c9f4e1ac85459d5fec61b6f76ac47ab3a4c",
"version" : "3.3.1"
"revision" : "9534039303015a84837090d20fa21cae6e5eadb6",
"version" : "3.3.2"
}
},
{
Expand All @@ -87,17 +86,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "9d108e9112aa1d65ce508facf804674546116d9c",
"version" : "1.22.3"
"revision" : "43aaef65e0c665daadf848761d560e446d350d3d",
"version" : "1.22.4"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692",
"version" : "2.30909.0"
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{
Expand All @@ -119,5 +118,5 @@
}
}
],
"version" : 3
"version" : 2
}
11 changes: 2 additions & 9 deletions iosApp/AndroidMakers/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIAppFonts</key>
<array>
<string>inter_semibold</string>
<string>inter_regular</string>
<string>inter_medium</string>
<string>inter_light</string>
<string>inter_bold</string>
<string>gill_sans_light</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand All @@ -60,6 +51,8 @@
</array>
</dict>
</dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down
1 change: 1 addition & 0 deletions iosApp/AndroidMakers/UI/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import shared
struct ContentView: View {
var body: some View {
MainView()
.ignoresSafeArea(.all, edges: [.top, .bottom])
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"images" : [
{
"filename" : "logo_android_makers@1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "logo_android_makers_night@1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "logo_android_makers@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "logo_android_makers_night@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "logo_android_makers@3x.png",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "logo_android_makers_night@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -11,15 +14,31 @@
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash_image" translatesAutoresizingMaskIntoConstraints="NO" id="Bh4-vD-ODX">
<rect key="frame" x="39.333333333333343" y="328" width="314.33333333333326" height="196.33333333333337"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Bh4-vD-ODX" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="4cc-WX-wxv"/>
<constraint firstItem="Bh4-vD-ODX" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="ffI-lP-X6w"/>
<constraint firstItem="Bh4-vD-ODX" firstAttribute="width" secondItem="Ze5-6b-2t3" secondAttribute="width" multiplier="0.8" id="jjM-fZ-78S"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="splash_image" width="600" height="196.33332824707031"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ package com.androidmakers.ui.about

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -24,9 +28,9 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import dev.icerock.moko.resources.compose.painterResource
import dev.icerock.moko.resources.compose.stringResource
import fr.androidmakers.domain.model.Partner
import fr.paug.androidmakers.ui.MR
import moe.tlaster.precompose.koin.koinViewModel

@Composable
fun AboutScreen(
versionName: String,
Expand Down Expand Up @@ -68,12 +72,20 @@ private fun IntroCard(
onFaqClick: () -> Unit,
onCocClick: () -> Unit
) {
val darkMode = isSystemInDarkTheme()
Column(Modifier.padding(vertical = 8.dp)) {
Image(
modifier = Modifier
.height(64.dp)
.fillMaxWidth(),
painter = painterResource(MR.images.logo_android_makers),
.heightIn(max = 128.dp)
.fillMaxWidth()
.padding(horizontal = 32.dp),
painter = painterResource(
if (darkMode) {
MR.images.logo_android_makers_night
} else {
MR.images.logo_android_makers
}
),
contentDescription = "Logo"
)
Text(
Expand Down Expand Up @@ -103,8 +115,12 @@ private fun SocialCard(
onXLogoClick: () -> Unit,
onYouTubeLogoClick: () -> Unit
) {
val darkMode = isSystemInDarkTheme()
Card(Modifier.fillMaxWidth()) {
Column(Modifier.padding(8.dp)) {
Column(
modifier = Modifier.padding(8.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Row(
Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center
Expand All @@ -113,27 +129,34 @@ private fun SocialCard(
}
Row(
Modifier
.fillMaxWidth()
.padding(top = 8.dp),
horizontalArrangement = Arrangement.Center
horizontalArrangement = Arrangement.spacedBy(16.dp),
) {
Icon(
modifier = Modifier
.size(96.dp, 64.dp)
.clickable(onClick = onXLogoClick)
.padding(12.dp),
IconButton(
onClick = onXLogoClick,
modifier = Modifier.size(64.dp)
) {
Icon(
modifier = Modifier.size(36.dp),
painter = painterResource(MR.images.ic_network_x),
tint = Color(0xFF000000),
tint = if (darkMode) {
Color.White
} else {
Color.Black
},
contentDescription = "X"
)
Icon(
modifier = Modifier
.size(96.dp, 64.dp)
.clickable(onClick = onYouTubeLogoClick),
)
}
IconButton(
modifier = Modifier.size(64.dp),
onClick = onYouTubeLogoClick
) {
Image(
modifier = Modifier.size(48.dp),
painter = painterResource(MR.images.ic_network_youtube),
tint = Color(0xffff0000),
contentDescription = "YouTube"
)
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ fun SessionDetailLayout(
}

Scaffold(
modifier = Modifier.navigationBarsPadding(),
contentWindowInsets = WindowInsets(0, 0, 0, 0),
topBar = {
TopAppBar(
navigationIcon = {
Expand Down Expand Up @@ -160,13 +158,14 @@ fun SessionDetailLayout(
}
}
) { innerPadding ->
Box(Modifier.padding(innerPadding)) {
Box {
when (sessionDetailState) {
is Lce.Loading, Lce.Error -> LoadingLayout()
is Lce.Content -> SessionDetails(
sessionDetails = sessionDetailState.content,
formattedDateAndRoom = formattedDateAndRoom!!,
openLink = onOpenLink
openLink = onOpenLink,
modifier = Modifier.padding(innerPadding)
)
}
}
Expand All @@ -175,6 +174,7 @@ fun SessionDetailLayout(

@Composable
private fun SessionDetails(
modifier: Modifier = Modifier,
sessionDetails: SessionDetailState,
formattedDateAndRoom: String,
openLink: (SocialsItem) -> Unit,
Expand All @@ -184,6 +184,7 @@ private fun SessionDetails(
Modifier
.verticalScroll(state = rememberScrollState())
.padding(16.dp)
.then(modifier)
) {

Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ fun SpeakerDetailsScreen(
) {
val speaker = uiState.speaker
Scaffold(
modifier = Modifier.navigationBarsPadding(),
contentWindowInsets = WindowInsets(0, 0, 0, 0),
topBar = {
TopAppBar(
navigationIcon = {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading