Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriel committed Nov 11, 2016
1 parent 17365fd commit 87f3cb3
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.exyui.android.debugbottle.components

/**
* Created by yuriel on 11/11/16.
*/
@Suppress("unused")
object DTEnv {

@JvmStatic val ENV = Env.DEBUG
@JvmStatic val VERSION_CODE = BuildConfig.VERSION_CODE
@JvmStatic val VERSION_NAME = BuildConfig.VERSION_NAME

@JvmStatic fun isDebug() = ENV == Env.DEBUG
@JvmStatic fun isRelease() = ENV == Env.RELEASE
@JvmStatic fun isTest() = ENV == Env.TEST

enum class Env {
DEBUG, RELEASE, TEST
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal abstract class DTReportMgr {
get() {
val f = detectedFileDirectory()
if (f.exists() && f.isDirectory) {
return f.listFiles() { dir, filename ->
return f.listFiles { dir, filename ->
filename.endsWith(TYPE)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class __ScalpelFrameLayout @JvmOverloads constructor(
private val idNames = SparseArray<String>()
private val layeredViewQueue = ArrayDeque<LayeredView>()
private val layeredViewPool = object : Pool<LayeredView>(CHILD_COUNT_ESTIMATION) {
protected override fun newObject(): LayeredView {
override fun newObject(): LayeredView {
return LayeredView()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal class ThreadStackSampler(private val mThread: Thread,
}

override fun doSample() {
Log.d("BlockCanary", "sample thread stack: [" + mThreadStackEntries.size + ", " + mMaxEntryCount + "]");
Log.d("BlockCanary", "sample thread stack: [" + mThreadStackEntries.size + ", " + mMaxEntryCount + "]")
val stringBuilder = StringBuilder()

// Fetch thread stack info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object __BlockCanaryInternals {
get() {
val f = detectedBlockDirectory()
if (f.exists() && f.isDirectory) {
return f.listFiles() { dir, filename ->
return f.listFiles { dir, filename ->
filename.endsWith(TYPE)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.exyui.android.debugbottle.components;

import com.exyui.android.debugbottle.BuildConfig;

/**
* Created by yuriel on 11/11/16.
*/

@SuppressWarnings("unused")
final public class DTEnv {
public static final Env ENV = Env.RELEASE;
public static final int VERSION_CODE = BuildConfig.VERSION_CODE;
public static final String VERSION_NAME = BuildConfig.VERSION_NAME;

public static Boolean isDebug() {
return ENV == Env.DEBUG;
}

public static Boolean isRelease() {
return ENV == Env.RELEASE;
}

public static Boolean isTest() {
return ENV == Env.TEST;
}

public enum Env {
DEBUG, RELEASE, TEST
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.exyui.android.debugbottle.components

import com.exyui.android.debugbottle.BuildConfig

/**
* Created by yuriel on 11/11/16.
*/
@Suppress("unused")
object DTEnv {

@JvmStatic val ENV = Env.RELEASE
@JvmStatic val VERSION_CODE = BuildConfig.VERSION_CODE
@JvmStatic val VERSION_NAME = BuildConfig.VERSION_NAME

@JvmStatic fun isDebug() = ENV == Env.DEBUG
@JvmStatic fun isRelease() = ENV == Env.RELEASE
@JvmStatic fun isTest() = ENV == Env.TEST

enum class Env {
DEBUG, RELEASE, TEST
}
}

0 comments on commit 87f3cb3

Please sign in to comment.