Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
google-automerger committed Feb 9, 2017
1 parent 6b08dcf commit 40d0afb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion NOTICE
@@ -1,7 +1,7 @@

This sample uses the following software:

Copyright 2016 The Android Open Source Project
Copyright 2017 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
9 changes: 5 additions & 4 deletions Wearable/build.gradle
Expand Up @@ -16,12 +16,13 @@ apply plugin: 'com.android.application'
dependencies {


provided "com.google.android.wearable:wearable:1.0.0"

compile 'com.google.android.gms:play-services-wearable:10.0.1'
compile 'com.android.support:support-v13:25.0.1'

compile 'com.google.android.support:wearable:2.0.0-alpha1'
provided 'com.google.android.wearable:wearable:2.0.0'

compile 'com.google.android.support:wearable:2.0.0'

}

Expand All @@ -42,9 +43,9 @@ android {
versionCode 1
versionName "1.0"

minSdkVersion 23
minSdkVersion 24

targetSdkVersion 23
targetSdkVersion 25
}

compileOptions {
Expand Down
4 changes: 4 additions & 0 deletions Wearable/src/main/AndroidManifest.xml
Expand Up @@ -13,6 +13,10 @@
android:supportsRtl="true"
android:theme="@android:style/Theme.DeviceDefault">

<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />

<!--If you want your app to run on pre-22, then set required to false -->
<uses-library android:name="com.google.android.wearable" android:required="false" />

Expand Down
Expand Up @@ -27,11 +27,10 @@
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.Toast;

Expand Down Expand Up @@ -86,17 +85,22 @@ protected void onCreate(Bundle savedInstanceState) {
(WearableNavigationDrawer) findViewById(R.id.top_navigation_drawer);
mWearableNavigationDrawer.setAdapter(new NavigationAdapter(this));

// Peeks Navigation drawer on the top.
mWearableDrawerLayout.peekDrawer(Gravity.TOP);

// Bottom Action Drawer
mWearableActionDrawer =
(WearableActionDrawer) findViewById(R.id.bottom_action_drawer);

mWearableActionDrawer.setOnMenuItemClickListener(this);

// Peeks action drawer on the bottom.
mWearableDrawerLayout.peekDrawer(Gravity.BOTTOM);
// Temporarily peeks the navigation and action drawers to ensure the user is aware of them.
ViewTreeObserver observer = mWearableDrawerLayout.getViewTreeObserver();
observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
mWearableDrawerLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
mWearableDrawerLayout.peekDrawer(Gravity.TOP);
mWearableDrawerLayout.peekDrawer(Gravity.BOTTOM);
}
});

/* Action Drawer Tip: If you only have a single action for your Action Drawer, you can use a
* (custom) View to peek on top of the content by calling
Expand Down

0 comments on commit 40d0afb

Please sign in to comment.