Graphics OverScroll Hex

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


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

edgeEffectTop.setColor(Color.parseColor("#9E9E9E"));

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

edgeEffectBottom.setColor(Color.parseColor("#9E9E9E"));

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

java.lang.reflect.Field f2 = android.widget.ScrollView.class.getDeclaredField("mEdgeGlowBottom");
f2.setAccessible(true);
f2.set(vscroll1, 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.parseColor("#9E9E9E"), PorterDuff.Mode.MULTIPLY);

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

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

androidEdge.setColorFilter(Color.parseColor("#9E9E9E"), 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