Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've somehow found a workaround to this by some hooks, which is far from being a perfect solution, since I had to hard-code some values. I've added the following code-snippet in my existing code to set the boundary limits to panning. Now the panning works fine.</p> <p>Logging the mClipBound.top, bottom, left, right values I came up with the following hard-coded values which might work only for 720x1280 &amp; 800x1280 devices.</p> <pre><code>case MotionEvent.ACTION_MOVE: { ... ... if (isPortraitMode) { if (mClipBound.top &lt; 104 &amp;&amp; dy &gt; 0) //104 is a hard-coded value here. dy = 0; if (mClipBound.bottom &gt; (screenHeight - 77) &amp;&amp; dy &lt; 0) // 77 - hardcoded dy = 0; } else { if (mClipBound.top &lt; 0 &amp;&amp; dy &gt; 0) dy = 0; if (mClipBound.bottom &gt; screenHeight &amp;&amp; dy &lt; 0) dy = 0; } if (mClipBound.left &lt; 30 &amp;&amp; dx &gt; 0) // 30 - hardcoded dx = 0; if (mClipBound.right &gt; screenWidth &amp;&amp; dx &lt; 0) dx = 0; mPosX += dx; mPosY += dy; ... ... ... } ... ... @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); screenWidth = widthSize; screenHeight = heightSize; super.onMeasure(widthMeasureSpec, heightMeasureSpec); setMeasuredDimension((int) (widthSize), (int) (heightSize )); } </code></pre> <p>But still i haven't been able to resolve <strong>problem 2:</strong> mentioned in my question above. Some proper adjustments in onMeasure(..) &amp; onLayout(..) methods using mScaleFactor might resolve the issue. But i haven't been able to make it work yet. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload