Explorar el Código

3

一拖四味魔方
fyf hace 1 año
padre
commit
2b249ff5e4
Se han modificado 4 ficheros con 88 adiciones y 71 borrados
  1. +1
    -1
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  2. +10
    -15
      app/src/main/java/com/bonait/bnframework/modules/mine/fragment/from/UserActivity.java
  3. +46
    -32
      app/src/main/res/layout/activity_user.xml
  4. +31
    -23
      app/src/main/res/layout/datatab/layout/user_item.xml

+ 1
- 1
app/src/main/java/com/bonait/bnframework/business/MainInit.java Ver fichero

@@ -190,7 +190,7 @@ public class MainInit {
user.account = "admin";
user.pass = "123456";
user.deviceID = ConfigName.getInstance().DeviceId;
user.userID = "20230415-fyf";
user.userID = "超级管理员";
user.exp = "管理员";
QueryDB.AddUser(user);



+ 10
- 15
app/src/main/java/com/bonait/bnframework/modules/mine/fragment/from/UserActivity.java Ver fichero

@@ -43,6 +43,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
* 用户数据
*/
ArrayList<BPA_USER> bpa_users = new ArrayList<>();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -55,7 +56,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {

private void initTopBar() {
mTopBar.setTitle("账户管理");
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() {
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
@@ -89,8 +90,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
public void onClick(QMUIDialog dialog, int index) {
CharSequence text = builder_add.getEditText().getText();
if (text != null && text.length() > 0) {
if(text.toString().equals("admin"))
{
if (text.toString().equals("admin")) {
ToastUtils.warning("不能设置账号为admin!");
return;
}
@@ -99,7 +99,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
bpa_user.account = text.toString();
bpa_user.pass = "123456";
bpa_user.deviceID = ConfigName.getInstance().DeviceId;
bpa_user.userID = ConfigName.getInstance().user.userID;
bpa_user.userID = ConfigName.getInstance().user.userID;//更改为,用户权限 // 一般用户 研发用户 超级管理员
QueryDB.AddUser(bpa_user);
ToastUtils.info("新增成功");
Initdata();
@@ -131,10 +131,9 @@ public class UserActivity extends BaseActivity implements MyClickListener {

@Override
public void clickListener(View v, Object data) {
String name= ((BPA_USER) data).name;
String ac= ((BPA_USER) data).account;
if(name.equals("admin") || ac.equals("admin"))
{
String name = ((BPA_USER) data).name;
String ac = ((BPA_USER) data).account;
if (name.equals("admin") || ac.equals("admin")) {
ToastUtils.warning("对不起,admin账户禁止操作!");
return;
}
@@ -155,11 +154,8 @@ public class UserActivity extends BaseActivity implements MyClickListener {
@Override
public void onClick(QMUIDialog dialog, int index) {
CharSequence text = builder.getEditText().getText();


if (text != null && text.length() > 0 ) {
if(text.toString().equals("admin"))
{
if (text != null && text.length() > 0) {
if (text.toString().equals("admin")) {
ToastUtils.warning("不能设置账号为admin!");
return;
}
@@ -192,8 +188,7 @@ public class UserActivity extends BaseActivity implements MyClickListener {
public void onClick(QMUIDialog dialog, int index) {
CharSequence text = builder1.getEditText().getText();
if (text != null && text.length() > 0) {
if(text.toString().equals("admin"))
{
if (text.toString().equals("admin")) {
ToastUtils.warning("不能设置账号为admin!");
return;
}


+ 46
- 32
app/src/main/res/layout/activity_user.xml Ver fichero

@@ -8,11 +8,12 @@
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".modules.mine.fragment.from.UserActivity">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/qmui_config_color_white"
android:layout_marginTop="?attr/qmui_topbar_height">
android:layout_marginTop="?attr/qmui_topbar_height"
android:background="@color/qmui_config_color_white">

<LinearLayout
android:layout_width="match_parent"
@@ -36,26 +37,30 @@
android:layout_alignParentBottom="true"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:textColor="@color/amber_primary_dark"
android:layout_marginLeft="10dp"
android:text="(温馨提示:点击行可修改内容.)"
android:textColor="@color/amber_primary_dark"
android:textSize="12dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:orientation="horizontal">

<Button
android:id="@+id/add_wl"
android:layout_width="100dp"
@@ -63,10 +68,10 @@
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/button1"
android:background="@drawable/bg_btn_login_selected"
android:text="+增加用户"
android:textSize="14dp"
/>
android:textColor="@color/white"
android:textSize="14dp" />

<Button
android:id="@+id/synchronous"
@@ -78,7 +83,7 @@
android:background="@drawable/button1"
android:text="同步云端"
android:textSize="14dp"
android:visibility="gone"/>
android:visibility="gone" />
</LinearLayout>

</RelativeLayout>
@@ -99,8 +104,8 @@
<!-- 表头 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="26dp"
android:background="@color/activity_background">
android:layout_height="36dp"
android:background="@color/datatab_tab">

<TableLayout
android:layout_width="match_parent"
@@ -121,25 +126,31 @@
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="用户名称" />
android:text="用户名称"
android:textAlignment="center"
android:textColor="@color/white"
android:textStyle="bold" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="用户账号" />
</RelativeLayout>
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="用户账号"
android:textAlignment="center"
android:textColor="@color/white"
android:textStyle="bold" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
@@ -147,11 +158,14 @@
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="用户密码" />
android:text="用户密码"
android:textAlignment="center"
android:textColor="@color/white"
android:textStyle="bold" />
</RelativeLayout>

<RelativeLayout
@@ -160,11 +174,14 @@
android:layout_weight="1">

<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:text="操作" />
android:text="操作"
android:textAlignment="center"
android:textColor="@color/white"
android:textStyle="bold" />
</RelativeLayout>
</TableRow>
</TableLayout>
@@ -176,10 +193,7 @@
<ListView
android:id="@+id/datatab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="3dp"
android:divider="#00000000"
android:dividerHeight="3dp" />
android:layout_height="match_parent" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>


+ 31
- 23
app/src/main/res/layout/datatab/layout/user_item.xml Ver fichero

@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.android.com/apk/res/android ">

<TableLayout
android:background="@color/activity_background1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:gravity="center"
android:stretchColumns="0">

<TableRow
@@ -28,28 +27,32 @@
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="回锅肉"
android:textSize="14dp"/>
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="12dp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">

<TextView
android:id="@+id/zhanghao"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="账号"
android:textSize="12dp"/>
</RelativeLayout>
<TextView
android:id="@+id/zhanghao"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:text="账号"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="12dp" />
</RelativeLayout>

<RelativeLayout
android:layout_width="0dp"
@@ -60,11 +63,13 @@
android:id="@+id/mima"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_alignParentLeft="true"
android:text="密码"
android:textSize="12dp"/>
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="12dp" />
</RelativeLayout>

<RelativeLayout
@@ -73,14 +78,17 @@
android:layout_weight="1">
<Button
android:id="@+id/button_item"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_width="60dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:background="@drawable/button"
android:focusable="false"
android:text="删除"
android:textSize="12dp"/>
android:textSize="12dp"
android:textColor="@color/black"/>
</RelativeLayout>

</TableRow>


Cargando…
Cancelar
Guardar