程序员界有个神奇的网站,那就是github,这个网站集合了一大批优秀的开源框架,极大地节省了开发者开发的时间,在这里我进行了一下整理,这样可以使我们在使用到时快速的查找到,希望对大家有所帮助!
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.okhttp3:okhttp:3.8.0'
dependencies {
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
在app的build.gradle上加入:
dependencies {
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
}
repositories {
mavenCentral()
google()
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
}
dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
}
在 Application 中写入:
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
LeakCanary.install(this);
// Normal app init code...
}
}
下载 universal-image-loader-1.9.5.jar
compile 'org.greenrobot:eventbus:3.0.0'
简介:强力的图片下载、缓存框架
上榜理由:本榜单出现的第三款图片类框架,不同的是picasso更强调图片下载,你可以将picasso集成进你的项目中,你也可以结合gilde和UIL与picasso,三者一齐封装至你的项目中,按需所用。
官网地址 http://square.github.io/picasso/
github https://github.com/square/picasso
作者 square团队
使用:
compile 'com.squareup.picasso:picasso:2.5.2'
dependencies {
// 其他依赖
compile 'com.facebook.fresco:fresco:0.12.0'
}
下面的依赖需要根据需求添加:
dependencies {
// 在 API < 14 上的机器支持 WebP 时,需要添加
compile 'com.facebook.fresco:animated-base-support:0.12.0'
// 支持 GIF 动图,需要添加
compile 'com.facebook.fresco:animated-gif:0.12.0'
// 支持 WebP (静态图+动图),需要添加
compile 'com.facebook.fresco:animated-webp:0.12.0'
compile 'com.facebook.fresco:webpsupport:0.12.0'
// 仅支持 WebP 静态图,需要添加
compile 'com.facebook.fresco:webpsupport:0.12.0'
}
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
在gihub上fork源码,集成进项目中
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
在app的module目录的build.gralde中加入:
dependencies {
compile 'com.github.chrisbanes:PhotoView:latest.release.here'
}
代码中使用
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/photo_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
PhotoView photoView = (PhotoView) findViewById(R.id.photo_view);
photoView.setImageResource(R.drawable.image);
dependencies {
// ... other dependencies here
compile 'com.afollestad.material-dialogs:core:0.9.4.5'
}
repositories {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
compile 'com.loopj.android:android-async-http:1.5.0-SNAPSHOT'
}
compile 'com.alibaba:fastjson:1.1.58.android'
down源码,修改学习
github fork源码,集成到项目中
dependencies {
compile 'com.google.android:flexbox:0.3.0-alpha3'
}
dependencies {
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:support-v4:20.+'
compile "com.daimajia.swipelayout:library:1.2.0@aar"
}
buildscript {
repositories {
jcenter()
mavenCentral() // add repository
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
}
}
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao' // apply plugin
dependencies {
compile 'org.greenrobot:greendao:3.2.2' // add library
}
compile 'com.facebook.stetho:stetho:1.5.0'
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:VERSION_CODE'
}
dependencies {
compile 'com.android.support:support-compat:25.1.1'
compile 'com.daimajia.easing:library:2.0@aar'
compile 'com.daimajia.androidanimations:library:2.2@aar'
}
sample:
YoYo.with(Techniques.Tada)
.duration(700)
.repeat(5)
.playOn(findViewById(R.id.edit_area));
compile('com.mikepenz:materialdrawer:5.9.2@aar') {
transitive = true
}
new DrawerBuilder().withActivity(this).build();
compile com.github.ksoichiro:android-observablescrollview
dependencies {
...
compile 'de.hdodenhof:circleimageview:2.1.0'
}
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/profile_image"
android:layout_width="96dp"
android:layout_height="96dp"
android:src="@drawable/profile"
app:civ_border_width="2dp"
app:civ_border_color="#FF000000"/>
compile 'com.orhanobut:logger:2.1.1'
Logger.d(MAP);
Logger.d(SET);
Logger.d(LIST);
Logger.d(ARRAY);
Logger.json(JSON_CONTENT);
Logger.xml(XML_CONTENT);
compile 'com.google.android.agera:agera:1.3.0'
compile 'com.google.android.agera:content:1.3.0'
compile 'com.google.android.agera:database:1.3.0'
compile 'com.google.android.agera:net:1.3.0'
compile 'com.google.android.agera:rvadapter:1.3.0'
compile 'com.google.android.agera:rvdatabinding:1.3.0'
compile 'com.roughike:bottom-bar:2.3.1'
dependencies {
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
}
dependencies {
repositories {
mavenCentral()
}
compile 'com.sothree.slidinguppanel:library:3.3.1'
}
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.apl-devs:appintro:v4.2.0'
}
dependencies {
// jCenter
compile 'jp.wasabeef:recyclerview-animators:2.2.6'
}
dependencies {
compile 'com.google.dagger:dagger:2.x'
annotationProcessor 'com.google.dagger:dagger-compiler:2.x'
}
If you're using classes in dagger.android you'll also want to include:
compile 'com.google.dagger:dagger-android:2.x'
compile 'com.google.dagger:dagger-android-support:2.x'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.x'
dependencies {
compile 'com.beardedhen:androidbootstrap:{X.X.X}'
}
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
'support-v4' library bindings:
compile 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.0.0'
'appcompat-v7' library bindings:
compile 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.0.0'
'design' library bindings:
compile 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0'
'recyclerview-v7' library bindings:
compile 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.0.0'
'leanback-v17' library bindings:
compile 'com.jakewharton.rxbinding2:rxbinding-leanback-v17:2.0.0'
repositories {
mavenCentral()
}
dependencies {
compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
}
repositories {
jcenter()
}
dependencies {
...
compile 'com.marshalchen.ultimaterecyclerview:library:0.7.2'
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
compile 'com.github.yalantis:ucrop:2.2.1'
dependencies {
compile 'com.zhy:autolayout:1.4.5'
}
compile 'top.zibin:Luban:1.1.1'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
dependencies {
compile('com.github.hotchemi:permissionsdispatcher:${latest.version}') {
exclude module: "support-v13"
}
annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:${latest.version}'
}
repositories {
jcenter()
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'
}
compile 'me.imid.swipebacklayout.lib:library:1.0.0'
dependencies {
compile 'com.liulishuo.filedownloader:library:1.5.5'
}
compile 'fm.jiecao:jiecaovideoplayer:5.5.4'
repositories {
jcenter()
}
dependencies {
compile 'jp.wasabeef:glide-transformations:2.0.2'
// If you want to use the GPU Filters
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
}
在Glide里设置变幻效果
Set Glide Transform.
Glide.with(this).load(R.drawable.demo)
.bitmapTransform(new BlurTransformation(context))
.into((ImageView) findViewById(R.id.image));
repositories {
jcenter()
}
dependencies {
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
}
更多的改造方法,还需要阅读Ios的编程文档,对于有毅力的小伙伴强力推荐!
repositories {
jcenter() // If not already there
}
dependencies {
compile 'com.tbruyelle.rxpermissions:rxpermissions:0.9.4@aar'
}
优雅的使用:
RxPermissions rxPermissions = new RxPermissions(this);
rxPermissions
.request(Manifest.permission.CAMERA)
.subscribe(granted -> {
if (granted) { // I can control the camera now
} else {
// Oups permission denied
}
});
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.antfortune.freeline:gradle:0.8.7'
}
}
apply plugin: 'com.antfortune.freeline'
android {
...
}
File → Settings... → Plugins → Browse repositories →freeline.
compile 'com.jakewharton:disklrucache:2.0.2'
dependencies {
compile 'com.taobao.android:dexposed:0.1.1@aar'
}
ependencies {
// ...
// Litho
compile 'com.facebook.litho:litho-core:0.3.1'
compile 'com.facebook.litho:litho-widget:0.3.1'
provided 'com.facebook.litho:litho-annotations:0.3.1'
annotationProcessor 'com.facebook.litho:litho-processor:0.3.1'
// SoLoader
compile 'com.facebook.soloader:soloader:0.2.0'
// Optional
// For debugging
debugCompile 'com.facebook.litho:litho-stetho:0.3.1'
// For integration with Fresco
compile 'com.facebook.litho:litho-fresco:0.3.1'
// For testing
testCompile 'com.facebook.litho:litho-testing:0.3.1'
}
dependencies {
compile 'com.hannesdorfmann.mosby3:mvi:3.0.4' // Model-View-Intent
// or
compile 'com.hannesdorfmann.mosby3:mvp:3.0.4' // Plain MVP
// or
compile 'com.hannesdorfmann.mosby3:viewstate:3.0.4' // MVP + ViewState support
}
allprojects {
repositories {
...
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
compile 'com.jaeger.statusbarutil:library:1.4.0'
testCompile "org.robolectric:robolectric:3.3.2"
// appcompat v7包是必须的
compile 'me.yokeyword:fragmentation:0.10.7'
// 如果想使用SwipeBack 滑动边缘退出Fragment/Activity功能,请再添加下面的库
// compile 'me.yokeyword:fragmentation-swipeback:0.10.4'
buildscript {
dependencies {
classpath 'net.wequick.tools.build:gradle-small:1.2.0-alpha6'
}
}
apply plugin: 'net.wequick.small'
small {
aarVersion = '1.2.0-alpha6'
}
repositories {
// ...
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.lzyzsd:jsbridge:1.0.4'
}
repositories {
jcenter()
}
dependencies {
compile 'jp.wasabeef:richeditor-android:1.2.2'
}
dependencies {
compile "com.andkulikov:transitionseverywhere:1.7.4"
}
View target = findViewById(R.id.target_view);
BadgeView badge = new BadgeView(this, target);
badge.setText("1");
badge.show();
buildscript {
......
dependencies{
// add packer-ng
classpath 'com.mcxiaoke.gradle:packer-ng:1.0.9'
}
}
apply plugin: 'packer'
dependencies {
compile 'com.mcxiaoke.gradle:packer-helper:1.0.9'
}
android {
//...
signingConfigs {
release {
// 满足下面两个条件时需要此配置
// 1. Gradle版本 >= 2.14.1
// 2. Android Gradle Plugin 版本 >= 2.2.0
// 作用是只使用旧版签名,禁用V2版签名模式
v2SigningEnabled false
}
}
}
debugCompile 'com.amitshekhar.android:debug-db:1.0.0'
Android {
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
arguments = [ moduleName : project.getName() ]
}
}
}
}
dependencies {
// 替换成最新版本, 需要注意的是api
// 要与compiler匹配使用,均使用最新版可以保证兼容
compile 'com.alibaba:arouter-api:x.x.x'
annotationProcessor 'com.alibaba:arouter-compiler:x.x.x'
...
}
// 旧版本gradle插件(< 2.2),可以使用apt插件,配置方法见文末'其他#4'
// Kotlin配置参考文末'其他#5'
compile 'com.bilibili:magicasakura:0.1.6@aar'
dependencies {
compile 'cat.ereza:customactivityoncrash:2.1.0'
}
添加到 Application class:
@Override
public void onCreate() {
super.onCreate();
CaocConfig.Builder.create()
.backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT)
.enabled(false) //default: true
.showErrorDetails(false) //default: true
.showRestartButton(false) //default: true
.trackActivities(true) //default: false
.minTimeBetweenCrashesMs(2000) //default: 3000
.errorDrawable(R.drawable.ic_custom_drawable) //default: bug image
.restartActivity(YourCustomActivity.class) //default: null (your app's launch activity)
.errorActivity(YourCustomErrorActivity.class) //default: null (default error activity)
.eventListener(new YourCustomEventListener()) //default: null
.apply();
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.w446108264:XhsEmoticonsKeyboard:2.0.4'
}