jImageBtn not enough
Hi, Agmcz!
What about jImageBtn component ???
i want to use imageview and add ripple effect on click....
How can I modify the design of components via an xml file?
There is a demo "AppApplyDrawableXMLDemo1"Very cool, but I want to add this to "ImageView1" :o
<ImageView
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"/>
android:background="?android:attr/selectableItemBackground"
But I still haven't learned how handle it programmatically....pls note here
TypedValue outValue = new TypedValue();
getBaseContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
ImageView myimage = (ImageView) findViewById(R.id.imageView);
myimage.setForeground(getDrawable(outValue.resourceId));
myimage.setClickable(true);
TypedValue outValue = new TypedValue();
controls.activity.getTheme().resolveAttribute(R.attr.selectableItemBackground, outValue, true);
this.setForeground(controls.activity.getResources().getDrawable(outValue.resourceId));
this.setClickable(true);
/*
public boolean onTouchEvent( MotionEvent event) {
...
}
*/
onClickListener = new OnClickListener() {
public void onClick(View view) {
controls.pOnClick(PasObj,Const.Click_Default);
}
};
setOnClickListener(onClickListener);
public void SetRippleEffect() {
TypedValue typedValue = new TypedValue();
controls.activity.getTheme().resolveAttribute(R.attr.selectableItemBackground, typedValue, true);
int[] attrs = new int[]{R.attr.selectableItemBackground};
TypedArray typedArray = controls.activity.obtainStyledAttributes(typedValue.resourceId, attrs);
this.setForeground(typedArray.getDrawable(0));
this.setClickable(true);
typedArray.recycle();
}
procedure jImageView.SetRippleEffect;
begin
if FInitialized then
jni_proc(gApp.jni.jEnv, FjObject, 'SetRippleEffect');
end;
ImageView1.SetRippleEffect;
Ok :D finished!
Please, can you post here a simple [demo] project....Demo attached.
Demo attached.