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
4f8a33bd
authored
7 years ago
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改progressUtil
parent
5fc07d16
master
…
dev
dev_xx
dev_xx_241116
dev_xx_250108_toast
dev_xx_250224_report
dev_xx_250414_sop
dev_xx_web
test
v2.7.2
v2.7.1
v2.7.0
v2.6.9
v2.6.7
v2.6.6
v2.6.5
v2.6.4
v2.6.3
v2.6.2
v2.6.1
v2.6.0
v2.5.9
v2.5.7
v2.5.5
v2.5.4
v2.5.3
v2.5.2
v2.5.0
v2.4.6
v2.4.5
v2.4.0
v_2.4.0
v2.3.2
v2.3.1
dev20230405
android_v1.6.0
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
61 additions
and
37 deletions
app/build.gradle
app/proguard-rules.pro
app/src/androidTest/java/com/dayu/bigfish/ExampleInstrumentedTest.java
app/src/main/java/com/dayu/bigfish/presenter/feedBack/FeedBackPresenter.java
app/src/test/java/com/dayu/bigfish/ExampleUnitTest.java
baseSDK/build.gradle
baseSDK/src/main/java/com/dayu/base/ui/presenter/BasePresenter.java
baseSDK/src/main/java/com/dayu/utils/ProgressUtil.java
locationComponent/src/main/java/com/dayu/location/base/LocationUtils.java
orderCenter/src/main/java/com/dayu/order/presenter/processorder/ProcessOrderPresenter.java
orderCenter/src/main/java/com/dayu/order/presenter/receivingorder/ReceivingPresenter.java
orderCenter/src/main/java/com/dayu/order/presenter/subcribeTime/SubcribeContract.java
orderCenter/src/main/java/com/dayu/order/presenter/subcribeTime/SubcribeTimePresenter.java
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderAdapter.java
app/build.gradle
View file @
4f8a33bd
...
...
@@ -84,7 +84,7 @@ repositories {
dependencies
{
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
testCompile
'junit:junit:4.12'
//ARouter
annotationProcessor
"com.alibaba:arouter-compiler:$arouter_compiler_version"
...
...
This diff is collapsed.
Click to expand it.
app/proguard-rules.pro
View file @
4f8a33bd
...
...
@@ -121,6 +121,7 @@
-keep class com.dayu.order.sqlbean.
*
* { *; }
-keep class com.dayu.provider.event.
*
* { *; }
-keep class com.dayu.usercenter.data.protocol.
*
* { *; }
-keep class com.dayu.event.
*
* { *; }
#-------------------------------------------------------------------------
#---------------------------------2.第三方包-------------------------------
...
...
This diff is collapsed.
Click to expand it.
app/src/androidTest/java/com/dayu/bigfish/ExampleInstrumentedTest.java
View file @
4f8a33bd
...
...
@@ -7,6 +7,7 @@ import android.support.test.runner.AndroidJUnit4;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
junit
.
framework
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.*;
/**
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/com/dayu/bigfish/presenter/feedBack/FeedBackPresenter.java
View file @
4f8a33bd
...
...
@@ -67,4 +67,5 @@ public class FeedBackPresenter extends FeedBackContract.Presenter {
mView
.
dumpBack
();
}));
}
}
This diff is collapsed.
Click to expand it.
app/src/test/java/com/dayu/bigfish/ExampleUnitTest.java
View file @
4f8a33bd
package
com
.
dayu
.
bigfish
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
import
com.dayu.bigfish.presenter.feedBack.FeedBackPresenter
;
import
org.junit.Before
;
import
org.junit.Test
;
/**
* Example local unit test, which will execute on the development machine (host).
...
...
@@ -10,9 +12,18 @@ import static org.junit.Assert.*;
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public
class
ExampleUnitTest
{
private
int
a
;
private
int
b
;
@Before
public
void
init
()
{
a
=
2
;
b
=
3
;
}
@Test
public
void
addition_isCorrect
()
throws
Exception
{
assertEquals
(
4
,
2
+
2
);
//test1
FeedBackPresenter
presenter
=
new
FeedBackPresenter
();
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
baseSDK/build.gradle
View file @
4f8a33bd
...
...
@@ -39,6 +39,7 @@ dependencies {
androidTestImplementation
(
'com.android.support.test.espresso:espresso-core:3.0.1'
,
{
exclude
group:
'com.android.support'
,
module:
'support-annotations'
})
testCompile
'junit:junit:4.12'
compile
'com.android.support:design:27.1.0'
//mutidex
compile
'com.android.support:multidex:1.0.3'
...
...
@@ -60,6 +61,5 @@ dependencies {
compile
'com.github.lzyzsd:jsbridge:1.0.4'
compile
project
(
':locationComponent'
)
// compile(name: 'locationLibrary-debug', ext: 'aar')
}
This diff is collapsed.
Click to expand it.
baseSDK/src/main/java/com/dayu/base/ui/presenter/BasePresenter.java
View file @
4f8a33bd
...
...
@@ -20,7 +20,7 @@ import io.reactivex.functions.Consumer;
*/
public
abstract
class
BasePresenter
<
V
>
{
protected
V
mView
;
pr
otected
CompositeDisposable
mComDisposable
=
new
CompositeDisposable
();
pr
ivate
CompositeDisposable
mComDisposable
=
new
CompositeDisposable
();
public
void
setView
(
V
v
)
{
this
.
mView
=
v
;
...
...
@@ -65,7 +65,6 @@ public abstract class BasePresenter<V> {
@Override
public
void
onComplete
()
{
}
};
}
...
...
@@ -108,7 +107,6 @@ public abstract class BasePresenter<V> {
@Override
public
void
onComplete
()
{
}
};
}
...
...
This diff is collapsed.
Click to expand it.
baseSDK/src/main/java/com/dayu/utils/ProgressUtil.java
View file @
4f8a33bd
...
...
@@ -21,7 +21,8 @@ import com.dayu.common.BaseApplication;
import
java.util.List
;
/**
* Created by luofan on 16/7/20.
* Created by luofan
* on 16/7/20.
*/
public
class
ProgressUtil
{
private
static
final
int
START_DIALOG
=
0
;
//开始对话框
...
...
@@ -30,6 +31,7 @@ public class ProgressUtil {
private
static
AlertDialog
dialog
=
null
;
private
static
TextView
title
=
null
;
private
static
Context
context
=
null
;
private
static
boolean
mCanDismiss
=
true
;
private
static
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
())
{
public
void
handleMessage
(
Message
msg
)
{
...
...
@@ -43,11 +45,11 @@ public class ProgressUtil {
return
;
}
init
(
context
,
message
);
isTouchDismiss
(
true
);
isTouchDismiss
(
mCanDismiss
);
break
;
case
UPDATE_DIALOG:
// 更新加载框
message
=
(
String
)
msg
.
obj
;
if
(
title
.
VISIBLE
==
View
.
VISIBLE
)
{
if
(
title
.
getVisibility
()
==
View
.
VISIBLE
)
{
if
(
TextUtils
.
isEmpty
(
message
))
{
title
.
setVisibility
(
View
.
GONE
);
}
else
{
...
...
@@ -204,6 +206,10 @@ public class ProgressUtil {
}
}
public
static
void
setCanDismiss
(
boolean
flag
)
{
mCanDismiss
=
flag
;
}
/**
* @方法说明:让警告框消失
* @方法名称:dismiss
...
...
@@ -211,6 +217,7 @@ public class ProgressUtil {
*/
public
static
void
stopLoad
()
{
handler
.
sendEmptyMessage
(
STOP_DIALOG
);
mCanDismiss
=
true
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
locationComponent/src/main/java/com/dayu/location/base/LocationUtils.java
View file @
4f8a33bd
...
...
@@ -93,6 +93,7 @@ public class LocationUtils {
@Override
public
void
onLocationChanged
(
AMapLocation
location
)
{
mHandler
=
null
;
if
(
location
!=
null
&&
flag
)
{
flag
=
false
;
//定位成功,取消定位
...
...
This diff is collapsed.
Click to expand it.
orderCenter/src/main/java/com/dayu/order/presenter/processorder/ProcessOrderPresenter.java
View file @
4f8a33bd
...
...
@@ -20,6 +20,7 @@ import com.dayu.order.ui.activity.ServerInstructionActivity;
import
com.dayu.order.ui.activity.SopWebViewActivity
;
import
com.dayu.provider.event.OrderState
;
import
com.dayu.provider.event.RefreshTab
;
import
com.dayu.utils.ProgressUtil
;
import
com.dayu.utils.UserManager
;
import
com.luck.picture.lib.tools.PictureFileUtils
;
import
com.umeng.analytics.MobclickAgent
;
...
...
@@ -188,7 +189,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
@Override
public
void
saveOrder
()
{
if
(
mImages
!=
null
&&
mImages
.
size
()
>
0
)
{
mView
.
getData
();
mView
.
getData
();
mOrderField
.
get
().
setImgPath
(
mImages
);
}
mOrderInfoDao
.
insertOrReplace
(
mOrderField
.
get
());
...
...
@@ -199,6 +200,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
@Override
public
void
submitOrder
()
{
ProgressUtil
.
setCanDismiss
(
false
);
mView
.
showDialog
();
if
(
buttonState
.
get
())
{
isPay
=
2
;
...
...
@@ -209,7 +211,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
mView
.
showDialog
();
commitPhoto
(
mImages
);
}
else
{
mView
.
getData
();
mView
.
getData
();
OrderInfo
info
=
mOrderField
.
get
();
commitOrder
(
null
,
mOrderId
,
info
.
getServerRecord
(),
mAccountId
,
isPay
,
info
.
getDoorPrice
(),
info
.
getOtherInfo
(),
...
...
This diff is collapsed.
Click to expand it.
orderCenter/src/main/java/com/dayu/order/presenter/receivingorder/ReceivingPresenter.java
View file @
4f8a33bd
...
...
@@ -6,15 +6,15 @@ import android.os.Bundle;
import
com.dayu.base.api.protocol.BasePageBean
;
import
com.dayu.common.BaseApplication
;
import
com.dayu.common.Constants
;
import
com.dayu.provider.event.RefreshReceivingNum
;
import
com.dayu.provider.event.RefreshTab
;
import
com.dayu.event.UserInfo
;
import
com.dayu.order.R
;
import
com.dayu.order.api.OrderApiFactory
;
import
com.dayu.order.api.protocol.Order
;
import
com.dayu.order.ui.activity.OrderDetailsActivity
;
import
com.dayu.provider.event.RefreshApoiment
;
import
com.dayu.provider.event.RefreshReceivingNum
;
import
com.dayu.provider.event.RefreshTab
;
import
com.dayu.provider.event.SwtichFragment
;
import
com.dayu.order.ui.activity.OrderDetailsActivity
;
import
com.dayu.utils.UserManager
;
import
com.umeng.analytics.MobclickAgent
;
...
...
@@ -30,7 +30,7 @@ import io.reactivex.disposables.Disposable;
* on 2017/11/8.
*/
public
class
ReceivingPresenter
extends
ReceivingContract
.
Presenter
{
p
ublic
ObservableField
datas
=
new
ObservableField
<>();
p
rivate
ObservableField
<
Object
>
datas
=
new
ObservableField
<>();
private
int
mTotalRows
;
private
Disposable
mDisPosable
;
private
int
mUserId
;
...
...
@@ -48,29 +48,29 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
@Override
public
void
getOrders
(
int
state
,
int
page
,
int
pageSize
,
int
siteId
,
int
userId
)
{
OrderApiFactory
.
getOrders
(
state
,
page
,
pageSize
,
siteId
,
userId
).
subscribe
(
baseObserver
(
orderBasePageBean
->
getOrderSuccess
(
orderBasePageBean
)
,
throwable
->
datas
.
set
(
Constants
.
FAILED
)));
OrderApiFactory
.
getOrders
(
state
,
page
,
pageSize
,
siteId
,
userId
).
subscribe
(
baseObserver
(
this
::
getOrderSuccess
,
throwable
->
datas
.
set
(
Constants
.
FAILED
)));
}
@Override
public
void
receiveOrder
(
int
orders
,
int
engineer
)
{
OrderApiFactory
.
receiveOrder
(
orders
,
engineer
).
subscribe
(
baseObserver
(
aBoolean
->
receiveOrderSuccess
(),
responeThrowable
->
{
if
(
"ORDER0002"
.
equals
(
responeThrowable
.
subCode
)
||
"ORDER0003"
.
equals
(
responeThrowable
.
subCode
))
{
refresh
();
}
}));
if
(
"ORDER0002"
.
equals
(
responeThrowable
.
subCode
)
||
"ORDER0003"
.
equals
(
responeThrowable
.
subCode
))
{
refresh
();
}
}));
}
p
ublic
void
getOrderSuccess
(
BasePageBean
<
Order
>
orderBasePageBean
)
{
p
rivate
void
getOrderSuccess
(
BasePageBean
<
Order
>
orderBasePageBean
)
{
datas
.
set
(
orderBasePageBean
);
mTotalRows
=
orderBasePageBean
.
getTotalRows
();
EventBus
.
getDefault
().
post
(
new
RefreshReceivingNum
(
mTotalRows
));
mPage
++;
}
p
ublic
void
receiveOrderSuccess
()
{
p
rivate
void
receiveOrderSuccess
()
{
int
num
=
mTotalRows
-
1
;
mView
.
showToast
(
R
.
string
.
receive_order_success
);
mView
.
dumpBack
();
...
...
@@ -102,8 +102,8 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
@Override
public
void
dumpDetail
(
int
orderId
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
ORDER_ID
,
orderId
);
mView
.
startActivity
(
OrderDetailsActivity
.
class
,
bundle
);
bundle
.
putInt
(
Constants
.
ORDER_ID
,
orderId
);
mView
.
startActivity
(
OrderDetailsActivity
.
class
,
bundle
);
MobclickAgent
.
onEvent
(
BaseApplication
.
getContext
(),
"check_order_detail"
);
}
...
...
This diff is collapsed.
Click to expand it.
orderCenter/src/main/java/com/dayu/order/presenter/subcribeTime/SubcribeContract.java
View file @
4f8a33bd
...
...
@@ -16,14 +16,12 @@ public interface SubcribeContract {
* 选择时间.
*/
void
selectTime
(
boolean
[]
type
,
TimePickerView
.
OnTimeSelectListener
listener
);
}
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
/**
*
* @param orderId 订单id.
* @param doorTime 上门时间.
* @param orderId 订单id.
* @param doorTime 上门时间.
* @param doorComment 备注.
*/
public
abstract
void
subcribeTime
(
int
orderId
,
String
doorTime
,
String
doorComment
);
...
...
@@ -41,7 +39,6 @@ public interface SubcribeContract {
/**
* 选择时间.
*
*/
public
abstract
void
selectTime
();
}
...
...
This diff is collapsed.
Click to expand it.
orderCenter/src/main/java/com/dayu/order/presenter/subcribeTime/SubcribeTimePresenter.java
View file @
4f8a33bd
...
...
@@ -12,6 +12,7 @@ import com.dayu.provider.event.OrderState;
import
com.dayu.provider.event.RefreshApoiment
;
import
com.dayu.provider.event.RefreshServe
;
import
com.dayu.provider.event.RefreshTab
;
import
com.dayu.utils.ProgressUtil
;
import
com.dayu.utils.UIUtils
;
import
com.dayu.utils.UtilsDate
;
import
com.dayu.utils.UtilsUserAccountMatcher
;
...
...
@@ -74,7 +75,9 @@ public class SubcribeTimePresenter extends SubcribeContract.Presenter {
mView
.
showToast
(
R
.
string
.
input_day_time
);
return
;
}
else
{
ProgressUtil
.
setCanDismiss
(
false
);
mView
.
showDialog
();
ProgressUtil
.
isTouchDismiss
(
false
);
mView
.
showToast
(
R
.
string
.
on_commite_data
);
try
{
String
d
=
UtilsDate
.
changeFormat
(
mDay
.
get
(),
LONG_DATE
,
LONG_DATE_FORMAT
);
...
...
@@ -111,7 +114,7 @@ public class SubcribeTimePresenter extends SubcribeContract.Presenter {
EventBus
.
getDefault
().
post
(
new
RefreshTab
(
3
));
EventBus
.
getDefault
().
post
(
new
RefreshServe
(
1
));
}
//
mView.dumpBack();
mView
.
dumpBack
();
}
}));
}
...
...
This diff is collapsed.
Click to expand it.
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderAdapter.java
View file @
4f8a33bd
...
...
@@ -9,16 +9,16 @@ import android.view.View;
import
com.amap.api.location.AMapLocation
;
import
com.dayu.base.ui.adapter.CoreAdapter
;
import
com.dayu.common.Constants
;
import
com.dayu.provider.event.RefreshTab
;
import
com.dayu.location.base.LocationUtils
;
import
com.dayu.order.R
;
import
com.dayu.order.api.protocol.Order
;
import
com.dayu.order.databinding.FragmentOrderdoingItemBinding
;
import
com.dayu.provider.event.RefreshServe
;
import
com.dayu.order.presenter.orderdoing.OrderDoingPresenter
;
import
com.dayu.order.ui.activity.ProcessOrderActivity
;
import
com.dayu.order.ui.activity.SopWebViewActivity
;
import
com.dayu.order.ui.activity.SubcribeTimeActivity
;
import
com.dayu.provider.event.RefreshServe
;
import
com.dayu.provider.event.RefreshTab
;
import
com.dayu.utils.ProgressUtil
;
import
com.dayu.utils.UtilsDate
;
import
com.umeng.analytics.MobclickAgent
;
...
...
@@ -260,6 +260,7 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
return
;
}
if
(
mItem
.
getStatus
()
==
3
)
{
ProgressUtil
.
setCanDismiss
(
false
);
ProgressUtil
.
startLoad
(
mContext
);
LocationUtils
.
getCurrentLocation
(
new
LocationUtils
.
MyLocationListener
()
{
@Override
...
...
This diff is collapsed.
Click to expand it.
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