This commit is contained in:
2020-09-15 08:41:19 +08:00
parent 7f61e539db
commit 9eb3cb162f
11 changed files with 271 additions and 75 deletions

View File

@@ -96,4 +96,5 @@ dependencies {
// api 'com.airbnb.android:lottie:1.0.1' // api 'com.airbnb.android:lottie:1.0.1'
implementation 'com.airbnb.android:lottie:3.4.0' implementation 'com.airbnb.android:lottie:3.4.0'
implementation 'com.github.paradoxie:AutoVerticalTextview:0.1'
} }

View File

@@ -10,8 +10,7 @@
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECEIVE_MMS" /> <uses-permission android:name="android.permission.RECEIVE_MMS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" /> <uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_CALENDAR" /> <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
<!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
<uses-feature android:name="android.hardware.camera.autofocus" /> <!-- 访问网络,网络定位需要上网 --> <uses-feature android:name="android.hardware.camera.autofocus" /> <!-- 访问网络,网络定位需要上网 -->
<uses-permission android:name="android.permission.CALL_PHONE" /> <!-- 腾讯bugly权限 --> <uses-permission android:name="android.permission.CALL_PHONE" /> <!-- 腾讯bugly权限 -->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- Bugly升级SDK权限配置开始 --> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- Bugly升级SDK权限配置开始 -->
@@ -34,8 +33,6 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 精确定位权限,允许一个程序访问精确位置(GPS定位) --> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 精确定位权限,允许一个程序访问精确位置(GPS定位) -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
!--声明SD卡读写权限-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@@ -48,14 +45,14 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".main.kehu.activity.FpOrderInfoActivity"></activity> <activity android:name=".main.my.activity.DemoActivity"></activity>
<activity android:name=".main.kehu.activity.FpOrderInfoActivity" />
<activity android:name=".main.kehu.activity.MoActivity" /> <activity android:name=".main.kehu.activity.MoActivity" />
<activity android:name=".main.activity.ForgetPasActivity" /> <activity android:name=".main.activity.ForgetPasActivity" />
<activity android:name=".main.activity.ModifyPasActivity" /> <activity android:name=".main.activity.ModifyPasActivity" />
<activity android:name=".main.find.ConversationActivity" /> <activity android:name=".main.find.ConversationActivity" />
<activity android:name=".main.find.CommentActivity" /> <activity android:name=".main.find.CommentActivity" />
<activity android:name=".main.kehu.activity.JsonDataActivity"> <activity android:name=".main.kehu.activity.JsonDataActivity"></activity>
</activity>
<activity android:name=".main.kehu.activity.CustomerDetailActivity" /> <activity android:name=".main.kehu.activity.CustomerDetailActivity" />
<activity android:name=".main.activity.Main2Activity" /> <!-- 开启页 --> <activity android:name=".main.activity.Main2Activity" /> <!-- 开启页 -->
<activity <activity
@@ -79,9 +76,7 @@
<activity <activity
android:name=".main.activity.MainActivity" android:name=".main.activity.MainActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/DefaultCityPickerTheme" android:theme="@style/DefaultCityPickerTheme"></activity>
>
</activity>
<activity android:name=".view.webview.XfiveWebActivity" /> <activity android:name=".view.webview.XfiveWebActivity" />
<activity <activity
android:name=".main.activity.mine.MessageNoticeActivity" android:name=".main.activity.mine.MessageNoticeActivity"
@@ -97,22 +92,26 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".main.kehu.activity.DesignActivity" android:name=".main.kehu.activity.DesignActivity"
android:screenOrientation="portrait"> android:screenOrientation="portrait"></activity>
</activity>
<activity <activity
android:name=".main.my.activity.PersonalProfileActivity" android:name=".main.my.activity.PersonalProfileActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".main.kehu.activity.AddCustomerActivity" <activity
android:windowSoftInputMode="adjustPan" android:name=".main.kehu.activity.AddCustomerActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait"
<activity android:name=".main.kehu.activity.AddCustDialogActivity" android:windowSoftInputMode="adjustPan" />
android:theme="@style/dialogstyle" <activity
android:name=".main.kehu.activity.AddCustDialogActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/dialogstyle" />
<activity
android:name=".main.kehu.activity.StyleActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".main.kehu.activity.StyleActivity" <activity
android:screenOrientation="portrait" /> android:name=".main.kehu.activity.BudgetActivity"
<activity android:name=".main.kehu.activity.BudgetActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="com.fenghoo.seven.fileprovider" android:authorities="com.fenghoo.seven.fileprovider"
@@ -120,7 +119,8 @@
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths_public"></meta-data> android:resource="@xml/file_paths_public" />
</provider> </provider>
</application> </application>
</manifest> </manifest>

