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
c9530f13
Commit
c9530f13
authored
Jul 13, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改出游人选择的bug
parent
48ef05e2
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
136 deletions
+148
-136
TravelerListAdapter.java
.../main/java/com/rv/rvmine/adapter/TravelerListAdapter.java
+5
-25
ChooseAVisitorActivity.java
...n/java/com/rv/rvmine/traveler/ChooseAVisitorActivity.java
+127
-99
common_icon_select.png
...e_mine/src/main/res/drawable-xhdpi/common_icon_select.png
+0
-0
common_icon_unselect.png
...mine/src/main/res/drawable-xhdpi/common_icon_unselect.png
+0
-0
rv_item_traveler_list.xml
module_mine/src/main/res/layout/rv_item_traveler_list.xml
+3
-6
TravelerConfirmOrderActivity.java
...va/com/rv/tourism/other/TravelerConfirmOrderActivity.java
+13
-6
No files found.
module_mine/src/main/java/com/rv/rvmine/adapter/TravelerListAdapter.java
View file @
c9530f13
...
...
@@ -3,7 +3,6 @@ package com.rv.rvmine.adapter;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.Toast
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
...
...
@@ -39,14 +38,14 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
).
setVisibility
(
View
.
GONE
);
}
else
{
if
(
item
.
getStatus
())
{
helper
.
set
Checked
(
R
.
id
.
cb_draveler
,
true
);
helper
.
set
ImageResource
(
R
.
id
.
cb_draveler
,
R
.
drawable
.
common_icon_select
);
}
else
{
helper
.
set
Checked
(
R
.
id
.
cb_draveler
,
false
);
helper
.
set
ImageResource
(
R
.
id
.
cb_draveler
,
R
.
drawable
.
common_icon_unselect
);
}
helper
.
setOnCheckedChangeListener
(
R
.
id
.
cb_draveler
,
new
CompoundButton
.
OnCheckedChange
Listener
()
{
helper
.
itemView
.
setOnClickListener
(
new
View
.
OnClick
Listener
()
{
@Override
public
void
onC
heckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
public
void
onC
lick
(
View
view
)
{
boolean
status
=
item
.
getStatus
();
boolean
result
=
false
;
if
(
mListener
!=
null
)
{
...
...
@@ -58,26 +57,7 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
}
else
{
mListener
.
showError
();
}
((
CheckBox
)
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
)).
setChecked
(
status
);
}
});
helper
.
itemView
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
// ((CheckBox)helper.itemView.findViewById(R.id.cb_draveler)).setChecked(item.getStatus());
// boolean status = item.getStatus();
// boolean result = false;
// if (mListener != null) {
// result = mListener.select(item, status ? 0 : 1);
// }
// if (result) { // 动作成功
// status = !status;
// item.setStatus(status);
// } else {
// mListener.showError();
// }
((
CheckBox
)
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
)).
setChecked
(!
item
.
getStatus
());
helper
.
setImageResource
(
R
.
id
.
cb_draveler
,
status
?
R
.
drawable
.
common_icon_select
:
R
.
drawable
.
common_icon_unselect
);
}
});
}
...
...
module_mine/src/main/java/com/rv/rvmine/traveler/ChooseAVisitorActivity.java
View file @
c9530f13
This diff is collapsed.
Click to expand it.
module_mine/src/main/res/drawable-xhdpi/common_icon_select.png
0 → 100644
View file @
c9530f13
541 Bytes
module_mine/src/main/res/drawable-xhdpi/common_icon_unselect.png
0 → 100644
View file @
c9530f13
466 Bytes
module_mine/src/main/res/layout/rv_item_traveler_list.xml
View file @
c9530f13
...
...
@@ -17,13 +17,10 @@
android:layout_marginBottom=
"@dimen/size_15"
android:orientation=
"horizontal"
>
<CheckBox
android:checked=
"false"
android:focusable=
"false"
android:focusableInTouchMode=
"false"
<ImageView
android:id=
"@+id/cb_draveler"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
@dimen/size_15
"
android:layout_height=
"
@dimen/size_15
"
android:layout_gravity=
"center_vertical"
/>
<LinearLayout
...
...
module_tourism/src/main/java/com/rv/tourism/other/TravelerConfirmOrderActivity.java
View file @
c9530f13
...
...
@@ -8,6 +8,7 @@ import android.support.annotation.Nullable;
import
android.support.v4.widget.PopupWindowCompat
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -150,7 +151,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
double
childPrice
=
dataBean
.
getChildPrice
();
double
adultPrice
=
dataBean
.
getPrice
();
price
=
Arith
.
mul
(
Double
.
valueOf
(
childNum
),
Double
.
valueOf
(
childPrice
))
+
Arith
.
mul
(
Double
.
valueOf
(
adultNum
),
Double
.
valueOf
(
adultPrice
));
tvPaymentAmount
.
setText
(
String
.
format
(
"¥%1$s"
,
new
BigDecimal
(
price
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()));
tvPaymentAmount
.
setText
(
String
.
format
(
"¥%1$s"
,
new
BigDecimal
(
price
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()));
for
(
int
i
=
0
;
i
<
Integer
.
valueOf
(
dataBean
.
getAdultNum
());
i
++)
{
BeanVisitorInformation
travelMember
=
new
BeanVisitorInformation
();
...
...
@@ -175,18 +176,24 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
mPosition
=
position
;
tourist
=
(
BeanVisitorInformation
)
adapter
.
getItem
(
position
);
StringBuffer
buffer
=
new
StringBuffer
();
StringBuffer
bufferAdults
=
new
StringBuffer
();
StringBuffer
bufferChilds
=
new
StringBuffer
();
for
(
BeanVisitorInformation
information
:
mVisitorInformationAdapter
.
getData
())
{
if
(
information
!=
null
)
{
buffer
.
append
(
information
.
getIdCard
())
.
append
(
";"
);
if
(
"0"
.
equals
(
information
.
getIsChild
())
&&
!
TextUtils
.
isEmpty
(
information
.
getId
()))
{
bufferAdults
.
append
(
information
.
getId
()).
append
(
";"
);
}
else
if
(
"1"
.
equals
(
information
.
getIsChild
())
&&
!
TextUtils
.
isEmpty
(
information
.
getId
()))
{
bufferChilds
.
append
(
information
.
getId
()).
append
(
";"
);
}
}
}
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_CHOOSEAVISITOR
)
.
withInt
(
"adult_number"
,
Integer
.
valueOf
(
dataBean
.
getAdultNum
()))
.
withInt
(
"child_number"
,
Integer
.
valueOf
(
dataBean
.
getChildNum
()))
.
withString
(
"hasChoiceAdults"
,
bufferAdults
.
length
()
==
0
?
""
:
bufferAdults
.
substring
(
0
,
bufferAdults
.
length
()
-
1
))
.
withString
(
"hasChoiceChilds"
,
bufferChilds
.
length
()
==
0
?
""
:
bufferChilds
.
substring
(
0
,
bufferChilds
.
length
()
-
1
))
.
withInt
(
"openType"
,
1
)
.
withString
(
"hasChoice"
,
buffer
.
toString
())
.
navigation
(
mActivity
,
104
);
}
});
...
...
@@ -296,7 +303,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
childrenBean3
.
setVal
(
"¥"
+
info
.
getData
().
getInsurePrice
()
*
(
adultNum
+
childNum
)
*
day
);
childrenBeanList
.
add
(
childrenBean3
);
tvPaymentAmount
.
setText
(
String
.
format
(
"¥%1$s"
,
new
BigDecimal
(
price
+
(
info
.
getData
().
getInsurePrice
()
*
(
adultNum
+
childNum
)
*
day
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()));
tvPaymentAmount
.
setText
(
String
.
format
(
"¥%1$s"
,
new
BigDecimal
(
price
+
(
info
.
getData
().
getInsurePrice
()
*
(
adultNum
+
childNum
)
*
day
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()));
}
else
{
tvPaymentAmount
.
setText
(
String
.
format
(
"¥%1$s"
,
new
BigDecimal
(
price
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()));
}
...
...
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