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

Remove Accessors #12310

Merged
merged 23 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ea48771
fix(android)!: remove get/set methods for properties that have normal…
sgtcoolguy Nov 24, 2020
e16c870
fix(android)!: remove auto-generated accessor methods in proxy native…
sgtcoolguy Nov 24, 2020
4dae84b
fix(android)!: remove accessor methods for properties
sgtcoolguy Dec 2, 2020
25e2113
fix(ios): expose Ti.Network.HTTPClient#getAllResponseHeaders()
sgtcoolguy Nov 24, 2020
2d99a46
fix(ios)!: begin ripping out automatic getter/setters for properties
sgtcoolguy Nov 24, 2020
1e9aefd
fix(ios)!: don't expose accessors for properties with Obj-c proxy sub…
sgtcoolguy Dec 1, 2020
6d28bde
docs(api): explicitly document Ti.Network.HTTPClient#getAllResponseHe…
sgtcoolguy Nov 24, 2020
77d9700
docs(api): use remoteBackup property access in place of getter/setter…
sgtcoolguy Nov 24, 2020
dab446b
docs(api): remove bad default values documented for Ti.Platform versi…
sgtcoolguy Dec 2, 2020
c3847b8
test: invert tests for getters/accessors to ensure they don't exist
sgtcoolguy Dec 4, 2020
2487749
test: fix namespace inconsistencies in tests
sgtcoolguy Dec 4, 2020
3a8a92d
test: remove generic getter/setter test
sgtcoolguy Dec 4, 2020
122c74b
feat(android): expose Ti.Media.AudioPlayer.audioSessionId as read-onl…
sgtcoolguy Feb 8, 2021
4e223fe
test: update audioplayer suite for accessor changes
sgtcoolguy Feb 8, 2021
93beac4
test: assign to Intent.flags as property, not using setter
sgtcoolguy Feb 8, 2021
413a29a
docs(api): fix AudioPlayer docs for accessor changes/deprecations/rem…
sgtcoolguy Feb 8, 2021
b0a7a99
fix(android): expose properties for get/set pairs on QuickSettingsSer…
sgtcoolguy Feb 10, 2021
b4e8cec
docs(api): document QuickSettingsService properties
sgtcoolguy Feb 10, 2021
903ee1a
fix(android): remove set methods for width/height/center for Views
sgtcoolguy Feb 10, 2021
b6cfd63
fix(android): add back Ti.Media.Sound.setLooping for now
sgtcoolguy Feb 10, 2021
b63364c
docs(api): mark Ti.Media.Sound.setLooping and setPaused as deprecated
sgtcoolguy Feb 10, 2021
f0f5a50
docs(api): note Ti.Network.HTTPClient.getAllResponseHeaders() is on A…
sgtcoolguy Feb 10, 2021
b256dce
fix(android): remove getters for documented properties on RecurrenceRule
sgtcoolguy Feb 10, 2021
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
Expand Up @@ -232,12 +232,6 @@ Local<FunctionTemplate> ${className}::getProxyTemplate(v8::Isolate* isolate)
titanium::Proxy::getProperty,
titanium::Proxy::onPropertyChanged);
</#if>
<#if !methods?? || !methods?keys?seq_contains(getter)>
DEFINE_PROTOTYPE_METHOD_DATA(isolate, t, "${getter}", titanium::Proxy::getProperty, ${name});
</#if>
<#if !methods?? || !methods?keys?seq_contains(setter)>
DEFINE_PROTOTYPE_METHOD_DATA(isolate, t, "${setter}", titanium::Proxy::onPropertyChanged, ${name});
</#if>
</@Proxy.listPropertyAccessors>

<#if interceptor??>
Expand Down Expand Up @@ -276,22 +270,14 @@ void ${className}::${method.apiName}(const FunctionCallbackInfo<Value>& args)
jvalue* jArguments = 0;
</#if>