View File

@@ -98,6 +98,7 @@ public class PrivateletterFragment extends MobanFragment {
FrameLayout mFrameLayout = (FrameLayout)parent; FrameLayout mFrameLayout = (FrameLayout)parent;
if(mFrameLayout!=null){ if(mFrameLayout!=null){
mFrameLayout.removeView(notDataView);} mFrameLayout.removeView(notDataView);}
setData(true, null);
markingtwoAdapter.setEmptyView(notDataView); markingtwoAdapter.setEmptyView(notDataView);
return; return;
} }

View File

@@ -37,16 +37,18 @@ public class CustomerFragment extends MobanFragment {
private static int mSerial = 0; private static int mSerial = 0;
private int mTabPos = 0; private int mTabPos = 0;
public String search=""; public String search = "";
public CustomerFragment(int serial) { public CustomerFragment(int serial) {
super(); super();
mSerial = serial; mSerial = serial;
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
public void setTabPos(int mTabPos) { public void setTabPos(int mTabPos) {
this.mTabPos = mTabPos; this.mTabPos = mTabPos;
} }
@Override @Override
public void initAdapter() { public void initAdapter() {
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
@@ -83,7 +85,7 @@ public class CustomerFragment extends MobanFragment {
@Override @Override
public void uploadAvatar() { public void uploadAvatar() {
//进入添加客户和完善信息 //进入添加客户和完善信息
ShowAty.AddCustomerActivity(getActivity(),item,search,""); ShowAty.AddCustomerActivity(getActivity(), item, search, "");
} }
}).show(); }).show();
@@ -92,7 +94,7 @@ public class CustomerFragment extends MobanFragment {
@Override @Override
public void enterCusDetail(CustomerListBean.ResultBean.DataBean item) { public void enterCusDetail(CustomerListBean.ResultBean.DataBean item) {
//进入客户详情 //进入客户详情
ShowAty.CustomerDetailActivity(getActivity(),item); ShowAty.CustomerDetailActivity(getActivity(), item);
} }
}); });
} }
@@ -126,27 +128,28 @@ public class CustomerFragment extends MobanFragment {
} }
}); });
} }
/** /**
* @description 重写下拉刷新方法,让刷新全部数据
* @param * @param
* @return * @return
* @description 重写下拉刷新方法,让刷新全部数据
*/ */
public void initRefreshLayout() { public void initRefreshLayout() {
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {
search=""; search = "";
refresh(); refresh();
} }
}); });
} }
public void onEvent(ThreeEvent event) { public void onEvent(ThreeEvent event) {
if (null != event ) { if (null != event) {
String pagetype = event.getPagetype(); String pagetype = event.getPagetype();
Log.e("刷新页面==",pagetype); Log.e("刷新页面==", pagetype);
Log.d("客户调拨--","刷新列表页面"); Log.d("客户调拨--", "刷新列表页面");
if(pagetype.equals("0")){ if (pagetype.equals("0")) {
search = event.getSearch(); search = event.getSearch();
newrefresh(); newrefresh();
} }
@@ -157,7 +160,7 @@ public class CustomerFragment extends MobanFragment {
public void requestData() { public void requestData() {
final HttpParams paramsPost = new HttpParams(); final HttpParams paramsPost = new HttpParams();
String uuid = ProfileSpUtils.getInstance().getUserProfie().getData().getUuid(); String uuid = ProfileSpUtils.getInstance().getUserProfie().getData().getUuid();
Log.e("uuid==",uuid); Log.e("uuid==", uuid);
paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid()); paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid());
paramsPost.put("search", search); paramsPost.put("search", search);
new NetApi().getPostData(paramsPost, HttpConstants.URi_device_AppCustomer_customerList).subscribe(new Observer<Response>() { new NetApi().getPostData(paramsPost, HttpConstants.URi_device_AppCustomer_customerList).subscribe(new Observer<Response>() {
@@ -171,9 +174,11 @@ public class CustomerFragment extends MobanFragment {
if (mNextRequestPage == 1) { if (mNextRequestPage == 1) {
if (data.size() == 0) { if (data.size() == 0) {
ViewParent parent = notDataView.getParent(); ViewParent parent = notDataView.getParent();
FrameLayout mFrameLayout = (FrameLayout)parent; FrameLayout mFrameLayout = (FrameLayout) parent;
if(mFrameLayout!=null){ if (mFrameLayout != null) {
mFrameLayout.removeView(notDataView);} mFrameLayout.removeView(notDataView);
}
setData(true, null);
markingtwoAdapter.setEmptyView(notDataView); markingtwoAdapter.setEmptyView(notDataView);
return; return;
} }
@@ -187,6 +192,7 @@ public class CustomerFragment extends MobanFragment {
mSwl.setRefreshing(false); mSwl.setRefreshing(false);
} }
} }
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
e.printStackTrace(); e.printStackTrace();
@@ -196,17 +202,18 @@ public class CustomerFragment extends MobanFragment {
}); });
} }
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
} }
/** /**
* @description 删除客户
* @param * @param
* @return * @return
* @description 删除客户
*/ */
private void deleteCus(String customer_id){ private void deleteCus(String customer_id) {
final HttpParams paramsPost = new HttpParams(); final HttpParams paramsPost = new HttpParams();
paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid()); paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid());
paramsPost.put("customer_id", customer_id); paramsPost.put("customer_id", customer_id);
@@ -215,12 +222,13 @@ public class CustomerFragment extends MobanFragment {
public void onNext(Response response) { public void onNext(Response response) {
String body = (String) response.body(); String body = (String) response.body();
BaseBean.ResultBean result = JsonUtils.fromJson(body, BaseBean.class).getResult(); BaseBean.ResultBean result = JsonUtils.fromJson(body, BaseBean.class).getResult();
if(result.getSuccess()==0){ if (result.getSuccess() == 0) {
newrefresh(); newrefresh();
}else { } else {
ToastUtils.showToast(getActivity(),result.getMsg()); ToastUtils.showToast(getActivity(), result.getMsg());
} }
} }
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -33,14 +33,17 @@ public class DealFragment extends MobanFragment {
private static int mSerial = 0; private static int mSerial = 0;
private int mTabPos = 0; private int mTabPos = 0;
private String search; private String search;
public DealFragment(int serial) { public DealFragment(int serial) {
super(); super();
mSerial = serial; mSerial = serial;
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
public void setTabPos(int mTabPos) { public void setTabPos(int mTabPos) {
this.mTabPos = mTabPos; this.mTabPos = mTabPos;
} }
@Override @Override
public void initAdapter() { public void initAdapter() {
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
@@ -59,7 +62,7 @@ public class DealFragment extends MobanFragment {
List<orderListBean.ResultBean.DataBean.IndustryBean> industry = item.getIndustry(); List<orderListBean.ResultBean.DataBean.IndustryBean> industry = item.getIndustry();
IndustryBeantwo industryBean = new IndustryBeantwo(); IndustryBeantwo industryBean = new IndustryBeantwo();
List<IndustryBeantwo.DataBean> dataBeans = new ArrayList<>(); List<IndustryBeantwo.DataBean> dataBeans = new ArrayList<>();
for(int i=0;i<industry.size();i++){ for (int i = 0; i < industry.size(); i++) {
orderListBean.ResultBean.DataBean.IndustryBean industryBean1 = industry.get(i); orderListBean.ResultBean.DataBean.IndustryBean industryBean1 = industry.get(i);
IndustryBeantwo.DataBean dataBean = new IndustryBeantwo.DataBean(); IndustryBeantwo.DataBean dataBean = new IndustryBeantwo.DataBean();
dataBean.setIndustry(industryBean1.getIndustry()); dataBean.setIndustry(industryBean1.getIndustry());
@@ -67,29 +70,31 @@ public class DealFragment extends MobanFragment {
dataBeans.add(dataBean); dataBeans.add(dataBean);
} }
industryBean.setData(dataBeans); industryBean.setData(dataBeans);
ShowAty.FpOrderInfoActivity(getActivity(),item.getCustomer_id(),item.getName()+item.getPhone(),item.getHeadimg(),item.getWechat(),item.getAddress(),industryBean); ShowAty.FpOrderInfoActivity(getActivity(), item.getCustomer_id(), item.getName() + item.getPhone(), item.getHeadimg(), item.getWechat(), item.getAddress(), industryBean);
} }
}); });
} }
/** /**
* @description 重写下拉刷新方法,让刷新全部数据
* @param * @param
* @return * @return
* @description 重写下拉刷新方法,让刷新全部数据
*/ */
public void initRefreshLayout() { public void initRefreshLayout() {
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {
search=""; search = "";
refresh(); refresh();
} }
}); });
} }
public void onEvent(ThreeEvent event) { public void onEvent(ThreeEvent event) {
if (null != event ) { if (null != event) {
String pagetype = event.getPagetype(); String pagetype = event.getPagetype();
Log.e("刷新页面==",pagetype); Log.e("刷新页面==", pagetype);
if(pagetype.equals("2")){ if (pagetype.equals("2")) {
search = event.getSearch(); search = event.getSearch();
newrefresh(); newrefresh();
} }
@@ -112,9 +117,11 @@ public class DealFragment extends MobanFragment {
if (mNextRequestPage == 1) { if (mNextRequestPage == 1) {
if (data.size() == 0) { if (data.size() == 0) {
ViewParent parent = notDataView.getParent(); ViewParent parent = notDataView.getParent();
FrameLayout mFrameLayout = (FrameLayout)parent; FrameLayout mFrameLayout = (FrameLayout) parent;
if(mFrameLayout!=null){ if (mFrameLayout != null) {
mFrameLayout.removeView(notDataView);} mFrameLayout.removeView(notDataView);
}
setData(true, null);
markingtwoAdapter.setEmptyView(notDataView); markingtwoAdapter.setEmptyView(notDataView);
return; return;
} }
@@ -128,6 +135,7 @@ public class DealFragment extends MobanFragment {
mSwl.setRefreshing(false); mSwl.setRefreshing(false);
} }
} }
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -32,14 +32,17 @@ public class DistriFragment extends MobanFragment {
private static int mSerial = 0; private static int mSerial = 0;
private int mTabPos = 0; private int mTabPos = 0;
private String search; private String search;
public DistriFragment(int serial) { public DistriFragment(int serial) {
super(); super();
mSerial = serial; mSerial = serial;
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
public void setTabPos(int mTabPos) { public void setTabPos(int mTabPos) {
this.mTabPos = mTabPos; this.mTabPos = mTabPos;
} }
@Override @Override
public void initAdapter() { public void initAdapter() {
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
@@ -53,7 +56,7 @@ public class DistriFragment extends MobanFragment {
List<FpListBean.ResultBean.DataBean.IndustryBean> industry = item.getIndustry(); List<FpListBean.ResultBean.DataBean.IndustryBean> industry = item.getIndustry();
IndustryBeantwo industryBean = new IndustryBeantwo(); IndustryBeantwo industryBean = new IndustryBeantwo();
List<IndustryBeantwo.DataBean> dataBeans = new ArrayList<>(); List<IndustryBeantwo.DataBean> dataBeans = new ArrayList<>();
for(int i=0;i<industry.size();i++){ for (int i = 0; i < industry.size(); i++) {
FpListBean.ResultBean.DataBean.IndustryBean industryBean1 = industry.get(i); FpListBean.ResultBean.DataBean.IndustryBean industryBean1 = industry.get(i);
IndustryBeantwo.DataBean dataBean = new IndustryBeantwo.DataBean(); IndustryBeantwo.DataBean dataBean = new IndustryBeantwo.DataBean();
dataBean.setIndustry(industryBean1.getIndustry()); dataBean.setIndustry(industryBean1.getIndustry());
@@ -61,29 +64,31 @@ public class DistriFragment extends MobanFragment {
dataBeans.add(dataBean); dataBeans.add(dataBean);
} }
industryBean.setData(dataBeans); industryBean.setData(dataBeans);
ShowAty.FpOrderInfoActivity(getActivity(),item.getCustomer_id(),item.getName()+item.getPhone(),item.getHeadimg(),item.getWechat(),item.getAddress(),industryBean); ShowAty.FpOrderInfoActivity(getActivity(), item.getCustomer_id(), item.getName() + item.getPhone(), item.getHeadimg(), item.getWechat(), item.getAddress(), industryBean);
} }
}); });
} }
/** /**
* @description 重写下拉刷新方法,让刷新全部数据
* @param * @param
* @return * @return
* @description 重写下拉刷新方法,让刷新全部数据
*/ */
public void initRefreshLayout() { public void initRefreshLayout() {
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {
search=""; search = "";
refresh(); refresh();
} }
}); });
} }
public void onEvent(ThreeEvent event) { public void onEvent(ThreeEvent event) {
if (null != event ) { if (null != event) {
String pagetype = event.getPagetype(); String pagetype = event.getPagetype();
Log.e("刷新页面==",pagetype); Log.e("刷新页面==", pagetype);
if(pagetype.equals("1")){ if (pagetype.equals("1")) {
search = event.getSearch(); search = event.getSearch();
newrefresh(); newrefresh();
} }
@@ -95,11 +100,11 @@ public class DistriFragment extends MobanFragment {
final HttpParams paramsPost = new HttpParams(); final HttpParams paramsPost = new HttpParams();
paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid()); paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid());
paramsPost.put("search", search); paramsPost.put("search", search);
requesetData(paramsPost,HttpConstants.URi_device_AppCustomer_fpList); requesetData(paramsPost, HttpConstants.URi_device_AppCustomer_fpList);
} }
private void requesetData(HttpParams paramsPost,String uri) { private void requesetData(HttpParams paramsPost, String uri) {
new NetApi().getPostData(paramsPost, uri).subscribe(new Observer<Response>() { new NetApi().getPostData(paramsPost, uri).subscribe(new Observer<Response>() {
@Override @Override
public void onNext(Response response) { public void onNext(Response response) {
@@ -111,9 +116,11 @@ public class DistriFragment extends MobanFragment {
if (mNextRequestPage == 1) { if (mNextRequestPage == 1) {
if (data.size() == 0) { if (data.size() == 0) {
ViewParent parent = notDataView.getParent(); ViewParent parent = notDataView.getParent();
FrameLayout mFrameLayout = (FrameLayout)parent; FrameLayout mFrameLayout = (FrameLayout) parent;
if(mFrameLayout!=null){ if (mFrameLayout != null) {
mFrameLayout.removeView(notDataView);} mFrameLayout.removeView(notDataView);
}
setData(true, null);
markingtwoAdapter.setEmptyView(notDataView); markingtwoAdapter.setEmptyView(notDataView);
return; return;
} }
@@ -127,6 +134,7 @@ public class DistriFragment extends MobanFragment {
mSwl.setRefreshing(false); mSwl.setRefreshing(false);
} }
} }
@Override @Override
public void onError(Exception e) { public void onError(Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -9,6 +9,8 @@ import android.widget.TextView;
import com.fenghoo.seven.R; import com.fenghoo.seven.R;
import com.fenghoo.seven.base.BaseTreeFragment; import com.fenghoo.seven.base.BaseTreeFragment;
import com.fenghoo.seven.dialog.BaseTipsDialog; import com.fenghoo.seven.dialog.BaseTipsDialog;
import com.fenghoo.seven.main.find.ConversationActivity;
import com.fenghoo.seven.main.my.activity.DemoActivity;
import com.fenghoo.seven.main.my.fragment.mvp.contract.MyContract; import com.fenghoo.seven.main.my.fragment.mvp.contract.MyContract;
import com.fenghoo.seven.main.my.fragment.mvp.presenter.MyPresenterImpl; import com.fenghoo.seven.main.my.fragment.mvp.presenter.MyPresenterImpl;
import com.fenghoo.seven.main.activity.LoginPasswordActivity; import com.fenghoo.seven.main.activity.LoginPasswordActivity;
@@ -16,6 +18,7 @@ import com.fenghoo.seven.main.activity.Main2Activity;
import com.fenghoo.seven.main.my.activity.PersonalProfileActivity; import com.fenghoo.seven.main.my.activity.PersonalProfileActivity;
import com.fenghoo.seven.main.my.entity.loginInfoBean; import com.fenghoo.seven.main.my.entity.loginInfoBean;
import com.fenghoo.seven.utils.GlideTools; import com.fenghoo.seven.utils.GlideTools;
import com.fenghoo.seven.utils.JumpUtils;
import com.fenghoo.seven.utils.ToastUtils; import com.fenghoo.seven.utils.ToastUtils;
import com.fenghoo.seven.utils.ToolsUtils; import com.fenghoo.seven.utils.ToolsUtils;
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils; import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
@@ -98,20 +101,20 @@ public class MyFragment
view.findViewById(R.id.lay_out).setOnClickListener(new View.OnClickListener() { view.findViewById(R.id.lay_out).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
JumpUtils.gotoActivity(getActivity(), DemoActivity.class, false, "", "");
new BaseTipsDialog().showDownloadDialog(getActivity(), "确认要退出登录吗?", "确定", new BaseTipsDialog.ClickListener() { // new BaseTipsDialog().showDownloadDialog(getActivity(), "确认要退出登录吗?", "确定", new BaseTipsDialog.ClickListener() {
@Override // @Override
public void confirm() { // public void confirm() {
ProfileSpUtils.getInstance().saveLoginSatus(false); // ProfileSpUtils.getInstance().saveLoginSatus(false);
Intent intent = new Intent(getActivity(), LoginPasswordActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); // Intent intent = new Intent(getActivity(), LoginPasswordActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent); // startActivity(intent);
} // }
//
@Override // @Override
public void cancle() { // public void cancle() {
//
} // }
}); // });
} }
}); });
} }

View File

@@ -0,0 +1,60 @@
package com.fenghoo.seven.main.my.activity;
import android.os.Bundle;
import com.fenghoo.seven.R;
import java.util.ArrayList;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
public class DemoActivity extends AppCompatActivity {
private RvAdapterPrizeInfo adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo);
initView();
}
private void initView() {
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_prize_info);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setHasFixedSize(true);
ArrayList<String> strings = new ArrayList<>();
// for (int i=0; i<10; i++) {
//
// strings.add("客户李**已在西安开单成交 13:48:19");
// }
strings.add("1客户李**已在西安开单成交 13:48:19");
strings.add("2客户李**已在西安开单成交 13:48:19");
strings.add("3客户李**已在西安开单成交 13:48:19");
strings.add("4客户李**已在西安开单成交 13:48:19");
strings.add("5客户李**已在西安开单成交 13:48:19");
strings.add("6客户李**已在西安开单成交 13:48:19");
strings.add("7客户李**已在西安开单成交 13:48:19");
strings.add("8客户李**已在西安开单成交 13:48:19");
strings.add("9客户李**已在西安开单成交 13:48:19");
strings.add("10客户李**已在西安开单成交 13:48:19");
adapter = new RvAdapterPrizeInfo(this);
recyclerView.setAdapter(adapter);
adapter.setList(strings);
ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();
ses.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
adapter.updateList();
}
}, 2000, 2000, TimeUnit.MILLISECONDS);
}
}

