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

Make select/deselect animation more flexible on MarkerView #5171

Closed

Description

@tobrun

Currently MarkerView exposes select/deselect animations as follows:

public void setSelectAnimRes(int selectAnimRes) {
        this.selectAnimRes = selectAnimRes;
}

public void setDeselectAnimRes(int deselectAnimRes) {
    this.deselectAnimRes = deselectAnimRes;
}

This limits end users to only providing animations through an animator created in xml.
To be more flexible I'm proposing to provide a callback interface instead and manage a selected state inside of MarkerView. This callback will provide the developer with an instance of the View and this gives the developer more flexibility to do animations (or even do non animations things as for example hiding the MarkerView).

Side notes:

  • View reuse could be affected by this. It's possible that we need to look into the same prepareForReuse callback as iOS.
  • There are other issues related to selection state that should be solved to completely get a correct select/deselect user experience. Will look into identifying and linking them back.

Activity

  1. added
    Android
    annotations
    on May 27, 2016
  2. added this to the android-v4.1.0 milestone on Jun 2, 2016
  3. tobrun commented on Jun 3, 2016

    @tobrun
    MemberAuthor

    In general when it comes to animations, I envisioned 4 primary use-cases:

    • on enter screen animation
    • on select marker animation
    • on deselect marker animation
    • on remove screen animation ( = prepareForReuse)

    The enter animation can be configured when calling an animation in the getView of the ViewMarkerAdapter since this will be called when you pan the viewport to an marker. For removing I'm considering adding a non-required removeView. This method is responsible of resetting the state back to it's normal state.

    For the select/deselect animation, I'm thinking of adding callback interfaces and provide the user with the View object to animate.

    Note: that users can even provide additional animation on top of these 4 cases, as long as they properly reset the View state when the View is being removed.

  4. tobrun commented on Jun 3, 2016

    @tobrun
    MemberAuthor

    Instead of calling this removeView, I'm going to call the method prepareViewForReuse. Since we aren't actually removing the View were are adding this to a pool of Views to be reused.

  5. tobrun commented on Jun 6, 2016

    @tobrun
    MemberAuthor

    merged in #5227 onto release-v4.1.0 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidannotations

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions