Giter Site home page Giter Site logo

android-kotlin-extend-utils's Introduction

Kotlin 常用扩展函数总结

1.ImageViewExtends(Glide)

名称 描述
loadImage 加载图片
loadCircleImage 加载圆形图片
loadRoundCornerImage 加载圆角图片
loadImageByProportion 按照图片的宽高比加载
loadClear 取消加载

2.ViewExtends

名称 描述
view2Bitmap View 转 bitmap
bottomMargin 底部Margin
leftMargin 左侧Margin
topMargin 上部Margin
rightMargin 右侧Margin

3.TextViewExtends

名称 描述
setColor 设置颜色
setDrawableLeft 左侧Drawable
setDrawableTop 上部Drawable
setDrawableRight 右侧Drawable
setDrawableBottom 下部Drawable

4.ContextExtends

名称 描述
toast 展示toast
centerToast 中心展示toast
dp2px dp转px
px2dp px转dp
sp2px sp转px
px2sp px转sp
getScreenWidth 屏幕宽度
getScreenHeight 屏幕高度
openWirelessSettings 打开网络设置界面
isConnected 网络是否连接
isMobileData 判断网络是否是移动数据
startHomeActivity 退回到桌面

5.ActivityExtends

名称 描述
screenShot 屏幕截图
isPortrait 是否竖屏
isLandscape 是否横屏
setPortrait 设置竖屏
setLandscape 设置横屏
setFullScreen 设置全屏
showKeyboard 显示软键盘
hideKeyboard 隐藏软键盘

6.BitmapExtends

名称 描述
scale bitmap 缩放

7.FileExtends

名称 描述
getBitmap file 转 bitmap

android-kotlin-extend-utils's People

Contributors

shiweibsw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.