标签: android-3.1-honeycomb

动画结束后如何做某事?

我有一个ImageView用来显示进度的方法AnimationDrawable.当我想展示我的进度微调器时,我这样做:

animDrawable.start();
ObjectAnimator.ofFloat(view, "alpha", 1.0f).setDuration(300).start();
Run Code Online (Sandbox Code Playgroud)

当我想隐藏微调器时,我这样做:

ObjectAnimator.ofFloat(view, "alpha", 0.0f).setDuration(300).start();
animDrawable.stop();
Run Code Online (Sandbox Code Playgroud)

但是,这会导致动画立即停止.我希望它只有在ObjectAnimator完全褪色到0.0 alpha 后停止.有没有办法按照"AnimationCompleted"回调的方式设置一些东西?

animation android android-3.1-honeycomb

46
推荐指数
3
解决办法
3万
查看次数

ViewGroups的一个Animate Layout属性如何?

我有以下布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_height="match_parent"
              android:layout_width="match_parent">

    <FrameLayout android:id="@+id/viewgroup_left"
                 android:layout_height="match_parent"
                 android:layout_weight="2"
                 android:layout_width="0dp">

        ... children ... 

    </FrameLayout>

    <LinearLayout android:id="@+id/viewgroup_right"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:layout_width="0dp"
                  android:orientation="vertical">

        ... children ...

    </LinearLayout>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我最终得到这样的东西:

  +------------------------+------------+
  |                        |            |
  |                        |            |
  |         Left           |   Right    |
  |                        |            |
  |                        |            |
  +------------------------+------------+
Run Code Online (Sandbox Code Playgroud)

当切换某个切换时,我想要为Left设置动画,使其宽度扩展以填充整个屏幕.同时,我想为Right的宽度设置动画,使其缩小到零.之后,当再次切换切换时,我需要将事物恢复到上述状态.

我已经尝试编写自己调用的动画View.getWidth()但是当我动画回到该值时(通过设置View.getLayoutParams().width)它比它开始时更宽.我怀疑我做错了.我还阅读了有关Honeycomb动画内容的所有文档,但我不想翻译或缩放...我想为布局宽度属性设置动画.我找不到这样的例子.

这样做的正确方法是什么?

animation android viewgroup android-3.1-honeycomb

8
推荐指数
1
解决办法
3万
查看次数

将本机库打包到APK中

我如何从Eclipse中执行此操作?我找不到任何办法.我尝试build.xml使用以下内容创建一个并将其添加为最终构建器:

<?xml version="1.0" encoding="UTF-8"?>
<project name="MobileRecovery" default="mergelibs">
<loadproperties srcFile="local.properties" />
<property file="ant.properties" />
<loadproperties srcFile="project.properties" />
<fail unless="sdk.dir" message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" />
<!-- version-tag: custom -->
<import file="${sdk.dir}/tools/ant/build.xml" />
<target name="mergelibs">
    <apkbuilder outfolder="bin" verbose="true" apkfilepath="bin/MobileRecovery.apk">
        <file path="bin/classes.dex" />
        <nativefolder path="libs" />
    </apkbuilder>
</target>
</project>
Run Code Online (Sandbox Code Playgroud)

但所有成就都是产出apkbuilder doesn't support the nested "file" element.

在这一点上,我对我做错了的原因和方法不感兴趣,如果有人可以给我一个解决方案,我会弄清楚它背后的理论.

eclipse ant android eclipse-3.6 android-3.1-honeycomb

3
推荐指数
1
解决办法
4418
查看次数

2
推荐指数
1
解决办法
1783
查看次数

禁用后退主页按钮Android 3.1

我有一个运行在Samsung Galaxy Tab 8.9和Android 3.1上的应用程序.

我必须禁用后退按钮.我知道

<category android:name="android.intent.category.HOME" />

禁用"主页"按钮.但我不想禁用主页按钮.我想禁用BackButton而不是HomeButton.

感谢大家..

android back-button android-3.1-honeycomb

0
推荐指数
1
解决办法
998
查看次数