Saturday, 15 March 2014

Android wear app displaying rect layout on round watch -


I have an Android word app but when I run it on Round Watch (Moto 360) instead of round layout, rectangular one Is being displayed.

When a new wearable project is created, then Android Studio creates all necessary layout files so that it automatically enables the rectangular layout to properly load our circular layout and I have not changed it by excluding content from rectangular or round layout files. Especially I have not changed the activity_main.xml nor how the rect or goal's activities have been loaded in the activity nor the activity .

Here is activity_main.xml:

   

Here is the beginning of round_activity_main.xml, it does not make any sense in showing all this:

  & lt ;? Xml version = "1.0" encoding = "UTF-8" & gt; & Lt; RelativeLayout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" tool: reference = "main activity" tool: deviceIds = "wear_round" & gt; & Lt; RelativeLayout Android: layout_width = "fill_parent"  

Completion is the beginning of rect_activity_main.xml here:

  & lt; XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; RelativeLayout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" Android: orientation = "vertical" tool: reference = "main activity" tool: deviceIds = "wear_square" Android: clickable = "true" & gt; & Lt; RelativeLayout Android: layout_width = "fill_parent" android: layout_height = "60dp"  

And here's how the layout is loaded in onCreate of activity ()

  Set Contentview (R. Lite Activity_man); Watch ViewStub Stub = (WatchViewStub) findViewById (R.id.watch_view_stub); Stub.setOnLayoutInflatedListener (New WatchViewStub.OnLayoutInflatedListener) {@Override Public Zero onLayoutInflated (WatchViewStub Stub) {...  

Everything is considered as your, as far as I can tell And as I mentioned that I have made an Android studio, I have not made any changes. Anyone can know what the problem might be?

< Div class = "post-text" itemprop = "text

  1. < P>

    You are using an activity inside this

  2. Have you set some OnApplyWindowInsetsListener?

  3. Call stub.requestApplyInsets and click ().

Edit:

From the discussion in the comments and further investigation. It seems that you & lt; item name = "windowOverscan" & Gt; True & lt; / item & gt; or WindowInsets must be sent to your ideas.


No comments:

Post a Comment