Commit d2ea35d7 authored by chenyuling's avatar chenyuling

"更换UI-1"

parent 1212e6be
Pipeline #1621 canceled with stages
This diff is collapsed.
package com.srthinker.statinfo.wedget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import com.srthinker.statinfo.databinding.ItemGroupNewBinding;
public class NewGroupView extends LinearLayout {
private Context context;
private com.srthinker.statinfo.databinding.ItemGroupNewBinding mBinding;
public NewGroupView(Context context) {
super(context);
}
public NewGroupView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
this.context = context;
initView(context);
}
private void initView(Context context) {
mBinding = ItemGroupNewBinding.inflate(LayoutInflater.from(context), this, true);
}
@SuppressLint("SetTextI18n")
public void initItem(String name, int number,float textSize){
mBinding.tvGroupName.setText(name+":");
mBinding.tvGroupNumber.setText(number+"");
mBinding.tvGroupName.setTextSize(TypedValue.COMPLEX_UNIT_SP,textSize);
mBinding.tvGroupNumber.setTextSize(TypedValue.COMPLEX_UNIT_SP,textSize);
}
public void initItem(String name, int number){
mBinding.tvGroupName.setText(name+":");
mBinding.tvGroupNumber.setText(number+"");
}
public void setNumber(int number){
mBinding.tvGroupNumber.setText(number+"");
}
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".uis.MainActivity">
<TextView
android:id="@+id/tv_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
android:textColor="@color/white"
android:textSize="40sp"
android:layout_alignParentRight="true"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true">
<com.srthinker.statinfo.wedget.NewGroupView
android:id="@+id/ngv_build"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.srthinker.statinfo.wedget.NewGroupView
android:id="@+id/ngv_waterproof"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.srthinker.statinfo.wedget.NewGroupView
android:id="@+id/ngv_outrigger"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.srthinker.statinfo.wedget.NewGroupView
android:id="@+id/ngv_supervisor"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:background="@color/bg_070A2E"
tools:context=".uis.news.SettingActivity">
<ImageView
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_back"
android:padding="10dp"/>
<LinearLayout
android:layout_width="255.5dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_shape"
android:layout_marginLeft="15dp"
android:padding="15dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="进出配置"
android:textSize="@dimen/text_10"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/line_bottom"
android:layout_marginTop="5dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="17dp">
<TextView
android:id="@+id/tv_enter_text"
android:layout_width="60dp"
android:layout_height="22dp"
android:gravity="center"
android:text="进入设备"
android:textColor="@color/white"
android:textSize="@dimen/text_10"
android:background="@color/color_00A89C"
android:layout_alignParentLeft="true"/>
<TextView
android:id="@+id/tv_enter_error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="!"
android:textColor="@color/white"
android:textSize="@dimen/text_12_5"
android:layout_toRightOf="@+id/tv_enter_text"
android:layout_alignBottom="@+id/tv_enter_text"
android:visibility="visible"
android:layout_marginLeft="5dp"/>
<TextView
android:id="@+id/tv_leave_text"
android:layout_width="60dp"
android:layout_height="22dp"
android:gravity="center"
android:text="出口设备"
android:textColor="@color/white"
android:textSize="@dimen/text_10"
android:background="@color/color_2D52E3"
android:layout_alignParentRight="true"/>
<TextView
android:id="@+id/tv_leave_error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="!"
android:textColor="@color/white"
android:textSize="@dimen/text_12_5"
android:layout_toLeftOf="@+id/tv_leave_text"
android:layout_alignBottom="@+id/tv_leave_text"
android:visibility="visible"
android:layout_marginRight="5dp"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="255.5dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_shape"
android:layout_marginLeft="15dp"
android:padding="15dp"
android:layout_marginTop="15dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="人员信息"
android:textSize="@dimen/text_10"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/line_bottom"
android:layout_marginTop="5dp"/>
<Button
android:id="@+id/btn_group_detail"
android:layout_width="60dp"
android:layout_height="22dp"
android:background="@color/color_2D52E3"
android:layout_alignParentRight="true"
android:layout_marginRight="8dp"
android:layout_marginTop="17dp"
android:gravity="center"
android:text="人员详情"
android:textColor="@color/white"
android:textSize="@dimen/text_10"/>
</LinearLayout>
<LinearLayout
android:layout_width="255.5dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_shape"
android:layout_marginLeft="15dp"
android:padding="15dp"
android:layout_marginTop="15dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="设备信息"
android:textSize="@dimen/text_10"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/line_bottom"
android:layout_marginTop="5dp"/>
<TextView
android:id="@+id/tv_device_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:layout_marginTop="17dp"
android:textColor="@color/white"
android:textSize="@dimen/text_10"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_group_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text=""
android:textColor="@color/red"
android:gravity="center|left"
android:textSize="@dimen/display_text"/>
<TextView
android:id="@+id/tv_group_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text=""
android:textColor="@color/red"
android:gravity="center|left"
android:textSize="@dimen/display_text"/>
</LinearLayout>
\ No newline at end of file
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