Skip to content

Commit

Permalink
Misc.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshualambert committed Mar 8, 2018
1 parent 86868d7 commit b46a5a5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
4 changes: 3 additions & 1 deletion app/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ function doSetEmailAddressBtnClick() {

function doReloadInboxBtnClick() {
if (OS_IOS) {
alert('Not supported on iOS yet.');
appInboxView.reload(function () {
alert('Reloaded the AppInbox successfully!');
});
// appInboxView.reload();
} else {
appInboxView.reload(function () {
Expand Down
28 changes: 16 additions & 12 deletions app/lib/localytics-hyperloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ exports.getAppInboxView = function (args) {
if (!inboxViewController) {

var detailViewController,
navigationController,
detailCloseBtn;

detailCloseBtn = Ti.UI.createButton({
title: "Done",
top: 10,
top: 20,
left: 10,
width: 50,
height: 50
width: 44,
height: 44
});

detailCloseBtn.addEventListener('click', function () {
Expand All @@ -139,8 +140,9 @@ exports.getAppInboxView = function (args) {
callback: function (tableView, indexPath) {
var campaign = inboxViewController.campaignForRowAtIndexPath(indexPath);
detailViewController = Localytics.inboxDetailViewControllerForCampaign(campaign);
detailViewController.view.addSubview(detailCloseBtn);
TiApp.app().showModalController(detailViewController, true);
navigationController = NavigationController.alloc().initWithRootViewController(detailViewController);
navigationController.view.addSubview(detailCloseBtn);
TiApp.app().showModalController(navigationController, true);
if (!campaign.isRead()) {
campaign.setRead(true);
tableView.reloadData();
Expand All @@ -155,10 +157,12 @@ exports.getAppInboxView = function (args) {

// TODO: Build out code to reload the AppInbox when this method is hit.
returnView.reload = function (callback) {
console.error('reload of AppInbox not supportedy yet on iOS.');
if (typeof callback === 'function') {
callback();
}
//console.error('reload of AppInbox not supportedy yet on iOS.');
Localytics.refreshInboxCampaigns(function(inboxCampaigns){
if (typeof callback === 'function') {
callback();
}
});
};

return returnView;
Expand All @@ -180,16 +184,16 @@ exports.getAppInboxView = function (args) {
var Intent = require('android.content.Intent');
var InboxDetailFragment = require('com.localytics.android.InboxDetailFragment'),
TypedValue = require('android.util.TypedValue'),
Gravity = require('android.view.Gravity');

Gravity = require('android.view.Gravity');
// Create instances.
var currentActivity = new Activity(Ti.Android.currentActivity);
var inboxListAdapter = new InboxListAdapter(currentActivity);
var inflater = LayoutInflater.from(currentActivity.getApplicationContext());
var containerView = inflater.inflate(Titanium.App.Android.R.layout["activity_inbox"], null);
var inboxListView = ListView.cast(containerView.findViewById(Titanium.App.Android.R.id.lv_inbox));
var emptyTextView = TextView.cast(containerView.findViewById(Titanium.App.Android.R.id.tv_empty_inbox));

// Setup the ListView with an adapter.
inboxListView.setAdapter(inboxListAdapter);
inboxListView.setEmptyView(emptyTextView);
Expand Down
4 changes: 2 additions & 2 deletions app/views/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
</Window>
</Tab>
<Tab title="App Inbox">
<Window id="appInboxTabWindow" title="App Inbox">
<Window id="appInboxTabWindow" title="App Inbox" theme="AppTheme">
<View id="appInboxContainerView" />
<View id="appInboxControlBoxView">
<Button title="Reload Inbox (Android)" id="reloadInboxBtn" onClick="doReloadInboxBtnClick" />
<Button title="Reload Inbox" id="reloadInboxBtn" onClick="doReloadInboxBtnClick" />
</View>
</Window>
</Tab>
Expand Down
7 changes: 4 additions & 3 deletions plugins/ti.alloy/hooks/alloy.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ exports.init = function (logger, config, cli, appc) {
cmd.map(function(a) {
if (/^[^"].* .*[^"]/.test(a)) return '"' + a + '"'; return a;
}).join(' ') + '"'].join(' ')], {
stdio: 'inherit',
windowsVerbatimArguments: true
});
stdio: 'inherit',
windowsVerbatimArguments: true
}
);
} else {
logger.info(__('Executing Alloy compile: %s', cmd.join(' ').cyan));
child = spawn(cmd.shift(), cmd);
Expand Down
2 changes: 1 addition & 1 deletion tiapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application android:icon="@drawable/appicon" android:label="hyperloop.testapp" android:name="HyperloopTestappApplication" android:debuggable="false" android:theme="@style/Theme.AppCompat" android:resizeableActivity="true">
<activity android:name=".HyperloopTestappActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|fontScale|screenSize|smallestScreenSize|screenLayout|density">
<activity android:name=".HyperloopTestappActivity" android:label="@string/app_name" android:theme="@style/AppTheme" android:configChanges="keyboardHidden|orientation|fontScale|screenSize|smallestScreenSize|screenLayout|density">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down

0 comments on commit b46a5a5

Please sign in to comment.