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

✨ Add android app #4

Merged
merged 2 commits into from
Jun 18, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ yarn-error.log*
convex/_generated/

.gradle/

# For setting JAVA_HOME
.envrc
6 changes: 6 additions & 0 deletions android/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions android/.idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions android/.idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apply plugin: 'com.android.application'

android {
namespace "com.example.app"
compileSdkVersion rootProject.ext.compileSdkVersion
namespace "app.starfocus"
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.example.app"
applicationId "app.starfocus"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
Expand Down
3 changes: 3 additions & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ android {

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-status-bar')

}
Expand Down
29 changes: 5 additions & 24 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">

<activity
android:exported="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:name="com.example.app.MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask">
<activity android:exported="true" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:name="app.starfocus.MainActivity" android:label="@string/title_activity_main" android:theme="@style/AppTheme.NoActionBarLaunch" android:launchMode="singleTask">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -25,14 +12,8 @@

</activity>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
</provider>
</application>

Expand Down
9 changes: 4 additions & 5 deletions android/app/src/main/assets/capacitor.config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"appId": "com.example.app",
"appName": "nextjs-tailwind-capacitor",
"appId": "app.starfocus",
"appName": "Starfocus",
"bundledWebRuntime": false,
"npmClient": "npm",
"webDir": "out",
"cordova": {},
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
}
},
"cordova": {}
"webDir": "out"
}
12 changes: 12 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
[
{
"pkg": "@capacitor/app",
"classpath": "com.capacitorjs.plugins.app.AppPlugin"
},
{
"pkg": "@capacitor/haptics",
"classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin"
},
{
"pkg": "@capacitor/keyboard",
"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
},
{
"pkg": "@capacitor/status-bar",
"classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.app;
package app.starfocus;

import com.getcapacitor.BridgeActivity;

Expand Down
8 changes: 4 additions & 4 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">nextjs-tailwind-capacitor</string>
<string name="title_activity_main">nextjs-tailwind-capacitor</string>
<string name="package_name">com.example.app</string>
<string name="custom_url_scheme">com.example.app</string>
<string name="app_name">starfocus</string>
<string name="title_activity_main">starfocus</string>
<string name="package_name">app.starfocus</string>
<string name="custom_url_scheme">app.starfocus</string>
</resources>
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.android.tools.build:gradle:8.4.1'
classpath 'com.google.gms:google-services:4.4.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
9 changes: 9 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')

include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')

include ':capacitor-haptics'
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')

include ':capacitor-keyboard'
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')

include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 7 additions & 7 deletions android/variables.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ext {
minSdkVersion = 22
compileSdkVersion = 33
targetSdkVersion = 33
androidxActivityVersion = '1.7.0'
compileSdkVersion = 34
targetSdkVersion = 34
androidxActivityVersion = '1.8.0'
androidxAppCompatVersion = '1.6.1'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.10.0'
androidxFragmentVersion = '1.5.6'
androidxCoreVersion = '1.12.0'
androidxFragmentVersion = '1.6.2'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
cordovaAndroidVersion = '10.1.1'
coreSplashScreenVersion = '1.0.0'
androidxWebkitVersion = '1.6.1'
coreSplashScreenVersion = '1.0.1'
androidxWebkitVersion = '1.9.0'
}
4 changes: 4 additions & 0 deletions app/home/page.tsx → app/[...all]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const App = dynamic(() => import('../../components/AppShell'), {
ssr: false,
})

export async function generateStaticParams() {
return [{ all: ['home'] }, { all: ['constellation'] }, { all: ['settings'] }]
}

export default function Page() {
return <App />
}
13 changes: 0 additions & 13 deletions capacitor.config.json

This file was deleted.

16 changes: 16 additions & 0 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { CapacitorConfig } from '@capacitor/cli'

const config: CapacitorConfig = {
appId: 'app.starfocus',
appName: 'Starfocus',
bundledWebRuntime: false,
cordova: {},
plugins: {
SplashScreen: {
launchShowDuration: 0,
},
},
webDir: 'out',
}

export default config
7 changes: 6 additions & 1 deletion components/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { StatusBar, Style } from '@capacitor/status-bar'
import { IonReactRouter } from '@ionic/react-router'
import { Route } from 'react-router-dom'
import Home from './pages/Home'
import Constellation from './pages/Constellation'

setupIonicReact({})

Expand All @@ -23,7 +24,11 @@ const AppShell = () => {
<IonReactRouter>
<IonRouterOutlet id="main">
<Route
path="/"
path="/constellation"
render={() => <Constellation />}
/>
<Route
path="/home"
render={() => <Home />}
/>
</IonRouterOutlet>
Expand Down
4 changes: 2 additions & 2 deletions components/landingPage/Contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export default function Contact() {
</div>
<div className="flex items-center gap-4">
<Separator character="⋆" />
<Link
<a
href="/home"
className="font-bold text-white underline"
>
Try it!
</Link>
</a>
<Separator character="⋆" />
</div>
<div className="flex items-center justify-center flex-grow gap-4 text-center">
Expand Down
9 changes: 9 additions & 0 deletions components/pages/Constellation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { IonPage } from '@ionic/react'

export default function Constellation() {
return (
<IonPage>
<h1>Constellation</h1>
</IonPage>
)
}
13 changes: 6 additions & 7 deletions components/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
import { OverlayEventDetail } from '@ionic/react/dist/types/components/react-component-lib/interfaces'
import { Todo, db } from '../db'
import { useLiveQuery } from 'dexie-react-hooks'
import { Link } from 'react-router-dom'

const Home = () => {
// const data = [
Expand Down Expand Up @@ -180,16 +181,13 @@ const Home = () => {
<>
<MiscMenu />
<FilterMenu />
<IonPage>
<IonPage id="main-content">
<IonHeader>
<IonToolbar>
<IonTitle>Today & upcoming</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent
className="ion-padding"
id="main-content"
>
<IonContent className="ion-padding">
<Log todos={logTodos} />
<Important todos={importantTodos} />
<Icebox todos={iceboxTodos} />
Expand Down Expand Up @@ -284,7 +282,7 @@ export const MiscMenu = () => {
>
<IonHeader>
<IonToolbar>
<IonTitle>Menu Content</IonTitle>
<IonTitle>Misc</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent className="ion-padding">
Expand All @@ -303,10 +301,11 @@ export const FilterMenu = () => {
>
<IonHeader>
<IonToolbar>
<IonTitle>Menu Content</IonTitle>
<IonTitle>Views</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent className="ion-padding">
<Link to="/constellation">Constellation</Link>
<p>Filters coming soon...</p>
</IonContent>
</IonMenu>
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.example.app;
PRODUCT_BUNDLE_IDENTIFIER = app.starfocus;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
Expand All @@ -367,7 +367,7 @@
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.app;
PRODUCT_BUNDLE_IDENTIFIER = app.starfocus;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
Expand Down
Loading
Loading