Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add some tweeks

commit 5572ff39b8d5627c9b31db97e7290ca986448404 1 parent 4206db8
@dinocore1 authored
View
20 devsmartlib/src/com/devsmart/android/Utils.java
@@ -39,19 +39,23 @@ public static String printCursor(Cursor cursor) {
return retval.toString();
}
-
- public static void log(String msg) {
- StackTraceElement[] st = Thread.currentThread().getStackTrace();
- StackTraceElement element = Thread.currentThread().getStackTrace()[3];
-
- String logMsg = String.format("[%s::%s:%d] %s",
+ private static String logstr(String msg, StackTraceElement element){
+ return String.format("[%s::%s:%d] %s",
element.getClassName(),
element.getMethodName(),
element.getLineNumber(),
msg
);
-
- Log.i("", logMsg);
+ }
+
+ public static void log(String msg) {
+ StackTraceElement element = Thread.currentThread().getStackTrace()[3];
+ Log.i("", logstr(msg, element));
+ }
+
+ public static void logerror(String msg, Exception e){
+ StackTraceElement element = Thread.currentThread().getStackTrace()[3];
+ Log.e("", logstr(msg, element), e);
}
}
View
4 devsmartlib/src/com/devsmart/android/ui/HorizontalListView.java
@@ -154,6 +154,8 @@ private void addAndMeasureChild(final View child, int viewPos) {
child.measure(MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.AT_MOST),
MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.AT_MOST));
}
+
+
@Override
protected synchronized void onLayout(boolean changed, int left, int top, int right, int bottom) {
@@ -279,7 +281,7 @@ private void positionItems(final int dx) {
View child = getChildAt(i);
int childWidth = child.getMeasuredWidth();
child.layout(left, 0, left + childWidth, child.getMeasuredHeight());
- left += childWidth;
+ left += childWidth + child.getPaddingRight();
}
}
}
View
5 devsmartlib/src/com/devsmart/android/ui/LayoutParamsHelper.java
@@ -9,4 +9,9 @@ public static LayoutParams createWrapWrap() {
return retval;
}
+ public static LayoutParams createFillWrap() {
+ LayoutParams retval = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
+ return retval;
+ }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.