Empty TextViews issue

8 views
Skip to first unread message

Stephen

unread,
Jun 4, 2011, 8:33:28 AM6/4/11
to android-appwidget-extensions
Quick question, not expecting an answer but will post none the less.

I'm using API v1 (mainly for backward compatibility).

Scenario
------------
I have a couple of TextViews and their height xml attribute is defined
as wrap_content.

Problem
-----------
If their text is set to "" from what's stored by my ContentProvider
the TextView consumes space and does not collapse.

Ideal Result
-----------------
Ideally I'd like it to not to consume space.

Leads???
---------
I'm aware that android:visiblity="gone" solves this but since the Home
Launcher is the app that is what has direct access to the list items I
can't set the the TextView's visiblity attribute to visible myself.

I'm sure this is simple but would appreciate some help. Is there
somewhere else I can discuss this? I never seem to get a reply??

Steve

Francois DESLANDES

unread,
Jun 4, 2011, 8:35:47 AM6/4/11
to android-appwid...@googlegroups.com
Hi,

I have the same wish.
Passing 'null' to the provider element which is linked to the textview would make to gone.

Francois

2011/6/4 Stephen <stephe...@gmail.com>



--
Francois Deslandes @ Pure widgets - Android widgets

Francois DESLANDES

unread,
Jun 4, 2011, 8:36:54 AM6/4/11
to android-appwid...@googlegroups.com
Stephen, well, you can directly participate to make it better: it's open source !

Modify and publish new source for Launcher+ and ADW and it will become the new version ;)

2011/6/4 Francois DESLANDES <kox...@gmail.com>

stephe...@gmail.com

unread,
Jun 4, 2011, 8:58:58 AM6/4/11
to android-appwid...@googlegroups.com
Thanks for the quick reply.

I tried the same also but to no avail :(

I passed null to my content provider.
In my ContentProvider I specifically set the bindNull(int) when the value passed in to insert was null.

stephe...@gmail.com

unread,
Jun 4, 2011, 9:02:25 AM6/4/11
to android-appwid...@googlegroups.com
I'm sure there is a solution without needing to modify the home launcher.  I've seen examples of it in other scrollable widgets but I can't imagine how the managed they did it?

Another idea I had was to extend the TextView class and make my own Custom View which would override the setText method to do the visibility changing there but I couldn't manage to get my view on the classpath of the HomeLauncher which would be drawing it??? :(

Francois DESLANDES

unread,
Jun 4, 2011, 9:04:07 AM6/4/11
to android-appwid...@googlegroups.com
I know the launcher code, and no, I don't see any way to do it without modifying the code.


I'm sure there is a solution without needing to modify the home launcher.  I've seen examples of it in other scrollable widgets but I can't imagine how the managed they did it?

Another idea I had was to extend the TextView class and make my own Custom View which would override the setText method to do the visibility changing there but I couldn't manage to get my view on the classpath of the HomeLauncher which would be drawing it??? :(

stephe...@gmail.com

unread,
Jun 4, 2011, 9:13:14 AM6/4/11
to android-appwid...@googlegroups.com
Have a look at Colorize Widgets (Facebook Widget).

There are multiple styled TextView's, I can't understand how they are being made "gone"?

Francois DESLANDES

unread,
Jun 4, 2011, 9:38:31 AM6/4/11
to android-appwid...@googlegroups.com
with API V2, no problem, you can do it... but you loose the LauncherPro compatibility.
with API V1, I really don't see how to do that.


Have a look at Colorize Widgets (Facebook Widget).

There are multiple styled TextView's, I can't understand how they are being made "gone"?

stephe...@gmail.com

unread,
Jun 4, 2011, 10:07:18 AM6/4/11
to android-appwid...@googlegroups.com
I was wondering if that was a possibility.  That makes sense then.  I'll have to rethink my layout design then...

Cheers,

Steve.

Florian Sundermann

unread,
Jun 6, 2011, 10:49:33 AM6/6/11
to android-appwid...@googlegroups.com
Hi,

about the code modifications: Are you sure that it will be merged to
LauncherPro if you change the V1 code?

--
Florian

Francois DESLANDES

unread,
Jun 6, 2011, 2:15:04 PM6/6/11
to android-appwid...@googlegroups.com
I think it won't :(

Last update of LP scrollable API was for a bug fix, and it tooks 6 months...


2011/6/6 Florian Sundermann <boom...@googlemail.com>

Florian Sundermann

unread,
Jun 7, 2011, 4:28:24 PM6/7/11
to android-appwid...@googlegroups.com
But then I think using V2 to "fix" this might be a better way. (yes I
know it would be very much work to update your pure widgets...)
And you could also use V1 code if the launcher don't support V2 and
then live with this "bug"...

2011/6/6 Francois DESLANDES <kox...@gmail.com>:

Francois DESLANDES

unread,
Jun 7, 2011, 4:48:11 PM6/7/11
to android-appwid...@googlegroups.com

I know florian, i know ;)
I just think my users wil, hate me the day i'll drop the api v1 ;p

Reply all
Reply to author
Forward
0 new messages