Skip to content

Commit

Permalink
fix issue with On-Screen navigation buttons eclipsing the lower porti…
Browse files Browse the repository at this point in the history
…on of the drawer when app installed with Ti SDK 6.1.0+
  • Loading branch information
fahad86 committed Jun 28, 2017
1 parent 0e72982 commit 0cb1f97
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,2 +1,4 @@
.DS_Store
tmp
tmp
bin/
.classpath
2 changes: 1 addition & 1 deletion android/build.properties
@@ -1,4 +1,4 @@
titanium.platform=/Users/napp/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android
titanium.platform=/Users/napp/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.GA/android
android.platform=/Volumes/DATA/Titanium/androidsdk/platforms/android-24
google.apis=/Volumes/DATA/Titanium/androidsdk/add-ons/addon-google_apis-google-11
android.ndk=/Volumes/DATA/Titanium/android-ndk-r13b
Expand Down
Binary file added android/dist/dk.napp.drawer-android-2.0.1.zip
Binary file not shown.
Binary file modified android/dist/nappslide.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/manifest
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.0.0
version: 2.0.1
apiversion: 4
description: Napp Drawer
author: Mads Moller
Expand Down
Expand Up @@ -34,7 +34,6 @@
import static android.graphics.Paint.SUBPIXEL_TEXT_FLAG;
import static android.graphics.Paint.Style.STROKE;
import static android.graphics.PixelFormat.TRANSLUCENT;
import static android.support.v4.widget.DrawerLayout.DrawerListener;
import static java.lang.Math.sqrt;

/** A drawable that rotates between a drawer icon and a back arrow based on parameter. */
Expand Down
26 changes: 15 additions & 11 deletions android/src/com/slidingmenu/lib/SlidingMenu.java
Expand Up @@ -2,6 +2,9 @@

import java.lang.reflect.Method;




//import android.annotation.SuppressLint;
//import android.annotation.TargetApi;
import android.app.Activity;
Expand All @@ -14,7 +17,6 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
Expand All @@ -24,10 +26,8 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;


import com.slidingmenu.lib.CustomViewAbove.OnPageChangeListener;

public class SlidingMenu extends RelativeLayout {
Expand Down Expand Up @@ -308,8 +308,11 @@ public void onPageSelected(int position) {
* @param slideStyle either SLIDING_CONTENT or SLIDING_WINDOW
*/
public void attachToActivity(Activity activity, int slideStyle) {
attachToActivity(activity, slideStyle, false);
}
attachToActivity(activity, slideStyle, false);
if(slideStyle == SLIDING_WINDOW && Build.VERSION.SDK_INT >= 21) {
setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
}
}

/**
* Attaches the SlidingMenu to an entire Activity
Expand Down Expand Up @@ -653,8 +656,9 @@ public void setAboveOffsetRes(int resID) {
setAboveOffset(i);
}

private int getDisplayWidth() {
int width;
@SuppressWarnings("deprecation")
private int getDisplayWidth() {
int width;
Display display = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
try {
Expand All @@ -667,14 +671,13 @@ private int getDisplayWidth() {
} catch (Exception e) {
width = display.getWidth();
}
return width;
}
return width;
}
/**
* Sets the behind width.
*
* @param i The width the Sliding Menu will open to, in pixels
*/
@SuppressWarnings("deprecation")
public void setBehindWidth(int i) {
setBehindOffset(getDisplayWidth()-i);
}
Expand All @@ -684,7 +687,6 @@ public void setBehindWidth(int i) {
*
* @param i The width the Sliding Menu will open to, in pixels
*/
@SuppressWarnings("deprecation")
public void setRightBehindWidth(int i) {
setRightBehindOffset(getDisplayWidth()-i);
}
Expand Down Expand Up @@ -792,6 +794,7 @@ public void setTouchModeBehind(int i) {
*
* @param resId the resource ID of the new shadow drawable
*/
@SuppressWarnings("deprecation")
public void setShadowDrawable(int resId) {
setShadowDrawable(getContext().getResources().getDrawable(resId));
}
Expand All @@ -810,6 +813,7 @@ public void setShadowDrawable(Drawable d) {
*
* @param resId the resource ID of the new shadow drawable
*/
@SuppressWarnings("deprecation")
public void setSecondaryShadowDrawable(int resId) {
setSecondaryShadowDrawable(getContext().getResources().getDrawable(resId));
}
Expand Down
1 change: 0 additions & 1 deletion android/src/dk/napp/drawer/NappdrawerModule.java
Expand Up @@ -15,7 +15,6 @@
import org.appcelerator.kroll.annotations.Kroll;

import org.appcelerator.titanium.TiApplication;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.kroll.common.TiConfig;


Expand Down

0 comments on commit 0cb1f97

Please sign in to comment.