Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RvApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lify
RvApp
Commits
12ec70de
Commit
12ec70de
authored
Jul 12, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改出游人显示排序维问题;修改驾驶人选择逻辑
parent
c59fc4ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
18 deletions
+49
-18
DrivingListActivity.java
...m/rv/home/rv/module/ui/main/home/DrivingListActivity.java
+9
-6
DrivingListAdapter.java
...me/rv/module/ui/main/home/adapter/DrivingListAdapter.java
+26
-12
ChooseAVisitorActivity.java
...n/java/com/rv/rvmine/traveler/ChooseAVisitorActivity.java
+14
-0
No files found.
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/DrivingListActivity.java
View file @
12ec70de
...
@@ -36,6 +36,7 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
...
@@ -36,6 +36,7 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
private
final
int
TYPE_REQUEST_EDIT
=
2
;
private
final
int
TYPE_REQUEST_EDIT
=
2
;
private
int
mPage
;
private
int
mPage
;
private
int
countPage
;
private
int
countPage
;
private
int
openType
;
private
DrivingListBean
.
DataBeanX
.
DataBean
dataBean
;
private
DrivingListBean
.
DataBeanX
.
DataBean
dataBean
;
public
static
Intent
getIntent
(
Context
context
,
DrivingListBean
.
DataBeanX
.
DataBean
dataBean
)
{
public
static
Intent
getIntent
(
Context
context
,
DrivingListBean
.
DataBeanX
.
DataBean
dataBean
)
{
...
@@ -60,16 +61,18 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
...
@@ -60,16 +61,18 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
}
}
});
});
mAdapter
=
new
DrivingListAdapter
();
mAdapter
=
new
DrivingListAdapter
(
dataBean
!=
null
);
mAdapter
.
setOnLoadMoreListener
(
this
,
recyclerView
);
mAdapter
.
setOnLoadMoreListener
(
this
,
recyclerView
);
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
recyclerView
.
setAdapter
(
mAdapter
);
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
mAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
getIntent
().
putExtra
(
"bean"
,
mAdapter
.
getItem
(
position
));
if
(
dataBean
!=
null
)
{
setResult
(
RESULT_OK
,
getIntent
());
getIntent
().
putExtra
(
"bean"
,
mAdapter
.
getItem
(
position
));
finish
();
setResult
(
RESULT_OK
,
getIntent
());
finish
();
}
}
}
});
});
...
@@ -78,7 +81,7 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
...
@@ -78,7 +81,7 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
if
(
view
.
getId
()
==
R
.
id
.
tv_edit
)
{
if
(
view
.
getId
()
==
R
.
id
.
tv_edit
)
{
startActivityForResult
(
DrivingUploadActivity
.
getIntent
(
mActivity
,
mAdapter
.
getItem
(
position
)),
TYPE_REQUEST_ADD
);
startActivityForResult
(
DrivingUploadActivity
.
getIntent
(
mActivity
,
mAdapter
.
getItem
(
position
)),
TYPE_REQUEST_ADD
);
}
else
if
(
view
.
getId
()
==
R
.
id
.
cb_driving
)
{
}
else
if
(
view
.
getId
()
==
R
.
id
.
cb_driving
)
{
getIntent
().
putExtra
(
"bean"
,
mAdapter
.
getItem
(
position
));
getIntent
().
putExtra
(
"bean"
,
mAdapter
.
getItem
(
position
));
setResult
(
RESULT_OK
,
getIntent
());
setResult
(
RESULT_OK
,
getIntent
());
finish
();
finish
();
...
@@ -154,7 +157,7 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
...
@@ -154,7 +157,7 @@ public class DrivingListActivity extends BaseStatusActivity<CommonPresenter> imp
for
(
int
i
=
0
;
i
<
bean
.
getData
().
getData
().
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
bean
.
getData
().
getData
().
size
();
i
++)
{
if
(
dataBean
!=
null
)
{
if
(
dataBean
!=
null
)
{
if
(
dataBean
.
getId
()
==
bean
.
getData
().
getData
().
get
(
i
).
getId
())
{
if
(
dataBean
.
getId
()
==
bean
.
getData
().
getData
().
get
(
i
).
getId
())
{
bean
.
getData
().
getData
().
get
(
i
).
setCheck
(
true
);
bean
.
getData
().
getData
().
get
(
i
).
setCheck
(
true
);
}
}
}
}
}
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/DrivingListAdapter.java
View file @
12ec70de
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
adapter
;
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
adapter
;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.CompoundButton
;
...
@@ -22,8 +23,12 @@ import io.reactivex.functions.Consumer;
...
@@ -22,8 +23,12 @@ import io.reactivex.functions.Consumer;
*/
*/
public
class
DrivingListAdapter
extends
BaseQuickAdapter
<
DrivingListBean
.
DataBeanX
.
DataBean
,
BaseViewHolder
>
{
public
class
DrivingListAdapter
extends
BaseQuickAdapter
<
DrivingListBean
.
DataBeanX
.
DataBean
,
BaseViewHolder
>
{
public
DrivingListAdapter
()
{
private
boolean
isShowSelect
=
false
;
public
DrivingListAdapter
(
boolean
b
)
{
super
(
R
.
layout
.
rv_item_driving_list
);
super
(
R
.
layout
.
rv_item_driving_list
);
this
.
isShowSelect
=
b
;
}
}
@Override
@Override
...
@@ -33,9 +38,16 @@ public class DrivingListAdapter extends BaseQuickAdapter<DrivingListBean.DataBea
...
@@ -33,9 +38,16 @@ public class DrivingListAdapter extends BaseQuickAdapter<DrivingListBean.DataBea
helper
.
setText
(
R
.
id
.
tv_id_card
,
item
.
getIdCard
());
helper
.
setText
(
R
.
id
.
tv_id_card
,
item
.
getIdCard
());
if
(
item
.
isCheck
())
{
if
(
item
.
isCheck
())
{
helper
.
setChecked
(
R
.
id
.
cb_driving
,
true
);
helper
.
setChecked
(
R
.
id
.
cb_driving
,
true
);
}
else
{
}
else
{
helper
.
setChecked
(
R
.
id
.
cb_driving
,
false
);
helper
.
setChecked
(
R
.
id
.
cb_driving
,
false
);
}
}
if
(
isShowSelect
)
{
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_driving
).
setVisibility
(
View
.
VISIBLE
);
}
else
{
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_driving
).
setVisibility
(
View
.
GONE
);
}
helper
.
addOnClickListener
(
R
.
id
.
tv_edit
);
helper
.
addOnClickListener
(
R
.
id
.
tv_edit
);
helper
.
addOnClickListener
(
R
.
id
.
cb_driving
);
helper
.
addOnClickListener
(
R
.
id
.
cb_driving
);
helper
.
setOnCheckedChangeListener
(
R
.
id
.
cb_driving
,
new
CompoundButton
.
OnCheckedChangeListener
()
{
helper
.
setOnCheckedChangeListener
(
R
.
id
.
cb_driving
,
new
CompoundButton
.
OnCheckedChangeListener
()
{
...
@@ -47,31 +59,33 @@ public class DrivingListAdapter extends BaseQuickAdapter<DrivingListBean.DataBea
...
@@ -47,31 +59,33 @@ public class DrivingListAdapter extends BaseQuickAdapter<DrivingListBean.DataBea
});
});
}
}
public
int
getPosition
(
DrivingListBean
.
DataBeanX
.
DataBean
item
){
public
int
getPosition
(
DrivingListBean
.
DataBeanX
.
DataBean
item
)
{
return
mData
.
indexOf
(
item
);
return
mData
.
indexOf
(
item
);
}
}
/**
/**
* 设置驾驶员选中状态
* 设置驾驶员选中状态
*
* @param check
* @param check
* @param position
* @param position
*/
*/
public
void
setItemState
(
boolean
check
,
int
position
)
{
public
void
setItemState
(
boolean
check
,
int
position
)
{
mData
.
get
(
position
).
selectType
=
check
==
true
?
1
:
0
;
mData
.
get
(
position
).
selectType
=
check
==
true
?
1
:
0
;
notifyItemChanged
(
position
);
notifyItemChanged
(
position
);
}
}
/**
/**
* 获取选中的驾驶员数据
* 获取选中的驾驶员数据
*
* @return
* @return
*/
*/
public
List
<
DrivingListBean
.
DataBeanX
.
DataBean
>
getSelectItem
(){
public
List
<
DrivingListBean
.
DataBeanX
.
DataBean
>
getSelectItem
()
{
List
<
DrivingListBean
.
DataBeanX
.
DataBean
>
list
=
new
ArrayList
<>();
List
<
DrivingListBean
.
DataBeanX
.
DataBean
>
list
=
new
ArrayList
<>();
for
(
DrivingListBean
.
DataBeanX
.
DataBean
dataBean:
mData
)
{
for
(
DrivingListBean
.
DataBeanX
.
DataBean
dataBean
:
mData
)
{
if
(
dataBean
.
selectType
==
1
)
{
if
(
dataBean
.
selectType
==
1
)
{
list
.
add
(
dataBean
);
list
.
add
(
dataBean
);
}
}
}
}
return
list
;
return
list
;
}
}
...
...
module_mine/src/main/java/com/rv/rvmine/traveler/ChooseAVisitorActivity.java
View file @
12ec70de
...
@@ -15,6 +15,7 @@ import android.widget.Toast;
...
@@ -15,6 +15,7 @@ import android.widget.Toast;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.base.utils.tools.java.DateUtil
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.url.Constance
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.frame.rv.config.RvFrameConfig
;
...
@@ -35,7 +36,10 @@ import com.rv.rvmine.bean.TravelerListBean;
...
@@ -35,7 +36,10 @@ import com.rv.rvmine.bean.TravelerListBean;
import
com.rv.rvmine.view.DeletePopupWindow
;
import
com.rv.rvmine.view.DeletePopupWindow
;
import
com.yuyife.okgo.OkGoUtil
;
import
com.yuyife.okgo.OkGoUtil
;
import
java.sql.Array
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -283,6 +287,16 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -283,6 +287,16 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
visitors
.
add
(
b
);
visitors
.
add
(
b
);
}
}
Collections
.
sort
(
visitors
,
new
Comparator
<
TravelerListBean
.
DataBean
>()
{
@Override
public
int
compare
(
TravelerListBean
.
DataBean
bean
,
TravelerListBean
.
DataBean
t1
)
{
long
crT
=
Long
.
valueOf
(
bean
.
getCrtTime
());
long
crT1
=
Long
.
valueOf
(
t1
.
getCrtTime
());
return
(
int
)
(
crT1
-
crT
);
}
});
if
(
visitors
.
isEmpty
())
{
if
(
visitors
.
isEmpty
())
{
mAdapter
.
setEmptyView
(
getEmptyView
(
recyclerView
,
-
1
,
"您还没有出游人信息哦"
));
mAdapter
.
setEmptyView
(
getEmptyView
(
recyclerView
,
-
1
,
"您还没有出游人信息哦"
));
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment