Android-百度地图定位实现仿钉钉签到打卡功能(附源码)

除了Bug,最让你头疼的问题是什么?单身?秃头?996?面试造火箭,工作拧螺丝?

作为安卓开发者,除了Bug,经常会碰到下面这些问题:

应用卡顿,丢帧,屏幕画面撕裂,操作界面刷新缓慢,UI不美观,布局混乱…这些问题频发的话,年后可能就不用来了。

开发App的时候,你是否会觉得界面卡顿?尤其是自定义View的时候。

Android 应用的卡顿、丢帧等,这些影响用户体验的因素绝大部分都与 16ms 这个值有关。Android 设备的刷新率也是 60Hz,Android系统每隔16ms发出VSYNC信号,触发对UI进行渲染,如果超过了16ms,我们则认为发生了卡顿。

前言

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

[【珍藏】推荐10个炫酷的开源库]

【开源推荐】进阶实战,从一款音乐播放器开始

Android 侧滑菜单(侧滑删除)总结

2020年有哪些优秀的开源库呢?本期就为大家带精选的10个,排名不分先后。

有需要这方面资料的小伙伴可以**私信我(进阶)**或者直接点击领取
Android学习PDF+架构视频+面试文档+源码笔记

No1. LiquidSwipe

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

1.1如何使用呢?

导入以下Gradle依赖项:

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

然后将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 效果图
效果1 效果2
image

| image

|

更多详细使用方法请看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"
}

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

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  效果图
效果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'
}

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

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
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值