View File

@@ -0,0 +1,79 @@
package com.fenghoo.seven.main.my.activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.fenghoo.seven.R;
import java.util.ArrayList;
import androidx.recyclerview.widget.RecyclerView;
/**
* Time: 2020/9/14
* Author: jianbo
* Description:
*/
class RvAdapterPrizeInfo extends RecyclerView.Adapter<RvAdapterPrizeInfo.PrizeInfoViewHolder> {
private Context mContext;
private ArrayList<String> prizeList = new ArrayList<>();
public RvAdapterPrizeInfo(Context context) {
this.mContext = context;
}
public void setList(ArrayList<String> list) {
if (list != null && !list.isEmpty()) {
this.prizeList = list;
notifyDataSetChanged();
}
}
public void updateList() {
if (!prizeList.isEmpty()) {
prizeList.add(prizeList.get(0));
prizeList.remove(0);
notifyItemRangeRemoved(0, 1);
}
}
@Override
public PrizeInfoViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.item_prize_info, viewGroup, false);
return new PrizeInfoViewHolder(view);
}
@Override
public void onBindViewHolder(PrizeInfoViewHolder holder, int i) {
String info = prizeList.get(i);
holder.tv.setText(info);
}
@Override
public int getItemCount() {
return 3;
}
class PrizeInfoViewHolder extends RecyclerView.ViewHolder{
private TextView tv;
PrizeInfoViewHolder(View itemView) {
super(itemView);
tv = (TextView) itemView.findViewById(R.id.tv_prize_info);
}
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".main.my.activity.DemoActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_prize_info"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,16 @@
<?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:orientation="vertical">
<TextView
android:id="@+id/tv_prize_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:lines="1"
android:textSize="14sp"
android:textColor="#565656"/>
</LinearLayout>