当前位置:   article > 正文

2020年GitHub 上那些优秀Android开源库,这里是Top10!_2020年github 上那些优秀android开源库,这里是top10!

2020年github 上那些优秀android开源库,这里是top10!

前言

每过一段时间呀,我都会给大家带来一些从Github上收集的一些开源库,有的是炫酷动效,有的则是实用的工具和类库。以前没看过或者没有收藏的同学,建议先收藏,以下是链接:

【Android珍藏】推荐10个炫酷的开源库
【开源推荐】进阶实战,从一款音乐播放器开始
2020年有哪些优秀的开源库呢?本期就为大家带精选的10个,排名不分先后。

No1. LiquidSwipe

这是一个很棒的ViewPager库,它在浏览ViewPager的不同页面时,显示波浪的滑动动画,效果非常炫酷。该库的USP是触摸交互的。这意味着在视图中显示类似液体的显示过渡时,应考虑触摸事件。

1.1如何使用呢?

导入以下Gradle依赖项:

implementation 'com.github.Chrisvin:LiquidSwipe:1.3'
  • 1

然后将LiquidSwipeLayout添加为保存fragment布局的容器的根布局:

<androidx.constraintlayout.widget.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.jem.liquidswipe.LiquidSwipeViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
1.2 效果图
效果1 效果2

更多详细使用方法请看Github: https://github.com/Chrisvin/LiquidSwipe

No2. Flourish

Flourish提供了一个炫酷的方式来显示或者隐藏一个布局,实现方式也很简单,就是对View或者布局进行了包装,通过构建者模式来提供api给上层调用。就像使用dialog一样,调用showdissmiss方法来显示和隐藏。此外,通过这些类,我们还可以自定义动画(正常,加速,反弹),或为布局方向设置我们自己的起点(左上,右下等)。

2.1 如何使用?

在build.gradle 中添加如下依赖:

dependencies {
   
    implementation "com.github.skydoves:flourish:1.0.0"
}
  • 1
  • 2
  • 3
  • 4

然后在代码中,构建布局:

Flourish flourish = new Flourish.Builder(parentLayout)
    // sets the flourish layout for showing and dismissing on the parent layout.
    .setFlourishLayout(R.layout.layout_flourish_main)
    // sets the flourishing animation for showing and dismissing.
    .setFlourishAnimation(FlourishAnimation.BOUNCE)
    // sets the orientation of the starting point.
    .setFlourishOrientation(FlourishOrientation.TOP_LEFT)
    // sets a flourishListener for listening changes.
    .setFlourishListener(flourishListener)
    // sets the flourish layout should be showed on start. 
    .setIsShowedOnStart(false)
    // sets the duration of the flourishing.
    .setDuration(800L)
    .build();
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

还提供有更简介的DSL:

val myFlourish = createFlourish(parentLayout) {
   
  setFlourishLayout(R.layout.layout_flourish_main)
  setFlourishAnimation(FlourishAnimation.ACCELERATE)
  setFlourishOrientation(FlourishOrientation.TOP_RIGHT)
  setIsShowedOnStart(true)
  setFlourishListener {
     }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
2.2 效果图
效果1 效果2

更多详细使用请看Github:https://github.com/skydoves/Flourish

No3. AestheticDialogs

这是一个美观而时尚的AlterDialog库,目前可支持六种不同的对话框,如:

  • Flash Dialog
  • Connectify Dialog
  • Toaster Dialog
  • Emotion Dialog
  • Drake Dialog
  • Emoji Dialog
    并且啊,还提供了暗黑模式的适配。
3.1 如何使用?

build.gradle 中添加如下依赖:

dependencies {
   
	...
	implementation 'com.github.gabriel-TheCode:AestheticDialogs:1.1.0'
}
  • 1
  • 2
  • 3
  • 4
  • 5

代码中,显示不同种类的对话框则调用对应的方法就好

Flash:

AestheticDialog.showFlashDialog(this, "Your dialog Title", "Your message", AestheticDialog.SUCCESS);
AestheticDialog.showFlashDialog(this, "Your dialog Title", "Your message", AestheticDialog.ERROR);
  • 1
  • 2

Connectify:

AestheticDialog.showConnectify(this,"Your message", AestheticDialog.SUCCESS);
AestheticDialog.showConnectify(this, "Your message", AestheticDialog.ERROR);

 /// Dark Theme
 AestheticDialog.showConnectifyDark(this,"Your message",AestheticDialog.SUCCESS);
 AestheticDialog.showConnectifyDark(this, "Your message", AestheticDialog.ERROR);
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

Toaster:

 AestheticDialog.showToaster(this, "Your dialog Title", "Your message", AestheticDialog.ERROR);
AestheticDialog.showToaster(this, "Your dialog Title", "Your message", AestheticDialog.SUCCESS);
AestheticDialog.showToaster(this, "Your dialog Title", "Your message", AestheticDialog.WARNING);
 AestheticDialog.showToaster(this, "Your dialog Title", "Your message", AestheticDialog.INFO);

 /// Dark Theme
 AestheticDialog.showToasterDark(this, "Your dialog Title", "Your message", AestheticDialog.ERROR);
AestheticDialog.showToasterDark(this, "Your dialog Title", "Your message", AestheticDialog.SUCCESS);
AestheticDialog.showToasterDark(
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/743748
推荐阅读
相关标签
  

闽ICP备14008679号