Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Implement MotionRuntime.interactions() API #75

Merged
merged 1 commit into from
Apr 24, 2017
Merged

Implement MotionRuntime.interactions() API #75

merged 1 commit into from
Apr 24, 2017

Conversation

randcode-generator
Copy link
Contributor

Summary: Fetches interactions asociated with a givent target.

Fixes #74

Tags: #material_motion

@pingpongboss
Copy link
Contributor

New runtime.interactions(view, Draggable.class) API as discussed in Discord.

@codecov
Copy link

codecov bot commented Apr 24, 2017

Codecov Report

❗ No coverage uploaded for pull request base (develop@bddba29). Click here to learn what that means.
The diff coverage is 7.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop      #75   +/-   ##
==========================================
  Coverage           ?   25.46%           
==========================================
  Files              ?       70           
  Lines              ?      962           
  Branches           ?       65           
==========================================
  Hits               ?      245           
  Misses             ?      714           
  Partials           ?        3
Impacted Files Coverage Δ
.../google/android/material/motion/MotionRuntime.java 48.38% <7.69%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bddba29...b1c8399. Read the comment docs.

Copy link
Contributor

@pingpongboss pingpongboss left a comment

Choose a reason for hiding this comment

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

Nice.

@@ -31,6 +32,7 @@

private final List<Subscription> subscriptions = new ArrayList<>();
private final SimpleArrayMap<View, ReactiveView> cachedReactiveViews = new SimpleArrayMap<>();
private final SimpleArrayMap<Object, ArrayList<Interaction>> cachedInteractions = new SimpleArrayMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Use List<Interaction for all definitions instead of ArrayList<Interaction>

@@ -62,6 +64,13 @@ public void next(T value) {
public final <O, T> void addInteraction(
Interaction<O, T> interaction, O target, ConstraintApplicator<T> constraints) {
interaction.apply(this, target, constraints);
ArrayList<Interaction> interactions = cachedInteractions.get(target);
Copy link
Contributor

Choose a reason for hiding this comment

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

List

@@ -39,4 +39,7 @@ dependencies {
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:recyclerview-v7:$supportLibVersion"
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.5'
testCompile 'com.google.truth:truth:0.28'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.1.2'
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove these too?

Summary: Fetches interactions associated with a given target.

Fixes #74

Tags: #material_motion
@pingpongboss pingpongboss merged commit f5cf97a into material-motion:develop Apr 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants