Skip to content

Instantly share code, notes, and snippets.

@ArtemiyTerekhov
ArtemiyTerekhov / Device Details
Created April 2, 2020 07:54 — forked from VenomVendor/Device Details
Get Device Details in Android Programmatically.
String details = "VERSION.RELEASE : "+Build.VERSION.RELEASE
+"\nVERSION.INCREMENTAL : "+Build.VERSION.INCREMENTAL
+"\nVERSION.SDK.NUMBER : "+Build.VERSION.SDK_INT
+"\nBOARD : "+Build.BOARD
+"\nBOOTLOADER : "+Build.BOOTLOADER
+"\nBRAND : "+Build.BRAND
+"\nCPU_ABI : "+Build.CPU_ABI
+"\nCPU_ABI2 : "+Build.CPU_ABI2
+"\nDISPLAY : "+Build.DISPLAY
+"\nFINGERPRINT : "+Build.FINGERPRINT
@ArtemiyTerekhov
ArtemiyTerekhov / horizontal_progress_demo.xml
Created October 27, 2018 19:15 — forked from Antarix/horizontal_progress_demo.xml
Android Custom horizontal ProgressBar emample
<RelativeLayout 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">
<ProgressBar
android:id="@+id/progress_limit"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ArtemiyTerekhov
ArtemiyTerekhov / ItemClickSupport.java
Created September 14, 2018 12:33 — forked from beraldofilippo/ItemClickSupport.java
RecyclerView single and double click listener on items of a RecyclerView.
/**
* Created by Hugo Visser.
* Please see http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/
*
* Modified by Filippo Beraldo:
* - Added OnDoubleClickListener in place of the standard OnClickListener.
*/
public class ItemClickSupport {
private final RecyclerView mRecyclerView;
@ArtemiyTerekhov
ArtemiyTerekhov / KeyboardUtils.java
Created December 29, 2017 11:46 — forked from lopspower/KeyboardUtils.java
Force Hide Keyboard Android
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
public class KeyboardUtils {
public static void hideKeyboard(Activity activity) {
View view = activity.findViewById(android.R.id.content);
@ArtemiyTerekhov
ArtemiyTerekhov / RxJava.md
Created May 5, 2017 12:58 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)