GithubHelp home page GithubHelp logo

toolutils's Introduction

常用工具类封装

SPUtils---常用SharedPreferences封装工具类

传送门

支持存储类型:

  • int
  • float
  • boolean
  • string
  • List

简单使用方法

  • 存储简单数据类型:putxxxValue(Context context,String key,xxx value)
  • 取出简单数据类型:getxxxValue(Context context,String key,xxx defValue)
  • 存储List:putStrListValue(Context context, String key,List strList)
  • 取出List:getStrListValue(Context context, String key)
  • 清空List所有数据:removeStrList(Context context, String key)
  • 清空对应key数据:remove(Context context, String key)
  • 清空所有数据:clear(Context context)

GlideUtils---配合Glide图片加载框架使用的封装工具类

传送门

注意事项 GlideUtils加载图片的封装,圆形、圆角,模糊等处理操作用到了glide-transformations,需要额外添加依赖:compile 'jp.wasabeef:glide-transformations:2.0.1'(注意更换版本)

简单使用方法

  • 常规加载图片:loadImage(Context context, ImageView imageView,String imgUrl, boolean isFade)
  • 加载缩略图:loadThumbnailImage(Context context, ImageView imageView, String imgUrl)
  • 加载图片并设置为指定大小:loadOverrideImage(Context context, ImageView imageView,String imgUrl, int withSize, int heightSize)
  • 加载图片并对其进行模糊处理:loadBlurImage(Context context, ImageView imageView, String imgUrl)
  • 加载圆图:loadCircleImage(Context context, ImageView imageView, String imgUrl)
  • 加载模糊的圆角的图片:loadBlurCircleImage(Context context, ImageView imageView, String imgUrl)
  • ....

permission---Android6.0运行时权限获取封装工具类

传送门

注意事项 此封装类根据郭霖在2016/12/27日作出的视频直播内容制作,视频地址

简单使用方法

继承BaseActivity传入所需权限,并且记得还要在AndroidManifest文件中申请所请求的权限

requestRunTimePermission(String[] permissions, IPermission listener)

回调接口提供onGranted()和onDenied(List deniedPermission)两个回调方法供使用

toolutils's People

Contributors

limuyang1013 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.