Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7f2814b4
authored
Jul 02, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加地址导航
parent
1df39665
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
16 deletions
baseSDK/src/main/res/values/strings.xml
locationComponent/src/main/java/com/dayu/location/base/LocationUtils.java
locationComponent/src/main/res/values/strings.xml
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderAdapter.java
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
baseSDK/src/main/res/values/strings.xml
View file @
7f2814b4
...
...
@@ -350,8 +350,6 @@
<string
name=
"process_order_success"
>
提交验收成功
</string>
<string
name=
"signature_name"
>
请先签名!
</string>
<string
name=
"click_and_signature"
>
点击此处让客户去签名
</string>
<string
name=
"install_gd_map"
>
请先安装高德地图
</string>
<!--消息-->
<string
name=
"message_system"
>
系统通知
</string>
...
...
locationComponent/src/main/java/com/dayu/location/base/LocationUtils.java
View file @
7f2814b4
package
com
.
dayu
.
location
.
base
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Handler
;
import
android.widget.Toast
;
import
com.amap.api.location.AMapLocation
;
import
com.amap.api.location.AMapLocationClient
;
import
com.amap.api.location.AMapLocationClientOption
;
import
com.amap.api.location.AMapLocationListener
;
import
com.dayu.location.R
;
import
java.io.File
;
/**
...
...
@@ -124,4 +129,21 @@ public class LocationUtils {
public
static
void
stop
()
{
mlocationClient
.
stopLocation
();
}
private
static
boolean
isInstallPackage
()
{
return
new
File
(
"/data/data/"
+
"com.autonavi.minimap"
).
exists
();
}
public
static
void
openMap
(
Context
mContext
,
String
address
){
if
(
isInstallPackage
())
{
Intent
intent
=
new
Intent
(
"android.intent.action.VIEW"
,
android
.
net
.
Uri
.
parse
(
"androidamap://poi?sourceApplication=softname&keywords="
+
address
));
intent
.
setPackage
(
"com.autonavi.minimap"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
mContext
.
startActivity
(
intent
);
}
else
{
Toast
.
makeText
(
mContext
,
R
.
string
.
install_gd_map
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
locationComponent/src/main/res/values/strings.xml
View file @
7f2814b4
<resources>
<string
name=
"app_name"
>
LocationLibrary
</string>
<string
name=
"install_gd_map"
>
请先安装高德地图
</string>
</resources>
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderAdapter.java
View file @
7f2814b4
...
...
@@ -67,15 +67,18 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
private
void
initData
(
FragmentOrderdoingItemBinding
holder
,
Order
item
,
int
position
)
throws
Exception
{
boolean
haveCustomer
=
true
;
String
address
=
item
.
getProvinceName
()
+
item
.
getCityName
()
+
item
.
getDistrictName
()
+
item
.
getAddress
();
holder
.
itemTextWeixiuLeixing
.
setText
(
item
.
getCategoryName
());
holder
.
itemTextWeixiu
.
setText
(
item
.
getProviderName
());
holder
.
itemTextDizhi
.
setText
(
item
.
getProvinceName
()
+
item
.
getCityName
()
+
item
.
getDistrictName
()
+
item
.
getAddress
());
holder
.
itemTextDizhi
.
setText
(
address
);
holder
.
tvErrorState
.
setVisibility
(
View
.
GONE
);
holder
.
itemUpdataTime
.
setVisibility
(
View
.
VISIBLE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
VISIBLE
);
holder
.
orderLineTwo
.
setVisibility
(
View
.
VISIBLE
);
holder
.
tvItemProcess
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemTextDizhi
.
setOnClickListener
(
v
->
LocationUtils
.
openMap
(
mContext
,
address
));
final
int
id
=
item
.
getId
();
if
(
item
.
getAnyContacts
()
==
0
)
{
holder
.
itemTextUserName
.
setText
(
mContext
.
getString
(
R
.
string
.
no_customer
));
...
...
@@ -395,7 +398,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
MobclickAgent
.
onEvent
(
mContext
,
"process_sop"
);
}
public
void
initPresenter
(
OrderDoingPresenter
presenter
)
{
mPresenter
=
presenter
;
}
...
...
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
View file @
7f2814b4
...
...
@@ -103,17 +103,6 @@ public class MultiOrderDetailFragment extends DataBindingFragment<FragmentMultiD
mBind
.
customerSignature
.
setVisibility
(
View
.
GONE
);
}
mBind
.
customerSignature
.
setOnClickListener
(
v
->
imgMax
(
detail
.
getEsignatureImg
()));
mBind
.
customerAddress
.
setOnClickListener
(
v
->
{
if
(
isInstallPackage
())
{
Intent
intent
=
new
Intent
(
"android.intent.action.VIEW"
,
android
.
net
.
Uri
.
parse
(
"androidamap://poi?sourceApplication=softname&keywords="
+
(
detail
.
getProvinceName
()
+
detail
.
getCityName
()
+
detail
.
getDistrictName
()
+
detail
.
getAddress
())));
intent
.
setPackage
(
"com.autonavi.minimap"
);
intent
.
addCategory
(
"android.intent.category.DEFAULT"
);
startActivity
(
intent
);
}
else
{
ToastUtils
.
showShortToast
(
R
.
string
.
install_gd_map
);
}
});
}
private
static
boolean
isInstallPackage
()
{
...
...
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