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
/* | |
* | |
<declare-styleable name="GridSpanLayout"> | |
<attr name="rows" format="integer" /> | |
<attr name="columns" format="integer" /> | |
<attr name="column" format="integer" /> | |
<attr name="row" format="integer" /> | |
<attr name="columnSpan" format="integer" /> | |
<attr name="rowSpan" format="integer" /> |
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 VG extends ViewGroup { | |
private static final String TAG = "VG"; | |
private final ViewDragHelper mDragHelper; | |
private Rect[] mBounds = new Rect[4]; | |
public VG(Context context) { | |
super(context); | |
int[] colors = {Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW}; | |
for (int i = 0; i < 4; i++) { | |
TextView tv = new TextView(getContext()); |
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
package com.example.app.myapplication; | |
import android.graphics.ColorFilter; | |
import android.graphics.ColorMatrix; | |
import android.graphics.ColorMatrixColorFilter; | |
public class ColorFilterGenerator { | |
private static double DELTA_INDEX[] = { | |
0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, |
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
package com.example.app.myapplication; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/* | |
res/layout/fsvt.xml test layout file: | |
<?xml version="1.0" encoding="utf-8"?> |
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
package com.example.app.myapplication; | |
import android.content.Context; | |
import android.support.v4.widget.ViewDragHelper; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public abstract class FlexScrollView extends ViewGroup { |
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
package com.example.app.myapplication; | |
import android.database.Cursor; | |
import android.database.CursorWrapper; | |
public class ColumnExtenderCursor extends CursorWrapper { | |
private final String[] columnNames; | |
public ColumnExtenderCursor(Cursor cursor, String... newColumns) { |
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
// add in Activity#onCreate | |
ListView lv = new ListView(this); | |
setContentView(lv); | |
Uri uri = ContactsContract.Contacts.CONTENT_URI; | |
Wrapper c = Wrapper.query(getContentResolver(), uri, null, null, null, ContactsContract.Contacts.DISPLAY_NAME, getResources()); | |
String[] from = { | |
ContactsContract.Contacts.DISPLAY_NAME, | |
Wrapper.PHONES, | |
}; |
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
abstract class DecoratedDrawable extends LevelListDrawable { | |
public DecoratedDrawable(Context ctx, int resId) { | |
TypedArray typedArray = ctx.obtainStyledAttributes(new int[] {resId}); | |
Drawable drawable = typedArray.getDrawable(0); | |
typedArray.recycle(); | |
if (drawable == null) { | |
drawable = ctx.getResources().getDrawable(resId); | |
} | |
init(drawable); | |
} |
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
class CircleBitmapDrawable extends Drawable { | |
Bitmap bitmap; | |
Paint maskPaint = new Paint(Paint.ANTI_ALIAS_FLAG); | |
Paint borderPaint = new Paint(Paint.ANTI_ALIAS_FLAG); | |
float side; | |
float radius; | |
public CircleBitmapDrawable(Bitmap wrappedBitmap, float borderWidth, int borderColor) { | |
bitmap = wrappedBitmap; | |
borderPaint.setStyle(Paint.Style.STROKE); |
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
import 'dart:async'; | |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:quiver/cache.dart'; | |
import 'package:quiver/collection.dart'; | |
/* | |
class LazyList extends StatefulWidget { |
OlderNewer