Skip to content

Commit

Permalink
Removed Cordova linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatsushita committed Jul 4, 2016
1 parent 6c7812f commit 8c00532
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 20 deletions.
6 changes: 6 additions & 0 deletions platforms/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="openmentoring" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host=" " android:pathPrefix="/" android:scheme=" " />
</intent-filter>
</activity>
<receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.TriggerReceiver" />
Expand Down
5 changes: 5 additions & 0 deletions platforms/android/CordovaLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ android {
targetCompatibility JavaVersion.VERSION_1_6
}

lintOptions {
abortOnError false;
disable 'NewApi','LongLogTag'
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
Expand Down
13 changes: 10 additions & 3 deletions platforms/android/android.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@
],
"/manifest/application/activity": [
{
"xml": "<intent-filter><data android:scheme=\"openmentoring\" /><action android:name=\"android.intent.action.VIEW\" /><category android:name=\"android.intent.category.DEFAULT\" /><category android:name=\"android.intent.category.BROWSABLE\" /></intent-filter>",
"xml": "<intent-filter><action android:name=\"android.intent.action.VIEW\" /><category android:name=\"android.intent.category.DEFAULT\" /><category android:name=\"android.intent.category.BROWSABLE\" /><data android:scheme=\"openmentoring\" /></intent-filter>",
"count": 1
},
{
"xml": "<intent-filter><action android:name=\"android.intent.action.VIEW\" /><category android:name=\"android.intent.category.DEFAULT\" /><category android:name=\"android.intent.category.BROWSABLE\" /><data android:host=\" \" android:pathPrefix=\"/\" android:scheme=\" \" /></intent-filter>",
"count": 1
}
]
Expand Down Expand Up @@ -169,6 +173,9 @@
},
"cordova-plugin-customurlscheme": {
"URL_SCHEME": "openmentoring",
"ANDROID_SCHEME": " ",
"ANDROID_HOST": " ",
"ANDROID_PATHPREFIX": "/",
"PACKAGE_NAME": "org.iilab.openmentoring"
},
"com.lampa.startapp": {
Expand Down Expand Up @@ -448,12 +455,12 @@
"cordova-plugin-whitelist": "1.2.2",
"cordova-plugin-splashscreen": "3.1.0",
"cordova-plugin-statusbar": "2.1.3",
"ionic-plugin-keyboard": "2.2.0",
"ionic-plugin-keyboard": "2.2.1",
"cordova-plugin-file": "4.1.1",
"cordova-plugin-file-transfer": "1.5.1",
"cordova-plugin-zip": "3.1.0",
"cordova-plugin-network-information": "1.2.1",
"cordova-plugin-customurlscheme": "4.1.5",
"cordova-plugin-customurlscheme": "4.2.0",
"com.lampa.startapp": "0.1.4"
}
}
4 changes: 2 additions & 2 deletions platforms/android/assets/www/cordova_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ module.exports.metadata =
"cordova-plugin-whitelist": "1.2.2",
"cordova-plugin-splashscreen": "3.1.0",
"cordova-plugin-statusbar": "2.1.3",
"ionic-plugin-keyboard": "2.2.0",
"ionic-plugin-keyboard": "2.2.1",
"cordova-plugin-file": "4.1.1",
"cordova-plugin-file-transfer": "1.5.1",
"cordova-plugin-zip": "3.1.0",
"cordova-plugin-network-information": "1.2.1",
"cordova-plugin-customurlscheme": "4.1.5",
"cordova-plugin-customurlscheme": "4.2.0",
"com.lampa.startapp": "0.1.4"
};
// BOTTOM OF METADATA
Expand Down
2 changes: 1 addition & 1 deletion platforms/android/assets/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<script src="js/services.js"></script>
</head>

<body ng-app="starter" class="platform-android platform-cordova platform-webview">
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
4 changes: 2 additions & 2 deletions platforms/android/assets/www/lib/ionic-filter-bar/.bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"tag": "v1.1.1",
"commit": "0a0a9f310a911815b45161800b276a9404142825"
},
"_source": "git://github.com/djett41/ionic-filter-bar.git",
"_target": "~1.1.1",
"_source": "https://github.com/djett41/ionic-filter-bar.git",
"_target": "^1.1.1",
"_originalSource": "ionic-filter-bar"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Keyboard.hideKeyboardAccessoryBar = function(hide) {
exec(null, null, "Keyboard", "hideKeyboardAccessoryBar", [hide]);
};

Keyboard.close = function() {
Keyboard.close = function() {
exec(null, null, "Keyboard", "close", []);
};

Expand Down
4 changes: 2 additions & 2 deletions platforms/android/platform_www/cordova_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ module.exports.metadata =
"cordova-plugin-whitelist": "1.2.2",
"cordova-plugin-splashscreen": "3.1.0",
"cordova-plugin-statusbar": "2.1.3",
"ionic-plugin-keyboard": "2.2.0",
"ionic-plugin-keyboard": "2.2.1",
"cordova-plugin-file": "4.1.1",
"cordova-plugin-file-transfer": "1.5.1",
"cordova-plugin-zip": "3.1.0",
"cordova-plugin-network-information": "1.2.1",
"cordova-plugin-customurlscheme": "4.1.5",
"cordova-plugin-customurlscheme": "4.2.0",
"com.lampa.startapp": "0.1.4"
};
// BOTTOM OF METADATA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Keyboard.hideKeyboardAccessoryBar = function(hide) {
exec(null, null, "Keyboard", "hideKeyboardAccessoryBar", [hide]);
};

Keyboard.close = function() {
Keyboard.close = function() {
exec(null, null, "Keyboard", "close", []);
};

Expand Down
6 changes: 3 additions & 3 deletions platforms/android/res/xml/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
<feature name="LaunchMyApp">
<param name="android-package" value="nl.xservices.plugins.LaunchMyApp" />
</feature>
<feature name="startApp">
<param name="android-package" value="com.lampa.startapp.startApp" />
</feature>
<feature name="Zip">
<param name="android-package" value="org.apache.cordova.Zip" />
</feature>
<feature name="startApp">
<param name="android-package" value="com.lampa.startapp.startApp" />
</feature>
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
Expand Down
33 changes: 28 additions & 5 deletions platforms/android/src/io/ionic/keyboard/IonicKeyboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.inputmethod.InputMethodManager;

// import additionally required classes for calculating screen height
import android.view.Display;
import android.graphics.Point;
import android.os.Build;

public class IonicKeyboard extends CordovaPlugin {

public void initialize(CordovaInterface cordova, CordovaWebView webView) {
Expand Down Expand Up @@ -67,13 +72,31 @@ public void onGlobalLayout() {
Rect r = new Rect();
//r will be populated with the coordinates of your view that area still visible.
rootView.getWindowVisibleDisplayFrame(r);

PluginResult result;

int heightDiff = rootView.getRootView().getHeight() - r.bottom;
// cache properties for later use
int rootViewHeight = rootView.getRootView().getHeight();
int resultBottom = r.bottom;

// calculate screen height differently for android versions >= 21: Lollipop 5.x, Marshmallow 6.x
//http://stackoverflow.com/a/29257533/3642890 beware of nexus 5
int screenHeight;

if (Build.VERSION.SDK_INT >= 21) {
Display display = cordova.getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
screenHeight = size.y;
} else {
screenHeight = rootViewHeight;
}

int heightDiff = screenHeight - resultBottom;

int pixelHeightDiff = (int)(heightDiff / density);
if (pixelHeightDiff > 100 && pixelHeightDiff != previousHeightDiff) { // if more than 100 pixels, its probably a keyboard...
String msg = "S" + Integer.toString(pixelHeightDiff);
String msg = "S" + Integer.toString(pixelHeightDiff);
result = new PluginResult(PluginResult.Status.OK, msg);
result.setKeepCallback(true);
callbackContext.sendPluginResult(result);
Expand All @@ -89,8 +112,8 @@ else if ( pixelHeightDiff != previousHeightDiff && ( previousHeightDiff - pixelH
};

rootView.getViewTreeObserver().addOnGlobalLayoutListener(list);


PluginResult dataResult = new PluginResult(PluginResult.Status.OK);
dataResult.setKeepCallback(true);
callbackContext.sendPluginResult(dataResult);
Expand Down

0 comments on commit 8c00532

Please sign in to comment.