Marineio
Marineio

Reputation: 415

Recompiling Android Launcher2 (Gingerbread)

I'm attempting to recompile the Launcher2 (Gingerbread) application, so that i can modify it.

However, I get a fair few errors (120ish), namely:

mLeft, mTop, mBottom, mRight, mParent, mContext cannot be resolved to a variable.

These come from (what I can see anyway), private members of the "TextView" widget.

Is there any way to access these private members, or would I need to do some other magic to get this working?

Cheers!

Upvotes: 1

Views: 802

Answers (2)

Joseph Earl
Joseph Earl

Reputation: 23442

These refer to private/protected members of the View and related classes. Lots of them have getters/setters, for instance all of the above (if they are just getting the value) could be replaced with the

getLeft(), getTop(), getBottom(), getRight() and getContext()

methods of the View class.

Some of them though, may not have public ways to access them. In that case you can either:

  • Copy the relevant classes into your project and change the visibility of the members
  • Use reflection (ugly, may break) to modify private fields of other classes.

Upvotes: 2

CommonsWare
CommonsWare

Reputation: 1007296

You cannot compile Launcher2 except as part of a full firmware build, most likely.

Upvotes: 0

Related Questions