use of android.support.annotation.RequiresApi in project AndroidUtilLib by SiberiaDante.
the class SDStorageUtil method getSDCardSizeKB.
/**
* 获取SD卡的完整空间大小,返回KB
* 需要最小API18
*
* @return
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public static long getSDCardSizeKB() {
if (isSDCardMounted()) {
StatFs fs = new StatFs(getSDCardBaseDir());
long count = fs.getBlockCountLong();
long size = fs.getBlockSizeLong();
return count * size / 1024;
}
return 0;
}
use of android.support.annotation.RequiresApi in project AndroidUtilLib by SiberiaDante.
the class SDStorageUtil method getSDCardFreeSizeMB.
/**
* 获取SD卡的剩余空间大小
*
* @return MB
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public static long getSDCardFreeSizeMB() {
if (isSDCardMounted()) {
StatFs fs = new StatFs(getSDCardBaseDir());
long count = fs.getFreeBlocksLong();
long size = fs.getBlockSizeLong();
return count * size / 1024 / 1024;
}
return 0;
}
use of android.support.annotation.RequiresApi in project AndroidUtilLib by SiberiaDante.
the class SDStorageUtil method getSDCardSizeMB.
/**
* 获取SD卡的完整空间大小,返回MB
* 需要最小API18
*
* @return
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public static long getSDCardSizeMB() {
if (isSDCardMounted()) {
StatFs fs = new StatFs(getSDCardBaseDir());
long count = fs.getBlockCountLong();
long size = fs.getBlockSizeLong();
return count * size / 1024 / 1024;
}
return 0;
}
use of android.support.annotation.RequiresApi in project tutorial-view by msayan.
the class TutorialActivity method changeStatusBarColor.
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private void changeStatusBarColor(int backgroundColor) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(backgroundColor);
}
use of android.support.annotation.RequiresApi in project UniPool by divya21raj.
the class SentRequestsTEA method onBindViewHolder.
// Replace the contents of a view (invoked by the layout manager)
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public void onBindViewHolder(MyHolder holder, int position) {
TripEntry tripEntry = list.get(position);
UtilityMethods.fillTripEntryHolder(holder, tripEntry);
holder.cardArrow.setOnClickListener(v -> {
if (holder.tripEntryExpand.isExpanded()) {
holder.tripEntryExpand.collapse();
holder.cardArrow.setImageResource(R.drawable.ic_arrow_left_24px);
} else {
holder.tripEntryExpand.expand();
holder.cardArrow.setImageResource(R.drawable.ic_arrow_drop_down_circle_24px);
}
});
holder.requestButton.setVisibility(View.INVISIBLE);
}
Aggregations