@@ -33,6 +33,36 @@ | |||
tools:ignore="GoogleAppIndexingWarning" | |||
tools:node="merge" | |||
tools:replace="android:icon"> | |||
<activity | |||
android:name=".modules.home.fragment.from.OrderListActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.SalesStatisticsActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.DeviceInformationActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.ImageSourceActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.SystemParameterActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.fragment.PlcControl_kz_fragment" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.fragment.PlcControl_pz_fragment" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.RealTimeActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.LogActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.PlcControlActivity" | |||
android:exported="false" /> | |||
<activity | |||
android:name=".modules.home.fragment.from.GoodPeiFangActivity" | |||
android:exported="false" /> | |||
@@ -13,7 +13,11 @@ import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.from.JcsjglActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.OrderListActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.SalesStatisticsActivity; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
@@ -57,11 +61,10 @@ public class DingDanfragment extends BaseFragment { | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.ddgl:// | |||
ToastUtils.info("点击按钮:订单管理"); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(2,new OrderListActivity()); | |||
break; | |||
case R.id.xltj:// | |||
//skipToActivity(DiyActivity.class); | |||
ToastUtils.info("点击按钮:销量统计"); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(2,new SalesStatisticsActivity()); | |||
break; | |||
} | |||
} | |||
@@ -12,7 +12,12 @@ import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.from.JcsjglActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.LogActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.PlcControlActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.RealTimeActivity; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
@@ -53,15 +58,13 @@ public class GuanLifragment extends BaseFragment { | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.plckz:// | |||
ToastUtils.info("点击按钮:PLC数据管理"); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(4,new PlcControlActivity()); | |||
break; | |||
case R.id.rzgl:// | |||
//skipToActivity(DiyActivity.class); | |||
ToastUtils.info("点击按钮:日志管理"); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(4,new LogActivity()); | |||
break; | |||
case R.id.ssjk:// | |||
ToastUtils.info("点击按钮:实时监控"); | |||
//skipToActivity(CpActivity.class); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(4,new RealTimeActivity()); | |||
break; | |||
} | |||
} | |||
@@ -3,11 +3,13 @@ package com.bonait.bnframework.modules.home.fragment; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.core.content.ContextCompat; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
@@ -22,6 +24,13 @@ public class JiaoYanFragment extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar;//顶部标题 | |||
@BindView(R.id.rv_left) | |||
RecyclerView rv_left;//左侧菜单 | |||
@BindView(R.id.child) | |||
LinearLayout child;//右侧控件 | |||
private Context context; | |||
public JiaoYanFragment() { | |||
@@ -39,6 +48,7 @@ public class JiaoYanFragment extends BaseFragment { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initData(); | |||
} | |||
/** | |||
@@ -48,6 +58,11 @@ public class JiaoYanFragment extends BaseFragment { | |||
mTopBar.setTitle("设备校正"); | |||
} | |||
public void initData() | |||
{ | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
@@ -12,7 +12,12 @@ import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.from.DeviceInformationActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.ImageSourceActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.PlcControlActivity; | |||
import com.bonait.bnframework.modules.home.fragment.from.SystemParameterActivity; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
@@ -55,15 +60,13 @@ public class SheZhifragment extends BaseFragment { | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.xtcs:// | |||
ToastUtils.info("点击按钮:系统参数"); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(5,new SystemParameterActivity()); | |||
break; | |||
case R.id.imagegl:// | |||
//skipToActivity(DiyActivity.class); | |||
ToastUtils.info("点击按钮:图片资源管理"); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(5,new ImageSourceActivity()); | |||
break; | |||
case R.id.shebeixinxi:// | |||
ToastUtils.info("点击按钮:设备信息"); | |||
//skipToActivity(CpActivity.class); | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(5,new DeviceInformationActivity()); | |||
break; | |||
} | |||
} | |||
@@ -0,0 +1,118 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.EditText; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.modules.home.fragment.SheZhifragment; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class DeviceInformationActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
private Context context; | |||
@BindView(R.id.edittext1) | |||
EditText edittext1; | |||
@BindView(R.id.edittext2) | |||
EditText edittext2; | |||
@BindView(R.id.edittext3) | |||
EditText edittext3; | |||
@BindView(R.id.edittext4) | |||
EditText edittext4; | |||
@BindView(R.id.edittext5) | |||
EditText edittext5; | |||
@BindView(R.id.edittext6) | |||
EditText edittext6; | |||
@BindView(R.id.edittext7) | |||
EditText edittext7; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_deviceinformation, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
initdata(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("系统参数"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(5,new SheZhifragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* 初始化数据 | |||
*/ | |||
public void initdata() | |||
{ | |||
if(ConfigName.getInstance().organizeMode !=null && ConfigName.getInstance().deviceInformation!=null) | |||
{ | |||
edittext1.setText(ConfigName.getInstance().deviceInformation.id); | |||
edittext2.setText(ConfigName.getInstance().deviceInformation.deviceName); | |||
edittext3.setText(ConfigName.getInstance().deviceInformation.deviceLoc); | |||
edittext4.setText(ConfigName.getInstance().organizeMode.tel); | |||
edittext5.setText(ConfigName.getInstance().deviceInformation.deviceAddr); | |||
edittext6.setText(ConfigName.getInstance().organizeMode.id); | |||
edittext7.setText(ConfigName.getInstance().organizeMode.store_Name); | |||
// if(ConfigName.getInstance().organizeMode.logo!=null) | |||
// { | |||
// new MyBitmapUtils().disPlay(image,ConfigName.getInstance().organizeMode.logo); | |||
// } | |||
}else | |||
{ | |||
edittext1.setText(ConfigName.getInstance().DeviceId); | |||
edittext2.setText(ConfigName.getInstance().versionSelectionEnum); | |||
edittext3.setText("未知"); | |||
edittext4.setText(""); | |||
edittext5.setText("未知"); | |||
edittext6.setText("未知"); | |||
edittext7.setText("未知"); | |||
} | |||
} | |||
/** | |||
* | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,195 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import androidx.recyclerview.widget.LinearLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.content.Context; | |||
import android.content.Intent; | |||
import android.graphics.Bitmap; | |||
import android.graphics.BitmapFactory; | |||
import android.os.Bundle; | |||
import android.os.Environment; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.Button; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.Constants; | |||
import com.bonait.bnframework.common.filepicker.PickerManager; | |||
import com.bonait.bnframework.common.filepicker.adapter.FilePickerShowAdapter; | |||
import com.bonait.bnframework.common.filepicker.adapter.OnFileItemClickListener; | |||
import com.bonait.bnframework.common.filepicker.model.FileEntity; | |||
import com.bonait.bnframework.common.filepicker.model.FileType; | |||
import com.bonait.bnframework.common.image.utils.LocalCacheUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.SheZhifragment; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import java.io.File; | |||
import java.io.FileInputStream; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class ImageSourceActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
private Context context; | |||
@BindView(R.id.rl_file) | |||
RecyclerView mRecyclerView; | |||
@BindView(R.id.rl_yx_file) | |||
RecyclerView rl_yx_file; | |||
@BindView(R.id.baocunbendi) | |||
Button baocunbendi; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_imagesource, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
FlushedImage(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("系统参数"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(5,new SheZhifragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
} | |||
@OnClick({R.id.xuanzhewenjian, R.id.baocunbendi}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.xuanzhewenjian://保存按钮 | |||
Intent intent = new Intent(context, FileActivity.class); | |||
startActivityForResult(intent, Constants.REQ_CODE); | |||
break; | |||
case R.id.baocunbendi://保存按钮 | |||
BitmapFactory.Options options = new BitmapFactory.Options(); | |||
options.inSampleSize = 2;//宽高压缩为原来的1/2 | |||
for (FileEntity item : PickerManager.getInstance().files) { | |||
File file = item.getFile(); | |||
try { | |||
Bitmap bitmap1 = BitmapFactory.decodeStream(new FileInputStream(file)); | |||
new LocalCacheUtils().setBitmapToLocal(file.getName(), bitmap1); | |||
} catch (Exception e) { | |||
} | |||
} | |||
ToastUtils.info("添加成功!"); | |||
break; | |||
} | |||
} | |||
ArrayList<FileEntity> yx_files = new ArrayList<>(); | |||
private static final String CACHE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/hblchayingdb/WebImage"; | |||
public void FlushedImage() { | |||
File path = new File(CACHE_PATH);// 获得路径 | |||
File[] files = path.listFiles();// 读取文件 | |||
yx_files.clear(); | |||
for (File f : files) { | |||
String absolutePath = f.getAbsolutePath(); | |||
FileEntity e; | |||
if (checkExits(absolutePath)) { | |||
e = new FileEntity(absolutePath, f, true); | |||
} else { | |||
e = new FileEntity(absolutePath, f, false); | |||
} | |||
if (f.isFile()) { | |||
String[] imgs = {"png", "jpg", "jpeg", "gif"}; | |||
e.setFileType(new FileType("IMG", imgs, 0)); | |||
yx_files.add(e); | |||
} | |||
} | |||
rl_yx_file.setLayoutManager(new LinearLayoutManager(context)); | |||
FilePickerShowAdapter adapter = new FilePickerShowAdapter(context, yx_files); | |||
rl_yx_file.setAdapter(adapter); | |||
adapter.setOnItemClickListener(new OnFileItemClickListener() { | |||
@Override | |||
public void click(int position) { | |||
// String path=yx_files.get(position).getPath(); | |||
// Bitmap bitmap =BitmapFactory.decodeFile("file://" + path); | |||
// MyImageDialog myImageDialog = new MyImageDialog(getActivity(),R.style.dialogWindowAnim,0,0,bitmap); | |||
// myImageDialog.show(); | |||
//打开系统相册浏览照片 | |||
// Intent intent = new Intent(); | |||
// intent.setAction(Intent.ACTION_VIEW); | |||
// intent.setDataAndType(Uri.parse("file://" + path), "image/*"); | |||
// startActivity(intent); | |||
} | |||
}); | |||
} | |||
private static boolean checkExits(String path) { | |||
for (FileEntity entity : PickerManager.getInstance().files) { | |||
if (entity.getPath().equals(path)) { | |||
return true; | |||
} | |||
} | |||
return false; | |||
} | |||
@Override | |||
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |||
super.onActivityResult(requestCode, resultCode, data); | |||
if (requestCode == Constants.REQ_CODE) { | |||
mRecyclerView.setLayoutManager(new LinearLayoutManager(context)); | |||
FilePickerShowAdapter adapter = new FilePickerShowAdapter(context, PickerManager.getInstance().files); | |||
mRecyclerView.setAdapter(adapter); | |||
String res = "(" + PickerManager.getInstance().files.size() + "/" + PickerManager.getInstance().maxCount + ")"; | |||
baocunbendi.setText(getString(R.string.file_select_res1, res)); | |||
adapter.setOnItemClickListener(new OnFileItemClickListener() { | |||
@Override | |||
public void click(int position) { | |||
// String path=PickerManager.getInstance().files.get(position).getPath(); | |||
// Intent intent = new Intent(); | |||
// intent.setAction(Intent.ACTION_VIEW); | |||
// intent.setDataAndType(Uri.parse("file://" + path), "image/*"); | |||
// startActivity(intent); | |||
} | |||
}); | |||
} | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,78 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.modules.home.fragment.GuanLifragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.Jcsjgl_sxgl_fragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.Jcsjgl_wl_fragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class LogActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.tabs) | |||
QMUITabSegment tabs; | |||
@BindView(R.id.viewpager_wl) | |||
QMUIViewPager viewpager_wl; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_log, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("日志管理"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(4,new GuanLifragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,70 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.modules.home.fragment.DingDanfragment; | |||
import com.bonait.bnframework.modules.home.fragment.GuanLifragment; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class OrderListActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_orderlist, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("订单列表"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(2,new DingDanfragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,108 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.modules.home.fragment.GongnengFragment; | |||
import com.bonait.bnframework.modules.home.fragment.GuanLifragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.Jcsjgl_sxgl_fragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.Jcsjgl_wl_fragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.PlcControl_kz_fragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.PlcControl_pz_fragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class PlcControlActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.tabs) | |||
QMUITabSegment tabs; | |||
@BindView(R.id.viewpager_wl) | |||
QMUIViewPager viewpager_wl; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_plccontrol, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("PLC地址配置与控制"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(4,new GuanLifragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
QMUIFragmentPagerAdapter adapter=new QMUIFragmentPagerAdapter(getChildFragmentManager()) { | |||
@Override | |||
public int getCount() { | |||
return 2; | |||
} | |||
@Override | |||
public QMUIFragment createFragment(int position) { | |||
switch (position) { | |||
case 0: | |||
return new PlcControl_pz_fragment(); | |||
case 1: | |||
default: | |||
return new PlcControl_kz_fragment(); | |||
} | |||
} | |||
@Override | |||
public CharSequence getPageTitle(int position) { | |||
switch (position) { | |||
case 0: | |||
return "PLC#地址"; | |||
case 1: | |||
default: | |||
return "控制#监控"; | |||
} | |||
} | |||
}; | |||
viewpager_wl.setAdapter(adapter); | |||
tabs.setupWithViewPager(viewpager_wl,true); | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,78 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.modules.home.fragment.GuanLifragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.Jcsjgl_sxgl_fragment; | |||
import com.bonait.bnframework.modules.home.fragment.from.fragment.Jcsjgl_wl_fragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragment; | |||
import com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class RealTimeActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.tabs) | |||
QMUITabSegment tabs; | |||
@BindView(R.id.viewpager_wl) | |||
QMUIViewPager viewpager_wl; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_realtime, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("实时监控管理"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(4,new GuanLifragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,69 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.modules.home.fragment.DingDanfragment; | |||
import com.bonait.bnframework.modules.home.fragment.GuanLifragment; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class SalesStatisticsActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_salesstatistics, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("销售统计"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(2,new DingDanfragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,247 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.content.Context; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.AdapterView; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.EditText; | |||
import android.widget.Spinner; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.GuanLifragment; | |||
import com.bonait.bnframework.modules.home.fragment.SheZhifragment; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment; | |||
import java.util.ArrayList; | |||
import java.util.LinkedHashMap; | |||
import java.util.Map; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class SystemParameterActivity extends BaseFragment { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
private Context context; | |||
@BindView(R.id.edittext1) | |||
EditText edittext1; | |||
@BindView(R.id.edittext2) | |||
EditText edittext2; | |||
@BindView(R.id.edittext3) | |||
EditText edittext3; | |||
@BindView(R.id.edittext4) | |||
EditText edittext4; | |||
@BindView(R.id.environment) | |||
Spinner environment; | |||
@BindView(R.id.versionselection) | |||
Spinner versionselection; | |||
@BindView(R.id.HuoLi) | |||
Spinner HuoLi; | |||
ArrayList<EditText> editTextLists = new ArrayList<>(); | |||
Map<String, Integer> material_map = new LinkedHashMap<>(); | |||
Map<String, Integer> material_map_vis = new LinkedHashMap<>(); | |||
/** | |||
* 系统设置参数 | |||
*/ | |||
ArrayList<BPA_SYSTEMSET> bpa_systemsets = new ArrayList<>(); | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.activity_systemparameter, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
context = getContext(); | |||
initTopBar(); | |||
initFragment(); | |||
initData(); | |||
initSelect(); | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("系统参数"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ConfigName.getInstance().fragmentAdapter.replaceFragment(5,new SheZhifragment()); | |||
} | |||
}); | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
*/ | |||
private void initFragment() { | |||
} | |||
private void initData() { | |||
editTextLists.add(edittext1); | |||
editTextLists.add(edittext2); | |||
editTextLists.add(edittext3); | |||
editTextLists.add(edittext4); | |||
material_map.put("开发环境", 0); | |||
material_map.put("测试环境", 1); | |||
material_map.put("正式环境", 2); | |||
for (int i = 0; i < ConfigName.getInstance().versionSelectionValues.length; i++) { | |||
material_map_vis.put(ConfigName.getInstance().versionSelectionValues[i], i); | |||
} | |||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map.keySet())); | |||
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
environment.setAdapter(adapter); | |||
ArrayAdapter<String> adapter1 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map_vis.keySet())); | |||
adapter1.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
versionselection.setAdapter(adapter1); | |||
ArrayAdapter<String> adapter2 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(ConfigName.getInstance().HeatingGearL.keySet())); | |||
adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
HuoLi.setAdapter(adapter2); | |||
HuoLi.setSelection(ConfigName.getInstance().HeatingGearL.get(ConfigName.getInstance().HuoLi)); | |||
bpa_systemsets = QueryDB.GetSystemsetALL(); | |||
for (BPA_SYSTEMSET item : bpa_systemsets) { | |||
switch (item.type) { | |||
case -100: | |||
ConfigName.getInstance().versionSelectionEnum = item.value; | |||
versionselection.setSelection(material_map_vis.get(item.value)); | |||
break; | |||
case -99: | |||
ConfigName.getInstance().Environment = item.value; | |||
environment.setSelection(material_map.get(item.value)); | |||
break; | |||
case 1: | |||
ConfigName.getInstance().Address = item.value; | |||
edittext1.setText(item.value); | |||
break; | |||
case 2: | |||
ConfigName.getInstance().Post = Integer.parseInt(item.value); | |||
edittext2.setText(item.value); | |||
break; | |||
case 3: | |||
ConfigName.getInstance().ClientAutoKey = item.value; | |||
edittext3.setText(item.value); | |||
break; | |||
case 4: | |||
ConfigName.getInstance().DeviceAutoKey = item.value; | |||
edittext4.setText(item.value); | |||
break; | |||
} | |||
} | |||
} | |||
/** | |||
* 初始化选中 | |||
*/ | |||
public void initSelect() { | |||
HuoLi.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() { | |||
@Override | |||
/*public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |||
}*/ | |||
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { | |||
ConfigName.getInstance().HuoLi=HuoLi.getSelectedItem().toString(); | |||
ConfigData.getInstance().SavePZ(); | |||
} | |||
@Override | |||
public void onNothingSelected(AdapterView<?> parent) { | |||
} | |||
}); | |||
} | |||
@OnClick({R.id.StartButton}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.StartButton://保存按钮 | |||
ConfigName.getInstance().Address = edittext1.getText().toString(); | |||
ConfigName.getInstance().Post = Integer.parseInt(edittext2.getText().toString()); | |||
ConfigName.getInstance().ClientAutoKey = edittext3.getText().toString(); | |||
ConfigName.getInstance().DeviceAutoKey = edittext4.getText().toString(); | |||
ConfigName.getInstance().Environment = environment.getSelectedItem().toString(); | |||
boolean isgb = false; | |||
if (!ConfigName.getInstance().versionSelectionEnum.equals(versionselection.getSelectedItem().toString())) { | |||
ConfigName.getInstance().versionSelectionEnum = versionselection.getSelectedItem().toString(); | |||
isgb = true; | |||
} | |||
for (BPA_SYSTEMSET item : bpa_systemsets) { | |||
QueryDB.DeleteSystemset(item.id); | |||
} | |||
for (int i = 0; i < editTextLists.size(); i++) { | |||
BPA_SYSTEMSET set = new BPA_SYSTEMSET(); | |||
set.type = i + 1; | |||
set.value = editTextLists.get(i).getText().toString(); | |||
set.deviceID = ConfigName.getInstance().DeviceId; | |||
set.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set); | |||
} | |||
BPA_SYSTEMSET set = new BPA_SYSTEMSET(); | |||
set.type = -99; | |||
set.value = environment.getSelectedItem().toString(); | |||
set.deviceID = ConfigName.getInstance().DeviceId; | |||
set.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set); | |||
BPA_SYSTEMSET set_vis = new BPA_SYSTEMSET(); | |||
set_vis.type = -100; | |||
set_vis.value = versionselection.getSelectedItem().toString(); | |||
set_vis.deviceID = ConfigName.getInstance().DeviceId; | |||
set_vis.userID = ConfigName.getInstance().user.userID; | |||
QueryDB.AddSystemset(set_vis); | |||
if (isgb) { | |||
ConfigData.getInstance().RevertPLCProcess(); | |||
} | |||
ToastUtils.info("保存成功"); | |||
break; | |||
} | |||
} | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
} | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.ContextWrapper; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc_control; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUILoadingView; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
public class PlcControl_kz_fragment extends BaseFragment { | |||
@BindView(R.id.plcview) | |||
LinearLayout plcview;//工序子集 | |||
@BindView(R.id.load_view) | |||
QMUILoadingView load_view;//工序子集 | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_plccontrol_kz, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
Init(); | |||
} | |||
/** | |||
* 初始化 | |||
*/ | |||
public void Init() { | |||
load_view.setVisibility(View.VISIBLE); | |||
plcview.removeAllViews(); | |||
ArrayList<BPA_PLCADDRESS> arrayList = QueryDB.GetPlcaddressALL(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
Activity activity = findActivity(context); | |||
if (activity != null) { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
for (BPA_PLCADDRESS item : arrayList) { | |||
fragment_plc_control gongxu = new fragment_plc_control(context, null, item); | |||
plcview.addView(gongxu); | |||
} | |||
} catch (Exception e) { | |||
}finally { | |||
load_view.setVisibility(View.INVISIBLE); | |||
} | |||
} | |||
}); | |||
} | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
private Activity findActivity(@NonNull Context context) { | |||
if (context instanceof Activity) { | |||
return (Activity) context; | |||
} else if (context instanceof ContextWrapper) { | |||
return findActivity(((ContextWrapper) context).getBaseContext()); | |||
} else { | |||
return null; | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* | |||
* 切记!切记!切记!否则会闪退! | |||
* | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,142 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from.fragment; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.Nullable; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.ContextWrapper; | |||
import android.os.Bundle; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.mode.fragment_plc; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUILoadingView; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class PlcControl_pz_fragment extends BaseFragment { | |||
@BindView(R.id.plcview) | |||
LinearLayout plcview;//工序子集 | |||
@BindView(R.id.load_view) | |||
QMUILoadingView load_view;//工序子集 | |||
private Context context; | |||
@Override | |||
protected View onCreateView() { | |||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_plccontrol_pz, null); | |||
ButterKnife.bind(this, root); | |||
return root; | |||
} | |||
@Override | |||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||
super.onViewCreated(view, savedInstanceState); | |||
Logger.d("我的fragment创建"); | |||
context = getContext(); | |||
Init(); | |||
} | |||
/** | |||
* 初始化 | |||
*/ | |||
public void Init() { | |||
load_view.setVisibility(View.VISIBLE); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
Activity activity = findActivity(context); | |||
if (activity != null) { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
try { | |||
ArrayList<BPA_PLCADDRESS> arrayList = QueryDB.GetPlcaddressALL(); | |||
for (BPA_PLCADDRESS item : arrayList) { | |||
fragment_plc gongxu = new fragment_plc(context, null, item); | |||
plcview.addView(gongxu); | |||
} | |||
} catch (Exception e) { | |||
}finally { | |||
load_view.setVisibility(View.INVISIBLE); | |||
} | |||
} | |||
}); | |||
} | |||
} catch (Exception e) { | |||
} | |||
} | |||
}).start(); | |||
} | |||
private Activity findActivity(@NonNull Context context) { | |||
if (context instanceof Activity) { | |||
return (Activity) context; | |||
} else if (context instanceof ContextWrapper) { | |||
return findActivity(((ContextWrapper) context).getBaseContext()); | |||
} else { | |||
return null; | |||
} | |||
} | |||
@OnClick({R.id.chushihua}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.chushihua: | |||
String title = "温馨提示!"; | |||
String message = "客官确定要初始化PLC地址吗,小菠萝温馨提示你,此操作将会影响到实际运行哦?"; | |||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
load_view.setVisibility(View.VISIBLE); | |||
ConfigData.getInstance().RevertPLCProcess(); | |||
Init(); | |||
ToastUtils.info("初始化成功!"); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
break; | |||
} | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
Logger.d("我的fragment销毁"); | |||
} | |||
/** | |||
* 当在activity设置viewPager + BottomNavigation + fragment时, | |||
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题, | |||
* 必须加上此方法,禁止fragment左滑返回上一界面。 | |||
* <p> | |||
* 切记!切记!切记!否则会闪退! | |||
* <p> | |||
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。 | |||
*/ | |||
@Override | |||
protected boolean canDragBack() { | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,254 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<RelativeLayout | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/main_background" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10"> | |||
<TableLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerHorizontal="true"> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备编号:" /> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:gravity="right" | |||
android:text="设备名称:" /> | |||
<EditText | |||
android:id="@+id/edittext2" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备位置:" /> | |||
<EditText | |||
android:id="@+id/edittext3" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:gravity="right" | |||
android:text="联系电话:" /> | |||
<EditText | |||
android:id="@+id/edittext4" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备详细地址:" /> | |||
<EditText | |||
android:id="@+id/edittext5" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="门店编号:" /> | |||
<EditText | |||
android:id="@+id/edittext6" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="门店名称:" /> | |||
<EditText | |||
android:id="@+id/edittext7" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:layout_weight="1" | |||
android:background="@drawable/input_bj" | |||
android:hint="" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
</TableRow> | |||
<!-- Table1--> | |||
<!-- <TableRow--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:layout_gravity="center"--> | |||
<!-- android:layout_margin="5dp">--> | |||
<!-- <com.qmuiteam.qmui.widget.textview.QMUILinkTextView--> | |||
<!-- android:layout_width="wrap_content"--> | |||
<!-- android:layout_height="wrap_content"--> | |||
<!-- android:gravity="right"--> | |||
<!-- android:text="门店LOGO:" />--> | |||
<!-- <ImageView--> | |||
<!-- android:id="@+id/image"--> | |||
<!-- android:layout_width="120dp"--> | |||
<!-- android:layout_height="120dp"--> | |||
<!-- android:layout_marginLeft="5dp"--> | |||
<!-- android:src="@mipmap/loading3" />--> | |||
<!-- </TableRow>--> | |||
</TableLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -104,7 +104,8 @@ | |||
<com.bonait.bnframework.modules.home.fragment.mode.add_pf_control | |||
android:id="@+id/add_pf" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"/> | |||
android:layout_height="match_parent" | |||
android:visibility="gone"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
@@ -0,0 +1,133 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<RelativeLayout | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1"> | |||
<!-- 本地已存在资源 --> | |||
<LinearLayout | |||
android:background="@color/qmui_config_color_white" | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="1" | |||
android:orientation="vertical" | |||
android:paddingLeft="@dimen/dp_10" | |||
android:paddingTop="@dimen/dp_10" | |||
android:paddingRight="@dimen/dp_10" | |||
android:layout_marginBottom="@dimen/dp_10"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="已有图片列表" | |||
android:textSize="@dimen/text_size_16" | |||
/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="5dp" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/rl_yx_file" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:scrollbars="none" | |||
/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<!-- 选择资源 --> | |||
<LinearLayout | |||
android:background="@color/qmui_config_color_white" | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="1" | |||
android:orientation="vertical" | |||
android:paddingLeft="@dimen/dp_10" | |||
android:paddingRight="@dimen/dp_10"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textSize="@dimen/text_size_16" | |||
android:text="选择图片列表"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="5dp" | |||
android:layout_marginBottom="@dimen/dp_10"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/rl_file" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:scrollbars="none" | |||
/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_margin="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="34dp" | |||
android:gravity="center_vertical" | |||
android:orientation="horizontal"> | |||
<Button | |||
android:id="@+id/xuanzhewenjian" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="选择文件" | |||
android:layout_weight="1" | |||
/> | |||
<Button | |||
android:id="@+id/baocunbendi" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/button1" | |||
android:text="保存本地" | |||
android:layout_weight="1" | |||
/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<com.qmuiteam.qmui.widget.tab.QMUITabSegment | |||
android:id="@+id/tabs" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="43dp" | |||
android:background="@drawable/qmui_list_item_bg_with_border_bottom" | |||
android:textSize="14sp" | |||
app:qmui_tab_selected_text_size="16sp" | |||
app:qmui_tab_normal_text_size="14sp" | |||
app:qmui_tab_indicator_height="2dp" | |||
app:qmui_tab_indicator_top="false" | |||
app:qmui_tab_has_indicator="true" | |||
/> | |||
<com.qmuiteam.qmui.widget.QMUIViewPager | |||
android:id="@+id/viewpager_wl" | |||
android:layout_marginTop="100dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="?attr/app_content_bg_color" /> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,24 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<RelativeLayout | |||
android:id="@+id/tabs" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/main_background" | |||
/> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<com.qmuiteam.qmui.widget.tab.QMUITabSegment | |||
android:id="@+id/tabs" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="43dp" | |||
android:background="@drawable/qmui_list_item_bg_with_border_bottom" | |||
android:textSize="14sp" | |||
app:qmui_tab_selected_text_size="16sp" | |||
app:qmui_tab_normal_text_size="14sp" | |||
app:qmui_tab_indicator_height="2dp" | |||
app:qmui_tab_indicator_top="false" | |||
app:qmui_tab_has_indicator="true" | |||
/> | |||
<com.qmuiteam.qmui.widget.QMUIViewPager | |||
android:id="@+id/viewpager_wl" | |||
android:layout_marginTop="100dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="?attr/app_content_bg_color" /> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<com.qmuiteam.qmui.widget.tab.QMUITabSegment | |||
android:id="@+id/tabs" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="43dp" | |||
android:background="@drawable/qmui_list_item_bg_with_border_bottom" | |||
android:textSize="14sp" | |||
app:qmui_tab_selected_text_size="16sp" | |||
app:qmui_tab_normal_text_size="14sp" | |||
app:qmui_tab_indicator_height="2dp" | |||
app:qmui_tab_indicator_top="false" | |||
app:qmui_tab_has_indicator="true" | |||
/> | |||
<com.qmuiteam.qmui.widget.QMUIViewPager | |||
android:id="@+id/viewpager_wl" | |||
android:layout_marginTop="100dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="?attr/app_content_bg_color" /> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,24 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<RelativeLayout | |||
android:id="@+id/tabs" | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/main_background" | |||
/> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,190 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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:orientation="vertical" | |||
android:background="@color/white" | |||
android:fitsSystemWindows="true"> | |||
<RelativeLayout | |||
android:layout_marginTop="54dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/main_background"> | |||
<RelativeLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<TableLayout | |||
android:layout_centerHorizontal="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<!-- Table1--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="center" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="PLC连接地址:" /> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入地址" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="PLC连接端口:" /> | |||
<EditText | |||
android:id="@+id/edittext2" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入端口" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" | |||
android:text="0"/> | |||
</TableRow> | |||
<!-- Table2--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="商家店铺号:" /> | |||
<EditText | |||
android:id="@+id/edittext3" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入商家店铺号" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="链接环境:" /> | |||
<Spinner | |||
android:id="@+id/environment" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
<!-- Table3--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="商家设备号:" /> | |||
<EditText | |||
android:id="@+id/edittext4" | |||
android:layout_width="120dp" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入商家设备号" | |||
android:inputType="text" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="12dp" /> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="版本选择:" /> | |||
<Spinner | |||
android:id="@+id/versionselection" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
<!-- Table3--> | |||
<TableRow | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="left" | |||
android:layout_margin="5dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="火力最大级别:" /> | |||
<Spinner | |||
android:id="@+id/HuoLi" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="80dp" | |||
android:layout_height="24dp" | |||
android:layout_centerVertical="true" /> | |||
</TableRow> | |||
</TableLayout> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginLeft="@dimen/dp_40" | |||
android:layout_marginRight="@dimen/dp_40" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:id="@+id/StartButton" | |||
android:layout_width="match_parent" | |||
android:layout_height="45dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="保存参数" | |||
android:textColor="@color/white" | |||
android:textSize="18sp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/app_color_blue"/> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -5,16 +5,37 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/app_color_blue"> | |||
<ScrollView | |||
<RelativeLayout | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="?attr/app_content_bg_color"> | |||
<RelativeLayout | |||
android:background="@color/main_background"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
</RelativeLayout> | |||
</ScrollView> | |||
android:layout_height="match_parent" | |||
android:orientation="horizontal"> | |||
<!-- 左侧导航 --> | |||
<LinearLayout | |||
android:id="@+id/daohanglan" | |||
android:layout_width="200dp" | |||
android:layout_height="match_parent"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/rv_left" | |||
android:layout_width="match_parent" | |||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" | |||
android:layout_height="match_parent" /> | |||
</LinearLayout> | |||
<!-- 右侧控件 --> | |||
<LinearLayout | |||
android:id="@+id/child" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="horizontal"> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
android:layout_width="match_parent" | |||
@@ -0,0 +1,39 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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" | |||
tools:context=".modules.home.fragment.from.fragment.PlcControl_kz_fragment"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/main_background"> | |||
<ScrollView | |||
android:layout_marginTop="20dp" | |||
android:layout_weight="1" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:id="@+id/plcview" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
</LinearLayout> | |||
</ScrollView> | |||
</LinearLayout> | |||
<com.qmuiteam.qmui.widget.QMUILoadingView | |||
android:id="@+id/load_view" | |||
android:layout_width="75dp" | |||
android:layout_height="55dp" | |||
android:layout_centerInParent="true" | |||
android:color="@color/colorPrimary" | |||
android:visibility="visible" | |||
tools:ignore="MissingConstraints" /> | |||
</RelativeLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -0,0 +1,55 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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" | |||
tools:context=".modules.home.fragment.from.fragment.PlcControl_pz_fragment"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical" | |||
android:background="@color/main_background"> | |||
<ScrollView | |||
android:layout_marginTop="20dp" | |||
android:layout_weight="1" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:id="@+id/plcview" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
</LinearLayout> | |||
</ScrollView> | |||
<LinearLayout | |||
android:layout_margin="20dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="34dp" | |||
android:gravity="center_vertical" | |||
android:orientation="horizontal"> | |||
<Button | |||
android:id="@+id/chushihua" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="恢复出厂设置" | |||
android:layout_weight="1" | |||
/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<com.qmuiteam.qmui.widget.QMUILoadingView | |||
android:id="@+id/load_view" | |||
android:layout_width="75dp" | |||
android:layout_height="55dp" | |||
android:layout_centerInParent="true" | |||
android:color="@color/colorPrimary" | |||
android:visibility="visible" | |||
tools:ignore="MissingConstraints" /> | |||
</RelativeLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |