<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[浅颜如梦]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Jhear</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Jhear]]></copyright><item><title><![CDATA[Android厂商推送接入]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/106716713</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/106716713</guid><author>Jhear</author><pubDate>Fri, 12 Jun 2020 15:31:26 +0800</pubDate><description><![CDATA[先到极光推送后台开通厂商推送功能（此功能需要收费，需要联系商务开通）
到各厂商开发者平台注册应用，然后对应开启推送功能，获取对应的key和secret

需要注意的是，有些厂商在申请推送功能时审核时间有点长，最好提前申请


到极光后台推送设置-厂商通道页面里填写申请的对应的key和secret
到极光官网获取厂商推送SDK

厂商推送功能其实是极光帮忙帮厂商推送的SKD进行封装后集成到极光的SDK里，所以需要按照极光提供的文档进行接入，不需要再考虑对应平台的计入方法



    // 极光
    a.]]></description><category></category></item><item><title><![CDATA[Android挂断电话流程]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/106716569</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/106716569</guid><author>Jhear</author><pubDate>Fri, 12 Jun 2020 15:26:57 +0800</pubDate><description><![CDATA[近期在友盟上看到许多关于挂断电话导致崩溃的问题，如下异常

    java.lang.NoSuchMethodError: No interface method endCall()Z in class Lcom/android/internal/telephony/ITelephony; or its super classes (declaration of &amp;#39;com.android.internal.telephony.ITelephony&amp;#39; appears in .]]></description><category></category></item><item><title><![CDATA[React Native 入门]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/89629806</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/89629806</guid><author>Jhear</author><pubDate>Sun, 28 Apr 2019 03:36:24 +0800</pubDate><description><![CDATA[文章目录环境安装开发工具常用命令导入项目引入依赖了解着手附
环境安装

推荐直接查看官网，嫌门槛高，那就React Native 中文网，建议认真仔细认真敲

开发工具

IDE建议使用VS Code，比较轻量级，插件想装就装，当然首选插件React Native Tools
安装好VS Code后，可以了解几个常用的快捷键

Alt + Shift + F 格式化
Ctrl + [       ...]]></description><category></category></item><item><title><![CDATA[常用算法]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/89629367</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/89629367</guid><author>Jhear</author><pubDate>Sun, 28 Apr 2019 01:33:55 +0800</pubDate><description><![CDATA[常用算法排序冒泡排序法快速排序法插入排序法选择排序法希尔排序查找二分查找法
排序
冒泡排序法

冒泡排序法，利用两层嵌套循环，相邻数据进行比较，每次内层循环结束，把当前最大数交换到最后。

public class BubbleSort{
    public static void mian(String[] args) {
        int[] arr = {2, 3, 5, 6, 9,...]]></description><category></category></item><item><title><![CDATA[状态布局]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/88868068</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/88868068</guid><author>Jhear</author><pubDate>Fri, 29 Mar 2019 17:49:56 +0800</pubDate><description><![CDATA[现行的项目中，其中某些页面需要用到多种状态页面的切换，于是找出原来的自己写的库，也顺便分享出来

需求如下：页面加载显示加载页面 -&gt; 网络异常-&gt;显示网络异常页面

                           -&gt; 加载出错 -&gt; 显示加载出错页面

              ...]]></description><category></category></item><item><title><![CDATA[Android地址选择器、日期选择器]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/81532143</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/81532143</guid><author>Jhear</author><pubDate>Thu, 09 Aug 2018 10:36:17 +0800</pubDate><description><![CDATA[最近一个项目需要，不能使用系统的选择器，只能根据需要把几年前一个不知道从哪搞来的WheelView改造成需要的样式，当年时间紧任务重，代码渣，代码各种问题，不过现在改后还能用。效果如下图：





效果里使用了AutoLayout做了适配，如果你们项目里有自己的适配方式，直接把WheelView拿去自己写逻辑也是可以的。

源码地址：点我...]]></description><category></category></item><item><title><![CDATA[Dialog的简单封装]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/81531471</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/81531471</guid><author>Jhear</author><pubDate>Thu, 09 Aug 2018 10:16:02 +0800</pubDate><description><![CDATA[许久没来，突发奇想，想要把自己用到的一些项目分享出去，那就从最简单的一个开启：dialog的简单封装使用。

先上图，看下大致的用法：



new WrapperDialog(this) {
    @Override
    public int getLayoutRes() {
        return R.layout.dialog_normal;
    }

    @Overri...]]></description><category></category></item><item><title><![CDATA[android 视差特效  启动页]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/79029254</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/79029254</guid><author>Jhear</author><pubDate>Wed, 10 Jan 2018 22:55:04 +0800</pubDate><description><![CDATA[最近看了兄弟公司的产品KK馆，感觉最新的app引导页做的效果很是不错，于是自己实现了同样的效果，如下图：

  

列表横向滑动，同时背景跟随滑动而偏移滑动，同时带有动态的效果，滑动列表最后一个，滑动到下个页面，同时可以从下个页面滑动到上个页面。

简单分析，两个页面间滑动可以使用ViewPager来实现，页面间的效果，有透明度和大小的渐变，可以通过ViewPager的切换动画来实现。同理，列表页...]]></description><category></category></item><item><title><![CDATA[WebView设置透明背景]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/76618657</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/76618657</guid><author>Jhear</author><pubDate>Thu, 03 Aug 2017 14:10:50 +0800</pubDate><description><![CDATA[WebView在布局里设置背景为透明会失效
但在代码里可以解决此问题，如下
mWebView.setBackgroundColor(0);]]></description><category></category></item><item><title><![CDATA[ViewPager随手势左滑退出]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/75193436</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/75193436</guid><author>Jhear</author><pubDate>Sat, 15 Jul 2017 20:04:40 +0800</pubDate><description><![CDATA[页面随手势左滑退出，ViewPager本身有滑动事件，要想ViewPager也实现随手势滑动退出，需要对ViewPager的事件动些手脚。
看代码，控制ViewPager的上下左右滑动，喜欢拿去。
/**
 * Auther:  winds
 * Data:    2017/4/27
 * Desc:    控制ViewPager的上下左右滑动
 */

public class SolveV]]></description><category></category></item><item><title><![CDATA[解决RecyclerView复用导致EdittText、CheckBox等显示异常的问题]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/75191997</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/75191997</guid><author>Jhear</author><pubDate>Sat, 15 Jul 2017 19:56:41 +0800</pubDate><description><![CDATA[在ReceleyrView中加载的列表中如果存在EditText、CheckBox、评分控件等这样的控件时，会存在数据显示异常的问题。
导致此问题的原因便是RecyclerView的复用问题，解决此问题最简单的办法便是取消复用，但却是不可取的。
知道问题后，解决也简单，便是用数据控制控件的显示，在适配器里先移除被复用事件，再添加新事件。
打字太累，看代码:
    //避免复用
     ]]></description><category></category></item><item><title><![CDATA[AutoView自动为旧设计稿更新新设计稿尺寸]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/71105993</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/71105993</guid><author>Jhear</author><pubDate>Wed, 03 May 2017 00:44:10 +0800</pubDate><description><![CDATA[使用AutoView适配框架适配Ui的时候，可以直接根据ui设计的尺寸做界面。
但是坑爹的Ui， 在设计时如果使用两种不同尺寸的设计稿，或者复用不同尺寸的设计稿，那在处理时，就需要花一番功夫测量设计稿，再重新计算，故根据正则表达式做了自动更新的代码。
public class AutoSizeUtils {
	
	public static void main(String[] args) {]]></description><category></category></item><item><title><![CDATA[标题栏随RecyclerView滑动动态修改透明度]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/66109083</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/66109083</guid><author>Jhear</author><pubDate>Sun, 26 Mar 2017 00:05:26 +0800</pubDate><description><![CDATA[ 

标题栏随RecyclerView滑动动态修改透明度,其使用是使标题栏覆盖在RecyclerView上方，添加以下方法监听滑动时y轴的变化

 


    private int height = 640;// 滑动开始变色的高,真实项目中此高度是由广告轮播或其他首页view高度决定
    private int overallXScroll = 0;
    recyclerView.a...]]></description><category></category></item><item><title><![CDATA[android朋友圈监听键盘状态 点击空白区域隐藏键盘]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/55669145</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/55669145</guid><author>Jhear</author><pubDate>Sat, 18 Feb 2017 17:38:39 +0800</pubDate><description><![CDATA[/**
     * 判断键盘是否隐藏
     */
    void setViewTreeObserver() {
        final ViewTreeObserver observer = parent.getViewTreeObserver();
        observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnG]]></description><category></category></item><item><title><![CDATA[Retrofit的简单使用]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/55668916</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/55668916</guid><author>Jhear</author><pubDate>Sat, 18 Feb 2017 17:19:32 +0800</pubDate><description><![CDATA[Retrofit的简单使用
1.引入
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'		
    compile 'com.squareup.retrofit2:converter-scalars:2.1.0'
    //]]></description><category></category></item><item><title><![CDATA[RGB565数据转RGB8888图片]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/52956788</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/52956788</guid><author>Jhear</author><pubDate>Tue, 01 Nov 2016 18:03:20 +0800</pubDate><description><![CDATA[RGB565格式说明
RGB565彩色模式, 一个像素占两个字节， 其中：第一个字节的前5位用来表示R(Red)，第一个字节的后三位+第二个字节的前三位用来表示G(Green)，第二个字节的后5位用来表示B(Blue)。如：15 14 13 1211
10 9 8 ， 7 6 5 4 3 2 1 0
      而bitmap图片是一个RGB888，每个像素由3个字节组成，R->8bit，G]]></description><category></category></item><item><title><![CDATA[Android RGB565颜色byte数组转图片]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/52997822</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/52997822</guid><author>Jhear</author><pubDate>Tue, 01 Nov 2016 17:26:30 +0800</pubDate><description><![CDATA[RGB565数据转图片方法如下


    /**
     * RGB 565图片颜色数组封装成图片
     * @param data          颜色数组
     * @param height        高度
     * @param width         宽度
     * @return
     */
    public static Bitmap ge]]></description><category></category></item><item><title><![CDATA[Android6.0及以上版本Wifi开发，扫描Wifi信息，获取Wifi列表为空]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/52839046</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/52839046</guid><author>Jhear</author><pubDate>Mon, 17 Oct 2016 15:26:24 +0800</pubDate><description><![CDATA[最简单的解决办法，把目标版本设置为23以下，其他解决办法待探究。]]></description><category></category></item><item><title><![CDATA[自定义Dialog调整宽高大小]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/52821199</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/52821199</guid><author>Jhear</author><pubDate>Sat, 15 Oct 2016 09:07:00 +0800</pubDate><description><![CDATA[private void showDialog(View view) {
        dialog = new Dialog(mActivity, R.style.AlertDialogTheme);
        dialog.setContentView(view);
        
        display = mActivity.getWindowManager().getD]]></description><category></category></item><item><title><![CDATA[Android给控件添加边线的各种办法]]></title><link>https://blog.youkuaiyun.com/Jhear/article/details/52470009</link><guid>https://blog.youkuaiyun.com/Jhear/article/details/52470009</guid><author>Jhear</author><pubDate>Thu, 08 Sep 2016 12:21:53 +0800</pubDate><description><![CDATA[1.通过增加控件方式显示边线

 


 &amp;lt;View 
        android:layout_height=&quot;0.5dp&quot;
        android:layout_width=&quot;match_parent&quot;
        android:background=&quot;#d9d9d9&quot;
        /&amp;gt;


这种方式通过控制View的宽和高来实现，简单使用。

 

2.通过...]]></description><category></category></item></channel></rss>