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
92a16416
authored
Nov 22, 2017
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单路程修改
parent
7c4f1a3c
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
509 additions
and
313 deletions
app/build.gradle
app/proguard-rules.pro
app/src/main/java/com/dayu/bigfish/Constants.java
app/src/main/java/com/dayu/bigfish/MyApplication.java
app/src/main/java/com/dayu/bigfish/SplashActivity.java
app/src/main/java/com/dayu/bigfish/adapter/OrderSecondTabAdapter.java
app/src/main/java/com/dayu/bigfish/api/APIService.java
app/src/main/java/com/dayu/bigfish/api/Api.java
app/src/main/java/com/dayu/bigfish/api/ApiWrapper.java
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
app/src/main/java/com/dayu/bigfish/presenter/ordertwotab/OrderTwoTabContract.java
app/src/main/java/com/dayu/bigfish/presenter/ordertwotab/OrderTwoTabModel.java
app/src/main/java/com/dayu/bigfish/presenter/ordertwotab/OrderTwoTabPresenter.java
app/src/main/java/com/dayu/bigfish/rxbus/AgainUpDoorText.java
app/src/main/java/com/dayu/bigfish/rxbus/OrderFinish.java
app/src/main/java/com/dayu/bigfish/rxbus/UpdataTime.java → app/src/main/java/com/dayu/bigfish/rxbus/OrderState.java
app/src/main/java/com/dayu/bigfish/rxbus/RefreshReceivingNum.java
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
app/src/main/java/com/dayu/bigfish/ui/ProcessOrderActivity.java
app/src/main/java/com/dayu/bigfish/ui/SubcribeTimeActivity.java
app/src/main/java/com/dayu/bigfish/ui/fragment/HomeSecondTabFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderFirstTabFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderSecondTabFragment.java
app/src/main/java/com/dayu/bigfish/utils/LocationUtils.java
app/src/main/java/com/dayu/bigfish/utils/UtilsDate.java
app/src/main/res/layout/activity_main_layout.xml
app/src/main/res/layout/fragment_tabtwo_item.xml
gradle.properties
app/build.gradle
View file @
92a16416
...
@@ -8,12 +8,6 @@ android {
...
@@ -8,12 +8,6 @@ android {
storeFile
file
(
'/Users/luofan/AndroidStudioProjects/app_key.jks'
)
storeFile
file
(
'/Users/luofan/AndroidStudioProjects/app_key.jks'
)
storePassword
'123456789'
storePassword
'123456789'
}
}
// debug {
// keyAlias 'keybigfish'
// keyPassword '123456789'
// storeFile file('/Users/luofan/AndroidStudioProjects/app_key.jks')
// storePassword '123456789'
// }
}
}
compileSdkVersion
25
compileSdkVersion
25
buildToolsVersion
'26.0.2'
buildToolsVersion
'26.0.2'
...
@@ -81,6 +75,8 @@ dependencies {
...
@@ -81,6 +75,8 @@ dependencies {
//注解工具
//注解工具
compile
'com.jakewharton:butterknife:8.1.0'
compile
'com.jakewharton:butterknife:8.1.0'
annotationProcessor
'com.jakewharton:butterknife-compiler:8.1.0'
annotationProcessor
'com.jakewharton:butterknife-compiler:8.1.0'
//友盟统计
compile
'com.umeng.analytics:analytics:latest.integration'
//greendao数据库
//greendao数据库
compile
'org.greenrobot:greendao:3.2.0'
compile
'org.greenrobot:greendao:3.2.0'
...
...
app/proguard-rules.pro
View file @
92a16416
...
@@ -23,6 +23,83 @@
...
@@ -23,6 +23,83 @@
# If you keep the line number information, uncomment this to
# If you keep the line number information, uncomment this to
# hide the original source file name.
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
#1.基本指令区
-
optimizationpasses
5
-
dontusemixedcaseclassnames
-
dontskipnonpubliclibraryclasses
-
dontskipnonpubliclibraryclassmembers
-
dontpreverify
-
verbose
-
printmapping
proguardMapping
.
txt
-
optimizations
!
code
/
simplification
/
cast
,!
field
/*
,!class/merging
/*
-keepattributes
*Annotation*,InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
#2.默认保留区
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.view.View
-keep public class com.android.vending.licensing.ILicensingService
-keep class android.support.
*
* {*;}
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclassmembers class * extends android.app.Activity{
public void *(android.view.View);
}
-keepclassmembers enum * {
public static
*
*[] values();
public static
*
* valueOf(java.lang.String);
}
-keep public class * extends android.view.View{
**
* get*();
void set*(
**
*);
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-keep class
*
*.R$* {
*;
}
-keepclassmembers class * {
void *(
*
*On*Event);
}
#3.webview
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
-keepclassmembers class * extends android.webkit.webViewClient {
public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
public boolean *(android.webkit.WebView, java.lang.String);
}
-keepclassmembers class * extends android.webkit.webViewClient {
public void *(android.webkit.webView, jav.lang.String);
}
#retrofit
#retrofit
-dontwarn okio.
*
*
-dontwarn okio.
*
*
...
@@ -71,10 +148,6 @@
...
@@ -71,10 +148,6 @@
public *;
public *;
}
}
# for DexGuard only
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
#########################################
#BaseRecyclerViewAdapterHelper
#BaseRecyclerViewAdapterHelper
...
@@ -87,15 +160,6 @@
...
@@ -87,15 +160,6 @@
<init>(...);
<init>(...);
}
}
#okgo
#okhttp
-
dontwarn
okhttp3
.
**
-
keep
class
okhttp3
.
**
{
*
;}
#okio
-
dontwarn
okio
.
**
-
keep
class
okio
.
**
{
*
;}
#greendao
#greendao
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
public static java.lang.String TABLENAME;
public static java.lang.String TABLENAME;
...
@@ -110,17 +174,6 @@ public static java.lang.String TABLENAME;
...
@@ -110,17 +174,6 @@ public static java.lang.String TABLENAME;
#xutils
#xutils
-keep class * extends java.lang.annotation.Annotation { *; }
-keep class * extends java.lang.annotation.Annotation { *; }
#eventbus
-
keepattributes
*
Annotation
*
-
keepclassmembers
class
**
{
@
org
.
greenrobot
.
eventbus
.
Subscribe
<
methods
>
;
}
-
keep
enum
org
.
greenrobot
.
eventbus
.
ThreadMode
{
*
;
}
# Only required if you use AsyncExecutor
-
keepclassmembers
class
*
extends
org
.
greenrobot
.
eventbus
.
util
.
ThrowableFailureEvent
{
<
init
>
(
java
.
lang
.
Throwable
);
}
#环信
#环信
-keep class com.hyphenate.
*
* {*;}
-keep class com.hyphenate.
*
* {*;}
...
@@ -130,4 +183,3 @@ public static java.lang.String TABLENAME;
...
@@ -130,4 +183,3 @@ public static java.lang.String TABLENAME;
-keep class com.amap.api.location.
*
*{*;}
-keep class com.amap.api.location.
*
*{*;}
-keep class com.amap.api.fence.
*
*{*;}
-keep class com.amap.api.fence.
*
*{*;}
-keep class com.autonavi.aps.amapapi.model.
*
*{*;}
-keep class com.autonavi.aps.amapapi.model.
*
*{*;}
app/src/main/java/com/dayu/bigfish/Constants.java
View file @
92a16416
...
@@ -110,4 +110,5 @@ public class Constants {
...
@@ -110,4 +110,5 @@ public class Constants {
public
final
static
int
FINISH_ORDER
=
5
;
public
final
static
int
FINISH_ORDER
=
5
;
}
}
app/src/main/java/com/dayu/bigfish/MyApplication.java
View file @
92a16416
...
@@ -65,6 +65,7 @@ public class MyApplication extends Application {
...
@@ -65,6 +65,7 @@ public class MyApplication extends Application {
initEasemob
();
initEasemob
();
//初始化高德地图
//初始化高德地图
LocationUtils
.
init
(
getApplicationContext
());
LocationUtils
.
init
(
getApplicationContext
());
}
}
...
...
app/src/main/java/com/dayu/bigfish/SplashActivity.java
View file @
92a16416
...
@@ -66,8 +66,10 @@ public class SplashActivity extends AppCompatActivity {
...
@@ -66,8 +66,10 @@ public class SplashActivity extends AppCompatActivity {
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//判断当前系统的SDK版本是否大于23
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//判断当前系统的SDK版本是否大于23
if
(!(
checkSelfPermission
(
Manifest
.
permission
.
READ_PHONE_STATE
)
==
PackageManager
.
PERMISSION_GRANTED
)
if
(!(
checkSelfPermission
(
Manifest
.
permission
.
READ_PHONE_STATE
)
==
PackageManager
.
PERMISSION_GRANTED
)
||
!(
checkSelfPermission
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
==
PackageManager
.
PERMISSION_GRANTED
))
{
||
!(
checkSelfPermission
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
==
PackageManager
.
PERMISSION_GRANTED
)
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
READ_PHONE_STATE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
},
SDK_PERMISSION_REQUEST
);
||
!(
checkSelfPermission
(
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
)
==
PackageManager
.
PERMISSION_GRANTED
))
{
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
READ_PHONE_STATE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
},
SDK_PERMISSION_REQUEST
);
}
}
}
}
}
}
...
@@ -77,7 +79,8 @@ public class SplashActivity extends AppCompatActivity {
...
@@ -77,7 +79,8 @@ public class SplashActivity extends AppCompatActivity {
super
.
onResume
();
super
.
onResume
();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//判断当前系统的SDK版本是否大于23
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//判断当前系统的SDK版本是否大于23
if
((
checkSelfPermission
(
Manifest
.
permission
.
READ_PHONE_STATE
)
==
PackageManager
.
PERMISSION_GRANTED
)
if
((
checkSelfPermission
(
Manifest
.
permission
.
READ_PHONE_STATE
)
==
PackageManager
.
PERMISSION_GRANTED
)
&&
(
checkSelfPermission
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
==
PackageManager
.
PERMISSION_GRANTED
))
{
&&
(
checkSelfPermission
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
==
PackageManager
.
PERMISSION_GRANTED
)
&&
(
checkSelfPermission
(
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
)
==
PackageManager
.
PERMISSION_GRANTED
))
{
doJump
();
doJump
();
}
}
}
else
{
}
else
{
...
...
app/src/main/java/com/dayu/bigfish/adapter/OrderSecondTabAdapter.java
View file @
92a16416
...
@@ -6,16 +6,23 @@ import android.graphics.Typeface;
...
@@ -6,16 +6,23 @@ import android.graphics.Typeface;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.view.View
;
import
android.view.View
;
import
com.amap.api.location.AMapLocation
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.presenter.ordertwotab.OrderTwoTabPresenter
;
import
com.dayu.bigfish.ui.ProcessOrderActivity
;
import
com.dayu.bigfish.ui.ProcessOrderActivity
;
import
com.dayu.bigfish.ui.SubcribeTimeActivity
;
import
com.dayu.bigfish.ui.SubcribeTimeActivity
;
import
com.dayu.bigfish.utils.DateUtils
;
import
com.dayu.bigfish.utils.DateUtils
;
import
com.dayu.bigfish.utils.LocationUtils
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
static
com
.
dayu
.
bigfish
.
ui
.
fragment
.
HomeSecondTabFragment
.
SUBCRIBE_TIME
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.functions.Consumer
;
import
static
com
.
dayu
.
bigfish
.
ui
.
fragment
.
HomeSecondTabFragment
.
MODIFY_TIME
;
import
static
com
.
dayu
.
bigfish
.
ui
.
fragment
.
HomeSecondTabFragment
.
UPDOOR_TIME
;
import
static
com
.
dayu
.
bigfish
.
ui
.
fragment
.
HomeSecondTabFragment
.
UPDOOR_TIME
;
...
@@ -25,11 +32,13 @@ import static com.dayu.bigfish.ui.fragment.HomeSecondTabFragment.UPDOOR_TIME;
...
@@ -25,11 +32,13 @@ import static com.dayu.bigfish.ui.fragment.HomeSecondTabFragment.UPDOOR_TIME;
*/
*/
public
class
OrderSecondTabAdapter
extends
BaseQuickAdapter
<
Order
,
BaseViewHolder
>
{
public
class
OrderSecondTabAdapter
extends
BaseQuickAdapter
<
Order
,
BaseViewHolder
>
{
private
final
OrderTwoTabPresenter
mPresenter
;
private
DateUtils
mDateUtils
;
private
DateUtils
mDateUtils
;
public
OrderSecondTabAdapter
(
int
layoutResId
)
{
public
OrderSecondTabAdapter
(
int
layoutResId
,
OrderTwoTabPresenter
presenter
)
{
super
(
layoutResId
);
super
(
layoutResId
);
mDateUtils
=
new
DateUtils
();
mDateUtils
=
new
DateUtils
();
mPresenter
=
presenter
;
}
}
...
@@ -57,43 +66,141 @@ public class OrderSecondTabAdapter extends BaseQuickAdapter<Order, BaseViewHolde
...
@@ -57,43 +66,141 @@ public class OrderSecondTabAdapter extends BaseQuickAdapter<Order, BaseViewHolde
item
.
getDistrictName
()
+
item
.
getAddress
());
item
.
getDistrictName
()
+
item
.
getAddress
());
holder
.
setText
(
R
.
id
.
item_text_user_name
,
item
.
getCustomerName
());
holder
.
setText
(
R
.
id
.
item_text_user_name
,
item
.
getCustomerName
());
holder
.
setText
(
R
.
id
.
item_text_user_phone
,
item
.
getCustomerMobile
());
holder
.
setText
(
R
.
id
.
item_text_user_phone
,
item
.
getCustomerMobile
());
holder
.
getView
(
R
.
id
.
item_text_phone
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
if
(
item
.
getStatus
()
==
3
&&
item
.
getSubStatus
()
==
1
)
{
holder
.
setText
(
R
.
id
.
tv_item_process
,
"我已出发"
);
}
else
if
(
item
.
getStatus
()
==
3
&&
item
.
getSubStatus
()
==
2
)
{
holder
.
setText
(
R
.
id
.
tv_item_process
,
"开始服务"
);
}
else
if
(
item
.
getStatus
()
==
4
&&
item
.
getSubStatus
()
==
6
)
{
holder
.
setText
(
R
.
id
.
tv_item_process
,
"等待验收"
);
holder
.
getView
(
R
.
id
.
item_updata_time
).
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
item_text_phone
).
setVisibility
(
View
.
GONE
);
return
;
}
else
if
(
item
.
getStatus
()
==
4
)
{
holder
.
setText
(
R
.
id
.
tv_item_process
,
"处理工单"
);
}
if
(
item
.
getStatus
()
==
3
)
{
holder
.
setText
(
R
.
id
.
item_updata_time
,
"修改预约时间"
);
}
else
if
(
item
.
getStatus
()
==
4
)
{
holder
.
setText
(
R
.
id
.
item_updata_time
,
"需要再次上门"
);
}
holder
.
setOnClickListener
(
R
.
id
.
tv_item_process
,
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_DIAL
);
ProgressUtil
.
startLoad
(
mContext
);
intent
.
setData
(
Uri
.
parse
(
"tel:"
+
item
.
getCustomerMobile
()));
LocationUtils
.
getCurrentLocation
(
new
LocationUtils
.
MyLocationListener
()
{
mContext
.
startActivity
(
intent
);
@Override
public
void
result
(
AMapLocation
location
)
{
if
(
item
.
getStatus
()
==
3
&&
item
.
getSubStatus
()
==
1
)
{
mPresenter
.
startOrder
(
item
.
getId
(),
location
.
getLatitude
(),
location
.
getLongitude
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
Integer
integer
)
throws
Exception
{
LocationUtils
.
stop
();
ProgressUtil
.
stopLoad
();
item
.
setSubStatus
(
integer
);
holder
.
setText
(
R
.
id
.
tv_item_process
,
"开始服务"
);
}
});
}
else
if
(
item
.
getStatus
()
==
3
&&
item
.
getSubStatus
()
==
2
)
{
mPresenter
.
startServer
(
item
.
getId
(),
location
.
getLatitude
(),
location
.
getLongitude
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
Integer
integer
)
throws
Exception
{
LocationUtils
.
stop
();
ProgressUtil
.
stopLoad
();
item
.
setStatus
(
4
);
item
.
setSubStatus
(
integer
);
holder
.
setText
(
R
.
id
.
tv_item_process
,
"处理工单"
);
}
});
}
else
if
(
item
.
getStatus
()
==
4
&&
item
.
getSubStatus
()
==
3
)
{
dumpProcessActivity
(
id
,
holder
.
getAdapterPosition
());
}
else
if
(
item
.
getStatus
()
==
4
&&
item
.
getSubStatus
()
==
4
)
{
}
else
if
(
item
.
getStatus
()
==
4
&&
item
.
getSubStatus
()
==
5
)
{
dumpProcessActivity
(
id
,
holder
.
getAdapterPosition
());
}
}
});
}
}
});
});
holder
.
getView
(
R
.
id
.
item_text_time
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
// holder.getView(R.id.tv_item_process).setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// ProgressUtil.startLoad(mContext);
// LocationUtils.getCurrentLocation(new LocationUtils.MyLocationListener() {
// @Override
// public void result(AMapLocation location) {
// if (item.getStatus() == 3 && item.getSubStatus() == 1) {
// mPresenter.startOrder(item.getId(), location.getLatitude(), location.getLongitude())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<Integer>() {
// @Override
// public void accept(Integer integer) throws Exception {
// LocationUtils.stop();
// ProgressUtil.stopLoad();
// item.setSubStatus(integer);
// holder.setText(R.id.tv_item_process, "开始服务");
// }
// });
// } else if (item.getStatus() == 3 && item.getSubStatus() == 2) {
// mPresenter.startServer(item.getId(), location.getLatitude(), location.getLongitude())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<Integer>() {
// @Override
// public void accept(Integer integer) throws Exception {
// LocationUtils.stop();
// ProgressUtil.stopLoad();
// item.setStatus(4);
// item.setSubStatus(integer);
// holder.setText(R.id.tv_item_process, "处理工单");
// }
// });
// } else if (item.getStatus() == 4 && item.getSubStatus() == 3) {
// dumpProcessActivity(id, holder.getAdapterPosition());
// } else if (item.getStatus() == 4 && item.getSubStatus() == 4) {
//
// } else if (item.getStatus() == 4 && item.getSubStatus() == 5) {
// dumpProcessActivity(id, holder.getAdapterPosition());
// }
// }
// });
// }
// });
holder
.
getView
(
R
.
id
.
item_updata_time
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
Intent
intent
=
new
Intent
(
mContext
,
SubcribeTimeActivity
.
class
);
if
(
item
.
getStatus
()
==
3
)
{
intent
.
putExtra
(
"orderId"
,
id
+
""
);
dumpSubcribeTimeActivity
(
id
,
holder
.
getAdapterPosition
(),
MODIFY_TIME
);
intent
.
putExtra
(
"position"
,
holder
.
getAdapterPosition
());
}
else
if
(
item
.
getStatus
()
==
4
)
{
intent
.
putExtra
(
Constants
.
ORDER_STATE
,
SUBCRIBE
_TIME
);
dumpSubcribeTimeActivity
(
id
,
holder
.
getAdapterPosition
(),
UPDOOR
_TIME
);
mContext
.
startActivity
(
intent
);
}
}
}
});
});
holder
.
getView
(
R
.
id
.
item_
restrt
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
holder
.
getView
(
R
.
id
.
item_
text_phone
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
Intent
intent
=
new
Intent
(
mContext
,
SubcribeTimeActivity
.
class
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_DIAL
);
intent
.
putExtra
(
"orderId"
,
id
+
""
);
intent
.
setData
(
Uri
.
parse
(
"tel:"
+
item
.
getCustomerMobile
()));
intent
.
putExtra
(
"position"
,
holder
.
getAdapterPosition
());
intent
.
putExtra
(
Constants
.
ORDER_STATE
,
UPDOOR_TIME
);
mContext
.
startActivity
(
intent
);
mContext
.
startActivity
(
intent
);
}
}
});
});
}
holder
.
getView
(
R
.
id
.
item_order
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
private
void
dumpSubcribeTimeActivity
(
int
id
,
int
adapterPosition
,
int
state
)
{
@Override
Intent
intent
=
new
Intent
(
mContext
,
SubcribeTimeActivity
.
class
);
public
void
onClick
(
View
v
)
{
intent
.
putExtra
(
"orderId"
,
id
+
""
);
Intent
intent
=
new
Intent
(
mContext
,
ProcessOrderActivity
.
class
);
intent
.
putExtra
(
"position"
,
adapterPosition
);
intent
.
putExtra
(
"orderId"
,
id
+
""
);
intent
.
putExtra
(
Constants
.
ORDER_STATE
,
state
);
intent
.
putExtra
(
"position"
,
holder
.
getAdapterPosition
());
mContext
.
startActivity
(
intent
);
mContext
.
startActivity
(
intent
);
}
}
});
private
void
dumpProcessActivity
(
int
id
,
int
adapterPosition
)
{
Intent
intent
=
new
Intent
(
mContext
,
ProcessOrderActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
id
+
""
);
intent
.
putExtra
(
"position"
,
adapterPosition
);
mContext
.
startActivity
(
intent
);
}
}
}
}
app/src/main/java/com/dayu/bigfish/api/APIService.java
View file @
92a16416
...
@@ -142,20 +142,20 @@ public interface APIService {
...
@@ -142,20 +142,20 @@ public interface APIService {
/**
/**
* 我已出发.
* 我已出发.
*
*
* @param
orderId
* @param
body
* @return
* @return
*/
*/
@
GET
(
"/api-order/"
+
"orders/onWay/{orderId}
"
)
@
POST
(
"/api-order/"
+
"orders/onWayUpgrade
"
)
Observable
<
BaseResponse
<
Boolean
>>
startOrder
(
@Path
(
"orderId"
)
int
orderId
);
Observable
<
BaseResponse
<
Integer
>>
startOrder
(
@Body
RequestBody
body
);
/**
/**
* 开始服务.
* 开始服务.
*
*
* @param
orderId
* @param
body
* @return
* @return
*/
*/
@
GET
(
"/api-order/"
+
"orders/onWorking/{orderId}
"
)
@
POST
(
"/api-order/"
+
"orders/onWorkingUpgrade
"
)
Observable
<
BaseResponse
<
Boolean
>>
startServer
(
@Path
(
"orderId"
)
int
orderId
);
Observable
<
BaseResponse
<
Integer
>>
startServer
(
@Body
RequestBody
body
);
/**
/**
* 获取工单详情信息.
* 获取工单详情信息.
...
...
app/src/main/java/com/dayu/bigfish/api/Api.java
View file @
92a16416
...
@@ -89,7 +89,7 @@ public class Api {
...
@@ -89,7 +89,7 @@ public class Api {
}
}
}
else
{
}
else
{
if
(!
e
.
isDisposed
())
{
if
(!
e
.
isDisposed
())
{
Log
.
d
(
"request"
,
response
.
getMsg
());
Log
.
d
(
"request
+errorMessag:
"
,
response
.
getMsg
());
e
.
onError
(
new
ServerException
(
response
.
getCode
(),
response
.
getMsg
()));
e
.
onError
(
new
ServerException
(
response
.
getCode
(),
response
.
getMsg
()));
}
}
return
;
return
;
...
...
app/src/main/java/com/dayu/bigfish/api/ApiWrapper.java
View file @
92a16416
...
@@ -98,14 +98,14 @@ public class ApiWrapper extends Api {
...
@@ -98,14 +98,14 @@ public class ApiWrapper extends Api {
}
}
//我已出发
//我已出发
public
Observable
<
Boolean
>
startOrder
(
int
orderId
)
{
public
Observable
<
Integer
>
startOrder
(
RequestBody
body
)
{
return
getService
().
startOrder
(
orderId
)
return
getService
().
startOrder
(
body
)
.
compose
(
applySchedulers
());
.
compose
(
applySchedulers
());
}
}
//开始服务
//开始服务
public
Observable
<
Boolean
>
startServer
(
int
orderId
)
{
public
Observable
<
Integer
>
startServer
(
RequestBody
body
)
{
return
getService
().
startServer
(
orderId
)
return
getService
().
startServer
(
body
)
.
compose
(
applySchedulers
());
.
compose
(
applySchedulers
());
}
}
...
...
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
View file @
92a16416
...
@@ -122,6 +122,43 @@ public abstract class BasePresenter<M, T> {
...
@@ -122,6 +122,43 @@ public abstract class BasePresenter<M, T> {
};
};
}
}
/**
* 创建观察者
*
* @param observer
* @return
*/
protected
<
V
>
Observer
baseObserver
(
final
Observer
<?
super
V
>
observer
)
{
return
new
Observer
<
V
>()
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
mComDisposable
.
add
(
d
);
}
@Override
public
void
onNext
(
V
o
)
{
ProgressUtil
.
stopLoad
();
try
{
observer
.
onNext
(
o
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
onError
(
Throwable
e
)
{
ProgressUtil
.
stopLoad
();
processException
(
e
);
}
@Override
public
void
onComplete
()
{
}
};
}
private
void
processException
(
Throwable
e
)
{
private
void
processException
(
Throwable
e
)
{
APIException
.
ResponeThrowable
exception
=
APIException
.
APIException
(
e
);
APIException
.
ResponeThrowable
exception
=
APIException
.
APIException
(
e
);
int
code
=
exception
.
code
;
int
code
=
exception
.
code
;
...
...
app/src/main/java/com/dayu/bigfish/presenter/ordertwotab/OrderTwoTabContract.java
View file @
92a16416
...
@@ -8,6 +8,7 @@ import com.dayu.bigfish.base.BaseView;
...
@@ -8,6 +8,7 @@ import com.dayu.bigfish.base.BaseView;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.Order
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
/**
/**
* Created by luo on 2016/8/4.
* Created by luo on 2016/8/4.
...
@@ -15,22 +16,23 @@ import io.reactivex.Observable;
...
@@ -15,22 +16,23 @@ import io.reactivex.Observable;
public
interface
OrderTwoTabContract
{
public
interface
OrderTwoTabContract
{
interface
Model
extends
BaseModel
{
interface
Model
extends
BaseModel
{
Observable
<
BasePageBean
<
Order
>>
getWatingOrder
(
int
state
,
int
pageId
,
int
pageSize
,
int
siteId
,
int
userId
);
Observable
<
BasePageBean
<
Order
>>
getWatingOrder
(
int
state
,
int
pageId
,
int
pageSize
,
int
siteId
,
int
userId
);
Observable
<
Boolean
>
startOrder
(
int
orderId
);
Observable
<
Boolean
>
startServer
(
int
orderId
);
Observable
<
Integer
>
startOrder
(
RequestBody
body
);
Observable
<
Integer
>
startServer
(
RequestBody
body
);
}
}
interface
View
extends
BaseView
{
interface
View
extends
BaseView
{
void
getWatingOrderSuccess
(
BasePageBean
<
Order
>
data
);
void
getWatingOrderSuccess
(
BasePageBean
<
Order
>
data
);
void
getWatingOrderFial
();
void
getWatingOrderFial
();
void
setartOrderSuccess
();
void
setartServerSuccess
();
}
}
abstract
class
Presenter
extends
BasePresenter
<
Model
,
View
>
{
abstract
class
Presenter
extends
BasePresenter
<
Model
,
View
>
{
public
abstract
void
getWatingOrder
(
int
state
,
int
pageId
,
int
pageSize
,
int
siteId
,
int
userId
);
public
abstract
void
getWatingOrder
(
int
state
,
int
pageId
,
int
pageSize
,
int
siteId
,
int
userId
);
public
abstract
void
startOrder
(
int
orderId
);
public
abstract
Observable
<
Integer
>
startOrder
(
int
orderId
,
double
latitude
,
double
longitude
);
public
abstract
void
startServer
(
int
orderId
);
public
abstract
Observable
<
Integer
>
startServer
(
int
orderId
,
double
latitude
,
double
longitude
);
}
}
}
}
app/src/main/java/com/dayu/bigfish/presenter/ordertwotab/OrderTwoTabModel.java
View file @
92a16416
...
@@ -5,6 +5,7 @@ import com.dayu.bigfish.base.BasePageBean;
...
@@ -5,6 +5,7 @@ import com.dayu.bigfish.base.BasePageBean;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.Order
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
/**
/**
* Created by luofan on 2017/11/8.
* Created by luofan on 2017/11/8.
...
@@ -19,12 +20,12 @@ public class OrderTwoTabModel implements OrderTwoTabContract.Model {
...
@@ -19,12 +20,12 @@ public class OrderTwoTabModel implements OrderTwoTabContract.Model {
}
}
@Override
@Override
public
Observable
<
Boolean
>
startOrder
(
int
orderId
)
{
public
Observable
<
Integer
>
startOrder
(
RequestBody
body
)
{
return
mWrapper
.
startOrder
(
orderId
);
return
mWrapper
.
startOrder
(
body
);
}
}
@Override
@Override
public
Observable
<
Boolean
>
startServer
(
int
orderId
)
{
public
Observable
<
Integer
>
startServer
(
RequestBody
body
)
{
return
mWrapper
.
startServer
(
orderId
);
return
mWrapper
.
startServer
(
body
);
}
}
}
}
app/src/main/java/com/dayu/bigfish/presenter/ordertwotab/OrderTwoTabPresenter.java
View file @
92a16416
...
@@ -3,7 +3,14 @@ package com.dayu.bigfish.presenter.ordertwotab;
...
@@ -3,7 +3,14 @@ package com.dayu.bigfish.presenter.ordertwotab;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.Order
;
import
org.json.JSONObject
;
import
java.util.HashMap
;
import
io.reactivex.Observable
;
import
io.reactivex.functions.Consumer
;
import
io.reactivex.functions.Consumer
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
/**
/**
* Created by luofan on 2017/11/8.
* Created by luofan on 2017/11/8.
...
@@ -32,22 +39,45 @@ public class OrderTwoTabPresenter extends OrderTwoTabContract.Presenter {
...
@@ -32,22 +39,45 @@ public class OrderTwoTabPresenter extends OrderTwoTabContract.Presenter {
}
}
@Override
@Override
public
void
startOrder
(
int
orderId
)
{
public
Observable
<
Integer
>
startOrder
(
int
orderId
,
double
latitude
,
double
longitude
)
{
mModel
.
startOrder
(
orderId
).
subscribe
(
new
Consumer
<
Boolean
>()
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
@Override
params
.
put
(
"latitude"
,
latitude
);
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
params
.
put
(
"longitude"
,
longitude
);
mView
.
setartOrderSuccess
();
params
.
put
(
"orderId"
,
orderId
);
}
JSONObject
jsonObject
=
new
JSONObject
(
params
);
});
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
jsonObject
.
toString
());
return
mModel
.
startOrder
(
body
);
}
}
@Override
@Override
public
void
startServer
(
int
orderId
)
{
public
Observable
<
Integer
>
startServer
(
int
orderId
,
double
latitude
,
double
longitude
)
{
mModel
.
startServer
(
orderId
).
subscribe
(
new
Consumer
<
Boolean
>()
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
@Override
params
.
put
(
"latitude"
,
latitude
);
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
params
.
put
(
"longitude"
,
longitude
);
mView
.
setartServerSuccess
();
params
.
put
(
"orderId"
,
orderId
);
}
JSONObject
jsonObject
=
new
JSONObject
(
params
);
});
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
jsonObject
.
toString
());
// mModel.startServer(body).subscribe(baseObserver(new Observer<Integer>(){
// @Override
// public void onSubscribe(Disposable d) {
//
// }
//
// @Override
// public void onNext(Integer integer) {
// onNext(integer);
// }
//
// @Override
// public void onError(Throwable e) {
//
// }
//
// @Override
// public void onComplete() {
//
// }
// }));
return
mModel
.
startServer
(
body
);
}
}
}
}
app/src/main/java/com/dayu/bigfish/rxbus/AgainUpDoorText.java
deleted
100755 → 0
View file @
7c4f1a3c
package
com
.
dayu
.
bigfish
.
rxbus
;
/**
* 需要再次上门
* on 2017/9/20.
*/
public
class
AgainUpDoorText
{
private
int
value
;
public
AgainUpDoorText
(
int
value
)
{
this
.
value
=
value
;
}
public
int
getValue
()
{
return
value
;
}
public
void
setValue
(
int
value
)
{
this
.
value
=
value
;
}
}
app/src/main/java/com/dayu/bigfish/rxbus/OrderFinish.java
deleted
100755 → 0
View file @
7c4f1a3c
package
com
.
dayu
.
bigfish
.
rxbus
;
/**
* 订单完成
* on 2017/9/20.
*/
public
class
OrderFinish
{
private
int
temp
;
public
OrderFinish
(
int
temp
)
{
this
.
temp
=
temp
;
}
public
int
getTemp
()
{
return
temp
;
}
public
void
setTemp
(
int
temp
)
{
this
.
temp
=
temp
;
}
}
app/src/main/java/com/dayu/bigfish/rxbus/
UpdataTim
e.java
→
app/src/main/java/com/dayu/bigfish/rxbus/
OrderStat
e.java
View file @
92a16416
...
@@ -5,13 +5,25 @@ package com.dayu.bigfish.rxbus;
...
@@ -5,13 +5,25 @@ package com.dayu.bigfish.rxbus;
* on 2017/9/20.
* on 2017/9/20.
*/
*/
public
class
UpdataTime
{
public
class
OrderState
{
private
int
position
;
private
int
state
;
private
int
state
;
public
UpdataTime
(
int
state
)
{
public
OrderState
(
int
state
,
int
position
)
{
this
.
position
=
position
;
this
.
state
=
state
;
this
.
state
=
state
;
}
}
public
int
getPosition
()
{
return
position
;
}
public
void
setPosition
(
int
position
)
{
this
.
position
=
position
;
}
public
int
getState
()
{
public
int
getState
()
{
return
state
;
return
state
;
}
}
...
@@ -19,5 +31,4 @@ public class UpdataTime {
...
@@ -19,5 +31,4 @@ public class UpdataTime {
public
void
setState
(
int
state
)
{
public
void
setState
(
int
state
)
{
this
.
state
=
state
;
this
.
state
=
state
;
}
}
}
}
app/src/main/java/com/dayu/bigfish/rxbus/RefreshReceivingNum.java
View file @
92a16416
package
com
.
dayu
.
bigfish
.
rxbus
;
package
com
.
dayu
.
bigfish
.
rxbus
;
/**
/**
* 刷新待
结单数量
.
* 刷新待
接单数量和刷新待预约列表
.
* on 2017/10/11.
* on 2017/10/11.
*/
*/
...
...
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
View file @
92a16416
...
@@ -40,6 +40,7 @@ import com.dayu.bigfish.ui.fragment.HomeMessageTabFragment;
...
@@ -40,6 +40,7 @@ import com.dayu.bigfish.ui.fragment.HomeMessageTabFragment;
import
com.dayu.bigfish.ui.fragment.HomeSecondTabFragment
;
import
com.dayu.bigfish.ui.fragment.HomeSecondTabFragment
;
import
com.dayu.bigfish.utils.AppUtils
;
import
com.dayu.bigfish.utils.AppUtils
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.LocationUtils
;
import
com.dayu.bigfish.utils.SPUtils
;
import
com.dayu.bigfish.utils.SPUtils
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.views.CustomDialog
;
import
com.dayu.bigfish.views.CustomDialog
;
...
@@ -119,6 +120,9 @@ public class MainActivity extends BaseActivity<MainPresenter, MainModel> impleme
...
@@ -119,6 +120,9 @@ public class MainActivity extends BaseActivity<MainPresenter, MainModel> impleme
@Override
@Override
public
void
accept
(
RefreshReceivingNum
refreshReceivingNum
)
throws
Exception
{
public
void
accept
(
RefreshReceivingNum
refreshReceivingNum
)
throws
Exception
{
mReceivingNum
-=
1
;
mReceivingNum
-=
1
;
if
(
mReceivingNum
<
0
)
{
mReceivingNum
=
0
;
}
mGetOrderTv
.
setText
(
mReceivingNum
+
""
);
mGetOrderTv
.
setText
(
mReceivingNum
+
""
);
}
}
});
});
...
@@ -319,4 +323,10 @@ public class MainActivity extends BaseActivity<MainPresenter, MainModel> impleme
...
@@ -319,4 +323,10 @@ public class MainActivity extends BaseActivity<MainPresenter, MainModel> impleme
return
"解析版本号失败"
;
return
"解析版本号失败"
;
}
}
}
}
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
LocationUtils
.
destroy
();
}
}
}
app/src/main/java/com/dayu/bigfish/ui/ProcessOrderActivity.java
View file @
92a16416
...
@@ -16,14 +16,14 @@ import android.widget.TextView;
...
@@ -16,14 +16,14 @@ import android.widget.TextView;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.bean.OrderDetail
;
import
com.dayu.bigfish.bean.OrderDetail
;
import
com.dayu.bigfish.rxbus.OrderFinish
;
import
com.dayu.bigfish.greendao.GreenDaoManager
;
import
com.dayu.bigfish.greendao.GreenDaoManager
;
import
com.dayu.bigfish.greendao.OrderInfoDao
;
import
com.dayu.bigfish.greendao.OrderInfoDao
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderContract
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderContract
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderModel
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderModel
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderPresenter
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderPresenter
;
import
com.dayu.bigfish.rxbus.OrderState
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.sqlbean.OrderInfo
;
import
com.dayu.bigfish.sqlbean.OrderInfo
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.GlideImageLoader
;
import
com.dayu.bigfish.utils.GlideImageLoader
;
...
@@ -52,6 +52,7 @@ import static com.dayu.bigfish.R.id.et_input;
...
@@ -52,6 +52,7 @@ import static com.dayu.bigfish.R.id.et_input;
import
static
com
.
dayu
.
bigfish
.
R
.
id
.
et_up_input
;
import
static
com
.
dayu
.
bigfish
.
R
.
id
.
et_up_input
;
import
static
com
.
dayu
.
bigfish
.
R
.
id
.
image_switch
;
import
static
com
.
dayu
.
bigfish
.
R
.
id
.
image_switch
;
import
static
com
.
dayu
.
bigfish
.
R
.
id
.
text_six_value
;
import
static
com
.
dayu
.
bigfish
.
R
.
id
.
text_six_value
;
import
static
com
.
dayu
.
bigfish
.
ui
.
fragment
.
HomeSecondTabFragment
.
ORDER_FINISH
;
import
static
com
.
dayu
.
bigfish
.
utils
.
SPUtils
.
get
;
import
static
com
.
dayu
.
bigfish
.
utils
.
SPUtils
.
get
;
/**
/**
...
@@ -385,8 +386,7 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Pr
...
@@ -385,8 +386,7 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Pr
@Override
@Override
public
void
commitOrderSuccess
()
{
public
void
commitOrderSuccess
()
{
ToastUtils
.
showShortToast
(
"数据提交成功"
);
ToastUtils
.
showShortToast
(
"数据提交成功"
);
// EventBus.getDefault().post(new OrderFinish(finshPosition));
RxBus
.
getDefault
().
post
(
new
OrderState
(
ORDER_FINISH
,
finshPosition
));
RxBus
.
getDefault
().
post
(
new
OrderFinish
(
finshPosition
));
mOrderInfoDao
.
deleteByKey
((
long
)
orderId
);
mOrderInfoDao
.
deleteByKey
((
long
)
orderId
);
PictureFileUtils
.
deleteCacheDirFile
(
mContext
);
PictureFileUtils
.
deleteCacheDirFile
(
mContext
);
finish
();
finish
();
...
...
app/src/main/java/com/dayu/bigfish/ui/SubcribeTimeActivity.java
View file @
92a16416
...
@@ -10,13 +10,12 @@ import com.bigkoo.pickerview.TimePickerView;
...
@@ -10,13 +10,12 @@ import com.bigkoo.pickerview.TimePickerView;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.rxbus.AgainUpDoorText
;
import
com.dayu.bigfish.rxbus.RefreshTabNum
;
import
com.dayu.bigfish.rxbus.UpdataTime
;
import
com.dayu.bigfish.presenter.subcribeTime.SubcribeContract
;
import
com.dayu.bigfish.presenter.subcribeTime.SubcribeContract
;
import
com.dayu.bigfish.presenter.subcribeTime.SubcribeTimeModel
;
import
com.dayu.bigfish.presenter.subcribeTime.SubcribeTimeModel
;
import
com.dayu.bigfish.presenter.subcribeTime.SubcribeTimePresenter
;
import
com.dayu.bigfish.presenter.subcribeTime.SubcribeTimePresenter
;
import
com.dayu.bigfish.rxbus.OrderState
;
import
com.dayu.bigfish.rxbus.RefreshTabNum
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.utils.DateUtils
;
import
com.dayu.bigfish.utils.DateUtils
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.ToastUtils
;
...
@@ -72,9 +71,9 @@ public class SubcribeTimeActivity extends BaseActivity<SubcribeTimePresenter, Su
...
@@ -72,9 +71,9 @@ public class SubcribeTimeActivity extends BaseActivity<SubcribeTimePresenter, Su
orderId
=
parseInt
(
value
);
orderId
=
parseInt
(
value
);
if
(
mState
==
0
)
{
if
(
mState
==
0
)
{
titleText
.
setText
(
getString
(
R
.
string
.
tv_home_tab_one_subscribe_time
));
titleText
.
setText
(
getString
(
R
.
string
.
tv_home_tab_one_subscribe_time
));
}
else
if
(
mState
==
1
)
{
}
else
if
(
mState
==
MODIFY_TIME
)
{
titleText
.
setText
(
getString
(
R
.
string
.
tv_home_tab_updata_subscribe_time
));
titleText
.
setText
(
getString
(
R
.
string
.
tv_home_tab_updata_subscribe_time
));
}
else
if
(
mState
==
2
)
{
}
else
if
(
mState
==
UPDOOR_TIME
)
{
titleText
.
setText
(
getString
(
R
.
string
.
item_restart
));
titleText
.
setText
(
getString
(
R
.
string
.
item_restart
));
}
}
}
}
...
@@ -85,15 +84,9 @@ public class SubcribeTimeActivity extends BaseActivity<SubcribeTimePresenter, Su
...
@@ -85,15 +84,9 @@ public class SubcribeTimeActivity extends BaseActivity<SubcribeTimePresenter, Su
finish
();
finish
();
if
(
mState
==
SUBCRIBE_TIME
)
{
if
(
mState
==
SUBCRIBE_TIME
)
{
ToastUtils
.
showShortToast
(
"预约时间成功,请移至待服务列表查看"
);
ToastUtils
.
showShortToast
(
"预约时间成功,请移至待服务列表查看"
);
// RxBus.getDefault().post(new RefreshTabNum(TAB_ONE));
RxBus
.
getDefault
().
post
(
new
RefreshTabNum
(
1
));
// EventBus.getDefault().post(new RefreshTabNum(1));
}
else
if
(
mState
==
MODIFY_TIME
||
mState
==
UPDOOR_TIME
)
{
RxBus
.
getDefault
().
post
(
new
RefreshTabNum
(
1
)
);
RxBus
.
getDefault
().
post
(
new
OrderState
(
MODIFY_TIME
,
finshPosition
));
}
else
if
(
mState
==
MODIFY_TIME
)
{
RxBus
.
getDefault
().
post
(
new
UpdataTime
(
finshPosition
));
// EventBus.getDefault().post(new UpdataTime(finshPosition));
}
else
if
(
mState
==
UPDOOR_TIME
)
{
RxBus
.
getDefault
().
post
(
new
AgainUpDoorText
(
finshPosition
));
// EventBus.getDefault().post(new AgainUpDoorText(finshPosition));
}
}
}
}
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/HomeSecondTabFragment.java
View file @
92a16416
...
@@ -61,6 +61,7 @@ public class HomeSecondTabFragment extends BaseFragment<HomeSecondPresenter, Hom
...
@@ -61,6 +61,7 @@ public class HomeSecondTabFragment extends BaseFragment<HomeSecondPresenter, Hom
public
final
static
int
SUBCRIBE_TIME
=
0
;
//预约上门时间
public
final
static
int
SUBCRIBE_TIME
=
0
;
//预约上门时间
public
final
static
int
MODIFY_TIME
=
1
;
//修改预约时间
public
final
static
int
MODIFY_TIME
=
1
;
//修改预约时间
public
final
static
int
UPDOOR_TIME
=
2
;
//再次上门时间
public
final
static
int
UPDOOR_TIME
=
2
;
//再次上门时间
public
final
static
int
ORDER_FINISH
=
3
;
public
final
static
int
TAB_ONE
=
0
;
public
final
static
int
TAB_ONE
=
0
;
public
final
static
int
TAB_TWO
=
1
;
public
final
static
int
TAB_TWO
=
1
;
...
@@ -316,11 +317,12 @@ public class HomeSecondTabFragment extends BaseFragment<HomeSecondPresenter, Hom
...
@@ -316,11 +317,12 @@ public class HomeSecondTabFragment extends BaseFragment<HomeSecondPresenter, Hom
return
newtab
;
return
newtab
;
}
}
@OnClick
(
R
.
id
.
title_right
)
@OnClick
(
R
.
id
.
title_right
)
public
void
onViewClicked
(
View
view
)
{
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
switch
(
view
.
getId
())
{
case
R
.
id
.
title_right
:
case
R
.
id
.
title_right
:
Intent
intent
=
new
Intent
(
mActivity
,
WorksRecordActivity
.
class
);
Intent
intent
=
new
Intent
(
mActivity
,
WorksRecordActivity
.
class
);
mActivity
.
startActivity
(
intent
);
mActivity
.
startActivity
(
intent
);
break
;
break
;
}
}
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderFirstTabFragment.java
View file @
92a16416
...
@@ -17,6 +17,7 @@ import com.dayu.bigfish.bean.Order;
...
@@ -17,6 +17,7 @@ import com.dayu.bigfish.bean.Order;
import
com.dayu.bigfish.presenter.ordertab.OrderTabContract
;
import
com.dayu.bigfish.presenter.ordertab.OrderTabContract
;
import
com.dayu.bigfish.presenter.ordertab.OrderTabModel
;
import
com.dayu.bigfish.presenter.ordertab.OrderTabModel
;
import
com.dayu.bigfish.presenter.ordertab.OrderTabPresenter
;
import
com.dayu.bigfish.presenter.ordertab.OrderTabPresenter
;
import
com.dayu.bigfish.rxbus.RefreshReceivingNum
;
import
com.dayu.bigfish.rxbus.RefreshTabNum
;
import
com.dayu.bigfish.rxbus.RefreshTabNum
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
...
@@ -24,6 +25,8 @@ import com.dayu.bigfish.utils.GetUserInfo;
...
@@ -24,6 +25,8 @@ import com.dayu.bigfish.utils.GetUserInfo;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.functions.Consumer
;
/**
/**
...
@@ -69,6 +72,15 @@ public class OrderFirstTabFragment extends BaseFragment<OrderTabPresenter, Order
...
@@ -69,6 +72,15 @@ public class OrderFirstTabFragment extends BaseFragment<OrderTabPresenter, Order
public
void
initListener
()
{
public
void
initListener
()
{
RxBus
.
getDefault
().
toObservable
(
RefreshReceivingNum
.
class
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
RefreshReceivingNum
>()
{
@Override
public
void
accept
(
RefreshReceivingNum
refreshReceivingNum
)
throws
Exception
{
ProgressUtil
.
startLoad
(
mContext
);
mPresenter
.
getWatingOrder
(
Constants
.
APPOIMENT_ORDER
,
mPage
,
mPageSize
,
siteId
,
userId
);
}
});
mAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
mAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
@Override
@Override
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderSecondTabFragment.java
View file @
92a16416
...
@@ -4,10 +4,8 @@ import android.content.Intent;
...
@@ -4,10 +4,8 @@ import android.content.Intent;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.RecyclerView
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
com.amap.api.location.AMapLocation
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.MyApplication
;
...
@@ -19,14 +17,22 @@ import com.dayu.bigfish.bean.Order;
...
@@ -19,14 +17,22 @@ import com.dayu.bigfish.bean.Order;
import
com.dayu.bigfish.presenter.ordertwotab.OrderTwoTabContract
;
import
com.dayu.bigfish.presenter.ordertwotab.OrderTwoTabContract
;
import
com.dayu.bigfish.presenter.ordertwotab.OrderTwoTabModel
;
import
com.dayu.bigfish.presenter.ordertwotab.OrderTwoTabModel
;
import
com.dayu.bigfish.presenter.ordertwotab.OrderTwoTabPresenter
;
import
com.dayu.bigfish.presenter.ordertwotab.OrderTwoTabPresenter
;
import
com.dayu.bigfish.rxbus.OrderState
;
import
com.dayu.bigfish.rxbus.RefreshTabNum
;
import
com.dayu.bigfish.rxbus.RefreshTabNum
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.rxbus.RxBus
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.LocationUtils
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
java.util.ArrayList
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.functions.Consumer
;
import
static
com
.
dayu
.
bigfish
.
ui
.
fragment
.
HomeSecondTabFragment
.
MODIFY_TIME
;
import
static
com
.
dayu
.
bigfish
.
ui
.
fragment
.
HomeSecondTabFragment
.
ORDER_FINISH
;
/**
/**
...
@@ -46,15 +52,17 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
...
@@ -46,15 +52,17 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
private
int
mPageSize
=
10
;
private
int
mPageSize
=
10
;
private
int
mPage
=
1
;
private
int
mPage
=
1
;
private
int
mRefreshState
=
1
;
//1:刷新,private int mRefreshState;
private
int
mRefreshState
=
1
;
//1:刷新,private int mRefreshState;
private
List
<
Order
>
mDatas
;
@Override
@Override
public
View
initView
(
View
view
)
{
public
View
initView
(
View
view
)
{
mAdapter
=
new
OrderSecondTabAdapter
(
R
.
layout
.
fragment_tabtwo_item
);
mAdapter
=
new
OrderSecondTabAdapter
(
R
.
layout
.
fragment_tabtwo_item
,
mPresenter
);
mRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mContext
));
mRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mContext
));
mRecyclerView
.
setAdapter
(
mAdapter
);
mRecyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mRecyclerView
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mRecyclerView
);
mRefreshLayout
.
setOnRefreshListener
(
this
);
mRefreshLayout
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mRecyclerView
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mRecyclerView
);
mDatas
=
new
ArrayList
<>();
initListener
();
initListener
();
return
view
;
return
view
;
}
}
...
@@ -74,19 +82,28 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
...
@@ -74,19 +82,28 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
startActivity
(
intent
);
startActivity
(
intent
);
}
}
});
});
RxBus
.
getDefault
().
toObservable
(
OrderState
.
class
).
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
OrderState
>()
{
@Override
public
void
accept
(
OrderState
orderState
)
throws
Exception
{
Order
order
=
mDatas
.
get
(
orderState
.
getPosition
());
if
(
orderState
.
getState
()
==
MODIFY_TIME
)
{
order
.
setSubStatus
(
1
);
order
.
setStatus
(
3
);
}
else
if
(
orderState
.
getState
()
==
ORDER_FINISH
)
{
order
.
setSubStatus
(
4
);
order
.
setStatus
(
6
);
}
mAdapter
.
setNewData
(
mDatas
);
mAdapter
.
loadMoreEnd
();
}
});
}
}
@Override
@Override
public
void
onResume
()
{
public
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
// ProgressUtil.startLoad(mContext);
// mPresenter.getWatingOrder(Constants.WATING_SERVER, mPage, mPageSize, siteId, userId);
LocationUtils
.
getCurrentLocation
(
new
LocationUtils
.
MyLocationListener
()
{
@Override
public
void
result
(
AMapLocation
location
)
{
Log
.
d
(
"location"
,
"纬度"
+
location
.
getLatitude
()
+
"经度"
+
location
.
getLongitude
());
}
});
}
}
@Override
@Override
...
@@ -104,7 +121,10 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
...
@@ -104,7 +121,10 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
if
(
mRefreshState
==
1
)
{
if
(
mRefreshState
==
1
)
{
mRefreshLayout
.
setRefreshing
(
false
);
mRefreshLayout
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
data
.
getData
());
mAdapter
.
setNewData
(
data
.
getData
());
mDatas
.
clear
();
mDatas
.
addAll
(
data
.
getData
());
}
else
{
}
else
{
mDatas
.
addAll
(
data
.
getData
());
mAdapter
.
addData
(
data
.
getData
());
mAdapter
.
addData
(
data
.
getData
());
}
}
if
(
mPage
==
mTotalPage
)
{
if
(
mPage
==
mTotalPage
)
{
...
@@ -115,8 +135,12 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
...
@@ -115,8 +135,12 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
}
}
mAdapter
.
notifyDataSetChanged
();
mAdapter
.
notifyDataSetChanged
();
}
else
{
}
else
{
mRefreshLayout
.
setRefreshing
(
false
);
if
(
mRefreshLayout
.
isRefreshing
())
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
mRefreshLayout
.
setRefreshing
(
false
);
}
if
(
mDatas
.
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
}
}
}
}
...
@@ -126,16 +150,6 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
...
@@ -126,16 +150,6 @@ public class OrderSecondTabFragment extends BaseFragment<OrderTwoTabPresenter, O
}
}
@Override
@Override
public
void
setartOrderSuccess
()
{
}
@Override
public
void
setartServerSuccess
()
{
}
@Override
public
void
onRefresh
()
{
public
void
onRefresh
()
{
mRefreshState
=
1
;
mRefreshState
=
1
;
mPage
=
1
;
mPage
=
1
;
...
...
app/src/main/java/com/dayu/bigfish/utils/LocationUtils.java
View file @
92a16416
...
@@ -15,11 +15,11 @@ public class LocationUtils {
...
@@ -15,11 +15,11 @@ public class LocationUtils {
private
static
AMapLocationClient
mlocationClient
;
private
static
AMapLocationClient
mlocationClient
;
public
static
AMapLocationClientOption
mLocationOption
=
null
;
public
static
AMapLocationClientOption
mLocationOption
=
null
;
public
static
AMapLocation
sLocation
=
null
;
public
static
AMapLocation
sLocation
=
null
;
/**
/**
*
*
@param context
* @Title: init
* @Title: init
* @Description: 初始化地图导航,在Application onCreate中调用,只需调用一次
* @Description: 初始化地图导航,在Application onCreate中调用,只需调用一次
* @param context
*/
*/
public
static
void
init
(
Context
context
)
{
public
static
void
init
(
Context
context
)
{
// 声明mLocationOption对象
// 声明mLocationOption对象
...
@@ -29,30 +29,31 @@ public class LocationUtils {
...
@@ -29,30 +29,31 @@ public class LocationUtils {
// 设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
// 设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
mLocationOption
.
setLocationMode
(
AMapLocationClientOption
.
AMapLocationMode
.
Hight_Accuracy
);
mLocationOption
.
setLocationMode
(
AMapLocationClientOption
.
AMapLocationMode
.
Hight_Accuracy
);
// 设置定位间隔,单位毫秒,默认为2000ms
// 设置定位间隔,单位毫秒,默认为2000ms
mLocationOption
.
setInterval
(
2000
);
// mLocationOption.setInterval(2000);
// 设置定位参数
mLocationOption
.
setOnceLocation
(
true
);
mLocationOption
.
setOnceLocationLatest
(
true
);
// 设置定位参数、、
mlocationClient
.
setLocationOption
(
mLocationOption
);
mlocationClient
.
setLocationOption
(
mLocationOption
);
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
// 在定位结束后,在合适的生命周期调用onDestroy()方法
// 在定位结束后,在合适的生命周期调用onDestroy()方法
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
}
}
/**
/**
*
*
@author frank.fun@qq.com
* @ClassName: MyLocationListener
* @ClassName: MyLocationListener
* @Description: 定位结果回调
* @Description: 定位结果回调
* @author frank.fun@qq.com
* @date 2017年1月8日 下午1:53:11
* @date 2017年1月8日 下午1:53:11
*
*/
*/
public
interface
MyLocationListener
{
public
interface
MyLocationListener
{
public
void
result
(
AMapLocation
location
);
public
void
result
(
AMapLocation
location
);
}
}
/**
/**
*
*
@param listener
* @Title: getLocation
* @Title: getLocation
* @Description: 获取位置,如果之前获取过定位结果,则不会重复获取
* @Description: 获取位置,如果之前获取过定位结果,则不会重复获取
* @param listener
*/
*/
public
static
void
getLocation
(
MyLocationListener
listener
)
{
public
static
void
getLocation
(
MyLocationListener
listener
)
{
if
(
sLocation
==
null
)
{
if
(
sLocation
==
null
)
{
...
@@ -61,14 +62,14 @@ public class LocationUtils {
...
@@ -61,14 +62,14 @@ public class LocationUtils {
listener
.
result
(
sLocation
);
listener
.
result
(
sLocation
);
}
}
}
}
/**
/**
*
*
@param listener
* @Title: getCurrentLocation
* @Title: getCurrentLocation
* @Description: 获取位置,重新发起获取位置请求
* @Description: 获取位置,重新发起获取位置请求
* @param listener
*/
*/
public
static
void
getCurrentLocation
(
final
MyLocationListener
listener
)
{
public
static
void
getCurrentLocation
(
final
MyLocationListener
listener
)
{
if
(
mlocationClient
==
null
)
{
if
(
mlocationClient
==
null
)
{
return
;
return
;
}
}
// 设置定位监听
// 设置定位监听
...
@@ -79,22 +80,32 @@ public class LocationUtils {
...
@@ -79,22 +80,32 @@ public class LocationUtils {
if
(
location
!=
null
)
{
if
(
location
!=
null
)
{
//定位成功,取消定位
//定位成功,取消定位
mlocationClient
.
stopLocation
();
mlocationClient
.
stopLocation
();
sLocation
=
location
;
sLocation
=
location
;
listener
.
result
(
location
);
listener
.
result
(
location
);
}
else
{
}
else
{
//获取定位数据失败
//获取定位数据失败
ToastUtils
.
showShortToast
(
"获取定位失败"
);
mlocationClient
.
stopLocation
();
}
}
}
}
});
});
// 启动定位
// 启动定位
mlocationClient
.
startLocation
();
mlocationClient
.
startLocation
();
}
}
/**
/**
*
* @Title: destroy
* @Title: destroy
* @Description: 销毁定位,必须在退出程序时调用,否则定位会发生异常
* @Description: 销毁定位,必须在退出程序时调用,否则定位会发生异常
*/
*/
public
static
void
destroy
()
{
public
static
void
destroy
()
{
mlocationClient
.
onDestroy
();
mlocationClient
.
onDestroy
();
}
}
/**
* @Title: destroy
* @Description: 销毁定位,必须在退出程序时调用,否则定位会发生异常
*/
public
static
void
stop
()
{
mlocationClient
.
stopLocation
();
}
}
}
app/src/main/java/com/dayu/bigfish/utils/UtilsDate.java
View file @
92a16416
...
@@ -281,7 +281,7 @@ public class UtilsDate {
...
@@ -281,7 +281,7 @@ public class UtilsDate {
/**
/**
* 比较两个日期的年差
* 比较两个日期的年差
*
*
* @param befor
* @param befor
e
* @param after
* @param after
* @return
* @return
*/
*/
...
...
app/src/main/res/layout/activity_main_layout.xml
View file @
92a16416
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
Frame
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<FrameLayout
<RelativeLayout
android:id=
"@+id/fl_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"0dp"
/>
android:layout_weight=
"1"
>
<FrameLayout
android:id=
"@+id/fl_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:background=
"@drawable/actionbar_shadow_up"
/>
</RelativeLayout>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_tab"
android:id=
"@+id/ll_tab"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"53.3dp"
android:layout_height=
"53.3dp"
android:layout_gravity=
"bottom"
android:background=
"@color/cl_home_listview_bg"
android:background=
"@color/cl_home_listview_bg"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:visibility=
"visible"
>
>
<TextView
<TextView
...
@@ -81,7 +97,6 @@
...
@@ -81,7 +97,6 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"10dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:gravity=
"center"
>
>
<TextView
<TextView
...
@@ -90,20 +105,21 @@
...
@@ -90,20 +105,21 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawablePadding=
"2dp"
android:drawablePadding=
"2dp"
android:drawableTop=
"@drawable/tab_third_selector"
android:drawableTop=
"@drawable/tab_third_selector"
android:gravity=
"center"
android:text=
"消息"
android:text=
"消息"
android:textColor=
"#585858"
android:textColor=
"#585858"
android:layout_centerInParent=
"true"
android:textSize=
"10sp"
android:textSize=
"10sp"
android:gravity=
"center"
/>
/>
<ImageView
<ImageView
android:id=
"@+id/iv_message"
android:id=
"@+id/iv_message"
android:layout_width=
"wrap_content"
android:layout_width=
"10dp"
android:layout_height=
"wrap_content"
android:layout_height=
"10dp"
android:layout_alignEnd=
"@id/tab_third"
android:layout_alignParentTop=
"true"
android:layout_alignRight=
"@id/tab_third"
android:src=
"@mipmap/renwu_numbg"
android:src=
"@mipmap/renwu_numbg"
android:layout_alignParentRight=
"true"
android:layout_alignParentTop=
"true"
android:layout_marginRight=
"25dp"
android:visibility=
"visible"
/>
android:visibility=
"visible"
/>
</RelativeLayout>
</RelativeLayout>
...
@@ -124,10 +140,4 @@
...
@@ -124,10 +140,4 @@
</LinearLayout>
</LinearLayout>
<ImageView
</LinearLayout>
android:layout_width=
"match_parent"
\ No newline at end of file
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_marginBottom=
"53.3dp"
android:background=
"@drawable/actionbar_shadow_up"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_tabtwo_item.xml
View file @
92a16416
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_height=
"@dimen/size_order_item_line_height"
android:layout_height=
"@dimen/size_order_item_line_height"
android:layout_marginLeft=
"@dimen/size_order_item_line_ml"
android:layout_marginLeft=
"@dimen/size_order_item_line_ml"
android:background=
"@color/cl_order_item_line_bg"
/>
android:background=
"@color/cl_order_item_line_bg"
/>
<TextView
<TextView
android:id=
"@+id/item_tody"
android:id=
"@+id/item_tody"
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
android:layout_marginTop=
"@dimen/size_order_item_time_mt"
android:layout_marginTop=
"@dimen/size_order_item_time_mt"
android:text=
"@string/tv_order_item_time"
android:text=
"@string/tv_order_item_time"
android:textColor=
"@color/cl_tab_yellow"
android:textColor=
"@color/cl_tab_yellow"
android:textSize=
"@dimen/size_order_item_time_text"
/>
android:textSize=
"@dimen/size_order_item_time_text"
/>
<TextView
<TextView
android:id=
"@+id/item_time"
android:id=
"@+id/item_time"
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
android:layout_marginRight=
"@dimen/size_order_item_data_mr"
android:layout_marginRight=
"@dimen/size_order_item_data_mr"
android:text=
"@string/tv_order_item_date"
android:text=
"@string/tv_order_item_date"
android:textColor=
"@color/cl_tab_yellow"
android:textColor=
"@color/cl_tab_yellow"
android:textSize=
"@dimen/size_order_item_data_text"
/>
android:textSize=
"@dimen/size_order_item_data_text"
/>
<ImageView
<ImageView
android:id=
"@+id/item_image_user"
android:id=
"@+id/item_image_user"
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginTop=
"@dimen/size_order_item_tool_mt"
android:layout_marginTop=
"@dimen/size_order_item_tool_mt"
android:layout_toRightOf=
"@id/item_line"
android:layout_toRightOf=
"@id/item_line"
android:src=
"@mipmap/shouye_liebiao_user_icon"
/>
android:src=
"@mipmap/shouye_liebiao_user_icon"
/>
<TextView
<TextView
android:id=
"@+id/item_text_user_name"
android:id=
"@+id/item_text_user_name"
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
android:text=
"@string/tv_order_item_user_name"
android:text=
"@string/tv_order_item_user_name"
android:textColor=
"@color/cl_home_title_text_color"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<TextView
<TextView
android:id=
"@+id/item_text_user_phone"
android:id=
"@+id/item_text_user_phone"
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
android:text=
"@string/tv_order_item_user_phone"
android:text=
"@string/tv_order_item_user_phone"
android:textColor=
"@color/cl_home_title_text_color"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<ImageView
<ImageView
android:id=
"@+id/item_image_weixiu"
android:id=
"@+id/item_image_weixiu"
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginTop=
"46dp"
android:layout_marginTop=
"46dp"
android:layout_toRightOf=
"@id/item_line"
android:layout_toRightOf=
"@id/item_line"
android:src=
"@mipmap/shouye_liebiao_weixiu_icon"
/>
android:src=
"@mipmap/shouye_liebiao_weixiu_icon"
/>
<ImageView
<ImageView
android:id=
"@+id/item_image_dizhi"
android:id=
"@+id/item_image_dizhi"
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
android:layout_marginLeft=
"@dimen/size_order_item_gps_ml"
android:layout_marginLeft=
"@dimen/size_order_item_gps_ml"
android:layout_marginTop=
"71dp"
android:layout_marginTop=
"71dp"
android:layout_toRightOf=
"@id/item_line"
android:layout_toRightOf=
"@id/item_line"
android:src=
"@mipmap/shouye_liebiao_dizhi_icon"
/>
android:src=
"@mipmap/shouye_liebiao_dizhi_icon"
/>
<TextView
<TextView
android:id=
"@+id/item_text_weixiu"
android:id=
"@+id/item_text_weixiu"
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
android:layout_toRightOf=
"@id/item_image_weixiu"
android:layout_toRightOf=
"@id/item_image_weixiu"
android:text=
"@string/tv_order_item_tool_text"
android:text=
"@string/tv_order_item_tool_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
android:textSize=
"@dimen/size_login_hint_text"
/>
<TextView
<TextView
android:id=
"@+id/text_line"
android:id=
"@+id/text_line"
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"43dp"
android:layout_marginTop=
"43dp"
android:layout_toRightOf=
"@id/item_text_weixiu"
android:layout_toRightOf=
"@id/item_text_weixiu"
android:text=
" -- "
/>
android:text=
" -- "
/>
<TextView
<TextView
android:id=
"@+id/item_text_weixiu_leixing"
android:id=
"@+id/item_text_weixiu_leixing"
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
android:layout_toRightOf=
"@id/text_line"
android:layout_toRightOf=
"@id/text_line"
android:text=
"@string/tv_order_item_tool_text_leixing"
android:text=
"@string/tv_order_item_tool_text_leixing"
android:textColor=
"@color/cl_home_title_text_color"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
android:textSize=
"@dimen/size_login_hint_text"
/>
<TextView
<TextView
android:id=
"@+id/item_text_dizhi"
android:id=
"@+id/item_text_dizhi"
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
android:layout_toRightOf=
"@id/item_image_dizhi"
android:layout_toRightOf=
"@id/item_image_dizhi"
android:text=
"@string/tv_order_item_gps_text"
android:text=
"@string/tv_order_item_gps_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
android:textSize=
"@dimen/size_login_hint_text"
/>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
<LinearLayout
...
@@ -151,93 +151,43 @@
...
@@ -151,93 +151,43 @@
android:gravity=
"center"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_one_phone"
android:text=
"@string/tv_home_tab_one_phone"
android:textColor=
"@color/cl_white"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
/>
android:textSize=
"@dimen/sp_15"
/>
<ImageView
<ImageView
android:id=
"@+id/iv"
android:id=
"@+id/iv"
android:layout_width=
"@dimen/dp_0.7"
android:layout_width=
"@dimen/dp_0.7"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cl_home_button"
/>
android:background=
"@color/cl_home_button"
/>
<RelativeLayout
android:id=
"@+id/rl"
<TextView
android:id=
"@+id/item_updata_time"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
>
android:layout_weight=
"1"
android:background=
"@drawable/btn_updata_time_selector"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_updata_subscribe_time"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
/>
<TextView
android:id=
"@+id/item_updata_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/btn_updata_time_selector"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_updata_subscribe_time"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
/>
<TextView
android:id=
"@+id/item_restrt"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/btn_updata_time_selector"
android:gravity=
"center"
android:text=
"@string/item_restart"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
android:visibility=
"gone"
/>
</RelativeLayout>
<ImageView
<ImageView
android:layout_width=
"@dimen/dp_0.7"
android:layout_width=
"@dimen/dp_0.7"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cl_home_button"
/>
android:background=
"@color/cl_home_button"
/>
<RelativeLayout
<TextView
android:id=
"@+id/tv_item_process"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
>
android:layout_weight=
"1"
android:background=
"@drawable/btn_right_selector"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_start"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
/>
<TextView
android:id=
"@+id/item_start_depart"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/btn_right_selector"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_start"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
/>
<TextView
android:id=
"@+id/item_serve"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/btn_right_selector"
android:gravity=
"center"
android:text=
"@string/tv_work_order_four"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/item_order"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/btn_right_selector"
android:gravity=
"center"
android:text=
"@string/tv_tab_two_order"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/item_wait"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/btn_right_selector"
android:gravity=
"center"
android:text=
"@string/wait"
android:textColor=
"@color/cl_white"
android:textSize=
"@dimen/sp_15"
android:visibility=
"gone"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
gradle.properties
View file @
92a16416
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
# The setting is particularly useful for tweaking memory settings.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs
=
-Xmx1536m
org.gradle.jvmargs
=
-Xmx1536m
android.enableAapt2
=
false
android.enableAapt2
=
false
# When configured, Gradle will run in incubating parallel mode.
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
...
...
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