title: How to set visibility in Kotlin?
body: <p>I am new in <strong>Kotlin</strong>. I have a view that I need to show or hide in conditional ways.<br>
  How can I do this in Kotlin?</p>
  
  <p><strong>In Java:</strong></p>
  
  <pre><code>public void showHide(View view){
      if (view.getVisibility() == View.VISIBLE) {
          view.setVisibility(View.INVISIBLE);
      } else {
          view.setVisibility(View.VISIBLE);
      }
  }
  </code></pre>