Skip to content

Instantly share code, notes, and snippets.

internal val ENFORCE_EDGE_TO_EDGE_SUPPORT = Issue.create(
id = LegacyStepEdgeToEdgeDetector::class.simpleName!!,
briefDescription = "Error description",
explanation = "Error explanation",
category = CORRECTNESS,
priority = 7,
severity = ERROR,
implementation = Implementation(LegacyStepEdgeToEdgeDetector::class.java, EnumSet.of(JAVA_FILE, TEST_SOURCES)),
)
insetsHandler.handleInsets(view) { v, insets ->
v.updatePadding(left = insets.left, top = insets.top, right = insets.right)
}
insetsHandler.handleInsetsWithPinnedButton(
mainContent = view.scrollingContent,
bottomPinnedContent = view.confirmButton,
)
insetsHandler.handleInsets(binding.screenContent)
interface InsetsHandler {
fun handleInsets(
view: View?,
insetDirection: InsetDirection = InsetDirection.EXCLUDE_TOP,
consumeInsets: Boolean = true,
useMargin: Boolean = false,
)
fun handleInsetsWithPinnedButton(
mainContent: View?,
setContent {
EdgeToEdgeTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
AppContent(
modifier = Modifier.padding(innerPadding)
)
}
}
}
@jollygreenegiant
jollygreenegiant / weatherLineChart.java
Created July 5, 2019 16:09
MPAndroidChart Line Chart with overlapping data values
lineChart = v.findViewById(R.id.tempChart);
List<HourDatum> hours = weatherData.getHourly().getData();
List<Entry> data = new ArrayList<>();
for (int i = 0; i < 24; i++) {
data.add(new Entry((float) i, Math.round(hours.get(i).getTemperature().floatValue())));
}
LineDataSet lineDataSet = new LineDataSet(data, "");
lineDataSet.setLineWidth(3f);