Skip to content

Commit

Permalink
Merge branch '8_3_X' into TIMOB-27104-8_3_X
Browse files Browse the repository at this point in the history
  • Loading branch information
garymathews committed Aug 20, 2019
2 parents 2c8f970 + 19403ec commit 6a4d0f8
Show file tree
Hide file tree
Showing 45 changed files with 393 additions and 546 deletions.
17 changes: 14 additions & 3 deletions android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

687 changes: 223 additions & 464 deletions android/.idea/workspace.xml

Large diffs are not rendered by default.

33 changes: 30 additions & 3 deletions android/cli/lib/AndroidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,39 @@ function AndroidManifest(filename) {
case 'uses-feature':
this[tag] || (this[tag] = []);
src[tag].forEach(function (tagItem) {
// Check for already added features.
let duplicateItem = this[tag].find(function (nextItem) {
// If given "uses-feature" name has already been added, then fetch its object.
const duplicateItem = this[tag].find(function (nextItem) {
// Compare them directly or by name.
return (nextItem === tagItem) || (nextItem.name === tagItem.name);
});
if (!duplicateItem) {
if (duplicateItem === tagItem) {
// Given reference was already added. Do nothing.
} else if (duplicateItem) {
// This is a duplicate "uses-feature" element name. Merge its settings.
if (typeof tagItem['tools:replace'] === 'string') {
// This attribute provides an array of other attributes that must be replaced.
tagItem['tools:replace'].split(',').forEach(function (attributeName) {
attributeName = attributeName.replace(androidAttrPrefixRegExp, '');
if (attributeName !== 'name') {
const value = tagItem[attributeName];
if (typeof value === 'undefined') {
delete duplicateItem[attributeName];
} else {
duplicateItem[attributeName] = value;
}
}
});
} else if (duplicateItem.required === false) {
// Do a logical OR on the "required" attribute value.
// If the "required" attribute is not defined, then it is considered true.
if (typeof tagItem.required === 'undefined') {
delete duplicateItem.required;
} else if (tagItem.required) {
duplicateItem.required = tagItem.required;
}
}
} else {
// The given "uses-feature" name has not been added yet. Do so now.
this[tag].push(tagItem);
}
}, this);
Expand Down
2 changes: 1 addition & 1 deletion android/dev/TitaniumTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.titanium.test" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28"/>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29"/>
<application android:icon="@drawable/appicon" android:label="TitaniumTest" android:name=".TitaniumTestApplication" android:theme="@style/Theme.AppCompat">
<activity android:name=".TitaniumTestActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion android/dev/TitaniumTest/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-28
target=android-29
android.library.reference.1=../../titanium
android.library.reference.2=../../modules/accelerometer
android.library.reference.3=../../modules/analytics
Expand Down
2 changes: 1 addition & 1 deletion android/modules/accelerometer/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/analytics/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />

<application android:label="@string/app_name">
</application>
Expand Down
2 changes: 1 addition & 1 deletion android/modules/android/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../filesystem
Expand Down
2 changes: 1 addition & 1 deletion android/modules/app/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/appcompat/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-28
target=android-29
android.library=true
2 changes: 1 addition & 1 deletion android/modules/calendar/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/cardview/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-28
target=android-29
android.library=true
2 changes: 1 addition & 1 deletion android/modules/compat/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-28
target=android-29
android.library=true
2 changes: 1 addition & 1 deletion android/modules/contacts/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/database/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/design/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-28
target=android-29
android.library=true
2 changes: 1 addition & 1 deletion android/modules/filesystem/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/geolocation/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/gesture/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/locale/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/media/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.3=../filesystem
android.library.reference.2=../../titanium
Expand Down
2 changes: 1 addition & 1 deletion android/modules/network/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.3=../xml
android.library.reference.2=../../titanium
Expand Down
2 changes: 1 addition & 1 deletion android/modules/platform/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../../kroll-apt
2 changes: 1 addition & 1 deletion android/modules/ui/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />

<application android:label="@string/app_name">
</application>
Expand Down
2 changes: 1 addition & 1 deletion android/modules/ui/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

android.library=true
# Project target.
target=android-28
target=android-29
android.library.reference.1=../../runtime/common
android.library.reference.2=../../titanium
android.library.reference.3=../filesystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.appcelerator.titanium.TiBaseActivity;
import org.appcelerator.titanium.TiBlob;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.TiRootActivity;
import org.appcelerator.titanium.proxy.TiWindowProxy;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiUIHelper;
Expand Down Expand Up @@ -388,6 +389,11 @@ protected void handleOpen(KrollDict options)
topActivity.overridePendingTransition(enterAnimation, exitAnimation);
} else {
topActivity.startActivity(intent);
if (topActivity instanceof TiRootActivity) {
// A fade-in transition from root splash screen to first window looks better than a slide-up.
// Also works-around issue where splash in mid-transition might do a 2nd transition on cold start.
topActivity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.appcelerator.titanium.TiBaseActivity;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.TiDimension;
import org.appcelerator.titanium.TiRootActivity;
import org.appcelerator.titanium.TiTranslucentActivity;
import org.appcelerator.titanium.proxy.ActivityProxy;
import org.appcelerator.titanium.proxy.TiWindowProxy;
Expand Down Expand Up @@ -56,6 +57,7 @@
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;

// clang-format off
@Kroll.proxy(creatableInModule = UIModule.class,
propertyAccessors = {
Expand Down Expand Up @@ -168,6 +170,11 @@ protected void handleOpen(KrollDict options)
topActivity.startActivity(intent, createActivityOptionsBundle(topActivity));
} else {
topActivity.startActivity(intent);
if (topActivity instanceof TiRootActivity) {
// A fade-in transition from root splash screen to first window looks better than a slide-up.
// Also works-around issue where splash in mid-transition might do a 2nd transition on cold start.
topActivity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
}

if (options.containsKey(TiC.PROPERTY_SUSTAINED_PERFORMANCE_MODE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ClickHandler(int id)
}
public void onClick(DialogInterface dialog, int which)
{
handleEvent(result);
handleEvent(result, true);
hide(null);
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ private void processOptions(String[] optionText, int selectedIndex)
@Override
public void onClick(DialogInterface dialog, int which)
{
handleEvent(which);
handleEvent(which, true);
hide(null);
}
});
Expand All @@ -143,7 +143,7 @@ public void onClick(DialogInterface dialog, int which)
@Override
public void onClick(DialogInterface dialog, int which)
{
handleEvent(which);
handleEvent(which, false);
hide(null);
}
});
Expand Down Expand Up @@ -322,7 +322,8 @@ public void onCancel(DialogInterface dlg)
? TiConvert.toInt(proxy.getProperty(TiC.PROPERTY_CANCEL))
: -1;
Log.d(TAG, "onCancelListener called. Sending index: " + cancelIndex, Log.DEBUG_MODE);
handleEvent(cancelIndex);
// In case wew cancel the Dialog we should not overwrite the selectedIndex
handleEvent(cancelIndex, false);
hide(null);
}
});
Expand All @@ -347,7 +348,7 @@ public void onCancel(DialogInterface dlg)
}

dialogWrapper.setDialog(dialog);
builder = null;
this.builder = null;
}

try {
Expand Down Expand Up @@ -438,7 +439,7 @@ private void createBuilder()
}
}

public void handleEvent(int id)
public void handleEvent(int id, boolean saveSelectedIndex)
{
int cancelIndex =
(proxy.hasProperty(TiC.PROPERTY_CANCEL)) ? TiConvert.toInt(proxy.getProperty(TiC.PROPERTY_CANCEL)) : -1;
Expand All @@ -452,8 +453,8 @@ public void handleEvent(int id)
id &= ~BUTTON_MASK;
} else {
data.put(TiC.PROPERTY_BUTTON, false);
// If an option was selected and the user accepted it, update the proxy.
if (proxy.hasProperty(TiC.PROPERTY_OPTIONS)) {
// If an option was selected, the user accepted and we are showing radio buttons, update the proxy.
if (proxy.hasProperty(TiC.PROPERTY_OPTIONS) && saveSelectedIndex) {
proxy.setProperty(TiC.PROPERTY_SELECTED_INDEX, id);
}
}
Expand Down

0 comments on commit 6a4d0f8

Please sign in to comment.