Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
2dd5c457
Commit
2dd5c457
authored
Jul 23, 2021
by
jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜品点击事件
parent
298d6949
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
42 deletions
+32
-42
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/NewSupplierPresenter.java
+1
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishProvider.java
+6
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesGroupNode.java
+0
-10
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesGroupProvider.java
+5
-2
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesTreeAdapter.java
+2
-1
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
+15
-24
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/NewFoodIngredientsFragment.java
+1
-1
component-supply-chain/src/main/res/values/strings.xml
+2
-1
No files found.
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/presenter/NewSupplierPresenter.java
View file @
2dd5c457
...
...
@@ -557,7 +557,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
}
//預計發貨時間
String
expect
=
infoMultiBeans
.
get
(
expectIndex
).
getShowValue
();
LogUtil
.
e
(
"zjs expect="
+
expect
);
//
LogUtil.e("zjs expect="+expect);
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
expect
))
{
supplierInfoBean
.
setDeliveryTime
(
Double
.
parseDouble
(
expect
));
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishProvider.java
View file @
2dd5c457
...
...
@@ -5,6 +5,7 @@ import android.view.View;
import
com.chad.library.adapter.base.entity.node.BaseNode
;
import
com.chad.library.adapter.base.provider.BaseNodeProvider
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.utils.log.LogUtil
;
import
com.gingersoft.supply_chain.R
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -24,8 +25,7 @@ public class DishProvider extends BaseNodeProvider {
public
void
convert
(
@NotNull
BaseViewHolder
helper
,
@NotNull
BaseNode
data
)
{
DishNode
entity
=
(
DishNode
)
data
;
helper
.
setText
(
R
.
id
.
tv_dish_title
,
entity
.
getFoodName
());
// LogUtil.e("zjs"," entity.isExpanded()="+entity.isExpanded());
LogUtil
.
e
(
"zjs"
,
"isExpanded()="
+
entity
.
isExpanded
()+
" getFoodName"
+
entity
.
getFoodName
());
// if (entity.isExpanded()) {
// helper.setImageResource(R.id.iv_dishes_group_icon, R.drawable.ic_dishes_up);
// } else {
...
...
@@ -36,10 +36,13 @@ public class DishProvider extends BaseNodeProvider {
@Override
public
void
onClick
(
@NotNull
BaseViewHolder
helper
,
@NotNull
View
view
,
BaseNode
data
,
int
position
)
{
DishNode
entity
=
(
DishNode
)
data
;
LogUtil
.
e
(
"zjs"
,
" onClick entity.isExpanded()="
+
entity
.
toString
());
if
(
entity
.
isExpanded
())
{
getAdapter
().
collapse
(
position
);
}
else
{
getAdapter
().
expandAndCollapseOther
(
position
);
}
}
}
\ No newline at end of file
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesGroupNode.java
View file @
2dd5c457
...
...
@@ -19,16 +19,6 @@ public class DishesGroupNode extends BaseExpandNode{
private
List
<
DishNode
>
child
;
private
List
<
BaseNode
>
childNode
;
public
DishesGroupNode
(
int
id
,
int
parentId
,
int
restaurantId
,
boolean
isParent
,
int
seqNo
,
String
foodName
)
{
this
.
id
=
id
;
this
.
parentId
=
parentId
;
this
.
restaurantId
=
restaurantId
;
this
.
isParent
=
isParent
;
this
.
seqNo
=
seqNo
;
this
.
foodName
=
foodName
;
}
public
List
<
DishNode
>
getDishNodes
()
{
return
child
;
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesGroupProvider.java
View file @
2dd5c457
...
...
@@ -33,8 +33,11 @@ public class DishesGroupProvider extends BaseNodeProvider {
public
void
convert
(
@NotNull
BaseViewHolder
baseViewHolder
,
BaseNode
baseNode
)
{
DishesGroupNode
entity
=
(
DishesGroupNode
)
baseNode
;
baseViewHolder
.
setText
(
R
.
id
.
tv_dishes_group_title
,
entity
.
getFoodName
());
baseViewHolder
.
setImageResource
(
R
.
id
.
iv_dishes_group_icon
,
R
.
drawable
.
ic_dishes_down
);
if
(
entity
.
isExpanded
())
{
baseViewHolder
.
setImageResource
(
R
.
id
.
iv_dishes_group_icon
,
R
.
drawable
.
ic_dishes_up
);
}
else
{
baseViewHolder
.
setImageResource
(
R
.
id
.
iv_dishes_group_icon
,
R
.
drawable
.
ic_dishes_down
);
}
setArrowSpin
(
baseViewHolder
,
baseNode
,
false
);
}
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/dishes/DishesTreeAdapter.java
View file @
2dd5c457
...
...
@@ -2,6 +2,7 @@ package com.gingersoft.supply_chain.mvp.ui.adapter.dishes;
import
com.chad.library.adapter.base.BaseNodeAdapter
;
import
com.chad.library.adapter.base.entity.node.BaseNode
;
import
com.gingersoft.supply_chain.R
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -14,7 +15,7 @@ public class DishesTreeAdapter extends BaseNodeAdapter {
super
();
addNodeProvider
(
new
DishesGroupProvider
());
addNodeProvider
(
new
DishProvider
());
addChildClickViewIds
(
R
.
id
.
tv_dish_title
);
}
@Override
protected
int
getItemType
(
@NotNull
List
<?
extends
BaseNode
>
list
,
int
i
)
{
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/DishesFragment.java
View file @
2dd5c457
...
...
@@ -11,6 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.chad.library.adapter.base.entity.node.BaseNode
;
import
com.gingersoft.gsa.cloud.common.utils.log.LogUtil
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerDishesComponent
;
...
...
@@ -21,11 +22,9 @@ import com.gingersoft.supply_chain.mvp.presenter.DishesPresenter;
import
com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishNode
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishesGroupNode
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.dishes.DishesTreeAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.widget.CenterLayoutManager
;
import
com.jess.arms.di.component.AppComponent
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
java.util.ArrayList
;
import
java.util.List
;
import
butterknife.BindView
;
...
...
@@ -74,33 +73,25 @@ public class DishesFragment extends BaseSupplyChainFragment<DishesPresenter> imp
}
private
void
initDishes
(
List
<
DishesGroupNode
>
dishesGroupNodes
){
DishesTreeAdapter
dishesTreeAdapter
=
new
DishesTreeAdapter
();
final
DishesTreeAdapter
dishesTreeAdapter
=
new
DishesTreeAdapter
();
dishesTreeAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
BaseNode
baseNode
=
dishesTreeAdapter
.
getItem
(
position
);
if
(
baseNode
instanceof
DishesGroupNode
)
{
DishesGroupNode
groupNode
=
(
DishesGroupNode
)
baseNode
;
LogUtil
.
e
(
"ZJS"
,
" groupNode position="
+
position
+
" getFoodName"
+
groupNode
.
getFoodName
());
}
else
{
DishNode
dishNode
=
(
DishNode
)
baseNode
;
LogUtil
.
e
(
"ZJS"
,
" onItemChildClick position="
+
position
+
" getFoodName"
+
dishNode
.
getFoodName
());
}
LogUtil
.
e
(
"ZJS"
,
" onItemChildClick position="
+
position
);
});
dishesTreeAdapter
.
setList
(
dishesGroupNodes
);
rvDishesGroup
.
setLayoutManager
(
new
LinearLayoutManager
(
requireContext
(),
LinearLayoutManager
.
VERTICAL
,
false
));
rvDishesGroup
.
setAdapter
(
dishesTreeAdapter
);
}
private
List
<
BaseNode
>
getEntity
()
{
List
<
BaseNode
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
List
<
BaseNode
>
secondNodeList
=
new
ArrayList
<>();
for
(
int
n
=
0
;
n
<=
3
;
n
++)
{
DishNode
seNode
=
new
DishNode
(
secondNodeList
);
secondNodeList
.
add
(
seNode
);
}
DishesGroupNode
entity
=
new
DishesGroupNode
(
secondNodeList
);
// 模拟 默认第0个是展开的
entity
.
setExpanded
(
i
==
0
);
list
.
add
(
entity
);
}
return
list
;
}
@Override
public
void
loadDishGroupInfo
(
List
<
DishesGroupNode
>
dishGroup
)
{
initDishes
(
dishGroup
);
...
...
component-supply-chain/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/food/NewFoodIngredientsFragment.java
View file @
2dd5c457
...
...
@@ -171,7 +171,7 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
@Override
public
void
initAdapter
()
{
infoMultiAdapter
=
new
InfoMultiAdapter
(
mContext
,
mPresenter
.
getFragmentInfo
(
mContext
,
(
v
,
hasFocus
)
->
{
LogUtil
.
e
(
"zjs"
,
" initAdapter currentThread "
+
v
.
isPressed
()+
" hasFocus__"
+
v
.
hasFocus
()+
" hasFocus=="
+
hasFocus
);
//
LogUtil.e("zjs"," initAdapter currentThread "+v.isPressed()+" hasFocus__"+v.hasFocus()+" hasFocus=="+hasFocus);
if
(
hasFocus
&&
purchaseFoodBean
!=
null
&&
purchaseFoodBean
.
getUnitPrice
()>
0
)
{
InfoMultiBean
infoMultiBean
=
infoMultiAdapter
.
getItem
(
12
);
infoMultiBean
.
setShowValue
(
""
);
...
...
component-supply-chain/src/main/res/values/strings.xml
View file @
2dd5c457
...
...
@@ -100,5 +100,5 @@
<string
name=
"str_order_del_contact_supplier"
>
訂單已刪除,請打電話聯繫供應商訂單刪除!
</string>
<string
name=
"str_order_num"
>
單號:%1$s
</string>
<string
name=
"str_dishes"
>
菜单
</string>
<string
name=
"str_dishes"
>
成品管理
</string>
</resources>
\ No newline at end of file
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