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'
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.RECEIVE_MMS" />
<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-permission android:name="android.permission.CALL_PHONE" /> <!-- 腾讯bugly权限 -->
<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_FINE_LOCATION" />
<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.READ_EXTERNAL_STORAGE" />
@@ -48,14 +45,14 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
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.activity.ForgetPasActivity" />
<activity android:name=".main.activity.ModifyPasActivity" />
<activity android:name=".main.find.ConversationActivity" />
<activity android:name=".main.find.CommentActivity" />
<activity android:name=".main.kehu.activity.JsonDataActivity">
</activity>
<activity android:name=".main.kehu.activity.JsonDataActivity"></activity>
<activity android:name=".main.kehu.activity.CustomerDetailActivity" />
<activity android:name=".main.activity.Main2Activity" /> <!-- 开启页 -->
<activity
@@ -79,9 +76,7 @@
<activity
android:name=".main.activity.MainActivity"
android:screenOrientation="portrait"
android:theme="@style/DefaultCityPickerTheme"
>
</activity>
android:theme="@style/DefaultCityPickerTheme"></activity>
<activity android:name=".view.webview.XfiveWebActivity" />
<activity
android:name=".main.activity.mine.MessageNoticeActivity"
@@ -97,22 +92,26 @@
android:screenOrientation="portrait" />
<activity
android:name=".main.kehu.activity.DesignActivity"
android:screenOrientation="portrait">
</activity>
android:screenOrientation="portrait"></activity>
<activity
android:name=".main.my.activity.PersonalProfileActivity"
android:screenOrientation="portrait" />
<activity android:name=".main.kehu.activity.AddCustomerActivity"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait" />
<activity android:name=".main.kehu.activity.AddCustDialogActivity"
android:theme="@style/dialogstyle"
<activity
android:name=".main.kehu.activity.AddCustomerActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".main.kehu.activity.AddCustDialogActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/dialogstyle" />
<activity
android:name=".main.kehu.activity.StyleActivity"
android:screenOrientation="portrait" />
<activity android:name=".main.kehu.activity.StyleActivity"
android:screenOrientation="portrait" />
<activity android:name=".main.kehu.activity.BudgetActivity"
<activity
android:name=".main.kehu.activity.BudgetActivity"
android:screenOrientation="portrait" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.fenghoo.seven.fileprovider"
@@ -120,7 +119,8 @@
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths_public"></meta-data>
android:resource="@xml/file_paths_public" />
</provider>
</application>
</manifest>

View File

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

View File

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

View File

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

View File

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

View File

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