Commit 1e2fb9b0 by Baoxy

fix: 应用使用情况初步完成界面

parent 087cd240
...@@ -21,16 +21,11 @@ ...@@ -21,16 +21,11 @@
android:textColor="#363636" android:textColor="#363636"
android:textSize="16sp" /> android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#DDDFE1" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:gravity="center_vertical"
android:background="@color/bg_white" android:background="@color/bg_white"
android:gravity="center_vertical"
android:onClick="more" android:onClick="more"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -49,7 +44,7 @@ ...@@ -49,7 +44,7 @@
<com.qmuiteam.qmui.widget.QMUIEmptyView <com.qmuiteam.qmui.widget.QMUIEmptyView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"/> android:layout_weight="1" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -61,4 +56,10 @@ ...@@ -61,4 +56,10 @@
android:textSize="15sp" /> android:textSize="15sp" />
</LinearLayout> </LinearLayout>
<com.secspace.lib.common.function.view.TimeProgress
android:id="@+id/time_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg_white"
android:padding="10dp" />
</LinearLayout> </LinearLayout>
...@@ -30,6 +30,7 @@ class AppUseActivity : BaseActivity() { ...@@ -30,6 +30,7 @@ class AppUseActivity : BaseActivity() {
tv_setting_title.setText(R.string.edu_item_app_use_title) tv_setting_title.setText(R.string.edu_item_app_use_title)
tv_app_use_time.text = String.format(getString(R.string.edu_item_app_use_last_day), "50") tv_app_use_time.text = String.format(getString(R.string.edu_item_app_use_last_day), "50")
time_progress.initAnimation()
} }
fun close(view: View?) { fun close(view: View?) {
......
...@@ -176,7 +176,7 @@ public class TimeProgress extends View { ...@@ -176,7 +176,7 @@ public class TimeProgress extends View {
int heightMode = MeasureSpec.getMode(heightMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec); int height = MeasureSpec.getSize(heightMeasureSpec);
parameterAssignment();
setMeasuredDimension(measureWidth(widthMode, width), measureHeight(heightMode, height)); setMeasuredDimension(measureWidth(widthMode, width), measureHeight(heightMode, height));
} }
...@@ -251,10 +251,7 @@ public class TimeProgress extends View { ...@@ -251,10 +251,7 @@ public class TimeProgress extends View {
x = x + paddingLeft; x = x + paddingLeft;
} }
y = textHeight + tipsMargin + progressHeight; y = textHeight + tipsMargin + progressHeight + paddingLeft;
if (i == times.size() - 1) {
y = y - paddingBottom;
}
canvas.drawRect(x - textWidth, y - textHeight + indicatorMargin, x - textWidth + textHeight, y + indicatorMargin, bgPaint); canvas.drawRect(x - textWidth, y - textHeight + indicatorMargin, x - textWidth + textHeight, y + indicatorMargin, bgPaint);
canvas.drawText(text, x, y, textPaint); canvas.drawText(text, x, y, textPaint);
canvas.drawText(text, x, y + textHeight + tipsMargin / 3, textPaint); canvas.drawText(text, x, y + textHeight + tipsMargin / 3, textPaint);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment