Skip to content

Instantly share code, notes, and snippets.

View livotov's full-sized avatar

Dmitri Livotov livotov

View GitHub Profile
@livotov
livotov / MainActivity
Created November 17, 2017 14:19 — forked from aftabsikander/MainActivity
How to create Custom Span
import android.app.Activity;
import android.content.Context;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.StyleSpan;
import android.view.View;
@livotov
livotov / ubuntu-cli-install-android-sdk.sh
Created October 30, 2017 15:40 — forked from zhy0/ubuntu-cli-install-android-sdk.sh
Install Android SDK on headless Ubuntu linux machine via command line, so that you can compile open source Android apps.
#!/bin/bash
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n
# Install Oracle JDK 8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-get install -y unzip make # NDK stuff
@livotov
livotov / two_line_item_layout.xml
Created October 19, 2017 11:34 — forked from renanferrari/two_line_item_layout.xml
Android Material Design List Item Layouts (based on http://stackoverflow.com/a/27661786/518179)
<!-- Clickable and selectableItemBackground are optional -->
<RelativeLayout
android:id="@+id/two_line_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:clickable="true"
android:minHeight="72dp"
android:paddingEnd="?listPreferredItemPaddingRight"
android:paddingLeft="?listPreferredItemPaddingLeft"

Keybase proof

I hereby claim:

  • I am livotov on github.
  • I am livotov (https://keybase.io/livotov) on keybase.
  • I have a public key ASAcFaJocfoZqL8MLMbs5cKLhAIxeYSvDOGvKfd0gzvWRgo

To claim this, I am signing this object:

@livotov
livotov / KeyboardSensitiveRelativeLayout.java
Created March 27, 2017 08:16 — forked from faruktoptas/KeyboardSensitiveRelativeLayout.java
A layout that detects Soft Keyboard is visible or not.
public class KeyboardSensitiveRelativeLayout extends RelativeLayout {
private OnKeyboardShowHideListener listener;
public KeyboardSensitiveRelativeLayout(Context context) {
super(context);
}
public KeyboardSensitiveRelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
@livotov
livotov / settings.gradle
Created March 19, 2017 08:34
How to reference a local android library project (somelib) from another android app project in order to automatically fetch latest sources changes from it
include ':mobile', ':somelib'
project(':somelib').projectDir = new File('/home/username/projects/somelib')