Skip to content

Instantly share code, notes, and snippets.

View balao7's full-sized avatar
🏠
Working from home

BHawk balao7

🏠
Working from home
View GitHub Profile
@balao7
balao7 / ModalBottomSheet.kt
Created November 1, 2024 15:48 — forked from Pasha831/ModalBottomSheet.kt
ModalBottomSheetLayout for Material 3 Jetpack Compose
package com.hse.parkingapp.ui.beta.screens.components.material3
/*
* Copyright 2020 The Android Open Source Project
*
* 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
@balao7
balao7 / build.gradle.kts
Created May 15, 2024 15:27 — forked from mricciuti/build.gradle.kts
gradle build script to reproduce artifactory publishing issue
plugins {
`kotlin-dsl`
id("com.jfrog.artifactory") version "5.1.11"
java
`java-gradle-plugin`
`maven-publish`
}
group = "org.example.gradle.publishing"
enum class Sport { HIKE, RUN, TOURING_BICYCLE, E_TOURING_BICYCLE }
data class Summary(val sport: Sport, val distance: Int)
fun main() {
val sportStats = listOf(
Summary(Sport.HIKE, 92),
Summary(Sport.RUN, 77),
Summary(Sport.TOURING_BICYCLE, 322),
Summary(Sport.E_TOURING_BICYCLE, 656)
@balao7
balao7 / maven-publish-helper-usage.gradle
Created November 15, 2021 21:49 — forked from Robyer/maven-publish-helper-usage.gradle
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {
@balao7
balao7 / AnAndroidApp.kt
Created November 12, 2021 21:26 — forked from manuelvicnt/AnAndroidApp.kt
Hilt and AssistedInject working together in Hilt v2.28-alpha times - ViewModel version
// AssistedInject and Hilt working together in v2.28-alpha times
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt
// As AssistedInject isn't part of Dagger yet, we cannot use in
// conjuction with @ViewModelInject
data class MyInitParams(private val neededId: String)
class MyViewModel @AssistedInject constructor(
... // Other dependencies injected by Hilt
// com.squareup.inject.assisted.Assisted annotation
@balao7
balao7 / app\build.gradle.kts
Created August 6, 2020 04:02 — forked from f3401pal/app\build.gradle.kts
Multi-module Android project with Kotlin DSL for Gradle
plugins {
`android-base-app`
`android-base`
id("io.fabric")
}
android {
defaultConfig {
versionCode = 20
versionName = "1.6.3"
@balao7
balao7 / ActivitiesLaunchingWay.kt
Created March 10, 2020 20:15 — forked from wajahatkarim3/ActivitiesLaunchingWay.kt
Kotlin Extensions for simpler, easier and funw way of launching of Activities
/**
* Kotlin Extensions for simpler, easier and funw way
* of launching of Activities
*/
inline fun <reified T : Any> Activity.launchActivity (
requestCode: Int = -1,
options: Bundle? = null,
noinline init: Intent.() -> Unit = {})
{
@balao7
balao7 / colors.xml
Created February 20, 2020 00:54
Material Design Color Palette Colors.xml Resource file for Android
<?xml version="1.0" encoding="utf-8"?>
<!--
Google Material Design Color Palette for Android http://www.google.com/design/spec/style/color.html#color-ui-color-palette
Spreadsheet used to create this reosurce - http://bit.ly/mdcolor_spreadsheet
Link to this colors.xml resource file - http://bit.ly/mdcolorsxml
Harshad Kale
https://github.com/kalehv
-->
@balao7
balao7 / InjectableActivityScenario.kt
Created February 10, 2020 20:53 — forked from rharter/InjectableActivityScenario.kt
An ActivityScenario that allows you to use Dagger Android's automatic, lifecycle based injection without making your Application class `open`, or overriding it in tests.
package com.pixite.pigment.testing
import android.app.Activity
import android.app.Instrumentation
import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
package com.doordash.mvpexample.data;
import android.support.annotation.NonNull;
import android.support.annotation.VisibleForTesting;
import com.doordash.mvpexample.api.AuthenticationApi;
import com.doordash.mvpexample.helpers.SharedPreferencesHelper;
import com.doordash.mvpexample.models.Token;
import javax.inject.Inject;