优化日志UI
This commit is contained in:
parent
befea40f61
commit
a730aa3f92
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 15 15:30:02 HKT 2025
|
#Mon Mar 17 01:36:14 GMT 2025
|
||||||
stageCount=3
|
stageCount=3
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.0
|
baseVersion=15.0
|
||||||
publishVersion=15.0.2
|
publishVersion=15.0.2
|
||||||
buildCount=0
|
buildCount=47
|
||||||
baseBetaVersion=15.0.3
|
baseBetaVersion=15.0.3
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#005800FF</color>
|
<color name="colorPrimary">#FF00B322</color>
|
||||||
<color name="colorPrimaryDark">#005800FF</color>
|
<color name="colorPrimaryDark">#FF005C12</color>
|
||||||
<color name="colorAccent">#005800FF</color>
|
<color name="colorAccent">#FF8DFFA2</color>
|
||||||
|
<color name="colorText">#FFFFFB8D</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 15 15:29:07 HKT 2025
|
#Mon Mar 17 01:36:14 GMT 2025
|
||||||
stageCount=3
|
stageCount=3
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.0
|
baseVersion=15.0
|
||||||
publishVersion=15.0.2
|
publishVersion=15.0.2
|
||||||
buildCount=0
|
buildCount=47
|
||||||
baseBetaVersion=15.0.3
|
baseBetaVersion=15.0.3
|
||||||
|
@ -190,6 +190,7 @@ public class LogView extends RelativeLayout {
|
|||||||
|
|
||||||
// 加载标签表
|
// 加载标签表
|
||||||
mListViewTags = findViewById(cc.winboll.studio.libappbase.R.id.tags_listview);
|
mListViewTags = findViewById(cc.winboll.studio.libappbase.R.id.tags_listview);
|
||||||
|
mListViewTags.setVerticalOffset(10);
|
||||||
mTAGListAdapter = new TAGListAdapter(mContext, mapTAGList);
|
mTAGListAdapter = new TAGListAdapter(mContext, mapTAGList);
|
||||||
mListViewTags.setAdapter(mTAGListAdapter);
|
mListViewTags.setAdapter(mTAGListAdapter);
|
||||||
|
|
||||||
|
@ -12,7 +12,9 @@ import android.widget.ListView;
|
|||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|
||||||
public class HorizontalListView extends ListView {
|
public class HorizontalListView extends ListView {
|
||||||
|
|
||||||
public static final String TAG = "HorizontalListView";
|
public static final String TAG = "HorizontalListView";
|
||||||
|
int verticalOffset = 0;
|
||||||
|
|
||||||
public HorizontalListView(Context context) {
|
public HorizontalListView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -25,25 +27,10 @@ public class HorizontalListView extends ListView {
|
|||||||
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) {
|
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
}
|
}
|
||||||
// @Override
|
|
||||||
// protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
public void setVerticalOffset(int verticalOffset) {
|
||||||
// super.onLayout(changed, l, t, r, b);
|
this.verticalOffset = verticalOffset;
|
||||||
// int childCount = getChildCount();
|
}
|
||||||
// int left = getPaddingLeft();
|
|
||||||
// // 获取HorizontalListView的高度
|
|
||||||
// int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
|
||||||
// for (int i = 0; i < childCount; i++) {
|
|
||||||
// View child = getChildAt(i);
|
|
||||||
// int width = child.getMeasuredWidth();
|
|
||||||
// int height = child.getMeasuredHeight();
|
|
||||||
// // 计算子项在垂直方向上的居中偏移量
|
|
||||||
// int verticalOffset = (viewHeight - height) / 2;
|
|
||||||
// // 设置子视图的位置,实现水平布局并垂直居中
|
|
||||||
// child.layout(left, getPaddingTop() + verticalOffset, left + width, getPaddingTop() + verticalOffset + height);
|
|
||||||
// left += width;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
@ -52,7 +39,7 @@ public class HorizontalListView extends ListView {
|
|||||||
int left = getPaddingLeft();
|
int left = getPaddingLeft();
|
||||||
int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
||||||
LogUtils.d(TAG, String.format("HorizontalListView的高度 %d", viewHeight));
|
LogUtils.d(TAG, String.format("HorizontalListView的高度 %d", viewHeight));
|
||||||
int verticalOffset = 20;
|
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
View child = getChildAt(i);
|
View child = getChildAt(i);
|
||||||
// 计算每个子视图的宽度和高度
|
// 计算每个子视图的宽度和高度
|
||||||
@ -60,7 +47,7 @@ public class HorizontalListView extends ListView {
|
|||||||
int height = child.getMeasuredHeight();
|
int height = child.getMeasuredHeight();
|
||||||
//LogUtils.d(TAG, String.format("child : width %d , height %d", width, height));
|
//LogUtils.d(TAG, String.format("child : width %d , height %d", width, height));
|
||||||
// 设置子视图的位置,实现水平布局
|
// 设置子视图的位置,实现水平布局
|
||||||
|
|
||||||
child.layout(left, verticalOffset, left + width, verticalOffset + height);
|
child.layout(left, verticalOffset, left + width, verticalOffset + height);
|
||||||
left += width;
|
left += width;
|
||||||
}
|
}
|
||||||
@ -68,15 +55,11 @@ public class HorizontalListView extends ListView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
|
||||||
int newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
int newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||||
//super.onMeasure(widthMeasureSpec, newHeightMeasureSpec);
|
//super.onMeasure(widthMeasureSpec, newHeightMeasureSpec);
|
||||||
int newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
int newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||||
//LogUtils.d(TAG, String.format("newWidthMeasureSpec %d, newHeightMeasureSpec %d", newWidthMeasureSpec, newHeightMeasureSpec));
|
//LogUtils.d(TAG, String.format("newWidthMeasureSpec %d, newHeightMeasureSpec %d", newWidthMeasureSpec, newHeightMeasureSpec));
|
||||||
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
|
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
|
||||||
|
|
||||||
// ViewGroup.LayoutParams params = getLayoutParams();
|
|
||||||
// params.width = getMeasuredWidth();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
libappbase/src/main/res/drawable/bg_border_round.xml
Normal file
13
libappbase/src/main/res/drawable/bg_border_round.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="#000000" /> <!-- 这里可调整边框宽度和颜色 -->
|
||||||
|
<solid android:color="@android:color/transparent" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="6dip"
|
||||||
|
android:bottomRightRadius="6dip"
|
||||||
|
android:topLeftRadius="6dip"
|
||||||
|
android:topRightRadius="6dip" />
|
||||||
|
</shape>
|
@ -10,8 +10,8 @@
|
|||||||
<shape android:shape="rectangle" >
|
<shape android:shape="rectangle" >
|
||||||
<gradient
|
<gradient
|
||||||
android:angle="270"
|
android:angle="270"
|
||||||
android:endColor="#0F000000"
|
android:endColor="@color/colorAccent"
|
||||||
android:startColor="#0F000000" />
|
android:startColor="@color/colorAccent" />
|
||||||
<corners
|
<corners
|
||||||
android:bottomLeftRadius="6dip"
|
android:bottomLeftRadius="6dip"
|
||||||
android:bottomRightRadius="6dip"
|
android:bottomRightRadius="6dip"
|
||||||
|
@ -5,18 +5,18 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFEEEEEE">
|
android:background="@drawable/bg_border_round">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="@dimen/button_height"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:id="@+id/viewlogtagTextView1"/>
|
android:id="@+id/viewlogtagTextView1"/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="24dp"
|
android:layout_height="@dimen/button_height"
|
||||||
android:id="@+id/viewlogtagCheckBox1"/>
|
android:id="@+id/viewlogtagCheckBox1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -72,27 +72,29 @@
|
|||||||
android:layout_below="@+id/viewlogRelativeLayoutToolbar"
|
android:layout_below="@+id/viewlogRelativeLayoutToolbar"
|
||||||
android:id="@+id/viewlogLinearLayout1"
|
android:id="@+id/viewlogLinearLayout1"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:background="#FFC0F4C2">
|
android:background="@drawable/bg_shadow">
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/button_height"
|
||||||
android:text="ALL"
|
android:text="ALL"
|
||||||
android:id="@+id/viewlogCheckBox1"/>
|
android:id="@+id/viewlogCheckBox1"
|
||||||
|
android:background="@drawable/bg_border_round"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"/>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/bg_border"
|
||||||
android:scrollbars="none"
|
android:scrollbars="none"
|
||||||
android:layout_weight="1.0"
|
android:padding="5dp"
|
||||||
android:background="#FF97F2E3">
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.views.HorizontalListView
|
<cc.winboll.studio.libappbase.views.HorizontalListView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/view_border"
|
android:id="@+id/tags_listview"/>
|
||||||
android:id="@+id/tags_listview"
|
|
||||||
android:paddingLeft="10dp"/>
|
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
9
libappbase/src/main/res/values/dimens.xml
Normal file
9
libappbase/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- 定义一个名为text_size_normal的尺寸,值为16sp -->
|
||||||
|
<dimen name="text_size_normal">16sp</dimen>
|
||||||
|
<!-- 定义一个名为margin_small的尺寸,值为8dp -->
|
||||||
|
<dimen name="margin_small">8dp</dimen>
|
||||||
|
<!-- 定义一个名为image_width的尺寸,值为200dp -->
|
||||||
|
<dimen name="button_height">24dp</dimen>
|
||||||
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user