自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

crazychen的专栏

只要有一个人爱我,懂我,愿意等我,我便勇往直前,无所不能。

  • 博客(498)
  • 资源 (25)
  • 收藏
  • 关注

原创 leetcode--Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 intonums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal tom + n) to hold addit

2015-06-05 15:23:10 521

原创 leetcode--Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3./** * Definition for sing

2015-06-05 15:09:22 446

原创 leetcode--Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?public class Solution { public

2015-06-05 13:54:11 472

原创 leetcode--Add Binary

Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".public class Solution { public String addBinary(String a, String b) { in

2015-06-05 13:47:35 623

原创 ChrisRenke/DrawerArrowDrawable源码解析

转载请注明出处源码下载地址这次解析的控件DrawerArrowDrawable是一款侧拉抽屉效果的控件,在很多应用上我们都可以看到(例如知乎),控件的github地址为https://github.com/ChrisRenke/DrawerArrowDrawable大家可以先来看一下控件的效果这个控件的作者,也写过一篇文章对控件的制作过程做了说明,其中更多的是涉及箭头的

2015-06-02 21:51:32 3191 1

原创 dmytrodanylyk/circular-progress-button源码解析(二)

源码下载http://download.csdn.net/detail/kangaroo835127729/8755815在上篇文章http://blog.csdn.net/crazy__chen/article/details/46278423中,我主要讲述了circular-progress-button状态切换的动画过程,接下来我们看一个最特殊的状态,就是加载状态,这个状态会显示一个圆环

2015-05-31 01:44:34 2610 6

原创 dmytrodanylyk/circular-progress-button源码解析(一)

dmytrodanylyk/circular-progress-button是github上一个开源的按钮控件,这个是链接https://github.com/dmytrodanylyk/circular-progress-button下面是示例图,应该说作为按钮,设计非常的简洁大方,这篇文章就是来介绍一下这个circular-progress-button的源码,让大家明白这么漂亮的控件

2015-05-30 23:42:19 3656 8

原创 leetcode--Plus One

Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.public class Solution {

2015-05-26 15:49:06 1011

原创 leetcode--Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defi

2015-05-26 15:27:15 651

原创 Maxwin-z/XListView-Android(下拉刷新上拉加载)源码解析(二)

转载请注明出处http://blog.csdn.net/crazy__chen/article/details/45956179源文件下载地址http://download.csdn.net/detail/kangaroo835127729/8736887本文主要是贴出xlistview的源代码和一个使用实例,没有过多讲解使用实例,MainActivitypublic class

2015-05-25 21:46:25 2442 4

原创 Maxwin-z/XListView-Android(下拉刷新上拉加载)源码解析(一)

本次解析的内容,是github上一个用于下拉刷新上拉加载的控件xlistview,这个功能相信大家在开发的过程中会经常用到。控件的源码地址是https://github.com/Maxwin-z/XListView-Android在这个控件之前,我看过一些相同功能的控件,挑选后觉得XListView功能比较完善,而且易于理解。在android-open-project里面,有提到一个Dro

2015-05-25 15:28:01 3296 2

原创 chenglei1986/DatePicker源码解析(二)

接上一篇文章chenglei1986/DatePicker源码解析(一),我们继续将剩余的部分讲完,其实剩余的内容,就是利用Numberpicker来组成一个datePicker,代码非常的简单为了实现自定义布局的效果,我们给Datepciker定制了一个layout,大家可以定制自己的layout<LinearLayout xmlns:android="http://schemas.a

2015-05-24 15:16:24 1733 1

原创 chenglei1986/DatePicker源码解析(一)

DatePicker在android其实是有提供的一个控件,相信有不少的人使用过它,但是这个控件的外观我们只能做一些简单的设定(原生的),如果我们有更高需求,希望能自定义我们的datepicker的外观,希望赋予它更多的功能,我们就需要自定义一个datepciker控件。在github上,我发现了一个chenglei1986/DatePicker的项目,可以实现上面的需求。地址是https:/

2015-05-23 21:43:43 2719

原创 Scroller类源码解析及其应用(二)

接上一篇文章的内容,这篇文章主要是Scroller类的应用,在讲具体实例之前,我还有顺便提一个Scroller的问题。就是fling()方法和startScroll()方法的区别,其实确保已经在上篇文章说得很清楚(注释里面)。fling没有设置起点坐标和终点坐标,而是根据滑动的起始速度来计算最后会到达的坐标位置。在了解scroller的使用之前,我们来看一下调用示意图据

2015-05-22 16:45:12 1723 2

原创 Scroller类源码解析及其应用(一)

滑动是我们在自定义控件时候经常遇见的难听,让新手们倍感困惑,这篇文章主要介绍Scroller类的源码,告诉打击这个到底有什么用,怎么使用它来控制滑动。另外,我还会结合一个简单的例子,来看一下这个类的应用。要说明Scroller类,我们往往要从另外两个方法说起,一个是ScrollTo(),一个是ScrollBy()这两个方法我们可以在View的源码看到,我们知道其实每个空间都有滚动条,只是有

2015-05-21 21:57:56 2043 2

原创 leetcode--Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.public class Solution { public String m

2015-05-15 23:09:27 608

原创 leetcode--Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]

2015-05-15 20:59:55 656

原创 leetcode--String to Integer (atoi)

Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case

2015-05-14 22:03:57 586

原创 leetcode--First Missing Positive

Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant spa

2015-05-14 21:13:52 520

原创 leetcode--Combination Sum II

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inC where the candidate numbers sums to T.Each number in C may only be used once in the combinatio

2015-05-14 20:19:40 531

原创 leetcode--Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations inC where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numbe

2015-05-14 20:02:29 514

原创 leetcode--Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as "one 2

2015-05-13 18:30:47 588

原创 leetcode--Sudoku Solver

Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution.A sudoku puzzle.

2015-05-13 17:14:04 598

原创 leetcode--Valid Sudoku

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character'.'.A partially filled s

2015-05-13 00:44:35 572

原创 leetcode--Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2015-05-12 21:58:46 566

原创 leetcode--Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found in

2015-05-12 21:23:57 525

原创 leetcode--Search in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array return its

2015-05-12 20:20:52 598

原创 leetcode--Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which

2015-05-12 00:05:31 580

原创 leetcode--Substring with Concatenation of All Words

You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) ins that is a concatenation of each word in words exactly once and w

2015-05-10 20:55:13 583

原创 leetcode--Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible o

2015-05-10 11:06:02 527

原创 leetcode--Implement strStr()

Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.public class Solution { public int strStr(String haystack, String ne

2015-05-09 18:38:14 574

原创 leetcode--Remove Element

Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.public

2015-05-09 00:56:26 779

原创 leetcode--Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another array, you must do this in place with

2015-05-08 19:36:37 656

原创 leetcode--Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.

2015-05-08 17:43:12 543

原创 leetcode--Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You m

2015-05-08 16:30:48 508

原创 leetcode--Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode n

2015-05-08 15:49:58 438

原创 leetcode--Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"

2015-05-08 11:51:20 471

原创 leetcode--Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Definition for singly-linked list. * public class L

2015-05-08 09:43:17 466

原创 leetcode--Valid Parentheses

Given a string containing just the characters '(', ')','{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all valid b

2015-05-08 00:40:47 522

原创 leetcode--4Sum

Given an array S of n integers, are there elements a,b, c, and d in S such that a + b +c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Elements

2015-05-07 21:48:49 498

自定义滚轮控件

自定义滚轮控件

2015-12-13

SuperLoadingProgress

#简介 昨天在简书上看到一篇文章,介绍了一个加载动画的实现过程 [一款Loading动画的实现思路(一)](http://www.jianshu.com/p/1c6a2de68753#) 只可惜原动画是**IOS**上制作的,而看了一下,作者的实现思路比较复杂,于是趁着空闲写了一个**Android版本**,这篇文章将给大家介绍一下实现过程。 首先让我们来看一下动画效果 ![这里写图片描述](http://img.blog.csdn.net/20151211230809602)

2015-12-12

android粒子爆炸

#简介 最近在闲逛的时候,发现了一款**粒子爆炸特效**的控件,觉得比较有意思,效果也不错。 但是代码不好扩展,也就是说如果要提供不同的爆炸效果,需要修改的地方比较多。于是我对源代码进行了一些**重构**,将爆炸流程和粒子运动分离。 对于源码,大家可以参考以下链接

2015-12-04

粒子爆炸特效

#简介 最近在闲逛的时候,发现了一款**粒子爆炸特效**的控件,觉得比较有意思,效果也不错。 但是代码不好扩展,也就是说如果要提供不同的爆炸效果,需要修改的地方比较多。于是我对源代码进行了一些**重构**,将爆炸流程和粒子运动分离。 对于源码,大家可以参考以下链接

2015-12-04

雷达图(蜘蛛网图)

#简介 最近因为项目需求,要实现一款雷达图来表示用户的各种成就值 雷达图的绘制很简单,只要思路清晰按部就班的绘制就可以了,其中使用得最多,是**路径path类**的使用,使用这个类可以让我们更加方便地绘制出**正多边形**等效果。 效果图如下:

2015-12-03

制作粒子爆炸特效

#简介 最近在闲逛的时候,发现了一款**粒子爆炸特效**的控件,觉得比较有意思,效果也不错。 但是代码不好扩展,也就是说如果要提供不同的爆炸效果,需要修改的地方比较多。于是我对源代码进行了一些**重构**,将爆炸流程和粒子运动分离。 对于源码,大家可以参考以下链接

2015-12-02

模仿手机QQ红点消除功能

#简介 手机QQ红点消除的功能大家应该印象很深,我一直奇怪微信为什么不跟进这个功能,毕竟消息太多。 功能图如下: ![这里写图片描述](http://img.blog.csdn.net/20151118101649390) 简单的功能描述是这样的:**新消息到来以后,会出现红点,红点被拉扯,在短距离内出现粘连效果,到达一点距离以后,可以扯断粘连,松手消除红点。** 对于这个功能是怎么实现的呢,我一直很好奇,并且参考了一下两篇文章:

2015-11-18

NineoldAndroids

#简介 [NineoldAndroids](https://github.com/JakeWharton/NineOldAndroids)是Github上一个著名的动画库,简单来说,**NineOldAndroids是一个向下兼容的动画库,主要是使低于API 11的系统也能够使用View的属性动画**。 网上已经有一些文章,介绍了这个库的设计,包括类结构和思想,例如

2015-11-14

ListView的多选模式

#ListView的多选需求 需求驱动技术,最近在项目中又遇到这样一个需求,简单而言就是:**遍历某个文件夹下的所有log文件,然后将它们通过微信发送给别人。** 这个功能很容易实现,但是在实现过程中,我希望自己的产品使用起来更加的人性化,所有我添加了**多文件压缩打包功能,多选,反选,全选等功能**,这样使用者就可以更加合理选择自己需要的log了。 那么问题来了,**ListView应该怎么实现多选功能呢?** <br><br>

2015-11-12

TextView自适应

#TextView问题由来 TextView在中英文夹杂的时候,会出现自动断行的情况,相信许多人都碰见过。这是系统的一个Bug,在Android5.0以后被修复了,而5.0以下的还没有见到比较好的解决版本。 参考了网上的方法,有的朋友推荐使用全角和半角转换(没有解决问题),也有的推荐了JustifyTextView这个控件(效果也不理想)。 于是我决定自定义一个TextView来做这件事,勉强解决了问题,但是代价是失去了很多TextView自身拥有的特性,而且TextView自身做了很多缓存和优化的工作,Google强烈不建议我们去修改这个控件。 我们先来看看实现效果:

2015-11-11

通用Adapter

通过对Adapter的简单封装,我们大大减少了自定义Adapter过程中的麻烦。网上实现多布局Adapter的设计,都是以单个布局Adapter为基类,然后提供一个辅助类来实现多布局。

2015-11-07

Volley加载本地图片

volley加载网络图片 众所周知volley提供了一个ImageLoader类用于网络图片的加载,本质上也是用消息队列的那一套去进行图片请求,只是请求以后做了一些图片本地缓存、缩放、错位处理等内容。 下面我们来看一个简单的加载例子:

2015-11-03

settings.jar

在Android Studio上快速导入Eclipse风格

2015-10-29

接收广播的最高优先级

@SuppressLint("NewApi") public class MainActivity extends Activity { SmsReceiver myReceiver; Button btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btn = (Button) findViewById(R.id.btn); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { test(); } }); } public void test(){ Cursor cursor = null; String defaultSmsApp = Telephony.Sms.getDefaultSmsPackage(this); Intent intent = new Intent(Sms.Intents.ACTION_CHANGE_DEFAULT); intent.putExtra(Sms.Intents.EXTRA_PACKAGE_NAME, this.getPackageName()); startActivity(intent); try { cursor = getContentResolver().query(Uri.parse("content://sms/inbox"), new String[] { "_id", "address", "read" }, "read = ? ", new String[] {"0" }, "date desc"); if (cursor != null) { ContentValues values = new ContentValues(); values.put("read", "1"); for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) { Log.v("cky", "" + cursor.getInt(cursor.getColumnIndex("_id")) + " , " + cursor.getString(cursor.getColumnIndex("address"))); int res = getContentResolver().update(Uri.parse("content://sms/inbox"), values, "_id=?", new String[] { "" + cursor.getInt(cursor.getColumnIndex("_id")) }); Log.i("cky","geng xin = "+res); } } intent = new Intent(Sms.Intents.ACTION_CHANGE_DEFAULT); intent.putExtra(Sms.Intents.EXTRA_PACKAGE_NAME, defaultSmsApp); startActivity(intent); } catch (Exception e) { e.printStackTrace(); } finally { if (cursor != null) { cursor.close(); cursor = null; } } } }

2015-10-29

CircleIndicator

/** * Created by kaiyi.cky on 2015/8/17. */ public class CircleIndicator extends LinearLayout implements ViewPager.OnPageChangeListener{ private ViewPager mViewPager; ViewPager.OnPageChangeListener mListener; private final static int SCROLL_WHAT = 99; MyHandler myHandler; /** * 滚动间隔时间 */ private int spentTime = 3000; /** * 当前显示的序号 */ private int curIndex = 1; /** * 圆点半径 */ private int circleRadiu = 10; /** * 圆点内边距 */ private int circlePadding = 3; /** * 圆点数目 */ private int circleCount = 0; /** * 滑动方向 * 1为向右,-1为向左 */ private int direction = 1; public CircleIndicator(Context context) { super(context); init(); } public CircleIndicator(Context context, AttributeSet attrs) { super(context, attrs); init();

2015-08-22

SVGPathView

/** * PathView is an View that animate paths. */ public class PathView extends View { /** * Logging tag. */ public static final String LOG_TAG = "PathView"; /** * The paint for the path. */ private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); /** * Utils to catch the paths from the svg. */ private final SvgUtils svgUtils = new SvgUtils(paint); /** * All the paths provided to the view. Both from Path and Svg. */ private List<SvgUtils.SvgPath> paths = new ArrayList<SvgUtils.SvgPath>(0); /** * This is a lock before the view is redrawn * or resided it must be synchronized with this object. */ private final Object mSvgLock = new Object(); /** * Thread for working with the object above.

2015-08-17

EventBus代码

public class EventBus { HashMap<Class<?>,ArrayList<Subscription>> subscriptionsByEventType = new HashMap<Class<?>,ArrayList<Subscription>>(); MainThreadHandler mainThreadHandler = new MainThreadHandler(this,Looper.getMainLooper()); AsyThreadHandler asyThreadHandler = new AsyThreadHandler(this); private final static EventBus instance = new EventBus(); public static EventBus getInstance(){ return instance; } private EventBus(){};

2015-08-11

VerticalScrollView

/** * Created by kaiyi.cky on 2015/8/5. * 跑马灯控件 */ public class VerticalScrollView extends ScrollView{ private LinearLayout mLinearLayout; /** * 当前显示的序号 */ private int curIndex = 1; /** * 滚动方向 * 1为向下,-1为向上 */ private int direction = 1; /**

2015-08-09

PullScrollView

/** * Created by kaiyi.cky on 2015/7/24. */ public class PullBlurScrollView extends ScrollView { /**头部**/ private View mHeader; /**主体**/ private View mContentView; /** 模糊图片 **/ private BlurDrawable mBlurDrawable; /** 阻尼系数,越小阻力就越大. */ private static final float SCROLL_RATIO = 0.5f; /** 当前头部状态 */ private State mState = State.NORMAL; /** 头部总高度 */ private int mHeaderHeight; /** 头部可视高 */ private int mHeaderVisibleHeight; /** 头部图片初始顶部和底部. */ private int mInitTop, mInitBottom; /** 头部图片拖动时顶部和底部. */ private int mCurrentTop, mCurrentBottom; /** 首次点击的Y坐标. */ private PointF mStartPoint = new PointF(); /** ScrollView的content view矩形,用于记录content的初始位置情况 */ private Rect mContentRect = new Rect(); /** 是否移动到顶部位置. */ private boolean isTop = false; /** 是否关闭ScrollView的滑动. */ private boolean mEnableTouch = false; /** 是否开始移动. */ private boolean isMoving = false; private enum State { /**顶部*/ UP, /**底部*/ DOWN, /**正常*/ NORMAL } public PullBlurScrollView(Context context) { super(context); init(context,null); }

2015-07-30

DrawerArrowDrawable

/** A drawable that rotates between a drawer icon and a back arrow based on parameter. */ public class DrawerArrowDrawable extends Drawable { /** * Joins two {@link Path}s as if they were one where the first 50% of the path is {@code * PathFirst} and the second 50% of the path is {@code pathSecond}. * 合并两个路径,前50%为路径1,后50%为路径2 */ private static class JoinedPath { private final PathMeasure measureFirst; private final PathMeasure measureSecond; private final float lengthFirst; private final float lengthSecond; private JoinedPath(Path pathFirst, Path pathSecond) { //PathMeasure类用于提供路径上的点坐标 measureFirst = new PathMeasure(pathFirst, false); measureSecond = new PathMeasure(pathSecond, false); lengthFirst = measureFirst.getLength(); lengthSecond = measureSecond.getLength(); }

2015-06-02

CircularProgressButton

package com.example.androidtest.view; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.StateListDrawable; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.util.StateSet; import android.widget.Button; import com.example.androidtest.R; public class CircularProgressButton extends Button { /** * 状态代号 * 0为初始状态,-1失败状态,100为完成状态,50为不明确中间状态 */ public static final int IDLE_STATE_PROGRESS = 0; public static final int ERROR_STATE_PROGRESS = -1; public static final int SUCCESS_STATE_PROGRESS = 100; public static final int INDETERMINATE_STATE_PROGRESS = 50; /** * 背景StrokeGradientDrawable * A Drawable with a color gradient for buttons, backgrounds, etc. * It can be defined in an XML file with the element. */ private StrokeGradientDrawable background; /** * 环形动画背景 */ private CircularAnimatedDrawable mAnimatedDrawable; /** * 环形进度背景 */ private CircularProgressDrawable mProgressDrawable; /** * ColorStateList对象可以在XML中定义,像color一样使用,它能根据它应用到的View对象的状态实时改变颜色 * 当每次状态改变时,StateList都会从上到下遍历一次,第一个匹配当前状态的item将被使用——选择的过程不是基于“最佳匹配”, * 只是符合state的最低标准的第一个item。 */ private ColorStateList mIdleColorState; /** * 完成状态ColorStateList */ private ColorStateList mCompleteColorState; /** * 失败状态ColorStateList */ private ColorStateList mErrorColorState; /** * 用于根据状态改变drawable * 初始状态背景 */ private StateListDrawable mIdleStateDrawable;

2015-05-30

xlistview代码

/** * @file XListView.java * @package me.maxwin.view * @create Mar 18, 2012 6:28:41 PM * @author Maxwin * @description An ListView support (a) Pull down to refresh, (b) Pull up to load more. * Implement IXListViewListener, and see stopRefresh() / stopLoadMore(). */ package com.example.androidtest.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.animation.DecelerateInterpolator; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.Scroller; import android.widget.TextView; import com.example.androidtest.R; public class XListView extends ListView implements OnScrollListener { private float mLastY = -1; // save event y /** * 用于下拉后,滑动返回 */ private Scroller mScroller; // used for scroll back private OnScrollListener mScrollListener; // user's scroll listener // the interface to trigger refresh and load more. private IXListViewListener mListViewListener; /** * 下拉头部 */

2015-05-25

datepicker

datepicker源代码. public class NumberPicker extends View { //基本设置 /** * picker宽度 */ private int mWidth; /** * picker高度 */ private int mHeight; /** * 声效 */ private Sound mSound; /** * 是否开启声效 */ private boolean mSoundEffectEnable = true;

2015-05-23

金尚在线商城项目源码

金尚在线商城项目源码

2014-08-05

php注册登录

php注册登录

2012-12-01

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除