如何扭转动画 - android(how to reverse an animation - android)
我在android中有一个测试应用程序,并在其上显示TextView。 在左侧滑动我正在“动画”TextView离开屏幕。 我使用了以下代码:
RES /动画/ swipoff1
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fillAfter="true"> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="360" android:pivotX="50%" android:pivotY="50%" android:duration="500" > </rotate> <translate android:fromXDelta="0%p" android:toXDelta="75%p" android:duration="500" /> </set>
并在活动中
Animation swipe_off_1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.swipoff1);
在左侧滑动:
dummy_textview.startAnimation(swipe_off_1);
在右侧滑动:
dummy_textview.clearAnimation();
我打算在右侧滑动时反转动画。
需要帮助来从代码中反转动画。
I have a test app in android and a TextView displayed on it. on a left swipe i am 'animating' that TextView off the screen. I have used the following code for that:
res/anim/swipoff1
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fillAfter="true"> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="360" android:pivotX="50%" android:pivotY="50%" android:duration="500" > </rotate> <translate android:fromXDelta="0%p" android:toXDelta="75%p" android:duration="500" /> </set>
and in the activity
Animation swipe_off_1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.swipoff1);
on left swipe :
dummy_textview.startAnimation(swipe_off_1);
on right swipe :
dummy_textview.clearAnimation();
I plan to reverse the animation on right swipe.
need help to reverse the animation from code.
原文:
最满意答案
之前已经多次说过,但我只是因为我在商业规则行业(大学,而不是供应商)而再次说出来,业务规则正迅速成为任何IT开发的重要组成部分。
你的团队很可能会花费大量的金钱,时间和精力来重新发明轮子。 创建一个评估规则的代码通常不是问题。 而你似乎已经解决了它。 现在,您正面临着最具挑战性的部分:UI。
尽管所有的书都说最重要的业务规则是业务逻辑与主系统的分离,但我认为实际上拥有业务规则引擎的最重要的一点是让BUSINESS PEOPLE自己创建这些规则,没有打扰程序员。 这意味着一个可靠的UI。
有一些业务规则引擎具有出色的用户界面,可以完成您所需要的一切,并且可以更低效地实现这一目标。 其中一些是免费的或有免费选项。
以Drools为例。 这是一个超级表演者。 但它只对程序员有用,除非你将Guvnor添加到图片中。 在Guvnor之前,Drools只在那些更关注评估性能和可用性的大公司中流行。
所以,在你自己构建规则UI这样一个可怕的项目之前,至少要看一些它们。 如果您使用的是Java平台,请考虑Drools。 您还可以查找位于MS Workflow Foundation内置的规则引擎之上的商业UI组件。 所有这些引擎都以XML格式保存规则,它们都具有很棒的UI(或UI组件),并且都是免费的或相对便宜的(除了InRule和BizTalk之外)。
我希望这可以帮助您节省团队即将体验的所有恶化和费用:)
It's been said many times before but I'm going to say it again simply because I am in business rules industry (university, not vendor) and business rules are quickly becoming very important part of any IT development.
It is very likely that your team will spend a lot of money, time and effort trying to reinvent the wheel. Creating a code that would evaluate your rules is not usually a problem. And you seem to solve it already. Now you are facing the most challenging part of it: the UI.
Even though all books say that the most important point of business rules is the separation of business logic from the main system, I'd say that practically the most important point of having business rules engine is to enable BUSINESS PEOPLE to create those rule themselves, without bothering programmers. That means a solid UI.
There are business rules engines with great user interfaces out there that do everything that you need, and they do that more efficiently for substantially less money. Some of them are free or have free option(s).
Take Drools, for example. It's a super performer. But it's useful only for programmers unless you add the Guvnor to the picture. Before the Guvnor, Drools was popular only among huge corporations that care more about evaluation performance then usability.
So, at least take a look at some of them before you undertake such a monstrous project of building rules UI yourself. Consider Drools if you are on Java platform. You can also look for commercial UI components that sit on top of the rule engine built into MS Workflow Foundation. All those engines save their rules in XML format, they all have great UI (or UI components), and all are either free or relatively cheap (except for maybe InRule and BizTalk.)
I do hope this helps you to save all that aggravation and expense that your team is about to experience :)
相关问答
更多-
你可能会检查出DBDesigner ... 现在称为MySQL Workbench http://dev.mysql.com/downloads/workbench/5.0.html You might check out DBDesigner ... Now known as MySQL Workbench http://dev.mysql.com/downloads/workbench/5.0.html
-
我敢肯定,如果你在这里发布你的问题,人们会以一些有见地的观点跳到它上面。 我怀疑你真的可以开发一个可以做到这一点的程序......这取决于你正在构建的东西。 规范化不确定“好”的设计。 I'm sure if you posted your questions here people will jump on it with some insightful opinions. I doubt you can really develop a program that can do this... it re ...
-
一些上下文:最近研究生院我研究了UML工具的可用性和一般的UML理解为一个独立的项目。 我也为生活建模/建筑师。 以前的帖子有太多的答案,没有足够的问题。 一个常见的误解是,UML是关于创建图表。 当然,图表很重要,但实际上你正在创建一个模型。 以下是每个供应商产品/解决方案比其他产品更好的一些事情应该回答的问题。 注意:列出的答案是我的观点,即使其他产品支持给定的功能或需要也是最好的。 你是建模还是绘画? (Drawing - ArgoUML ,免费的实现和Visio ) 你会在将来建模吗? (对于基本建 ...
-
OR映射工具[关闭](OR Mapping tool [closed])[2024-05-20]
NHibernate ? Linq (对sql)? 亚音速 ? Castle Project不做点什么吗? NHibernate? Linq (to sql)? Subsonic? doesn't Castle Project do something? -
好吧,这是一个简单的错误,虽然是一个非显而易见的错误,因为包构建部分访问代码正常并从我的提供程序程序集中调用它。 问题是,由于Web应用程序中的所有内容都以4.0框架为目标,因此我使用自定义提供程序代码添加的类库项目也是如此。 我不得不将目标框架设置为2.0,这一切都开始起作用了。 没有任何错误报告过于明显。 OK, this was a simple mistake, although a non-obvious one since the package building portion accesse ...
-
Sourcegraph for Haskell为您提供了Haskell代码的图形化表示。 看看文档 ,有一些例子。 Sourcegraph for Haskell gives you a graphical rapresentation of Haskell Code. Take a look at the documentation, there are some examples.
-
缺乏做其他事情的特殊原因,您通常使用MFC本身 - CDC::Polyline , CDC::PolyPolyline , CDC::Arc , CDC::PolyBezier等。 编辑:我担心如果你想要一个矢量绘图程序的完整例子,完成缩放,编辑,保存和打开文件等等,你可能在错误的地方。 我(以及其他一些人)可以而且经常会回答相应的具体问题,但如果你想要相对较大,精心设计的程序的例子,像Code Project这样的地方可能是更好的选择。 我不确定他们有一个,但至少在那里你有一个合理的机会。 关于最接近的我 ...
-
我觉得你的问题与DexExpress eXpressApp Framework的设计和建模重复。 基本上,您将能够使用内置的Visual Studio建模工具对单个域组件进行建模。 它适用于接口。 也许,您还可以基于开源Liekhus ADO.NET实体数据模型XAF扩展工具构建自定义建模解决方案。 最后,由于您正在使用XAF(我相信您也是DevExpress客户),我建议您联系我们的支持团队,以获得有关XAF或任何其他DevExpress产品的快速且有保障的帮助。 I felt that your que ...
-
请参阅本教程 它一定会帮到你。 恩乔伊! Please see this tutorial It will definitely help you. Njoy!!
-
自定义绘图工具[关闭](Custom Diagramming Tool [closed])[2024-01-01]
之前已经多次说过,但我只是因为我在商业规则行业(大学,而不是供应商)而再次说出来,业务规则正迅速成为任何IT开发的重要组成部分。 你的团队很可能会花费大量的金钱,时间和精力来重新发明轮子。 创建一个评估规则的代码通常不是问题。 而你似乎已经解决了它。 现在,您正面临着最具挑战性的部分:UI。 尽管所有的书都说最重要的业务规则是业务逻辑与主系统的分离,但我认为实际上拥有业务规则引擎的最重要的一点是让BUSINESS PEOPLE自己创建这些规则,没有打扰程序员。 这意味着一个可靠的UI。 有一些业务规则引擎具 ...