<#if method.args?size == 0 && name[0..2] == "get" && isDynamic>
<#if method.args?size == 0 && name[0..2] == "get" && isDynamic && !isTitaniumSdk>
<#assign propertyName = name[3]?lower_case + name[4..]>
const char *deprecationMessage = "Getter method deprecated, please use \"obj.${propertyName};\" or \"obj['${propertyName}'];\" instead.";
<#if isTitaniumSdk>
Proxy::logDeprecation(isolate, deprecationMessage);
<#else>
LOGW(TAG, deprecationMessage);
</#if>
<#elseif method.args?size == 1 && name[0..2] == "set" && isDynamic>
<#elseif method.args?size == 1 && name[0..2] == "set" && isDynamic && !isTitaniumSdk>
<#assign propertyName = name[3]?lower_case + name[4..]>
const char *deprecationMessage = "Setter method deprecated, please use \"obj.${propertyName} = val;\" or \"obj['${propertyName}'] = val;\" instead.";
<#if isTitaniumSdk>
Proxy::logDeprecation(isolate, deprecationMessage);
<#else>
LOGW(TAG, deprecationMessage);
</#if>
</#if>

jobject javaProxy = proxy->getJavaObject();
Expand Down
Expand Up @@ -48,14 +48,12 @@ public AnalyticsModule()
super();
}

@Kroll.method
@Kroll.getProperty
public boolean getOptedOut()
{
return APSAnalytics.getInstance().isOptedOut();
}

@Kroll.method
@Kroll.setProperty
public void setOptedOut(boolean optedOut)
{
Expand Down Expand Up @@ -194,7 +192,6 @@ public static int validateJSON(JSONObject jsonObject, int level)
return SUCCESS;
}

@Kroll.method
@Kroll.getProperty
public String getLastEvent()
{
Expand Down
Expand Up @@ -611,7 +611,6 @@ public RProxy getR()
return r;
}

@Kroll.method
@Kroll.getProperty
public ActivityProxy getCurrentActivity()
{
Expand All @@ -622,7 +621,6 @@ public ActivityProxy getCurrentActivity()
return null;
}

@Kroll.method
@Kroll.getProperty
public ActivityProxy getRootActivity()
{
Expand Down
Expand Up @@ -46,14 +46,12 @@ public void handleCreationDict(KrollDict dict)
}
}

@Kroll.method
@Kroll.setProperty
public void setUrl(String url)
{
receiver.setUrl(url);
}

@Kroll.method
@Kroll.setProperty
public void setOnReceived(Object callback)
{
Expand Down
Expand Up @@ -27,35 +27,30 @@ public class EnvironmentModule extends KrollModule
@Kroll.constant
public static final String MEDIA_UNMOUNTED = Environment.MEDIA_UNMOUNTED;

@Kroll.method
@Kroll.getProperty
public String getDataDirectory()
{
return Environment.getDataDirectory().getAbsolutePath();
}

@Kroll.method
@Kroll.getProperty
public String getDownloadCacheDirectory()
{
return Environment.getDownloadCacheDirectory().getAbsolutePath();
}

@Kroll.method
@Kroll.getProperty
public String getExternalStorageDirectory()
{
return Environment.getExternalStorageDirectory().getAbsolutePath();
}

@Kroll.method
@Kroll.getProperty
public String getExternalStorageState()
{
return Environment.getExternalStorageState();
}

@Kroll.method
@Kroll.getProperty
public String getRootDirectory()
{
Expand Down
Expand Up @@ -58,7 +58,6 @@ public void handleCreationDict(KrollDict d)
}
}

@Kroll.method
@Kroll.setProperty
public void setBigLargeIcon(Object icon)
{
Expand All @@ -81,7 +80,6 @@ public void setBigLargeIcon(Object icon)
setProperty(TiC.PROPERTY_BIG_LARGE_ICON, icon);
}

@Kroll.method
@Kroll.setProperty
public void setBigPicture(Object picture)
{
Expand All @@ -98,15 +96,13 @@ public void setBigPicture(Object picture)
setProperty(TiC.PROPERTY_BIG_PICTURE, picture);
}

@Kroll.method
@Kroll.setProperty
public void setBigContentTitle(String title)
{
((BigPictureStyle) style).setBigContentTitle(title);
setProperty(TiC.PROPERTY_BIG_CONTENT_TITLE, title);
}

