Skip to content

Commit

Permalink
Add wear_keep to datalayer-helper-guide and sample (#2385)
Browse files Browse the repository at this point in the history
* Add wear_keep to datalayer-helper-guide and sample

* Move keep files to res/raw and update docs

* Mention issue with link in datalayer-helpers-guide
  • Loading branch information
oas004 authored Sep 13, 2024
1 parent a135d77 commit 802df8b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
17 changes: 17 additions & 0 deletions datalayer/sample/wear/src/main/res/raw/wear_keep.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2024 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.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@array/android_wear_capabilities"/>
10 changes: 8 additions & 2 deletions docs/datalayer-helpers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ phone.

2. Add the capabilities

Add a `wear.xml` file in the `res/values` folder with the following content:
Add a `wear.xml` file in the `res/raw` folder with the following content. It needs to be
`res/raw` folder due to https://issuetracker.google.com/issues/348688201

```
```xml
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@array/android_wear_capabilities">
<string-array name="android_wear_capabilities">
Expand All @@ -55,6 +56,11 @@ phone.
</string-array>
</resources>
```
and a `res/raw/wear_keep.xml`

```xml
<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@array/android_wear_capabilities"/>
```

on your wear and phone projects respectively.

Expand Down

0 comments on commit 802df8b

Please sign in to comment.