- 博客(81)
- 资源 (3)
- 收藏
- 关注
原创 自定义slideMenu
public class SlideLayout extends FrameLayout{ private View menuView; private int menuItemHeight,menuItemWidth; private Scroller scroller; private boolean isOpen= false; public SlideL
2016-06-29 21:23:39 297
原创 自定义ToggleButton
ToggleButton .javapublic class ToggleButton extends View{ private ToggleState toggleState; private Bitmap switchBg; private Bitmap slideBg; private int currentX; private boolean isSl
2016-06-29 20:48:40 410
原创 listView的item侧滑显示操作
SlideDeleteView.javapublic class SlideDeleteView extends FrameLayout { private View item_content; private View item_menu; private int itemContentWidth; private int itemContentHeight;
2016-06-29 13:40:45 388
原创 简谈属性动画
属性动画组成部分、相关类介绍: 1.ObjectAnimator :对象动画执行类。 2.ValueAnimator :值动画执行类,常配合AnimatorUpdateListener使用。 3.PropertyValuesHolder : 属性存储器,为两个执行类提供更新多个属性的功能。 4.Keyframe :为 PropertyValuesHolder提供多个关键帧的操作值。 5.A
2016-06-29 13:34:52 248
原创 自定义水波纹View
public class WaveView extends View { private Random random = new Random(); private List<Circle> list; private Handler mHandler = new Handler() { @Override public void handleM
2016-06-29 12:52:35 272
原创 popupWindow和listView那些事之自定义下拉框
public class MainActivity extends Activity { private PopupWindow pw; private ListView listView; private BaseAdapter adapter; private List<String> list; private TextView textView;
2016-06-29 12:50:22 489
原创 ListView的item点击问题
如果listView的item中有Button,checkbox等会强制获取焦点的view,此时,listView的item无法获取焦点,从而无法被点击解决办法:给item的根布局添加 android:descendantFocusability=”blocksDescendants”
2016-06-29 12:39:44 293
原创 DensityUtils
public class DensityUtils { /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) { final float density = context.getRe
2016-06-28 22:28:34 663
原创 Scroller
private Scroller scroller; scroller = new Scroller(context); scroller.startScroll(getScrollX(), getScrollY(), -getScrollX(), - getScrollY());invalidate(); ---------- @Override public voi
2016-06-27 22:23:22 305
原创 自定义SlideMenu
SlideLayout.javapublic class SlideLayout extends FrameLayout{ private View menuView; private int menuItemHeight,menuItemWidth; private Scroller scroller; private boolean isOpen= false;
2016-06-27 22:20:13 314
原创 android canvas使用line画半园
LineView.javapublic class LineView extends View { private int progress = 0; private int max = 100; private int roundWidth = 50; public LineView(Context context) { super(context)
2016-06-26 17:36:01 1174
原创 自定义进度圆环
CycleBar.javapublic class CycleBar extends View { private int roundWidth = 25; private int progress=0; private int max = 100; private String text="点击开始"; private boolean start=false
2016-06-26 17:31:48 280
原创 获取联系人
Contact .javapublic class Contact { String name ; String phone; public Contact() { } public Contact(String name, String phone) { this.name = name; this.phone = phone;
2016-06-26 13:37:33 305
原创 View抖动
shake.xml<?xml version="1.0" encoding="utf-8"?><translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0" android:toXDelta="10" android:duration="1000"
2016-06-26 13:33:38 425
原创 自定义SlideBar
/** * Created by 新火燎塬 on 2016/6/24. 以及 on 18:39!^-^ */public class SliderBar extends View { private Paint paint ; private String item[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
2016-06-26 13:24:34 1038
转载 Pinyin4j - utils
PinYinUtils .javapublic class PinYinUtils { /** * 得到指定汉字的拼音 * 注意:不应该被频繁调用,它消耗一定内存 * @param hanzi * @return */ public static String getPinYin(String hanzi){ Stri
2016-06-26 13:13:08 1186
转载 通用ListAdapter
CommonBaseAdapter.javapublic abstract class CommonBaseAdapter<T> extends BaseAdapter { private Context context; private List<T> data; private int layoutId; public CommonBaseAdapter(Contex
2016-06-26 13:00:15 313
原创 Android控件绑定menu键
控件.setFocusableInTouchMode(true); 控件.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) {
2016-06-24 09:27:17 587
原创 FloatingActionButton
自定义FloatingActionsMenupublic class FloatingActionsMenu extends ViewGroup { public static final int EXPAND_UP = 0; public static final int EXPAND_DOWN = 1; public static final int EXPAND_LEFT = 2;
2016-06-22 14:45:17 846
原创 actionBar之searchView
option_menu.xml<menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/menu_search" android:actionViewClass="android.widget.SearchView"
2016-06-22 14:37:20 519
转载 Android ActionBar的基本用法
1、ActionBar的简介ActionBar位于Activity的顶部,可用来显示activity的标题、Icon、Actions和一些用于交互的View。它也可被用于应用的导航。 ActionBar 是在Android 3.0(API 11)中加入到SK中的,想在低版本中使用ActionBar需要Support Library v7。 下面是一张使用ActionBar的界面截图:其中,[1]
2016-06-22 14:34:47 429 1
原创 xUtils之FileUtil
功能强大的FileUtil public class FileUtil { private FileUtil() { } public static File getCacheDir(String dirName) { File result; if (existsSdcard()) { File cacheDir = x.
2016-06-22 08:52:08 408
原创 xUtils之网络请求
RequestParams params = new RequestParams("http://blog.csdn.net/mobile/experts.html");x.http().get(params, new Callback.CommonCallback<String>() { @Override public void onSuccess(String result)
2016-06-22 08:47:39 362
原创 xUtils之操作数据库
初始化数据库public class MyJApplication extends Application { private DbManager.DaoConfig daoConfig; public DbManager.DaoConfig getDaoConfig() { return daoConfig; } @Override publ
2016-06-22 08:45:18 448
转载 xUtils之加载图片
使用xUtils的第一步就是必须创建自己的Application类,代码如下//在manifest.xml中注册public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); x.Ext.init(this);/
2016-06-22 08:33:51 3646
原创 xUtils之IOC框架
使用xUtils的第一步就是必须创建自己的Application类,代码如下//在manifest.xml中注册public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); x.Ext.init(this);/
2016-06-22 00:05:05 513
原创 显示ProgressDialog
private ProgressDialog pd;/** * 显示一个圆形进度框 * * @param msg * @param isHorizon */private void showProgressDialog(String msg, boolean isHorizon) { pd = new ProgressDialog(this); if (isHorizo
2016-06-21 23:57:17 300
原创 检查校准网址前缀
public static String checkUrlPre(String url) { if (!url.startsWith("http")) { url = "http://" + url; } return url;}
2016-06-21 23:55:24 353
原创 ImageOptions
public static ImageOptions smallImageOptions; public static ImageOptions bigImageOptions;static { smallImageOptions = new ImageOptions.Builder() .setImageScaleType(ImageView.ScaleT
2016-06-21 23:54:00 854
原创 自定义AdapterBase-ListView
public abstract class AdapterBase extends BaseAdapter { public List list; public Context context; public List getList() { return list; } public void setList(List list) {
2016-06-21 23:52:21 208
原创 自定义checkbox样式
在drawable下新建cb_selector.xml<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/cb_select" android:state_ch
2016-06-21 23:48:04 225
原创 RecyclerViewAdapterBase
public abstract class AdapterBase<T> extends RecyclerView.Adapter{ private List<T> list; public AdapterBase(List<T> list) { this.list = list; } public interfa
2016-06-21 23:38:47 176
原创 ViewPagerAdapter模版
public class MyViewPagerAdapter extends PagerAdapter { private List<T> list; public MyViewPagerAdapter(List<ImageBean> list) { super(); this.list = list; } @Override
2016-06-21 23:35:49 377
转载 Jsoup文档
入门解析和遍历一个html文档如何解析一个HTML文档:String html = "<html><head><title>First parse</title></head>" + "<body><p>Parsed HTML into a doc.</p></body></html>";Document doc = Jsoup.parse(html);(更详细内容可查看 解析一个HTM
2016-06-21 23:29:49 555
原创 onCreate()中设置屏幕常亮
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 保持屏幕常亮 getWindow().setFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_O
2016-06-20 10:45:14 301
原创 设置随机颜色
Random r = new Random();v.setBackgroundColor(r.nextInt(Integer.MAX_VALUE )| 0xff000000);
2016-06-19 17:08:26 746
原创 AS之NDK开发流程
1. 安装配置NDK 1). 解压NDK的zip包到非中文目录 2). 配置path : 解压后NDK的根目录----->ndk-build2. 给AS配置关联NDK 1). local.properties中添加配置 ndk.dir=D\:\\android-ndk32-r10-windows-x86_64\\android-ndk-r10 2). gradle.prope
2016-06-19 13:53:12 2993
原创 JNI之C语言(七)-- 其他
7. 其它 函数指针 理解 当一个指针指向的是一个函数时称为函数指针 定义 返回值类型 (*指针名)(形参类型列表); int (*funP)(int, int) 使用 函数指针名=函数名 funP = fun 作为实参传递给调用的函数 测试 函数指针作为实参传递 结构 理解 在程序中有时需要操作一个复合型(包含多个属性)
2016-06-19 13:50:50 261
pinyin4j.jar
2016-06-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人