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 Aug 12, 2017
1 parent d71b650 commit 084234d
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 168 deletions.
20 changes: 16 additions & 4 deletions Wearable/build.gradle
Expand Up @@ -5,16 +5,24 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:2.3.3'
}
}

apply plugin: 'com.android.application'

repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}



dependencies {

compile 'com.android.support:wear:26.0.0'


compile 'com.google.android.gms:play-services-wearable:10.2.4'
Expand All @@ -35,17 +43,21 @@ List<String> dirs = [
'template'] // boilerplate code that is generated by the sample template process

android {
compileSdkVersion 25

compileSdkVersion 26

buildToolsVersion "25.0.3"

defaultConfig {
versionCode 1
versionName "1.0"

minSdkVersion 24
minSdkVersion 23

targetSdkVersion 26

multiDexEnabled true

targetSdkVersion 25
}

compileOptions {
Expand Down
Expand Up @@ -24,7 +24,6 @@
import android.os.Handler;
import android.os.Message;
import android.support.wearable.activity.WearableActivity;
import android.support.wearable.view.WatchViewStub;
import android.util.Log;
import android.widget.TextView;

Expand Down Expand Up @@ -124,22 +123,14 @@ public void onCreate(Bundle savedInstanceState) {
ambientStateIntent,
PendingIntent.FLAG_UPDATE_CURRENT);

mTimeTextView = (TextView) findViewById(R.id.time);
mTimeStampTextView = (TextView) findViewById(R.id.time_stamp);
mStateTextView = (TextView) findViewById(R.id.state);
mUpdateRateTextView = (TextView) findViewById(R.id.update_rate);
mDrawCountTextView = (TextView) findViewById(R.id.draw_count);

/** Determines whether watch is round or square and applies proper view. **/
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {

mTimeTextView = (TextView) stub.findViewById(R.id.time);
mTimeStampTextView = (TextView) stub.findViewById(R.id.time_stamp);
mStateTextView = (TextView) stub.findViewById(R.id.state);
mUpdateRateTextView = (TextView) stub.findViewById(R.id.update_rate);
mDrawCountTextView = (TextView) stub.findViewById(R.id.draw_count);
refreshDisplayAndSetNextUpdate();

refreshDisplayAndSetNextUpdate();
}
});
}

/**
Expand Down
54 changes: 46 additions & 8 deletions Wearable/src/main/res/layout/activity_main.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,15 +13,54 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<android.support.wearable.view.WatchViewStub
<android.support.wear.widget.BoxInsetLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/watch_view_stub"
android:background="@color/dark_grey"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rectLayout="@layout/rect_activity_main"
app:roundLayout="@layout/round_activity_main"
tools:context=".MainActivity"
tools:deviceIds="wear">
</android.support.wearable.view.WatchViewStub>
tools:context=".MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:boxedEdges="all">

<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="24sp"
android:text="Hello, time!"/>

<TextView
android:id="@+id/time_stamp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello, timestamp!"/>

<TextView
android:id="@+id/state"
android:textColor="@color/green"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello, state!"/>

<TextView
android:id="@+id/update_rate"
android:textColor="@color/green"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello, update rate!"/>

<TextView
android:id="@+id/draw_count"
android:textColor="@color/green"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello, draw count!"/>

</LinearLayout>
</android.support.wear.widget.BoxInsetLayout>
59 changes: 0 additions & 59 deletions Wearable/src/main/res/layout/rect_activity_main.xml

This file was deleted.

59 changes: 0 additions & 59 deletions Wearable/src/main/res/layout/round_activity_main.xml

This file was deleted.

23 changes: 0 additions & 23 deletions Wearable/src/main/res/values/dimens.xml

This file was deleted.

0 comments on commit 084234d

Please sign in to comment.