自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

我是北上君

Java/android

  • 博客(75)
  • 资源 (1)
  • 收藏
  • 关注

原创 源码注释:SlidingMenu(一)

import android.annotation.SuppressLint;import android.annotation.TargetApi;import android.app.Activity;import android.content.Context;import android.content.res.TypedArray;import android.graphi...

2018-04-26 19:33:44 231

原创 源码注释:StickyListHeadersListView

// 其他的文章:https://blog.csdn.net/ldstartnow/article/details/52454223import android.annotation.SuppressLint;import android.annotation.TargetApi;import android.content.Context;import android.content....

2018-04-25 19:23:22 622

原创 源码注释:ViewDragHelper

import android.content.Context;import android.os.Build;import android.support.v4.view.ViewCompat;import android.util.Log;import android.view.MotionEvent;import android.view.VelocityTracker;imp...

2018-04-25 18:26:13 334

原创 源码注释:Animation的一些应用

/** * Animation例子 * <p> * PositionAndSizeAnimation * PieRenderer * BaseCardView * SwitchCompat * AppTransition * FloatingToolbar * CurvedTranslateAnimation * BaseCardView * CircularPr...

2018-04-25 18:13:51 253

原创 源码注释:Animation

import android.content.Context;import android.content.res.TypedArray;import android.graphics.RectF;import android.os.Handler;//import android.os.SystemProperties;import android.util.AttributeSe...

2018-04-25 16:29:09 470

翻译 ViewDragHelper的应用:SwpieBackLayout(源码注释)

// 参考地址:https://blog.csdn.net/vv_bug/article/details/53063985 import static android.view.Display.DEFAULT_DISPLAY;import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;pu...

2018-04-24 09:32:07 258

原创 文章标题

List remote repo git remote -v你的项目添加一个新的远端仓库 git remote add alias1 <url1> git remote add alias2 <url2>删除现存的某个别名 git remote rm aliasgit fetch 会使你与另一仓库同步,提取你本地所没有的数据,为你在同步时的该远端的每一分支提供书签。 这些分支被叫做“远端分支”,除

2016-04-22 11:03:47 354

原创 欢迎使用CSDN-markdown编辑器

查看和配置环境git config --list git config --global user.name "yourname"git config --global user.email "youremail"clone a repo:get clone url --recursiveView all branchsgit branch -acheck remote branch to l

2016-04-22 10:59:23 702

转载 RxJava实例(三)

问题:如何在http请求出错的时候重试?进一步,如何动态添加重试次数和间隔时间?如何实现定时轮询?方式有很多,用RxJava如何优雅地实现?不知道,请看这篇文章。(From:http://www.jianshu.com/p/023a5f60e6d0)retry/retryWhen/repeat/repeatWhen当.repeat()接收到.onCompleted()事件后触发重订阅。当.

2016-04-02 17:33:53 821

转载 RxJava实例(二)

RxBus(From http://nerds.weddingpartyapp.com/tech/2014/12/24/implementing-an-event-bus-with-rxjava-rxbus/)事件总线// this is the middleman objectpublic class RxBus { private final Subject<Object, Object>

2016-04-02 16:02:47 739

转载 RxJava实例(一)

RxJava实例涉及到:flatmap、filter、take、doOnNext假设有两个api// 据输入的字符串返回一个网站的url列表(搜索引擎)Observable<List<String>> query(String text);// 返回网站的标题,如果404了就返回nullObservable<String> getTitle(String URL);目标1:希望构建一个健壮系统,

2016-04-02 15:23:18 818

转载 Linux Select/Epoll注记

Select#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <unistd.h>#include <fcntl.h>#define SERV_PORT 8888#de

2016-03-18 21:39:26 428

转载 动态加载基础一

类加载器包括BootStrap、Extension、App Classloader以及自定义类加载器。BootStrap ClassLoader称为启动类加载器,是Java类加载层次中最顶层的类加载器,负责加载JDK中的核心类库,如:rt.jar、resources.jar、charsets.jar等,根类加载器的实现依赖于底层操作系统,属于虚拟机的实现的一部分,它并没有继承java.lang.Cl

2016-03-11 21:16:51 407

转载 Android 各个状态的区别

http://stackoverflow.com/questions/11504860/what-is-the-difference-between-the-states-selected-checked-and-activated-in-and

2016-03-10 21:34:59 298

转载 Test之guava

import static com.google.common.primitives.Shorts.checkedCast;import java.util.ArrayList;import java.util.List;import org.junit.Test;import com.google.common.base.Preconditions;public class Preconditi

2016-03-10 21:22:58 352

原创 Java线程基础一

1.Object#wait让调用线程等待,并且只能在获取了这个对象(就是wait方法所属的对象)的锁(monitor)的线程中执行(This method can only be invoked by a thread which owns this object’s monitor),也就是说调用此方法,线程必须先获取monitor(否则抛出IllegalMonitorStateException

2016-03-08 19:43:56 429

原创 OnCreateContextMenuListener,MultiChoiceModeListener和OnLongClickListener的优先级

查看短信源码的时候,对于以下代码,发现一个问题:listView.setOnCreateContextMenuListener(mConvListOnCreateContextMenuListener); listView.setOnKeyListener(mThreadListKeyListener); listView.setChoiceMode(ListView

2016-03-06 21:18:17 952

转载 Python http请求(读取代理ip列表)

例子:读取代理ip列表知识点beautifulsoup4urllib & urllib2 & httplib2网络请求文件操作#encoding=utf-8# from fib import fibonacci# 这个声明不会把整个fib模块导入到当前的命名空间中,它只会将fib里的fibonacci单个引入到执行这个声明的模块的全局符号表from bs4 import Beautif

2016-03-05 17:17:14 3344

转载 Python扫描端口

Python扫面端口包含的知识点:–多线程,锁 –socket#encoding=utf-8# __author__ = 'wangshenglong'import socketimport threadingrouters = []lock = threading.Lock()# 实际上可以认为是端口扫描,程序只是粗略地检查是否开放了80端口。# timeout可以设置成1秒或2秒。lo

2016-03-05 15:33:45 592

原创 文章标题

Style array解析<integer-array name="my_array"> <item>@drawable/pencil</item> <item>@drawable/pencil2</item> <item>@drawable/pencil3</item> <item>@drawable/pencil4</item> <item>@drawable/pencil5</ite

2015-06-03 15:35:42 572

原创 Python Note

Python Note获取当前工作目录 workpath = os.path.dirname(os.path.realpath(__file__))获取PATH path = os.environ.get('PATH', '')展开当前用户目录 COCOS2D_PREFIX = os.path.expanduser('~/.cocos2d')check python版本def _ch

2015-06-03 14:11:20 416

原创 Shell分割迭代字符串

Shell分割迭代字符串

2015-03-24 11:22:17 2312

原创 Lua基础(2)

-------------------------------------------------------算数运算 a = 10 b = -3 r = a % b --a - floor(a/b) * b,结果与与b的符号相同 print(r) a = 10.3 n = a % 1 --去正实数的小数部分:0.3 p = a - n --取正实数的整数部分:

2014-08-20 18:32:51 487

原创 Lua基础(1)

--=========================--注释--[[ main()--]]--print(factor(3))--=========================-- type-- 八大类型:thread/function/table/userdata/string/number/boolean/nilprint("Test type");print(ty

2014-08-20 14:22:43 628

翻译 Android NDK Stable APIs

每个api对应一系列头文件,一个共享库包含一系列的实现,这些必须链接到你的本地代码。如果你需要使用系统库Foo,需要包含,在加载时还要告诉build system你需要链接/system/lib/libfoo.so,此时需要这么做。  LOCAL_LDLIBS := -lfoobuild system自动链接C library、数学库以及C++支持库,因此在LOCA

2014-08-08 16:14:01 1004

转载 [IOS基础]property和synthesize

property和synthesize【一】Student.h--------------------------------------------@interface Student : NSObject {int number;}//生成getter和setter声明@property int number// -(void) setNum

2014-06-12 23:06:41 471

转载 Java中仿照C#代理

http://stackoverflow.com/questions/1184418/javas-equivalents-of-func-and-actionC#中拥有ActionheAction DelegateFunc Delegate

2014-05-10 23:49:21 1166

转载 A Java Programmer Looks at C# Delegates

A Java Programmer Looks at C# DelegatesAbstractWhile C# has a set of capabilities similar to Java, it has added several new and interesting features. Delegation is the ability to treat a met

2014-05-10 22:38:35 769

转载 图片和文字居中

Custom drawn Android button which aligns left drawable and its text to center.https://gist.github.com/rajivnarayana/5224881package com.webileapps.myrtprofile; import android.content.Context;i

2014-03-31 19:21:48 1154

转载 Android plurals

http://stackoverflow.com/questions/5651902/android-plurals-treatment-of-zerohttps://code.google.com/p/android/issues/detail?id=8287pluralsAndroid中plurals表示单复数,但是对于0是不起作用的,比如 Fr

2014-03-31 18:36:18 761

转载 Android apk签名

http://www.zhihu.com/question/20749413http://www.cnblogs.com/tanlon/archive/2012/07/09/2583661.htmlhttp://blog.csdn.net/wulianghuan/article/details/18400581原理: 1、签名过的包会在apk中生成META-INF文件夹,并创建

2014-03-25 11:24:07 1276

转载 Android编译

Android “invalid resource directory name bin/res/crunch”原因分析:这种情况是版本不一致造成的,这个无效的目录不是当前编译的时候生成的,有可能是Debug情况下,生成的。解决方案:用命令 $ rm -fR $(find . -type d -name crunch|xargs) 删除即可。或者直接 $ rm cr

2014-03-21 11:42:07 801

原创 IDEA+maven使用最新版本的support-v4-r19

maven使用support-v4最新版本是r7,没有r19 。比如ActionBarSherlock do not have latest support library(https://github.com/JakeWharton/ActionBarSherlock/pull/853):作者说:We cannot update the support library sin

2014-03-18 21:14:13 2817

转载 Android资源

http://blog.tisa7.com/android_open_source_projectshttp://www.zhihu.com/question/20377285

2014-03-18 20:01:58 664

转载 Fragment保存状态

Fragment保存状态http://stackoverflow.com/questions/11353075/how-can-i-maintain-fragment-state-when-added-to-the-back-stackIf you return to a fragment from the back stack it does not re-cre

2014-03-18 16:57:46 1865

转载 Genymotion 2.0之后安装Google Play

Genymotion 2.0之后安装Google Playhttp://stackoverflow.com/questions/20121883/how-to-install-google-play-service-in-the-genymotion-ubuntu-13-04-currently-iGenymotion tablet version emulator doesn

2014-03-18 11:03:28 3636

转载 Git Note

clone a repo:get clone url --recursiveCreate the branch on your local machine :$ git branch Push the branch on github :$ git push origin Switch to your new branch :$ git checkout Delete a

2014-03-17 16:50:59 659

原创 关于Loader的笔记

LoadManagerFragmentActivity#getSupportLoaderManager(Fragment#getLoaderManager)都是调用FragmentActivity#getLoaderManagerFragmentActivity和LoaderManager的生命周期FragmentActivity#onStartF

2014-03-12 17:08:45 904

原创 JNI获取Bitmap轮廓

Color类#ifndef COLORGETTER_H_#define COLORGETTER_H_class Color {public: Color(int color): color(color) {}; int alpha() { return (color & 0xFF000000) >> 24; } int R() { return (color & 0x

2014-01-28 10:36:19 875

原创 关于资源Resource

// R.array.bg_folder_list// ArrayList> localArrayList = new ArrayList>();// ta = getActivity().getResources().obtainTypedArray(this.arrayResId);// int i = ta.length();// for (int index = 0; in

2014-01-07 16:01:00 2654

gradle-wrapper.tar

博客(Flutter搭建环境的下载Gradle Wrapper的问题的一个解决方式) http://blog.csdn.net/xjwangliang/article/details/78042740

2017-09-20

空空如也

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

TA关注的人

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