See how a minor change to your branch name style can make you a better programmer.
Format: <type>/#<issueNumber>-<alias>
for name in $(git log --pretty="%ae%n%cn" | sort | uniq); do | |
git log \ | |
--author "$name" \ | |
--pretty=tformat: --numstat | | |
awk -v name="$name" '{ | |
add += $1; subs += $2; loc += $1 - $2 | |
} END { | |
if (loc != 0) | |
printf "[%s] Lines: +\033[32m%s\033[0m -\033[31m%s\033[0m; Total: %s\n", name, add, subs, loc | |
}' |
/* | |
* Copyright 2020 Michael Rittmeister | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.ViewGroup; | |
import androidx.recyclerview.widget.GridLayoutManager; | |
import androidx.recyclerview.widget.RecyclerView; | |
public class AbsolutefitLayourManager extends GridLayoutManager { |
import com.google.android.material.shape.EdgeTreatment | |
import com.google.android.material.shape.ShapePath | |
import kotlin.math.atan | |
import kotlin.math.sqrt | |
class CircleEdgeTreatment | |
( | |
private val radius: Float, | |
private val cradleRoundedCornerRadius: Float | |
) : |
fun <T> debounce( | |
waitMs: Long = 300L, | |
scope: CoroutineScope, | |
destinationFunction: (T) -> Unit | |
): (T) -> Unit { | |
var debounceJob: Job? = null | |
return { param: T -> | |
debounceJob?.cancel() | |
debounceJob = scope.launch { | |
delay(waitMs) |
// https://github.com/Zhuinden/fragmentviewbindingdelegate-kt | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.DefaultLifecycleObserver | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.Observer | |
import androidx.viewbinding.ViewBinding | |
import kotlin.properties.ReadOnlyProperty |
val textColorsUsed = mutableMapOf<String, Int>() | |
File("../").walkTopDown().forEach { file -> | |
if (file.isFile && file.extension == "xml" && file.path.contains("res/layout")) { | |
val builder: DocumentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder() | |
val xmlInput = InputSource(StringReader(file.readText())) | |
val doc: Document = builder.parse(xmlInput) | |
val androidViews = XPathFactory.newInstance() | |
.newXPath() |
The Material Components Library introduced with the 1.2.0-alpha03
the new ShapeableImageView
.
In your layout you can use:
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image_view"
app:srcCompat="@drawable/..." />
Then in your code apply the ShapeAppearanceModel
to define your custom corners:
private val LocalStore: ProvidableCompositionLocal<Store<*>> = compositionLocalOf { error("Store not provided") } | |
@Composable | |
fun <STATE : State> StoreProvider(store: Store<STATE>, content: @Composable Store<STATE>.() -> Unit) { | |
CompositionLocalProvider(LocalStore provides store) { | |
store.content() | |
} | |
} | |
@Composable |