viezel / TiSocial.Framework

iOS6+ Social.Framework. Appcelerator apps are able to share content to Facebook and Twitter.
MIT License
259 stars 102 forks source link

Fix activity popover in navigation bar, bump 1.8.4 #156

Closed hansemannn closed 8 years ago

hansemannn commented 8 years ago

Patch of #155 , since the PR was merged it bit to early. Anyway, thanks @viezel !

Demo:


var Social = require("dk.napp.social");

var win = Ti.UI.createWindow({
    backgroundColor : "#fff",
    title: "Social Module"
});

var btn = Ti.UI.createButton({
    title : "Share"
});

btn.addEventListener("click", showActivityPopover);

function showActivityPopover() {
    if (Social.isActivityViewSupported()) {

        Social.activityPopover({
            text : "Share Image",
            subject : "Share Image",
            view : btn
        });
    }
}

var nav = Ti.UI.iOS.createNavigationWindow({
    window : win
});

win.setRightNavButton(btn);
nav.open();

// -- Use Case 1) Button in window
// win.add(btn);
// win.open();

// -- Use Case 2) Button in navigationBar
var nav = Ti.UI.iOS.createNavigationWindow({
    window: win
});

win.setRightNavButton(btn);
nav.open();
viezel commented 8 years ago

woops my bad.. did not read for description carefully before merging. thanks for the patch!