[function]基础功能
This commit is contained in:
parent
b1adea1fdc
commit
cb6218bffc
|
|
@ -38,7 +38,7 @@ const val TIMING = "timing"
|
|||
/**
|
||||
* 定数计时
|
||||
*/
|
||||
const val NUMBER = "number"
|
||||
const val NUMBER = "counter"
|
||||
|
||||
const val TIMING_NAME = "定时计数(秒)"
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,14 @@ import com.skipping.activity.home.HomeGridAdaper
|
|||
import com.skipping.activity.perform.PerformActivity
|
||||
import com.skipping.activity.setting.SettingActivity
|
||||
import com.skipping.net.DetailActivityBean
|
||||
import com.skipping.utils.NumberUtil
|
||||
import com.skipping.utils.ScreenUtil
|
||||
import com.skipping.utils.StatusBarUtil
|
||||
import com.skipping.utils.ThreadPoolUtil
|
||||
import com.skipping.view.bubblewindow.BubbleWindow
|
||||
import com.skipping.view.bubblewindow.Direction
|
||||
import com.skipping.view.bubblewindow.OnItemClick
|
||||
import com.skipping.view.bubblewindow.itemview.TextItemView
|
||||
import com.tencent.mmkv.MMKV
|
||||
import kotlinx.android.synthetic.main.activity_begin.*
|
||||
import kotlinx.android.synthetic.main.activity_home.*
|
||||
|
|
@ -36,6 +41,7 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
|||
lateinit var adaper: BeginGridAdaper
|
||||
lateinit var detailBean: DetailActivityBean
|
||||
lateinit var future: ScheduledFuture<*>
|
||||
lateinit var bubbleWindow: BubbleWindow
|
||||
|
||||
companion object {
|
||||
val ID = "id"
|
||||
|
|
@ -54,6 +60,7 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
|||
}
|
||||
|
||||
override fun initStart() {
|
||||
ScreenUtil.setCustomDensity(this)
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
|
|
@ -79,11 +86,30 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
|||
}, 0, 1000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
begin_listRL.setOnClickListener {
|
||||
bubbleWindow.show(begin_list)
|
||||
}
|
||||
}
|
||||
|
||||
fun activityDetailResult(bean: DetailActivityBean) {
|
||||
bean.candidates
|
||||
bubbleWindow = BubbleWindow.Builder(this).apply {
|
||||
for (i in 0..bean.candidates.size) {
|
||||
val num = NumberUtil.numberToChinese(i)
|
||||
this.setItemView(TextItemView(this@BeginActivity, i.toString(), "第{$num}组"))
|
||||
}
|
||||
}.setOnItemClick(object : OnItemClick {
|
||||
override fun onClick(tag: String?, position: Int, bubbleWindow: BubbleWindow?) {
|
||||
val num = NumberUtil.numberToChinese(tag?.toInt()!!)
|
||||
begin_list.text = "第{$num}组"
|
||||
}
|
||||
})
|
||||
// .setMargining(com.libs.utils.ScreenUtil.getActionBarHeight(this))
|
||||
.setDirection(Direction.BOTTOM)
|
||||
.build()
|
||||
|
||||
|
||||
detailBean = bean
|
||||
begin_name.text = bean.activityName
|
||||
if (detailBean.activityType == TIMING) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.skipping.activity.home
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
|
|
@ -16,16 +17,13 @@ import com.skipping.NUMBER
|
|||
import com.skipping.R
|
||||
import com.skipping.TIMING
|
||||
import com.skipping.activity.begin.BeginActivity
|
||||
import com.skipping.activity.perform.PerformActivity
|
||||
import com.skipping.activity.setting.SettingActivity
|
||||
import com.skipping.net.ActivityBean
|
||||
import com.skipping.net.GradleBean
|
||||
import com.skipping.utils.DateUtils
|
||||
import com.skipping.utils.ScreenUtil
|
||||
import com.skipping.view.bubblewindow.BubbleWindow
|
||||
import com.skipping.view.bubblewindow.Direction
|
||||
import com.skipping.view.bubblewindow.OnItemClick
|
||||
import com.skipping.view.bubblewindow.itemview.TextItemView
|
||||
import com.skipping.view.dialog.DialogBean
|
||||
import com.skipping.view.dialog.DialogTool
|
||||
import kotlinx.android.synthetic.main.activity_detail.view.*
|
||||
import kotlinx.android.synthetic.main.activity_home.*
|
||||
|
||||
|
|
@ -37,6 +35,8 @@ import kotlinx.android.synthetic.main.activity_home.*
|
|||
class HomeActivity : BaseActivity<HomePresenter>() {
|
||||
lateinit var classList: List<GradleBean>
|
||||
lateinit var bubbleWindow: BubbleWindow
|
||||
lateinit var dialog:AlertDialog
|
||||
var choseGradeBeanList = mutableListOf<DialogBean<GradleBean>>()
|
||||
var choseCla: GradleBean? = null
|
||||
lateinit var adaper: HomeGridAdaper
|
||||
var position = 0
|
||||
|
|
@ -67,9 +67,18 @@ class HomeActivity : BaseActivity<HomePresenter>() {
|
|||
}
|
||||
p.getActivityList(1)
|
||||
p.getClassList()
|
||||
|
||||
choseClass.setOnClickListener {
|
||||
bubbleWindow.show(chooseIV)
|
||||
dialog = DialogTool(this).buildList(this, choseGradeBeanList){
|
||||
choseCla = it.bean
|
||||
chooseIV.text = it.bean.groupName + "班"
|
||||
activityNameEdit?.setText(it.bean.groupName + "班活动")
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
cancel_btn.setOnClickListener {
|
||||
drawerlayout.closeDrawer(GravityCompat.START)
|
||||
}
|
||||
|
|
@ -165,10 +174,10 @@ class HomeActivity : BaseActivity<HomePresenter>() {
|
|||
recyclerview.layoutManager = layoutManager
|
||||
adaper = HomeGridAdaper(this, list)
|
||||
adaper.setOnItemChangeClickListener {
|
||||
LogUtil.e("111111")
|
||||
// PerformActivity.startActivity(this, it.id.toString(), DateUtils.dealDateFormat(it.createdAt))
|
||||
}
|
||||
adaper.setOnItemStartClickListener {
|
||||
LogUtil.e(it)
|
||||
BeginActivity.startBegin(this, it.id.toString())
|
||||
}
|
||||
recyclerview.adapter = adaper
|
||||
|
|
@ -180,25 +189,34 @@ class HomeActivity : BaseActivity<HomePresenter>() {
|
|||
|
||||
fun showClassList(list: List<GradleBean>) {
|
||||
classList = list
|
||||
bubbleWindow = BubbleWindow.Builder(this).apply {
|
||||
classList.forEach {
|
||||
this.setItemView(TextItemView(this@HomeActivity, it.groupID, it.groupName + "班学生"))
|
||||
}
|
||||
}.setOnItemClick(object : OnItemClick {
|
||||
override fun onClick(tag: String?, position: Int, bubbleWindow: BubbleWindow?) {
|
||||
choseCla = list[position]
|
||||
chooseIV.text = list[position].groupName + "班"
|
||||
activityNameEdit?.setText(list[position].groupName + "班活动")
|
||||
bubbleWindow?.dismiss()
|
||||
}
|
||||
}).setMargining(com.libs.utils.ScreenUtil.getActionBarHeight(this))
|
||||
.setDirection(Direction.BOTTOM)
|
||||
.build()
|
||||
choseGradeBeanList.clear()
|
||||
classList.forEach {
|
||||
choseGradeBeanList.add(DialogBean(it.groupName + "班学生", it))
|
||||
}
|
||||
// bubbleWindow = BubbleWindow.Builder(this).apply {
|
||||
// classList.forEach {
|
||||
// this.setItemView(TextItemView(this@HomeActivity, it.groupID, it.groupName + "班学生"))
|
||||
// }
|
||||
// }.setOnItemClick(object : OnItemClick {
|
||||
// override fun onClick(tag: String?, position: Int, bubbleWindow: BubbleWindow?) {
|
||||
// choseCla = list[position]
|
||||
// chooseIV.text = list[position].groupName + "班"
|
||||
// activityNameEdit?.setText(list[position].groupName + "班活动")
|
||||
// bubbleWindow?.dismiss()
|
||||
// }
|
||||
// }).setMargining(com.libs.utils.ScreenUtil.getActionBarHeight(this))
|
||||
// .setDirection(Direction.BOTTOM)
|
||||
// .build()
|
||||
}
|
||||
|
||||
fun addActivityResult() {
|
||||
p.getActivityList(1)
|
||||
}
|
||||
|
||||
override fun onRestart() {
|
||||
ScreenUtil.setCustomDensity(this)
|
||||
super.onRestart()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ class HomeGridAdaper(context: Context, list: List<ActivityBean>) : RecyclerView.
|
|||
override fun onBindViewHolder(holder: HomeGridAdaper.Holder, position: Int) {
|
||||
holder.name.text = list[position].name
|
||||
holder.time.text = DateUtils.dealDateFormat(list[position].createdAt)
|
||||
holder.className.text = list[position].id.toString()
|
||||
holder.className.text = list[position].gradeName+"年级"+list[position].gradeName
|
||||
if (list[position].activityType == TIMING) {
|
||||
holder.status.text = TIMING_NAME
|
||||
holder.gridItemNum.text = list[position].value.toString() + " 秒"
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class ListAdapter extends RecyclerView.Adapter<ListAdapter.RecyclerHolder
|
|||
holder.title.setText("活动ID:" + list.get(position).getId() + "");
|
||||
holder.name.setText("活动名称:" + list.get(position).getName() + "");
|
||||
holder.orgid.setText("OrgID:" + list.get(position).getOrgID() + "");
|
||||
holder.greadid.setText("GreadID:" + list.get(position).getGreadID() + "");
|
||||
// holder.greadid.setText("GreadID:" + list.get(position).getGreadID() + "");
|
||||
holder.classid.setText("ClassID:" + list.get(position).getClassID() + "");
|
||||
holder.preson.setText("人数:" + list.get(position).getPersonNumber() + "");
|
||||
holder.status.setText("状态:" + list.get(position).getStatus() + "");
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import androidx.fragment.app.Fragment
|
|||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.libs.fragment.BaseActivity
|
||||
import com.libs.utils.ActivityManager
|
||||
import com.libs.utils.LogUtil
|
||||
import com.skipping.NUMBER_NAME
|
||||
import com.skipping.R
|
||||
import com.skipping.TIMING
|
||||
|
|
@ -17,9 +18,17 @@ import com.skipping.activity.setting.SettingActivity
|
|||
import com.skipping.fragment.login.LoginFragment
|
||||
import com.skipping.fragment.pair.PairFragment
|
||||
import com.skipping.net.DetailActivityBean
|
||||
import com.skipping.utils.ConnectManager
|
||||
import com.skipping.utils.NumberUtil
|
||||
import com.skipping.utils.ScreenUtil
|
||||
import com.skipping.utils.StatusBarUtil
|
||||
import com.skipping.view.bubblewindow.BubbleWindow
|
||||
import com.skipping.view.bubblewindow.Direction
|
||||
import com.skipping.view.bubblewindow.OnItemClick
|
||||
import com.skipping.view.bubblewindow.itemview.TextItemView
|
||||
import kotlinx.android.synthetic.main.activity_home.*
|
||||
import kotlinx.android.synthetic.main.activity_perform.*
|
||||
import kotlinx.android.synthetic.main.activity_perform.recyclerview
|
||||
import kotlinx.android.synthetic.main.activity_setting.*
|
||||
|
||||
/**
|
||||
|
|
@ -75,5 +84,8 @@ class PerformActivity : BaseActivity<PerformPresenter>() {
|
|||
recyclerview.adapter = adaper
|
||||
}
|
||||
|
||||
|
||||
override fun onRestart() {
|
||||
ScreenUtil.setCustomDensity(this)
|
||||
super.onRestart()
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,8 @@ import com.skipping.net.DetailActivityBean
|
|||
class PerformAdaper(context: Context, bean: DetailActivityBean) : RecyclerView.Adapter<PerformAdaper.Holder>() {
|
||||
var bean = bean
|
||||
var context = context
|
||||
lateinit var onClick: () -> Unit
|
||||
lateinit var onClick: (bean: DetailActivityBean.CandidatesBean) -> Unit
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PerformAdaper.Holder {
|
||||
return Holder(LayoutInflater.from(context).inflate(R.layout.perform_item, parent, false))
|
||||
}
|
||||
|
|
@ -31,7 +32,9 @@ class PerformAdaper(context: Context, bean: DetailActivityBean) : RecyclerView.A
|
|||
holder.code.text = bean.candidates[0].get(position).studentID
|
||||
holder.time.text = bean.activityValue.toString()
|
||||
holder.num.text = bean.candidates[0].get(position).score.toString()
|
||||
|
||||
holder.itemView.setOnClickListener {
|
||||
onClick.invoke(bean.candidates[0].get(position))
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
|
|
@ -44,4 +47,9 @@ class PerformAdaper(context: Context, bean: DetailActivityBean) : RecyclerView.A
|
|||
var time = itemView.findViewById<TextView>(R.id.time)
|
||||
var num = itemView.findViewById<TextView>(R.id.num)
|
||||
}
|
||||
|
||||
|
||||
fun setOnItemClickListener(onClick: (bean: DetailActivityBean.CandidatesBean) -> Unit) {
|
||||
this.onClick = onClick
|
||||
}
|
||||
}
|
||||
|
|
@ -95,4 +95,8 @@ class SettingActivity : BaseActivity<SettingPresenter>() {
|
|||
supportFragmentManager.beginTransaction().replace(R.id.fragment, fragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
override fun onRestart() {
|
||||
ScreenUtil.setCustomDensity(this)
|
||||
super.onRestart()
|
||||
}
|
||||
}
|
||||
|
|
@ -55,6 +55,10 @@ class SplashActivity : BaseActivity<SplashPresenter>() {
|
|||
startActivity(Intent(this@SplashActivity, HomeActivity::class.java))
|
||||
ActivityManager.getInstance().popActivity(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRestart() {
|
||||
ScreenUtil.setCustomDensity(this)
|
||||
super.onRestart()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.skipping.fragment.pair
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.loop.loopminisdk.LoopDevice
|
||||
import com.skipping.R
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/25/22
|
||||
*
|
||||
*/
|
||||
class PairAdaper(context: Context?,list: List<LoopDevice>) : RecyclerView.Adapter<PairAdaper.Holder>() {
|
||||
var list = list
|
||||
var context = context
|
||||
lateinit var onClick: () -> Unit
|
||||
|
||||
fun setData(list: List<LoopDevice>){
|
||||
this.list = list
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PairAdaper.Holder {
|
||||
return Holder(LayoutInflater.from(context).inflate(R.layout.pair_item, parent, false))
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: PairAdaper.Holder, position: Int) {
|
||||
holder.pair_item_tv1.text = list[position].loopDeviceId.toString()
|
||||
holder.pair_item_tv2.text = list[position].macList.toString()
|
||||
holder.pair_item_tv3.text = list[position].power.toString()
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return list.size
|
||||
}
|
||||
|
||||
class Holder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var pair_item_tv1 = itemView.findViewById<TextView>(R.id.pair_item_tv1)
|
||||
var pair_item_tv2 = itemView.findViewById<TextView>(R.id.pair_item_tv2)
|
||||
var pair_item_tv3 = itemView.findViewById<TextView>(R.id.pair_item_tv3)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +1,16 @@
|
|||
package com.skipping.fragment.pair
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.libs.fragment.BaseFragment
|
||||
import com.libs.utils.LogUtil
|
||||
import com.loop.loopminisdk.LoopDevice
|
||||
import com.loop.loopminisdk.LoopHost
|
||||
import com.loop.loopminisdk.LoopMessage
|
||||
import com.loop.loopminisdk.LoopMini
|
||||
import com.skipping.R
|
||||
import com.skipping.utils.ConnectManager
|
||||
import kotlinx.android.synthetic.main.activity_perform.*
|
||||
import kotlinx.android.synthetic.main.fragment_pair.*
|
||||
|
||||
/**
|
||||
|
|
@ -22,7 +20,9 @@ import kotlinx.android.synthetic.main.fragment_pair.*
|
|||
*/
|
||||
class PairFragment : BaseFragment<PairPresenter>() {
|
||||
var position = 0
|
||||
var deviceList: MutableList<LoopDevice> = ArrayList()
|
||||
lateinit var manager: ConnectManager
|
||||
lateinit var adaper:PairAdaper
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.fragment_pair;
|
||||
|
|
@ -30,7 +30,7 @@ class PairFragment : BaseFragment<PairPresenter>() {
|
|||
|
||||
override fun initView(view: View?, savedInstanceState: Bundle?) {
|
||||
pairStatus.setOnClickListener {
|
||||
manager.pairDevice(1)
|
||||
manager.host
|
||||
}
|
||||
|
||||
pair_btn.setOnClickListener {
|
||||
|
|
@ -57,7 +57,23 @@ class PairFragment : BaseFragment<PairPresenter>() {
|
|||
}
|
||||
|
||||
override fun initData() {
|
||||
manager = ConnectManager.getSingleton(activity)
|
||||
manager = ConnectManager.getSingleton()
|
||||
manager.setLoopHostListener {
|
||||
var bytes = it.macList
|
||||
pair_address.text = "网关地址:" + LoopMini.bytesToHexString(bytes)
|
||||
pair_id.text = "网关id:" + it.hostId.toString()
|
||||
pair_list.layoutManager = LinearLayoutManager(activity)
|
||||
|
||||
for (i in 0..it.license){
|
||||
var device = LoopDevice().apply {
|
||||
this.loopDeviceId = i
|
||||
}
|
||||
deviceList.add(device)
|
||||
}
|
||||
adaper = PairAdaper(activity,deviceList)
|
||||
pair_list.adapter = adaper
|
||||
adaper.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
@ -67,6 +83,6 @@ class PairFragment : BaseFragment<PairPresenter>() {
|
|||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
manager.pause()
|
||||
// manager.pause()
|
||||
}
|
||||
}
|
||||
|
|
@ -8,22 +8,25 @@ import java.io.Serializable;
|
|||
* @author Ming
|
||||
* 3/15/22
|
||||
*/
|
||||
public class ActivityBean implements Serializable {
|
||||
public class ActivityBean{
|
||||
|
||||
|
||||
/**
|
||||
* ID : 13
|
||||
* ID : 11
|
||||
* Name : loop2
|
||||
* ActivityType : timing
|
||||
* Value : 60
|
||||
* OrgID : ae428145b8a466e9c72f6047b8
|
||||
* GreadID : 6b76e9770a4eafbcee213121d4ad6b
|
||||
* GradeID : 6b76e9770a4eafbcee213121d4ad6b
|
||||
* ClassID : 77bba9124a4281bc9f92f965561cd5
|
||||
* Status : 未完成
|
||||
* Step : 2
|
||||
* CompleteTime : null
|
||||
* PersonNumber : 6
|
||||
* GroupID :
|
||||
* CreatedAt : 2022-03-14T08:38:21.495+08:00
|
||||
* CreatedAt : 2022-03-14T08:36:49.881+08:00
|
||||
* GradeName : 101
|
||||
* ClassName : 002
|
||||
*/
|
||||
|
||||
private Integer ID;
|
||||
|
|
@ -31,7 +34,7 @@ public class ActivityBean implements Serializable {
|
|||
private String ActivityType;
|
||||
private Integer Value;
|
||||
private String OrgID;
|
||||
private String GreadID;
|
||||
private String GradeID;
|
||||
private String ClassID;
|
||||
private String Status;
|
||||
private Integer Step;
|
||||
|
|
@ -39,13 +42,15 @@ public class ActivityBean implements Serializable {
|
|||
private Integer PersonNumber;
|
||||
private String GroupID;
|
||||
private String CreatedAt;
|
||||
private String GradeName;
|
||||
private String ClassName;
|
||||
|
||||
public Integer getId() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.ID = id;
|
||||
public void setId(Integer ID) {
|
||||
this.ID = ID;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
@ -80,12 +85,12 @@ public class ActivityBean implements Serializable {
|
|||
OrgID = orgID;
|
||||
}
|
||||
|
||||
public String getGreadID() {
|
||||
return GreadID;
|
||||
public String getGradeID() {
|
||||
return GradeID;
|
||||
}
|
||||
|
||||
public void setGreadID(String greadID) {
|
||||
GreadID = greadID;
|
||||
public void setGradeID(String gradeID) {
|
||||
GradeID = gradeID;
|
||||
}
|
||||
|
||||
public String getClassID() {
|
||||
|
|
@ -144,15 +149,31 @@ public class ActivityBean implements Serializable {
|
|||
CreatedAt = createdAt;
|
||||
}
|
||||
|
||||
public String getGradeName() {
|
||||
return GradeName;
|
||||
}
|
||||
|
||||
public void setGradeName(String gradeName) {
|
||||
GradeName = gradeName;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return ClassName;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
ClassName = className;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ActivityBean{" +
|
||||
"ID=" + ID +
|
||||
"id=" + ID +
|
||||
", Name='" + Name + '\'' +
|
||||
", ActivityType='" + ActivityType + '\'' +
|
||||
", Value=" + Value +
|
||||
", OrgID='" + OrgID + '\'' +
|
||||
", GreadID='" + GreadID + '\'' +
|
||||
", GradeID='" + GradeID + '\'' +
|
||||
", ClassID='" + ClassID + '\'' +
|
||||
", Status='" + Status + '\'' +
|
||||
", Step=" + Step +
|
||||
|
|
@ -160,6 +181,8 @@ public class ActivityBean implements Serializable {
|
|||
", PersonNumber=" + PersonNumber +
|
||||
", GroupID='" + GroupID + '\'' +
|
||||
", CreatedAt='" + CreatedAt + '\'' +
|
||||
", GradeName='" + GradeName + '\'' +
|
||||
", ClassName='" + ClassName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import android.view.View;
|
|||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.libs.fragment.BaseApplication;
|
||||
import com.libs.utils.LogUtil;
|
||||
import com.libs.utils.ToastUtil;
|
||||
import com.loop.loopminisdk.LoopDevice;
|
||||
|
|
@ -38,17 +39,17 @@ public class ConnectManager {
|
|||
private Set<LoopDevice> loopDeviceSet = new HashSet<>();
|
||||
private LoopDevice loopDevice;
|
||||
private LoopHost loopHost;
|
||||
private Activity activity;
|
||||
private Handler mHandler;
|
||||
private int position;
|
||||
private OnLoopHost onLoopHost;
|
||||
private ScheduledFuture scheduledFuture;
|
||||
private static volatile ConnectManager connectManager;
|
||||
|
||||
public static ConnectManager getSingleton(Activity activity) {
|
||||
public static ConnectManager getSingleton() {
|
||||
if (connectManager == null) {
|
||||
synchronized (ThreadPoolUtil.class) {
|
||||
if (connectManager == null) {
|
||||
connectManager = new ConnectManager(activity);
|
||||
connectManager = new ConnectManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -80,8 +81,8 @@ public class ConnectManager {
|
|||
}
|
||||
};
|
||||
|
||||
public ConnectManager(Activity activity) {
|
||||
this.activity = activity;
|
||||
public ConnectManager() {
|
||||
LogUtil.e("创建");
|
||||
mHandler = new DeviceHandler();
|
||||
}
|
||||
|
||||
|
|
@ -184,18 +185,19 @@ public class ConnectManager {
|
|||
|
||||
|
||||
public void pause(){
|
||||
activity.unregisterReceiver(mUsbReceiver);
|
||||
activity.unbindService(usbConnection);
|
||||
LogUtil.e("关闭");
|
||||
BaseApplication.getInstance().unregisterReceiver(mUsbReceiver);
|
||||
BaseApplication.getInstance().unbindService(usbConnection);
|
||||
}
|
||||
|
||||
|
||||
private void startService(ServiceConnection serviceConnection) {
|
||||
if (!LoopMini.SERVICE_CONNECTED) {
|
||||
Intent startService = new Intent(activity, LoopMini.class);
|
||||
activity.startService(startService);
|
||||
Intent startService = new Intent(BaseApplication.getInstance(), LoopMini.class);
|
||||
BaseApplication.getInstance().startService(startService);
|
||||
}
|
||||
Intent bindingIntent = new Intent(activity, LoopMini.class);
|
||||
activity.bindService(bindingIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||
Intent bindingIntent = new Intent(BaseApplication.getInstance(), LoopMini.class);
|
||||
BaseApplication.getInstance().bindService(bindingIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
|
||||
private void setFilters() {
|
||||
|
|
@ -205,7 +207,7 @@ public class ConnectManager {
|
|||
filter.addAction(LoopMini.ACTION_USB_DISCONNECTED);
|
||||
filter.addAction(LoopMini.ACTION_USB_NOT_SUPPORTED);
|
||||
filter.addAction(LoopMini.ACTION_USB_PERMISSION_NOT_GRANTED);
|
||||
activity.registerReceiver(mUsbReceiver, filter);
|
||||
BaseApplication.getInstance().registerReceiver(mUsbReceiver, filter);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -221,6 +223,7 @@ public class ConnectManager {
|
|||
break;
|
||||
case LoopMini.Loop_GET_HOST_INFO:
|
||||
loopHost = (LoopHost) msg.obj;
|
||||
onLoopHost.connected(loopHost);
|
||||
LogUtil.e("LoopHost", loopHost.toString());
|
||||
break;
|
||||
case LoopMini.LOOP_GET_DEVICE_INFO:
|
||||
|
|
@ -240,5 +243,22 @@ public class ConnectManager {
|
|||
loopDeviceSet.add(loopDevice);
|
||||
}
|
||||
|
||||
public Set<LoopDevice> getDevice(){
|
||||
return loopDeviceSet;
|
||||
}
|
||||
|
||||
public void setLoopHostListener(OnLoopHost onLoopHost){
|
||||
this.onLoopHost = onLoopHost;
|
||||
}
|
||||
|
||||
public LoopHost getHost(){
|
||||
return loopHost;
|
||||
}
|
||||
|
||||
|
||||
public interface OnLoopHost{
|
||||
void connected(LoopHost host);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
package com.skipping.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/29/22
|
||||
*/
|
||||
public class NumberUtil {
|
||||
private static String nums[] = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
|
||||
private static String pos_units[] = {"", "十", "百", "千"};
|
||||
private static String weight_units[] = {"", "万", "亿"};
|
||||
|
||||
/**
|
||||
* 数字转汉字【新】
|
||||
*
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String numberToChinese(int num) {
|
||||
if (num == 0) {
|
||||
return "零";
|
||||
}
|
||||
|
||||
int weigth = 0;//节权位
|
||||
String chinese = "";
|
||||
String chinese_section = "";
|
||||
boolean setZero = false;//下一小节是否需要零,第一次没有上一小节所以为false
|
||||
while (num > 0) {
|
||||
int section = num % 10000;//得到最后面的小节
|
||||
if (setZero) {//判断上一小节的千位是否为零,是就设置零
|
||||
chinese = nums[0] + chinese;
|
||||
}
|
||||
chinese_section = sectionTrans(section);
|
||||
if (section != 0) {//判断是都加节权位
|
||||
chinese_section = chinese_section + weight_units[weigth];
|
||||
}
|
||||
chinese = chinese_section + chinese;
|
||||
chinese_section = "";
|
||||
Log.d("TAG", chinese_section);
|
||||
|
||||
setZero = (section < 1000) && (section > 0);
|
||||
num = num / 10000;
|
||||
weigth++;
|
||||
}
|
||||
if ((chinese.length() == 2 || (chinese.length() == 3)) && chinese.contains("一十")) {
|
||||
chinese = chinese.substring(1, chinese.length());
|
||||
}
|
||||
if (chinese.indexOf("一十") == 0) {
|
||||
chinese = chinese.replaceFirst("一十", "十");
|
||||
}
|
||||
|
||||
return chinese;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将每段数字转汉子
|
||||
*
|
||||
* @param section
|
||||
* @return
|
||||
*/
|
||||
public static String sectionTrans(int section) {
|
||||
StringBuilder section_chinese = new StringBuilder();
|
||||
int pos = 0;//小节内部权位的计数器
|
||||
boolean zero = true;//小节内部的置零判断,每一个小节只能有一个零。
|
||||
while (section > 0) {
|
||||
int v = section % 10;//得到最后一个数
|
||||
if (v == 0) {
|
||||
if (!zero) {
|
||||
zero = true;//需要补零的操作,确保对连续多个零只是输出一个
|
||||
section_chinese.insert(0, nums[0]);
|
||||
}
|
||||
} else {
|
||||
zero = false;//有非零数字就把置
|
||||
section_chinese.insert(0, pos_units[pos]);
|
||||
section_chinese.insert(0, nums[v]);
|
||||
}
|
||||
pos++;
|
||||
section = section / 10;
|
||||
}
|
||||
return section_chinese.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.skipping.view.dialog
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.skipping.R
|
||||
import com.skipping.TIMING_NAME
|
||||
import com.skipping.net.ActivityBean
|
||||
import com.skipping.net.DetailActivityBean
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/25/22
|
||||
*
|
||||
*/
|
||||
class DialogAdaper<T>(context: Context, val list: List<DialogBean<T>>) : RecyclerView.Adapter<DialogAdaper.Holder>() {
|
||||
var context = context
|
||||
lateinit var onClick: (bean: DialogBean<T>) -> Unit
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DialogAdaper.Holder {
|
||||
return Holder(LayoutInflater.from(context).inflate(R.layout.dialog_item, parent, false))
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: DialogAdaper.Holder, position: Int) {
|
||||
holder.dialog_item_content.text = list[position].content
|
||||
holder.itemView.setOnClickListener {
|
||||
onClick.invoke(list[position])
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return list.size
|
||||
}
|
||||
|
||||
class Holder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var dialog_item_content = itemView.findViewById<TextView>(R.id.dialog_item_content)
|
||||
}
|
||||
|
||||
|
||||
fun setOnItemClickListener(onClick: (bean: DialogBean<T>) -> Unit) {
|
||||
this.onClick = onClick
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.skipping.view.dialog
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/29/22
|
||||
*
|
||||
*/
|
||||
class DialogBean<T>(val content: String, val bean: T) {
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.skipping.view.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.skipping.R
|
||||
import com.skipping.utils.ThreadPoolUtil
|
||||
import java.util.concurrent.ScheduledFuture
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/29/22
|
||||
*
|
||||
*/
|
||||
class DialogTool(val context: Context) {
|
||||
lateinit var dialog_reset: TextView
|
||||
lateinit var dialog_bttv: TextView
|
||||
lateinit var dialog_btll: LinearLayout
|
||||
lateinit var dialog_iv: ImageView
|
||||
var future: ScheduledFuture<*>? = null
|
||||
|
||||
fun build(status: Status) {
|
||||
val dialog: AlertDialog = AlertDialog.Builder(context, R.style.bubble_dialog_style).create()
|
||||
val view = View.inflate(context, R.layout.dialog_view, null)
|
||||
val dialog_ll = view.findViewById<LinearLayout>(R.id.dialog_ll)
|
||||
dialog_bttv = view.findViewById(R.id.dialog_bttv)
|
||||
dialog_iv = view.findViewById(R.id.dialog_iv)
|
||||
dialog_btll = view.findViewById(R.id.dialog_btll)
|
||||
dialog_reset = view.findViewById(R.id.dialog_reset)
|
||||
when (status) {
|
||||
Status.CONNECTING -> {
|
||||
dialog_btll.visibility = View.GONE
|
||||
dialog_bttv.visibility = View.VISIBLE
|
||||
dialog_iv.visibility = View.VISIBLE
|
||||
loading()
|
||||
}
|
||||
Status.RESET -> {
|
||||
dialog_bttv.visibility = View.GONE
|
||||
dialog_btll.visibility = View.VISIBLE
|
||||
dialog_iv.visibility = View.INVISIBLE
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var lp = dialog_ll.layoutParams
|
||||
lp.width = 630
|
||||
lp.height = 344
|
||||
dialog_ll.layoutParams = lp
|
||||
dialog.setView(view);
|
||||
dialog.setCancelable(true);
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
fun setStatus(status: Status) {
|
||||
when (status) {
|
||||
Status.CONNECTING -> {
|
||||
dialog_btll.visibility = View.GONE
|
||||
dialog_bttv.visibility = View.VISIBLE
|
||||
dialog_iv.visibility = View.VISIBLE
|
||||
loading()
|
||||
}
|
||||
Status.RESET -> {
|
||||
dialog_bttv.visibility = View.GONE
|
||||
dialog_btll.visibility = View.VISIBLE
|
||||
dialog_iv.visibility = View.INVISIBLE
|
||||
stopLoading()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun loading() {
|
||||
future = ThreadPoolUtil.getSingleton().scheduleWithFixedDelayMain({
|
||||
dialog_iv.animate().setInterpolator(LinearInterpolator()).rotationBy(90f).duration = 500
|
||||
}, 0, 500)
|
||||
}
|
||||
|
||||
fun stopLoading() {
|
||||
if (future != null) {
|
||||
future?.cancel(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun <T> buildList(activity: Activity, list: List<DialogBean<T>>, onClick: (bean: DialogBean<T>) -> Unit): AlertDialog {
|
||||
val dialog: AlertDialog = AlertDialog.Builder(context, R.style.bubble_dialog_style).create()
|
||||
val view = View.inflate(context, R.layout.dialog_view_list, null)
|
||||
val dialog_list_ll = view.findViewById<LinearLayout>(R.id.dialog_list_ll)
|
||||
val recyclerview = view.findViewById<RecyclerView>(R.id.recyclerview)
|
||||
recyclerview.layoutManager = LinearLayoutManager(activity)
|
||||
var adaper = DialogAdaper(activity, list)
|
||||
adaper.setOnItemClickListener(onClick)
|
||||
recyclerview.adapter = adaper
|
||||
var lp = dialog_list_ll.layoutParams
|
||||
lp.width = 630
|
||||
lp.height = 344
|
||||
dialog_list_ll.layoutParams = lp
|
||||
dialog.setView(view);
|
||||
dialog.setCancelable(true);
|
||||
dialog.show()
|
||||
return dialog
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.skipping.view.dialog
|
||||
|
||||
/**
|
||||
* @author Ming
|
||||
* 3/29/22
|
||||
*
|
||||
*/
|
||||
enum class Status {
|
||||
CONNECTING,RESET
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/whitePure" />
|
||||
<corners android:radius="30dp" />
|
||||
</shape>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/whitePure" />
|
||||
<stroke android:width="2dp"
|
||||
android:color="@color/color_3d3d3d"/>
|
||||
<corners android:radius="30dp" />
|
||||
</shape>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="30dp" />
|
||||
<solid android:color="@color/color_1296DB" />
|
||||
</shape>
|
||||
|
|
@ -73,16 +73,26 @@
|
|||
android:textColor="@color/black"
|
||||
android:textSize="28dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/begin_list"
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/begin_listRL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_marginLeft="150dp"
|
||||
android:paddingRight="30dp"
|
||||
android:paddingBottom="30dp"
|
||||
android:text="第一组"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28dp" />
|
||||
android:paddingBottom="30dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/begin_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="30dp"
|
||||
android:paddingBottom="30dp"
|
||||
android:text="第一组"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingTop="30dp"
|
||||
android:paddingRight="30dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_item_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@color/color_50_D8D8D8"
|
||||
android:layout_height="2dp"/>
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/dialog_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="手柄配对操作"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="28dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="当前操作手柄编号:1"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="按住手柄上的配对按钮进行配对"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dialog_iv"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/load"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_btll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_reset"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="@drawable/dialog_ok"
|
||||
android:gravity="center"
|
||||
android:text="重试"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_cancel"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="@drawable/dialog_cancel"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="24dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_bttv"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/dialog_ok"
|
||||
android:gravity="center"
|
||||
android:text="配对中"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/dialog_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dialog_list_ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="34dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="手柄配对操作"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="28dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="14dp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="34dp"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -37,21 +37,23 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pair_address"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="网关地址:"
|
||||
android:textColor="@color/color_50_3d3d3d"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pair_id"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="网关id:"
|
||||
android:textColor="@color/color_50_3d3d3d"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
|
||||
|
||||
|
|
@ -141,4 +143,9 @@
|
|||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/pair_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:gravity="center"
|
||||
android:padding="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pair_item_tv1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pair_item_tv2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pair_item_tv3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_3d3d3d"
|
||||
android:textSize="20dp" />
|
||||
</LinearLayout>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 956 B |
Binary file not shown.
|
After Width: | Height: | Size: 956 B |
Binary file not shown.
|
After Width: | Height: | Size: 956 B |
Loading…
Reference in New Issue