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
e85544c8
authored
Jan 15, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mactivity.finish替换为mview.dumpback
parent
0765eacd
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
32 additions
and
28 deletions
app/src/main/java/com/dayu/bigfish/base/BaseActivity.java
app/src/main/java/com/dayu/bigfish/base/BaseFragment.java
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
app/src/main/java/com/dayu/bigfish/base/BaseView.java
app/src/main/java/com/dayu/bigfish/presenter/Withdrawals/WithdrawalsPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/accountbalance/AccountBalanceContract.java
app/src/main/java/com/dayu/bigfish/presenter/accountbalance/AccountBalancePresenter.java
app/src/main/java/com/dayu/bigfish/presenter/feedback/FeedBackPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/main/MainPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/processorder/ProcessOrderPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/setting/SettingPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/subcribeTime/SubcribeTimePresenter.java
app/src/main/java/com/dayu/bigfish/utils/AppUtils.java
app/src/main/java/com/dayu/bigfish/base/BaseActivity.java
View file @
e85544c8
...
@@ -63,7 +63,7 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
...
@@ -63,7 +63,7 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
ProgressUtil
.
stopLoad
();
ProgressUtil
.
stopLoad
();
}
}
public
void
dum
b
Back
()
{
public
void
dum
p
Back
()
{
mActivity
.
finish
();
mActivity
.
finish
();
}
}
...
...
app/src/main/java/com/dayu/bigfish/base/BaseFragment.java
View file @
e85544c8
...
@@ -40,6 +40,10 @@ public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBi
...
@@ -40,6 +40,10 @@ public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBi
if
(
mPresenter
!=
null
)
mPresenter
.
onDetached
();
if
(
mPresenter
!=
null
)
mPresenter
.
onDetached
();
}
}
public
void
dumpBack
()
{
mActivity
.
finish
();
}
public
void
showToast
(
int
resId
)
{
public
void
showToast
(
int
resId
)
{
ToastUtils
.
showShortToast
(
resId
);
ToastUtils
.
showShortToast
(
resId
);
}
}
...
...
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
View file @
e85544c8
...
@@ -163,7 +163,7 @@ public abstract class BasePresenter<V> {
...
@@ -163,7 +163,7 @@ public abstract class BasePresenter<V> {
public
void
dumpBack
()
{
public
void
dumpBack
()
{
if
(
mView
instanceof
BaseActivity
)
{
if
(
mView
instanceof
BaseActivity
)
{
((
BaseActivity
)
mView
).
dum
b
Back
();
((
BaseActivity
)
mView
).
dum
p
Back
();
}
}
}
}
}
}
app/src/main/java/com/dayu/bigfish/base/BaseView.java
View file @
e85544c8
...
@@ -17,6 +17,8 @@ public interface BaseView {
...
@@ -17,6 +17,8 @@ public interface BaseView {
void
hideDialog
();
void
hideDialog
();
void
dumpBack
();
void
startActivity
(
Class
cls
);
void
startActivity
(
Class
cls
);
void
startActivity
(
Class
<?>
clz
,
Bundle
bundle
);
void
startActivity
(
Class
<?>
clz
,
Bundle
bundle
);
...
...
app/src/main/java/com/dayu/bigfish/presenter/Withdrawals/WithdrawalsPresenter.java
View file @
e85544c8
...
@@ -60,7 +60,7 @@ public class WithdrawalsPresenter extends WithdrawalsContract.Presenter {
...
@@ -60,7 +60,7 @@ public class WithdrawalsPresenter extends WithdrawalsContract.Presenter {
@Override
@Override
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
mView
.
showToast
(
R
.
string
.
comfirm_alipay_account_success
);
mView
.
showToast
(
R
.
string
.
comfirm_alipay_account_success
);
m
Activity
.
finish
();
m
View
.
dumpBack
();
}
}
}));
}));
}
}
...
@@ -71,7 +71,7 @@ public class WithdrawalsPresenter extends WithdrawalsContract.Presenter {
...
@@ -71,7 +71,7 @@ public class WithdrawalsPresenter extends WithdrawalsContract.Presenter {
@Override
@Override
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
mView
.
showToast
(
R
.
string
.
modify_alipay_account_success
);
mView
.
showToast
(
R
.
string
.
modify_alipay_account_success
);
m
Activity
.
finish
();
m
View
.
dumpBack
();
}
}
}));
}));
}
}
...
...
app/src/main/java/com/dayu/bigfish/presenter/accountbalance/AccountBalanceContract.java
View file @
e85544c8
...
@@ -10,7 +10,6 @@ import com.dayu.bigfish.base.BaseView;
...
@@ -10,7 +10,6 @@ import com.dayu.bigfish.base.BaseView;
public
interface
AccountBalanceContract
{
public
interface
AccountBalanceContract
{
interface
View
extends
BaseView
{
interface
View
extends
BaseView
{
}
}
abstract
class
Presenter
extends
BaseListPresenter
<
View
>
{
abstract
class
Presenter
extends
BaseListPresenter
<
View
>
{
...
...
app/src/main/java/com/dayu/bigfish/presenter/accountbalance/AccountBalancePresenter.java
View file @
e85544c8
package
com
.
dayu
.
bigfish
.
presenter
.
accountbalance
;
package
com
.
dayu
.
bigfish
.
presenter
.
accountbalance
;
import
android.content.Intent
;
import
android.databinding.ObservableField
;
import
android.databinding.ObservableField
;
import
com.app.annotation.apt.InstanceFactory
;
import
com.app.annotation.apt.InstanceFactory
;
...
@@ -62,7 +61,6 @@ public class AccountBalancePresenter extends AccountBalanceContract.Presenter {
...
@@ -62,7 +61,6 @@ public class AccountBalancePresenter extends AccountBalanceContract.Presenter {
@Override
@Override
public
void
dumpToWithdrawal
()
{
public
void
dumpToWithdrawal
()
{
Intent
intent
=
new
Intent
(
mActivity
,
WithdrawalsActivity
.
class
);
mView
.
startActivity
(
WithdrawalsActivity
.
class
);
mActivity
.
startActivity
(
intent
);
}
}
}
}
app/src/main/java/com/dayu/bigfish/presenter/feedback/FeedBackPresenter.java
View file @
e85544c8
...
@@ -58,7 +58,7 @@ public class FeedBackPresenter extends FeedBackContract.Presenter {
...
@@ -58,7 +58,7 @@ public class FeedBackPresenter extends FeedBackContract.Presenter {
@Override
@Override
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
mView
.
showToast
(
R
.
string
.
commite_success
);
mView
.
showToast
(
R
.
string
.
commite_success
);
m
Activity
.
finish
();
m
View
.
dumpBack
();
}
}
}));
}));
}
}
...
...
app/src/main/java/com/dayu/bigfish/presenter/main/MainPresenter.java
View file @
e85544c8
...
@@ -55,8 +55,8 @@ public class MainPresenter extends MainContract.Presenter {
...
@@ -55,8 +55,8 @@ public class MainPresenter extends MainContract.Presenter {
}
}
private
void
request
()
{
private
void
request
()
{
commitVersionInfo
(
mAccountId
,
AppUtils
.
getIMEI
(
mActivity
),
"2"
,
AppUtils
.
getPackageNum
(
mActivity
));
commitVersionInfo
(
mAccountId
,
AppUtils
.
getIMEI
(
),
"2"
,
AppUtils
.
getPackageNum
(
));
getNewVersion
(
AppUtils
.
getPackageNum
(
mActivity
));
getNewVersion
(
AppUtils
.
getPackageNum
());
getReceiveOrder
(
Constants
.
WATING_ORDER
,
mAccountId
,
mSiteId
,
1
,
20
);
getReceiveOrder
(
Constants
.
WATING_ORDER
,
mAccountId
,
mSiteId
,
1
,
20
);
getHxNum
(
mUser
.
getHxAccount
());
getHxNum
(
mUser
.
getHxAccount
());
}
}
...
@@ -86,7 +86,7 @@ public class MainPresenter extends MainContract.Presenter {
...
@@ -86,7 +86,7 @@ public class MainPresenter extends MainContract.Presenter {
@Override
@Override
public
void
commitVersionInfo
(
int
accoutId
,
String
imei
,
String
platform
,
String
versionCode
)
{
public
void
commitVersionInfo
(
int
accoutId
,
String
imei
,
String
platform
,
String
versionCode
)
{
if
(
SPUtils
.
get
(
Constants
.
OLD_PAKAGENUM
,
""
).
equals
(
mActivity
.
getPackageName
()))
{
if
(
SPUtils
.
get
(
Constants
.
OLD_PAKAGENUM
,
""
).
equals
(
MyApplication
.
getAppContext
()
.
getPackageName
()))
{
return
;
return
;
}
}
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
...
@@ -102,7 +102,7 @@ public class MainPresenter extends MainContract.Presenter {
...
@@ -102,7 +102,7 @@ public class MainPresenter extends MainContract.Presenter {
ApiFactory
.
commitVersionInfo
(
requestBody
).
subscribe
(
baseObserver
(
new
Consumer
<
Boolean
>()
{
ApiFactory
.
commitVersionInfo
(
requestBody
).
subscribe
(
baseObserver
(
new
Consumer
<
Boolean
>()
{
@Override
@Override
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
SPUtils
.
put
(
Constants
.
OLD_PAKAGENUM
,
mActivity
.
getPackageName
());
SPUtils
.
put
(
Constants
.
OLD_PAKAGENUM
,
MyApplication
.
getAppContext
()
.
getPackageName
());
}
}
}));
}));
}
}
...
@@ -164,7 +164,7 @@ public class MainPresenter extends MainContract.Presenter {
...
@@ -164,7 +164,7 @@ public class MainPresenter extends MainContract.Presenter {
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
(),
"sure_update_app"
);
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
(),
"sure_update_app"
);
}
else
{
}
else
{
if
(
info
.
getType
()
==
2
)
{
if
(
info
.
getType
()
==
2
)
{
m
Activity
.
finish
();
m
View
.
dumpBack
();
}
}
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
(),
"cancle_update_app"
);
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
(),
"cancle_update_app"
);
}
}
...
...
app/src/main/java/com/dayu/bigfish/presenter/processorder/ProcessOrderPresenter.java
View file @
e85544c8
...
@@ -9,6 +9,7 @@ import android.text.TextUtils;
...
@@ -9,6 +9,7 @@ import android.text.TextUtils;
import
com.app.annotation.apt.InstanceFactory
;
import
com.app.annotation.apt.InstanceFactory
;
import
com.apt.ApiFactory
;
import
com.apt.ApiFactory
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.bean.OrderDetail
;
import
com.dayu.bigfish.bean.OrderDetail
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.UserInfo
;
...
@@ -100,7 +101,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
...
@@ -100,7 +101,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
mOrderField
.
get
().
setOtherPrice
(
""
);
mOrderField
.
get
().
setOtherPrice
(
""
);
mOrderField
.
get
().
setOtherInfo
(
""
);
mOrderField
.
get
().
setOtherInfo
(
""
);
}
}
MobclickAgent
.
onEvent
(
mActivity
,
"get_customer_money"
);
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
()
,
"get_customer_money"
);
}
}
@Override
@Override
...
@@ -160,7 +161,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
...
@@ -160,7 +161,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
EventBus
.
getDefault
().
post
(
new
OrderState
(
status
,
mPosition
));
EventBus
.
getDefault
().
post
(
new
OrderState
(
status
,
mPosition
));
mOrderInfoDao
.
deleteByKey
((
long
)
orderId
);
mOrderInfoDao
.
deleteByKey
((
long
)
orderId
);
PictureFileUtils
.
deleteCacheDirFile
(
mActivity
);
PictureFileUtils
.
deleteCacheDirFile
(
mActivity
);
m
Activity
.
finish
();
m
View
.
dumpBack
();
}
}
}));
}));
}
}
...
...
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingPresenter.java
View file @
e85544c8
...
@@ -82,7 +82,7 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
...
@@ -82,7 +82,7 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
int
num
=
mTotalRows
-
1
;
int
num
=
mTotalRows
-
1
;
mView
.
showToast
(
R
.
string
.
receive_order_success
);
mView
.
showToast
(
R
.
string
.
receive_order_success
);
EventBus
.
getDefault
().
post
(
new
SwtichFragment
(
1
));
EventBus
.
getDefault
().
post
(
new
SwtichFragment
(
1
));
m
Activity
.
finish
();
m
View
.
dumpBack
();
mDisPosable
=
Observable
.
timer
(
300
,
TimeUnit
.
MILLISECONDS
).
subscribe
(
aLong
->
{
mDisPosable
=
Observable
.
timer
(
300
,
TimeUnit
.
MILLISECONDS
).
subscribe
(
aLong
->
{
EventBus
.
getDefault
().
post
(
new
RefreshTab
(
0
));
EventBus
.
getDefault
().
post
(
new
RefreshTab
(
0
));
EventBus
.
getDefault
().
post
(
new
RefreshReceivingNum
(
num
<
0
?
0
:
num
));
EventBus
.
getDefault
().
post
(
new
RefreshReceivingNum
(
num
<
0
?
0
:
num
));
...
...
app/src/main/java/com/dayu/bigfish/presenter/setting/SettingPresenter.java
View file @
e85544c8
...
@@ -10,6 +10,7 @@ import android.text.TextUtils;
...
@@ -10,6 +10,7 @@ import android.text.TextUtils;
import
com.app.annotation.apt.InstanceFactory
;
import
com.app.annotation.apt.InstanceFactory
;
import
com.apt.ApiFactory
;
import
com.apt.ApiFactory
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.ui.AboutUsActivity
;
import
com.dayu.bigfish.ui.AboutUsActivity
;
...
@@ -72,7 +73,7 @@ public class SettingPresenter extends SettingContract.Presenter {
...
@@ -72,7 +73,7 @@ public class SettingPresenter extends SettingContract.Presenter {
}
else
{
}
else
{
EMClient
.
getInstance
().
logout
(
true
);
EMClient
.
getInstance
().
logout
(
true
);
}
}
MobclickAgent
.
onEvent
(
mActivity
,
"swtich_message_button"
);
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
()
,
"swtich_message_button"
);
}
}
...
@@ -81,7 +82,7 @@ public class SettingPresenter extends SettingContract.Presenter {
...
@@ -81,7 +82,7 @@ public class SettingPresenter extends SettingContract.Presenter {
ApiFactory
.
checkVersion
(
"dayushifua_dayu"
).
subscribe
(
baseObserver
(
new
Consumer
<
String
>()
{
ApiFactory
.
checkVersion
(
"dayushifua_dayu"
).
subscribe
(
baseObserver
(
new
Consumer
<
String
>()
{
@Override
@Override
public
void
accept
(
String
s
)
throws
Exception
{
public
void
accept
(
String
s
)
throws
Exception
{
if
(
s
.
equals
(
AppUtils
.
getPackageNum
(
mActivity
)))
{
if
(
s
.
equals
(
AppUtils
.
getPackageNum
()))
{
mView
.
showToast
(
R
.
string
.
is_newversion
);
mView
.
showToast
(
R
.
string
.
is_newversion
);
}
else
{
}
else
{
mView
.
showToast
(
mActivity
.
getString
(
R
.
string
.
newversion_code
)
+
s
);
mView
.
showToast
(
mActivity
.
getString
(
R
.
string
.
newversion_code
)
+
s
);
...
...
app/src/main/java/com/dayu/bigfish/presenter/subcribeTime/SubcribeTimePresenter.java
View file @
e85544c8
...
@@ -102,7 +102,7 @@ public class SubcribeTimePresenter extends SubcribeContract.Presenter {
...
@@ -102,7 +102,7 @@ public class SubcribeTimePresenter extends SubcribeContract.Presenter {
}
else
if
(
mState
==
ORDER_YUYUE
||
mState
==
ORDER_DOING
)
{
}
else
if
(
mState
==
ORDER_YUYUE
||
mState
==
ORDER_DOING
)
{
EventBus
.
getDefault
().
post
(
new
OrderState
(
ORDER_YUYUE
,
mPosition
,
mTime
));
EventBus
.
getDefault
().
post
(
new
OrderState
(
ORDER_YUYUE
,
mPosition
,
mTime
));
}
}
m
Activity
.
finish
();
m
View
.
dumpBack
();
}
}
},
responeThrowable
->
{
},
responeThrowable
->
{
if
(
"ORDER0004"
.
equals
(
responeThrowable
.
subCode
))
{
if
(
"ORDER0004"
.
equals
(
responeThrowable
.
subCode
))
{
...
@@ -113,7 +113,7 @@ public class SubcribeTimePresenter extends SubcribeContract.Presenter {
...
@@ -113,7 +113,7 @@ public class SubcribeTimePresenter extends SubcribeContract.Presenter {
EventBus
.
getDefault
().
post
(
new
RefreshTab
(
3
));
EventBus
.
getDefault
().
post
(
new
RefreshTab
(
3
));
EventBus
.
getDefault
().
post
(
new
RefreshServe
(
1
));
EventBus
.
getDefault
().
post
(
new
RefreshServe
(
1
));
}
}
m
Activity
.
finish
();
m
View
.
dumpBack
();
}
}
}));
}));
}
}
...
...
app/src/main/java/com/dayu/bigfish/utils/AppUtils.java
View file @
e85544c8
package
com
.
dayu
.
bigfish
.
utils
;
package
com
.
dayu
.
bigfish
.
utils
;
import
android.content.Context
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
import
android.telephony.TelephonyManager
;
import
android.telephony.TelephonyManager
;
import
com.dayu.bigfish.MyApplication
;
/**
/**
* Created by luofan on 2017/11/7.
* Created by luofan on 2017/11/7.
*/
*/
public
class
AppUtils
{
public
class
AppUtils
{
public
static
final
int
REQUEST_PHONE_STATE_PERMISSION
=
0
;
/**
/**
* 获取设备IMEI编号
* 获取设备IMEI编号
*/
*/
public
static
String
getIMEI
(
Context
context
)
{
public
static
String
getIMEI
()
{
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
context
.
getSystemService
(
context
.
TELEPHONY_SERVICE
);
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
MyApplication
.
getAppContext
().
getSystemService
(
MyApplication
.
getAppContext
()
.
TELEPHONY_SERVICE
);
String
imei
=
telephonyManager
.
getDeviceId
();
String
imei
=
telephonyManager
.
getDeviceId
();
return
imei
;
return
imei
;
...
@@ -28,9 +27,9 @@ public class AppUtils {
...
@@ -28,9 +27,9 @@ public class AppUtils {
/**
/**
* 获取当前应用的版本号
* 获取当前应用的版本号
*/
*/
public
static
String
getPackageNum
(
Context
context
)
{
public
static
String
getPackageNum
()
{
try
{
try
{
PackageInfo
packageInfo
=
context
.
getPackageManager
().
getPackageInfo
(
context
.
getPackageName
(),
0
);
PackageInfo
packageInfo
=
MyApplication
.
getAppContext
().
getPackageManager
().
getPackageInfo
(
MyApplication
.
getAppContext
()
.
getPackageName
(),
0
);
String
packageName
=
packageInfo
.
versionName
;
String
packageName
=
packageInfo
.
versionName
;
return
packageName
;
return
packageName
;
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
...
...
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