Skip to content

Commit

Permalink
Merge pull request #4 from ashcoding/fixes
Browse files Browse the repository at this point in the history
[MOD-2104] and [MOD-2105]
  • Loading branch information
pec1985 committed Mar 23, 2015
2 parents 285e856 + 1f8d945 commit 8252b07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 35 deletions.
6 changes: 3 additions & 3 deletions android/src/facebook/LikeButtonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public class LikeButtonProxy extends TiViewProxy

public LikeButtonProxy() {
super();
defaultValues.put("likeViewStyle", Style.STANDARD);
defaultValues.put("auxiliaryViewPosition", AuxiliaryViewPosition.BOTTOM);
defaultValues.put("horizontalAlignment", HorizontalAlignment.CENTER);
defaultValues.put("likeViewStyle", "standard");
defaultValues.put("auxiliaryViewPosition", "bottom");
defaultValues.put("horizontalAlignment", "center");
Log.d(TAG, "[VIEWPROXY LIFECYCLE EVENT] init");
}

Expand Down
6 changes: 3 additions & 3 deletions android/src/facebook/LikeButtonView.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public LikeButtonView(TiViewProxy proxy)

private void setLikeViewStyle(String name) {
for(Style style : Style.values()) {
if (style.toString().equals(name)) {
if (style.toString().equalsIgnoreCase(name)) {
likeView.setLikeViewStyle(style);
break;
}
Expand All @@ -52,7 +52,7 @@ private void setLikeViewStyle(String name) {

private void setAuxiliaryViewPosition(String name) {
for(AuxiliaryViewPosition avp : AuxiliaryViewPosition.values()) {
if (avp.toString().equals(name)) {
if (avp.toString().equalsIgnoreCase(name)) {
likeView.setAuxiliaryViewPosition(avp);
break;
}
Expand All @@ -61,7 +61,7 @@ private void setAuxiliaryViewPosition(String name) {

private void setHorizontalAlignment(String name) {
for(HorizontalAlignment ha : HorizontalAlignment.values()) {
if (ha.toString().equals(name)) {
if (ha.toString().equalsIgnoreCase(name)) {
likeView.setHorizontalAlignment(ha);
break;
}
Expand Down
32 changes: 3 additions & 29 deletions android/src/facebook/TiFacebookModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -746,40 +746,14 @@ public void onComplete(Bundle values,
}
});
}

@Kroll.method
public void requestNewReadPermissions(String[] permissions, final KrollFunction callback) {
requestNewReadPermissions(permissions, AUDIENCE_EVERYONE, callback);
}

@Kroll.method
public void requestNewReadPermissions(String[] permissions, int audienceChoice, final KrollFunction callback) {
SessionDefaultAudience audience;
switch(audienceChoice){
case TiFacebookModule.AUDIENCE_NONE:
audience = SessionDefaultAudience.NONE;
break;
case TiFacebookModule.AUDIENCE_ONLY_ME:
audience = SessionDefaultAudience.ONLY_ME;
break;
case TiFacebookModule.AUDIENCE_FRIENDS:
audience = SessionDefaultAudience.FRIENDS;
break;
default:
case TiFacebookModule.AUDIENCE_EVERYONE:
audience = SessionDefaultAudience.EVERYONE;
break;
}
public void requestNewReadPermissions(String[] permissions, final KrollFunction callback) {
permissionCallback = callback;
Session.getActiveSession().requestNewReadPermissions(
new NewPermissionsRequest(TiApplication.getInstance().getCurrentActivity(), Arrays.asList(permissions)).setDefaultAudience(audience));
}

@Kroll.method
public void requestNewPublishPermissions(String[] permissions, final KrollFunction callback) {
requestNewPublishPermissions(permissions, AUDIENCE_EVERYONE, callback);
new NewPermissionsRequest(TiApplication.getInstance().getCurrentActivity(), Arrays.asList(permissions)));
}

@Kroll.method
public void requestNewPublishPermissions(String[] permissions, int audienceChoice, final KrollFunction callback) {
SessionDefaultAudience audience;
Expand Down

0 comments on commit 8252b07

Please sign in to comment.