Skip to content

Instantly share code, notes, and snippets.

View tarek360's full-sized avatar
💭
I'm Fluttering!

Ahmed Tarek tarek360

💭
I'm Fluttering!
View GitHub Profile
RichPathView colorPickerRichPathView = findViewById(R.id.color_picker);
final RichPath bluePath = colorPickerRichPathView.findRichPathByName("bluePath");
final RichPath redPath = colorPickerRichPathView.findRichPathByName("redPath");
final RichPath greenPath = colorPickerRichPathView.findRichPathByName("greenPath");
final RichPath purplePath = colorPickerRichPathView.findRichPathByName("purplePath");
colorPickerRichPathView.setOnPathClickListener(new RichPath.OnPathClickListener() {
@Override
public void onClick(RichPath richPath) {
// reset all strokes
<com.richpath.RichPathView
android:id="@+id/color_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:vector="@drawable/color_picker" />
RichPathView colorPickerRichPathView = findViewById(R.id.color_picker);
final RichPath bluePath = colorPickerRichPathView.findRichPathByName("bluePath");
final RichPath redPath = colorPickerRichPathView.findRichPathByName("redPath");
final RichPath greenPath = colorPickerRichPathView.findRichPathByName("greenPath");
final RichPath purplePath = colorPickerRichPathView.findRichPathByName("purplePath");
colorPickerRichPathView.setOnPathClickListener(new RichPath.OnPathClickListener() {
@Override
public void onClick(RichPath richPath) {
bluePath.setStrokeAlpha(0f);
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="218dp"
android:height="64dp"
android:viewportHeight="40"
android:viewportWidth="136">
<path
android:fillColor="#FFFFFF"
android:pathData="M136,38c0,1.1-0.9,2-2,2H2c-1.1,0-2-0.9-2-2V2c0-1.1,0.9-2,2-2h132c1.1,0,2,0.9,2,2V38z" />
final KyrieDrawable kyrieDrawable =
KyrieDrawable.builder()
.viewport(409, 280)
.child(
PathNode.builder()
.strokeColor(Color.BLACK)
.strokeWidth(1f)
.fillColor(
Animation.ofArgb(hippoFillColor, elephantFillColor).duration(300),
Animation.ofArgb(buffaloFillColor).startDelay(600).duration(300),
final RichPath richPath = imageView.findFirstRichPath();
richPath.setStrokeColor(Color.BLACK);
richPath.setStrokeWidth(1f);
RichPathAnimator
.animate(richPath)
.pathData(elephantPathData)
.fillColor(elephantFillColor)
.duration(600)
val VariableElements = typeElement.enclosedElements
.filterIsInstance<VariableElement>()
@tarek360
tarek360 / Car.java
Last active June 8, 2017 18:48
Car.java annotated with @easyjson
import com.tarek30.annotation.EasyJSON;
import org.json.JSONObject;
@EasyJSON
public class Car {
long modelNumber;
int maxSpeed;
String color;
String manufacturer;
String style;
import com.google.auto.service.AutoService
import com.tarek30.annotation.EasyJSON
import javax.annotation.processing.AbstractProcessor
import javax.annotation.processing.ProcessingEnvironment
import javax.annotation.processing.Processor
import javax.annotation.processing.RoundEnvironment
import javax.lang.model.SourceVersion
import javax.lang.model.element.TypeElement
@AutoService(Processor::class)
@tarek360
tarek360 / EasyJSON.kt
Created June 8, 2017 11:14
annotation in Kotlin
@Target(AnnotationTarget.CLASS)
annotation class EasyJSON