Skip to content

Instantly share code, notes, and snippets.

@omar-adel
omar-adel / LocalBroadcastExampleActivity.java
Created September 2, 2018 07:02 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
circle_background_views.xml:
<?xml version="1.0" encoding="utf-8"?>
<!-- Background circle for the magnitude value -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#ffffff" />
<stroke android:width="2dp"
android:color="#437c32" />
@omar-adel
omar-adel / SublimeText-Project-Line-Count
Created March 19, 2018 19:53 — forked from halcarleton/SublimeText-Project-Line-Count
Count total lines of code in a Sublime Text Project or Directory
Go to menu:
Find -> Find in Files... (windows: ctrl+shift+f)
Switch on reg_ex button (windows: alt+r)
Find:
^.*\S+.*$
Where:
c:\your_folder\,*.php,*.js,*.inc,*.html,*.htm,*.scss, -*/folder_to_exclude/*, -*.min.js
@omar-adel
omar-adel / PFRecyclerViewAdapter.java
Created June 21, 2017 08:10 — forked from Plumillon/PFRecyclerViewAdapter.java
Simpler generic RecyclerView.Adapter and RecyclerView.ViewHolder with click listener
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;