GithubHelp home page GithubHelp logo

commit451 / morphtransitions Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 3.0 137 KB

Morph transitions from buttons to dialogs and back

License: Apache License 2.0

Java 100.00%
android morph-transitions plaid

morphtransitions's Introduction

MorphTransitions

Morph transitions from FAB to dialog, and Button to dialog

Inspired by Plaid

Build Status

Usage

See the sample app. Typical usage:

MorphTransform.addExtras(intent, color, dialogCornerRadius);
ActivityOptions options =
        ActivityOptions.makeSceneTransitionAnimation(MainActivity.this, button,
                getString(R.string.morph_transition));
startActivity(intent, options.toBundle());

in the first activity, then:

MorphTransform.setup(this, container, color, dialogCornerRadius));

in the next activity. Be sure that you override onBackPressed() and call ActivityCompat.finishAfterTransition(DialogActivity.this);

In addition, be sure that your activities themes have the attribute:

<item name="android:windowContentTransitions">true</item>

License

Copyright 2015 Google, Inc
Copyright 2016 Commit 451

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

morphtransitions's People

Contributors

jawnnypoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

morphtransitions's Issues

change morph drawable shape

Hello. I have been trying this demo and i made a little adjustments, but i cant figure it out something.
I realised the morph Fab to Dialog shape is build depending of the dialog width/height ratio. for instance, if the dialog is a rectangle, the morphing fab will transform from a circle to a rectangle. but if the dialog is more like a square, the fab morphing will be from a circle to a circle. I want to achieve a 'rectangular' morph even with a square dialog shape. Can you give me a hint?

AnimUtils is package-private

Hi, the AnimUtils class has no access modifier (this is only available to this package), but in Plaid it's public and I need access to the TransitionListenerAdapter (that is what it is for, public usage).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.