fresco icon indicating copy to clipboard operation
fresco copied to clipboard

fresco:pressedStateOverlayImage

Open xingxiang1989 opened this issue 11 years ago • 6 comments

    fresco:overlayImage="@android:color/transparent"
    fresco:pressedStateOverlayImage="@android:color/black"

touch the view ,it does not change

xingxiang1989 avatar May 13 '15 08:05 xingxiang1989

I just retested this and it works fine, can you provide a code snippet so that we can try to work out what's going wrong?

Also, why do you have a transparent overlay?

IanChilds avatar May 13 '15 09:05 IanChilds

https://github.com/facebook/fresco/issues/33 if i don't add fresco:overlayImage="@android:color/transparent" ,it will crash

xingxiang1989 avatar May 13 '15 09:05 xingxiang1989

Oh okay. That is fixed now though so you shouldn't need it.

IanChilds avatar May 13 '15 09:05 IanChilds

Can you provide the code snippet that you are using? It is strange that this is not working for you. What version of Fresco are you using?

IanChilds avatar May 13 '15 10:05 IanChilds

I write a compound widget which extends RelativeLayout.Its layout is shown below.I add pressedStateOverlayImage in code.Then, I use the compound widget in GridView. I get no press effect.

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.diandian.coolco.emilie.widget.SizeAdjustableSimpleDraweeView
        android:id="@+id/dv_web_img"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
         />
    <!--fresco:placeholderImage="@color/drawee_view_place_holder"-->
    <!--fresco:actualImageScaleType="fitCenter"-->
    <!--fresco:fadeDuration="200"-->
    <!--fresco:pressedStateOverlayImage="@color/press_state_overlay_color"-->
    <ProgressBar
        android:id="@+id/pb_loading"
        style="@style/progressBarLightTheme"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_centerInParent="true" />

    <TextView
        android:id="@+id/tv_loading_progress"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:text="0%"
        android:textColor="@color/global_text_secondary_inverse"
        android:textSize="12sp" />

</merge>
GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
        GenericDraweeHierarchy hierarchy = builder
                .setProgressBarImage(new ProgressBarDrawable() {
                    @Override
                    protected boolean onLevelChange(int level) {
                        setLoadingProgress(level);
                        return true;
                    }

                    @Override
                    public void draw(Canvas canvas) {

                    }
                })
                .setFadeDuration(getResources().getInteger(R.integer.drawee_view_fade_duration))
                .setPlaceholderImage(new ColorDrawable(getResources().getColor(R.color.drawee_view_place_holder)))
                .setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER)
                .setPressedStateOverlay(new ColorDrawable(getResources().getColor(R.color.drawee_view_press_state_overlay_color)))
                .build();
        draweeView.setHierarchy(hierarchy);

myronlee avatar May 19 '15 09:05 myronlee

reaping

plamenko avatar Jul 08 '15 13:07 plamenko