Skip to content

Instantly share code, notes, and snippets.

View smartherd's full-sized avatar

Sriyank Siddhartha smartherd

View GitHub Profile
@smartherd
smartherd / .gitignore
Last active February 1, 2023 13:23
Gitignore File for Android Studio Projects for MacOS, Windows, and Linux
# macOS files
.DS_Store
.AppleDouble
.LSOverride
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
title: Create Lifecycle-Aware Component
description: ... 

Slide

[Slide 01] $[//] $

So let's explore how we create a lifecycle-aware component.

@smartherd
smartherd / MainActivity.kt
Created May 26, 2022 05:21
Toast Message in Android Jetpack Compose | Source Code
package com.sriyank.composecomponents
import android.os.Bundle
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Button
@smartherd
smartherd / MainActivity.kt
Created May 25, 2022 08:10
Button, OutlinedButton, and TextButton in Jetpack Compose
package com.sriyank.composecomponents
import android.content.Context
import android.os.Bundle
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
@smartherd
smartherd / DraggableCoordinatorLayout.kt
Last active March 29, 2023 09:14
Android Draggable MaterialCardView
package com.sriyank.mdccomponents
import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.customview.widget.ViewDragHelper
import java.util.*
@smartherd
smartherd / MainActivity.kt
Created December 4, 2020 12:06
Checkable MaterialCardView
package com.sriyank.mdccomponents
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
@smartherd
smartherd / MainActivity.kt
Created December 3, 2020 08:15
Extended Floating Action Button Gist Files
package com.sriyank.mdccomponents
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import androidx.core.widget.NestedScrollView
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
package com.sriyank.mdccomponents
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
@smartherd
smartherd / MainActivity.kt
Created November 27, 2020 10:06
Material Toggle Button with Icon only
package com.sriyank.mdccomponents
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
@smartherd
smartherd / MainActivity.kt
Created November 27, 2020 08:03
Material Toggle Button (Material Design Component: MDC)
package com.sriyank.mdccomponents
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {