Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
c1ec16ee
Commit
c1ec16ee
authored
Dec 20, 2019
by
Jeffrey I. Schiller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ucr'
Change-Id: Ib6cff8abf1c421459ce27c3e91cc0ebbfdab27bc
parents
48d3190c
babac434
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
appinventor/components/src/com/google/appinventor/components/runtime/ButtonBase.java
...com/google/appinventor/components/runtime/ButtonBase.java
+9
-2
No files found.
appinventor/components/src/com/google/appinventor/components/runtime/ButtonBase.java
View file @
c1ec16ee
...
@@ -423,8 +423,15 @@ public abstract class ButtonBase extends AndroidViewComponent
...
@@ -423,8 +423,15 @@ public abstract class ButtonBase extends AndroidViewComponent
private
Drawable
getSafeBackgroundDrawable
()
{
private
Drawable
getSafeBackgroundDrawable
()
{
if
(
myBackgroundDrawable
==
null
)
{
if
(
myBackgroundDrawable
==
null
)
{
Drawable
.
ConstantState
state
=
defaultButtonDrawable
.
getConstantState
();
Drawable
.
ConstantState
state
=
defaultButtonDrawable
.
getConstantState
();
if
(
state
!=
null
)
{
if
(
state
!=
null
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
GINGERBREAD_MR1
)
{
try
{
myBackgroundDrawable
=
state
.
newDrawable
().
mutate
();
myBackgroundDrawable
=
state
.
newDrawable
().
mutate
();
}
catch
(
NullPointerException
e
)
{
// We see this on SDK 7, but given we can't easily test every version
// this is meant as a safeguard.
Log
.
e
(
LOG_TAG
,
"Unable to clone button drawable"
,
e
);
myBackgroundDrawable
=
defaultButtonDrawable
;
}
}
else
{
}
else
{
// Since we can't make a copy of the default we'll just use it directly
// Since we can't make a copy of the default we'll just use it directly
myBackgroundDrawable
=
defaultButtonDrawable
;
myBackgroundDrawable
=
defaultButtonDrawable
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment