This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
这里有两个package: | |
com.Harris.qqsliding_view/SlidingMenu.java | |
com.Harris.qqslidingview/MainActivity.java | |
SlidingMenu.java代码部分 | |
package com.Harris.qqsliding_view; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.util.DisplayMetrics; | |
import android.util.TypedValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ScrollView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<LinearLayout android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="vertical"> | |
<android.support.v4.widget.NestedScrollView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collection; | |
import java.util.List; | |
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.RejectedExecutionHandler; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mRecyclerView= (RecyclerView) findViewById(R.id.recyclerview); | |
layoutManager=new LinearLayoutManager(this); | |
mRecyclerView.setLayoutManager(layoutManager); | |
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST)); | |
adapter=new SimpleAdapter(this,mDatas); | |
mRecyclerView.setAdapter(adapter); | |
mSwipeRefreshLayout= (SwipeRefreshLayout) findViewById(R.id.swiperefreshlayout); | |
mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, | |
android.R.color.holo_orange_light, android.R.color.holo_red_light); | |
//此处是android自带的只支持下拉刷新 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package android.os; | |
import java.util.ArrayDeque; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.CancellationException; | |
import java.util.concurrent.Executor; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.FutureTask; | |
import java.util.concurrent.LinkedBlockingQueue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.util.*; | |
import java.util.Map.Entry; | |
public class B { | |
public static void main(String[] args) { | |
Map<Integer,Integer> mm = new HashMap<Integer,Integer>(); | |
for(int i=0;i<10;i++) { | |
mm.put(i, i); | |
} | |
for( Entry<Integer, Integer> e : mm.entrySet()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* * 文 件 名: DataCleanManager.java * 描 述: 主要功能有清除内/外缓存,清除数据库,清除sharedPreference,清除files和清除自定义目录 */ | |
import java.io.File; | |
import android.content.Context; | |
import android.os.Environment; | |
/** * 本应用数据清除管理器 */ | |
public class DataCleanManager { | |
/** * 清除本应用内部缓存(/data/data/com.xxx.xxx/cache) * * @param context */ | |
public static void cleanInternalCache(Context context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://..... | |
git add . | |
git commint -m "First Commit" | |
git push origin master | |
改变云端文件后,本地需要 | |
git pull origin master | |
才能进行操作 | |
之后本地更改需要重复上面的add-commit-push操作。 | |
git init将本地文件初始化为一个仓库,也就是生成一个.git隐藏文件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import android.util.Log; | |
public class LogUtil { | |
private static final boolean DEBUG = true; | |
public static void d(String TAG, String method, String msg) { | |
Log.d(TAG, "[" + method + "]" + msg); |
OlderNewer