小编Jak*_*ke_的帖子

TranslateAnimation如何在Android上运行?

我经历了

TranslateAnimation (float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)
Run Code Online (Sandbox Code Playgroud)

但我仍然对如何Translate animation运作感到困惑.

有人可以解释它是如何工作的吗?我读了那些说的文件

fromXDelta  Change in X coordinate to apply at the start of the animation
toXDelta    Change in X coordinate to apply at the end of the animation
fromYDelta  Change in Y coordinate to apply at the start of the animation
toYDelta    Change in Y coordinate to apply at the end of the animation 
Run Code Online (Sandbox Code Playgroud)

但我仍然不清楚它是如何工作的.

编辑:我有Button一个LinearLayout没有任何孩子.当我点击时,Button我想动态生成一个TextView和动画TextView显示在 …

android android-animation

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

AppBarLayout中的SwipeRefreshLayout未包装内容

我试图实现拉动刷新,但我有一个问题,SwipeRefreshLayout没有包装子视图的高度.在视图预览和实时构建中,它似乎具有0高度.

布局如下:

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:elevation="0dp">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        app:layout_collapseMode="pin">

        <android.support.v4.widget.SwipeRefreshLayout
            android:id="@+id/swipe_refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <include layout="@layout/child_layout" />

        </android.support.v4.widget.SwipeRefreshLayout>
    </android.support.v7.widget.Toolbar>

</android.support.design.widget.AppBarLayout>
Run Code Online (Sandbox Code Playgroud)

我也试过制作没有任何成功SwipeRefreshLayout的父母,也AppBarLayout没有把一个单一的LinearLayout内部SwipeRefreshLayout.唯一似乎阻止滑动布局高度为0的东西是静态设置它但我希望它基于子视图的高度是动态的.

这里有什么我想念的吗?似乎可能存在错误,SwipeRefreshLayout因为将其替换为LinearLayout包含内容的内容按预期工作.

android android-layout swiperefreshlayout android-appbarlayout

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

Android M 应用链接验证失败

我定义我的应用程序链接如下AndroidManifest.xml

<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <category android:name="android.intent.category.DEFAULT"/>

    <data android:host="mysite.com" android:scheme="http"/>
    <data android:host="mysite.com" android:scheme="https"/>
    <data android:host="www.mysite.com" android:scheme="http"/>
    <data android:host="www.mysite.com" android:scheme="https"/>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

该应用程序正确地检测到来自主机的 URL,但会提示用户是否要在应用程序或浏览器中打开它们,因为验证失败,如 Android 监控控制台所示:

01-17 15:44:28.847 7084-30015/? I/IntentFilterIntentSvc: Verifying IntentFilter. verificationId:2 scheme:"https" hosts:"mysite.com www.mysite.com" package:"com.site.myapp.android.flavor".
01-17 15:44:29.821 7084-30015/? I/IntentFilterIntentSvc: Verification 2 complete. Success:false. Failed hosts:mysite.com,www.mysite.com.
Run Code Online (Sandbox Code Playgroud)

我的 assetlinks.json 文件位于mysite.com/.well-known/assetlinks.json并包含正确的包名称和 SHA256 哈希值。它也可以通过 http 和 https 访问。我已经通过从 APK 中提取 CERT.RSA 文件并使用keytool -printcert -file CERT.RSA

我曾尝试调用https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://domain1:port&relation=delegate_permission/common.handle_all_urls以及使用谷歌站点语句列表测试器,并且都返回 OK。

我正在使用运行 Android 7 的 Nexus 设备进行测试。 …

android json deep-linking applinks android-6.0-marshmallow

4
推荐指数
1
解决办法
2055
查看次数

Android 意图过滤器删除查询字符串

intent-filter我在我的节点中定义了一个数据标签,AndroidManifest.xml如下所示:

<data
    android:scheme="http"
    android:host="example.com"
    android:pathPrefix="/path/pageEnum" />
Run Code Online (Sandbox Code Playgroud)

我想要捕捉的路径是http://example.com/path/pageEnum?one=1&two=2&three=3

adb我正在这样启动意图:

adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "http://example.com/path/pageEnum?one=1&two=2&three=3"

目标活动已成功启动,但是当我调用getIntent().getDataString()字符串onCreate()值时http://example.com/path/pageEnum?one=1

除第一个查询参数之外的所有查询参数都将被删除。

是否有任何解决方法可以确保我获得所有查询参数?

谷歌的文档中没有任何关于此行为的内容。

android deep-linking android-intent

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

每个应用程序风格的自定义意图?

假设我有应用程序 A 和 B。应用程序 B 有多种构建风格,但每个都略有不同,我想从应用程序 A 启动特定风格。

我已经考虑使用一个自定义共享意图,但如果用户安装了多个版本的 B,我不希望操作系统提示用户使用哪个版本来处理意图。

是否可以以编程方式为应用程序的每种风格定义独特的自定义意图?

android android-intent

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