forked from racofix/architecture-for-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zjlong
committed
Jun 3, 2016
1 parent
c4edf23
commit 483a972
Showing
16 changed files
with
667 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
core/src/androidTest/java/com/android/core/ApplicationTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.android.core.control; | ||
|
||
import com.android.core.MainApp; | ||
|
||
/** | ||
* @author: 蜡笔小新 | ||
* @date: 2016-06-02 17:56 | ||
* @GitHub: https://github.com/meikoz | ||
*/ | ||
public class Toast { | ||
|
||
private static android.widget.Toast mToast; | ||
|
||
public static void show(String msg) { | ||
int duration = android.widget.Toast.LENGTH_SHORT; | ||
if (msg.length() > 10) { | ||
duration = android.widget.Toast.LENGTH_LONG; | ||
} | ||
mToast = android.widget.Toast.makeText(MainApp.getContext(), msg, duration); | ||
mToast.show(); | ||
} | ||
|
||
public static void show(int msg) { | ||
int duration = android.widget.Toast.LENGTH_SHORT; | ||
mToast = android.widget.Toast.makeText(MainApp.getContext(), msg, duration); | ||
mToast.show(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
core/src/main/java/com/android/core/logcat/AndroidLogTool.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.android.core.logcat; | ||
|
||
import android.util.Log; | ||
|
||
/** | ||
* @author: 蜡笔小新 | ||
* @date: 2016-06-02 17:21 | ||
* @GitHub: https://github.com/meikoz | ||
*/ | ||
public class AndroidLogTool implements LogTool{ | ||
|
||
public AndroidLogTool() { | ||
} | ||
|
||
public void d(String tag, String message) { | ||
Log.d(tag, message); | ||
} | ||
|
||
public void e(String tag, String message) { | ||
Log.e(tag, message); | ||
} | ||
|
||
public void w(String tag, String message) { | ||
Log.w(tag, message); | ||
} | ||
|
||
public void i(String tag, String message) { | ||
Log.i(tag, message); | ||
} | ||
|
||
public void v(String tag, String message) { | ||
Log.v(tag, message); | ||
} | ||
|
||
public void wtf(String tag, String message) { | ||
Log.wtf(tag, message); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
core/src/main/java/com/android/core/logcat/BuildConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.android.core.logcat; | ||
|
||
/** | ||
* @author: 蜡笔小新 | ||
* @date: 2016-06-02 17:22 | ||
* @GitHub: https://github.com/meikoz | ||
*/ | ||
public class BuildConfig { | ||
public static final boolean DEBUG = true; | ||
|
||
public BuildConfig() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.android.core.logcat; | ||
|
||
/** | ||
* @author: 蜡笔小新 | ||
* @date: 2016-06-02 17:24 | ||
* @GitHub: https://github.com/meikoz | ||
*/ | ||
public enum LogLevel { | ||
FULL, | ||
NONE; | ||
|
||
private LogLevel() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.android.core.logcat; | ||
|
||
/** | ||
* @author: 蜡笔小新 | ||
* @date: 2016-06-02 17:21 | ||
* @GitHub: https://github.com/meikoz | ||
*/ | ||
public interface LogTool { | ||
|
||
void d(String var1, String var2); | ||
|
||
void e(String var1, String var2); | ||
|
||
void w(String var1, String var2); | ||
|
||
void i(String var1, String var2); | ||
|
||
void v(String var1, String var2); | ||
|
||
void wtf(String var1, String var2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.android.core.logcat; | ||
|
||
/** | ||
* @author: 蜡笔小新 | ||
* @date: 2016-06-02 17:26 | ||
* @GitHub: https://github.com/meikoz | ||
*/ | ||
public class Logcat { | ||
|
||
private static final String DEFAULT_TAG = "EXLOGCAT"; | ||
private static Printer printer = new LoggerPrinter(); | ||
|
||
private Logcat() { | ||
} | ||
|
||
public static Settings init() { | ||
return init("EXLOGCAT"); | ||
} | ||
|
||
public static Settings init(String tag) { | ||
printer = new LoggerPrinter(); | ||
return printer.init(tag); | ||
} | ||
|
||
public static void clear() { | ||
printer.clear(); | ||
printer = null; | ||
} | ||
|
||
public static Printer t(String tag) { | ||
return printer.t(tag, printer.getSettings().getMethodCount()); | ||
} | ||
|
||
public static Printer t(int methodCount) { | ||
return printer.t((String) null, methodCount); | ||
} | ||
|
||
public static Printer t(String tag, int methodCount) { | ||
return printer.t(tag, methodCount); | ||
} | ||
|
||
public static void d(String message, Object... args) { | ||
printer.d(message, args); | ||
} | ||
|
||
public static void e(String message, Object... args) { | ||
printer.e((Throwable) null, message, args); | ||
} | ||
|
||
public static void e(Throwable throwable, String message, Object... args) { | ||
printer.e(throwable, message, args); | ||
} | ||
|
||
public static void i(String message, Object... args) { | ||
printer.i(message, args); | ||
} | ||
|
||
public static void v(String message, Object... args) { | ||
printer.v(message, args); | ||
} | ||
|
||
public static void w(String message, Object... args) { | ||
printer.w(message, args); | ||
} | ||
|
||
public static void wtf(String message, Object... args) { | ||
printer.wtf(message, args); | ||
} | ||
|
||
public static void json(String json) { | ||
printer.json(json); | ||
} | ||
|
||
public static void xml(String xml) { | ||
printer.xml(xml); | ||
} | ||
} |
Oops, something went wrong.