title: Android P visibilityawareimagebutton.setVisibility can only be called from the same library group
body: <p>I'm trying to use the new Android P FloatingActionButton that's part of the <code>com.google.android.material.floatingactionbutton.FloatingActionButton</code> and I'm getting this warning:</p>
  <blockquote>
  <p>VisibilityAwareImageButton.setVisibility can only be called from the same library group (groupId=com.google.android.material)</p>
  </blockquote>
  <pre><code>import com.google.android.material.floatingactionbutton.FloatingActionButton
  import android.view.View
  
  class MainActivity : AppCompatActivity() {
  
      lateinit var demoFab: FloatingActionButton
  
      override fun onCreate(savedInstanceState: Bundle?) {
          demoFab = findViewById(R.id.demoFab)
          demoFab.visibility = View.VISIBLE  // the warning is here
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/MH3mw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MH3mw.png" alt="enter image description here" /></a></p>
  <p>I've tried searching and the only search result is in regards to responding to UI visibility changes:</p>
  <p><a href="https://developer.android.com/training/system-ui/visibility" rel="noreferrer">Respond to UI visibility changes</a></p>
  <p>I tried exploring how I could to see if there was a <code>VISIBLE</code> int value in that <code>com.google.android.material</code> package and the only one I found was <code>com.google.android.material.floatingactionbutton.FloatingActionButton.VISIBLE</code>, but the warning still remains.</p>
  <h2>Top-level build.gradle</h2>
  <pre><code>buildscript {
      ext.kotlin_version = '1.2.41'
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.2.0-alpha14'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
          classpath &quot;com.google.gms:oss-licenses:0.9.2&quot;
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          mavenCentral()
          maven { url &quot;http://oss.sonatype.org/content/repositories/snapshots/&quot; }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <h2>Project-level build.gradle</h2>
  <pre><code>apply plugin: 'com.android.application'
  
  apply plugin: 'kotlin-android'
  
  apply plugin: 'kotlin-android-extensions'
  
  apply plugin: 'com.google.gms.oss.licenses.plugin'
  
  android {
      compileSdkVersion 'android-P'
      defaultConfig {
          applicationId &quot;com.codeforsanjose.maps.pacmap&quot;
          minSdkVersion 21
          targetSdkVersion 'P'
          versionCode 1
          versionName &quot;1.0&quot;
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
      splits {
          abi {
              enable true
              reset()
              include 'arm64-v8a', 'armeabi', 'armeabi-v7a', 'mips', 'x86', 'x86_64'
              universalApk false
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      buildTypes {
          release {
              minifyEnabled true
              shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
      implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.1.0-alpha2'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha2'
  
      implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.2'
      //implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.1.0'
      implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.5.0'
      implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.13.0'
      implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.13.0'
  
      implementation 'com.google.android.gms:play-services-oss-licenses:15.0.1'
      implementation 'com.google.code.gson:gson:2.8.2'
      implementation 'com.squareup.moshi:moshi:1.5.0'
      implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
      implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
      implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
      implementation &quot;com.squareup.retrofit2:adapter-rxjava2:2.3.0&quot;
      implementation 'com.squareup.retrofit2:retrofit:2.4.0'
      implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
      implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'
  }
  </code></pre>
  <h3>edit:</h3>
  <p>I should note that I'm using Android Studio version 3.2 canary 14. It seems there have been some reported bugs for this version, and I suspect this is one of them.</p>
  <h2>edit 2:</h2>
  <p>Issue still exists with Android Studio version 3.2 canary 15, but I found a workaround for it using <code>show()</code> and <code>hide()</code></p>
  <pre><code>override fun onCreate(savedInstanceState: Bundle?) {
      demoFab = findViewById(R.id.demoFab)
      demoFab.show()    // this works and doesn't have the warning
  }
  </code></pre>