Skip to content

Instantly share code, notes, and snippets.

View ibrahimsn98's full-sized avatar

İbrahim Süren ibrahimsn98

View GitHub Profile
@ibrahimsn98
ibrahimsn98 / Demeter.kt
Created September 17, 2022 14:54
ty-demeter-blog-2
fun sendEvent(name: String, group: String, screen: String, parameters: Map<String, String>) {
singleEventDispatcher.dispatch(name, group, screen, parameters)
}
fun enqueueEvent(name: String, group: String, screen: String, parameters: Map<String, String>) {
batchEventDispatcher.dispatch(name, group, screen, parameters)
}
apply plugin: 'maven-publish'
static def isReleaseBuild() {
return !Config.versionName.contains("SNAPSHOT")
}
def getOutputDir() {
if (isReleaseBuild()) {
return "${project.buildDir}/releases"
} else {
@ibrahimsn98
ibrahimsn98 / bottomsheet.kt
Created July 7, 2021 14:03
Android Appending Sticky Bottom Sheet View
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val bottomSheetDialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
bottomSheetDialog.setOnShowListener {
val containerLayout = dialog?.findViewById(
com.google.android.material.R.id.container
) as? FrameLayout
val buttonLayout = LayoutInflater.from(dialog?.context)
.inflate(R.layout.layout_delivery_bottom_sheet_buttons, null)
.findViewById<LinearLayout>(R.id.layoutButtons)
allprojects {
repositories {
google()
jcenter()
...
maven {
url "https://gitlab.com/api/v4/projects/projectid/packages/maven"
name "GitLab"
credentials(HttpHeaderCredentials) {
name = 'Private-Token'
implementation "com.company.project:artifact:1.0.0-SNAPSHOT"
apply from: "$rootDir/gradle-mvn-push.gradle"
buildscript {
...
}
plugins {
id 'maven-publish'
}
allprojects {
...
( printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 cat.ab ) | tar xfvz -
@ibrahimsn98
ibrahimsn98 / AdmobConsentSimple
Created June 18, 2018 16:12 — forked from ameerhamza6733/AdmobConsentSimple
Simple for Consent sdk android admob
/*https://www.youtube.com/watch?v=_JOapnq8hrs&t=852s
video tutorial for consent sdk android
*/
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
@ibrahimsn98
ibrahimsn98 / LivePreference.kt
Last active July 27, 2019 11:23
Android-Live-Shared-Preferences-Gist3
class LivePreference<T> constructor(private val updates: Observable<String>,
private val preferences: SharedPreferences,
private val key: String,
private val defaultValue: T) : MutableLiveData<T>() {
private var disposable: Disposable? = null
override fun onActive() {
super.onActive()
value = (preferences.all[key] as T) ?: defaultValue