Neat library, that provides a simple way to implement guillotine-styled animation
Check this [project on Dribbble] (https://dribbble.com/shots/2018249-Guillotine-Menu)
Also, read how it was done in [our blog] (https://yalantis.com/blog/how-we-developed-the-guillotine-menu-animation-for-android/?utm_source=github)
For a working implementation, have a look at the app module
Add JitPack repository in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add the dependency to your app build.gradle
dependencies {
compile 'com.github.Yalantis:GuillotineMenu-Android:1.2'
}
You need to create a layout for the navigation menu (guillotine.xml
in sample app), which will later open and close guillotine-style. The only tricky part here is that the navigation layout should be on top of any other content and will disappear after closing animation ends. That is why content layout (activity.xml
in sample app) should also have hamburger icon at the same coordinates as navigation menu has.
After that all you need to do is to build animation by passing navigation layout object, navigation and content layout hamburger objects to GuillotineAnimation.GuillotineBuilder
in your onCreate
method
new GuillotineAnimation.GuillotineBuilder(guillotineMenu, guillotineMenu.findViewById(R.id.guillotine_hamburger), contentHamburger)
.setActionBarViewForAnimation(toolbar)
.build();
Here setActionBarViewForAnimation
method enables bounce effect of Toolbar at the end of the guillotine closing animation.
Builder allows you to customize start delay, duration, interpolation and you can set listener if you want to do staff at the moment when menu has been opened or closed.
We’d be really happy if you sent us links to your projects where you use our component. Just send an email to github@yalantis.com And do let us know if you have any questions or suggestion regarding the animation.
P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for Android (iOS) better than better. Stay tuned!
Copyright 2017, Yalantis
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.
GuillotineMenu 是一个简单的菜单切换动画,它用 Swift 实现。
问题内容: 我正在尝试从一个发送客户类的对象,Activity然后在另一个对象中显示它Activity。 客户类的代码: 我想将其对象从一个对象发送Activity到另一个对象,然后在另一个对象上显示数据Activity。 我该如何实现? 问题答案: 一种选择是让你的自定义类实现该接口,然后可以使用该方法的变体在意图中额外传递对象实例。 伪代码:
问题内容: 我很难找到最简单的方法来针对给定的JSON模式字符串验证JSON字符串(作为参考,这是在Java中运行在Android应用程序中)。 理想情况下,我只想传入JSON字符串和JSON模式字符串,并且它返回关于是否通过验证的布尔值。通过搜索,我发现了以下两个有前途的库可以完成此任务: http://jsontools.berlios.de/ https://github.com/fge/j
问题内容: 我想每隔5秒重复调用一次方法,每当我希望停止该方法的重复调用时,我可能会停止或重新启动该方法的重复调用。 这是一些我真正想要实现的示例代码。在这方面请帮助我,我将非常感谢您。 问题答案: 使用以下命令设置重复任务: 如果您想取消任务,只需调用这里就是您的对象 并且您还可以检查答案下方的评论,他们已经提供了有关此内容的简短信息。
问题内容: 我有一个活动,该活动的TabHost包含一组TabSpec,每个TabSpec都有一个listview,其中包含要由该选项卡显示的项目。创建每个TabSpec时,我设置一个图标以显示在选项卡标题中。 TabSpec是通过以下方法创建的,该方法循环创建适当数量的选项卡: 有几个实例,我希望能够更改程序执行过程中每个选项卡中显示的图标。目前,我正在删除所有选项卡,并再次调用上述代码以重新创
问题内容: 如何通过android app向终端发送命令并获取输出?例如,发送“ ls /”并获取输出以在GUI中将其打印出来? 问题答案: 您必须使用反射来调用android.os.Exec.createSubprocess():