Skip to content

Instantly share code, notes, and snippets.

View ShadyRover's full-sized avatar
💭
I may be slow to respond.

ShadyRover

💭
I may be slow to respond.
View GitHub Profile
@ShadyRover
ShadyRover / README.md
Created February 15, 2018 06:20 — forked from gabrielemariotti/README.md
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle
@ShadyRover
ShadyRover / BannerAutoScrollRecyclerView.java
Created December 21, 2018 08:03
BannerAutoScrollRecyclerView
public class BannerAutoScrollRecyclerView extends RecyclerView {
private static final int AUTO_SCROLL_PERIOD_MILLIS = 3500;
private static final int SCROLL_WHAT = 1;
private boolean mAutoScrollEnabled;
private boolean mAutoScrolling;
private ScrollHandler mHandler;
private static class ScrollHandler extends Handler {
private final WeakReference<BannerAutoScrollRecyclerView> mRecyclerViewWeakReference;
@ShadyRover
ShadyRover / NavigationExtensions.kt
Created September 9, 2020 13:45
Fix for NavigationExtensions when reinitialization bottom navigation
package ru.rt.key.app.extension
import android.content.Intent
import android.util.SparseArray
import android.view.MenuItem
import androidx.core.util.forEach
import androidx.core.util.set
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.AdapterView
import android.widget.SpinnerAdapter
import androidx.appcompat.widget.AppCompatSpinner
private const val NO_POSITION = -1
@ShadyRover
ShadyRover / accept_licences.sh
Created October 19, 2021 12:11
Accept All Android Emulator Licences
#!/bin/bash
<< ////
The script creates 'licenses' under '$ANDROID_HOME' and creates a file which proves
that the SDK license was accepted by the user.
Usage:
In .travis.yml
before_script:
- curl URL_OF_THIS_FILE | sh
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
@ShadyRover
ShadyRover / git-tool.py
Last active August 10, 2022 09:50
Python script that finds branches with the latest commit older than a given date
#!/usr/bin/env python3
# Using:
# Run script with parameters
# pip3 install gitpython
# chmod +x git-tool.py
# ./git-tool.py check -d "01/01/2021" -p "/Users/path_to_git_repo"
# ./git-tool.py delete -d "/Users/path_to_git_repo"
import datetime
import sys