Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion ViewPager and setClipChildren(false)

Received: by 10.58.133.100 with SMTP id pb4mr6542809veb.6.1346191036110;
        Tue, 28 Aug 2012 14:57:16 -0700 (PDT)
X-BeenThere: android-developers@googlegroups.com
Received: by 10.52.93.38 with SMTP id cr6ls949242vdb.8.gmail; Tue, 28 Aug 2012
 14:55:23 -0700 (PDT)
Received: by 10.52.30.133 with SMTP id s5mr129445vdh.10.1346190923360;
        Tue, 28 Aug 2012 14:55:23 -0700 (PDT)
Date: Tue, 28 Aug 2012 14:55:22 -0700 (PDT)
From: Thesalan <thesa...@gmail.com>
To: android-developers@googlegroups.com
Message-Id: <3afc8f0b-5efe-43d7-87ac-794774bab850@googlegroups.com>
In-Reply-To: <CALLdnhOH59at21jQ615F6zg29SssXVpBQ7eHoN-6m8dd-W8p=g@mail.gmail.com>
References: <e8f29982-f938-4ae3-98ab-47872cca8afa@googlegroups.com>
 <CALLdnhON0vekTZ1v6c=W+Gv_+aGaJJ1X3YVMsWHm-k6Sy=vxdA@mail.gmail.com> <4d04f392-0fcc-415e-be32-4c6e1eaf123a@googlegroups.com>
 <CALLdnhOH59at21jQ615F6zg29SssXVpBQ7eHoN-6m8dd-W8p=g@mail.gmail.com>
Subject: Re: [android-developers] ViewPager and setClipChildren(false)
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1601_16030329.1346190922720"

------=_Part_1601_16030329.1346190922720
Content-Type: multipart/alternative; 
	boundary="----=_Part_1602_13206150.1346190922721"

------=_Part_1602_13206150.1346190922721
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Mark, a huge thank you!! I never thought the problem would come from=20
hardware acceleration (I'm a beginner after all ^_^). Indeed, my current=20
rom force hardware acceleration for all applications.

I tried to force software mode just on the ViewPager with=20
setLayerType(View.LAYER_TYPE_SOFTWARE, null) (see here :=20
http://developer.android.com/guide/topics/graphics/hardware-accel.html) but=
=20
it doesn't work : content stay inside the viewpager.

But by specifying it in the manifest as you say it works very well! And=20
given the application, it does not pose any problems to do without hardware=
=20
acceleration.

Again, thank you very much Mark!

Le mardi 28 ao=C3=BBt 2012 23:09:38 UTC+2, Mark Murphy (a Commons Guy) a =
=C3=A9crit :
>
> On Tue, Aug 28, 2012 at 8:54 AM, Thesalan <thes...@gmail.com <javascript:=
>>=20
> wrote:=20
> > The project is attached to this post, at this lighter version (like we=
=20
> can=20
> > found here https://gist.github.com/8cbe094bb7a783e37ad1)=20
> >=20
> > I repeat : this works greats on emulator and older devices, but not on=
=20
> my=20
> > HTC One X with last OTA (Android 4.0.4) and Nexus S with CyanogenMod 10=
=20
> > (Android 4.1.1)=20
>
> I can reproduce your problem.=20
>
> It appears to be tied to hardware acceleration, insofar as if I add=20
> android:hardwareAccelerated=3D"false" to the activity, things work on=20
> hardware where it failed before (and also fails if I set the value=20
> explicity to "true").=20
>
> Since the issues of clipping and hardware acceleration are beyond my=20
> area of expertise, I can't explain why this is the case. Rather than=20
> disable hardware acceleration for the whole activity, you could=20
> experiment with disabling it just for the ViewPager itself. And, of=20
> course, if we're lucky, somebody who understands more about this area=20
> will chime in and explain where things are going wrong.=20
>
> --=20
> Mark Murphy (a Commons Guy)=20
> http://commonsware.com | http://github.com/commonsguy=20
> http://commonsware.com/blog | http://twitter.com/commonsguy=20
>
> _The Busy Coder's Guide to Android Development_ Version 4.1 Available!=20
>

------=_Part_1602_13206150.1346190922721
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Mark, a huge thank you!! I never thought the problem would come from hardwa=
re acceleration (I'm a beginner after all ^_^). Indeed, my current rom forc=
e hardware acceleration for all applications.<div><br></div><div>I tried to=
 force software mode just on the ViewPager with setLayerType(View.LAYER_TYP=
E_SOFTWARE, null) (see here :&nbsp;<a href=3D"http://developer.android.com/=
guide/topics/graphics/hardware-accel.html">http://developer.android.com/gui=
de/topics/graphics/hardware-accel.html</a>) but it doesn't work : content s=
tay inside the viewpager.</div><div><br></div><div>But by specifying it in =
the manifest as you say it works very well! And given the application, it d=
oes not pose any problems to do without hardware acceleration.</div><div><b=
r></div><div>Again, thank you very much Mark!<br><div><br>Le mardi 28 ao=C3=
=BBt 2012 23:09:38 UTC+2, Mark Murphy (a Commons Guy) a =C3=A9crit&nbsp;:<b=
lockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;borde=
r-left: 1px #ccc solid;padding-left: 1ex;">On Tue, Aug 28, 2012 at 8:54 AM,=
 Thesalan &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mail=
to=3D"O1J4eCZFcrAJ">thes...@gmail.com</a>&gt; wrote:
<br>&gt; The project is attached to this post, at this lighter version (lik=
e we can
<br>&gt; found here <a href=3D"https://gist.github.com/8cbe094bb7a783e37ad1=
" target=3D"_blank">https://gist.github.com/<wbr>8cbe094bb7a783e37ad1</a>)
<br>&gt;
<br>&gt; I repeat : this works greats on emulator and older devices, but no=
t on my
<br>&gt; HTC One X with last OTA (Android 4.0.4) and Nexus S with CyanogenM=
od 10
<br>&gt; (Android 4.1.1)
<br>
<br>I can reproduce your problem.
<br>
<br>It appears to be tied to hardware acceleration, insofar as if I add
<br>android:hardwareAccelerated=3D"<wbr>false" to the activity, things work=
 on
<br>hardware where it failed before (and also fails if I set the value
<br>explicity to "true").
<br>
<br>Since the issues of clipping and hardware acceleration are beyond my
<br>area of expertise, I can't explain why this is the case. Rather than
<br>disable hardware acceleration for the whole activity, you could
<br>experiment with disabling it just for the ViewPager itself. And, of
<br>course, if we're lucky, somebody who understands more about this area
<br>will chime in and explain where things are going wrong.
<br>
<br>--
<br>Mark Murphy (a Commons Guy)
<br><a href=3D"http://commonsware.com" target=3D"_blank">http://commonsware=
.com</a> | <a href=3D"http://github.com/commonsguy" target=3D"_blank">http:=
//github.com/commonsguy</a>
<br><a href=3D"http://commonsware.com/blog" target=3D"_blank">http://common=
sware.com/blog</a> | <a href=3D"http://twitter.com/commonsguy" target=3D"_b=
lank">http://twitter.com/commonsguy</a>
<br>
<br>_The Busy Coder's Guide to Android Development_ Version 4.1 Available!
<br></blockquote></div></div>
------=_Part_1602_13206150.1346190922721--

------=_Part_1601_16030329.1346190922720--