Search code examples
androidandroid-studioxamarinxamarin.androidwear-os

Xamarin Android Wear - Navigation


I'd like an example of a step-by-step implementation of this type of menu on Android Wear.

I can not understand the concept of this implementation

It can be in Xamarin or Java.

Documentation:

https://developer.android.com/training/wearables/ui/ui-nav-actions#java

Expectancy:

ndroid


Solution

  • Glad you are enjoying Xamarin! There's multiple ways of navigating between fragments, regardless if it's a Watch. One of them is using ViewPagers. If you look into the Android documentation, you will find details of how to make it look really cool and fancy with small changes to the ViewPager code.

    As far as examples to the Google Wear app that uses ViewPagers, you can take a look at this and some of the other examples of Android wear applications. Let me know if that helps. Btw, you might have more success simply implementing that code (layout/activity_main.xml, SimpleGridPagerAdapter.cs and MainActivity.cs) in your project, than making those projects works since they're old.

    Since you are looking for the usage of the android.support.wear.widget.drawer.WearableDrawerLayout, you can take a look at this, particularly at the activity_main.xml. For implementing the WearableDrawerLayout, you have the following

    1. WearableNavigationDrawerView that acts as the top navigation drawer
    2. FrameLayout that contains your fragment
    3. WearableActionDrawerView that acts as your bottom action drawer

    PS: I noticed you are looking for Java examples too, this one seems very simple example to follow. You just have to check the Planets.java, MainActivity.java, and activity_main.xml files in that repo