今天的主题就是仿联系人界面。相信大家在平时都见过,就是可以实现快速索引的侧边栏。比如在美团中选择城市的界面: 美团中选择城市的界面 我们可以看到在右侧有一个支持快速索引的栏。
GroupingViewSample 制作类似联系人页面所需要的Slider,还有用来给recyclerview进行分组的ItemDecoration,我觉得最实用的地方是可以用xml来画对应部分的布局...="@color/colorPrimary" android:id="@+id/slider" android:layout_width="wrap_content"...android:layout_height="wrap_content" android:orientation="vertical" /> 然后在代码中给Slider绑定对应的...="http://schemas.android.com/apk/res/android" android:id="@+id/item" android:layout_width="wrap_content..." android:layout_height="wrap_content" android:text="test" android:textSize="20sp"> </TextView
android:layout_height="wrap_content" android:layout_marginRight="@dimen/dp_10" android..." android:paddingLeft="@dimen/dp_4" android:paddingRight="@dimen/dp_4" android..." android:layout_height="wrap_content" android:text=" : "/> <TextView android..." android:layout_width="wrap_content" android:layout_height="wrap_content" android...> android="http://schemas.android.com/apk/res/android"> android:radius="5dp
Introduction To Android Contacts Learn to work with the Android contacts database....; import android.database.Cursor; import android.os.Bundle; import android.provider.ContactsContract;...getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null); // 获取手机联系人...这个permission android:name="android.permission.READ_CONTACTS" /> 运行结果: ?...代码示例 参考推荐: Working With Android Contacts Android Contacts的使用
看到一些应用中的点赞觉得挺有意思,具体效果大概就是这个样子 50buq-l34h1.gif 然后我仿写了下,效果差不多,代码比较简单就不过多说明了 import android.animation.Animator...; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.annotation.SuppressLint...; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import...android.graphics.Paint; import android.support.annotation.Nullable; import android.util.AttributeSet...; import android.view.View; public class LikeView extends View { private static final String DEFAULT_TEXT_COLOR
这篇博客实现的功能主要有仿微信,QQ 上传图像裁剪功能,包括拍照,从相册选取。裁剪框的样式有圆形,正方形,九宫格。...它的实现原理是通过空白的 fragment 处理实现的,有兴趣的可以看我这一篇博客 Android Fragment 的妙用 - 优雅地申请权限和处理 onActivityResult ClipImageActivity.goToClipActivity...// 释放资源 mImageView.destroyDrawingCache(); return zoomedCropBitmap; } ---- 题外话 这个 Demo 涉及到的 Android...Android 7.0 图片拍照适配,6.0 动态权限申请,Android 使用空白 fragment 处理 onActivityResult,动态权限申请,自定义 View,View 的事件分发机制等等
主要利用三角函数和贝塞尔曲线实现粘连效果,角度和坐标对应关系如下 /** * qq气泡 */ public class BubbleView extends...
获取联系人就比较复杂了,其表结构也比较复杂,我们获取联系人的姓名、电话号码、邮箱,要通过3张表去提取 数据库所在位置data-->data中的下面路径 ?...", name='" + name + '\'' + '}'; } } 最后别忘了加上权限 android...:name="android.permission.READ_SMS"/> android:name="android.permission.READ_CONTACTS..."/> 如过是Android 6.0以上的版本还要动态获取权限 获取联系人的效果图 ?...中找到该联系人的电话号码 * 通过这个ID可以在ContactsContract.CommonDataKinds.Email.CONTENT_URI 找到该联系人的邮箱
,他在网络上也存在,这个时候Android就可以识别他们,认为他们两个其实 是指同一个人。 ...“mimetype”是电话 或者 姓名 的标示符编码: 例如:电话 对应“vnd.android.cursor.item/phone_v2” 姓名 对应“vnd.android.cursor.item/...Uri uri = Uri.parse(“content://com.android.contacts/raw_contacts”); raw_contacts表 该表保存了所有创建过的手机测联系人,每个联系人占一行...3 Uri dataUri = Uri.parse (“content://com.android.contacts/data”); data表 Ø 该表保存了所有创建过的手机测联系人的所有信息,每个字段占一行...Ø 联系人的所有信息保存在列data1至data15中,各列中保存的内容根据MimeTypeID的不同而不同。
> android="http://schemas.android.com/apk/res/android" android:..." android:layout_height="match_parent" android:layout_alignParentTop="true" android...="wrap_content" android:background="@android:color/transparent" android:gravity="right...android:maxLines="1" android:drawableLeft="@mipmap/search_icon" android...> android="http://schemas.android.com/apk/res/android" xmlns:app=
本期主题聚焦联系人和身份。 重要更新 Android 11 的目标之一是让手机更加 "以人为本",因为与至爱亲朋保持联系对人们而言至关重要。...视频资源 如需要进一步了解这些 "以人为本" 的功能,我们建议您查看关于联系人的 Android 11 发布精选片段。...最后,您还可以收听 Chet 的播客,听听他就 联系人 和 Bubble 与我们的沟通。...开始学习 如果您想要轻松了解本周的要点,请查看 "联系人和身份" 学习计划。...您对 "联系人和身份" 相关关键知识点掌握多少?欢迎加入测试,赢取限量版徽章。 知识点 Android 11 是我们持续优化用户、联系人以及聊天等重要功能的起点。
言归正传,今天讨论的是在Android里面如何来实现这么个效果,那么如何实现呢???...相信部分童鞋首先想到的是android.widget.DatePicker和android.widget.TimePicker,因为它们的样子长得很像,事实就是它们仅仅是长得相而已,Google在设计这个两个...好了,既然在Android中没办法偷懒的用一个系统widget搞定,那么只能自己来自定义view来实现了,这篇就围绕这个来展开分享一下,我在项目中实现这个的全过程。...首先是做了下开源代码调研,在github上面有一个叫做 android-wheel 的开源控件, 代码地址https://github.com/maarek/android-wheel 是一个非常好用的组件...关于XML的解析,一共有SAX、PULL、DOM三种解析方式,这里就不讲了,可以看我的前面的几篇学习的文章: Android解析XML方式(一)使用SAX解析 Android解析XML方式(二)使用
> android="http://schemas.android.com/apk/res/android" android:...android:defaultValue="true" android:enabled="false" android:summary="summary" android:title...android:dependency="checkbox" android:summaryOff="off" android:summaryOn="on" android:title...android:key="checkbox" android:summaryOff="off" android:summaryOn="on" android:title="MyCheckbox...android:defaultValue="false" android:key="checkbox1" android:summaryOff="off" android:summaryOn
现在侧滑菜单的框架在github上也有很多,有兴趣的可以去搜一下,今天我就给大家展示一个简单的仿qq侧滑菜单的例子。...> android="http://schemas.android.com/apk/res/android" android:...android:layout_height="wrap_content" android:layout_centerInParent="true" android:orientation...android:id="@+id/id_img2" android:layout_width="50dp" android:layout_height...> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:qq_menu="http
Android 的SMS读取短信,可以获取发信人/收信人的手机号码(address),Contacts的联系人,可以过滤手机号码(address),因此SMS可以通过手机号码(address)关联到...Contacts联系人 SMS - Contacts 关联代码 // 通过address手机号关联Contacts联系人的显示名字 private String getPeopleNameFromPerson...; import android.util.Log; import android.widget.ScrollView; import android.widget.TextView; public...getSmsInPhone", ex.getMessage()); } return smsBuilder.toString(); } // 通过address手机号关联Contacts联系人的显示名字...示例代码 参考推荐: Android 之 Contacts 联系人读取
> android="http://schemas.android.com/apk/res/android" android:id="@+id/root"...android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding...android:id="@+id/topPanel" android:layout_width="match_parent" android:layout_height..." android:layout_height="match_parent" android:alpha="0" android:...android:layout_below="@+id/logo" android:layout_marginTop="30dp" android:orientation=
下面直接贴代码 1.先写一个实体类,来放名字和号码 public class PhoneDto { private String name; //联系人姓名...> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:...tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"...android:layout_width="match_parent" android:layout_height="match_parent" tools..." android:layout_height="match_parent" android:id="@+id/lv_main_list"></ListView
> <com.achillesl.neteasedisc.widget.DiscView mlns:android="http://schemas.android.com/apk/res/android..." android:layout_width="match_parent" android:layout_height="wrap_content"> <!..." android:layout_height="wrap_content" android:layout_centerHorizontal="true"...android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal...附:仿网易云音乐界面源码
https://blog.csdn.net/lyhhj/article/details/49935345 最近小编搞了一个仿微信群聊头像的一个功能,分享给大家......工作中需要实现仿钉钉群头像的一个功能,就是个人的头像拼到一起显示,看了一下市场上的APP好像微信的群聊头像是组合的,QQ的头像不是,别的好像也没有了。今天给大家分享一下怎么实现的吧。...="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android..." android:gravity="center" android:orientation="vertical" android:background="#987" android...android:layout_height="wrap_content" /> <TextView android:background="#fff" android
领取专属 10元无门槛券
手把手带您无忧上云