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
setBackground() vs setBackgroundDrawable(): why deprecate?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
kj  
View profile  
 More options Oct 25 2012, 11:06 am
From: kj <scwee...@gmail.com>
Date: Thu, 25 Oct 2012 08:06:45 -0700 (PDT)
Local: Thurs, Oct 25 2012 11:06 am
Subject: setBackground() vs setBackgroundDrawable(): why deprecate?

Hi all,

I was looking over the View class source today and noticed that
setBackgroundDrawable() has been deprecated as of API 16 in favor of
setBackground(). I'm curious as to why this is, as the current
View.setBackground() method just calls setBackgroundDrawable(). What was
the reason for the change and should I being to switch my calls to
setBackgroundDrawable() to setBackground()?

Thanks,
KJ


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Streets Of Boston  
View profile  
 More options Oct 25 2012, 12:48 pm
From: Streets Of Boston <flyingdutc...@gmail.com>
Date: Thu, 25 Oct 2012 09:48:03 -0700 (PDT)
Local: Thurs, Oct 25 2012 12:48 pm
Subject: Re: setBackground() vs setBackgroundDrawable(): why deprecate?

It's part of the code cleanup, to make the XML attributes conform to the
Java setter/getter properties and vice versa.

Eg.
Setting a background in XML is done through the *android:background*attribute.
The corresponding setter of the attribute in Java was *setBackgroundDrawable
*.
The two attribute names are not the same: *drawable *vs *backgroundDrawable*
.
They decided to make them the same by changing the Java name of this
attribute to *drawable *as well, resulting in a setter called *setDrawable*.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »