Skip to content

Commit ba2b66b

Browse files
YuvalYuval
authored andcommitted
refactor(android): remove legacy Gradle files and update MainActivity for system window compatibility
1 parent ad2fc51 commit ba2b66b

21 files changed

Lines changed: 83 additions & 119 deletions

03-Client/android/app/build.gradle

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
package com.groundshare.app;
22

3+
import android.os.Bundle;
4+
import androidx.core.view.WindowCompat;
35
import com.getcapacitor.BridgeActivity;
46

5-
public class MainActivity extends BridgeActivity {}
7+
public class MainActivity extends BridgeActivity {
8+
@Override
9+
public void onCreate(Bundle savedInstanceState) {
10+
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
11+
super.onCreate(savedInstanceState);
12+
}
13+
}

03-Client/android/app/src/main/res/values/styles.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@
1313
<item name="windowActionBar">false</item>
1414
<item name="windowNoTitle">true</item>
1515
<item name="android:background">@null</item>
16+
<item name="android:statusBarColor">@android:color/transparent</item>
17+
<item name="android:navigationBarColor">@android:color/transparent</item>
18+
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
1619
</style>
1720

1821

1922
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
2023
<item name="android:background">@drawable/splash</item>
24+
<item name="android:statusBarColor">@android:color/transparent</item>
25+
<item name="android:navigationBarColor">@android:color/transparent</item>
26+
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
2127
</style>
2228
</resources>

03-Client/android/build.gradle

Lines changed: 0 additions & 29 deletions
This file was deleted.

03-Client/android/gradle.properties

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,32 @@
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12-
org.gradle.jvmargs=-Xmx1536m
12+
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m
1313

1414
# When configured, Gradle will run in incubating parallel mode.
1515
# This option should only be used with decoupled projects. More details, visit
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17-
# org.gradle.parallel=true
17+
org.gradle.parallel=true
18+
19+
# Enables the Gradle build cache.
20+
org.gradle.caching=true
21+
22+
# Enables the Gradle configuration cache.
23+
org.gradle.configuration-cache=true
1824

1925
# AndroidX package structure to make it clearer which packages are bundled with the
2026
# Android operating system, and which are packaged with your app's APK
2127
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2228
android.useAndroidX=true
29+
android.nonTransitiveRClass=true
30+
android.nonFinalResIds=true
2331
android.defaults.buildfeatures.resvalues=true
2432
android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
2533
android.enableAppCompileTimeRClass=false
2634
android.usesSdkInManifest.disallowed=false
2735
android.uniquePackageNames=false
2836
android.dependency.useConstraints=true
29-
android.r8.strictFullModeForKeepRules=false
30-
android.r8.optimizedResourceShrinking=false
37+
android.r8.strictFullModeForKeepRules=true
38+
android.r8.optimizedResourceShrinking=true
3139
android.builtInKotlin=false
3240
android.newDsl=false

03-Client/android/settings.gradle

Lines changed: 0 additions & 8 deletions
This file was deleted.

03-Client/src/app/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function App() {
77
return (
88
<div className="size-full flex items-center justify-center bg-gray-200">
99
{/* On mobile: fill viewport. On desktop: fixed phone preview. */}
10-
<div className="w-full h-dvh md:w-[412px] md:h-[915px] md:max-h-screen overflow-hidden relative bg-white md:shadow-2xl safe-pt">
10+
<div className="w-full h-dvh md:w-[412px] md:h-[915px] md:max-h-screen overflow-hidden relative bg-white md:shadow-2xl">
1111
<OfflineBanner />
1212
<RouterProvider router={router} />
1313
<InstallBanner />

03-Client/src/app/capacitor-init.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ export async function initCapacitor(): Promise<void> {
2121
const tasks: Promise<unknown>[] = [];
2222

2323
if (Capacitor.isPluginAvailable("StatusBar")) {
24-
tasks.push(StatusBar.setStyle({ style: Style.Light }));
24+
tasks.push(StatusBar.setOverlaysWebView({ overlay: true }));
25+
tasks.push(StatusBar.setStyle({ style: Style.Dark }));
2526
if (Capacitor.getPlatform() === "android") {
26-
tasks.push(StatusBar.setBackgroundColor({ color: "#063c55" }));
27+
tasks.push(StatusBar.setBackgroundColor({ color: "#00000000" }));
2728
}
2829
}
2930

03-Client/src/app/components/CompareSystem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export function CompareSystem() {
160160
<div className="absolute inset-0 bg-black/7 backdrop-blur-[12px] z-10" />
161161

162162
{/* Header bar */}
163-
<div className="absolute top-[20px] left-0 right-0 h-[58px] bg-[#f3fbfd] z-30 flex items-center justify-between px-[12px]">
163+
<div className="app-top-bar absolute top-[20px] left-0 right-0 h-[58px] bg-[#f3fbfd] z-30 flex items-center justify-between px-[12px]">
164164
<button onClick={() => setDrawerOpen(true)} className="cursor-pointer w-[28px] h-[28px] shrink-0">
165165
<div className="w-full h-full bg-[#626262]" style={{
166166
maskImage: `url('${imgFill}')`,

03-Client/src/app/components/CreateEventScreen.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function CreateEventScreen() {
143143
return (
144144
<div className="relative w-full h-full overflow-hidden bg-[#063c55]" dir="rtl">
145145
{/* Header */}
146-
<div className="absolute top-[20px] left-0 right-0 h-[58px] bg-[#f3fbfd] z-30 flex items-center px-[12px] gap-[10px]">
146+
<div className="app-top-bar absolute top-[20px] left-0 right-0 h-[58px] bg-[#f3fbfd] z-30 flex items-center px-[12px] gap-[10px]">
147147
<button onClick={handleBack} className="shrink-0 cursor-pointer">
148148
<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
149149
<path d="M9.7 18.3a1 1 0 010-1.4l4.6-4.6a.3.3 0 000-.42L9.7 7.28a1 1 0 011.4-1.42l5.32 5.32a1.2 1.2 0 010 1.7l-5.32 5.32a1 1 0 01-1.4.1z" fill="#063c55" />
@@ -159,8 +159,8 @@ export function CreateEventScreen() {
159159

160160
{/* Content area */}
161161
<div
162-
className="absolute left-[16px] right-[16px] z-20 flex flex-col"
163-
style={{ top: 93, bottom: 105 }}
162+
className="below-header absolute left-[16px] right-[16px] z-20 flex flex-col"
163+
style={{ bottom: 105 }}
164164
>
165165
{/* Progress bar */}
166166
<div className="flex items-center gap-[6px] mb-[14px]">

0 commit comments

Comments
 (0)