WearableListView.Item is not in the supported library 1.1

My wear app uses WearableListView.Item for ListView, and it worked fine and compiled, but then I updated Android Studio, Gradle plugin, SDK tools, etc. etc., and now it will not compile.

My build.gradle clothes contains:

compileSdkVersion 20 buildToolsVersion "21.1.2" ... minSdkVersion 20 targetSdkVersion 20 ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.support:wearable:+' compile 'com.google.android.gms:play-services-wearable:6.5.+' } 

Now he says: Error: (141, 84) error: cannot find character class Element

Any help there please?

+6
source share
4 answers

This is because the API has changed. Now it depends on RecyclerView

Here is the gist showing how to implement WearableListView .

+5
source

Here's a good implementation of WearableListView using v1.1.0 of a supported supporting library that still supports the correct scaling behavior (directly from official Google samples):

android-WatchFace / DigitalWatchFaceWearableConfigActivity.java

+2
source

It looks like ( source ), so in a workaround you had to change:

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

to

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

This only looks like a temporary workaround before a fix arrives.

0
source

Now you should do something like this:

 public class ItemView extends FrameLayout implements WearableListView.OnCenterProximityListener 

Or:

 public class ItemView extends FrameLayout implements WearableListView.OnScrollListener 

Since the interface WearableListView.Item is not applied anymore. I hope to help you.

0
source

Source: https://habr.com/ru/post/979501/


All Articles