Android Open Source - xiaomi-miband-android L






From Project

Back to project page xiaomi-miband-android.

License

The source code is released under:

GNU General Public License

If you think the Android project xiaomi-miband-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.motioncoding.debugging;
//from ww  w .  j  a v a  2 s  .c  o  m
import android.content.Context;
import android.util.Log;
import android.widget.Toast;

public class L {

  public static enum LogType {
    CLASS, CLASS_AND_METHOD, CLASS_AND_METHOD_AND_LINE, CLASS_AND_LINE
  }
  
  private static LogType mType = LogType.CLASS_AND_METHOD;
  
  
  public static void toast(Context context, String msg) {
    Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
  }
  
  public static void setLogType(LogType type) {
    mType = type;
  }
  
  public static void e(String msg) {
    Log.e(getTag(), msg);
  }
  
  public static void i(String msg) {
    Log.i(getTag(), msg);
  }
  
  public static void d(String msg) {
    Log.d(getTag(), msg);
  }
  
  public static void v(String msg) {
    Log.v(getTag(), msg);
  }
  
  public static void w(String msg) {
    Log.w(getTag(), msg);
  }
  
  public static void wtf(String msg) {
    Log.wtf(getTag(), msg);
  }
  
  private static String getTag() {
    StackTraceElement[] s = Thread.currentThread().getStackTrace();
    switch (mType) {
    case CLASS:
      return s[4].getClassName();
    case CLASS_AND_LINE:
      return s[4].getClassName()+":"+s[4].getLineNumber();
    case CLASS_AND_METHOD:
      return s[4].getClassName()+"."+s[4].getMethodName();
    case CLASS_AND_METHOD_AND_LINE:
      return s[4].getClassName()+"."+s[4].getMethodName()+":"+s[4].getLineNumber();
    default:
      break;
    }
    return null;
  }
}




Java Source Code List

com.motioncoding.debugging.L.java
com.motioncoding.miband.MiActivity.java
com.motioncoding.miband.MiLeParamsActivity.java
com.motioncoding.miband.MiOverviewActivity.java
com.motioncoding.miband.model.Battery.java
com.motioncoding.miband.model.LeParams.java
com.motioncoding.miband.model.MiBand.java
com.motioncoding.miband.view.ColorPickerDialog.java