android:filterTouchesWhenObscured

In Package installer activity.

In PackageInstaller/res/layout/install_confirm.xml

98    <!-- OK confirm and cancel buttons.  -->
99    <LinearLayout
100            android:layout_width="match_parent"
101            android:layout_height="wrap_content"
102            android:orientation="vertical"
103            android:divider="?android:attr/dividerHorizontal"
104            android:showDividers="beginning">
105
106        <LinearLayout
107                style="?android:attr/buttonBarStyle"
108                android:layout_width="match_parent"
109                android:layout_height="wrap_content"
110                android:orientation="horizontal"
111                android:measureWithLargestChild="true">
112
113            <LinearLayout android:id="@+id/leftSpacer"
114                    android:layout_weight="0.25"
115                    android:layout_width="0dip"
116                    android:layout_height="wrap_content"
117                    android:orientation="horizontal"
118                    android:visibility="gone" />
119
120            <Button android:id="@+id/cancel_button"
121                    android:layout_width="0dip"
122                    android:layout_height="wrap_content"
123                    android:layout_gravity="start"
124                    android:layout_weight="1"
125                    android:text="@string/cancel"
126                    android:maxLines="2"
127                    style="?android:attr/buttonBarButtonStyle" />
128
129            <Button android:id="@+id/ok_button"
130                    android:layout_width="0dip"
131                    android:layout_height="wrap_content"
132                    android:layout_gravity="end"
133                    android:layout_weight="1"
134                    android:text="@string/next"
135                    android:maxLines="2"
136                    android:filterTouchesWhenObscured="true"
137                    style="?android:attr/buttonBarButtonStyle" />
138
139            <LinearLayout android:id="@+id/rightSpacer"
140                    android:layout_width="0dip"
141                    android:layout_weight="0.25"
142                    android:layout_height="wrap_content"
143                    android:orientation="horizontal"
144                    android:visibility="gone" />
145
146        </LinearLayout>
147    </LinearLayout>

filterTouchesWhenObscured attribute mean the button's onClick will not work if there is another view on the top of this button even if the above view is transparent.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值