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
fun GraphicBox(values: List<Float>, labels: List<String>) { | |
val context = LocalContext.current | |
// BarGraph Dimensions | |
val barGraphHeight by remember { mutableStateOf(200.dp) } | |
val barGraphWidth by remember { mutableStateOf(24.dp) } | |
Column( | |
modifier = Modifier | |
.padding(start = 10.dp, end = 10.dp, top = 4.dp) |
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
buildTypes { | |
release { | |
minifyEnabled false | |
shrinkResources false | |
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | |
testCoverageEnabled false | |
manifestPlaceholders = [ | |
appIcon: "@mipmap/ic_release" | |
] | |
} |
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
<application | |
android:name=".di.Application" | |
android:icon="${appIcon}" | |
android:roundIcon="${appIcon}" | |
.... | |
</aplication> |
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
fun isNetworkAvailable(context: Context?): Boolean { | |
if (context == null) return false | |
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | |
val capabilities = connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork) | |
if (capabilities != null) { | |
when { | |
capabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> { | |
return true | |
} |
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
//USAGE | |
private lateinit var connectionLiveData: ConnectionLiveData | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = ActivityInternetConnectionTestBinding.inflate(layoutInflater) | |
setContentView(binding.root) | |
connectionLiveData = ConnectionLiveData(this) |
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
//EXTENSION FOR COMPOSABLE ELEMENTS | |
fun Modifier.dashedBorder( | |
color: Color, | |
strokeWidth: Dp, | |
strokeLength: Dp, | |
animate: Boolean = true, | |
) = composed( | |
factory = { | |
val density = LocalDensity.current |
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
@Composable | |
fun SimpleButtonDemo(){ | |
val textA = stringResource(id = R.string.textA) | |
val textB = stringResource(id = R.string.textB) | |
val colorA = colorResource(id = R.color.purple_200) | |
val colorB = colorResource(id = R.color.teal_700) | |
var text by remember{ mutableStateOf(textA)} | |
var color by remember { mutableStateOf(colorA) } |