加速Android开发的工具类:Caffeine
jopen
10年前
一个工具类的集合,它有助于使Android的开发速度更快(更安全!)。具体如下:
Class | Description |
---|---|
ActivityUtils | Utility methods for common Activity code |
CountUtil | Utility methods for formatting counts |
DialogUtils | Utility methods used to show a quick pop-up dialog. |
MiscUtils | A class for toys that do not have a home. |
PhoneUtils | 常用照片处理方法 Common phone utility methods |
StrictModeUtils | Used to turn on strict mode for Dev builds |
ToastUtils | Toast message utilities. |
ViewUtils | Utility methods that make working with views easier, less error prone, and more concise. |
示例
No more unsafe type casting scattered throughout your code:
TextView x = ViewUtils.findViewById(this, R.id.my_text) ImageView y = ViewUtils.findViewById(this, R.id.my_image) LinearLayout z = ViewUtils.findViewById(this, R.id.my_layout)
Some handy 1-liners:
ActivityUtils.launchActivity(this, SomeNewActivity.class); DialogUtils.quickDialog(this, "Some awesome message"); ToastUtils.quickToast(this, "Some toast message");