有什么方法来检测是否时钟是圆的? [英] Is there any way to detect if the clock is round?

查看:110
本文介绍了有什么方法来检测是否时钟是圆的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许是我错过了一些东西,但没有任何标志知道,如果时钟是圆的还是方?

Might be I missed something but is there any flag for knowing if the clock is round or square?

我可以想像,如果你想设计通知的背景下,这是非常重要的。

I could imagine that this is important if you want to design the background of the notifications.

推荐答案

从谷歌I / O通话(<一href="https://www.youtube.com/watch?v=naf_WbtFAlY#t=284">https://www.youtube.com/watch?v=naf_WbtFAlY#t=284):

From google I/O talk (https://www.youtube.com/watch?v=naf_WbtFAlY#t=284):

从SDK 20 android.view.View 类有

public void setOnApplyWindowInsetsListener(OnApplyWindowInsetsListener listener)

OnApplyWindowInsetsListener 有一个回调方法 onApplyWindowsInset

public WindowInsets onApplyWindowInsets(View view, WindowInsets windowInsets){

    if (windowInsets.isRound()){
        //Do stuff
    }

}

这篇关于有什么方法来检测是否时钟是圆的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