- Adopted from: https://stubby4j.com/docs/admin_portal.html
- Inspired by Swagger API docs style & structure: https://petstore.swagger.io/#/pet
This file contains 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
package bagus2x.sosmed.presentation.common.components | |
import androidx.compose.foundation.ExperimentalFoundationApi | |
import androidx.compose.foundation.layout.PaddingValues | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.size | |
import androidx.compose.foundation.layout.wrapContentSize | |
import androidx.compose.foundation.pager.VerticalPager | |
import androidx.compose.foundation.pager.rememberPagerState | |
import androidx.compose.material.MaterialTheme |
This file contains 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
public String getFileSize(long size, int round) { | |
if (size <= 0) | |
return "0"; | |
final String[] units = new String[]{"B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}; | |
int digitGroups = (int) (Math.log10(size) / Math.log10(1024)); | |
return String.format("%." + round + "f", size / Math.pow(1024, digitGroups)) + " " + units[digitGroups]; | |
} |
This file contains 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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, | |
and distribution as defined by Sections 1 through 9 of this document. |