@Kroll.method
@Kroll.setProperty
public void setSummaryText(String text)
{
Expand Down
Expand Up @@ -46,23 +46,20 @@ public void handleCreationDict(KrollDict d)
}
}

@Kroll.method
@Kroll.setProperty
public void setBigText(String text)
{
((BigTextStyle) style).bigText(text);
setProperty(TiC.PROPERTY_BIG_TEXT, text);
}

@Kroll.method
@Kroll.setProperty
public void setBigContentTitle(String title)
{
((BigTextStyle) style).setBigContentTitle(title);
setProperty(TiC.PROPERTY_BIG_CONTENT_TITLE, title);
}

@Kroll.method
@Kroll.setProperty
public void setSummaryText(String text)
{
Expand Down
Expand Up @@ -76,162 +76,139 @@ public void handleCreationDict(KrollDict d)
}
}

@Kroll.method
@Kroll.getProperty
public String getId()
{
return channel.getId();
}

@Kroll.method
@Kroll.getProperty
public boolean getEnableLights()
{
return channel.shouldShowLights();
}

@Kroll.method
@Kroll.setProperty
public void setEnableLights(boolean lights)
{
channel.enableLights(lights);
}

@Kroll.method
@Kroll.getProperty
public boolean getEnableVibration()
{
return channel.shouldVibrate();
}

@Kroll.method
@Kroll.setProperty
public void setEnableVibration(boolean vibration)
{
channel.enableVibration(vibration);
}

@Kroll.method
@Kroll.getProperty
public boolean getBypassDnd()
{
return channel.canBypassDnd();
}

@Kroll.method
@Kroll.setProperty
public void setBypassDnd(boolean bypassDnd)
{
channel.setBypassDnd(bypassDnd);
}

@Kroll.method
@Kroll.getProperty
public String getDescription()
{
return channel.getDescription();
}

@Kroll.method
@Kroll.setProperty
public void setDescription(String description)
{
channel.setDescription(description);
}

@Kroll.method
@Kroll.getProperty
public String getGroupId()
{
return channel.getGroup();
}

@Kroll.method
@Kroll.setProperty
public void setGroupId(String groupId)
{
channel.setGroup(groupId);
}

@Kroll.method
@Kroll.getProperty
public int getImportance()
{
return channel.getImportance();
}

@Kroll.method
@Kroll.setProperty
public void setImportance(int importance)
{
channel.setImportance(importance);
}

@Kroll.method
@Kroll.getProperty
public int getLightColor()
{
return channel.getLightColor();
}

@Kroll.method
@Kroll.setProperty
public void setLightColor(int argb)
{
channel.setLightColor(argb);
}

@Kroll.method
@Kroll.getProperty
public int getLockscreenVisibility()
{
return channel.getLockscreenVisibility();
}

@Kroll.method
@Kroll.setProperty
public void setLockscreenVisibility(int lockscreenVisibility)
{
channel.setLockscreenVisibility(lockscreenVisibility);
}

@Kroll.method
@Kroll.getProperty
public String getName()
{
return channel.getName().toString();
}

@Kroll.method
@Kroll.setProperty
public void setName(String name)
{
channel.setName(name);
}

@Kroll.method
@Kroll.getProperty
public boolean getShowBadge()
{
return channel.canShowBadge();
}

@Kroll.method
@Kroll.setProperty
public void setShowBadge(boolean showBadge)
{
channel.setShowBadge(showBadge);
}

@Kroll.method
@Kroll.getProperty
public String getSound()
{
Uri uri = channel.getSound();
return (uri != null) ? uri.toString() : null;
}

@Kroll.method
@Kroll.setProperty
public void setSound(String path)
{
Expand All @@ -241,7 +218,6 @@ public void setSound(String path)
channel.setSound(Uri.parse(resolveUrl(null, path)), attributesBuilder.build());
}

@Kroll.method
@Kroll.getProperty
public Object getVibrationPattern()
{
Expand All @@ -253,7 +229,6 @@ public Object getVibrationPattern()
return patternArray;
}

@Kroll.method
@Kroll.setProperty
public void setVibrationPattern(Object patternObj)
{
Expand Down