Skip to content

Instantly share code, notes, and snippets.

View oleggreen's full-sized avatar

Oleg Green oleggreen

View GitHub Profile
@oleggreen
oleggreen / SwipeButton.kt
Created March 18, 2024 18:02
Swipable button example in Jetpack Compose
package com.oleg.green.swipe_button
import android.content.res.Configuration
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.Crossfade
import androidx.compose.animation.core.tween
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.AnchoredDraggableState
import androidx.compose.foundation.gestures.DraggableAnchors
@oleggreen
oleggreen / gist:3346eca75d26b9f468ec
Last active August 29, 2015 14:23
Android Support Annotations
@oleggreen
oleggreen / gist:221ff19cfa920757b404
Last active August 29, 2015 14:21
android studio layout preview attributes

Tools Attributes

link to source (android tools project site)

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    ....
@oleggreen
oleggreen / gist:4ad337ad72f88c731a16
Last active August 29, 2015 14:15
proguard configuration
# Retrofit, OkHttp, Gson
-keepattributes *Annotation*
-keepattributes Signature
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
-dontwarn rx.**
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {
@oleggreen
oleggreen / .git_branch_in_prompt.sh
Last active August 29, 2015 14:00
configuring git branch appearance in prompt
# add lines below to a "~/.bashrc" file
# or save this file for example in "~/" folder
# and include file in "~/.bashrc":
# if [ -f ~/.git_branch_in_prompt.sh ]; then
# . ~/.git_branch_in_prompt.sh
# fi
RED='\[\033[1;31m\]'
YELLOW='\[\033[1;33m\]'
GREEN='\[\033[1;32m\]'
@oleggreen
oleggreen / git_useful_tips.md
Last active August 29, 2015 13:58
git tips
  • Disable chmode change detection:
    git config core.fileMode false
    git -c core.fileMode=false status //for single command

  • Check which branches are merged:
    git checkout master
    git branch --merged

  • Check which branches are NOT merged:
    git branch --no-merged