Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ios, android): remove deprecated APIs #11386

Merged
merged 26 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d130d2d
refactor(android): remove deprecated Ti.Android.Activity events
sgtcoolguy Dec 4, 2019
44ce1a2
docs: mark Ti.Android.Activity events around lifecycle removed in 9.0.0
sgtcoolguy Dec 4, 2019
3194c9e
docs: define types for Ti.Android.Activity callback arguments
sgtcoolguy Dec 4, 2019
7e22f82
fix(ios): remove deprecated tabgroup unselected/selected events
sgtcoolguy Dec 9, 2019
9364767
docs: mark Ti.UI.TabGroup selected/unselected events as removed in 9.0.0
sgtcoolguy Dec 9, 2019
83df44f
fix(ios): remove deprecated tab blur/focus events
sgtcoolguy Dec 9, 2019
2aa58aa
docs: mark Ti.UI.Tab blur/focus events as removed in 9.0.0
sgtcoolguy Dec 9, 2019
5c37869
fix(ios): remove deprecated contacts methods
sgtcoolguy Dec 9, 2019
1ca4099
docs: mark Ti.Contacts getGroup/PersonByID methods as removed in 9.0.0
sgtcoolguy Dec 9, 2019
9a2c30e
fix(android): remove deprecated contacts methods
sgtcoolguy Dec 9, 2019
0cd90e4
fix(ios): remove references to Ti.Contacts methods that are removed
sgtcoolguy Dec 9, 2019
f51b7ec
fix(android): remove deprecated contacts methods
sgtcoolguy Dec 9, 2019
bb59cfa
fix(ios): remove deprecated contacts methods
sgtcoolguy Dec 9, 2019
08da77e
docs: mark Ti.Contacts requestAuthorization method as removed in 9.0.0
sgtcoolguy Dec 9, 2019
10b95f9
docs: mark Ti.Calendar requestEventsAuthorization removed in 8.1.0
sgtcoolguy Dec 9, 2019
3bed8d4
docs: mark Ti.Calendar eventsAuthorization removed in 8.1.0
sgtcoolguy Dec 9, 2019
6d2e437
fix(ios): remove deprecated Ti.Media methods
sgtcoolguy Dec 9, 2019
f1fd8c8
docs: mark deprecated Ti.Media methods removed in 9.0.0
sgtcoolguy Dec 9, 2019
41ccdaf
fix(ios): remove deprecated Ti.Media methods
sgtcoolguy Dec 9, 2019
234995d
docs: mark deprecated Ti.Media methods removed in 9.0.0
sgtcoolguy Dec 9, 2019
dfd883f
docs: mark legacy CardView properties removed in 6.0.0
sgtcoolguy Dec 9, 2019
31f6eb6
fix(ios): remove deprecated UI appearance properties
sgtcoolguy Dec 10, 2019
60963de
docs: mark TextField/Area appearance property removed in 9.0.0
sgtcoolguy Dec 10, 2019
074f0b0
fix(ios): remove deprecated TextField padding properties
sgtcoolguy Dec 10, 2019
5342346
docs: mark TextField paddingRight/Left properties removed in 9.0.0
sgtcoolguy Dec 10, 2019
b681b34
docs: mark Ti.Gesture isPortrait/Landscape removed in 7.0.0
sgtcoolguy Dec 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3639,11 +3639,9 @@ AndroidBuilder.prototype.generateAndroidManifest = function generateAndroidManif
'Contacts.getAllContacts': contactsReadPermissions,
'Contacts.showContactPicker': contactsReadPermissions,
'Contacts.showContacts': contactsReadPermissions,
'Contacts.getPersonByID': contactsReadPermissions,
'Contacts.getPeopleWithName': contactsReadPermissions,
'Contacts.getAllPeople': contactsReadPermissions,
'Contacts.getAllGroups': contactsReadPermissions,
'Contacts.getGroupByID': contactsReadPermissions,

'Media.Android.setSystemWallpaper': wallpaperPermissions,
'Media.showCamera': cameraPermissions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,6 @@ public void save(Object people)
contactsApi.save(people);
}

@Kroll.method
public PersonProxy getPersonByID(long id)
{
Log.w(
TAG,
"Ti.Contacts.getPersonByID() has been deprecated in favor of Ti.Contacts.getPersonByIdentifier() for cross-platform parity",
Log.DEBUG_MODE);
return contactsApi.getPersonById(id);
}

@Kroll.method
public PersonProxy getPersonByIdentifier(long id)
{
Expand All @@ -156,14 +146,6 @@ public void removePerson(PersonProxy person)
contactsApi.removePerson(person);
}

@Kroll.method
public void requestAuthorization(KrollFunction function)
{
KrollDict dict = new KrollDict();
dict.putCodeAndMessage(TiC.ERROR_CODE_NO_ERROR, null);
function.callAsync(getKrollObject(), dict);
}

@Kroll.method
public void showContacts(@Kroll.argument(optional = true) KrollDict d)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,6 @@ public void onChanged(TiActivitySafeAreaMonitor monitor)
}
if (activityProxy != null) {
dispatchCallback(TiC.PROPERTY_ON_CREATE, null);
activityProxy.fireEvent(TiC.EVENT_CREATE, null);
}
synchronized (lifecycleListeners.synchronizedList())
{
Expand Down Expand Up @@ -1303,10 +1302,6 @@ protected void onPause()
releaseDialogs(false);
}

if (activityProxy != null) {
activityProxy.fireEvent(TiC.EVENT_PAUSE, null);
}

synchronized (lifecycleListeners.synchronizedList())
{
for (OnLifecycleEvent listener : lifecycleListeners.nonNull()) {
Expand Down Expand Up @@ -1344,10 +1339,6 @@ protected void onResume()
tiApp.setCurrentActivity(this, this);
TiApplication.updateActivityTransitionState(false);

if (activityProxy != null) {
activityProxy.fireEvent(TiC.EVENT_RESUME, null);
}

synchronized (lifecycleListeners.synchronizedList())
{
for (OnLifecycleEvent listener : lifecycleListeners.nonNull()) {
Expand Down Expand Up @@ -1386,20 +1377,6 @@ protected void onStart()

updateTitle();

if (activityProxy != null) {
// we only want to set the current activity for good in the resume state but we need it right now.
// save off the existing current activity, set ourselves to be the new current activity temporarily
// so we don't run into problems when we give the proxy the event
TiApplication tiApp = getTiApp();
Activity tempCurrentActivity = tiApp.getCurrentActivity();
tiApp.setCurrentActivity(this, this);

activityProxy.fireEvent(TiC.EVENT_START, null);

// set the current activity back to what it was originally
tiApp.setCurrentActivity(this, tempCurrentActivity);
}

synchronized (lifecycleListeners.synchronizedList())
{
for (OnLifecycleEvent listener : lifecycleListeners.nonNull()) {
Expand All @@ -1426,10 +1403,6 @@ protected void onStop()

Log.d(TAG, "Activity " + this + " onStop", Log.DEBUG_MODE);

if (activityProxy != null) {
activityProxy.fireEvent(TiC.EVENT_STOP, null);
}

synchronized (lifecycleListeners.synchronizedList())
{
for (OnLifecycleEvent listener : lifecycleListeners.nonNull()) {
Expand All @@ -1455,20 +1428,6 @@ protected void onRestart()
super.onRestart();

Log.d(TAG, "Activity " + this + " onRestart", Log.DEBUG_MODE);

if (activityProxy != null) {
// we only want to set the current activity for good in the resume state but we need it right now.
// save off the existing current activity, set ourselves to be the new current activity temporarily
// so we don't run into problems when we give the proxy the event
TiApplication tiApp = getTiApp();
Activity tempCurrentActivity = tiApp.getCurrentActivity();
tiApp.setCurrentActivity(this, this);

activityProxy.fireEvent(TiC.EVENT_RESTART, null);

// set the current activity back to what it was originally
tiApp.setCurrentActivity(this, tempCurrentActivity);
}
}

@Override
Expand Down Expand Up @@ -1644,9 +1603,6 @@ protected void onRestoreInstanceState(Bundle savedInstanceState)
protected void fireOnDestroy()
{
if (!onDestroyFired) {
if (activityProxy != null) {
activityProxy.fireEvent(TiC.EVENT_DESTROY, null);
}
onDestroyFired = true;
}
}
Expand Down
10 changes: 0 additions & 10 deletions android/titanium/src/java/org/appcelerator/titanium/TiC.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ public class TiC
*/
public static final String EVENT_COMPLETE = "complete";

/**
* @module.api
*/
public static final String EVENT_CREATE = "create";

/**
* @module.api
*/
Expand Down Expand Up @@ -544,11 +539,6 @@ public class TiC
*/
public static final String EVENT_REGION_CHANGED = "regionchanged";

/**
* @module.api
*/
public static final String EVENT_RESTART = "restart";

/**
* @module.api
*/
Expand Down
59 changes: 49 additions & 10 deletions apidoc/Titanium/Android/Activity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ events:
summary: Fired from the activity's `onCreate` method.
deprecated:
since: "3.4.0"
removed: "9.0.0"
notes: Use [Titanium.Android.Activity.onCreate](Titanium.Android.Activity.onCreate) instead.
description: |
See also:
Expand All @@ -253,6 +254,7 @@ events:
summary: Fired from the activity's `onDestroy` method.
deprecated:
since: "3.4.0"
removed: "9.0.0"
notes: Use [Titanium.Android.Activity.onDestroy](Titanium.Android.Activity.onDestroy) instead.
description: |
See also: [onDestroy](https://developer.android.com/reference/android/app/Activity.html#onDestroy())
Expand Down Expand Up @@ -287,16 +289,28 @@ events:
summary: Fired when the activity is paused.
deprecated:
since: "3.4.0"
removed: "9.0.0"
notes: Use [Titanium.Android.Activity.onPause](Titanium.Android.Activity.onPause) instead.
description: |
See also:
[onPause](https://developer.android.com/reference/android/app/Activity.html#onPause())
in the Android Developer Reference.

- name: restart
summary: Fired when the activity is restarted.
deprecated:
since: "3.4.0"
removed: "9.0.0"
notes: Use [Titanium.Android.Activity.onRestart](Titanium.Android.Activity.onRestart) instead.
description: |
See also: [onRestart](https://developer.android.com/reference/android/app/Activity.html#onRestart())
in the Android Developer Reference.

- name: resume
summary: Fired when the activity is resumed.
deprecated:
since: "3.4.0"
removed: "9.0.0"
notes: Use [Titanium.Android.Activity.onResume](Titanium.Android.Activity.onResume) instead.
description: |
See also: [onResume](https://developer.android.com/reference/android/app/Activity.html#onResume())
Expand All @@ -306,6 +320,7 @@ events:
summary: Fired when the activity is started.
deprecated:
since: "3.4.0"
removed: "9.0.0"
notes: Use [Titanium.Android.Activity.onStart](Titanium.Android.Activity.onStart) instead.
description: |
See also: [onStart](https://developer.android.com/reference/android/app/Activity.html#onStart())
Expand All @@ -315,6 +330,7 @@ events:
summary: Fired when the activity is stopped.
deprecated:
since: "3.4.0"
removed: "9.0.0"
notes: Use [Titanium.Android.Activity.onStop](Titanium.Android.Activity.onStop) instead.
description: |
See also: [onStop](https://developer.android.com/reference/android/app/Activity.html#onStop())
Expand Down Expand Up @@ -370,7 +386,7 @@ properties:
summary: |
Callback function called when the Android activity is created.
since: "3.4.0"
type: Callback<Object>
type: Callback<ActivityLifecycleCallbackObject>

- name: onCreateOptionsMenu
summary: |
Expand All @@ -382,19 +398,19 @@ properties:
See also:
[Creating an Options Menu](https://developer.android.com/guide/topics/ui/menus.html#options-menu)
in the Android Developer's Guide.
type: Callback<Object>
type: Callback<OptionsMenuCallbackObject>

- name: onDestroy
summary: |
Callback function called when the Android activity is destroyed.
since: "3.4.0"
type: Callback<Object>
type: Callback<ActivityLifecycleCallbackObject>

- name: onPause
summary: |
Callback function called when the Android activity is paused.
since: "3.4.0"
type: Callback<Object>
type: Callback<ActivityLifecycleCallbackObject>

- name: onPrepareOptionsMenu
summary: |
Expand All @@ -406,31 +422,31 @@ properties:
See also:
[Creating an Options Menu](https://developer.android.com/guide/topics/ui/menus.html#options-menu)
in the Android Developer's Guide.
type: Callback<Object>
type: Callback<OptionsMenuCallbackObject>

- name: onRestart
summary: |
Callback function called when the Android activity is restarted.
since: "3.4.0"
type: Callback<Object>
type: Callback<ActivityLifecycleCallbackObject>

- name: onResume
summary: |
Callback function called when the Android activity is resumed.
since: "3.4.0"
type: Callback<Object>
type: Callback<ActivityLifecycleCallbackObject>

- name: onStart
summary: |
Callback function called when the Android activity is started.
since: "3.4.0"
type: Callback<Object>
type: Callback<ActivityLifecycleCallbackObject>

- name: onStop
summary: |
Callback function called when the Android activity is stopped.
since: "3.4.0"
type: Callback<Object>
type: Callback<ActivityLifecycleCallbackObject>

- name: requestedOrientation
summary: Specifies a specific orientation for this activity.
Expand All @@ -444,7 +460,7 @@ properties:
This property is used to set a toolbar as an ActionBar prior to the actual activity creation.
After the activity is created that must be done through the [setSupportActionBar()](Titanium.Android.Activity.setSupportActionBar) method.
type: Titanium.UI.Toolbar
since: 6.2.0
since: "6.2.0"

examples:
- title: Callback Example
Expand Down Expand Up @@ -488,3 +504,26 @@ properties:
the intent as "extras").
type: Titanium.Android.Intent

---
name: ActivityLifecycleCallbackObject
summary: |
Simple object passed to the <Titanium.Android.Activity> callbacks for
onCreate, onDestroy, onPause, onResume, onStart, onStop, onRestart.

Additional properties may be set on the Object.
properties:
- name: source
summary: The Activity firing the callback.
type: Titanium.Android.Activity

---
name: OptionsMenuCallbackObject
summary: |
Simple object passed to the <Titanium.Android.Activity> callbacks for
onPrepareOptionsMenu and onCreateOptionsMenu.

Additional properties may be set on the Object.
properties:
- name: menu
summary: The relevant Menu.
type: Titanium.Android.Menu
10 changes: 6 additions & 4 deletions apidoc/Titanium/Calendar/Calendar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ methods:
- name: requestEventsAuthorization
deprecated:
since: "5.1.0"
removed: "8.1.0"
notes: Use [Titanium.Calendar.requestCalendarPermissions](Titanium.Calendar.requestCalendarPermissions) instead.
summary: If authorization is unknown, the system will bring up a dialog requesting permission.
description: |
Expand Down Expand Up @@ -327,7 +328,7 @@ properties:

- name: AUTHORIZATION_AUTHORIZED
summary: |
An [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value
An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
indicating that the application is authorized to use events in the Calendar.
description: |
This value is always returned if the device is running an iOS release prior to 6.0.
Expand All @@ -337,15 +338,15 @@ properties:

- name: AUTHORIZATION_DENIED
summary: |
An [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value
An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
indicating that the application is not authorized to use events in the Calendar.
type: Number
permission: read-only
platforms: [iphone, ipad]

- name: AUTHORIZATION_RESTRICTED
summary: |
An [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value
An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
indicating that the application is not authorized to use events in the Calendar.
the user cannot change this application's status.
type: Number
Expand All @@ -354,7 +355,7 @@ properties:

- name: AUTHORIZATION_UNKNOWN
summary: |
An [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value
An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
indicating that the authorization state is unknown.
type: Number
permission: read-only
Expand Down Expand Up @@ -729,6 +730,7 @@ properties:
Always returns `AUTHORIZATION_AUTHORIZED` on iOS pre-6.0.
deprecated:
since: "5.2.0"
removed: "8.1.0"
notes: Use [Titanium.Calendar.calendarAuthorization](Titanium.Calendar.calendarAuthorization) instead.
type: Number
constants: Titanium.Calendar.AUTHORIZATION_*
Expand Down