Skip to content

Commit

Permalink
- upgrading native libraries
Browse files Browse the repository at this point in the history
- android issues fix
- bumping version
  • Loading branch information
prscms committed Dec 8, 2019
1 parent 9336010 commit 98ba958
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
}
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ repositories {
dependencies {
implementation 'com.facebook.react:react-native:+'
implementation project(':react-native-vector-icons')
implementation 'com.github.zawadz88.materialpopupmenu:material-popup-menu:2.2.0'
implementation 'com.github.zawadz88.materialpopupmenu:material-popup-menu:4.0.0'
}
19 changes: 16 additions & 3 deletions android/src/main/java/ui/popovermenu/RNPopoverMenuModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public Object invoke(Object o) {
LinearLayout layout = (LinearLayout) o;

AppCompatImageView imageView = (AppCompatImageView) layout.findViewById(R.id.mpm_popup_menu_item_icon);
imageView.setImageTintMode(PorterDuff.Mode.DST);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
imageView.setImageTintMode(PorterDuff.Mode.DST);
}

TextView textView = (TextView) layout.findViewById(R.id.mpm_popup_menu_item_label);

Expand All @@ -141,7 +143,7 @@ public Object invoke(Object o) {

item.setViewBoundCallback(customItemLayout);

final Function0 callback = new Function0() {
final Function0 onDoneCallback = new Function0() {
@Override
public Object invoke() {
onDone.invoke(index, menuIndex);
Expand All @@ -150,7 +152,7 @@ public Object invoke() {
}
};

item.setCallback(callback);
item.setCallback(onDoneCallback);

return item;
}
Expand All @@ -174,6 +176,17 @@ public Object invoke() {
public void run() {
MaterialPopupMenu menu = popupMenuBuilder.build();
menu.show(activity, viewGroup);

final Function0 onCancelCallback = new Function0() {
@Override
public Object invoke() {
onCancel.invoke();

return null;
}
};

menu.setOnDismissListener(onCancelCallback);
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions ios/RNPopoverMenu.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ This library is a React Native bridge around native popover libraries. It allows
s.license = { type: "Apache License", file: "../LICENSE" }
s.author = { "author" => "Pranav Raj Singh Chauhan" }
s.platforms = { ios: "7.0" }
s.source = { git: "https://github.com/author/RNPopoverMenu.git" }
s.source = { :git => 'https://github.com/prscX/react-native-popover-menu.git', :tag => s.version }
s.source_files = "**/*.{h,m}"
s.requires_arc = true

s.dependency 'React'
s.dependency 'FTPopOverMenu', '~> 2.0.2'
s.dependency 'FTPopOverMenu', '~> 2.0.9'
end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{
"name": "react-native-popover-menu",
"version": "1.0.0",
"version": "1.0.1",
"description": "React Native: Native Popover Menu",
"main": "js/RNPopoverMenu.js",
"scripts": {
Expand Down

0 comments on commit 98ba958

Please sign in to comment.