Skip to content

Instantly share code, notes, and snippets.

View adolgiy's full-sized avatar

Aleksey Dolgiy adolgiy

View GitHub Profile
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 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
*
* Unless required by applicable law or agreed to in writing, software
@gabrielemariotti
gabrielemariotti / README.md
Last active March 9, 2023 06:02
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@mkholodnyak
mkholodnyak / remote_socks
Last active October 13, 2022 02:15
Создать socks5-прокси через удалённый сервер. Например, DigitalOcean.
ssh -D 5555 -i ~/.ssh/id_rsa login@servername -N
@evantoli
evantoli / GitConfigHttpProxy.md
Last active April 26, 2024 17:21
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@cbeyls
cbeyls / MultiChoiceHelper.java
Last active September 30, 2020 14:48
Helper class to reproduce ListView's modal MultiChoice mode with a RecyclerView. Compatible with API 7+.
package be.digitalia.common.widgets;
import android.content.Context;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v4.util.LongSparseArray;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.view.ActionMode;
@Miha-x64
Miha-x64 / PicassoTextView.kt
Last active April 26, 2021 18:48
A TextView with Picasso targets for compound drawables
package net.aquadc.commonandroid.views
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.TransitionDrawable
import android.view.View
@Miha-x64
Miha-x64 / BoundService.kt
Last active January 5, 2020 14:48
Boilerplate for bound services (may become a part of http://github.com/Miha-x64/Flawless) later
package net.aquadc.flawless.service
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.Binder
import android.os.IBinder
/**
object a<T> {
operator fun get(vararg values:T) = values
}
a[] // empty array
a[1, 2, 3] // arrayOf(1,2,3)
@y2k
y2k / lite-moxy.kt
Created February 15, 2019 13:13
lite moxy
interface LitePresenter<T : Any> {
fun attachView(view: LiteView<T>)
fun detachView()
}
open class BaseLitePresenter<T : Any> : LitePresenter<T> {
private val buffer = ArrayList<T>()
private var view: LiteView<T>? = null
private var firstAttached = false
@Miha-x64
Miha-x64 / proguard-rules.pro
Last active March 13, 2023 07:27
Healthy person's ProGuard rules for Android and Kotlin.
# preverify is useful only for J2ME
# R8 doesn't preverify by default
#-dontpreverify
-optimizationpasses 5
# this seems to be enough
# remove indirection
-allowaccessmodification