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
public static abstract class OnLastItemVisibleListener extends RecyclerView.OnScrollListener implements OnScrollToBottomListener { | |
private String TAG = getClass().getSimpleName(); | |
public enum LAYOUT_MANAGER_TYPE { | |
LINEAR, | |
GRID, | |
STAGGERED_GRID | |
} |
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
/* | |
* Copyright (C) 2013 Andreas Stuetz <andreas.stuetz@gmail.com> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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.wang.avi.indicator; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.view.animation.LinearInterpolator; | |
import com.nineoldandroids.animation.ValueAnimator; | |
/** | |
* Created by Jack on 2015/10/19. |
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
Execution failed for task ':CCVoice:dexDevDebug'. | |
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process dk1.7.0_75.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3 | |
只需要在 build.gradle中加入 | |
dexOptions { | |
jumboMode true | |
javaMaxHeapSize "4g" //加大内存分配 | |
} |
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
#指定代码的压缩级别 | |
-optimizationpasses 5 | |
#包明不混合大小写 | |
-dontusemixedcaseclassnames | |
#不去忽略非公共的库类 | |
-dontskipnonpubliclibraryclasses | |
#优化 不优化输入的类文件 |
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
defaultConfig { | |
multiDexEnabled = true | |
} | |
lintOptions{ | |
abortOnError false | |
} | |
//使编译debug环境是在version21以上的,会预先执行preDexDebug,提高编译效果 | |
//在gradle的配置中勾选界面中的选项 |
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
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="@drawable/selector_message_bg" //selector 背景 | |
android:orientation="vertical" | |
android:clickable="true" //如果点击没有效果,需要加上 clickable=true | |
android:paddingLeft="10dp" | |
android:paddingTop="10dp"> |
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
private void hideStatusBar() { | |
if (Build.VERSION.SDK_INT < 16) { | |
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
}else { | |
View decorView = getActivity().getWindow().getDecorView(); | |
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; | |
decorView.setSystemUiVisibility(uiOptions); | |
} |
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
apply plugin: 'com.android.library' | |
apply plugin: 'com.github.dcendents.android-maven' | |
apply plugin: 'com.jfrog.bintray' | |
// 这个version是区分library版本的,因此当我们需要更新library时记得修改这个version | |
version = "1.0.0" | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.1" | |
resourcePrefix "" | |
defaultConfig { |
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
/** | |
* get a thumbnail image url from original url | |
* @param imgUrl original image url | |
* @param width width u need | |
* @param height height u need | |
* @return the number(85) in below url indicate the quality of original image | |
*/ | |
public static String getThumbnailImageUrl(String imgUrl,int width,int height){ | |
String url="http://imgsize.ph.126.net/?imgurl=data1_data2xdata3x0x85.jpg&enlarge=true"; | |
url=url.replaceAll("data1", imgUrl).replaceAll("data2", width+"").replaceAll("data3", height+""); |