- Telegram: @k_konovalov
This file contains 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
package sinet.startup.inDriver.feature.country.ui | |
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Color | |
import android.graphics.Paint | |
import android.graphics.Rect | |
import android.text.TextPaint | |
import android.util.AttributeSet | |
import android.util.TypedValue |
This file contains 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
/* Codebase placed in | |
debug: module/src/debug | |
release: module/src/release | |
and base manifest pwd module/src/main/AndroidManifest | |
!!! No code in src/main or it will provide DuplicateError | |
*/ | |
android{ | |
// Different buildConfig | |
defaultConfig { |
This file contains 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
android { | |
firebaseCrashlytics { | |
nativeSymbolUploadEnabled true | |
// Зададаются пути т.к. мы используем сторонние NDK зависимости, которые лежат в других модулях | |
// https://firebase.google.com/docs/crashlytics/ndk-reports#upload-symbols-external-dependencies | |
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib' | |
} | |
} | |
depenencies { | |
implementation "com.google.firebase:firebase-crashlytics-ndk:18.2.8" |
This file contains 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 toArrayOfByteArrays(): Array<ByteArray> { | |
val bytesArr = mutableListOf<ByteArray>() | |
javaClass.declaredFields.forEach { field -> | |
val constructorValueAsStr = (field.get(this) as? String) | |
constructorValueAsStr?.let { | |
val bytes = fillBytes(it) | |
bytesArr.add(bytes) | |
} | |
} |
This file contains 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
import android.content.res.AssetManager | |
import android.graphics.drawable.BitmapDrawable | |
import android.graphics.drawable.Drawable | |
// Fun to get bitmap, text from assets | |
fun AssetManager.assetsToBitmap(fileName: String): Drawable? { | |
return try { | |
open(fileName).use { | |
BitmapDrawable.createFromStream(it, null) | |
} |
This file contains 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
# We can provide flags and paths to CMake (ex. OpenCV) | |
android { | |
defaultConfig { | |
externalNativeBuild { | |
cmake { | |
path file('src/main/cpp/CMakeLists.txt') // path to CMake file | |
cppFlags "-frtti -fexceptions" //Turn on ability to stacktrace C++ exceptions | |
cppFlags "-std=c++17" //Specify c++ version | |
cppFlags "-DCMAKE_BUILD_TYPE=Debug" | |
cppFlags "-DENABLE_NEON=ON -DENABLE_VFPV3=ON" |
This file contains 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
#!/bin/bash | |
#Log to file avg / min / max process cpu % for selected number | |
#using: sh {selected_thread_name} {launch_times} | |
echo "--- CPU dumper <top>" | |
#Setup vars | |
selected_thread_name=$1 | |
launch_times=$2 | |
top_line_str="" |
This file contains 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
/* For accessing primitive types from class use | |
following field descriptors | |
+---+---------+ | |
| Z | boolean | | |
| B | byte | | |
| C | char | | |
| S | short | | |
| I | int | | |
| J | long | |
This file contains 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
data class Test( | |
val testField: ByteArray | |
) | |
private external fun extractByteArray(test: Test) |
This file contains 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
import android.content.Context | |
import android.util.AttributeSet | |
import android.widget.ProgressBar | |
import android.animation.TimeAnimator | |
import android.graphics.* | |
import android.graphics.drawable.Animatable | |
import android.graphics.drawable.Drawable | |
class ScrollingGradient : Drawable(), Animatable, TimeAnimator.TimeListener { |
NewerOlder