onSaveInstanceState() 相同id的view会被覆盖
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| help() { | |
| cat <<- HELP | |
| Usage: `basename $0` -p <packageName> [-v] | |
| List fd info for package indicated. | |
| -p, --pkg package name | |
| -v verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TEMP=`getopt -o u:p: --long user:,passwd: -n "$0" -- "$@"` | |
| if [ $? != 0 ]; then echo "Terminating..." >&2; exit 1; fi | |
| eval set -- "$TEMP" | |
| while true; do | |
| case "$1" in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Handler; | |
| import android.os.Looper; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| /** | |
| * Created by lixindong2 on 6/29/18. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * A LinearLayout that can be constrained to a maximum size. | |
| * | |
| * Example: | |
| * <org.chromium.chrome.browser.widget.BoundedLinearLayout | |
| * xmlns:android="http://schemas.android.com/apk/res/android" | |
| * xmlns:chrome="http://schemas.android.com/apk/res-auto" | |
| * android:layout_width="match_parent" | |
| * android:layout_height="match_parent" | |
| * chrome:maxWidth="692dp" > |
先记录目前想到的几个点:
- 抽屉导航: 方便再不同 Sample 间切换。全局功能开关。不影响正常视野。
- 可选的 ActionBar: Sample 里需要的功能,比如刷新、重新加载等
- Google Design Sample 常用颜色: 看着比较高端
- 可录制的 Fragment: 方便开发者为 Sample 录制课程
- 可视化可开关的 log: 方便调试
增强功能:
- 可录制声音。录制视频或专有的带声音图片的格式
- 自资源管理系统。录制的资源自动保存。可选自动云同步。
BitmapFactory这个类提供了多个解析方法(decodeByteArray, decodeFile, decodeResource等)用于创建Bitmap对象。 每一种解析方法都提供了一个可选的BitmapFactory.Options参数,将这个参数的inJustDecodeBounds属性设置为true就可以让解析方法禁止为bitmap分配内存,返回值也不再是一个Bitmap对象,而是null。虽然Bitmap是null了,但是BitmapFactory.Options的outWidth、outHeight和outMimeType属性都会被赋值。这个技巧让我们可以在加载图片之前就获取到图片的长宽值和MIME类型,从而根据情况对图片进行压缩。
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(getResources(), R.id.myimage, options);
int imageHeight = options.outHeight;
int imageWidth = options.outWidth;
相对在线转换下载优势:
- 无广告
- 一键下载无需跳转
- 断点续传
- 播放列表批量下载
- 支持站点多
相对 4K Downloader 优势
- 支持简单脚本批量生成网址
- 播放列表下载无 25 个视频限制
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.v7.app.AppCompatActivity; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.widget.ImageView; | |
| import android.widget.RelativeLayout; | |
| /** | |
| * Created by lixindong on 1/4/18. | |
| */ |