Skip to content

Commit d60f03a

Browse files
committed
Added type for route. Fixed: type issue capacitor-app.ts & android studio cordova plugin missing error
1 parent 99100df commit d60f03a

File tree

8 files changed

+88
-5
lines changed

8 files changed

+88
-5
lines changed

android/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ lint/tmp/
9090
*.hprof
9191

9292
# Cordova plugins for Capacitor
93-
capacitor-cordova-android-plugins
93+
# capacitor-cordova-android-plugins
9494

9595
# Copied web assets
9696
app/src/main/assets/public
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
ext {
2+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
3+
cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '7.0.0'
4+
}
5+
6+
buildscript {
7+
repositories {
8+
google()
9+
jcenter()
10+
}
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:4.2.1'
13+
}
14+
}
15+
16+
apply plugin: 'com.android.library'
17+
18+
android {
19+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
20+
defaultConfig {
21+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
22+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
23+
versionCode 1
24+
versionName "1.0"
25+
}
26+
lintOptions {
27+
abortOnError false
28+
}
29+
compileOptions {
30+
sourceCompatibility JavaVersion.VERSION_1_8
31+
targetCompatibility JavaVersion.VERSION_1_8
32+
}
33+
}
34+
35+
repositories {
36+
google()
37+
mavenCentral()
38+
jcenter()
39+
flatDir{
40+
dirs 'src/main/libs', 'libs'
41+
}
42+
}
43+
44+
dependencies {
45+
implementation fileTree(dir: 'src/main/libs', include: ['*.jar'])
46+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
47+
implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
48+
// SUB-PROJECT DEPENDENCIES START
49+
50+
// SUB-PROJECT DEPENDENCIES END
51+
}
52+
53+
// PLUGIN GRADLE EXTENSIONS START
54+
apply from: "cordova.variables.gradle"
55+
// PLUGIN GRADLE EXTENSIONS END
56+
57+
for (def func : cdvPluginPostBuildExtras) {
58+
func()
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
2+
ext {
3+
cdvMinSdkVersion = project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
4+
// Plugin gradle extensions can append to this to have code run at the end.
5+
cdvPluginPostBuildExtras = []
6+
cordovaConfig = [:]
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<manifest package="capacitor.android.plugins"
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:amazon="http://schemas.amazon.com/apk/res/android">
5+
<application >
6+
7+
</application>
8+
9+
</manifest>

android/capacitor-cordova-android-plugins/src/main/java/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/capacitor-app.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var capacitorApp = {
2-
f7: null,
2+
f7: null as any,
33
/*
44
This method hides splashscreen after 2 seconds
55
*/
@@ -103,7 +103,7 @@ var capacitorApp = {
103103
Keyboard.setAccessoryBarVisible({isVisible: true});
104104
});
105105

106-
$(document).on('touchstart', 'input, textarea, select', function (e) {
106+
$(document).on('touchstart', 'input, textarea, select', function (e: any) {
107107
var nodeName = e.target.nodeName.toLowerCase();
108108
var type = e.target.type;
109109
var showForTypes = ['datetime-local', 'time', 'date', 'datetime'];
@@ -114,7 +114,7 @@ var capacitorApp = {
114114
}
115115
}, true);
116116
},
117-
init: function (f7) {
117+
init: function (f7: any) {
118118
// Save f7 instance
119119
capacitorApp.f7 = f7;
120120

@@ -129,4 +129,10 @@ var capacitorApp = {
129129
},
130130
};
131131

132+
declare global {
133+
interface Window {
134+
Capacitor: any;
135+
}
136+
}
137+
132138
export default capacitorApp;

src/routes/router.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import type { Router } from "framework7/types";
12
import HomePage from '../pages/home.vue';
23
import AboutPage from '../pages/about.vue';
34
import SettingsPage from '../pages/settings.vue';
45
import DynamicRoutePage from '../pages/dynamic-route.vue';
56
import RequestAndLoad from '../pages/request-and-load.vue';
67
import NotFoundPage from '../pages/404.vue';
78

8-
var routes = [
9+
var routes: Router.RouteParameters[] = [
910
{
1011
path: '/',
1112
component: HomePage,

0 commit comments

Comments
 (0)