<!-- @page { margin: 2cm } PRE.cjk { font-family: "Droid Sans Fallback", monospace } PRE.ctl { font-family: "Lohit Hindi", monospace } P { margin-bottom: 0.21cm } A:link { so-language: zxx } -->
SlidingDrawer 隐藏部分内容,该控件可以实现抽屉效果。
如下 xml 文件
<SlidingDrawer android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:handle="@+id/handle" android:content="@+id/content"> <ImageView android:id="@id/handle" android:layout_width="88dip" android:layout_height="44dip" /> <GridView android:id="@id/content" android:layout_width="match_parent" android:layout_height="match_parent" /> </SlidingDrawer> SlidingDrawer 中的android:content="@+id/content" 表示要隐藏的内容, android:handle="@+id/handle" 表示控制content 显示或者隐藏的控件(可以是一个按钮)
animateToggle() 打开和关闭自动切换
animateClose() 关闭内容
animateOpen() 打开内容
//这个是手机内存的可用空间大小
static public long getAvailableInternalMemorySize() {
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long availableBlocks = stat.getAvailableBlocks();
return availableBlocks * blockSize;
}
//这个是手机内存的总空间大小
static public long getTotalInternalMemorySize() {
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long totalBlocks = stat.getBlockCount();
return totalBlocks * blockSize;
}
//这个是手机sdcard的可用空间大小
static public long getAvailableExternalMemorySize() {
if (externalMemoryAvailable()) {
File path = Environment.getExternalStorageDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long availableBlocks = stat.getAvailableBlocks();
return availableBlocks * blockSize;
} else {
return ERROR;
}
}
//这个是手机sdcard的总空间大小
static public long getTotalExternalMemorySize() {
if (externalMemoryAvailable()) {
File path = Environment.getExternalStorageDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long totalBlocks = stat.getBlockCount();
return totalBlocks * blockSize;
} else {
return ERROR;
}
}
private static final int ERROR = -1;
/**
* SDCARD是否存
*/
public static boolean externalMemoryAvailable() {
return android.os.Environment.getExternalStorageState().equals(
android.os.Environment.MEDIA_MOUNTED);
}
易我数据恢复向导