Hi all, I think I have reached my wits end with this. Basically I am
trying to apply pinch zooming to a relative layout with 2 children, an
image view and a progress bar. Here is the relevant parts of my code:


layout xml:

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

        <com.*******.WaveformHolder android:id="@+id/waveform_holder"
                android:layout_gravity="right" 
android:layout_width="fill_parent"
                android:layout_height="50dip" 
android:layout_marginBottom="5dip">
                <com.******.CloudProgressBar
                        style="@style/CloudProgressBar" 
android:id="@+id/progress_bar"
                        android:background="#AAFFFFFF"
                        android:layout_alignParentTop="true"
android:layout_width="fill_parent"
                        android:layout_height="fill_parent" 
android:keepScreenOn="true" />
                <ImageView android:id="@+id/progress_overlay"
                        android:layout_alignParentTop="true"
android:layout_width="fill_parent"
                        android:layout_height="fill_parent" />
        </com.******.WaveformHolder>

</LinearLayout>



>From my custom view class:

   handler.sendEmptyMessage(0);

            public Handler handler = new  Handler(){
                  public void handleMessage(Message msg) {
                          mWaveformHolder.setMatrix(matrix);
                          mWaveformHolder.invalidate();
                          mOverlay.invalidate();
                          mProgressBar.invalidate();
                  }
             };

I have tried this function without invalidating the image overlay and
progress bar, no change.

an example matrix value : Matrix{[0.71418333, 0.0, 67.23105][0.0,
0.71418333, 37.07012][0.0, 0.0, 1.0]}



and my waveform holder class:

public class WaveformHolder extends RelativeLayout {

        private Matrix matrix;

        public WaveformHolder(Context context, AttributeSet attrs) {
                super(context, attrs);
                this.setWillNotDraw(false);
        }

        @Override
        protected void onDraw(Canvas canvas)
        {
                    canvas.save();
                    if (matrix != null)
                         canvas.setMatrix(matrix);
                    super.onDraw(canvas);
                    canvas.restore();
        }

        public void setMatrix(Matrix m){
                matrix = m;
        }

}


Basically, the draw function is getting called with the right
parameter, but nothing happens onscreen, the elements are never
redrawn. Anybody have any experience with something like this? Thanks
for any suggestions!

Jon

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to