Git Product home page Git Product logo

lesscode's Introduction

Jcenter Status Build Status MethodCount

LessCode

less code, more efficient for android, for the best android tools library!

Overview

  • support more effective methods than android
  • high performence
  • easy integration
  • small size (only 45k~ by proguard)
  • open source

Gradle

implementation 'com.jayfeng:lesscode-core:2.4.2'

Features

源码 备注
ActivityLess Activity相关辅助类:去标题,全屏,两次退出提示,优化Overdraw背景等
AdapterLess 打造通用的BaseAdapter,PagerAdapter,RecyclerView.Adapter等
AlarmLess 定时器相关
AppLess 获取应用版本,名称,签名,清理缓存等
BitmapLess Bitmap处理相关
CacheLess 缓存网络请求返回的json
DeviceLess 获取设备信息,比如mac
DisplayLess 屏幕相关,比如dp和px的转换,状态栏或者标题栏的高度,dpi判断
DrawableLess 通用的着色方案
EncodeLess md5加密
FileLess 文件处理相关
HttpLess 简单的Http工具类,如果是专业用途还是用其他更强大的第三方库吧
ImageLess 图片相关
KeyBoardLess 输入法的弹出或隐藏
LogLess 强大的Log库
NetworkLess 网络判断
ResourceLess 根据资源名获取ID
SerializeLess 序列化和反序列化
SharedPreferenceLess 简化和增强SharedPreference的操作
StorageLess 手机存储相关,包括:手机内存,内置存储卡(Sdcard),外置存储卡(ExtSdcard)
ToastLess 简化Toast的使用
UpdateLess/UpdateService 简单但完整的自动更新实现,无缝对接(已分离到LessCode-Update项目)
ViewLess 简化繁琐的findViewById和强制转换

Usage

####Config

  • Required
$.getInstance()
 .context(getApplicationContext())
 .build();
  • Optional
$.getInstance()
 .context(getApplicationContext())
 .log(BuildConfig.DEBUG, "LESSCODE") // LogLess - debug, tag
 .update(null, 5) // UpdateLess - null means the default value, 5 is the notification frequent, default is 5
 .http(5000, 5000) // HttpLess - default connect and read timeout
 .build();

####Android VS LessCode

  • ViewLess
// 强制转化View类型
// Before
ListView listView = (ListView) findViewById(R.id.list);
// After
ListView listView = ViewLess.$(this, R.id.list);
  • ActivityLess
// 无标题全屏
// Before
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
            activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
// After
ActivityLess.$noTitle(this);
ActivityLess.$fullScreen(this);

Proguard

-dontwarn com.jayfeng.lesscode.**

See more details on the Wiki

Alternative libraries

Author

Author weibo:冯建V    mail:[email protected]    QQ:673592063

License

Copyright (C)  LessCode Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

lesscode's People

Contributors

fjtianxia avatar openproject avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lesscode's Issues

aar发布问题

参照你的文章配置完后,上传时报错:
HTTP/1.1 404 Not Found [message:Repo 'maven' was not found]
上传失败,这个问题要怎么解决?

aar发布的问题

您好,我参照您的“使用Gradle发布aar项目到JCenter仓库”文章,进行aar发布时,gradle配置文件配好,进行编译时报错。于是我clone了您的项目,在studio中能编译通过,但是执行gradlew编译时也报错,错误包括 package android.support.v4.graphics.drawable does not exist / can't find symble com.jayfeng.lesscode.core.R; 等等,看起来是依赖库找不到,.R也找不到(我的工程也是这类错)。请问您知道问题出在哪里吗?谢谢

SharedPreferenceLess需要context

和之前给toastLess提出的问题类似,初始化是传入了context,后面再使用的时候,不想每次put,get都再次传入context参数了

重复下载

点击确定升级,在apk还未升级完时,再点击确定升级,通知栏会出现50%调到10%又调到51%等两次下载的状态

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.