Skip to content

Instantly share code, notes, and snippets.

Emin Yahyayev ewintory

Block or report user

Report or block ewintory

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View chrome.md

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
View activity
@Override
public void onMenuToggle(final boolean isOpen) {
setBackgroundDimming(isOpen);
}
private void setBackgroundDimming(boolean dimmed) {
final float targetAlpha = dimmed ? 1f : 0;
final int endVisibility = dimmed ? View.VISIBLE : View.GONE;
mDimmerView.setVisibility(View.VISIBLE);
mDimmerView.animate()
View android.md

Android Cheat Sheet

Developer tips

Record a video of your app

Developer options -> Check show touches
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4
View material_colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="material_red50">#ffffebee</color>
<color name="material_red100">#ffffcdd2</color>
<color name="material_red200">#ffef9a9a</color>
<color name="material_red300">#ffe57373</color>
<color name="material_red400">#ffef5350</color>
<color name="material_red500">#fff44336</color>
<color name="material_red600">#ffe53935</color>
<color name="material_red700">#ffd32f2f</color>
@ewintory
ewintory / MainActivity.java
Last active Aug 29, 2015 — forked from blackcj/MainActivity.java
Design support library with CoordinatorLayout, SwipeRefreshLayout and RecyclerView.
View MainActivity.java
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import com.blackcj.designsupportexample.adapters.RecyclerViewAdapter;
@ewintory
ewintory / LeakSlackUploadService.java
Created Feb 16, 2016 — forked from pyricau/LeakSlackUploadService.java
Sending Leak Traces to a Slack Channel (and HipChat, see the comments)
View LeakSlackUploadService.java
import android.util.Log;
import com.squareup.leakcanary.AnalysisResult;
import com.squareup.leakcanary.DisplayLeakService;
import com.squareup.leakcanary.HeapDump;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.Part;
import retrofit.mime.TypedFile;
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Add this as a debug manifest so the permissions won't be required by your production app -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
</manifest>
You can’t perform that action at this time.