initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.stardust.scriptdroid.tool;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/1/23.
|
||||
*/
|
||||
|
||||
public class ClassTool {
|
||||
|
||||
public static void loadClass(Class c) {
|
||||
try {
|
||||
Class.forName(c.getName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadClasses(Class... classes) {
|
||||
for (Class c : classes) {
|
||||
loadClass(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.stardust.scriptdroid.tool;
|
||||
|
||||
import android.support.annotation.IdRes;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/1/24.
|
||||
*/
|
||||
|
||||
public class ViewTool {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <V extends View> V $(View view, @IdRes int resId) {
|
||||
return (V) view.findViewById(resId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user