自定义博客皮肤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--Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.题意:给定二叉树,查找最长路径分类:二叉树解法1:递

2015-08-01 22:32:54 953

原创 leetcode--Count Complete Tree Nodes

Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, except possibly the last, is completely filled,

2015-08-01 20:21:24 914

原创 leetcode--Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find thekth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the BST

2015-08-01 15:03:29 856

原创 leetcode--Lowest Common Ancestor of a Binary Tree

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes

2015-08-01 14:32:36 1324

原创 leetcode--Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betwee

2015-08-01 11:42:09 1121

原创 leetcode--Recover Binary Search Tree

Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devise a

2015-08-01 10:46:31 1059

原创 PullScrollView源码解析

PullScrollView是Github上面的一个开源项目,主要用于实现下拉时头部伸缩的效果,项目地址见https://github.com/MarkMjw/PullScrollView大家先来看一下实现的效果图(图侵删)但是由于这个项目的代码比较复杂,而实际上不这样做也可实现效果,我在网上找了另外一篇介绍pullScrollView的文章,写得非常好,本文也只是基于文章http

2015-07-30 10:47:29 1561

原创 android图片处理之图像模糊

这篇文章将给大家介绍android图片处理的高效做法,大家有需求的时候可以参考一下。首先我要说明一下本实例中实现的效果(我还不会制作gif图,如果谁会的话,希望可以教一下我):通过手指对图片的上下滑动,实现图片的逐渐模糊效果。找网上找了一张效果图如下(侵权请通知删除):下面我来讲解一下效果制作的思路。首先是对图像的模糊处理,最常见的模糊处理方式是高斯模糊,高斯模糊指

2015-07-23 20:07:24 8961 3

原创 SharedPreferencesCompat的由来与简单解析

最近在读项目源码的时候,发现一个SharedPreferencesCompat类,这个类做了一些简单的工作,后来google之后理解了这种写法的缘由,在这里跟大家分享一下。首先我们直接来看这个类的源码,很简短/** * Reflection utils to call SharedPreferences$Editor.apply when possible, * falling b

2015-07-23 19:21:45 2952

原创 leetcode--Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return 6.分类:二叉树

2015-07-11 00:16:28 975

原创 leetcode--Binary Tree Postorder Traversal

Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].分类:二叉树题意:后续遍历二叉树解

2015-06-30 16:00:42 846

原创 volley源码解析(七)--最终目的之Response<T>

在上篇文章中,我们最终通过网络,获取到了HttpResponse对象HttpResponse是android包里面的一个类,然后为了更高的扩展性,我们在BasicNetwork类里面看到,Volley将其包装成一个Volley自己的对象NetworkResponse另外,在BasicNetwork类中我们也注意到,对HttpResponse包装成NetworkResponse的过程中,使用

2015-06-24 00:30:59 3122 1

原创 volley源码解析(六)--HurlStack与HttpClientStack之争

Volley中网络加载有两种方式,分别是HurlStack与HttpClientStack,我们来看Volley.java中的一段代码if (stack == null) {//如果没有限定stack if (Build.VERSION.SDK_INT >= 9) {//adk版本在9或者以上 stack = new HurlStack(

2015-06-23 22:16:29 3234 1

原创 leetcode--Populating Next Right Pointers in Each Node II

Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant extr

2015-06-23 00:18:38 871

原创 leetcode--Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return 5.N

2015-06-21 12:39:58 569

原创 leetcode--Implement Stack using Queues

mplement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return wheth

2015-06-21 11:43:47 537

原创 leetcode--Combination Sum III

Find all possible combinations of k numbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.Ensure that numbers wit

2015-06-21 11:24:51 580

原创 leetcode--House Robber II

Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time

2015-06-21 09:54:11 563

原创 leetcode--Add and Search Word - Data structure design

Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regular expression string containing only letter

2015-06-20 23:02:30 650

原创 leetcode--Minimum Size Subarray Sum

Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead.For example, given the array [2,3,1

2015-06-20 21:26:40 824

原创 leetcode--Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.Note:You may assume that all inputs are consist of lowercase letters a-z.class TrieNode { // Initialize your data structure here.

2015-06-20 20:51:00 690

原创 leetcode--Bitwise AND of Numbers Range

Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4.public class Solution { public int rangeBitwiseAnd(int m, int n) { int i = 0; while(n!=m){

2015-06-20 19:29:22 602

原创 leetcode--Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume

2015-06-20 17:03:37 570

原创 leetcode--Binary Tree Right Side View

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tree, 1

2015-06-20 16:41:08 871

原创 leetcode--Largest Number

Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is9534330.Note: The result may be very

2015-06-20 16:08:17 574

原创 leetcode--Binary Search Tree Iterator

Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next() and

2015-06-20 15:02:08 940

原创 leetcode--Fraction to Recurring Decimal

Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating, enclose the repeating part in parentheses.For

2015-06-20 14:52:40 494

原创 leetcode--Find Peak Element

A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in that

2015-06-20 13:53:56 597

原创 leetcode--Integer to Roman

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.public class Solution { public String intToRoman(int num) { int[] radix = new in

2015-06-20 13:44:50 553

原创 leetcode--Roman to Integer

Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.public class Solution { public int romanToInt(String s) { int res = 0; for(int i=0;i

2015-06-20 13:32:59 526

原创 leetcode--Find Minimum 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).Find the minimum element.You may assume no duplicate exists in the arra

2015-06-20 13:13:09 555

原创 剑指offer--旋转数组的最小数字

把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。import java.util.ArrayList;public class Solution { public int minNumberInRotateArray(int

2015-06-20 13:09:38 1280

原创 leetcode--Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the largest pr

2015-06-20 13:02:50 595

原创 leetcode--Reverse Words in a String

Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C programmers: Try to solve it in-place in O(1

2015-06-19 23:37:13 538

原创 leetcode--Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "+",

2015-06-19 23:04:05 495

原创 leetcode--Sort List

Sort a linked list in O(n log n) time using constant space complexity./** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x)

2015-06-19 18:34:05 454

原创 leetcode--Insertion Sort List

Sort a linked list using insertion sort./** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */public c

2015-06-19 18:30:12 466

原创 leetcode--Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3]./** * Definition for a binary tre

2015-06-19 18:15:44 769

原创 leetcode--Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it to {1,4

2015-06-19 18:10:51 460

原创 leetcode--Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked list. * cl

2015-06-19 17:40:53 462

自定义滚轮控件

自定义滚轮控件

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关注的人

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