Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[android] - transition options for layer properties - #8509

Merged
tobrun merged 1 commit into
masterfrom
tvn-transitionoptions-property
Mar 31, 2017
Merged

tobrun merged 1 commit into
masterfrom
tvn-transitionoptions-property

Conversation

@tobrun

@tobrun tobrun commented Mar 23, 2017 •

Copy link
Copy Markdown
Member

Closes #8015

This PR adds TransitionOptions to the Android bindings for Layer Properties that support it

Todo to finish:

  • replace jni::Array<jni::jlong> return type with jni::Object<jni::ObjectTag> jni::Object<TransformOptions>
  • add sample to Test app

cc @zugaldia @ericrwolfe

@tobrun tobrun added Android Mapbox Maps SDK for Android runtime styling labels Mar 23, 2017
@tobrun tobrun added this to the android-v5.1.0 milestone Mar 23, 2017
@tobrun tobrun self-assigned this Mar 23, 2017
@tobrun
tobrun requested a review from ivovandongen March 23, 2017 15:54
@mention-bot

Copy link
Copy Markdown

@tobrun, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh to be potential reviewers.

@tobrun tobrun added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Mar 23, 2017
@tobrun
tobrun force-pushed the tvn-transitionoptions-property branch 2 times, most recently from 7181f73 to 22758cf Compare March 23, 2017 15:56

@ivovandongen ivovandongen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun Looks good. Just some cleaning up to do.


mbgl::style::TransitionOptions options = layer.as<mbgl::style::FillLayer>()->FillLayer::getFillOpacityTransition();
jlong durations[2];
durations[0] = options.duration.value_or(mbgl::Duration::zero()).count();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just return the actual object in a typed manner. Don't think there is a noticeable overhead in creating an object instead of an array and filling it up and then creating the object from that jvm side.

METHOD(&CircleLayer::getCircleStrokeWidthTransition, "nativeGetCircleStrokeWidthTransition"),
METHOD(&CircleLayer::setCircleStrokeWidthTransition, "nativeSetCircleStrokeWidthTransition"),
METHOD(&CircleLayer::getCircleStrokeWidth, "nativeGetCircleStrokeWidth"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT. Could you remove the blank lines?

return jni::Object<jni::ObjectTag>(*converted);
}

jni::Array<jni::jlong> FillLayer::getFillOpacityTransition(jni::JNIEnv& env) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Let's just use the typed object


mbgl::style::TransitionOptions options = layer.as<mbgl::style::FillLayer>()->FillLayer::getFillTranslateTransition();
jlong durations[2];
durations[0] = options.duration.value_or(mbgl::Duration::zero()).count();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the actual unit instead of Duration so it's clear on first glance what we're talking about?

}

void FillLayer::setFillTranslateTransition(jni::JNIEnv& env, jlong duration, jlong delay) {
(void) env;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this line and instead remove the parameter name?

return jni::Object<jni::ObjectTag>(*converted);
}


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant blank lines

@tobrun
tobrun force-pushed the tvn-transitionoptions-property branch 3 times, most recently from 7188b40 to 1a0b019 Compare March 31, 2017 14:01
@tobrun tobrun removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Mar 31, 2017

@ivovandongen ivovandongen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very small nit; one empty line here would be just perfection

@tobrun
tobrun force-pushed the tvn-transitionoptions-property branch from 1a0b019 to ea0fb93 Compare March 31, 2017 14:14
[android] fixup highlevel bindings for transition options

finish integration
@tobrun
tobrun force-pushed the tvn-transitionoptions-property branch from ea0fb93 to 94a7146 Compare March 31, 2017 15:16
@tobrun
tobrun merged commit 939526b into master Mar 31, 2017
@tobrun
tobrun deleted the tvn-transitionoptions-property branch March 31, 2017 15:51
@tobrun tobrun mentioned this pull request May 2, 2017
9 of 12 tasks
@tobrun tobrun mentioned this pull request Jun 9, 2017
12 tasks done
@tobrun tobrun mentioned this pull request Jun 21, 2017
11 tasks done
@tobrun tobrun mentioned this pull request Jun 30, 2017
16 tasks done
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Android Mapbox Maps SDK for Android runtime styling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants