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
8292e843
authored
Dec 14, 2017
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除所有basequikAdapter,用coreadapter代替,增加user类
parent
d3c66e52
Hide whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
1048 additions
and
2376 deletions
annotation_lib/build/libs/annotation_lib.jar
app/build.gradle
app/proguard-rules.pro
app/src/main/AndroidManifest.xml
app/src/main/java/com/dayu/bigfish/Constants.java
app/src/main/java/com/dayu/bigfish/api/Api.java
app/src/main/java/com/dayu/bigfish/base/CoreAdapter.java
app/src/main/java/com/dayu/bigfish/presenter/errororder/ErrorOrderContract.java
app/src/main/java/com/dayu/bigfish/presenter/orderdetailserve/OrderDetailServeContract.java
app/src/main/java/com/dayu/bigfish/presenter/orderdetailserve/OrderDetailServePresenter.java
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingContract.java
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingPresenter.java
app/src/main/java/com/dayu/bigfish/ui/AccountBalanceActivity.java
app/src/main/java/com/dayu/bigfish/ui/AccountBalanceActivity1.java
app/src/main/java/com/dayu/bigfish/ui/FeedBackActivity.java
app/src/main/java/com/dayu/bigfish/ui/LoginActivity.java
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
app/src/main/java/com/dayu/bigfish/ui/OrderRecordActivity.java
app/src/main/java/com/dayu/bigfish/ui/ProcessOrderActivity.java
app/src/main/java/com/dayu/bigfish/ui/ReceivingActivity.java
app/src/main/java/com/dayu/bigfish/ui/SettingActivity.java
app/src/main/java/com/dayu/bigfish/ui/SopWebViewActivity.java
app/src/main/java/com/dayu/bigfish/ui/WithdrawalsActivity.java
app/src/main/java/com/dayu/bigfish/ui/adapter/AccessoriesAdapter.java
app/src/main/java/com/dayu/bigfish/ui/adapter/AccountBalanceAdapter.java
app/src/main/java/com/dayu/bigfish/ui/adapter/FragmentOrderAdapter.java
app/src/main/java/com/dayu/bigfish/ui/adapter/OrderDoingAdapter.java → app/src/main/java/com/dayu/bigfish/ui/adapter/OrderAdapter.java
app/src/main/java/com/dayu/bigfish/ui/adapter/OrderFourTabAdapter.java
app/src/main/java/com/dayu/bigfish/ui/adapter/OrderThreeTabAdapter.java
app/src/main/java/com/dayu/bigfish/ui/adapter/ServeDatailsAdapter.java
app/src/main/java/com/dayu/bigfish/ui/adapter/SystemMessageAdapter.java
app/src/main/java/com/dayu/bigfish/ui/fragment/BigFishMessageFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/HomeOrderFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/HomePersonFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/MessageFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderDatailsServeFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderFirstTabFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderFourTabFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderSecondTabFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderThreeTabFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/SystemMessageFragment.java
app/src/main/java/com/dayu/bigfish/ui/listener/OnChildClickListener.java
app/src/main/java/com/dayu/bigfish/ui/views/LRecyclerView.java
app/src/main/java/com/dayu/bigfish/utils/DateUtils.java
app/src/main/java/com/dayu/bigfish/utils/GetUserInfo.java
app/src/main/java/com/dayu/bigfish/utils/LocationUtils.java
app/src/main/java/com/dayu/bigfish/utils/NetworkConnectChangedReceiver.java
app/src/main/java/com/dayu/bigfish/utils/SPUtils.java
app/src/main/java/com/dayu/bigfish/utils/TUtil.java
app/src/main/java/com/dayu/bigfish/utils/managers/UserManager.java
app/src/main/res/layout/activity_accountbalance_layout1.xml
app/src/main/res/layout/activity_order_record.xml
app/src/main/res/layout/activity_receiving.xml
app/src/main/res/layout/big_message_adapter.xml
app/src/main/res/layout/commom_recycle.xml
app/src/main/res/layout/fragment_message_bigfish.xml
app/src/main/res/layout/fragment_message_system.xml
app/src/main/res/layout/fragment_order_cancle_item.xml
app/src/main/res/layout/fragment_order_error_item.xml
app/src/main/res/layout/fragment_order_serve.xml
app/src/main/res/layout/fragment_orderdoing_item.xml
app/src/main/res/layout/item_account_balance_layout11.xml
app/src/main/res/layout/lrecycle_layout.xml
app/src/main/res/layout/serve_datails_item.xml
app/src/main/res/layout/tips_empty.xml
app/src/main/res/layout/tips_loading_failed.xml
annotation_lib/build/libs/annotation_lib.jar
View file @
8292e843
No preview for this file type
app/build.gradle
View file @
8292e843
...
...
@@ -97,8 +97,6 @@ dependencies {
//eventBus
compile
'org.greenrobot:eventbus:3.1.1'
//adapter
compile
'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
//图片选择
compile
'com.github.LuckSiege.PictureSelector:picture_library:v2.1.5'
//retrofit
...
...
app/proguard-rules.pro
View file @
8292e843
...
...
@@ -203,6 +203,7 @@ public static java.lang.String TABLENAME;
-keep class com.amap.api.fence.
*
*{*;}
-keep class com.autonavi.aps.amapapi.model.
*
*{*;}
#友盟
-keepclassmembers class * {
public <init> (org.json.JSONObject);
...
...
app/src/main/AndroidManifest.xml
View file @
8292e843
...
...
@@ -130,6 +130,10 @@
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.OrderRecordActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.SettingActivity"
android:screenOrientation=
"portrait"
/>
...
...
@@ -159,14 +163,6 @@
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.OrderRecordActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.AccountBalanceActivity1"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.AccountBalanceActivity"
android:screenOrientation=
"portrait"
/>
...
...
app/src/main/java/com/dayu/bigfish/Constants.java
View file @
8292e843
...
...
@@ -20,16 +20,18 @@ public class Constants {
public
static
final
String
BASE_COUNT
=
"https://47.94.101.239:7500/"
;
/***********************测试环境配置**********************************/
// public static final int DEBUGLEVEL = LogUtils.LEVEL_ALL;
// public static final String BASE_URL = "http://47.94.101.239:3112";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
public
static
final
int
DEBUGLEVEL
=
LogUtils
.
LEVEL_ALL
;
public
static
final
String
BASE_URL
=
"http://47.94.101.239:3112"
;
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"
;
public
final
static
String
WEB_SOP
=
"http://47.94.101.239:9004/#/sop"
;
// public final static String WEB_SOP = "http://192.168.1.132:8080/#/sop";
/**************************正式环境*******************************/
public
static
final
int
DEBUGLEVEL
=
LogUtils
.
LEVEL_ALL
;
public
static
final
String
BASE_URL
=
"https://mobile.dayu.ai"
;
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply"
;
public
final
static
String
WEB_SOP
=
"https://sop.kf.ai/#/sop"
;
//
public static final int DEBUGLEVEL = LogUtils.LEVEL_ALL;
//
public static final String BASE_URL = "https://mobile.dayu.ai";
//
public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
//
public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
/*****************/
public
static
final
String
LOGIN_URL
=
"/check"
;
//登录时发送验证码的URL
...
...
@@ -88,7 +90,7 @@ public class Constants {
/***********************其他配置**********************************/
public
final
static
int
PAGESIZE
=
20
;
public
final
static
int
PAGESIZE
=
8
;
//相册选择照片删除时传递的key
public
final
static
String
BUNDLE_KEY_ID
=
"BUNDLE_KEY_ID"
;
//工程师的账户余额
...
...
app/src/main/java/com/dayu/bigfish/api/Api.java
View file @
8292e843
...
...
@@ -6,8 +6,9 @@ import android.util.Log;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.base.BaseResponse
;
import
com.dayu.bigfish.
utils.Get
UserInfo
;
import
com.dayu.bigfish.
bean.
UserInfo
;
import
com.dayu.bigfish.utils.LogUtils
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
...
...
@@ -138,11 +139,14 @@ public class Api {
@Override
public
Response
intercept
(
Chain
chain
)
throws
IOException
{
Request
request
=
chain
.
request
();
String
token
=
GetUserInfo
.
getToken
(
MyApplication
.
getContext
());
if
(!
TextUtils
.
isEmpty
(
token
))
{
request
=
request
.
newBuilder
()
.
header
(
"token"
,
token
)
.
build
();
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
MyApplication
.
getContext
());
if
(
userInfo
!=
null
)
{
String
token
=
userInfo
.
getToken
();
if
(!
TextUtils
.
isEmpty
(
token
))
{
request
=
request
.
newBuilder
()
.
header
(
"token"
,
token
)
.
build
();
}
}
// Log.d("request_header", request.headers().toString());
return
chain
.
proceed
(
request
);
...
...
app/src/main/java/com/dayu/bigfish/base/CoreAdapter.java
View file @
8292e843
...
...
@@ -10,6 +10,7 @@ import android.view.ViewGroup;
import
com.dayu.bigfish.BR
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.ui.listener.OnChildClickListener
;
import
com.dayu.bigfish.ui.listener.OnItemClickListener
;
import
java.util.ArrayList
;
...
...
@@ -28,11 +29,12 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
private
int
viewType
;
private
int
mFooterViewType
=
R
.
layout
.
lrecycler_foot
;
protected
Context
mContext
;
private
int
mTotalPage
;
private
int
mTotalPage
=
0
;
private
int
mPage
=
1
;
public
boolean
isLoadFial
=
false
;
private
OnItemClickListener
mOnItemClickListener
;
private
BasePresenter
mPresenter
;
protected
OnChildClickListener
mOnChildClickListener
;
@Override
public
BaseViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
...
...
@@ -46,6 +48,13 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
}
}
public
CoreAdapter
(
boolean
needFoot
,
int
viewType
)
{
if
(
needFoot
)
{
mFootTypeDatas
.
add
(
new
Item
(
mFooterViewType
,
true
));
}
this
.
viewType
=
viewType
;
}
@Override
public
void
onBindViewHolder
(
BaseViewHolder
holder
,
int
position
)
{
Object
item
=
getItem
(
position
);
...
...
@@ -55,7 +64,7 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
holder
.
mBind
.
setVariable
(
BR
.
item
,
item
);
holder
.
mBind
.
executePendingBindings
();
if
(
item
!=
null
&&
!(
item
instanceof
Boolean
))
{
onBind
(
holder
,
(
M
)
item
);
onBind
(
(
B
)
holder
.
mBind
,
(
M
)
item
,
position
);
holder
.
mBind
.
getRoot
().
setOnClickListener
(
v
->
{
if
(
mOnItemClickListener
!=
null
)
{
mOnItemClickListener
.
OnItemClick
(
item
,
holder
.
mBind
);
...
...
@@ -151,6 +160,18 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
notifyDataSetChanged
();
}
/**
* 是否允许加载更多.
*
* @param flag
*/
public
void
setLoadMore
(
boolean
flag
)
{
isHasMore
=
flag
;
if
(
mPage
>=
mTotalPage
||
mTotalPage
==
0
)
{
isHasMore
=
false
;
}
}
@Override
public
int
getItemCount
()
{
return
mItemList
.
size
()
+
mHeadTypeDatas
.
size
()
+
mFootTypeDatas
.
size
();
...
...
@@ -170,13 +191,17 @@ public class CoreAdapter<M, B> extends RecyclerView.Adapter<BaseViewHolder> {
}
}
protected
void
onBind
(
B
aseViewHolder
holder
,
M
item
)
{
protected
void
onBind
(
B
holder
,
M
item
,
int
position
)
{
}
public
void
setOnItemClickListener
(
OnItemClickListener
<
M
,
B
>
listener
)
{
mOnItemClickListener
=
listener
;
}
public
void
setOnChildClickListener
(
OnChildClickListener
listener
)
{
mOnChildClickListener
=
listener
;
}
/**
* 获取数据源.
*
...
...
app/src/main/java/com/dayu/bigfish/presenter/errororder/ErrorOrderContract.java
View file @
8292e843
...
...
@@ -16,6 +16,7 @@ public interface ErrorOrderContract {
void
getErrorOrderSuccess
(
List
<
ErrorOrder
>
data
);
void
getErrorOrderFial
();
}
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
...
...
app/src/main/java/com/dayu/bigfish/presenter/orderdetailserve/OrderDetailServeContract.java
View file @
8292e843
...
...
@@ -16,5 +16,7 @@ public interface OrderDetailServeContract {
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
public
abstract
void
getOrderServerInfo
(
int
orderId
);
public
abstract
String
getCreatTime
(
String
time
);
}
}
app/src/main/java/com/dayu/bigfish/presenter/orderdetailserve/OrderDetailServePresenter.java
View file @
8292e843
...
...
@@ -3,6 +3,9 @@ package com.dayu.bigfish.presenter.orderdetailserve;
import
com.app.annotation.apt.InstanceFactory
;
import
com.apt.ApiFactory
;
import
com.dayu.bigfish.bean.OrderDetail
;
import
com.dayu.bigfish.utils.UtilsDate
;
import
java.text.ParseException
;
import
io.reactivex.functions.Consumer
;
...
...
@@ -28,5 +31,14 @@ public class OrderDetailServePresenter extends OrderDetailServeContract.Presente
}));
}
@Override
public
String
getCreatTime
(
String
time
)
{
try
{
return
UtilsDate
.
changeFormat
(
time
,
UtilsDate
.
FORMAT_ONE
,
UtilsDate
.
FORMAT_FOURTH
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
return
""
;
}
}
}
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingContract.java
View file @
8292e843
...
...
@@ -21,6 +21,8 @@ public interface ReceivingContract {
void
receiveOrderSuccess
();
void
receiveOrderFail
(
APIException
.
ResponeThrowable
throwable
);
void
receiveOrder
(
int
orderId
);
}
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
...
...
@@ -40,5 +42,10 @@ public interface ReceivingContract {
* @param engineer 工程师id.
*/
public
abstract
void
receiveOrder
(
int
orders
,
int
engineer
);
/**
* 接单
*/
public
abstract
void
receiveOrder
(
int
orderId
);
}
}
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingPresenter.java
View file @
8292e843
...
...
@@ -40,4 +40,9 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
}));
}
@Override
public
void
receiveOrder
(
int
orderId
)
{
mView
.
receiveOrder
(
orderId
);
}
}
app/src/main/java/com/dayu/bigfish/ui/AccountBalanceActivity.java
View file @
8292e843
...
...
@@ -3,16 +3,16 @@ package com.dayu.bigfish.ui;
import
android.content.Intent
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.AccountBalance
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.databinding.AccountbalanceLayoutBinding
;
import
com.dayu.bigfish.presenter.accountbalance.AccountBalanceContract
;
import
com.dayu.bigfish.presenter.accountbalance.AccountBalancePresenter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.managers.UserManager
;
/**
* Created by luofan on 2017/11/1.
...
...
@@ -33,7 +33,8 @@ public class AccountBalanceActivity extends BaseActivity<AccountBalancePresenter
public
void
initView
()
{
mBind
.
setPresenter
(
mPresenter
);
ProgressUtil
.
startLoad
(
mActivity
);
mUserId
=
GetUserInfo
.
getACCOUNT_ID
(
MyApplication
.
getContext
());
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
mUserId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
mPresenter
.
getAccountBalanceList
(
mPage
,
mPageSize
,
mUserId
);
initData
();
}
...
...
app/src/main/java/com/dayu/bigfish/ui/AccountBalanceActivity1.java
deleted
100644 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
ui
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.TextView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.AccountBalance
;
import
com.dayu.bigfish.databinding.ActivityAccountbalanceLayout1Binding
;
import
com.dayu.bigfish.presenter.accountbalance.AccountBalanceContract
;
import
com.dayu.bigfish.presenter.accountbalance.AccountBalancePresenter
;
import
com.dayu.bigfish.ui.adapter.AccountBalanceAdapter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ToastUtils
;
/**
* Created by luofan on 2017/11/1.
*/
public
class
AccountBalanceActivity1
extends
BaseActivity
<
AccountBalancePresenter
,
ActivityAccountbalanceLayout1Binding
>
implements
AccountBalanceContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
private
int
mUserId
;
private
AccountBalanceAdapter
mAdapter
;
private
int
mPage
=
1
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mTotalPage
=
1
;
private
int
mRefreshState
=
1
;
//1:刷新,2:下拉加载
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
activity_accountbalance_layout1
;
}
@Override
public
void
initView
()
{
mBind
.
setPresenter
(
mPresenter
);
initData
();
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getAccountBalanceList
(
mPage
,
mPageSize
,
mUserId
);
}
private
void
initData
()
{
mUserId
=
GetUserInfo
.
getACCOUNT_ID
(
MyApplication
.
getContext
());
int
balance
=
getIntent
().
getIntExtra
(
Constants
.
ACCOUNT_BALANCE
,
0
);
mBind
.
tvAccountBalance
.
setText
(
"¥"
+
balance
);
mAdapter
=
new
AccountBalanceAdapter
(
R
.
layout
.
item_account_balance_layout11
,
null
);
mBind
.
rlBalance
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
mBind
.
rlBalance
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
rlBalance
);
mBind
.
swipeRefersh
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mBind
.
rlBalance
);
mAdapter
.
setEnableLoadMore
(
false
);
}
@Override
public
void
getBalanceSuccess
(
BasePageBean
<
AccountBalance
>
balance
)
{
mTotalPage
=
balance
.
getTotalPages
();
mPageSize
=
balance
.
getPageSize
();
if
(
mRefreshState
==
1
)
{
mBind
.
swipeRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
balance
.
getData
());
mAdapter
.
loadMoreEnd
();
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mAdapter
.
addData
(
balance
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
mPage
+=
1
;
}
mPage
+=
1
;
if
(
balance
.
getData
().
size
()
==
0
)
{
LayoutInflater
inflater
=
LayoutInflater
.
from
(
mActivity
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
tips_empty
,
null
);
TextView
tip
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
tv_empty
);
tip
.
setText
(
getString
(
R
.
string
.
no_record
));
mAdapter
.
setEmptyView
(
view
);
}
}
@Override
public
void
getBalanceError
()
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_loading_failed
);
mAdapter
.
loadMoreFail
();
ToastUtils
.
showShortToast
(
getString
(
R
.
string
.
get_account_list_error
));
mBind
.
lineOne
.
setVisibility
(
View
.
VISIBLE
);
}
@Override
public
void
dumpToWithdrawal
()
{
Intent
intent
=
new
Intent
(
mActivity
,
WithdrawalsActivity
.
class
);
startActivity
(
intent
);
}
@Override
public
String
getTotalPrice
()
{
int
balance
=
getIntent
().
getIntExtra
(
Constants
.
ACCOUNT_BALANCE
,
0
);
return
"¥"
+
balance
;
}
@Override
public
void
onRefresh
()
{
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getAccountBalanceList
(
mPage
,
mPageSize
,
mUserId
);
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getAccountBalanceList
(
mPage
,
mPageSize
,
mUserId
);
}
}
app/src/main/java/com/dayu/bigfish/ui/FeedBackActivity.java
View file @
8292e843
...
...
@@ -5,9 +5,9 @@ import com.dayu.bigfish.base.BaseActivity;
import
com.dayu.bigfish.databinding.ActivityFeedbackBinding
;
import
com.dayu.bigfish.presenter.feedback.FeedBackContract
;
import
com.dayu.bigfish.presenter.feedback.FeedBackPresenter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.UtilsUserAccountMatcher
;
import
com.dayu.bigfish.utils.managers.UserManager
;
/**
* 设置页面 --反馈提交
...
...
@@ -27,8 +27,8 @@ public class FeedBackActivity extends BaseActivity<FeedBackPresenter, ActivityFe
@Override
public
void
initView
()
{
userName
=
GetUserInfo
.
getUserName
(
this
);
userPhone
=
GetUserInfo
.
getUserPhone
(
this
);
userName
=
UserManager
.
getInstance
().
getUserName
(
mActivity
);
userPhone
=
UserManager
.
getInstance
().
getUserPhone
(
mActivity
);
mBind
.
setPresenter
(
mPresenter
);
mBind
.
submitIdea
.
setOnClickListener
(
o
->
{
mComment
=
mBind
.
etContent
.
getText
().
toString
();
...
...
app/src/main/java/com/dayu/bigfish/ui/LoginActivity.java
View file @
8292e843
...
...
@@ -108,7 +108,7 @@ public class LoginActivity extends BaseActivity<LoginPresenter, LoginBinding> im
@Override
public
void
dumpAndSave
(
UserInfo
info
)
{
UserManager
.
getInstance
().
saveUser
Info
(
this
,
info
);
UserManager
.
getInstance
().
saveUser
(
this
,
info
);
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
finish
();
...
...
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
View file @
8292e843
...
...
@@ -28,6 +28,7 @@ import com.dayu.bigfish.base.BaseActivity;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.InformBean
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.VersionInfo
;
import
com.dayu.bigfish.bean.event.DownloadBean
;
import
com.dayu.bigfish.bean.event.RefreshReceivingNum
;
...
...
@@ -42,10 +43,10 @@ import com.dayu.bigfish.ui.fragment.HomePersonFragment;
import
com.dayu.bigfish.ui.listener.onDownloadListener
;
import
com.dayu.bigfish.ui.views.CustomDialog
;
import
com.dayu.bigfish.utils.AppUtils
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.LocationUtils
;
import
com.dayu.bigfish.utils.SPUtils
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
...
...
@@ -72,6 +73,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
private
HomeOrderFragment
secondFragment
;
private
HomeMessageTabFragment
thirdFragment
;
private
HomePersonFragment
fourFragment
;
private
UserInfo
mUser
;
@Override
public
int
getLayoutId
()
{
...
...
@@ -81,8 +83,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override
public
void
initView
()
{
mBind
.
setPresenter
(
mPresenter
);
mAccountId
=
GetUserInfo
.
getACCOUNT_ID
(
mActivity
);
mSiteId
=
GetUserInfo
.
getSITE_ID
(
mActivity
);
mUser
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
mAccountId
=
Integer
.
parseInt
(
mUser
.
getAccountId
());
mSiteId
=
Integer
.
parseInt
(
mUser
.
getSiteId
());
firstFragment
=
HomeFirstTabFragment
.
newInstance
();
secondFragment
=
HomeOrderFragment
.
newInstance
();
thirdFragment
=
HomeMessageTabFragment
.
newInstance
();
...
...
@@ -128,7 +131,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
mPresenter
.
commitVersionInfo
(
mAccountId
,
AppUtils
.
getIMEI
(
mActivity
),
"2"
,
AppUtils
.
getPackageNum
(
mActivity
));
mPresenter
.
getNewVersion
(
AppUtils
.
getPackageNum
(
mActivity
));
mPresenter
.
getReceiveOrder
(
Constants
.
WATING_ORDER
,
mAccountId
,
mSiteId
,
1
,
20
);
mPresenter
.
getHxNum
(
GetUserInfo
.
getHxUserId
(
mActivity
));
mPresenter
.
getHxNum
(
mUser
.
getHxAccount
(
));
}
@Override
...
...
@@ -348,17 +351,17 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
if
(!
flag
)
{
CustomDialog
dialog
=
new
CustomDialog
(
mActivity
,
R
.
style
.
custom_dialog2
,
getString
(
R
.
string
.
please_open__permission
)
,
(
dialog1
,
confirm
)
->
{
if
(
confirm
)
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_APPLICATION_DETAILS_SETTINGS
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivity
(
intent
);
dialog1
.
dismiss
();
}
else
{
Toast
.
makeText
(
mActivity
,
getString
(
R
.
string
.
no_permission
),
Toast
.
LENGTH_SHORT
).
show
();
finish
();
dialog1
.
dismiss
();
}
});
if
(
confirm
)
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_APPLICATION_DETAILS_SETTINGS
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivity
(
intent
);
dialog1
.
dismiss
();
}
else
{
Toast
.
makeText
(
mActivity
,
getString
(
R
.
string
.
no_permission
),
Toast
.
LENGTH_SHORT
).
show
();
finish
();
dialog1
.
dismiss
();
}
});
dialog
.
setTitle
(
getString
(
R
.
string
.
notice
))
.
setNegativeButton
(
getString
(
R
.
string
.
cancle
))
.
setPositiveButton
(
getString
(
R
.
string
.
go_setting
));
...
...
app/src/main/java/com/dayu/bigfish/ui/OrderRecordActivity.java
View file @
8292e843
...
...
@@ -2,26 +2,24 @@ package com.dayu.bigfish.ui;
import
android.content.Context
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextWatcher
;
import
android.view.View
;
import
android.view.inputmethod.InputMethodManager
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.databinding.ActivityOrderRecordBinding
;
import
com.dayu.bigfish.presenter.worksRecord.WorksRecordPresenter
;
import
com.dayu.bigfish.presenter.worksRecord.WroksRecordContract
;
import
com.dayu.bigfish.ui.adapter.OrderDoingAdapter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.ui.adapter.OrderAdapter
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
java.util.ArrayList
;
...
...
@@ -31,15 +29,13 @@ import java.util.ArrayList;
*/
public
class
OrderRecordActivity
extends
BaseActivity
<
WorksRecordPresenter
,
ActivityOrderRecordBinding
>
implements
WroksRecordContract
.
View
,
BaseQuickAdapter
.
RequestLoadMoreListener
,
SwipeRefreshLayout
.
OnRefreshListener
{
implements
WroksRecordContract
.
View
{
public
ArrayList
<
Order
>
mList
=
new
ArrayList
<>();
private
int
siteId
;
private
int
userId
;
private
Order
Doing
Adapter
mAdapter
;
private
OrderAdapter
mAdapter
;
private
int
mPage
=
1
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mTotalPage
=
1
;
private
int
mRefreshState
=
1
;
@Override
public
int
getLayoutId
()
{
...
...
@@ -50,26 +46,24 @@ public class OrderRecordActivity extends BaseActivity<WorksRecordPresenter, Acti
@Override
public
void
initView
()
{
mBind
.
setPresenter
(
mPresenter
);
siteId
=
GetUserInfo
.
getSITE_ID
(
mActivity
);
userId
=
GetUserInfo
.
getACCOUNT_ID
(
mActivity
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
siteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
());
mBind
.
tvTitle
.
setText
(
getString
(
R
.
string
.
history_order
));
mAdapter
=
new
OrderDoingAdapter
(
R
.
layout
.
fragment_orderdoing_item
,
mActivity
);
mBind
.
rlRecord
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
mBind
.
rlRecord
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
rlRecord
);
mBind
.
swipeRefersh
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mBind
.
rlRecord
);
mAdapter
=
new
OrderAdapter
(
true
,
R
.
layout
.
fragment_orderdoing_item
);
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
initListener
();
mAdapter
.
setEnableLoadMore
(
false
);
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getWorksRecord
(
Constants
.
FINISH_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
private
void
initListener
()
{
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
Order
data
=
(
Order
)
adapter
.
getData
().
get
(
position
);
dumpDetail
(
data
.
getId
());
mBind
.
recyclerView
.
setRefreshListener
(()
->
refresh
());
mBind
.
recyclerView
.
setOnLoadMoreListener
(()
->
{
mPage
++;
mPresenter
.
getWorksRecord
(
Constants
.
FINISH_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
});
mAdapter
.
setOnItemClickListener
((
item
,
bind
)
->
dumpDetail
(
item
.
getId
()));
mBind
.
etSeacher
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
...
...
@@ -98,39 +92,13 @@ public class OrderRecordActivity extends BaseActivity<WorksRecordPresenter, Acti
@Override
public
void
getWorksRecord
(
BasePageBean
<
Order
>
oredrs
)
{
mTotalPage
=
oredrs
.
getTotalPages
();
mPageSize
=
oredrs
.
getPageSize
();
if
(
mRefreshState
==
1
)
{
mBind
.
swipeRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
oredrs
.
getData
());
mList
.
clear
();
mList
.
addAll
(
oredrs
.
getData
());
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mList
.
addAll
(
oredrs
.
getData
());
mAdapter
.
addData
(
oredrs
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
}
mPage
+=
1
;
if
(
oredrs
.
getData
().
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
mBind
.
recyclerView
.
setPageData
(
oredrs
);
mList
=
(
ArrayList
<
Order
>)
mAdapter
.
getDatas
();
}
@Override
public
void
getWorkRecordFail
()
{
mAdapter
.
loadMoreFail
();
mAdapter
.
setEnableLoadMore
(
true
);
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_loading_failed
);
mBind
.
swipeRefersh
.
setRefreshing
(
false
);
mAdapter
.
getEmptyView
().
setOnClickListener
(
v
->
{
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getWorksRecord
(
Constants
.
FINISH_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
});
mBind
.
recyclerView
.
setDataFail
();
}
@Override
...
...
@@ -154,9 +122,8 @@ public class OrderRecordActivity extends BaseActivity<WorksRecordPresenter, Acti
@Override
public
void
doSearch
(
Editable
s
)
{
mAdapter
.
setEnableLoadMore
(
false
);
String
str
=
s
.
toString
();
if
(
mList
==
null
)
{
if
(
mList
==
null
||
TextUtils
.
isEmpty
(
str
)
)
{
return
;
}
ArrayList
<
Order
>
list
=
new
ArrayList
<>();
...
...
@@ -165,25 +132,13 @@ public class OrderRecordActivity extends BaseActivity<WorksRecordPresenter, Acti
list
.
add
(
data
);
}
}
mAdapter
.
setNewData
(
list
);
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getWorksRecord
(
Constants
.
FINISH_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
@Override
public
void
onRefresh
()
{
refresh
();
mBind
.
recyclerView
.
setData
(
list
);
mAdapter
.
setLoadMore
(
false
);
}
public
void
refresh
()
{
hideSearch
();
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getWorksRecord
(
Constants
.
FINISH_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
}
app/src/main/java/com/dayu/bigfish/ui/ProcessOrderActivity.java
View file @
8292e843
...
...
@@ -13,6 +13,7 @@ import com.dayu.bigfish.Constants;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.bean.OrderDetail
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.OrderState
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.bean.sqlbean.OrderInfo
;
...
...
@@ -21,11 +22,11 @@ import com.dayu.bigfish.greendao.GreenDaoManager;
import
com.dayu.bigfish.greendao.OrderInfoDao
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderContract
;
import
com.dayu.bigfish.presenter.processorder.ProcessOrderPresenter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.GlideImageLoader
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.UtilsScreen
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
com.luck.picture.lib.PictureSelectionModel
;
import
com.luck.picture.lib.PictureSelector
;
import
com.luck.picture.lib.config.PictureConfig
;
...
...
@@ -97,7 +98,8 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac
Intent
intent
=
getIntent
();
orderId
=
intent
.
getIntExtra
(
Constants
.
ORDER_ID
,
0
);
finshPosition
=
intent
.
getIntExtra
(
Constants
.
ORDER_POSTION
,
0
);
engineerId
=
GetUserInfo
.
getACCOUNT_ID
(
this
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
engineerId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
Query
query
=
mOrderInfoDao
.
queryBuilder
().
where
(
OrderInfoDao
.
Properties
.
Id
.
eq
(
orderId
),
OrderInfoDao
.
Properties
.
EngineerId
.
eq
(
engineerId
))
.
build
();
...
...
app/src/main/java/com/dayu/bigfish/ui/ReceivingActivity.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.api.APIException
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.base.CoreAdapter
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.RefreshApoiment
;
import
com.dayu.bigfish.bean.event.RefreshReceivingNum
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
...
...
@@ -18,15 +18,14 @@ import com.dayu.bigfish.bean.event.SwtichFragment;
import
com.dayu.bigfish.databinding.ActivityReceivingBinding
;
import
com.dayu.bigfish.presenter.receivingorder.ReceivingContract
;
import
com.dayu.bigfish.presenter.receivingorder.ReceivingPresenter
;
import
com.dayu.bigfish.ui.adapter.Order
Doing
Adapter
;
import
com.dayu.bigfish.u
tils.GetUserInfo
;
import
com.dayu.bigfish.ui.adapter.OrderAdapter
;
import
com.dayu.bigfish.u
i.listener.OnChildClickListener
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.List
;
/**
* 待接单列表
...
...
@@ -35,16 +34,13 @@ import java.util.List;
*/
public
class
ReceivingActivity
extends
BaseActivity
<
ReceivingPresenter
,
ActivityReceivingBinding
>
implements
ReceivingContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
ReceivingContract
.
View
{
private
int
userId
;
private
int
siteId
;
private
int
mPage
=
1
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mTotalPage
=
1
;
private
OrderDoingAdapter
mAdapter
;
private
int
mRefreshState
=
1
;
//1:刷新,2:下拉加载
private
OrderAdapter
mAdapter
;
private
int
mTotalRows
;
public
List
<
Order
>
list
;
@Override
...
...
@@ -54,16 +50,12 @@ public class ReceivingActivity extends BaseActivity<ReceivingPresenter, Activity
@Override
public
void
initView
()
{
userId
=
GetUserInfo
.
getACCOUNT_ID
(
this
);
siteId
=
GetUserInfo
.
getSITE_ID
(
this
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
siteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
());
mBind
.
tvTitle
.
setText
(
getString
(
R
.
string
.
receive_list
));
mAdapter
=
new
OrderDoingAdapter
(
R
.
layout
.
fragment_orderdoing_item
,
mActivity
);
mBind
.
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
mAdapter
=
new
OrderAdapter
(
true
,
R
.
layout
.
fragment_orderdoing_item
);
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
recyclerView
);
mBind
.
swipeRefersh
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mBind
.
recyclerView
);
mAdapter
.
setEnableLoadMore
(
false
);
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getReceiveOrder
(
Constants
.
WATING_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
mBind
.
setPresenter
(
mPresenter
);
...
...
@@ -71,16 +63,23 @@ public class ReceivingActivity extends BaseActivity<ReceivingPresenter, Activity
}
private
void
initListener
()
{
mAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
Order
order
=
(
Order
)
adapter
.
getItem
(
position
);
if
(
view
.
getId
()
==
R
.
id
.
item_text_phone
)
{
mPresenter
.
receiveOrder
(
order
.
getId
(),
userId
);
mBind
.
recyclerView
.
setRefreshListener
(()
->
refresh
());
mBind
.
recyclerView
.
setOnLoadMoreListener
(()
->
{
mPage
++;
mPresenter
.
getReceiveOrder
(
Constants
.
WATING_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
});
mAdapter
.
setOnChildClickListener
(
new
OnChildClickListener
()
{
@Override
public
void
OnChildClick
(
View
view
,
CoreAdapter
adapter
,
int
position
)
{
if
(
view
.
getId
()
==
R
.
id
.
item_text_phone
)
{
Order
order
=
(
Order
)
adapter
.
getItem
(
position
);
mPresenter
.
receiveOrder
(
order
.
getId
(),
userId
);
}
}
});
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
Order
order
=
(
Order
)
adapter
.
getItem
(
position
);
mAdapter
.
setOnItemClickListener
((
item
,
bind
)
->
{
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
order
.
getId
());
intent
.
putExtra
(
"orderId"
,
item
.
getId
());
startActivity
(
intent
);
});
}
...
...
@@ -88,39 +87,14 @@ public class ReceivingActivity extends BaseActivity<ReceivingPresenter, Activity
@Override
public
void
getReceiveOrderSuccess
(
BasePageBean
<
Order
>
orders
)
{
mTotalPage
=
orders
.
getTotalPages
();
mPageSize
=
orders
.
getPageSize
();
mTotalRows
=
orders
.
getTotalRows
();
if
(
mRefreshState
==
1
)
{
mBind
.
swipeRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
orders
.
getData
());
mAdapter
.
loadMoreEnd
();
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mAdapter
.
addData
(
orders
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
}
mPage
+=
1
;
if
(
orders
.
getData
().
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
mBind
.
recyclerView
.
setPageData
(
orders
);
EventBus
.
getDefault
().
post
(
new
RefreshReceivingNum
(
mTotalRows
));
}
@Override
public
void
getReceiveOrderFail
()
{
mBind
.
swipeRefersh
.
setRefreshing
(
false
);
mAdapter
.
setEnableLoadMore
(
true
);
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_loading_failed
);
mAdapter
.
loadMoreFail
();
mAdapter
.
getEmptyView
().
setOnClickListener
(
v
->
{
ProgressUtil
.
startLoad
(
mActivity
);
refresh
();
});
mBind
.
recyclerView
.
setDataFail
();
}
@Override
...
...
@@ -142,29 +116,20 @@ public class ReceivingActivity extends BaseActivity<ReceivingPresenter, Activity
}
}
@Override
public
void
onRefresh
(
)
{
refresh
(
);
public
void
receiveOrder
(
int
orderId
)
{
mPresenter
.
receiveOrder
(
orderId
,
userId
);
}
public
void
refresh
()
{
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getReceiveOrder
(
Constants
.
WATING_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
@Override
public
void
finish
()
{
super
.
finish
();
overridePendingTransition
(
0
,
R
.
anim
.
slide_bottom_out
);
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getReceiveOrder
(
Constants
.
WATING_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
}
app/src/main/java/com/dayu/bigfish/ui/SettingActivity.java
View file @
8292e843
...
...
@@ -7,13 +7,13 @@ import android.text.TextUtils;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.databinding.ActivitySettingBinding
;
import
com.dayu.bigfish.presenter.setting.SettingContract
;
import
com.dayu.bigfish.presenter.setting.SettingPresenter
;
import
com.dayu.bigfish.ui.views.CustomDialog
;
import
com.dayu.bigfish.utils.AppUtils
;
import
com.dayu.bigfish.utils.DataCleanManager
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.managers.UserManager
;
...
...
@@ -44,8 +44,9 @@ public class SettingActivity extends BaseActivity<SettingPresenter, ActivitySett
public
void
initView
()
{
mBind
.
setPresenter
(
mPresenter
);
initListener
();
mHxAccount
=
GetUserInfo
.
getHxUserId
(
mActivity
);
mHxPwd
=
GetUserInfo
.
getHxPwd
(
mActivity
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
mHxAccount
=
userInfo
.
getHxAccount
();
mHxPwd
=
userInfo
.
getHxPwd
();
}
private
void
initListener
()
{
...
...
app/src/main/java/com/dayu/bigfish/ui/SopWebViewActivity.java
View file @
8292e843
...
...
@@ -14,10 +14,11 @@ import android.widget.LinearLayout;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.DataBindingActivity
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.OrderState
;
import
com.dayu.bigfish.databinding.ActivityWebviewBinding
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
com.github.lzyzsd.jsbridge.BridgeHandler
;
import
com.github.lzyzsd.jsbridge.BridgeWebView
;
import
com.github.lzyzsd.jsbridge.CallBackFunction
;
...
...
@@ -53,7 +54,8 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
@Override
public
void
initView
()
{
mActivity
=
this
;
mToken
=
GetUserInfo
.
getToken
(
mActivity
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
mToken
=
userInfo
.
getToken
();
mOrderId
=
getIntent
().
getIntExtra
(
Constants
.
ORDER_ID
,
0
);
mPositon
=
getIntent
().
getIntExtra
(
Constants
.
ORDER_POSTION
,
0
);
mBind
.
titleBack
.
setOnClickListener
(
o
->
finish
());
...
...
app/src/main/java/com/dayu/bigfish/ui/WithdrawalsActivity.java
View file @
8292e843
...
...
@@ -3,17 +3,17 @@ package com.dayu.bigfish.ui;
import
android.text.TextUtils
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.bean.AlipayInfo
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.databinding.ActivityWithdrawalsBinding
;
import
com.dayu.bigfish.presenter.Withdrawals.WithdrawalsContract
;
import
com.dayu.bigfish.presenter.Withdrawals.WithdrawalsPresenter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
com.dayu.bigfish.utils.UtilsUserAccountMatcher
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.json.JSONObject
;
...
...
@@ -43,7 +43,8 @@ public class WithdrawalsActivity extends BaseActivity<WithdrawalsPresenter, Acti
@Override
public
void
initView
()
{
mBind
.
setPresenter
(
mPresenter
);
mUserId
=
GetUserInfo
.
getACCOUNT_ID
(
MyApplication
.
getContext
());
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
mUserId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
querAlipay
(
mUserId
);
}
...
...
app/src/main/java/com/dayu/bigfish/ui/adapter/AccessoriesAdapter.java
deleted
100644 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
ui
.
adapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.bean.OrderDetail
;
/**
* Created by luofan on 2017/11/23.
*/
public
class
AccessoriesAdapter
extends
BaseQuickAdapter
<
OrderDetail
.
accessories
,
BaseViewHolder
>
{
public
AccessoriesAdapter
(
int
layoutResId
)
{
super
(
layoutResId
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
OrderDetail
.
accessories
item
)
{
helper
.
setText
(
R
.
id
.
tv_accessories_name
,
item
.
getName
());
}
}
app/src/main/java/com/dayu/bigfish/ui/adapter/AccountBalanceAdapter.java
deleted
100644 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
ui
.
adapter
;
import
android.support.annotation.LayoutRes
;
import
android.support.annotation.Nullable
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.bean.AccountBalance
;
import
java.util.List
;
/**
* Created by luofan on 2017/11/1.
*/
public
class
AccountBalanceAdapter
extends
BaseQuickAdapter
<
AccountBalance
,
BaseViewHolder
>
{
public
AccountBalanceAdapter
(
@LayoutRes
int
layoutResId
,
@Nullable
List
<
AccountBalance
>
data
)
{
super
(
layoutResId
,
data
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
AccountBalance
item
)
{
double
balance
=
item
.
getStreamPrice
();
if
(
balance
>
0
)
{
helper
.
setText
(
R
.
id
.
item_tv_accout_balance
,
"+"
+
item
.
getStreamPrice
());
helper
.
setTextColor
(
R
.
id
.
item_tv_accout_balance
,
mContext
.
getResources
().
getColor
(
R
.
color
.
cl_tab_yellow
));
}
else
{
helper
.
setText
(
R
.
id
.
item_tv_accout_balance
,
item
.
getStreamPrice
()
+
""
);
helper
.
setTextColor
(
R
.
id
.
item_tv_accout_balance
,
mContext
.
getResources
().
getColor
(
R
.
color
.
cl_order_text_title
));
}
helper
.
setText
(
R
.
id
.
item_tv_accout_source
,
item
.
getOperateActionComment
());
helper
.
setText
(
R
.
id
.
item_tv_accout_time
,
item
.
getCreateTime
());
}
}
app/src/main/java/com/dayu/bigfish/ui/adapter/FragmentOrderAdapter.java
View file @
8292e843
...
...
@@ -26,6 +26,6 @@ public class FragmentOrderAdapter extends FragmentPagerAdapter {
@Override
public
int
getCount
()
{
return
2
;
return
list_fragemnts
.
size
()
;
}
}
app/src/main/java/com/dayu/bigfish/ui/adapter/Order
Doing
Adapter.java
→
app/src/main/java/com/dayu/bigfish/ui/adapter/OrderAdapter.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
adapter
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.res.AssetManager
;
import
android.graphics.Typeface
;
import
android.net.Uri
;
import
android.text.TextUtils
;
import
android.view.View
;
import
com.amap.api.location.AMapLocation
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.CoreAdapter
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.event.RefreshServe
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.databinding.FragmentOrderdoingItemBinding
;
import
com.dayu.bigfish.presenter.serverorder.ServerOrderPresenter
;
import
com.dayu.bigfish.ui.ProcessOrderActivity
;
import
com.dayu.bigfish.ui.SopWebViewActivity
;
...
...
@@ -31,7 +28,6 @@ import io.reactivex.functions.Consumer;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
FORMAT_ONE
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
LONG_TIME_FORMAT_TWO
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
SHORT_DATE_FORMAT
;
/**
...
...
@@ -39,184 +35,182 @@ import static com.dayu.bigfish.utils.UtilsDate.SHORT_DATE_FORMAT;
* on 2017/9/11.
*/
public
class
Order
DoingAdapter
extends
BaseQuickAdapter
<
Order
,
BaseViewHolder
>
{
public
class
Order
Adapter
extends
CoreAdapter
<
Order
,
FragmentOrderdoingItemBinding
>
{
private
ServerOrderPresenter
mPresenter
;
private
final
Activity
mActivity
;
private
Order
mItem
;
private
BaseViewHolder
mHolder
;
private
FragmentOrderdoingItemBinding
mBind
;
public
OrderDoingAdapter
(
int
layoutResId
,
Activity
activity
)
{
super
(
layoutResId
);
mActivity
=
activity
;
public
OrderAdapter
(
boolean
needFoot
,
int
viewType
)
{
super
(
needFoot
,
viewType
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
Order
item
)
{
protected
void
onBind
(
FragmentOrderdoingItemBinding
holder
,
Order
item
,
int
position
)
{
super
.
onBind
(
holder
,
item
,
position
);
try
{
initData
(
h
elper
,
item
);
initData
(
h
older
,
item
,
position
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
private
void
initData
(
BaseViewHolder
holder
,
Order
item
)
throws
Exception
{
private
void
initData
(
FragmentOrderdoingItemBinding
holder
,
Order
item
,
int
position
)
throws
Exception
{
boolean
haveCustomer
=
true
;
AssetManager
mgr
=
mContext
.
getAssets
();
Typeface
tf
=
Typeface
.
createFromAsset
(
mgr
,
"fonts/DIN Alternate Bold.ttf"
);
holder
.
setTypeface
(
R
.
id
.
item_time
,
tf
);
holder
.
setText
(
R
.
id
.
item_text_weixiu_leixing
,
item
.
getCategoryName
());
holder
.
setText
(
R
.
id
.
item_text_weixiu
,
item
.
getProviderName
());
holder
.
setText
(
R
.
id
.
item_text_dizhi
,
item
.
getProvinceName
()
+
item
.
getCityName
()
+
holder
.
itemTextWeixiuLeixing
.
setText
(
item
.
getCategoryName
());
holder
.
itemTextWeixiu
.
setText
(
item
.
getProviderName
());
holder
.
itemTextDizhi
.
setText
(
item
.
getProvinceName
()
+
item
.
getCityName
()
+
item
.
getDistrictName
()
+
item
.
getAddress
());
holder
.
getView
(
R
.
id
.
item_updata_time
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
order_line_two
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
tv_error_state
).
setVisibility
(
View
.
GON
E
);
holder
.
getView
(
R
.
id
.
tv_item_process
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemUpdataTime
.
setVisibility
(
View
.
VISIBLE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
VISIBLE
);
holder
.
orderLineTwo
.
setVisibility
(
View
.
VISIBLE
);
holder
.
tvErrorState
.
setVisibility
(
View
.
VISIBL
E
);
holder
.
tvItemProcess
.
setVisibility
(
View
.
VISIBLE
);
final
int
id
=
item
.
getId
();
if
(
item
.
getAnyContacts
()
==
0
)
{
holder
.
setText
(
R
.
id
.
item_text_user_name
,
mContext
.
getString
(
R
.
string
.
no_customer
));
holder
.
getView
(
R
.
id
.
item_text_user_phone
)
.
setVisibility
(
View
.
GONE
);
holder
.
itemTextUserName
.
setText
(
mContext
.
getString
(
R
.
string
.
no_customer
));
holder
.
itemTextUserPhone
.
setVisibility
(
View
.
GONE
);
haveCustomer
=
false
;
}
else
if
(
item
.
getAnyContacts
()
==
1
)
{
holder
.
setText
(
R
.
id
.
item_text_user_name
,
item
.
getCustomerName
());
holder
.
setText
(
R
.
id
.
item_text_user_phone
,
item
.
getCustomerMobile
());
holder
.
getView
(
R
.
id
.
item_text_user_phone
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemTextUserName
.
setText
(
item
.
getCustomerName
());
holder
.
itemTextUserPhone
.
setText
(
item
.
getCustomerMobile
());
holder
.
itemTextUserPhone
.
setVisibility
(
View
.
VISIBLE
);
haveCustomer
=
true
;
}
if
(
TextUtils
.
isEmpty
(
item
.
getSpuName
()))
{
holder
.
setText
(
R
.
id
.
tv_order_detail
,
mContext
.
getString
(
R
.
string
.
no_server
));
holder
.
tvOrderDetail
.
setText
(
mContext
.
getString
(
R
.
string
.
no_server
));
}
else
{
holder
.
setText
(
R
.
id
.
tv_order_detail
,
item
.
getSpuName
());
holder
.
tvOrderDetail
.
setText
(
item
.
getSpuName
());
}
//工单状态:1未接单2未预约3已预约4进行中5已完成6已取消7订单关闭
//工单子状态:3已预约1未出发|3已预约2已出发|4进行中3无SOP处理|4进行中4SOP未完成|4进行中5SOP已完成
String
time
=
""
;
switch
(
item
.
getStatus
())
{
case
1
:
//待接单
holder
.
getView
(
R
.
id
.
tv_item_process
).
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
item_updata_time
).
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_two
).
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_one
).
setVisibility
(
View
.
GONE
);
holder
.
setText
(
R
.
id
.
item_text_phone
,
mContext
.
getString
(
R
.
string
.
receive_order
));
holder
.
addOnClickListener
(
R
.
id
.
item_text_phone
);
holder
.
setText
(
R
.
id
.
tv_order_time
,
mContext
.
getString
(
R
.
string
.
have_appointment
));
holder
.
tvItemProcess
.
setVisibility
(
View
.
GONE
);
holder
.
itemUpdataTime
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineTwo
.
setVisibility
(
View
.
GONE
);
holder
.
itemTextPhone
.
setText
(
mContext
.
getString
(
R
.
string
.
receive_order
));
holder
.
itemTextPhone
.
setOnClickListener
(
v
->
{
if
(
mOnChildClickListener
!=
null
)
{
mOnChildClickListener
.
OnChildClick
(
holder
.
itemTextPhone
,
this
,
position
);
}
});
holder
.
tvOrderTime
.
setText
(
mContext
.
getString
(
R
.
string
.
have_appointment
));
time
=
item
.
getAppointmentTime
();
break
;
case
2
:
//待预约
if
(!
haveCustomer
)
{
holder
.
getView
(
R
.
id
.
item_text_phone
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
GONE
);
holder
.
itemTextPhone
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
getView
(
R
.
id
.
item_text_phone
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemTextPhone
.
setVisibility
(
View
.
VISIBLE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
VISIBLE
);
}
holder
.
getView
(
R
.
id
.
tv_item_process
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_two
)
.
setVisibility
(
View
.
GONE
);
holder
.
setText
(
R
.
id
.
item_updata_time
,
mContext
.
getString
(
R
.
string
.
appointment_time
));
holder
.
setText
(
R
.
id
.
tv_order_time
,
mContext
.
getString
(
R
.
string
.
have_appointment
));
holder
.
tvItemProcess
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineTwo
.
setVisibility
(
View
.
GONE
);
holder
.
itemUpdataTime
.
setText
(
mContext
.
getString
(
R
.
string
.
appointment_time
));
holder
.
tvOrderTime
.
setText
(
mContext
.
getString
(
R
.
string
.
have_appointment
));
time
=
item
.
getAppointmentTime
();
break
;
case
3
:
//待服务
if
(!
haveCustomer
)
{
holder
.
getView
(
R
.
id
.
item_text_phone
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
GONE
);
holder
.
itemTextPhone
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
getView
(
R
.
id
.
item_text_phone
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemTextPhone
.
setVisibility
(
View
.
VISIBLE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
VISIBLE
);
}
holder
.
setText
(
R
.
id
.
item_updata_time
,
mContext
.
getString
(
R
.
string
.
modify_appointment_time
));
holder
.
itemUpdataTime
.
setText
(
mContext
.
getString
(
R
.
string
.
modify_appointment_time
));
if
(
item
.
getSubStatus
()
==
1
)
{
holder
.
setText
(
R
.
id
.
tv_item_process
,
mContext
.
getString
(
R
.
string
.
have_go_on
));
holder
.
tvItemProcess
.
setText
(
mContext
.
getString
(
R
.
string
.
have_go_on
));
}
else
if
(
item
.
getSubStatus
()
==
2
)
{
holder
.
setText
(
R
.
id
.
tv_item_process
,
mContext
.
getString
(
R
.
string
.
begain_server
));
holder
.
tvItemProcess
.
setText
(
mContext
.
getString
(
R
.
string
.
begain_server
));
}
time
=
item
.
getConfirmDoorTime
();
break
;
case
4
:
//待处理
holder
.
setText
(
R
.
id
.
item_updata_time
,
mContext
.
getString
(
R
.
string
.
need_again_door
));
holder
.
setText
(
R
.
id
.
tv_item_process
,
mContext
.
getString
(
R
.
string
.
process_order
));
holder
.
itemUpdataTime
.
setText
(
mContext
.
getString
(
R
.
string
.
need_again_door
));
holder
.
tvItemProcess
.
setText
(
mContext
.
getString
(
R
.
string
.
process_order
));
if
(!
haveCustomer
)
{
holder
.
getView
(
R
.
id
.
item_text_phone
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
GONE
);
holder
.
itemTextPhone
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
getView
(
R
.
id
.
item_text_phone
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemTextPhone
.
setVisibility
(
View
.
VISIBLE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
item
.
getSubStatus
()
==
6
)
{
holder
.
setText
(
R
.
id
.
tv_error_state
,
mContext
.
getString
(
R
.
string
.
check_upon_delivery
));
holder
.
setTextColor
(
R
.
id
.
tv_error_state
,
mActivity
.
getResources
().
getColor
(
R
.
color
.
cl_tab_line
));
holder
.
getView
(
R
.
id
.
tv_error_state
).
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
item_updata_time
).
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
tv_item_process
).
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_one
).
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_two
).
setVisibility
(
View
.
GONE
);
holder
.
tvErrorState
.
setText
(
mContext
.
getString
(
R
.
string
.
check_upon_delivery
));
holder
.
tvErrorState
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
cl_tab_line
));
holder
.
tvErrorState
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemUpdataTime
.
setVisibility
(
View
.
GONE
);
holder
.
tvItemProcess
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineTwo
.
setVisibility
(
View
.
GONE
);
if
(!
haveCustomer
)
{
holder
.
getView
(
R
.
id
.
ll_bottom
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
item_bottom_line
)
.
setVisibility
(
View
.
GONE
);
holder
.
llBottom
.
setVisibility
(
View
.
GONE
);
holder
.
itemBottomLine
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
getView
(
R
.
id
.
ll_bottom
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
item_bottom_line
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
llBottom
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemBottomLine
.
setVisibility
(
View
.
VISIBLE
);
}
}
time
=
item
.
getConfirmDoorTime
();
break
;
case
5
:
//已完成
holder
.
setText
(
R
.
id
.
tv_error_state
,
mContext
.
getString
(
R
.
string
.
order_finish
));
holder
.
setTextColor
(
R
.
id
.
tv_error_state
,
mActivity
.
getResources
().
getColor
(
R
.
color
.
cl_tab_line
));
holder
.
getView
(
R
.
id
.
tv_error_state
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
item_updata_time
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
tv_item_process
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_one
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
order_line_two
)
.
setVisibility
(
View
.
GONE
);
holder
.
tvErrorState
.
setText
(
mContext
.
getString
(
R
.
string
.
order_finish
));
holder
.
tvErrorState
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
cl_tab_line
));
holder
.
tvErrorState
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemUpdataTime
.
setVisibility
(
View
.
GONE
);
holder
.
tvItemProcess
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineOne
.
setVisibility
(
View
.
GONE
);
holder
.
orderLineTwo
.
setVisibility
(
View
.
GONE
);
if
(!
haveCustomer
)
{
holder
.
getView
(
R
.
id
.
ll_bottom
)
.
setVisibility
(
View
.
GONE
);
holder
.
getView
(
R
.
id
.
item_bottom_line
)
.
setVisibility
(
View
.
GONE
);
holder
.
llBottom
.
setVisibility
(
View
.
GONE
);
holder
.
itemBottomLine
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
getView
(
R
.
id
.
ll_bottom
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
getView
(
R
.
id
.
item_bottom_line
)
.
setVisibility
(
View
.
VISIBLE
);
holder
.
llBottom
.
setVisibility
(
View
.
VISIBLE
);
holder
.
itemBottomLine
.
setVisibility
(
View
.
VISIBLE
);
}
time
=
item
.
getConfirmDoorTime
();
break
;
default
:
break
;
}
if
(
TextUtils
.
isEmpty
(
time
))
{
holder
.
setText
(
R
.
id
.
item_tody
,
mContext
.
getString
(
R
.
string
.
no_appointment
));
holder
.
getView
(
R
.
id
.
item_time
)
.
setVisibility
(
View
.
GONE
);
holder
.
itemTody
.
setText
(
mContext
.
getString
(
R
.
string
.
no_appointment
));
holder
.
itemTime
.
setVisibility
(
View
.
GONE
);
}
else
{
String
dateMD
=
UtilsDate
.
changeFormat
(
time
,
FORMAT_ONE
,
SHORT_DATE_FORMAT
);
String
dateTime
=
UtilsDate
.
changeFormat
(
time
,
FORMAT_ONE
,
LONG_TIME_FORMAT_TWO
);
if
(
UtilsDate
.
IsToday
(
time
))
{
holder
.
setText
(
R
.
id
.
item_tody
,
mContext
.
getString
(
R
.
string
.
today
));
}
else
if
(
UtilsDate
.
IsNextday
(
time
))
{
holder
.
setText
(
R
.
id
.
item_tody
,
mContext
.
getString
(
R
.
string
.
tomorrow
));
}
else
{
holder
.
setText
(
R
.
id
.
item_tody
,
dateMD
);
}
holder
.
setText
(
R
.
id
.
item_time
,
dateTime
);
holder
.
getView
(
R
.
id
.
item_time
).
setVisibility
(
View
.
VISIBLE
);
holder
.
itemTody
.
setText
(
UtilsDate
.
getDayOrIsToday
(
time
));
holder
.
itemTime
.
setText
(
dateTime
);
holder
.
itemTime
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
item
.
getExcptionCode
()
==
1
)
{
holder
.
setText
(
R
.
id
.
tv_error_state
,
mContext
.
getString
(
R
.
string
.
receive_time_out
));
holder
.
getView
(
R
.
id
.
tv_error_state
).
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
item
.
getExcptionCode
()
==
2
)
{
holder
.
setText
(
R
.
id
.
tv_error_state
,
mContext
.
getString
(
R
.
string
.
appointment_time_out
));
holder
.
getView
(
R
.
id
.
tv_error_state
).
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
item
.
getExcptionCode
()
==
3
)
{
holder
.
setText
(
R
.
id
.
tv_error_state
,
mContext
.
getString
(
R
.
string
.
server_time_out
));
holder
.
getView
(
R
.
id
.
tv_error_state
).
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
item
.
getExcptionCode
()
==
4
)
{
holder
.
setText
(
R
.
id
.
tv_error_state
,
mContext
.
getString
(
R
.
string
.
delivery_time_out
));
holder
.
getView
(
R
.
id
.
tv_error_state
).
setVisibility
(
View
.
VISIBLE
);
int
errorState
=
item
.
getExcptionCode
();
if
(
errorState
==
1
)
{
holder
.
tvErrorState
.
setText
(
mContext
.
getString
(
R
.
string
.
receive_time_out
));
holder
.
tvErrorState
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
errorState
==
2
)
{
holder
.
tvErrorState
.
setText
(
mContext
.
getString
(
R
.
string
.
appointment_time_out
));
holder
.
tvErrorState
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
errorState
==
3
)
{
holder
.
tvErrorState
.
setText
(
mContext
.
getString
(
R
.
string
.
server_time_out
));
holder
.
tvErrorState
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
errorState
==
4
)
{
holder
.
tvErrorState
.
setText
(
mContext
.
getString
(
R
.
string
.
delivery_time_out
));
holder
.
tvErrorState
.
setVisibility
(
View
.
VISIBLE
);
}
holder
.
getView
(
R
.
id
.
tv_item_process
).
setOnClickListener
(
v
->
processClick
(
item
,
holder
));
holder
.
getView
(
R
.
id
.
item_updata_time
).
setOnClickListener
(
v
->
dumpSubcribeTimeActivity
(
id
,
holder
.
getAdapterPosition
(),
item
.
getStatus
()));
holder
.
tvItemProcess
.
setOnClickListener
(
v
->
processClick
(
item
,
holder
,
position
));
holder
.
itemUpdataTime
.
setOnClickListener
(
v
->
dumpSubcribeTimeActivity
(
id
,
position
,
item
.
getStatus
()));
if
(
item
.
getStatus
()
!=
1
)
{
holder
.
getView
(
R
.
id
.
item_text_phone
)
.
setOnClickListener
(
v
->
{
holder
.
itemTextPhone
.
setOnClickListener
(
v
->
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_DIAL
);
intent
.
setData
(
Uri
.
parse
(
"tel:"
+
item
.
getCustomerMobile
()));
mContext
.
startActivity
(
intent
);
...
...
@@ -225,20 +219,19 @@ public class OrderDoingAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
}
private
void
processClick
(
Order
it
,
BaseViewHolder
h
)
{
private
void
processClick
(
Order
it
,
FragmentOrderdoingItemBinding
h
,
int
posiiton
)
{
mItem
=
it
;
mHolder
=
h
;
int
position
=
mHolder
.
getAdapterPosition
();
mBind
=
h
;
if
(
mItem
.
getStatus
()
==
4
&&
mItem
.
getSubStatus
()
==
3
)
{
dumpProcessActivity
(
mItem
.
getId
(),
posi
ti
on
);
dumpProcessActivity
(
mItem
.
getId
(),
posi
it
on
);
}
else
if
(
mItem
.
getStatus
()
==
4
&&
mItem
.
getSubStatus
()
==
4
)
{
if
(
mItem
.
getSopStatus
()
==
1
)
{
//sop启用
dumpSOPActivity
(
mItem
.
getId
(),
posi
ti
on
);
dumpSOPActivity
(
mItem
.
getId
(),
posi
it
on
);
}
else
if
(
mItem
.
getSopStatus
()
==
0
)
{
dumpProcessActivity
(
mItem
.
getId
(),
posi
ti
on
);
dumpProcessActivity
(
mItem
.
getId
(),
posi
it
on
);
}
}
else
if
(
mItem
.
getStatus
()
==
4
&&
mItem
.
getSubStatus
()
==
5
)
{
dumpProcessActivity
(
mItem
.
getId
(),
posi
ti
on
);
dumpProcessActivity
(
mItem
.
getId
(),
posi
it
on
);
}
if
(
mItem
.
getStatus
()
==
4
)
{
return
;
...
...
@@ -263,7 +256,7 @@ public class OrderDoingAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
LocationUtils
.
stop
();
ProgressUtil
.
stopLoad
();
mItem
.
setSubStatus
(
2
);
m
Holder
.
setText
(
R
.
id
.
tv_item_process
,
mContext
.
getString
(
R
.
string
.
begain_server
));
m
Bind
.
tvItemProcess
.
setText
(
mContext
.
getString
(
R
.
string
.
begain_server
));
}
},
responeThrowable
->
{
if
(
"ORDER0005"
.
equals
(
responeThrowable
.
subCode
))
{
...
...
@@ -281,8 +274,8 @@ public class OrderDoingAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
ProgressUtil
.
stopLoad
();
mItem
.
setStatus
(
4
);
mItem
.
setSubStatus
(
integer
);
m
Holder
.
setText
(
R
.
id
.
tv_item_process
,
mContext
.
getString
(
R
.
string
.
process_order
));
m
Holder
.
setText
(
R
.
id
.
item_updata_time
,
mContext
.
getString
(
R
.
string
.
need_again_door
));
m
Bind
.
tvItemProcess
.
setText
(
mContext
.
getString
(
R
.
string
.
process_order
));
m
Bind
.
itemUpdataTime
.
setText
(
mContext
.
getString
(
R
.
string
.
need_again_door
));
}
},
responeThrowable
->
{
if
(
"ORDER0006"
.
equals
(
responeThrowable
.
subCode
))
{
...
...
@@ -312,10 +305,10 @@ public class OrderDoingAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
}
private
void
dumpSOPActivity
(
int
id
,
int
adapterPosition
)
{
Intent
intent
=
new
Intent
(
m
Activity
,
SopWebViewActivity
.
class
);
Intent
intent
=
new
Intent
(
m
Context
,
SopWebViewActivity
.
class
);
intent
.
putExtra
(
Constants
.
ORDER_ID
,
id
);
intent
.
putExtra
(
Constants
.
ORDER_POSTION
,
adapterPosition
);
m
Activity
.
startActivity
(
intent
);
m
Context
.
startActivity
(
intent
);
}
...
...
app/src/main/java/com/dayu/bigfish/ui/adapter/OrderFourTabAdapter.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
adapter
;
import
android.content.res.AssetManager
;
import
android.graphics.Typeface
;
import
android.text.TextUtils
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.CoreAdapter
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.databinding.FragmentOrderCancleItemBinding
;
import
com.dayu.bigfish.utils.UtilsDate
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
FORMAT_ONE
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
LONG_TIME_FORMAT_TWO
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
SHORT_DATE_FORMAT
;
/**
* 已取消列表的适配器
* on 2017/9/12.
*/
public
class
OrderFourTabAdapter
extends
BaseQuickAdapter
<
Order
,
BaseViewHolder
>
{
public
class
OrderFourTabAdapter
extends
CoreAdapter
<
Order
,
FragmentOrderCancleItemBinding
>
{
public
OrderFourTabAdapter
(
int
layoutResId
)
{
super
(
layoutResId
);
}
public
OrderFourTabAdapter
(
boolean
needFoot
)
{
super
(
needFoot
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
Order
item
)
{
initData
(
helper
,
item
);
protected
void
onBind
(
FragmentOrderCancleItemBinding
holder
,
Order
item
,
int
positon
)
{
super
.
onBind
(
holder
,
item
,
positon
);
initData
(
holder
,
item
);
}
private
void
initData
(
BaseViewHolder
helper
,
Order
item
)
{
private
void
initData
(
FragmentOrderCancleItemBinding
helper
,
Order
item
)
{
try
{
String
time
;
if
(
item
.
getStatus
()
==
1
||
item
.
getStatus
()
==
2
)
{
time
=
item
.
getAppointmentTime
();
helper
.
setText
(
R
.
id
.
tv_order_time
,
mContext
.
getString
(
R
.
string
.
have_appointment
));
helper
.
tvOrderTime
.
setText
(
mContext
.
getString
(
R
.
string
.
have_appointment
));
}
else
{
time
=
item
.
getConfirmDoorTime
();
helper
.
setText
(
R
.
id
.
tv_order_time
,
mContext
.
getString
(
R
.
string
.
tv_home_tab_one_subscribe_time
));
helper
.
tvOrderTime
.
setText
(
mContext
.
getString
(
R
.
string
.
tv_home_tab_one_subscribe_time
));
}
if
(
TextUtils
.
isEmpty
(
time
))
{
helper
.
setText
(
R
.
id
.
item_tody
,
mContext
.
getString
(
R
.
string
.
no_appointment
));
helper
.
getView
(
R
.
id
.
item_time
)
.
setVisibility
(
View
.
GONE
);
helper
.
itemTody
.
setText
(
mContext
.
getString
(
R
.
string
.
no_appointment
));
helper
.
itemTime
.
setVisibility
(
View
.
GONE
);
}
else
{
String
dateMD
=
UtilsDate
.
changeFormat
(
time
,
FORMAT_ONE
,
SHORT_DATE_FORMAT
);
String
dateTime
=
UtilsDate
.
changeFormat
(
time
,
FORMAT_ONE
,
LONG_TIME_FORMAT_TWO
);
if
(
UtilsDate
.
IsToday
(
time
))
{
helper
.
setText
(
R
.
id
.
item_tody
,
mContext
.
getString
(
R
.
string
.
today
));
}
else
if
(
UtilsDate
.
IsNextday
(
time
))
{
helper
.
setText
(
R
.
id
.
item_tody
,
mContext
.
getString
(
R
.
string
.
tomorrow
));
}
else
{
helper
.
setText
(
R
.
id
.
item_tody
,
dateMD
);
}
helper
.
setText
(
R
.
id
.
item_time
,
dateTime
);
helper
.
getView
(
R
.
id
.
item_time
).
setVisibility
(
View
.
VISIBLE
);
helper
.
itemTody
.
setText
(
UtilsDate
.
getDayOrIsToday
(
time
));
helper
.
itemTime
.
setText
(
dateTime
);
helper
.
itemTime
.
setVisibility
(
View
.
VISIBLE
);
}
AssetManager
mgr
=
mContext
.
getAssets
();
Typeface
tf
=
Typeface
.
createFromAsset
(
mgr
,
"fonts/DIN Alternate Bold.ttf"
);
helper
.
setTypeface
(
R
.
id
.
item_time
,
tf
);
helper
.
setText
(
R
.
id
.
item_text_weixiu_leixing
,
item
.
getCategoryName
());
helper
.
setText
(
R
.
id
.
item_text_weixiu
,
item
.
getProviderName
());
helper
.
setText
(
R
.
id
.
item_text_dizhi
,
item
.
getProvinceName
()
+
item
.
getCityName
()
+
helper
.
itemTextWeixiu
.
setText
(
item
.
getProviderName
());
helper
.
itemTextWeixiuLeixing
.
setText
(
item
.
getCategoryName
());
helper
.
itemTextDizhi
.
setText
(
item
.
getProvinceName
()
+
item
.
getCityName
()
+
item
.
getDistrictName
()
+
item
.
getAddress
());
helper
.
setText
(
R
.
id
.
error_state
,
mContext
.
getString
(
R
.
string
.
order_cancle
));
helper
.
errorState
.
setText
(
mContext
.
getString
(
R
.
string
.
order_cancle
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
app/src/main/java/com/dayu/bigfish/ui/adapter/OrderThreeTabAdapter.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
adapter
;
import
android.content.res.AssetManager
;
import
android.graphics.Typeface
;
import
android.text.TextUtils
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.CoreAdapter
;
import
com.dayu.bigfish.bean.ErrorOrder
;
import
com.dayu.bigfish.databinding.FragmentOrderErrorItemBinding
;
import
com.dayu.bigfish.utils.UtilsDate
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
FORMAT_ONE
;
...
...
@@ -19,43 +17,42 @@ import static com.dayu.bigfish.utils.UtilsDate.LONG_TIME_FORMAT_TWO;
* on 2017/9/12.
*/
public
class
OrderThreeTabAdapter
extends
BaseQuickAdapter
<
ErrorOrder
,
BaseViewHolder
>
{
public
class
OrderThreeTabAdapter
extends
CoreAdapter
<
ErrorOrder
,
FragmentOrderErrorItemBinding
>
{
public
OrderThreeTabAdapter
(
int
layoutResId
)
{
super
(
layoutResId
);
public
OrderThreeTabAdapter
(
boolean
needFoot
)
{
super
(
needFoot
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
ErrorOrder
item
)
{
initData
(
helper
,
item
);
protected
void
onBind
(
FragmentOrderErrorItemBinding
holder
,
ErrorOrder
item
,
int
position
)
{
super
.
onBind
(
holder
,
item
,
position
);
initData
(
holder
,
item
);
}
private
void
initData
(
BaseViewHolder
helper
,
ErrorOrder
item
)
{
private
void
initData
(
FragmentOrderErrorItemBinding
helper
,
ErrorOrder
item
)
{
try
{
String
time
;
if
(
item
.
getStatus
()
==
1
||
item
.
getStatus
()
==
2
)
{
time
=
item
.
getAppointmentTime
();
helper
.
setText
(
R
.
id
.
tv_order_time
,
mContext
.
getString
(
R
.
string
.
have_appointment
));
helper
.
tvOrderTime
.
setText
(
mContext
.
getString
(
R
.
string
.
have_appointment
));
}
else
{
time
=
item
.
getConfirmDoorTime
();
helper
.
setText
(
R
.
id
.
tv_order_time
,
mContext
.
getString
(
R
.
string
.
tv_home_tab_one_subscribe_time
));
helper
.
tvOrderTime
.
setText
(
mContext
.
getString
(
R
.
string
.
tv_home_tab_one_subscribe_time
));
}
if
(
TextUtils
.
isEmpty
(
time
))
{
helper
.
setText
(
R
.
id
.
item_tody
,
mContext
.
getString
(
R
.
string
.
no_appointment
));
helper
.
getView
(
R
.
id
.
item_time
)
.
setVisibility
(
View
.
GONE
);
helper
.
itemTody
.
setText
(
mContext
.
getString
(
R
.
string
.
no_appointment
));
helper
.
itemTime
.
setVisibility
(
View
.
GONE
);
}
else
{
String
dateTime
=
UtilsDate
.
changeFormat
(
time
,
FORMAT_ONE
,
LONG_TIME_FORMAT_TWO
);
helper
.
setText
(
R
.
id
.
item_tody
,
UtilsDate
.
getDayOrIsToday
(
time
));
helper
.
setText
(
R
.
id
.
item_time
,
dateTime
);
helper
.
getView
(
R
.
id
.
item_time
)
.
setVisibility
(
View
.
VISIBLE
);
helper
.
itemTody
.
setText
(
UtilsDate
.
getDayOrIsToday
(
time
));
helper
.
itemTime
.
setText
(
dateTime
);
helper
.
itemTime
.
setVisibility
(
View
.
VISIBLE
);
}
AssetManager
mgr
=
mContext
.
getAssets
();
Typeface
tf
=
Typeface
.
createFromAsset
(
mgr
,
"fonts/DIN Alternate Bold.ttf"
);
helper
.
setTypeface
(
R
.
id
.
item_time
,
tf
);
helper
.
setText
(
R
.
id
.
item_text_weixiu_leixing
,
item
.
getCategoryName
());
helper
.
setText
(
R
.
id
.
item_text_weixiu
,
item
.
getProviderName
());
helper
.
setText
(
R
.
id
.
item_text_dizhi
,
item
.
getProvinceName
()
+
item
.
getCityName
()
+
helper
.
itemTextWeixiu
.
setText
(
item
.
getProviderName
());
helper
.
itemTextWeixiuLeixing
.
setText
(
item
.
getCategoryName
());
helper
.
itemTextDizhi
.
setText
(
item
.
getProvinceName
()
+
item
.
getCityName
()
+
item
.
getDistrictName
()
+
item
.
getAddress
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -63,13 +60,13 @@ public class OrderThreeTabAdapter extends BaseQuickAdapter<ErrorOrder, BaseViewH
int
errorState
=
item
.
getExcptionCode
();
if
(
errorState
==
1
)
{
helper
.
setText
(
R
.
id
.
error_state
,
mContext
.
getString
(
R
.
string
.
receive_time_out
));
helper
.
errorState
.
setText
(
mContext
.
getString
(
R
.
string
.
receive_time_out
));
}
else
if
(
errorState
==
2
)
{
helper
.
setText
(
R
.
id
.
error_state
,
mContext
.
getString
(
R
.
string
.
appointment_time_out
));
helper
.
errorState
.
setText
(
mContext
.
getString
(
R
.
string
.
appointment_time_out
));
}
else
if
(
errorState
==
3
)
{
helper
.
setText
(
R
.
id
.
error_state
,
mContext
.
getString
(
R
.
string
.
server_time_out
));
helper
.
errorState
.
setText
(
mContext
.
getString
(
R
.
string
.
server_time_out
));
}
else
if
(
errorState
==
4
)
{
helper
.
setText
(
R
.
id
.
error_state
,
mContext
.
getString
(
R
.
string
.
delivery_time_out
));
helper
.
errorState
.
setText
(
mContext
.
getString
(
R
.
string
.
delivery_time_out
));
}
}
...
...
app/src/main/java/com/dayu/bigfish/ui/adapter/ServeDatailsAdapter.java
deleted
100755 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
ui
.
adapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.bean.OrderDetail
;
import
com.dayu.bigfish.utils.UtilsDate
;
import
java.text.ParseException
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
FORMAT_FOURTH
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
FORMAT_ONE
;
/**
* 服务记录的适配器
* on 2017/9/30.
*/
public
class
ServeDatailsAdapter
extends
BaseQuickAdapter
<
OrderDetail
.
RecordBean
,
BaseViewHolder
>
{
public
ServeDatailsAdapter
(
int
layoutResId
)
{
super
(
layoutResId
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
OrderDetail
.
RecordBean
item
)
{
try
{
String
date
=
UtilsDate
.
changeFormat
(
item
.
getCreateTime
(),
FORMAT_ONE
,
FORMAT_FOURTH
);
helper
.
setText
(
R
.
id
.
item_time
,
date
);
helper
.
setText
(
R
.
id
.
item_text
,
item
.
getOperationComment
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
app/src/main/java/com/dayu/bigfish/ui/adapter/SystemMessageAdapter.java
deleted
100755 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
ui
.
adapter
;
import
android.content.res.AssetManager
;
import
android.graphics.Typeface
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.bean.NewMessage
;
import
com.dayu.bigfish.utils.UtilsDate
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
FORMAT_ONE
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
LONG_TIME_FORMAT_TWO
;
import
static
com
.
dayu
.
bigfish
.
utils
.
UtilsDate
.
SHORT_DATE_FORMAT
;
/**
* 系统消息的适配器
* 2017/10/14.
*/
public
class
SystemMessageAdapter
extends
BaseQuickAdapter
<
NewMessage
,
BaseViewHolder
>
{
public
SystemMessageAdapter
(
int
layoutResId
)
{
super
(
layoutResId
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
NewMessage
item
)
{
AssetManager
mgr
=
mContext
.
getAssets
();
//得到AssetManager
Typeface
tf
=
Typeface
.
createFromAsset
(
mgr
,
"fonts/DIN Alternate Bold.ttf"
);
//根据路径得到Typeface
helper
.
setTypeface
(
R
.
id
.
message_date
,
tf
);
if
(
item
.
getRead
()
==
1
)
{
helper
.
getView
(
R
.
id
.
read_state
).
setVisibility
(
View
.
GONE
);
}
else
{
helper
.
getView
(
R
.
id
.
read_state
).
setVisibility
(
View
.
VISIBLE
);
}
try
{
String
dateMD
=
UtilsDate
.
changeFormat
(
item
.
getCreateTime
(),
FORMAT_ONE
,
SHORT_DATE_FORMAT
);
String
dateTime
=
UtilsDate
.
changeFormat
(
item
.
getCreateTime
(),
FORMAT_ONE
,
LONG_TIME_FORMAT_TWO
);
if
(
UtilsDate
.
IsToday
(
item
.
getCreateTime
()))
{
helper
.
setText
(
R
.
id
.
message_date
,
mContext
.
getString
(
R
.
string
.
today
));
}
else
if
(
UtilsDate
.
IsNextday
(
item
.
getCreateTime
()))
{
helper
.
setText
(
R
.
id
.
message_date
,
mContext
.
getString
(
R
.
string
.
tomorrow
));
}
else
{
helper
.
setText
(
R
.
id
.
message_date
,
dateMD
);
}
helper
.
setText
(
R
.
id
.
message_time
,
dateTime
);
helper
.
setText
(
R
.
id
.
message_text_content
,
item
.
getTitle
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
app/src/main/java/com/dayu/bigfish/ui/fragment/BigFishMessageFragment.java
deleted
100755 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
android.widget.TextView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.NewMessage
;
import
com.dayu.bigfish.databinding.FragmentMessageSystemBinding
;
import
com.dayu.bigfish.presenter.message.messageContract
;
import
com.dayu.bigfish.presenter.message.messagePresenter
;
import
com.dayu.bigfish.ui.SystemMesDetailActivity
;
import
com.dayu.bigfish.ui.adapter.SystemMessageAdapter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
/**
* 大鱼运营官方通知
* on 2017/10/11.
*/
public
class
BigFishMessageFragment
extends
BaseFragment
<
messagePresenter
,
FragmentMessageSystemBinding
>
implements
messageContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
private
SystemMessageAdapter
mAdapter
;
private
String
hxUserId
;
private
int
mPage
=
1
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mTotalPage
=
1
;
private
int
mRefreshState
=
1
;
//1:刷新,2:下拉加载
@Override
public
View
initView
(
View
view
)
{
initData
();
return
view
;
}
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_message_system
;
}
@Override
protected
void
lazyLoad
()
{
}
public
void
initData
()
{
hxUserId
=
GetUserInfo
.
getHxUserId
(
mActivity
);
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getHxMessage
(
hxUserId
,
2
,
mPage
,
mPageSize
);
mAdapter
=
new
SystemMessageAdapter
(
R
.
layout
.
message_adapter
);
mBind
.
rlMessage
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
mBind
.
rlMessage
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
rlMessage
);
mBind
.
spRefersh
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mBind
.
rlMessage
);
mAdapter
.
setEnableLoadMore
(
false
);
initListener
();
}
private
void
initListener
()
{
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
NewMessage
message
=
(
NewMessage
)
adapter
.
getData
().
get
(
position
);
if
(
message
.
getRead
()
==
0
)
{
mPresenter
.
readMessage
(
message
.
getId
(),
1
);
TextView
textView
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
read_state
);
textView
.
setVisibility
(
View
.
GONE
);
}
Intent
intent
=
new
Intent
(
mActivity
,
SystemMesDetailActivity
.
class
);
intent
.
putExtra
(
Constants
.
HX_MESSAGE
,
message
);
intent
.
putExtra
(
"category"
,
2
);
startActivity
(
intent
);
});
}
@Override
public
void
getHxMessageSuccess
(
BasePageBean
<
NewMessage
>
message
)
{
mTotalPage
=
message
.
getTotalPages
();
mPageSize
=
message
.
getPageSize
();
if
(
mRefreshState
==
1
)
{
mBind
.
rlMessage
.
smoothScrollToPosition
(
0
);
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
message
.
getData
());
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mAdapter
.
addData
(
message
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
mPage
+=
1
;
}
mPage
+=
1
;
if
(
message
.
getData
().
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
}
@Override
public
void
getHxMessageFail
()
{
if
(
mBind
.
spRefersh
.
isRefreshing
())
{
mBind
.
spRefersh
.
setRefreshing
(
false
);
}
}
@Override
public
void
readMessageSuccess
()
{
}
@Override
public
void
onRefresh
()
{
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getHxMessage
(
hxUserId
,
2
,
mPage
,
mPageSize
);
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getHxMessage
(
hxUserId
,
2
,
mPage
,
mPageSize
);
}
}
app/src/main/java/com/dayu/bigfish/ui/fragment/HomeOrderFragment.java
View file @
8292e843
...
...
@@ -13,15 +13,16 @@ import android.widget.TextView;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.bean.Tab
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.databinding.FragmentOrderHomeBinding
;
import
com.dayu.bigfish.presenter.homeorder.HomeOrderContract
;
import
com.dayu.bigfish.presenter.homeorder.HomeOrderPresenter
;
import
com.dayu.bigfish.ui.OrderRecordActivity
;
import
com.dayu.bigfish.ui.adapter.FragmentHomeAdapter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.TabLayoutUtils
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
...
...
@@ -85,8 +86,9 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
public
void
init
()
{
tabDesc
=
new
String
[]{
mActivity
.
getString
(
R
.
string
.
waite_appointemnt
),
mActivity
.
getString
(
R
.
string
.
waite_server
),
mActivity
.
getString
(
R
.
string
.
order_exception
),
mActivity
.
getString
(
R
.
string
.
cancle_order
)};
userId
=
GetUserInfo
.
getACCOUNT_ID
(
mActivity
);
mSiteId
=
GetUserInfo
.
getSITE_ID
(
mActivity
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
mSiteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
());
mBind
.
tvRightTitle
.
setOnClickListener
(
o
->
{
Intent
intent
=
new
Intent
(
mActivity
,
OrderRecordActivity
.
class
);
mActivity
.
startActivity
(
intent
);
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/HomePersonFragment.java
View file @
8292e843
...
...
@@ -11,13 +11,13 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.bean.EngineerInfo
;
import
com.dayu.bigfish.bean.OrderRecord
;
import
com.dayu.bigfish.bean.TodayAchievement
;
import
com.dayu.bigfish.bean.TodayBalance
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.databinding.FragmentPersonalCenterBinding
;
import
com.dayu.bigfish.presenter.homefourtab.HomeFourContract
;
import
com.dayu.bigfish.presenter.homefourtab.HomePersonPresenter
;
...
...
@@ -26,9 +26,9 @@ import com.dayu.bigfish.ui.OrderRecordActivity;
import
com.dayu.bigfish.ui.SettingActivity
;
import
com.dayu.bigfish.ui.WithdrawalsActivity
;
import
com.dayu.bigfish.ui.views.CustomDialog
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.SPUtils
;
import
com.dayu.bigfish.utils.managers.UserManager
;
/**
* Created by luofan on 2017/11/20.
...
...
@@ -58,9 +58,10 @@ public class HomePersonFragment extends BaseFragment<HomePersonPresenter, Fragme
@Override
public
View
initView
(
View
view
)
{
mBind
.
setPresenter
(
mPresenter
);
userId
=
GetUserInfo
.
getACCOUNT_ID
(
MyApplication
.
getContext
());
siteId
=
GetUserInfo
.
getSITE_ID
(
MyApplication
.
getContext
());
mBind
.
setImgurl
(
GetUserInfo
.
getUserHead
(
mActivity
));
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
siteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
());
mBind
.
setImgurl
(
userInfo
.
getHeaderImg
());
return
view
;
}
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/MessageFragment.java
View file @
8292e843
...
...
@@ -8,11 +8,12 @@ import com.dayu.bigfish.R;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.NewMessage
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.databinding.LrecyclerViewBinding
;
import
com.dayu.bigfish.presenter.message.messageContract
;
import
com.dayu.bigfish.presenter.message.messagePresenter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.managers.UserManager
;
/**
...
...
@@ -51,7 +52,8 @@ public class MessageFragment extends BaseFragment<messagePresenter, LrecyclerVie
}
public
void
initData
()
{
hxUserId
=
GetUserInfo
.
getHxUserId
(
mActivity
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
hxUserId
=
userInfo
.
getHxAccount
();
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getHxMessage
(
hxUserId
,
mCategory
,
mPage
,
mPageSize
);
initListener
();
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderDatailsServeFragment.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
com.dayu.bigfish.R
;
...
...
@@ -9,7 +8,6 @@ import com.dayu.bigfish.bean.OrderDetail;
import
com.dayu.bigfish.databinding.FragmentOrderServeBinding
;
import
com.dayu.bigfish.presenter.orderdetailserve.OrderDetailServeContract
;
import
com.dayu.bigfish.presenter.orderdetailserve.OrderDetailServePresenter
;
import
com.dayu.bigfish.ui.adapter.ServeDatailsAdapter
;
import
com.dayu.bigfish.utils.ProgressUtil
;
/**
...
...
@@ -19,17 +17,13 @@ import com.dayu.bigfish.utils.ProgressUtil;
public
class
OrderDatailsServeFragment
extends
BaseFragment
<
OrderDetailServePresenter
,
FragmentOrderServeBinding
>
implements
OrderDetailServeContract
.
View
{
private
int
orderId
;
private
ServeDatailsAdapter
mAdapter
;
@Override
public
View
initView
(
View
view
)
{
orderId
=
getArguments
().
getInt
(
"orderId"
);
mAdapter
=
new
ServeDatailsAdapter
(
R
.
layout
.
serve_datails_item
);
mBind
.
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
recyclerView
);
return
null
;
mBind
.
recyclerView
.
setPresenter
(
mPresenter
);
return
view
;
}
@Override
...
...
@@ -45,9 +39,6 @@ public class OrderDatailsServeFragment extends BaseFragment<OrderDetailServePres
@Override
public
void
getOrderServerInfo
(
OrderDetail
detail
)
{
if
(
detail
!=
null
)
{
mAdapter
.
setNewData
(
detail
.
getRecord
());
mAdapter
.
loadMoreEnd
();
}
mBind
.
recyclerView
.
setData
(
detail
.
getRecord
());
}
}
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderFirstTabFragment.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.RefreshApoiment
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.databinding.FragmentRecyclerBinding
;
import
com.dayu.bigfish.databinding.CommomRecycleBinding
;
import
com.dayu.bigfish.databinding.FragmentOrderdoingItemBinding
;
import
com.dayu.bigfish.presenter.AppointmentOrder.AppointmentContract
;
import
com.dayu.bigfish.presenter.AppointmentOrder.AppointmentPresenter
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.ui.adapter.Order
Doing
Adapter
;
import
com.dayu.bigfish.u
tils.GetUserInfo
;
import
com.dayu.bigfish.ui.adapter.OrderAdapter
;
import
com.dayu.bigfish.u
i.listener.OnItemClickListener
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
...
...
@@ -30,29 +30,23 @@ import org.greenrobot.eventbus.ThreadMode;
* 待预约的Fragment
*/
public
class
OrderFirstTabFragment
extends
BaseFragment
<
AppointmentPresenter
,
FragmentRecyclerBinding
>
implements
AppointmentContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
private
Order
Doing
Adapter
mAdapter
;
public
class
OrderFirstTabFragment
extends
BaseFragment
<
AppointmentPresenter
,
CommomRecycleBinding
>
implements
AppointmentContract
.
View
{
private
OrderAdapter
mAdapter
;
private
int
siteId
;
private
int
userId
;
private
int
mTotalPage
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mPage
=
1
;
private
int
mRefreshState
=
1
;
//1:刷新,private int mRefreshState;
@Override
public
View
initView
(
View
view
)
{
siteId
=
GetUserInfo
.
getSITE_ID
(
mActivity
);
userId
=
GetUserInfo
.
getACCOUNT_ID
(
mActivity
);
mAdapter
=
new
OrderDoingAdapter
(
R
.
layout
.
fragment_orderdoing_item
,
mActivity
);
m
Bind
.
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
)
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
()
);
siteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
()
);
m
Adapter
=
new
OrderAdapter
(
true
,
R
.
layout
.
fragment_orderdoing_item
);
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
recyclerView
);
mBind
.
spRefersh
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mBind
.
recyclerView
);
ProgressUtil
.
startLoad
(
mActivity
);
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getWatingOrder
(
Constants
.
APPOIMENT_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
initListener
();
return
view
;
...
...
@@ -64,31 +58,30 @@ public class OrderFirstTabFragment extends BaseFragment<AppointmentPresenter,Fra
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_recycler
;
return
R
.
layout
.
commom_recycle
;
}
public
void
initListener
()
{
EventBus
.
getDefault
().
register
(
this
);
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
Order
order
=
(
Order
)
adapter
.
getItem
(
position
);
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
order
.
getId
());
startActivity
(
intent
);
mBind
.
recyclerView
.
setRefreshListener
(()
->
refresh
());
mBind
.
recyclerView
.
setOnLoadMoreListener
(()
->
{
mPage
++;
mPresenter
.
getWatingOrder
(
Constants
.
APPOIMENT_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
});
mAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
Order
order
=
(
Order
)
adapter
.
getItem
(
position
);
Intent
intent
=
new
Intent
(
getContext
(),
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
order
.
getId
());
startActivity
(
intent
);
mAdapter
.
setOnItemClickListener
(
new
OnItemClickListener
<
Order
,
FragmentOrderdoingItemBinding
>()
{
@Override
public
void
OnItemClick
(
Order
item
,
FragmentOrderdoingItemBinding
bind
)
{
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
item
.
getId
());
startActivity
(
intent
);
}
});
}
@Subscribe
(
threadMode
=
ThreadMode
.
MAIN
)
public
void
RefreshApoiment
(
RefreshApoiment
event
)
{
mPage
=
1
;
mRefreshState
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getWatingOrder
(
Constants
.
APPOIMENT_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
...
...
@@ -96,56 +89,16 @@ public class OrderFirstTabFragment extends BaseFragment<AppointmentPresenter,Fra
@Override
public
void
getWatingOrderSuccess
(
BasePageBean
<
Order
>
data
)
{
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
mTotalPage
=
data
.
getTotalPages
();
mPageSize
=
data
.
getPageSize
();
if
(
mRefreshState
==
1
)
{
mBind
.
recyclerView
.
smoothScrollToPosition
(
0
);
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
data
.
getData
());
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mAdapter
.
addData
(
data
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
}
mPage
+=
1
;
if
(
data
.
getData
().
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
mBind
.
recyclerView
.
setPageData
(
data
);
}
@Override
public
void
getWatingOrderFial
()
{
if
(
mRefreshState
==
1
)
{
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_loading_failed
);
mAdapter
.
setEnableLoadMore
(
true
);
}
mAdapter
.
loadMoreFail
();
mAdapter
.
getEmptyView
().
setOnClickListener
(
v
->
{
ProgressUtil
.
startLoad
(
mActivity
);
refresh
();
});
}
@Override
public
void
onRefresh
()
{
refresh
();
mBind
.
recyclerView
.
setDataFail
();
}
public
void
refresh
()
{
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getWatingOrder
(
Constants
.
APPOIMENT_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getWatingOrder
(
Constants
.
APPOIMENT_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderFourTabFragment.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.databinding.
FragmentRecycler
Binding
;
import
com.dayu.bigfish.databinding.
CommomRecycle
Binding
;
import
com.dayu.bigfish.presenter.AppointmentOrder.AppointmentContract
;
import
com.dayu.bigfish.presenter.AppointmentOrder.AppointmentPresenter
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.ui.adapter.OrderFourTabAdapter
;
import
com.dayu.bigfish.u
tils.GetUserInfo
;
import
com.dayu.bigfish.u
i.listener.OnItemClickListener
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.greenrobot.eventbus.EventBus
;
...
...
@@ -28,24 +27,22 @@ import org.greenrobot.eventbus.EventBus;
* on 2017/8/31.
*/
public
class
OrderFourTabFragment
extends
BaseFragment
<
AppointmentPresenter
,
FragmentRecyclerBinding
>
implements
AppointmentContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
public
class
OrderFourTabFragment
extends
BaseFragment
<
AppointmentPresenter
,
CommomRecycleBinding
>
implements
AppointmentContract
.
View
{
private
OrderFourTabAdapter
mAdapter
;
private
int
siteId
;
private
int
userId
;
private
int
mTotalPage
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mPage
=
1
;
private
int
mRefreshState
=
1
;
//1:刷新,private int mRefreshState;
@Override
public
View
initView
(
View
view
)
{
siteId
=
GetUserInfo
.
getSITE_ID
(
mActivity
);
userId
=
GetUserInfo
.
getACCOUNT_ID
(
mActivity
);
mAdapter
=
new
OrderFourTabAdapter
(
R
.
layout
.
fragment_order_cancle_item
);
mBind
.
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
siteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
());
mAdapter
=
new
OrderFourTabAdapter
(
true
);
mAdapter
.
setViewType
(
R
.
layout
.
fragment_order_cancle_item
);
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
recyclerView
);
mBind
.
spRefersh
.
setOnRefreshListener
(
this
);
initListener
();
return
view
;
}
...
...
@@ -57,21 +54,28 @@ public class OrderFourTabFragment extends BaseFragment<AppointmentPresenter, Fra
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_recycler
;
return
R
.
layout
.
commom_recycle
;
}
protected
void
initData
()
{
ProgressUtil
.
startLoad
(
mActivity
);
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getWatingOrder
(
Constants
.
CANCLE_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
public
void
initListener
()
{
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
Order
order
=
(
Order
)
adapter
.
getItem
(
position
);
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
order
.
getId
());
startActivity
(
intent
);
mBind
.
recyclerView
.
setRefreshListener
(()
->
refresh
());
mBind
.
recyclerView
.
setOnLoadMoreListener
(()
->
{
mPage
++;
mPresenter
.
getWatingOrder
(
Constants
.
CANCLE_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
});
mBind
.
recyclerView
.
setOnItemClickListener
(
new
OnItemClickListener
()
{
@Override
public
void
OnItemClick
(
Object
item
,
Object
bind
)
{
Order
order
=
(
Order
)
item
;
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
order
.
getId
());
startActivity
(
intent
);
}
});
}
...
...
@@ -79,57 +83,18 @@ public class OrderFourTabFragment extends BaseFragment<AppointmentPresenter, Fra
@Override
public
void
getWatingOrderSuccess
(
BasePageBean
<
Order
>
data
)
{
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
mTotalPage
=
data
.
getTotalPages
();
mPageSize
=
data
.
getPageSize
();
if
(
mRefreshState
==
1
)
{
mBind
.
recyclerView
.
smoothScrollToPosition
(
0
);
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
data
.
getData
());
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mAdapter
.
addData
(
data
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
}
mPage
+=
1
;
if
(
data
.
getData
().
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
mBind
.
recyclerView
.
setPageData
(
data
);
}
@Override
public
void
getWatingOrderFial
()
{
if
(
mRefreshState
==
1
)
{
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_loading_failed
);
mAdapter
.
setEnableLoadMore
(
true
);
}
mAdapter
.
loadMoreFail
();
mAdapter
.
getEmptyView
().
setOnClickListener
(
v
->
{
ProgressUtil
.
startLoad
(
mActivity
);
refresh
();
});
}
@Override
public
void
onRefresh
()
{
refresh
();
mBind
.
recyclerView
.
setDataFail
();
}
public
void
refresh
()
{
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getWatingOrder
(
Constants
.
CANCLE_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getWatingOrder
(
Constants
.
CANCLE_ORDER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
}
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderSecondTabFragment.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.Order
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.OrderState
;
import
com.dayu.bigfish.bean.event.RefreshServe
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.databinding.
FragmentRecycler
Binding
;
import
com.dayu.bigfish.databinding.
CommomRecycle
Binding
;
import
com.dayu.bigfish.presenter.serverorder.ServerOrderPresenter
;
import
com.dayu.bigfish.presenter.serverorder.ServerorderContract
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.ui.adapter.OrderDoingAdapter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.ui.adapter.OrderAdapter
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
...
...
@@ -40,28 +38,24 @@ import static com.dayu.bigfish.ui.fragment.HomeOrderFragment.ORDER_YUYUE;
* on 2017/8/31.
*/
public
class
OrderSecondTabFragment
extends
BaseFragment
<
ServerOrderPresenter
,
FragmentRecyclerBinding
>
implements
ServerorderContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
private
OrderDoingAdapter
mAdapter
;
public
class
OrderSecondTabFragment
extends
BaseFragment
<
ServerOrderPresenter
,
CommomRecycleBinding
>
implements
ServerorderContract
.
View
{
private
OrderAdapter
mAdapter
;
private
int
siteId
;
private
int
userId
;
private
int
mTotalPage
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mPage
=
1
;
private
int
mRefreshState
=
1
;
//1:刷新,private int mRefreshState;
private
List
<
Order
>
mDatas
;
@Override
public
View
initView
(
View
view
)
{
EventBus
.
getDefault
().
register
(
this
);
siteId
=
GetUserInfo
.
getSITE_ID
(
mActivity
);
userId
=
GetUserInfo
.
getACCOUNT_ID
(
mActivity
);
mAdapter
=
new
OrderDoingAdapter
(
R
.
layout
.
fragment_orderdoing_item
,
getActivity
());
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
siteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
());
mAdapter
=
new
OrderAdapter
(
true
,
R
.
layout
.
fragment_orderdoing_item
);
mAdapter
.
initPresenter
(
mPresenter
);
mBind
.
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
recyclerView
);
mBind
.
spRefersh
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mBind
.
recyclerView
);
mDatas
=
new
ArrayList
<>();
initListener
();
return
view
;
...
...
@@ -69,14 +63,18 @@ public class OrderSecondTabFragment extends BaseFragment<ServerOrderPresenter,Fr
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_recycler
;
return
R
.
layout
.
commom_recycle
;
}
public
void
initListener
()
{
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
Order
order
=
(
Order
)
adapter
.
getItem
(
position
);
mBind
.
recyclerView
.
setRefreshListener
(()
->
referesh
());
mBind
.
recyclerView
.
setOnLoadMoreListener
(()
->
{
mPage
++;
mPresenter
.
getWatingOrder
(
Constants
.
WATING_SERVER
,
userId
,
siteId
,
mPage
,
mPageSize
);
});
mAdapter
.
setOnItemClickListener
((
item
,
bind
)
->
{
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
order
.
getId
());
intent
.
putExtra
(
"orderId"
,
item
.
getId
());
startActivity
(
intent
);
});
}
...
...
@@ -84,8 +82,6 @@ public class OrderSecondTabFragment extends BaseFragment<ServerOrderPresenter,Fr
@Subscribe
(
threadMode
=
ThreadMode
.
MAIN
)
public
void
RefreshServe
(
RefreshServe
event
)
{
mPage
=
1
;
mRefreshState
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getWatingOrder
(
Constants
.
WATING_SERVER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
...
...
@@ -106,8 +102,8 @@ public class OrderSecondTabFragment extends BaseFragment<ServerOrderPresenter,Fr
}
else
if
(
event
.
getState
()
==
ORDER_NOCONTACT_FINISH
)
{
mDatas
.
remove
(
order
);
}
m
Adapter
.
setNew
Data
(
mDatas
);
mAdapter
.
loadMoreEnd
(
);
m
Bind
.
recyclerView
.
set
Data
(
mDatas
);
mAdapter
.
setLoadMore
(
true
);
}
...
...
@@ -119,66 +115,23 @@ public class OrderSecondTabFragment extends BaseFragment<ServerOrderPresenter,Fr
@Override
protected
void
lazyLoad
()
{
ProgressUtil
.
startLoad
(
mActivity
);
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getWatingOrder
(
Constants
.
WATING_SERVER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
@Override
public
void
getWatingOrderSuccess
(
BasePageBean
<
Order
>
data
)
{
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
mTotalPage
=
data
.
getTotalPages
();
mPageSize
=
data
.
getPageSize
();
if
(
mRefreshState
==
1
)
{
mBind
.
recyclerView
.
smoothScrollToPosition
(
0
);
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
data
.
getData
());
mDatas
.
clear
();
mDatas
.
addAll
(
data
.
getData
());
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mDatas
.
addAll
(
data
.
getData
());
mAdapter
.
addData
(
data
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
}
mPage
+=
1
;
if
(
data
.
getData
().
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
mBind
.
recyclerView
.
setPageData
(
data
);
mDatas
=
mAdapter
.
getDatas
();
}
@Override
public
void
getWatingOrderFial
()
{
if
(
mBind
.
spRefersh
.
isRefreshing
())
{
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_loading_failed
);
}
mAdapter
.
loadMoreFail
();
mAdapter
.
setEnableLoadMore
(
true
);
mAdapter
.
getEmptyView
().
setOnClickListener
(
v
->
{
ProgressUtil
.
startLoad
(
mActivity
);
referesh
();
});
mBind
.
recyclerView
.
setDataFail
();
}
public
void
referesh
()
{
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getWatingOrder
(
Constants
.
WATING_SERVER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
@Override
public
void
onRefresh
()
{
referesh
();
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getWatingOrder
(
Constants
.
WATING_SERVER
,
userId
,
siteId
,
mPage
,
mPageSize
);
}
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderThreeTabFragment.java
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.bean.ErrorOrder
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.databinding.FragmentRecyclerBinding
;
import
com.dayu.bigfish.databinding.CommomRecycleBinding
;
import
com.dayu.bigfish.databinding.FragmentOrderErrorItemBinding
;
import
com.dayu.bigfish.presenter.errororder.ErrorOrderContract
;
import
com.dayu.bigfish.presenter.errororder.ErrorOrderPresenter
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.ui.adapter.OrderThreeTabAdapter
;
import
com.dayu.bigfish.u
tils.GetUserInfo
;
import
com.dayu.bigfish.u
i.listener.OnItemClickListener
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
org.greenrobot.eventbus.EventBus
;
...
...
@@ -27,21 +28,19 @@ import java.util.List;
* on 2017/8/31.
*/
public
class
OrderThreeTabFragment
extends
BaseFragment
<
ErrorOrderPresenter
,
FragmentRecyclerBinding
>
implements
ErrorOrderContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
{
private
OrderThreeTabAdapter
mAdapter
;
public
class
OrderThreeTabFragment
extends
BaseFragment
<
ErrorOrderPresenter
,
CommomRecycleBinding
>
implements
ErrorOrderContract
.
View
{
private
int
siteId
;
private
int
userId
;
@Override
public
View
initView
(
View
view
)
{
siteId
=
GetUserInfo
.
getSITE_ID
(
mActivity
);
userId
=
GetUserInfo
.
getACCOUNT_ID
(
mActivity
);
mAdapter
=
new
OrderThreeTabAdapter
(
R
.
layout
.
fragment_order_error_item
);
mBind
.
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
mBind
.
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
disableLoadMoreIfNotFullPage
(
mBind
.
recyclerView
);
mBind
.
spRefersh
.
setOnRefreshListener
(
this
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
(
mActivity
);
userId
=
Integer
.
parseInt
(
userInfo
.
getAccountId
());
siteId
=
Integer
.
parseInt
(
userInfo
.
getSiteId
());
OrderThreeTabAdapter
adapter
=
new
OrderThreeTabAdapter
(
false
);
adapter
.
setViewType
(
R
.
layout
.
fragment_order_error_item
);
mBind
.
recyclerView
.
setAdapter
(
adapter
);
initListener
();
return
view
;
}
...
...
@@ -53,15 +52,18 @@ public class OrderThreeTabFragment extends BaseFragment<ErrorOrderPresenter,Frag
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_recycler
;
return
R
.
layout
.
commom_recycle
;
}
public
void
initListener
()
{
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
ErrorOrder
order
=
(
ErrorOrder
)
adapter
.
getItem
(
position
);
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
order
.
getId
());
startActivity
(
intent
);
mBind
.
recyclerView
.
setRefreshListener
(()
->
mPresenter
.
getErrorOrder
(
userId
,
siteId
));
mBind
.
recyclerView
.
setOnItemClickListener
(
new
OnItemClickListener
<
ErrorOrder
,
FragmentOrderErrorItemBinding
>()
{
@Override
public
void
OnItemClick
(
ErrorOrder
item
,
FragmentOrderErrorItemBinding
bind
)
{
Intent
intent
=
new
Intent
(
mActivity
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
"orderId"
,
item
.
getId
());
startActivity
(
intent
);
}
});
}
...
...
@@ -73,31 +75,12 @@ public class OrderThreeTabFragment extends BaseFragment<ErrorOrderPresenter,Frag
@Override
public
void
getErrorOrderSuccess
(
List
<
ErrorOrder
>
data
)
{
mBind
.
recyclerView
.
setData
(
data
);
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
if
(
mBind
.
spRefersh
.
isRefreshing
())
{
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
loadMoreEnd
();
}
mAdapter
.
setNewData
(
data
);
if
(
data
.
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
}
@Override
public
void
getErrorOrderFial
()
{
if
(
mBind
.
spRefersh
.
isRefreshing
())
{
mBind
.
spRefersh
.
setRefreshing
(
false
);
}
mAdapter
.
getEmptyView
().
setOnClickListener
(
v
->
{
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getErrorOrder
(
userId
,
siteId
);
});
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_loading_failed
);
}
@Override
public
void
onRefresh
()
{
mPresenter
.
getErrorOrder
(
userId
,
siteId
);
mBind
.
recyclerView
.
setDataFail
();
}
}
app/src/main/java/com/dayu/bigfish/ui/fragment/SystemMessageFragment.java
deleted
100755 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.view.View
;
import
android.widget.TextView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.NewMessage
;
import
com.dayu.bigfish.databinding.FragmentMessageSystemBinding
;
import
com.dayu.bigfish.presenter.message.messageContract
;
import
com.dayu.bigfish.presenter.message.messagePresenter
;
import
com.dayu.bigfish.ui.SystemMesDetailActivity
;
import
com.dayu.bigfish.ui.adapter.SystemMessageAdapter
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.ProgressUtil
;
/**
* 系统工单状态通知
* on 2017/10/11.
*/
public
class
SystemMessageFragment
extends
BaseFragment
<
messagePresenter
,
FragmentMessageSystemBinding
>
implements
messageContract
.
View
,
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
private
SystemMessageAdapter
mAdapter
;
private
String
hxUserId
;
private
int
mPage
=
1
;
private
int
mPageSize
=
Constants
.
PAGESIZE
;
private
int
mTotalPage
=
1
;
private
int
mRefreshState
=
1
;
//1:刷新,2:下拉加载
@Override
public
View
initView
(
View
view
)
{
initData
();
return
view
;
}
private
void
initListener
()
{
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
NewMessage
message
=
(
NewMessage
)
adapter
.
getData
().
get
(
position
);
if
(
message
.
getRead
()
==
0
)
{
mPresenter
.
readMessage
(
message
.
getId
(),
1
);
TextView
textView
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
read_state
);
textView
.
setVisibility
(
View
.
GONE
);
}
Intent
intent
=
new
Intent
(
mActivity
,
SystemMesDetailActivity
.
class
);
intent
.
putExtra
(
Constants
.
HX_MESSAGE
,
message
);
intent
.
putExtra
(
"category"
,
1
);
startActivity
(
intent
);
});
}
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_message_system
;
}
@Override
protected
void
lazyLoad
()
{
}
public
void
initData
()
{
hxUserId
=
GetUserInfo
.
getHxUserId
(
mActivity
);
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getHxMessage
(
hxUserId
,
1
,
mPage
,
mPageSize
);
mAdapter
=
new
SystemMessageAdapter
(
R
.
layout
.
message_adapter
);
mBind
.
rlMessage
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
mBind
.
rlMessage
.
setAdapter
(
mAdapter
);
mBind
.
spRefersh
.
setOnRefreshListener
(
this
);
mAdapter
.
setOnLoadMoreListener
(
this
,
mBind
.
rlMessage
);
mAdapter
.
setEnableLoadMore
(
false
);
initListener
();
}
@Override
public
void
getHxMessageSuccess
(
BasePageBean
<
NewMessage
>
message
)
{
mTotalPage
=
message
.
getTotalPages
();
mPageSize
=
message
.
getPageSize
();
if
(
mRefreshState
==
1
)
{
mBind
.
rlMessage
.
smoothScrollToPosition
(
0
);
mBind
.
spRefersh
.
setRefreshing
(
false
);
mAdapter
.
setNewData
(
message
.
getData
());
mAdapter
.
setEnableLoadMore
(
true
);
}
else
{
mAdapter
.
addData
(
message
.
getData
());
}
if
(
mPage
>=
mTotalPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mAdapter
.
loadMoreComplete
();
mPage
+=
1
;
}
mPage
+=
1
;
if
(
message
.
getData
().
size
()
==
0
)
{
mAdapter
.
setEmptyView
(
R
.
layout
.
tips_empty
);
}
}
@Override
public
void
getHxMessageFail
()
{
if
(
mBind
.
spRefersh
.
isRefreshing
())
{
mBind
.
spRefersh
.
setRefreshing
(
false
);
}
}
@Override
public
void
readMessageSuccess
()
{
}
@Override
public
void
onRefresh
()
{
mRefreshState
=
1
;
mPage
=
1
;
mAdapter
.
setEnableLoadMore
(
false
);
mPresenter
.
getHxMessage
(
hxUserId
,
1
,
mPage
,
mPageSize
);
}
@Override
public
void
onLoadMoreRequested
()
{
mRefreshState
=
2
;
mPresenter
.
getHxMessage
(
hxUserId
,
1
,
mPage
,
mPageSize
);
}
}
app/src/main/java/com/dayu/bigfish/ui/listener/OnChildClickListener.java
0 → 100644
View file @
8292e843
package
com
.
dayu
.
bigfish
.
ui
.
listener
;
import
android.view.View
;
import
com.dayu.bigfish.base.CoreAdapter
;
/**
* Created by luofan on 2017/12/10.
*/
public
interface
OnChildClickListener
{
void
OnChildClick
(
View
view
,
CoreAdapter
adapter
,
int
position
);
}
app/src/main/java/com/dayu/bigfish/ui/views/LRecyclerView.java
View file @
8292e843
...
...
@@ -98,7 +98,7 @@ public class LRecyclerView<M, B> extends FrameLayout {
recyclerview
=
(
RecyclerView
)
layout
.
findViewById
(
R
.
id
.
recyclerview
);
ll_emptyView
=
(
LinearLayout
)
layout
.
findViewById
(
R
.
id
.
ll_emptyview
);
ll_faileView
=
(
LinearLayout
)
layout
.
findViewById
(
R
.
id
.
ll_faileview
);
//
swipeRefresh.setColorSchemeResources(R.color.cl_receiving_order_item_data);
swipeRefresh
.
setColorSchemeResources
(
R
.
color
.
cl_receiving_order_item_data
);
mLayoutManager
=
new
LinearLayoutManager
(
context
);
mLayoutManager
.
setAutoMeasureEnabled
(
true
);
recyclerview
.
setLayoutManager
(
mLayoutManager
);
...
...
@@ -121,11 +121,11 @@ public class LRecyclerView<M, B> extends FrameLayout {
swipeRefresh
.
setOnRefreshListener
(()
->
{
Refresh
();
});
ll_
emptyView
.
setOnClickListener
(
(
view
->
{
ll_
faileView
.
setOnClickListener
(
view
->
{
ProgressUtil
.
startLoad
(
mCoreAdapter
.
getContext
());
Refresh
();
})
)
;
ll_
faile
View
.
setOnClickListener
(
view
->
{
});
ll_
empty
View
.
setOnClickListener
(
view
->
{
ProgressUtil
.
startLoad
(
mCoreAdapter
.
getContext
());
Refresh
();
});
...
...
@@ -200,6 +200,8 @@ public class LRecyclerView<M, B> extends FrameLayout {
* @param data
*/
public
void
setData
(
List
<
M
>
data
)
{
swipeRefresh
.
setRefreshing
(
false
);
mCoreAdapter
.
isHasMore
=
false
;
if
(
data
==
null
||
(
data
!=
null
&&
data
.
size
()
==
0
))
{
ToastUtils
.
showShortToast
(
"暂无数据"
);
setEmpty
();
...
...
@@ -218,6 +220,7 @@ public class LRecyclerView<M, B> extends FrameLayout {
* @param data
*/
public
void
setPageData
(
BasePageBean
<
M
>
data
)
{
isNeedFoot
=
true
;
mCoreAdapter
.
isLoadFial
=
false
;
swipeRefresh
.
setRefreshing
(
false
);
if
(
isRefresh
)
{
...
...
@@ -241,6 +244,7 @@ public class LRecyclerView<M, B> extends FrameLayout {
*/
public
void
setDataFail
()
{
if
(
isRefresh
)
{
swipeRefresh
.
setRefreshing
(
false
);
setFaileView
();
}
else
{
mCoreAdapter
.
isLoadFial
=
true
;
...
...
app/src/main/java/com/dayu/bigfish/utils/DateUtils.java
deleted
100755 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
utils
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Locale
;
/**
* 时间数据格式化
* on 2017/9/11.
*/
public
class
DateUtils
{
private
List
timeList
=
new
ArrayList
();
private
String
myYear
;
/**
* 时间数据格式化
* 格式转换为--->年:月
*/
public
String
stringDateToDate
(
String
stringDate
)
throws
Exception
{
DateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
dateString
=
simpleDateFormat
.
parse
(
stringDate
);
return
dateToString
(
dateString
);
}
public
List
getSystemTime
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
String
created
=
calendar
.
get
(
Calendar
.
YEAR
)
+
"年"
+
(
calendar
.
get
(
Calendar
.
MONTH
)
+
1
)
+
"月"
//从0计算
+
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)
+
"日"
+
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)
+
"时"
+
calendar
.
get
(
Calendar
.
MINUTE
)
+
"分"
+
calendar
.
get
(
Calendar
.
SECOND
)
+
"s"
;
timeList
.
add
(
calendar
.
get
(
Calendar
.
YEAR
));
//年
timeList
.
add
((
calendar
.
get
(
Calendar
.
MONTH
)
+
1
));
//月
timeList
.
add
(
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
));
//日
return
timeList
;
}
/**
* 时间数据格式化
* 格式转换为--->年:月
* date格式转换为String
*/
public
String
dateToString
(
Date
date
)
{
String
stringDate
;
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
stringDate
=
df
.
format
(
date
);
stringDate
=
stringDate
.
substring
(
5
);
return
stringDate
;
}
/**
* 时间数据格式化
* 格式转换为--->时:分
*/
public
String
stringTimeToDate
(
String
stringDate
)
throws
Exception
{
DateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Date
dateString
=
simpleDateFormat
.
parse
(
stringDate
);
return
timeToString
(
dateString
);
}
/**
* 时间数据格式化
* 格式转换为--->时:分
* date格式转换为String
*/
public
String
timeToString
(
Date
date
)
{
String
stringTime
;
//截取之前的时间,第一次截取
String
stringTime2
;
//截取之后的时间 ---->时:分:秒
String
StringTimeEnd
;
//最终截取完成后的时间 ---->时:分
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
stringTime
=
df
.
format
(
date
);
stringTime2
=
stringTime
.
substring
(
11
);
StringTimeEnd
=
stringTime2
.
substring
(
0
,
stringTime2
.
length
()
-
3
);
return
StringTimeEnd
;
}
/**
* 随机时间字符串转换为标准时间戳
* 年-月-日
*/
public
String
stringTimeTo
(
String
time
)
{
String
one
;
//第一次替换年
String
two
;
//第二次替换月
String
three
;
//第三次替换日
one
=
time
.
replace
(
"年"
,
"-"
);
two
=
one
.
replace
(
"月"
,
"-"
);
three
=
two
.
replace
(
"日"
,
" "
);
return
three
;
}
//获取手机系统时间转换为时间戳
public
String
getTodayDateTime
()
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
,
Locale
.
getDefault
());
return
format
.
format
(
new
Date
());
}
}
app/src/main/java/com/dayu/bigfish/utils/GetUserInfo.java
deleted
100755 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
utils
;
import
android.content.Context
;
/**
* Created by yu on 2017/9/14.
*/
public
class
GetUserInfo
{
/**
*获取工程师id
* */
public
static
int
getACCOUNT_ID
(
Context
context
){
String
userId
=
(
String
)
SPUtils
.
get
(
context
,
"ACCOUNT_ID"
,
""
);
return
Integer
.
parseInt
(
userId
);
}
/**
*获取服务站id
* */
public
static
int
getSITE_ID
(
Context
context
){
String
userId
=
(
String
)
SPUtils
.
get
(
context
,
"SITE_ID"
,
""
);
return
Integer
.
parseInt
(
userId
);
}
/**
*获取token
* */
public
static
String
getToken
(
Context
context
){
String
userId
=
(
String
)
SPUtils
.
get
(
context
,
"ACCESS_TOKEN"
,
""
);
return
userId
;
}
/**
*获取工程师名字
* */
public
static
String
getUserName
(
Context
context
){
String
userName
=
(
String
)
SPUtils
.
get
(
context
,
"USER_NAME"
,
""
);
return
userName
;
}
/**
*获取工程师手机号
* */
public
static
String
getUserPhone
(
Context
context
){
String
userPhone
=
(
String
)
SPUtils
.
get
(
context
,
"USER_PHONE"
,
""
);
return
userPhone
;
}
/**
*获取环信账号
* */
public
static
String
getHxUserId
(
Context
context
){
String
hxuser
=
(
String
)
SPUtils
.
get
(
context
,
"HXUSER_ID"
,
""
);
return
hxuser
;
}
/**
*获取环信密码
* */
public
static
String
getHxPwd
(
Context
context
){
String
hxuser
=
(
String
)
SPUtils
.
get
(
context
,
"HXUSER_PWD"
,
""
);
return
hxuser
;
}
/**
*获取工程师头像
* */
public
static
String
getUserHead
(
Context
context
){
String
headImage
=
(
String
)
SPUtils
.
get
(
context
,
"IMAGE_URL"
,
""
);
return
headImage
;
}
}
app/src/main/java/com/dayu/bigfish/utils/LocationUtils.java
View file @
8292e843
...
...
@@ -7,9 +7,6 @@ import com.amap.api.location.AMapLocationClient;
import
com.amap.api.location.AMapLocationClientOption
;
import
com.amap.api.location.AMapLocationListener
;
import
java.util.concurrent.TimeUnit
;
import
io.reactivex.Observable
;
import
io.reactivex.disposables.Disposable
;
/**
...
...
@@ -75,15 +72,15 @@ public class LocationUtils {
}
flag
=
true
;
//刷新有时不回调.
mDisposable
=
Observable
.
timer
(
8000
,
TimeUnit
.
MILLISECONDS
)
.
subscribe
(
aLong
->
{
if
(
flag
)
{
// ToastUtils.showShortToast("获取定位失败");
listener
.
result
(
null
);
flag
=
false
;
mlocationClient
.
stopLocation
();
}
});
//
mDisposable = Observable.timer(8000, TimeUnit.MILLISECONDS)
//
.subscribe(aLong -> {
//
if (flag) {
//
//
ToastUtils.showShortToast("获取定位失败");
//
listener.result(null);
//
flag = false;
//
mlocationClient.stopLocation();
//
}
//
});
mlocationClient
.
setLocationListener
(
new
AMapLocationListener
()
{
@Override
...
...
@@ -95,6 +92,7 @@ public class LocationUtils {
sLocation
=
location
;
listener
.
result
(
location
);
}
else
if
((
location
==
null
&&
flag
))
{
LogUtils
.
d
(
"location:"
+
location
.
getErrorCode
());
flag
=
false
;
mlocationClient
.
stopLocation
();
listener
.
result
(
location
);
...
...
app/src/main/java/com/dayu/bigfish/utils/NetworkConnectChangedReceiver.java
View file @
8292e843
...
...
@@ -20,7 +20,6 @@ import android.util.Log;
* 然后对相应的界面进行相应的操作,并将 状态 保存在我们的APP里面
* <p>
* <p>
* Created by xujun
*/
public
class
NetworkConnectChangedReceiver
extends
BroadcastReceiver
{
private
String
getConnectionType
(
int
type
)
{
...
...
app/src/main/java/com/dayu/bigfish/utils/SPUtils.java
View file @
8292e843
...
...
@@ -15,7 +15,6 @@ public class SPUtils {
* 保存在手机里面的文件名
*/
public
static
final
String
FILE_NAME
=
"big_fish"
;
public
static
final
String
FILE_NAME_TWO
=
"big_fish_two"
;
/**
* 保存数据的方法,我们需要拿到保存数据的具体类型,然后根据类型调用不同的保存方法
...
...
@@ -46,28 +45,6 @@ public class SPUtils {
SharedPreferencesCompat
.
apply
(
editor
);
}
public
static
void
putTwo
(
Context
context
,
String
key
,
Object
object
)
{
SharedPreferences
sp
=
context
.
getSharedPreferences
(
FILE_NAME_TWO
,
Context
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
editor
=
sp
.
edit
();
if
(
object
instanceof
String
)
{
editor
.
putString
(
key
,
(
String
)
object
);
}
else
if
(
object
instanceof
Integer
)
{
editor
.
putInt
(
key
,
(
Integer
)
object
);
}
else
if
(
object
instanceof
Boolean
)
{
editor
.
putBoolean
(
key
,
(
Boolean
)
object
);
}
else
if
(
object
instanceof
Float
)
{
editor
.
putFloat
(
key
,
(
Float
)
object
);
}
else
if
(
object
instanceof
Long
)
{
editor
.
putLong
(
key
,
(
Long
)
object
);
}
else
{
editor
.
putString
(
key
,
object
.
toString
());
}
SharedPreferencesCompat
.
apply
(
editor
);
}
/**
* 得到保存数据的方法,我们根据默认值得到保存的数据的具体类型,然后调用相对于的方法获取值
*/
...
...
@@ -112,7 +89,6 @@ public class SPUtils {
*/
public
static
void
clear
(
Context
context
)
{
clear
(
context
,
FILE_NAME
);
clear
(
context
,
FILE_NAME_TWO
);
}
public
static
void
clear
(
Context
context
,
String
spName
)
{
...
...
app/src/main/java/com/dayu/bigfish/utils/TUtil.java
deleted
100755 → 0
View file @
d3c66e52
package
com
.
dayu
.
bigfish
.
utils
;
import
java.lang.reflect.ParameterizedType
;
/**
* Created by luofan on 16/8/2.
*/
public
class
TUtil
{
public
static
<
T
>
T
getT
(
Object
o
,
int
i
)
{
try
{
return
((
Class
<
T
>)
((
ParameterizedType
)
(
o
.
getClass
()
.
getGenericSuperclass
())).
getActualTypeArguments
()[
i
])
.
newInstance
();
}
catch
(
InstantiationException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
ClassCastException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
static
Class
<?>
forName
(
String
className
)
{
try
{
return
Class
.
forName
(
className
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
app/src/main/java/com/dayu/bigfish/utils/managers/UserManager.java
View file @
8292e843
...
...
@@ -9,23 +9,15 @@ import com.google.gson.Gson;
/**
* 主要管理用户信息
* 2017/
8/28
.
* 2017/
12/13
.
*/
public
class
UserManager
{
/**
* 内部类实现单例模式
* 延迟加载,减少内存开销
*
* @author wangceyu
*/
private
static
class
UserManagerHolder
{
private
static
UserManager
instance
=
new
UserManager
();
}
/**
* 私有的构造函数
*/
private
UserManager
()
{
}
...
...
@@ -34,28 +26,6 @@ public class UserManager {
return
UserManagerHolder
.
instance
;
}
/**
* 使用sp保存用户信息
* 后续如有需要可再此添加,如有加密需要可另行解决
*
* @param context 上下文
* @param accountId 工程师账户id
* @param siteId 工程师所属服务商id
* @param accessToken token
* @param hxUserId 环信账号Id
* @param hxUserPwd 环信密码
* @param imageUrl 工程师头像Url
*/
public
void
saveUserInfo
(
Context
context
,
String
accountId
,
String
siteId
,
String
accessToken
,
String
hxUserId
,
String
hxUserPwd
,
String
imageUrl
)
{
SPUtils
.
put
(
context
,
"ACCOUNT_ID"
,
accountId
);
SPUtils
.
put
(
context
,
"SITE_ID"
,
siteId
);
SPUtils
.
put
(
context
,
"ACCESS_TOKEN"
,
accessToken
);
SPUtils
.
put
(
context
,
"HXUSER_ID"
,
hxUserId
);
SPUtils
.
put
(
context
,
"HXUSER_PWD"
,
hxUserPwd
);
SPUtils
.
put
(
context
,
"IMAGE_URL"
,
imageUrl
);
}
public
void
saveUser
(
Context
context
,
UserInfo
info
)
{
if
(
info
!=
null
)
{
...
...
@@ -63,25 +33,16 @@ public class UserManager {
}
}
public
void
saveUserInfo
(
Context
context
,
UserInfo
info
)
{
if
(!
TextUtils
.
isEmpty
(
info
.
getToken
()))
{
SPUtils
.
put
(
context
,
"ACCESS_TOKEN"
,
info
.
getToken
());
}
if
(!
TextUtils
.
isEmpty
(
info
.
getAccountId
()))
{
SPUtils
.
put
(
context
,
"ACCOUNT_ID"
,
info
.
getAccountId
());
}
if
(!
TextUtils
.
isEmpty
(
info
.
getSiteId
()))
{
SPUtils
.
put
(
context
,
"SITE_ID"
,
info
.
getSiteId
());
}
if
(!
TextUtils
.
isEmpty
(
info
.
getHxAccount
()))
{
SPUtils
.
put
(
context
,
"HXUSER_ID"
,
info
.
getHxAccount
());
}
if
(!
TextUtils
.
isEmpty
(
info
.
getHxPwd
()))
{
SPUtils
.
put
(
context
,
"HXUSER_PWD"
,
info
.
getHxPwd
());
}
if
(!
TextUtils
.
isEmpty
(
info
.
getHeaderImg
()))
{
SPUtils
.
put
(
context
,
"IMAGE_URL"
,
info
.
getHeaderImg
());
}
public
UserInfo
getUser
(
Context
context
)
{
return
new
Gson
().
fromJson
((
String
)
SPUtils
.
get
(
context
,
"big_fish"
,
"USER_INFO"
,
""
),
UserInfo
.
class
);
}
public
String
getUserName
(
Context
context
)
{
return
(
String
)
SPUtils
.
get
(
context
,
"USER_NAME"
,
""
);
}
public
String
getUserPhone
(
Context
context
)
{
return
(
String
)
SPUtils
.
get
(
context
,
"USER_PHONE"
,
""
);
}
/**
...
...
@@ -89,19 +50,18 @@ public class UserManager {
* 一般用在退出登录
*/
public
void
clearUserInfo
(
Context
context
)
{
SPUtils
.
clear
(
context
);
SPUtils
.
remove
(
context
,
"USER_INFO"
);
}
/**
* 判断UserInfo中是否有数据
*/
public
boolean
hasUserInfo
(
Context
context
)
{
UserInfo
userInfo
=
getUser
Info
(
context
);
UserInfo
userInfo
=
getUser
(
context
);
if
(
userInfo
!=
null
)
{
//有数据
if
((!
TextUtils
.
isEmpty
(
userInfo
.
getAccountId
()))
&&
(!
TextUtils
.
isEmpty
(
userInfo
.
getSiteId
()))
&&
(!
TextUtils
.
isEmpty
(
userInfo
.
getAccessToken
()))
&&
(!
TextUtils
.
isEmpty
(
userInfo
.
getHxAccount
())
&&
(!
TextUtils
.
isEmpty
(
userInfo
.
getHxPwd
())))
)
{
if
((!
TextUtils
.
isEmpty
(
userInfo
.
getAccountId
()))
&&
(!
TextUtils
.
isEmpty
(
userInfo
.
getSiteId
()))
&&
(!
TextUtils
.
isEmpty
(
userInfo
.
getHxAccount
())
&&
(!
TextUtils
.
isEmpty
(
userInfo
.
getHxPwd
()))))
{
return
true
;
}
else
{
return
false
;
...
...
@@ -110,19 +70,4 @@ public class UserManager {
return
false
;
}
/**
* 获取用户信息model
*
* @param context
*/
public
UserInfo
getUserInfo
(
Context
context
)
{
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setAccountId
((
String
)
SPUtils
.
get
(
context
,
"big_fish"
,
"ACCOUNT_ID"
,
""
));
userInfo
.
setSiteId
((
String
)
SPUtils
.
get
(
context
,
"big_fish"
,
"SITE_ID"
,
""
));
userInfo
.
setAccessToken
((
String
)
SPUtils
.
get
(
context
,
"big_fish"
,
"ACCESS_TOKEN"
,
""
));
userInfo
.
setHxAccount
((
String
)
SPUtils
.
get
(
context
,
"big_fish"
,
"HXUSER_ID"
,
""
));
userInfo
.
setHxPwd
((
String
)
SPUtils
.
get
(
context
,
"big_fish"
,
"HXUSER_PWD"
,
""
));
userInfo
.
setHeaderImg
((
String
)
SPUtils
.
get
(
context
,
"big_fish"
,
"IMAGE_URL"
,
""
));
return
userInfo
;
}
}
app/src/main/res/layout/activity_accountbalance_layout1.xml
deleted
100644 → 0
View file @
d3c66e52
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<data>
<import
type=
"com.dayu.bigfish.presenter.accountbalance.AccountBalancePresenter"
/>
<variable
name=
"presenter"
type=
"AccountBalancePresenter"
/>
</data>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
android:id=
"@+id/time_title"
style=
"@style/title"
>
<TextView
android:id=
"@+id/title_text"
style=
"@style/text_title"
android:text=
"@string/title_account_balance"
/>
<ImageView
android:id=
"@+id/title_back"
style=
"@style/title_image_back"
android:onClick=
"@{()->presenter.dumpBack()}"
/>
<TextView
android:id=
"@+id/title_right"
style=
"@style/title_right_text"
android:onClick=
"@{()->presenter.dumpToWithdrawal()}"
android:text=
"@string/title_account_balance_right"
android:textColor=
"#3faafc"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_6"
android:layout_alignParentBottom=
"true"
android:src=
"@drawable/line_shape"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_account_balance"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:gravity=
"center"
android:textColor=
"#ffbe2d"
android:textSize=
"40sp"
/>
<ImageView
android:id=
"@+id/line_one"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_0.3"
android:layout_centerHorizontal=
"true"
android:background=
"@color/cl_order_item_line_bg"
android:visibility=
"gone"
/>
<android.support.v4.widget.SwipeRefreshLayout
android:id=
"@+id/swipe_refersh"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/rl_balance"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/activity_order_record.xml
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<data>
...
...
@@ -95,17 +96,11 @@
</RelativeLayout>
<
android.support.v4.widget.SwipeRefreshLayout
android:id=
"@+id/
swipe_refersh
"
<
com.dayu.bigfish.ui.views.LRecyclerView
android:id=
"@+id/
recyclerView
"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/rl_record"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#f5f5f5"
/>
</android.support.v4.widget.SwipeRefreshLayout>
android:layout_height=
"match_parent"
android:background=
"#f5f5f5"
/>
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/activity_receiving.xml
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<data>
...
...
@@ -38,22 +39,11 @@
style=
"@style/card_line"
/>
<
android.support.v4.widget.SwipeRefreshLayout
android:id=
"@+id/
swipe_refersh
"
<
com.dayu.bigfish.ui.views.LRecyclerView
android:id=
"@+id/
recyclerView
"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#f5f5f5"
/>
</RelativeLayout>
</android.support.v4.widget.SwipeRefreshLayout>
android:layout_height=
"match_parent"
android:background=
"#f5f5f5"
/>
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/big_message_adapter.xml
deleted
100755 → 0
View file @
d3c66e52
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:id=
"@+id/big_item"
android:layout_width=
"@dimen/dp_333"
android:layout_height=
"@dimen/dp_80"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_12"
android:background=
"@drawable/item_shape"
>
<TextView
android:id=
"@+id/big_line_textView"
android:layout_width=
"1dp"
android:background=
"@color/line_color"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"89dp"
/>
<TextView
android:id=
"@+id/big_message_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/sp_12"
android:textColor=
"@color/cl_home_title_text_color"
android:layout_marginTop=
"@dimen/dp_18"
android:layout_alignRight=
"@id/big_line_textView"
android:layout_marginRight=
"@dimen/dp_12"
android:text=
"08-10"
/>
<TextView
android:id=
"@+id/big_message_date"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"24sp"
android:layout_marginTop=
"@dimen/dp_34"
android:textColor=
"@color/cl_home_title_text_color"
android:textStyle=
"bold"
android:layout_alignRight=
"@id/big_line_textView"
android:layout_marginRight=
"@dimen/dp_12"
android:text=
"18:72"
/>
<TextView
android:id=
"@+id/big_message_text_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/sp_13.3"
android:textColor=
"@color/cl_home_title_text_color"
android:layout_alignLeft=
"@id/big_line_textView"
android:layout_marginLeft=
"@dimen/dp_16"
android:layout_centerVertical=
"true"
/>
<TextView
android:id=
"@+id/read_state"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/sp_10"
android:textColor=
"@color/cl_tab_read"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"@dimen/dp_21.3"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/commom_recycle.xml
0 → 100644
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<com.dayu.bigfish.ui.views.LRecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#f5f5f5"
/>
</layout>
\ No newline at end of file
app/src/main/res/layout/fragment_message_bigfish.xml
deleted
100644 → 0
View file @
d3c66e52
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<ListView
android:id=
"@+id/message_bigfish_listview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cl_home_listview_bg"
android:divider=
"@null"
android:scrollbars=
"none"
/>
<RelativeLayout
android:id=
"@+id/big_message_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
>
<ImageView
android:id=
"@+id/big_image_empty"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/yu"
/>
<TextView
android:id=
"@+id/big_textView_empty"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/big_image_empty"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_17"
android:text=
"@string/no_notice"
android:textColor=
"@color/cl_login_clearedittext_hint"
android:textSize=
"@dimen/sp_13.3"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_message_system.xml
deleted
100755 → 0
View file @
d3c66e52
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cl_home_listview_bg"
android:orientation=
"vertical"
>
<android.support.v4.widget.SwipeRefreshLayout
android:id=
"@+id/sp_refersh"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/rl_message"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"2dp"
android:background=
"#f5f5f5"
/>
</RelativeLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/fragment_order_cancle_item.xml
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/item_shape"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginBottom=
"@dimen/dp_13.3"
android:layout_weight=
"1"
android:orientation=
"horizontal"
<layout>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:layout_marginTop=
"5dp"
android:background=
"@drawable/item_shape"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginBottom=
"@dimen/dp_13.3"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_order_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25.3dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
"@string/tv_home_tab_one_subscribe_time"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"13.3sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_tody"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"5.7dp"
android:text=
"@string/tv_order_item_time"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/sp_13.3"
/>
<TextView
android:id=
"@+id/item_time"
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:text=
"@string/tv_order_item_date"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_order_item_data_text"
/>
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
</LinearLayout>
<TextView
android:id=
"@+id/tv_order_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25.3dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
"@string/tv_home_tab_one_subscribe_time"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"13.3sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/item_line"
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"@dimen/dp_21.3"
android:background=
"@color/cl_order_item_line_bg"
/>
<TextView
android:id=
"@+id/item_tody"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"5.7dp"
android:text=
"@string/tv_order_item_time"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/sp_13.3"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"9.3dp"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/item_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:text=
"@string/tv_order_item_date"
android:typeface=
"@{@string/tv_fonts}"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_order_item_data_text"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/item_line"
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"@dimen/dp_21.3"
android:background=
"@color/cl_order_item_line_bg"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginBottom=
"9.3dp"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/item_text_weixiu"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"3"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/text_line"
android:layout_width=
"wrap_content"
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
" - "
android:textColor=
"@color/cl_order_item_line_bg"
android:textStyle=
"bold"
/>
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/item_text_weixiu"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"3"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/text_line"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
" - "
android:textColor=
"@color/cl_order_item_line_bg"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_text_weixiu_leixing"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"7"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text_leixing"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
</LinearLayout>
<TextView
android:id=
"@+id/
item_text_weixiu_leixing
"
android:id=
"@+id/
error_state
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"7"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text_leixing"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_login_hint_text"
android:
textStyle=
"bold
"
android:
visibility=
"visible
"
/>
</LinearLayout>
<TextView
android:id=
"@+id/
error_state
"
android:id=
"@+id/
item_text_dizhi
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"10dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:text=
"@string/tv_order_item_gps_text"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_login_hint_text"
android:visibility=
"visible"
/>
</LinearLayout>
<TextView
android:id=
"@+id/item_text_dizhi"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"10dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:text=
"@string/tv_order_item_gps_text"
android:textColor=
"@color/cl_order_item_line_bg"
android:textSize=
"@dimen/size_login_hint_text"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/fragment_order_error_item.xml
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"10dp"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:background=
"@drawable/item_shape"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginBottom=
"@dimen/dp_13.3"
android:layout_weight=
"1"
android:orientation=
"horizontal"
<layout>
<data>
<variable
name=
"item"
type=
"com.dayu.bigfish.bean.ErrorOrder"
/>
</data>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:layout_marginTop=
"5dp"
android:background=
"@drawable/item_shape"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginBottom=
"@dimen/dp_13.3"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_order_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25.3dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
"@string/tv_home_tab_one_subscribe_time"
android:textColor=
"#3a3a3a"
android:textSize=
"13.3sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_tody"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"5.7dp"
android:text=
"@string/tv_order_item_time"
android:textColor=
"@color/cl_tab_read"
android:textSize=
"@dimen/sp_13.3"
/>
<TextView
android:id=
"@+id/item_time"
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:text=
"@string/tv_order_item_date"
android:textColor=
"@color/cl_tab_read"
android:textSize=
"@dimen/size_order_item_data_text"
/>
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
</LinearLayout>
<TextView
android:id=
"@+id/tv_order_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25.3dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
"@string/tv_home_tab_one_subscribe_time"
android:textColor=
"#3a3a3a"
android:textSize=
"13.3sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/item_line"
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"@dimen/dp_21.3"
android:background=
"@color/cl_order_item_line_bg"
/>
<TextView
android:id=
"@+id/item_tody"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"5.7dp"
android:text=
"@string/tv_order_item_time"
android:textColor=
"@color/cl_tab_read"
android:textSize=
"@dimen/sp_13.3"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"9.3dp"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/item_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:text=
"@string/tv_order_item_date"
android:typeface=
"@{@string/tv_fonts}"
android:textColor=
"@color/cl_tab_read"
android:textSize=
"@dimen/size_order_item_data_text"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/item_line"
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"@dimen/dp_21.3"
android:background=
"@color/cl_order_item_line_bg"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginBottom=
"9.3dp"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:
layout_weight=
"1
"
android:orientation=
"horizontal"
>
android:
orientation=
"horizontal
"
>
<TextView
android:id=
"@+id/item_text_weixiu"
android:layout_width=
"wrap_content"
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"3"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/item_text_weixiu"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"3"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/text_line"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
" - "
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_text_weixiu_leixing"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"7"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text_leixing"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
</LinearLayout>
<TextView
android:id=
"@+id/
text_lin
e"
android:id=
"@+id/
error_stat
e"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
" - "
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_text_weixiu_leixing"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"7"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text_leixing"
android:textColor=
"@color/cl_home_title_text_color"
android:textColor=
"@color/cl_tab_read"
android:textSize=
"@dimen/size_login_hint_text"
android:
textStyle=
"bold
"
android:
visibility=
"visible
"
/>
</LinearLayout>
<TextView
android:id=
"@+id/
error_state
"
android:id=
"@+id/
item_text_dizhi
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:textColor=
"@color/cl_tab_read"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"10dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:text=
"@string/tv_order_item_gps_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:visibility=
"visible"
/>
</LinearLayout>
<TextView
android:id=
"@+id/item_text_dizhi"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"13.3dp"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"10dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:text=
"@string/tv_order_item_gps_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/fragment_order_serve.xml
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<RelativeLayout
<com.dayu.bigfish.ui.views.LRecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cl_home_listview_bg"
>
</android.support.v7.widget.RecyclerView>
</RelativeLayout>
android:background=
"@color/cl_home_listview_bg"
app:isRefreshable=
"false"
app:itemType=
"@layout/serve_datails_item"
app:needCoreAdapter=
"true"
app:needFoot=
"false"
>
</com.dayu.bigfish.ui.views.LRecyclerView>
</layout>
\ No newline at end of file
app/src/main/res/layout/fragment_orderdoing_item.xml
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:layout_marginTop=
"5dp"
android:background=
"@drawable/item_shape"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:orientation=
"horizontal"
<layout>
<data>
<variable
name=
"presenter"
type=
"com.dayu.bigfish.presenter.receivingorder.ReceivingPresenter"
/>
<variable
name=
"item"
type=
"com.dayu.bigfish.bean.Order"
/>
</data>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:layout_marginTop=
"5dp"
android:background=
"@drawable/item_shape"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_order_time"
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25.3dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
"@string/tv_home_tab_one_subscribe_time"
android:textColor=
"#3a3a3a"
android:textSize=
"13.3sp"
android:textStyle=
"bold"
/>
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/item_tody"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"5.7dp"
android:text=
"@string/tv_order_item_time"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_13.3"
/>
<TextView
android:id=
"@+id/tv_order_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25.3dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
"@string/tv_home_tab_one_subscribe_time"
android:textColor=
"#3a3a3a"
android:textSize=
"13.3sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:text=
"@string/tv_order_item_date"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/size_order_item_data_text"
/>
<TextView
android:id=
"@+id/item_tody"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"5.7dp"
android:text=
"@string/tv_order_item_time"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_13.3"
/>
</LinearLayout>
<TextView
android:id=
"@+id/item_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:text=
"@string/tv_order_item_date"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/size_order_item_data_text"
android:typeface=
"@{@string/tv_fonts}"
/>
<ImageView
android:id=
"@+id/item_line"
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"25dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"@dimen/dp_21.3"
android:background=
"@color/cl_order_item_line_bg"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginBottom=
"9.3dp"
>
<ImageView
android:id=
"@+id/item_line"
android:layout_width=
"@dimen/size_order_item_line_width"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"25dp"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"@dimen/dp_21.3"
android:background=
"@color/cl_order_item_line_bg"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginBottom=
"9.3dp"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/item_text_weixiu"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"3"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/text_line"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
" - "
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/item_text_weixiu_leixing"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"7"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text_leixing"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
</LinearLayout>
<TextView
android:id=
"@+id/
item_text_weixiu
"
android:id=
"@+id/
tv_error_state
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin
Left=
"@dimen/dp_13.3
"
android:layout_margin
Right=
"10dp
"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"3"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_tool_text"
android:textColor=
"@color/cl_home_title_text_color"
android:text=
"[预约超时]"
android:textColor=
"@color/cl_tab_read"
android:textSize=
"@dimen/size_login_hint_text"
android:
textStyle=
"bold
"
android:
visibility=
"visible
"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_order_detail"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_14"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"5dp"
android:ellipsize=
"end"
android:maxLines=
"1"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/
text_lin
e"
android:id=
"@+id/
item_text_user_nam
e"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
" - "
android:textStyle=
"bold"
/>
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:ellipsize=
"end"
android:maxEms=
"5"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_user_name"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
<TextView
android:id=
"@+id/item_text_
weixiu_leixing
"
android:id=
"@+id/item_text_
user_phone
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16.7"
android:ellipsize=
"end"
android:maxEms=
"7"
android:layout_marginLeft=
"@dimen/size_order_item_tooltext_ml"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_
tool_text_leixing
"
android:text=
"@string/tv_order_item_
user_phone
"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_error_state"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"@dimen/dp_16.7"
android:text=
"[预约超时]"
android:textColor=
"@color/cl_tab_read"
android:textSize=
"@dimen/size_login_hint_text"
android:visibility=
"visible"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_order_detail"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_14"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"5dp"
android:ellipsize=
"end"
android:maxLines=
"1"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
android:textStyle=
"bold"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:orientation=
"horizontal"
>
</LinearLayout>
<TextView
android:id=
"@+id/item_text_
user_name
"
android:id=
"@+id/item_text_
dizhi
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"5dp"
android:ellipsize=
"end"
android:maxEms=
"5"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_user_name"
android:maxLines=
"2"
android:text=
"@string/tv_order_item_gps_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
</LinearLayout>
<TextView
android:id=
"@+id/item_text_user_phone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_order_item_tooltext_ml"
android:maxLines=
"1"
android:text=
"@string/tv_order_item_user_phone"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/item_bottom_line"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_order_item_line_width"
android:background=
"@color/cl_order_item_line_bg"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/item_text_dizhi"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_order_item_tool_ml"
android:layout_marginRight=
"40dp"
android:layout_marginTop=
"5dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:text=
"@string/tv_order_item_gps_text"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/size_login_hint_text"
/>
</LinearLayout>
android:id=
"@+id/item_text_phone"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_one_phone"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_15"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/order_line_one"
android:layout_width=
"@dimen/dp_0.7"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"11.7dp"
android:layout_marginTop=
"11.7dp"
android:background=
"@color/cl_receiving_order_item_data"
/>
<ImageView
android:id=
"@+id/item_bottom_line"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_order_item_line_width"
android:background=
"@color/cl_order_item_line_bg"
/>
<LinearLayout
android:id=
"@+id/ll_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/item_text_phone"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_one_phone"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_15"
/>
<ImageView
android:id=
"@+id/order_line_one"
android:layout_width=
"@dimen/dp_0.7"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"11.7dp"
android:layout_marginTop=
"11.7dp"
android:background=
"@color/cl_receiving_order_item_data"
/>
<TextView
android:id=
"@+id/item_updata_time"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_updata_subscribe_time"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_15"
/>
<TextView
android:id=
"@+id/item_updata_time"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_updata_subscribe_time"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_15"
/>
<ImageView
android:id=
"@+id/order_line_two"
android:layout_width=
"@dimen/dp_0.7"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"11.7dp"
android:layout_marginTop=
"11.7dp"
android:background=
"@color/cl_receiving_order_item_data"
/>
<TextView
android:id=
"@+id/tv_item_process"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_start"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_15"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/order_line_two"
android:layout_width=
"@dimen/dp_0.7"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"11.7dp"
android:layout_marginTop=
"11.7dp"
android:background=
"@color/cl_receiving_order_item_data"
/>
</LinearLayout>
\ No newline at end of file
<TextView
android:id=
"@+id/tv_item_process"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"@string/tv_home_tab_start"
android:textColor=
"@color/cl_receiving_order_item_data"
android:textSize=
"@dimen/sp_15"
/>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/item_account_balance_layout11.xml
deleted
100644 → 0
View file @
d3c66e52
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name=
"item"
type=
"com.dayu.bigfish.bean.AccountBalance"
/>
</data>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"74dp"
android:orientation=
"horizontal"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_alignParentTop=
"true"
android:background=
"@color/cl_order_item_line_bg"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_16.7"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/item_tv_accout_source"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/order_subsidy"
android:textColor=
"#3a3a3a"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/item_tv_accout_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"2017/3/22 19:00"
android:textColor=
"#888888"
android:textSize=
"13.3sp"
/>
</LinearLayout>
<TextView
android:id=
"@+id/item_tv_accout_balance"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"@dimen/dp_16.7"
android:gravity=
"end"
android:text=
"- 100.00"
android:textColor=
"#000000"
android:textSize=
"20sp"
/>
</RelativeLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/lrecycle_layout.xml
View file @
8292e843
...
...
@@ -42,7 +42,7 @@
android:layout_below=
"@id/iv_empty"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_13"
android:text=
"暂无数据"
android:text=
"暂无数据
(点击刷新)
"
android:textColor=
"@color/cl_selector_hui"
android:textSize=
"@dimen/sp_13.3"
/>
...
...
@@ -85,4 +85,4 @@
android:textSize=
"15.4sp"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
app/src/main/res/layout/serve_datails_item.xml
View file @
8292e843
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:layout_marginTop=
"5dp"
android:orientation=
"vertical"
<layout>
>
<data
>
<LinearLayout
android:id=
"@+id/item_layout"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_54"
android:background=
"@drawable/item_shape"
android:gravity=
"center"
>
<import
type=
"com.dayu.bigfish.utils.UtilsDate"
/>
<variable
name=
"item"
type=
"com.dayu.bigfish.bean.OrderDetail.RecordBean"
/>
<variable
name=
"presenter"
type=
"com.dayu.bigfish.presenter.orderdetailserve.OrderDetailServePresenter"
/>
</data>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_54"
android:layout_marginLeft=
"@dimen/dp_13.3"
android:layout_marginRight=
"@dimen/dp_13.3"
android:layout_marginTop=
"5dp"
android:background=
"@drawable/item_shape"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/
item
_time"
android:id=
"@+id/
tv
_time"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"10dp"
android:layout_weight=
"1"
android:text=
"
2017-9-68 78:90:00
"
android:text=
"
@{presenter.getCreatTime(item.createTime)}
"
android:textColor=
"@color/cl_order_text_title"
android:textSize=
"@dimen/sp_13.3"
/>
...
...
@@ -34,13 +40,13 @@
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginRight=
"5dp"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:maxLines=
"2"
android:layout_marginRight=
"5dp"
android:text=
"2017-9-68 78:90:00"
android:text=
"@{item.operationComment}"
android:textColor=
"@color/cl_tab_init"
android:textSize=
"@dimen/sp_10"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</layout>
\ No newline at end of file
app/src/main/res/layout/tips_empty.xml
deleted
100755 → 0
View file @
d3c66e52
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/cl_home_listview_bg"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_empty"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/yu"
/>
<TextView
android:id=
"@+id/tv_empty"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/iv_empty"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_13"
android:text=
"暂无工单"
android:textColor=
"@color/cl_selector_hui"
android:textSize=
"@dimen/sp_13.3"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/tips_loading_failed.xml
deleted
100755 → 0
View file @
d3c66e52
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/icon"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:scaleType=
"centerInside"
android:src=
"@mipmap/error"
/>
<TextView
android:id=
"@+id/description"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"23dp"
android:text=
"加载出错啦"
android:textColor=
"#c9c9c9"
android:textSize=
"17.3sp"
/>
<TextView
android:id=
"@+id/retry_btn"
android:layout_width=
"115dp"
android:layout_height=
"30dp"
android:layout_marginTop=
"55dp"
android:gravity=
"center"
android:paddingBottom=
"4dp"
android:paddingLeft=
"6dp"
android:paddingRight=
"6dp"
android:paddingTop=
"4dp"
android:text=
"重新加载"
android:textSize=
"15.4sp"
/>
</LinearLayout>
</FrameLayout>
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