2024年GitHub-上那些优秀Android开源库,这里是Top10!建议收藏!

本文介绍了几个有助于IT技术提升的在线学习资源和库,包括Flourish的布局和动画,AestheticDialogs的美观对话框,EasyReveal的动画效果,AndroidColorX的颜色转换,以及动画导航栏和评分提示组件。同时鼓励读者加入技术交流社区,共同学习和进步。
摘要由CSDN通过智能技术生成

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化学习资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

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

dependencies {
implementation “com.github.skydoves:flourish:1.0.0”
}

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

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();

还提供有更简洁的DSL:

val myFlourish = createFlourish(parentLayout) {
setFlourishLayout(R.layout.layout_flourish_main)
setFlourishAnimation(FlourishAnimation.ACCELERATE)
setFlourishOrientation(FlourishOrientation.TOP_RIGHT)
setIsShowedOnStart(true)
setFlourishListener {  }
}

2.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’
}

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

Flash:

AestheticDialog.showFlashDialog(this, “Your dialog Title”, “Your message”, AestheticDialog.SUCCESS);
AestheticDialog.showFlashDialog(this, “Your dialog Title”, “Your message”, AestheticDialog.ERROR);

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);

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(this, “Your dialog Title”, “Your message”, AestheticDialog.WARNING);
AestheticDialog.showToasterDark(this, “Your dialog Title”, “Your message”, AestheticDialog.INFO);

Drake :

AestheticDialog.showDrake(this, AestheticDialog.SUCCESS);
AestheticDialog.showDrake(this, AestheticDialog.ERROR);

Emoji :

AestheticDialog.showEmoji(this,“Your dialog Title”, “Your message”, AestheticDialog.SUCCESS);
AestheticDialog.showEmoji(this, “Your dialog Title”, “Your message”, AestheticDialog.ERROR);

/// Dark Theme
AestheticDialog.showEmojiDark(this,“Your dialog Title”, “Your message”, AestheticDialog.SUCCESS);
AestheticDialog.showEmojiDark(this, “Your dialog Title”, “Your message”, AestheticDialog.ERROR);

Emotion :

AestheticDialog.showEmotion(this,“Your dialog Title”, “Your message”, AestheticDialog.SUCCESS);
AestheticDialog.showEmotion(this, “Your dialog Title”, “Your message”, AestheticDialog.ERROR);

Rainbow :

AestheticDialog.showRainbow(this,“Your dialog Title”, “Your message”, AestheticDialog.SUCCESS);
AestheticDialog.showRainbow(this,“Your dialog Title”, “Your message”, AestheticDialog.ERROR);
AestheticDialog.showRainbow(this,“Your dialog Title”, “Your message”, AestheticDialog.WARNING);
AestheticDialog.showRainbow(this,“Your dialog Title”, “Your message”, AestheticDialog.INFO);

3.2 效果如下

Flash DialogConnectify DialogToaster Dialog

Emotion DialogDrake DialogEmoji Dialog

image

更多详情使用方法请看Github:https://github.com/gabriel-TheCode/AestheticDialogs

N4. EasyReveal

从名字就知道,这是一个提供reveal动画效果的库,它的厉害之处在于可以提供不同尺寸、不同形状的reveal动画,并且还可以在定义它在屏幕任意位置开始和结束动画。

4.1 如何使用?

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

dependencies {

implementation ‘com.github.Chrisvin:EasyReveal:1.2’
}

然后,xml中,需要添加显示或者隐藏动画的View应该包裹在EasyRevealLinearLayout中:

<com.jem.easyreveal.layouts.EasyRevealLinearLayout

app:clipPathProvider=“star” // possible values: circular, linear, random_line, star, sweep & wave
app:revealAnimationDuration=“2000”
app:hideAnimationDuration=“1500” >

</com.jem.easyreveal.layouts.EasyRevealLinearLayout>

也可以在代码中添加:

val revealLayout = EasyRevealLinearLayout(this)
// Set the ClipPathProvider that is used to clip the view for reveal animation
revealLayout.clipPathProvider = StarClipPathProvider(numberOfPoints = 6)
// Set the duration taken for reveal animation
revealLayout.revealAnimationDuration = 1500
// Set the duration taken for hide animation
revealLayout.hideAnimationDuration = 2000
// Set listener to get updates during reveal/hide animation
revealLayout.onUpdateListener = object: RevealLayout.OnUpdateListener {
override fun onUpdate(percent: Float) {
Toast.makeText(this@MainActivity, “Revealed percent: $percent”, Toast.LENGTH_SHORT).show()
}
}
// Start reveal animation
revealLayout.reveal()
// Start hide animation
revealLayout.hide()

4.2效果图

Emotion DialogDrake DialogEmoji Dialog

image

更多详细使用信息请看Github:https://github.com/Chrisvin/EasyReveal

No5. Android ColorX

Android ColorX 以Kotlin 扩展函数的形式提供了一些重要的获取颜色的方法。通过提供不同颜色格式(RGB,HSV,CYMK等)的转换功能,它使开发变得更加轻松。该库的USP具有以下功能:

  • 颜色的不同阴影和色调。
  • 较深和较浅的阴影。
  • 颜色的补码

5.1 如何使用?

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

