小编Ish*_*arg的帖子

通告揭示了新活动的过渡

根据https://developer.android.com/training/material/animations.html

通过该ViewAnimationUtils.createCircularReveal()方法,您可以设置剪贴圆的动画以显示或隐藏视图.

要使用此效果显示以前不可见的视图:

// previously invisible view
View myView = findViewById(R.id.my_view);

// get the center for the clipping circle
int cx = (myView.getLeft() + myView.getRight()) / 2;
int cy = (myView.getTop() + myView.getBottom()) / 2;

// get the final radius for the clipping circle
int finalRadius = Math.max(myView.getWidth(), myView.getHeight());

// create the animator for this view (the start radius is zero)
Animator anim =
    ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);

// make the view visible and start the …
Run Code Online (Sandbox Code Playgroud)

animation android material-design

67
推荐指数
4
解决办法
4万
查看次数

使用srcCompat进行数据绑定

我正在使用Support Lib v23.2中的新向量drawable支持app:srcCompat并尝试通过数据绑定设置其drawable.

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

<data>
    <variable
        name="mediaPojo"
        type="in.ishaan.pika.data_binding.MediaPojo"/>
</data>

<RelativeLayout
    android:background="@color/black"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <VideoView
        ... />

    <ImageView
        ...
        app:srcCompat="@{mediaPojo.isPlaying ? @drawable/ic_pause_24dp : @drawable/ic_play_arrow_24dp}"
    />

    <ProgressBar
        .../>
</RelativeLayout>
</layout>
Run Code Online (Sandbox Code Playgroud)

试图建立,工作室抛出:

错误:(33,30)无法找到参数类型为android.graphics.drawable.Drawable的属性'app:srcCompat'的setter.

android android-support-library android-databinding

47
推荐指数
2
解决办法
9421
查看次数

Android数据绑定:包含标记的可见性

根据http://developer.android.com/tools/data-binding/guide.html#imports,我们可以在可见性中使用这样简单的表达式:

<TextView
..
android:visibility="@{user.isAdult ? View.VISIBLE : View.GONE}"/>
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试在include标签中执行相同操作时,如下所示:

<include
android:id="@+id/image_layout"
layout="@layout/image_layout"
android:visibility="@{notification.notifType == 0 ? View.VISIBLE : View.GONE}"/>
Run Code Online (Sandbox Code Playgroud)

然后Studio不仅以红色显示表达式,而且在构建时它会在自动生成的绑定类中显示以下错误:

错误:(138,29)错误:找不到符号方法setVisibility(int)

这是自动生成的绑定类中发生错误的位置

// batch finished
if ((dirtyFlags & 0x3L) != 0) {
    // api target 1
    this.imageLayout.setVisibility(NotifTypeNotificatio1);
}
imageLayout.executePendingBindings();
Run Code Online (Sandbox Code Playgroud)

android android-databinding

39
推荐指数
8
解决办法
2万
查看次数

RatingBar自定义Vector Drawables叠加

android中的RatingBar令人沮丧.

我已经按照/sf/answers/917543581/使用我自己的drawable实现了一个自定义评级栏,但所有的星星都相互叠加,因此最终只显示一颗星.

对于我的生活,我不能弄明白为什么.

编辑:PNG drawable似乎工作正常,但用作矢量drawables的SVG导致此问题

android ratingbar

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

Firebase性能详细的URL模式

即使API在过去几个月内有超过30,000的样本,我也无法在Firebase性能监控中查看详细的URL模式.

它只是显示根API域,如下所示:

api.myAppName.in/**
Run Code Online (Sandbox Code Playgroud)

而不是像

api.myAppName.in/app/v3/user/*/profile/
Run Code Online (Sandbox Code Playgroud)

如果您将鼠标悬停在控制台上,控制台只会在API上显示"未分类"标签

当我们收集大量样本时,将显示来自api.myAppName.in的详细UR​​L模式.收集后最多24小时.

但正如前面所提到的,它已经过了几个月,超过30,000个样本.

我正在使用改造,如果这有帮助.

android firebase firebase-performance

8
推荐指数
2
解决办法
1345
查看次数