Graphics OverScroll RGB

//moreblock: |overScroll| |view:item| (namber:r) (namber:g) (namber:b)


if (Build.VERSION.SDK_INT >= 21) {

android.widget.EdgeEffect edgeEffectTop = new android.widget.EdgeEffect(this);

edgeEffectTop.setColor(Color.rgb((int)_r,(int)_g,(int)_b));

android.widget.EdgeEffect edgeEffectBottom = new android.widget.EdgeEffect(this);

edgeEffectBottom.setColor(Color.rgb((int)_r,(int)_g,(int)_b));

try {
java.lang.reflect.Field f1 = android.widget.ScrollView.class.getDeclaredField("mEdgeGlowTop");
f1.setAccessible(true);
f1.set(_item, edgeEffectTop);

java.lang.reflect.Field f2 = android.widget.ScrollView.class.getDeclaredField("mEdgeGlowBottom");
f2.setAccessible(true);
f2.set(_item, edgeEffectBottom);
}
catch (Exception e)
{
e.printStackTrace();
}
} else {

int glowDrawableId = getResources().getIdentifier("overscroll_glow", "drawable", "android");

android.graphics.drawable.Drawable androidGlow = getResources().getDrawable(glowDrawableId);

androidGlow.setColorFilter(Color.rgb((int)_r,(int)_g,(int)_b), PorterDuff.Mode.MULTIPLY);

int edgeDrawableId = getResources().getIdentifier("overscroll_edge", "drawable", "android");

android.graphics.drawable.Drawable androidEdge = getResources().getDrawable(edgeDrawableId);

androidEdge.setColorFilter(Color.rgb((int)_r,(int)_g,(int)_b), PorterDuff.Mode.MULTIPLY);
}

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button

Animation Transtition Animation