Skip to content

Commit

Permalink
fix the graph zooming issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mubeen1519 committed Jul 28, 2024
1 parent eaf4085 commit db1f9a4
Show file tree
Hide file tree
Showing 131 changed files with 24 additions and 346 deletions.
15 changes: 0 additions & 15 deletions android/FucksGiven/.gitignore

This file was deleted.

185 changes: 0 additions & 185 deletions android/FucksGiven/gradlew

This file was deleted.

89 changes: 0 additions & 89 deletions android/FucksGiven/gradlew.bat

This file was deleted.

Binary file removed android/app-release.aab
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rocks.poopjournal.fucksgiven
import android.app.LocaleConfig
import android.app.LocaleManager
import android.os.Build
import android.os.Build.VERSION.SDK_INT
import android.os.Bundle
import android.os.LocaleList
import androidx.activity.ComponentActivity
Expand All @@ -29,15 +30,16 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
val localeManager = applicationContext
.getSystemService(LocaleManager::class.java)
localeManager.overrideLocaleConfig = LocaleConfig(
LocaleList.forLanguageTags("en-US,de,ur,fr")
)

val overrideLocaleConfig = localeManager.overrideLocaleConfig
val supportedLocales = overrideLocaleConfig?.supportedLocales
if (SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
val localeManager = applicationContext
.getSystemService(LocaleManager::class.java)
localeManager.overrideLocaleConfig = LocaleConfig(
LocaleList.forLanguageTags("en-US,de,ur,fr")
)

val overrideLocaleConfig = localeManager.overrideLocaleConfig
val supportedLocales = overrideLocaleConfig?.supportedLocales
}
val theme = themeSetting.themeFlow.collectAsState()
val useDarkColors = when (theme.value) {
AppTheme.LIGHT -> false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ fun LineChartComposable(
setCircleColor(FuckGreen.toArgb())
setDrawValues(false)
setPinchZoom(false)
setScaleMinima(2f, 2f)

}

val lineData = LineData(dataSet)
Expand All @@ -88,6 +90,7 @@ fun LineChartComposable(
xAxis.typeface = tf



axisRight.valueFormatter = object : ValueFormatter() {
override fun getFormattedValue(value: Float): String {
return value.toInt().toString()
Expand Down Expand Up @@ -142,7 +145,10 @@ fun LineChartComposable(
// chart.axisRight.axisMaximum = 10f
chart.axisRight.isGranularityEnabled = true
chart.notifyDataSetChanged()

chart.fitScreen()
chart.viewPortHandler.setMaximumScaleX(2f);
chart.viewPortHandler.setMaximumScaleY(2f);
chart.isDoubleTapToZoomEnabled = false
chart.invalidate() // Refresh the chart
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ private fun RadioGroupItems(
Spacer(modifier = modifier.width(5.dp))
Text(
text = items.name,
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.bodySmall
color = MaterialTheme.colorScheme.onBackground,
style = MaterialTheme.typography.bodyLarge
)
}
}
Loading

0 comments on commit db1f9a4

Please sign in to comment.