Skip to content

Commit

Permalink
Merge branch 'master' into TIMOB-26758
Browse files Browse the repository at this point in the history
  • Loading branch information
ssjsamir committed Mar 19, 2019
2 parents 7270b7c + 4961d92 commit a1b092d
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 2,944 deletions.
7 changes: 5 additions & 2 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2678,17 +2678,20 @@ AndroidBuilder.prototype.copyResources = function copyResources(next) {
appc.async.series(this, tasks, function () {
const templateDir = path.join(this.platformPath, 'templates', 'app', 'default', 'template', 'Resources', 'android');

// if an app icon hasn't been copied, copy the default one
const srcIcon = path.join(templateDir, 'appicon.png');
const destIcon = path.join(this.buildBinAssetsResourcesDir, this.tiapp.icon);

// if an app icon hasn't been copied, copy the default one
if (!fs.existsSync(destIcon)) {
copyFile.call(this, srcIcon, destIcon);
}
delete this.lastBuildFiles[destIcon];

const destIcon2 = path.join(this.buildResDrawableDir, this.tiapp.icon);
if (!fs.existsSync(destIcon2)) {
copyFile.call(this, srcIcon, destIcon2);
// Note, we are explicitly copying destIcon here as we want to ensure that we're
// copying the user specified icon, srcIcon is the default Titanium icon
copyFile.call(this, destIcon, destIcon2);
}
delete this.lastBuildFiles[destIcon2];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ public static ArrayList<EventProxy> queryEvents(Uri uri, String query, String[]
visibility = "visibility";
}

Cursor eventCursor = contentResolver.query(uri,
new String[] { "_id", "title", "description", "eventLocation",
"dtstart", "dtend", "allDay", "hasAlarm",
"eventStatus", visibility, "hasExtendedProperties" },
query, queryArgs, orderBy);
Cursor eventCursor = contentResolver.query(
uri,
new String[] { "_id", "title", "description", "eventLocation", "dtstart", "dtend", "allDay", "hasAlarm",
"eventStatus", visibility, Events.RRULE, Events.CALENDAR_ID, "hasExtendedProperties" },
query, queryArgs, orderBy);

while (eventCursor.moveToNext()) {
EventProxy event = new EventProxy();
Expand All @@ -189,8 +189,17 @@ public static ArrayList<EventProxy> queryEvents(Uri uri, String query, String[]
event.hasAlarm = !eventCursor.getString(7).equals("0");
event.status = eventCursor.getInt(8);
event.visibility = eventCursor.getInt(9);
event.hasExtendedProperties = !eventCursor.getString(10).equals("0");

event.hasExtendedProperties = !eventCursor.getString(12).equals("0");
// Guarding against Cursor implementations which would throw an exception
// instead of returning null if no recurrence rule is added to the event
String recurrenceRule = null;
try {
recurrenceRule = eventCursor.getString(10);
} catch (Exception e) {
Log.w(TAG, "Trying to get a recurrence rule for an event without one.");
e.printStackTrace();
}
event.setRecurrenceRules(recurrenceRule, eventCursor.getInt(11));
events.add(event);
}
eventCursor.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.AsyncResult;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.kroll.common.TiMessenger;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.TiConvert;
Expand All @@ -26,6 +24,8 @@

import android.app.Activity;
import android.os.Message;
import android.widget.RelativeLayout;

// clang-format off
@Kroll.proxy(creatableInModule = UIModule.class,
propertyAccessors = {
Expand Down Expand Up @@ -137,6 +137,12 @@ public void releaseViews()
@Override
public void release()
{
// Release search bar proxy if there is one
if (hasPropertyAndNotNull(TiC.PROPERTY_SEARCH)) {
TiViewProxy searchView = (TiViewProxy) getProperty(TiC.PROPERTY_SEARCH);
searchView.release();
}

super.release();

releaseViews();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SearchViewProxy extends TiViewProxy
public SearchViewProxy()
{
super();
defaultValues.put(TiC.PROPERTY_ICONIFIED_BY_DEFAULT, true);
defaultValues.put(TiC.PROPERTY_ICONIFIED_BY_DEFAULT, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ public void onDestroy(Activity activity)
@Override
public void release()
{
// Release search bar if there is one
// Release search bar views if there is one
if (nativeView instanceof RelativeLayout) {
((RelativeLayout) nativeView).removeAllViews();
TiViewProxy searchView = (TiViewProxy) (proxy.getProperty(TiC.PROPERTY_SEARCH));
searchView.release();
searchView.releaseViews();
}

// If a refresh control is currently assigned, then detach it.
Expand Down
2 changes: 1 addition & 1 deletion android/runtime/common/src/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ Module.prototype.loadAsDirectory = function (id, context) {
// b. let M = X + (json main field)
var m = path.resolve(id, object.exports.main);
// c. LOAD_AS_FILE(M)
return this.loadAsFile(m, context);
return this.loadAsFileOrDirectory(m, context);
}
}

Expand Down
10 changes: 6 additions & 4 deletions apidoc/Titanium/Calendar/Calendar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ examples:
win.open();
- title: Create a Recurring Event with Alerts on iOS
- title: Create a Recurring Event with Alerts
example: |
Create a recurring event with alerts.
Expand Down Expand Up @@ -1065,9 +1065,11 @@ examples:
Ti.API.info(' ' + monthsOfTheYear[j]);
}
Ti.API.info('daysOfTheYear : ');
var setPositions = eventRule[i].setPositions;
for(var j=0;j<setPositions.length;j++) {
Ti.API.info(' ' + setPositions[j]);
if (osname !== 'android') {
var setPositions = eventRule[i].setPositions;
for(var j=0;j<setPositions.length;j++) {
Ti.API.info(' ' + setPositions[j]);
}
}
};
Ti.API.info('alerts : '+ eventFromCalendar.alerts);
Expand Down
7 changes: 4 additions & 3 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/KrollBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,10 @@ - (NSString *)packageJSONMain:(NSString *)packageJsonPath
// b. let M = X + (json main field)
m = [x stringByAppendingPathComponent:mainString];
m = [self pathByStandarizingPath:m];
if ([self fileExists:m]) {
packageJSONMainCache[packageJsonPath] = m; // cache from package.json to main value
return m;
ResolvedModule *resolved = [self tryFileOrDirectory:m];
if (resolved) {
packageJSONMainCache[packageJsonPath] = resolved->path; // cache from package.json to main value
return resolved->path;
}
}
return nil;
Expand Down

0 comments on commit a1b092d

Please sign in to comment.