This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GridLayoutManager does not respect children's layout parameters. It sends measure spec as `EXACTLY` to children's `onMeasure` method. | |
You could wrap each children in a layout like FrameLayout. | |
ViewPager does not respect its children's margin settings. To have margins, wrap your children in a FrameLayout. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bitmap bitmap = Bitmap.createBitmap(pageWidth, pageHeight, Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); | |
// inflate a view | |
View view = LayoutInflater.from(context).inflate(R.layout.view, null); | |
int marginLeft = 100; | |
int marginTop = 100; | |
Rect bound = new Rect(marginLeft, marginTop, pageWidth - marginLeft, pageHeight - marginTop); | |
//Measure the view at the exact dimensions (otherwise the text won't center correctly) | |
int widthSpec = View.MeasureSpec.makeMeasureSpec(bound.width(), View.MeasureSpec.EXACTLY); | |
int heightSpec = View.MeasureSpec.makeMeasureSpec(bound.height(), View.MeasureSpec.EXACTLY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This snippet is from http://stackoverflow.com/questions/17667964/how-to-create-shape-with-solid-corner-stroke-in-java-code | |
int strokeWidth = 5; // 3px not dp | |
int roundRadius = 15; // 8px not dp | |
int strokeColor = Color.parseColor("#2E3135"); | |
int fillColor = Color.parseColor("#DFDFE0"); | |
GradientDrawable gd = new GradientDrawable(); | |
gd.setColor(fillColor); | |
gd.setCornerRadius(roundRadius); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<stroke | |
android:color="#000000" | |
android:width="2dp"/> | |
<corners android:radius="6dp"/> | |
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OptionLayout extends LinearLayout | |
{ | |
@InjectView(R.id.title) | |
TextView title; | |
@InjectView(R.id.summary) | |
TextView summary; | |
@InjectView(R.id.content) | |
ViewGroup content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<gradient | |
android:angle="0" | |
android:startColor="#f00" | |
android:centerColor="@android:color/transparent" | |
android:centerX="0.01" /> | |
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- | |
Created using JS Bin | |
http://jsbin.com | |
Copyright (c) 2015 by anonymous (http://jsbin.com/hizoperevo/1/edit) | |
Released under the MIT license: http://jsbin.mit-license.org | |
--> | |
<meta name="robots" content="noindex"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function pychanged { | |
git diff --name-only $1 $2 |grep -q ".py$" | |
} | |
while read oldrev newrev ref | |
do | |
branch=`echo $ref | cut -d/ -f3` | |
if [ "production" == "$branch" -o "master" == "$branch" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember Starter Kit</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.8.0/ember.js"></script> | |
<style id="jsbin-css"> |