Skip to content

Instantly share code, notes, and snippets.

Avatar
☸️
Planning

Omkar Tenkale omkar-tenkale

☸️
Planning
  • FRND
  • India
View GitHub Profile
@omkar-tenkale
omkar-tenkale / build.gradle
Created Nov 15, 2022
Change gradle android apk name
View build.gradle
android{
...
def changeApkName = { variant ->
variant.outputs.each { output ->
def apk = output.outputFile;
def addBrand = true
def addTime = false
def addGitBranch = true
def addVersionCode = true
def addVersionName = true
@omkar-tenkale
omkar-tenkale / build.gradle
Created Nov 15, 2022
Gradle keystore configuration
View build.gradle
apply plugin: ...
def debugKeystorePropertiesFile = rootProject.file("env/debug-keystore.properties");
def debugKeystoreProperties = new Properties()
debugKeystoreProperties.load(new FileInputStream(debugKeystorePropertiesFile))
def releaseKeystorePropertiesFile = rootProject.file("env/release-keystore.properties");
def releaseKeystoreProperties = new Properties()
if(releaseKeystorePropertiesFile.exists()) {
releaseKeystoreProperties.load(new FileInputStream(releaseKeystorePropertiesFile))
View gist:1547aa340dab725b07cda5151969a9c2
1. In navigation toolbar, A new ICON ![Sequence Diagram ...](imges/sequence.svg){:height="24px" width="24px"} added.
View VaragrNonNullCheckTest.kt
//approach 1
fun main(){
val a = Unit
val b = null
if(listOf(a,b).all{ it != null }){
println("Not null")
}else{
print("Please check inputs")
}
}
@omkar-tenkale
omkar-tenkale / R.anim.anim_press.xml
Last active Nov 16, 2022
View extensions with click/press effect
View R.anim.anim_press.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true" android:fillBefore="true">
<scale
android:duration="100"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
@omkar-tenkale
omkar-tenkale / ModularInheritance.kt
Created Sep 13, 2022
Inheritance for multi module project in kotlin, android
View ModularInheritance.kt
import kotlinx.coroutines.*
fun main() {
BaseAPIImpl().endpoint1()
ModuleAPIImpl().endpoint1()
ModuleAPIImpl().endpoint2()
(ModuleAPIImpl() as ModuleAPI).endpoint1()
(ModuleAPIImpl() as ModuleAPI).endpoint2()
}
View KotlinContraVarienceAndCovarience
-----FRUIT BASKET--------
-----MANGO BASKET-------- PUT ANY MEMBER TO FRUIT BASKET AS MANGO - OK, GET ANY MEMBER FROM FRUIT AS MANGO - NOT OK
-----MANGO BASKET-------- PUT ANY MEMBER TO KESHAR-MANGO BASKET AS MANGO - NOT OK, GET ANY MEMBER FROM KESHAR-MANGO AS MANGO - OK
-----KESHAR-MANGO BASKET--------
View SimpleFlowImpl.kt
interface MFlow<T>{
fun collect(collector: MCollector<T>)
}
interface MCollector<T>{
fun onEmit(item :T)
}
// fun mFlowOf(value: String):MFlow<String>{
View BaseActivity.java
public class BaseActivity extends FragmentActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
IronSource.init(this, AppConfig.IRONSOURCE_APP_KEY);
...
}
}
@omkar-tenkale
omkar-tenkale / ImagesToPdf.java
Last active Jul 23, 2021
Images to pdf android java
View ImagesToPdf.java
// Just pass context and list of file
// It will create a PDF file in cache dir
// Add your own logic to share/open PDF
// Works fast and reliable method
// > - No library needed (Uses android internal android.graphics.pdf.PdfDocument classes)
// > - Works in background, Doesn''t freeze UI
// > - No need to declare and grant storage permission :)