package com.example.timber.ui;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import timber.log.Timber;

import static java.lang.String.format;

@SuppressLint("Registered") //
public class LintActivity extends Activity {
  /**
   * Below are some examples of how NOT to use Timber.
   *
   * Currently, locally-packaged lint checks don't work in Studio. As a workaround,
   * you will need to run "./gradlew :timber-sample:lint" first, before Lint IDE
   * highlighting will work.
   *
   * A future release will eliminate the 'command-line first' workaround.
   */
  @Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    /*
    // LogNotTimber
    Log.d("TAG", "msg");
    Log.d("TAG", "msg", new Exception());
    android.util.Log.d("TAG", "msg");
    android.util.Log.d("TAG", "msg", new Exception());

    // StringFormatInTimber
    Timber.w(String.format("%s", getString()));
    Timber.w(format("%s", getString()));

    // ThrowableNotAtBeginning
    Timber.d("%s", new Exception());

    // BinaryOperationInTimber
    String foo = "foo";
    String bar = "bar";
    Timber.d("foo" + "bar");
    Timber.d("foo" + bar);
    Timber.d(foo + "bar");
    Timber.d(foo + bar);

    // TimberArgCount
    Timber.d("%s %s", "arg0");
    Timber.d("%s", "arg0", "arg1");
    Timber.tag("tag").d("%s %s", "arg0");
    Timber.tag("tag").d("%s", "arg0", "arg1");

    // TimberArgTypes
    Timber.d("%d", "arg0");
    Timber.tag("tag").d("%d", "arg0");

    // TimberTagLength
    Timber.tag("abcdefghijklmnopqrstuvwx");
    Timber.tag("abcdefghijklmnopqrstuvw" + "x");

    // TimberExceptionLogging
    Timber.d(new Exception(), new Exception().getMessage());
    Timber.d(new Exception(), "");
    Timber.d(new Exception(), null);
    */
  }

  private String getString() {
    return "foo";
  }
}

@@ -407,280 +407,409 @@
   * 
-Currently, locally-packaged lint checks don't work in Studio. As a workaround,%0A   * you will need to run %22./gradlew :timber-sample:lint%22 first, before Lint IDE%0A   * highlighting will work.%0A   *%0A   * A future release will eliminate the 'command-line first' workaround.%0A   *
+To see how a particular lint issue behaves, comment/remove its corresponding id from the set%0A   * of SuppressLint ids below.%0A   */%0A  @SuppressLint(%7B%0A      %22LogNotTimber%22, //%0A      %22StringFormatInTimber%22, //%0A      %22ThrowableNotAtBeginning%22, //%0A      %22BinaryOperationInTimber%22, //%0A      %22TimberArgCount%22, //%0A      %22TimberArgTypes%22, //%0A      %22TimberTagLength%22, //%0A      %22TimberExceptionLogging%22 //%0A  %7D) /
 /%0A  
@@ -926,15 +926,8 @@
 );%0A%0A
-    /*%0A
     
@@ -2031,15 +2031,8 @@
 l);%0A
-    */%0A
   %7D%0A

Update LintActivity