androidsonysony-smarteyeglass

How to rotate an ImageView when using SmartEyeGlass SDK?


I am using layout rendering (as opposed to bitmap rendering) in my Smarteyeglass app. How can I rotate an image view, let's say by 45 degrees?

I am using the following code to display my layout:

Intent intent = new Intent(Control.Intents.CONTROL_PROCESS_LAYOUT_INTENT);
intent.putExtra(Control.Intents.EXTRA_DATA_XML_LAYOUT, R.layout.my_layout_id);
sendToHostApp(intent);

Which doesn't return a reference to the view, so I can't do something like this:

relativeLayout.findViewById(R.id.my_view_object).setRotation(20);

I also can't find an intent which can rotate a view.


Solution

  • Unfortunately, you can not dynamically rotate view elements in the layout. Because layout is rendered and sent to SmartEyeglass once before you use showLayout or sendToHostApp method.

    If you would like to make any detailed changes in your view elements, you need to send complete layout again.

    But if you are trying to make changes in text or image content in your view elements, you can use sendText and sendImage methods.