博客园 - developer_Kale
uuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=45350
2017-08-28T07:02:30Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
feed.cnblogs.com
https://www.cnblogs.com/tianzhijiexian/p/4883759.html
判断是否安装微博 - developer_Kale
public static boolean isWeiboInstalled(@NonNull Context context) { PackageManager pm; if ((pm = context.getApplicationContext().getPacka...
2015-10-15T13:39:00Z
2015-10-15T13:39:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】public static boolean isWeiboInstalled(@NonNull Context context) { PackageManager pm; if ((pm = context.getApplicationContext().getPacka... <a href="https://www.cnblogs.com/tianzhijiexian/p/4883759.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4807813.html
Java 注解 - developer_Kale
Java的注解是个很神奇的东西,它既可以帮你生成代码,又可以结合反射来在运行时获得注解标识的对象,进行逻辑处理,它能帮助我们完成很多很多不可能完成的任务,这回我们就来一起来了解下它。一、什么可以被注解修饰Java中的类、方法、变量、参数、包都可以被注解,在java8中注解可以被运用到任何地方。比如:...
2015-09-14T09:45:00Z
2015-09-14T09:45:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】Java的注解是个很神奇的东西,它既可以帮你生成代码,又可以结合反射来在运行时获得注解标识的对象,进行逻辑处理,它能帮助我们完成很多很多不可能完成的任务,这回我们就来一起来了解下它。一、什么可以被注解修饰Java中的类、方法、变量、参数、包都可以被注解,在java8中注解可以被运用到任何地方。比如:... <a href="https://www.cnblogs.com/tianzhijiexian/p/4807813.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4807781.html
android tools使用方式 - developer_Kale
我们希望在布局中显示测试的属性,而这个属性不会影响到正式代码,因此我们就需要tools这个命名空间。首先定义:xmlns:tools="http://schemas.android.com/tools"tools:context 填入activity的完整包名tools:menutools:acti...
2015-09-14T09:34:00Z
2015-09-14T09:34:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】我们希望在布局中显示测试的属性,而这个属性不会影响到正式代码,因此我们就需要tools这个命名空间。首先定义:xmlns:tools="http://schemas.android.com/tools"tools:context 填入activity的完整包名tools:menutools:acti... <a href="https://www.cnblogs.com/tianzhijiexian/p/4807781.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4769959.html
listview复用机制研究 - developer_Kale
Listview在第一次的时候会先把屏幕上绘制的item都new出来,为了讲解方便我把new出来的item都用红色背景,复用的则用绿色背景。可以看到这个list种有三种item。在第一次展示的时候,listview会看屏幕上每种item有几个,比如这里的textView的item就有5个。它就会ne...
2015-08-29T14:28:00Z
2015-08-29T14:28:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】Listview在第一次的时候会先把屏幕上绘制的item都new出来,为了讲解方便我把new出来的item都用红色背景,复用的则用绿色背景。可以看到这个list种有三种item。在第一次展示的时候,listview会看屏幕上每种item有几个,比如这里的textView的item就有5个。它就会ne... <a href="https://www.cnblogs.com/tianzhijiexian/p/4769959.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4723880.html
java 驼峰字符和下划线字符相互转换工具类 - developer_Kale
public static final char UNDERLINE='_'; public static String camelToUnderline(String param){ if (param==null||"".equals(param.trim())){ ...
2015-08-12T04:06:00Z
2015-08-12T04:06:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】public static final char UNDERLINE='_'; public static String camelToUnderline(String param){ if (param==null||"".equals(param.trim())){ ... <a href="https://www.cnblogs.com/tianzhijiexian/p/4723880.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4713118.html
剪切板(复制、粘贴)工具类 - developer_Kale
package kale.http.framework.util;import android.content.ClipboardManager;import android.content.Context;/** * @author http://blog.csdn.net/voiceofnet/...
2015-08-08T06:33:00Z
2015-08-08T06:33:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】package kale.http.framework.util;import android.content.ClipboardManager;import android.content.Context;/** * @author http://blog.csdn.net/voiceofnet/... <a href="https://www.cnblogs.com/tianzhijiexian/p/4713118.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4711670.html
为ListView组件加上快速滑块以及修改快速滑块图像 - developer_Kale
本文转载自:http://blog.csdn.net/ouyang_peng/article/details/46919723作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!转载请保留原文地址:http://blog.csdn.net/ouyang_peng1.允许快速滑动在xml中将android:...
2015-08-07T10:52:00Z
2015-08-07T10:52:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】本文转载自:http://blog.csdn.net/ouyang_peng/article/details/46919723作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!转载请保留原文地址:http://blog.csdn.net/ouyang_peng1.允许快速滑动在xml中将android:... <a href="https://www.cnblogs.com/tianzhijiexian/p/4711670.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4702327.html
一个插件让你在chrome直接运行apk - developer_Kale
插件的下载地址:https://chrome.google.com/webstore/detail/arc-welder/emfinbmielocnlhgmfkkmkngdoccbadn?utm_source=chrome-app-launcher-info-dialog安装好插件后,需要选一个目录...
2015-08-04T08:15:00Z
2015-08-04T08:15:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】插件的下载地址:https://chrome.google.com/webstore/detail/arc-welder/emfinbmielocnlhgmfkkmkngdoccbadn?utm_source=chrome-app-launcher-info-dialog安装好插件后,需要选一个目录... <a href="https://www.cnblogs.com/tianzhijiexian/p/4702327.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4699615.html
onMeasure流程解析 - developer_Kale
0、预备知识我们的手机屏幕的布局其实是嵌套的,最外层是一个phoneWindow,这个view和手机屏幕一样大,里面是一个frameLayout,再里面才是我们自己写的布局文件。我们在绘制控件前必须要经历measure的过程,这个过程需要从最外层的PhoneWindow开始进行。phonewindo...
2015-08-03T09:57:00Z
2015-08-03T09:57:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】0、预备知识我们的手机屏幕的布局其实是嵌套的,最外层是一个phoneWindow,这个view和手机屏幕一样大,里面是一个frameLayout,再里面才是我们自己写的布局文件。我们在绘制控件前必须要经历measure的过程,这个过程需要从最外层的PhoneWindow开始进行。phonewindo... <a href="https://www.cnblogs.com/tianzhijiexian/p/4699615.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4699014.html
Tint(着色器)的兼容实现 - developer_Kale
我们在做控件的时候可以使用tint这个属性给控件上色,这样在很多情况下能减少不同色彩的资源色彩。在MD设计中,控件颜色随着主体改变也是一大要点,今天我们就来看看如何使用它。使用步骤:1.建立一个控件;2.使用ViewCompat.setBackgroundTintList // 第一种实现...
2015-08-03T04:19:00Z
2015-08-03T04:19:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】我们在做控件的时候可以使用tint这个属性给控件上色,这样在很多情况下能减少不同色彩的资源色彩。在MD设计中,控件颜色随着主体改变也是一大要点,今天我们就来看看如何使用它。使用步骤:1.建立一个控件;2.使用ViewCompat.setBackgroundTintList // 第一种实现... <a href="https://www.cnblogs.com/tianzhijiexian/p/4699014.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4698760.html
inputType属性 - developer_Kale
android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用。这也大大的方便的操作。有时需要虚拟键盘只为字符或只为数字。所以inputType尤为重要。//文本类型,多为大写、小写和数字符号。 android:inputType="none" android...
2015-08-03T02:59:00Z
2015-08-03T02:59:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用。这也大大的方便的操作。有时需要虚拟键盘只为字符或只为数字。所以inputType尤为重要。//文本类型,多为大写、小写和数字符号。 android:inputType="none" android... <a href="https://www.cnblogs.com/tianzhijiexian/p/4698760.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4689758.html
Android Studio常用快捷键 - developer_Kale
Ctrl+U :如果你的光标在重写父类的一个方法内(如:Activity#onCreate()),这个将会跳到父类的实现上。如果你的光标在类名上,它将会跳到父类。Ctrl+Alt+Home:它可以帮助你很轻松地在布局文件和Activity/fragment文件之间进行导航。还有一个快捷方式是在类名的...
2015-07-30T08:33:00Z
2015-07-30T08:33:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】Ctrl+U :如果你的光标在重写父类的一个方法内(如:Activity#onCreate()),这个将会跳到父类的实现上。如果你的光标在类名上,它将会跳到父类。Ctrl+Alt+Home:它可以帮助你很轻松地在布局文件和Activity/fragment文件之间进行导航。还有一个快捷方式是在类名的... <a href="https://www.cnblogs.com/tianzhijiexian/p/4689758.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4686627.html
Android引用本地aar - developer_Kale
先建立一个lib工程,然后build出aar。接着把aar放入要引入它的工程module的libs中。在project的build.gradle中:repositories { flatDir { dirs 'libs' //this way we can find the .a...
2015-07-29T09:39:00Z
2015-07-29T09:39:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】先建立一个lib工程,然后build出aar。接着把aar放入要引入它的工程module的libs中。在project的build.gradle中:repositories { flatDir { dirs 'libs' //this way we can find the .a... <a href="https://www.cnblogs.com/tianzhijiexian/p/4686627.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4686587.html
兼容Android的水波纹效果 - developer_Kale
Android的水波纹效果只有高版本才有,我们希望自己的应用在低版本用低版本的阴影,高版本用水波纹,这怎么做呢?其实,只要分drawable和drawablev21两个文件夹就好了。普通情况下的selector:v21中的selector: -->这里ripple中的color就是按下...
2015-07-29T09:30:00Z
2015-07-29T09:30:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】Android的水波纹效果只有高版本才有,我们希望自己的应用在低版本用低版本的阴影,高版本用水波纹,这怎么做呢?其实,只要分drawable和drawablev21两个文件夹就好了。普通情况下的selector:v21中的selector: -->这里ripple中的color就是按下... <a href="https://www.cnblogs.com/tianzhijiexian/p/4686587.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4645563.html
让Android支持透明状态栏 - developer_Kale
可以在代码中动态设置:private void initSystemBar() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setTranslucentStatus(true); Syst...
2015-07-14T07:24:00Z
2015-07-14T07:24:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】可以在代码中动态设置:private void initSystemBar() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setTranslucentStatus(true); Syst... <a href="https://www.cnblogs.com/tianzhijiexian/p/4645563.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4645497.html
LayoutInflater的infalte() - developer_Kale
其中: resource:是布局文件ID root:是父ViewGroup对象, attachToRoot:是是否将“翻译”出来的View添加到上面的root中 root和attachToRoot是共同作用的: 1,有root,同时attachToRoot为false,那么inflate()返回的就...
2015-07-14T07:06:00Z
2015-07-14T07:06:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】其中: resource:是布局文件ID root:是父ViewGroup对象, attachToRoot:是是否将“翻译”出来的View添加到上面的root中 root和attachToRoot是共同作用的: 1,有root,同时attachToRoot为false,那么inflate()返回的就... <a href="https://www.cnblogs.com/tianzhijiexian/p/4645497.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4644693.html
Android布局优化策略 - developer_Kale
我们要知道布局是否合理,可以通过Hierarchy Viewer这个工具。打开Hierarchy Viewer(定位到tools/目录下,直接执行hierarchyviewer的命令,选定需要查看的Process,再点击Load View Hierarchy会显示出当前界面的布局Tree。在每个模块...
2015-07-14T02:09:00Z
2015-07-14T02:09:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】我们要知道布局是否合理,可以通过Hierarchy Viewer这个工具。打开Hierarchy Viewer(定位到tools/目录下,直接执行hierarchyviewer的命令,选定需要查看的Process,再点击Load View Hierarchy会显示出当前界面的布局Tree。在每个模块... <a href="https://www.cnblogs.com/tianzhijiexian/p/4644693.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4643338.html
Android EditText输入最大值提示功能 - developer_Kale
public class LengthFilter implements InputFilter { public LengthFilter(int max) { mMax = max; } @Override public C...
2015-07-13T08:57:00Z
2015-07-13T08:57:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】public class LengthFilter implements InputFilter { public LengthFilter(int max) { mMax = max; } @Override public C... <a href="https://www.cnblogs.com/tianzhijiexian/p/4643338.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4633377.html
在Android中引入Java8的lambda表达式 - developer_Kale
我用的是retrolambda这个插件,下面来说下如何添加它。项目地址:https://github.com/evant/gradle-retrolambda在根项目的build.gradle中添加这个classpathclasspath 'me.tatarka:gradle-retrolambda...
2015-07-09T07:48:00Z
2015-07-09T07:48:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】我用的是retrolambda这个插件,下面来说下如何添加它。项目地址:https://github.com/evant/gradle-retrolambda在根项目的build.gradle中添加这个classpathclasspath 'me.tatarka:gradle-retrolambda... <a href="https://www.cnblogs.com/tianzhijiexian/p/4633377.html" target="_blank">阅读全文</a>
https://www.cnblogs.com/tianzhijiexian/p/4632485.html
如何更好的通过Inflate layout的方式来实现自定义view - developer_Kale
本篇文章讲的是如何用现有控件产生一个组合控件的方法,十分简单实用。现在开始!一、需求我们要实现一个有红点和文字的按钮控件,就像下面这样:二、实现我的思路是让一个button和一个textview进行组合。 可以看到最外层我用了merge标签,这是因为我需要把这个xml加载到一个自定义...
2015-07-09T02:51:00Z
2015-07-09T02:51:00Z
developer_Kale
https://www.cnblogs.com/tianzhijiexian/
【摘要】本篇文章讲的是如何用现有控件产生一个组合控件的方法,十分简单实用。现在开始!一、需求我们要实现一个有红点和文字的按钮控件,就像下面这样:二、实现我的思路是让一个button和一个textview进行组合。 可以看到最外层我用了merge标签,这是因为我需要把这个xml加载到一个自定义... <a href="https://www.cnblogs.com/tianzhijiexian/p/4632485.html" target="_blank">阅读全文</a>