Skip to content

Commit

Permalink
safe and change fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGinard committed Aug 20, 2022
1 parent 6664384 commit 7667c50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ class AboutFragment: Fragment() {
private fun sectionWhatisAire() {
Text(
text = stringResource(id = R.string.whatsIsAireLibre),
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
fontSize = 15.sp
)

Text(
text = stringResource(id = R.string.descriptionWhatis),
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Normal,
fontSize = 14.sp,
textAlign = TextAlign.Center,
Expand All @@ -121,7 +121,7 @@ class AboutFragment: Fragment() {
Text(
modifier = Modifier.paddingFromBaseline(top = 30.dp),
text = stringResource(id = R.string.titleSocialMedia),
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
fontSize = 15.sp
Expand Down Expand Up @@ -171,22 +171,22 @@ class AboutFragment: Fragment() {
Text(
modifier = Modifier.paddingFromBaseline(top = 30.dp),
text = stringResource(id = R.string.questionInteresant),
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
fontSize = 15.sp
)

Text(
text = stringResource(id = R.string.descriptionInteresant),
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Normal,
fontSize = 14.sp,
textAlign = TextAlign.Center,
)
Text(
text = stringResource(id = R.string.seeMore),
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
color = if (ThemeState.isDark)linkDark else Color.Blue,
style = TextStyle(textDecoration = TextDecoration.Underline),
Expand Down Expand Up @@ -227,7 +227,7 @@ class AboutFragment: Fragment() {
) {
if(flagListContributor.value) {
Text(
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
text = stringResource(id = R.string.titleContributors),
fontSize = 15.sp,
Expand Down Expand Up @@ -286,7 +286,7 @@ class AboutFragment: Fragment() {
Text(
text = stringResource(id = R.string.licenseAireLibreLink),
textAlign = TextAlign.Center,
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
color = if (ThemeState.isDark)linkDark else Color.Blue,
fontSize = 14.sp,
Expand All @@ -306,15 +306,15 @@ class AboutFragment: Fragment() {
Text(
text = stringResource(id = R.string.titleDeveloper),
textAlign = TextAlign.Center ,
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
fontSize = 14.sp,
modifier = Modifier.paddingFromBaseline(top = 30.dp)
)
Text(
text = stringResource(id = R.string.textNameDeveloper),
textAlign = TextAlign.Center,
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
color = if (ThemeState.isDark)linkDark else Color.Blue,
fontSize = 14.sp,
Expand All @@ -331,15 +331,15 @@ class AboutFragment: Fragment() {
Text(
text = stringResource(id = R.string.TitlelicenseLogo),
textAlign = TextAlign.Center ,
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
fontSize = 14.sp,
modifier = Modifier.paddingFromBaseline(top = 30.dp)
)
Text(
text = stringResource(id = R.string.desciptionlicenseLogo),
textAlign = TextAlign.Center,
fontFamily = ComposablesUtils.fontFamily,
fontFamily = ComposablesUtils.fonts,
fontWeight = FontWeight.Bold,
color = if (ThemeState.isDark)linkDark else Color.Blue,
fontSize = 14.sp,
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/com/lucasginard/airelibre/utils/extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.lucasginard.airelibre.R
import java.net.InetAddress
import java.io.IOException


fun View.setTint(color: Int = R.color.primaryColor) {
Expand Down Expand Up @@ -253,10 +253,12 @@ fun Modifier.vertical() = layout { measurable, constraints ->

fun Fragment.isInternetAvailable(): Boolean {
try {
val address: InetAddress = InetAddress.getByName("www.google.com")
return !address.equals("")
} catch (e: NetworkOnMainThreadException) {
// Log error
val ipProcess = Runtime.getRuntime().exec("/system/bin/ping -c 1 8.8.8.8")
return ipProcess.waitFor() == 0
} catch (e: IOException) {
e.printStackTrace()
} catch (e: InterruptedException) {
e.printStackTrace()
}
return false
}

0 comments on commit 7667c50

Please sign in to comment.