dependencies {
implementation ‘me.jorgecastillo:androidcolorx:0.2.0’
}

在代码中,一系列的转换方法:

val color = Color.parseColor(“#e91e63”)

val rgb = color.asRgb()
val argb = color.asArgb()
val hex = color.asHex()
val hsl = color.asHsl()
val hsla = color.asHsla()
val hsv = color.asHsv()
val cmyk = color.asCmyk()

val colorHsl = HSLColor(hue = 210f, saturation = 0.5f, lightness = 0.5f)

val colorInt = colorHsl.asColorInt()
val rgb = colorHsl.asRgb()
val argb = colorHsl.asArgb()
val hex = colorHsl.asHex()
val cmyk = colorHsl.asCmyk()
val hsla = colorHsl.asHsla()
val hsv = colorHsl.asHsv()

5.2 效果图

No6. AnimatedBottomBar

这是一个带动画的底部导航栏库。它使你可以以编程方式以及通过XML添加和删除选项卡。此外,我们可以轻松地从BottomBar拦截选项卡。限制访问应用程序导航中的高级区域时,“拦截”标签非常有用。流畅的动画提供了许多自定义选项,从动画插值器到设置波纹效果。

6.1 如何使用?

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

dependencies {
implementation ‘nl.joery.animatedbottombar:library:1.0.8’
}

在xml文件中添加AnimatedBottomBar和自定义属性

<nl.joery.animatedbottombar.AnimatedBottomBar
android:id=“@+id/bottom_bar”
android:background=“#FFF”
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
app:abb_selectedTabType=“text”
app:abb_indicatorAppearance=“round”
app:abb_indicatorMargin=“16dp”
app:abb_indicatorHeight=“4dp”
app:abb_tabs=“@menu/tabs”
app:abb_selectedIndex=“1” />

在res/menu目录下定义tabs.xml文件:

最后,代码中添加tab

// Creating a tab by passing values
val bottomBarTab1 = AnimatedBottomBar.createTab(drawable, “Tab 1”)

// Creating a tab by passing resources
val bottomBarTab2 = AnimatedBottomBar.createTab(R.drawable.ic_home, R.string.tab_2, R.id.tab_home)

6.2 效果图

tab1tab2

No7. RateBottomSheet

有时候,为了推广我们的应用,我们需要让用户跳转到应用商店为我们的APP打分,传统的对话框用户体验很不好,而本库则是用BottomSheet来进行提示,它位于底部缩略区域,用户体验很好。

7.1 如何使用呢?

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

dependencies {
implementation ‘com.mikhaellopez:ratebottomsheet:1.1.0’
}

然后修改默认的string资源文件来改变显示文案:

Like this App? Do you like using this application? Yes I do Not really

Rate this app
Would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!
Rate it now
Remind me later
No, thanks

代码中使用:

RateBottomSheetManager(this)
.setInstallDays(1) // 3 by default
.setLaunchTimes(2) // 5 by default
.setRemindInterval(1) // 2 by default
.setShowAskBottomSheet(false) // True by default
.setShowLaterButton(false) // True by default
.setShowCloseButtonIcon(false) // True by default
.monitor()

// Show bottom sheet if meets conditions
// With AppCompatActivity or Fragment
RateBottomSheet.showRateBottomSheetIfMeetsConditions(this)

7.2 效果图

No8. TransformationLayout

这是一个用于Activity或者Fragment 以及View切换的过渡动画库,效果非常炫,它使用Material Design的运动系统过渡模式来创建变形动画。该库提供了用于绑定目标视图,设置淡入淡出和路径运动方向以及许多其他自定义选项的属性。

8.1 如何使用?

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

dependencies {
implementation “com.github.skydoves:transformationlayout:1.0.4”
}

然后,需要将我们需要添加过渡动画的View包裹到 TransformationLayout:

写在最后

由于本文罗列的知识点是根据我自身总结出来的,并且由于本人水平有限,无法全部提及,欢迎大神们能补充~

将来我会对上面的知识点一个一个深入学习,也希望有童鞋跟我一起学习,一起进阶。

提升架构认知不是一蹴而就的,它离不开刻意学习和思考。

**这里,笔者分享一份从架构哲学的层面来剖析的视频及资料分享给大家,**梳理了多年的架构经验,筹备近1个月最新录制的,相信这份视频能给你带来不一样的启发、收获。

最近还在整理并复习一些Android基础知识点,有问题希望大家够指出,谢谢。

希望读到这的您能转发分享和关注一下我,以后还会更新技术干货,谢谢您的支持!

转发+点赞+关注,第一时间获取最新知识点

Android架构师之路很漫长,一起共勉吧!

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化学习资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

梳理了多年的架构经验,筹备近1个月最新录制的,相信这份视频能给你带来不一样的启发、收获。

[外链图片转存中…(img-s75JKQXc-1714983144754)]

[外链图片转存中…(img-qap1XIpS-1714983144754)]

最近还在整理并复习一些Android基础知识点,有问题希望大家够指出,谢谢。

希望读到这的您能转发分享和关注一下我,以后还会更新技术干货,谢谢您的支持!

转发+点赞+关注,第一时间获取最新知识点

Android架构师之路很漫长,一起共勉吧!

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化学习资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

  • 23
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值