0

I'm looking for a way to change the position of a view in a homescreen widget/remoteview during runtime. I also saw this topic before but the answer given there didn't help me or even work.

For example:

I'm trying to shift the x position of the TextView by 5 pixels:

myRemoteView.setFloat(R.id.myTextView, "setTranslationX", 5); // does not work
myRemoteView.setFloat(R.id.myTextView, "setX", 5); // does not work
myRemoteView.setInt(R.id.myTextView, "setLeft", 5); // does not work

I couldn't find somewhere else a useful answer that could help me.

Community
  • 1
  • 1
Verhelst
  • 1,492
  • 2
  • 22
  • 46

1 Answers1

0

You could try inflating a different layout with your RemoteViews, one with the widgets in your desired position. I am not sure that it will work, but it is worth a try.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491