Android 代码片段
csdn_02
这个作者很懒,什么都没留下…
展开
-
Android将整个app设置成灰色
Android将整个app设置成灰色。BaseDialog:因为Dialog新建了一个PhoneWindow,相当于走了一遍Activity中创建window的流程,所以新建Dialog的时候要重新设置ColorMatrix。在BaseActivity和BaseDialog中加入代码即可。原创 2022-12-13 08:53:47 · 597 阅读 · 1 评论 -
Android Textview缩进之悬挂缩进
很多地方都需要用到类似这样的悬挂缩进,排版看起来比较整齐。代码实现起来也很简单,几行就搞定了。String str = "1. Because of the protocol implementation on Philips Hue lights, it is not possible to remotely factory reset the lights. Instead a separate Philips Dimmer Switch is required to proceed....原创 2020-07-15 10:13:30 · 624 阅读 · 0 评论 -
Android Edittext 软键盘输入法回车键改成Next或者Done
<EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:lines="1" android:inputType="text" android:imeOptions="actionDone"/>只有单行输入的时候才有效,所以这三...原创 2020-04-23 10:41:44 · 1093 阅读 · 0 评论 -
Android 更换RadioButton图标和监听事件
Android 更换RadioButton图标只需定义一个selector文件,然后在布局中引用即可。在drawable中建立myradiobutton.xml文档并导入图片:<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res...原创 2020-04-16 19:30:23 · 456 阅读 · 0 评论 -
Android 发送本地通知
Android发送本地通知,之前很多方法都收不到通知了,更新完的 兼容api26 Intent intent = new Intent(mContext,TestActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, ...原创 2020-03-26 20:15:02 · 1484 阅读 · 0 评论