d
This commit is contained in:
183
app/src/main/java/com/fenghoo/seven/BaseApplication.java
Normal file
183
app/src/main/java/com/fenghoo/seven/BaseApplication.java
Normal file
@@ -0,0 +1,183 @@
|
||||
package com.fenghoo.seven;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.fenghoo.seven.db.dao.DataBaseHelper;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.cache.CacheEntity;
|
||||
import com.lzy.okgo.cache.CacheMode;
|
||||
import com.lzy.okgo.cookie.CookieJarImpl;
|
||||
import com.lzy.okgo.cookie.store.DBCookieStore;
|
||||
import com.lzy.okgo.https.HttpsUtils;
|
||||
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
|
||||
import com.lzy.okgo.model.HttpHeaders;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
|
||||
/**
|
||||
* Created by: xudiwei
|
||||
* <p>
|
||||
* on: 2017/3/13.
|
||||
* <p>
|
||||
* 描述:Base Application
|
||||
* 123
|
||||
*/
|
||||
|
||||
public class BaseApplication extends Application {
|
||||
|
||||
private static Context mContext;
|
||||
private static BaseApplication baseApplication;
|
||||
public static BaseApplication getInstance() {
|
||||
|
||||
return baseApplication;
|
||||
}
|
||||
|
||||
|
||||
private String str;
|
||||
|
||||
|
||||
public static Context getContext() {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
baseApplication = this;
|
||||
mContext = this;
|
||||
//用户资料存储工具
|
||||
ProfileSpUtils.init(this);
|
||||
DataBaseHelper.initOrmLite(this);
|
||||
initOkGo();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
|
||||
}
|
||||
|
||||
public String getStr() {
|
||||
return str;
|
||||
}
|
||||
|
||||
public void setStr(String str) {
|
||||
this.str = str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void initOkGo() {
|
||||
//---------这里给出的是示例代码,告诉你可以这么传,实际使用的时候,根据需要传,不需要就不传-------------//
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.put("commonHeaderKey1", "commonHeaderValue1"); //header不支持中文,不允许有特殊字符
|
||||
headers.put("commonHeaderKey2", "commonHeaderValue2");
|
||||
HttpParams params = new HttpParams();
|
||||
params.put("commonParamsKey1", "commonParamsValue1"); //param支持中文,直接传,不要自己编码
|
||||
params.put("commonParamsKey2", "这里支持中文参数");
|
||||
//----------------------------------------------------------------------------------------//
|
||||
|
||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||
//log相关
|
||||
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor("OkGo");
|
||||
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY); //log打印级别,决定了log显示的详细程度
|
||||
loggingInterceptor.setColorLevel(Level.INFO); //log颜色级别,决定了log在控制台显示的颜色
|
||||
builder.addInterceptor(loggingInterceptor); //添加OkGo默认debug日志
|
||||
//第三方的开源库,使用通知显示当前请求的log,不过在做文件下载的时候,这个库好像有问题,对文件判断不准确
|
||||
//builder.addInterceptor(new ChuckInterceptor(this));
|
||||
|
||||
//超时时间设置,默认60秒
|
||||
builder.readTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS); //全局的读取超时时间
|
||||
builder.writeTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS); //全局的写入超时时间
|
||||
builder.connectTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS); //全局的连接超时时间
|
||||
|
||||
//自动管理cookie(或者叫session的保持),以下几种任选其一就行
|
||||
//builder.cookieJar(new CookieJarImpl(new SPCookieStore(this))); //使用sp保持cookie,如果cookie不过期,则一直有效
|
||||
builder.cookieJar(new CookieJarImpl(new DBCookieStore(this))); //使用数据库保持cookie,如果cookie不过期,则一直有效
|
||||
//builder.cookieJar(new CookieJarImpl(new MemoryCookieStore())); //使用内存保持cookie,app退出后,cookie消失
|
||||
|
||||
//https相关设置,以下几种方案根据需要自己设置
|
||||
//方法一:信任所有证书,不安全有风险
|
||||
HttpsUtils.SSLParams sslParams1 = HttpsUtils.getSslSocketFactory();
|
||||
//方法二:自定义信任规则,校验服务端证书
|
||||
HttpsUtils.SSLParams sslParams2 = HttpsUtils.getSslSocketFactory(new SafeTrustManager());
|
||||
//方法三:使用预埋证书,校验服务端证书(自签名证书)
|
||||
//HttpsUtils.SSLParams sslParams3 = HttpsUtils.getSslSocketFactory(getAssets().open("srca.cer"));
|
||||
//方法四:使用bks证书和密码管理客户端证书(双向认证),使用预埋证书,校验服务端证书(自签名证书)
|
||||
//HttpsUtils.SSLParams sslParams4 = HttpsUtils.getSslSocketFactory(getAssets().open("xxx.bks"), "123456", getAssets().open("yyy.cer"));
|
||||
builder.sslSocketFactory(sslParams1.sSLSocketFactory, sslParams1.trustManager);
|
||||
//配置https的域名匹配规则,详细看demo的初始化介绍,不需要就不要加入,使用不当会导致https握手失败
|
||||
builder.hostnameVerifier(new SafeHostnameVerifier());
|
||||
|
||||
// 其他统一的配置
|
||||
// 详细说明看GitHub文档:https://github.com/jeasonlzy/
|
||||
OkGo.getInstance().init(this) //必须调用初始化
|
||||
.setOkHttpClient(builder.build()) //建议设置OkHttpClient,不设置会使用默认的
|
||||
.setCacheMode(CacheMode.NO_CACHE) //全局统一缓存模式,默认不使用缓存,可以不传
|
||||
.setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE) //全局统一缓存时间,默认永不过期,可以不传
|
||||
.setRetryCount(3); //全局统一超时重连次数,默认为三次,那么最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0
|
||||
// .addCommonHeaders(headers) //全局公共头
|
||||
// .addCommonParams(params); //全局公共参数
|
||||
}
|
||||
|
||||
/**
|
||||
* 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
|
||||
* 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
|
||||
* 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
|
||||
* 重要的事情说三遍,以下代码不要直接使用
|
||||
*/
|
||||
private class SafeTrustManager implements X509TrustManager {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
try {
|
||||
for (X509Certificate certificate : chain) {
|
||||
certificate.checkValidity(); //检查证书是否过期,签名是否通过等
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new CertificateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
|
||||
* 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
|
||||
* 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
|
||||
* 重要的事情说三遍,以下代码不要直接使用
|
||||
*/
|
||||
private class SafeHostnameVerifier implements HostnameVerifier {
|
||||
@Override
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
//验证主机名是否匹配
|
||||
//return hostname.equals("server.jeasonlzy.com");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
app/src/main/java/com/fenghoo/seven/FHConfig.java
Normal file
23
app/src/main/java/com/fenghoo/seven/FHConfig.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.fenghoo.seven;
|
||||
|
||||
/**
|
||||
* 蜂狐配置参数
|
||||
* Created by XiaoQiang on 2017/6/24.
|
||||
*/
|
||||
public class FHConfig {
|
||||
|
||||
|
||||
/**
|
||||
* 地区选择SHNG
|
||||
*/
|
||||
public static String KEY_OPTIONS1= "options1";
|
||||
/**
|
||||
* 地区选择
|
||||
*/
|
||||
public static String KEY_OPTIONS2= "options2";
|
||||
/**
|
||||
* 地区选择
|
||||
*/
|
||||
public static String KEY_OPTIONS3= "options3";
|
||||
|
||||
}
|
||||
38
app/src/main/java/com/fenghoo/seven/GetJsonDataUtil.java
Normal file
38
app/src/main/java/com/fenghoo/seven/GetJsonDataUtil.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.fenghoo.seven;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* <读取Json文件的工具类>
|
||||
*
|
||||
* @author: 小嵩
|
||||
* @date: 2017/3/16 16:22
|
||||
|
||||
*/
|
||||
|
||||
public class GetJsonDataUtil {
|
||||
|
||||
|
||||
public String getJson(Context context,String fileName) {
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
try {
|
||||
AssetManager assetManager = context.getAssets();
|
||||
BufferedReader bf = new BufferedReader(new InputStreamReader(
|
||||
assetManager.open(fileName)));
|
||||
String line;
|
||||
while ((line = bf.readLine()) != null) {
|
||||
stringBuilder.append(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
126
app/src/main/java/com/fenghoo/seven/JsonUtils.java
Normal file
126
app/src/main/java/com/fenghoo/seven/JsonUtils.java
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (C) 2016 android@19code.com
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.fenghoo.seven;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONTokener;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Json工具类
|
||||
*
|
||||
* Create by h4de5ing 2016/5/7 007
|
||||
*/
|
||||
public class JsonUtils {
|
||||
public static String toJson(Object obj) {
|
||||
Gson gson = new Gson();
|
||||
return gson.toJson(obj);
|
||||
}
|
||||
|
||||
public static <T> T fromJson(String str, Class<T> type) {
|
||||
Gson gson = new Gson();
|
||||
return gson.fromJson(str, type);
|
||||
}
|
||||
|
||||
public static JSONObject map2Json(Map<?, ?> data) {
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
for (Map.Entry<?, ?> entry : data.entrySet()) {
|
||||
String key = (String) entry.getKey();
|
||||
if (key == null) {
|
||||
throw new NullPointerException("key == null");
|
||||
}
|
||||
try {
|
||||
object.put(key, wrap(entry.getValue()));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
public static JSONArray collection2Json(Collection<?> data) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
if (data != null) {
|
||||
for (Object aData : data) {
|
||||
jsonArray.put(wrap(aData));
|
||||
}
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
public static JSONArray object2Json(Object data) throws JSONException {
|
||||
if (!data.getClass().isArray()) {
|
||||
throw new JSONException("Not a primitive data: " + data.getClass());
|
||||
}
|
||||
final int length = Array.getLength(data);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (int i = 0; i < length; ++i) {
|
||||
jsonArray.put(wrap(Array.get(data, i)));
|
||||
}
|
||||
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
private static Object wrap(Object o) {
|
||||
if (o == null) {
|
||||
return null;
|
||||
}
|
||||
if (o instanceof JSONArray || o instanceof JSONObject) {
|
||||
return o;
|
||||
}
|
||||
try {
|
||||
if (o instanceof Collection) {
|
||||
return collection2Json((Collection<?>) o);
|
||||
} else if (o.getClass().isArray()) {
|
||||
return object2Json(o);
|
||||
}
|
||||
if (o instanceof Map) {
|
||||
return map2Json((Map<?, ?>) o);
|
||||
}
|
||||
|
||||
if (o instanceof Boolean || o instanceof Byte || o instanceof Character || o instanceof Double || o instanceof Float || o instanceof Integer || o instanceof Long
|
||||
|| o instanceof Short || o instanceof String) {
|
||||
return o;
|
||||
}
|
||||
if (o.getClass().getPackage().getName().startsWith("java.")) {
|
||||
return o.toString();
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static JSONObject string2JSONObject(String json) {
|
||||
JSONObject jsonObject = null;
|
||||
try {
|
||||
JSONTokener jsonParser = new JSONTokener(json);
|
||||
jsonObject = (JSONObject) jsonParser.nextValue();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
251
app/src/main/java/com/fenghoo/seven/base/BaseActivity.java
Normal file
251
app/src/main/java/com/fenghoo/seven/base/BaseActivity.java
Normal file
@@ -0,0 +1,251 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextPaint;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.LoadingDialog;
|
||||
import com.fenghoo.seven.dialog.PersonnelDialogHelptwo;
|
||||
import com.fenghoo.seven.utils.NetUtils;
|
||||
import com.fenghoo.seven.utils.StatusBarUtil;
|
||||
import com.fenghoo.seven.utils.ToastUtils;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
|
||||
/**
|
||||
* @author: qndroid
|
||||
* @function: 所有Activity的基类,用来处理一些公共事件,如:数据统计
|
||||
* @date: 16/3/10
|
||||
*/
|
||||
public abstract class BaseActivity extends FragmentActivity {
|
||||
|
||||
private LoadingDialog mProgressDialog;
|
||||
public static final int REQUEST_CALL_PERMISSION = 10111; //拨号请求码
|
||||
protected final String TAG = this.getClass().getSimpleName();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
reverseStatusColor();
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.StatusBarLightMode(this); //设置白底黑字
|
||||
initFontScale();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 拨打电话(直接拨打)
|
||||
*
|
||||
* @param telPhone 电话
|
||||
*/
|
||||
public void call(String telPhone) {
|
||||
if (checkReadPermission(Manifest.permission.CALL_PHONE, REQUEST_CALL_PERMISSION)) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_CALL);
|
||||
Uri phoneNum = Uri.parse("tel:" + telPhone);
|
||||
intent.setData(phoneNum);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有某项权限
|
||||
*
|
||||
* @param string_permission 权限
|
||||
* @param request_code 请求码
|
||||
* @return
|
||||
*/
|
||||
public boolean checkReadPermission(String string_permission, int request_code) {
|
||||
boolean flag = false;
|
||||
if (ContextCompat.checkSelfPermission(this, string_permission) == PackageManager.PERMISSION_GRANTED) {//已有权限
|
||||
flag = true;
|
||||
} else {//申请权限
|
||||
ActivityCompat.requestPermissions(this, new String[]{string_permission}, request_code);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private void initFontScale() {
|
||||
Configuration configuration = getResources().getConfiguration();
|
||||
configuration.fontScale = (float) 1;
|
||||
//0.85 小, 1 标准大小, 1.15 大,1.3 超大 ,1.45 特大
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
metrics.scaledDensity = configuration.fontScale * metrics.density;
|
||||
getBaseContext().getResources().updateConfiguration(configuration, metrics);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请指定的权限.
|
||||
*/
|
||||
public void requestPermission(int code, String... permissions) {
|
||||
|
||||
ActivityCompat.requestPermissions(this, permissions, code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化进度对话框
|
||||
*/
|
||||
|
||||
public void showProgressDialog(String dialogMessage,Context mContext) {
|
||||
mProgressDialog = new LoadingDialog(mContext);
|
||||
mProgressDialog.setCanceledOnTouchOutside(false);
|
||||
// mProgressDialog.setMessage(dialogMessage);
|
||||
mProgressDialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭进度对话框
|
||||
*/
|
||||
|
||||
public void dismissProgressDialog() {
|
||||
if (null != mProgressDialog && mProgressDialog.isShowing()) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有指定的权限
|
||||
*/
|
||||
public boolean hasPermission(String... permissions) {
|
||||
|
||||
for (String permisson : permissions) {
|
||||
if (ContextCompat.checkSelfPermission(this, permisson)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理整个应用用中的SDCard业务
|
||||
*/
|
||||
public void doSDCardPermission() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏状态栏
|
||||
*/
|
||||
public void hiddenStatusBar() {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
/**
|
||||
* 开启一个Activity
|
||||
*
|
||||
* @param clz
|
||||
*/
|
||||
public void startActivity(Class<? extends Activity> clz) {
|
||||
startActivity(new Intent(this, clz));
|
||||
}
|
||||
/**
|
||||
* 改变状态栏颜色
|
||||
*
|
||||
* @param color
|
||||
*/
|
||||
public void changeStatusBarColor(@ColorRes int color) {
|
||||
// StatusBarUtil.setStatusBarColor(this, color);
|
||||
}
|
||||
|
||||
/**
|
||||
* 调整状态栏为亮模式,这样状态栏的文字颜色就为深模式了。
|
||||
*/
|
||||
private void reverseStatusColor() {
|
||||
// StatusBarUtil.statusBarLightMode(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 弹出提示对话框
|
||||
*/
|
||||
|
||||
public void alertmessage(Context context,String msg) {
|
||||
|
||||
new PersonnelDialogHelptwo().showDownloadDialog(BaseActivity.this, msg,"确定", new PersonnelDialogHelptwo.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
public void messageDialog(String str) {
|
||||
new PersonnelDialogHelptwo().showDownloadDialog(BaseActivity.this, str,"确定", new PersonnelDialogHelptwo.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void toast(String msg) {
|
||||
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
/**
|
||||
* 字体加粗
|
||||
*/
|
||||
protected void Thickening(TextView mLayTopTitle) {
|
||||
TextPaint tp = mLayTopTitle.getPaint();
|
||||
tp.setFakeBoldText(true);
|
||||
}
|
||||
protected void Thickeningtwo(TextView mLayTopTitle) {
|
||||
TextPaint tp = mLayTopTitle.getPaint();
|
||||
tp.setFakeBoldText(false);
|
||||
}
|
||||
|
||||
|
||||
public boolean ConnectNetwork(Context context,String str) {
|
||||
if (!NetUtils.isConnected(context)) {
|
||||
ToastUtils.showToast(context, str);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 初始化一般返回按钮事件
|
||||
*/
|
||||
public void initNormalBack() {
|
||||
|
||||
ImageView iv_back = (ImageView) findViewById(R.id.iv_left_btn);
|
||||
|
||||
if (iv_back != null) {
|
||||
iv_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
15
app/src/main/java/com/fenghoo/seven/base/BaseBean.java
Normal file
15
app/src/main/java/com/fenghoo/seven/base/BaseBean.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description 实体基类
|
||||
* @author fangyan
|
||||
* @date 2015年8月1日
|
||||
*/
|
||||
public class BaseBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
}
|
||||
114
app/src/main/java/com/fenghoo/seven/base/BaseFragment.java
Normal file
114
app/src/main/java/com/fenghoo/seven/base/BaseFragment.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.text.TextPaint;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
/**
|
||||
* 项目名:erp
|
||||
* 包名:com.realize.erp.view.fragment
|
||||
* 文件名:BaseFragment
|
||||
* 创建者:任剑波
|
||||
* 创建时间:2017/9/29 17:42
|
||||
* 描述:TODO
|
||||
*/
|
||||
public class BaseFragment extends Fragment {
|
||||
|
||||
protected Activity mContext;
|
||||
|
||||
public static final int REQUEST_CALL_PERMISSION = 10111; //拨号请求码
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 申请指定的权限.
|
||||
*/
|
||||
public void requestPermission(int code, String... permissions) {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
requestPermissions(permissions, code);
|
||||
}
|
||||
}
|
||||
|
||||
/**s
|
||||
* 判断是否有指定的权限
|
||||
*/
|
||||
public boolean hasPermission(String... permissions) {
|
||||
|
||||
for (String permisson : permissions) {
|
||||
if (ContextCompat.checkSelfPermission(getActivity(), permisson)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void doOpenCamera() {
|
||||
|
||||
}
|
||||
|
||||
public void doWriteSDCard() {
|
||||
|
||||
}
|
||||
/**
|
||||
* 字体加粗
|
||||
*/
|
||||
protected void Thickening(TextView mLayTopTitle) {
|
||||
TextPaint tp = mLayTopTitle.getPaint();
|
||||
tp.setFakeBoldText(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启一个Activity
|
||||
*
|
||||
* @param clz 需要开启的Activity
|
||||
*/
|
||||
public void startActivity(Context mContext,Class<? extends Activity> clz) {
|
||||
startActivity(new Intent(mContext, clz));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 拨打电话(直接拨打)
|
||||
*
|
||||
* @param telPhone 电话
|
||||
*/
|
||||
public void call(String telPhone) {
|
||||
if (checkReadPermission(Manifest.permission.CALL_PHONE, REQUEST_CALL_PERMISSION)) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_CALL);
|
||||
Uri phoneNum = Uri.parse("tel:" + telPhone);
|
||||
intent.setData(phoneNum);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 判断是否有某项权限
|
||||
*
|
||||
* @param string_permission 权限
|
||||
* @param request_code 请求码
|
||||
* @return
|
||||
*/
|
||||
public boolean checkReadPermission(String string_permission, int request_code) {
|
||||
boolean flag = false;
|
||||
if (ContextCompat.checkSelfPermission(getActivity(), string_permission) == PackageManager.PERMISSION_GRANTED) {//已有权限
|
||||
flag = true;
|
||||
} else {//申请权限
|
||||
ActivityCompat.requestPermissions(getActivity(), new String[]{string_permission}, request_code);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
257
app/src/main/java/com/fenghoo/seven/base/BaseRecycleAdapter.java
Normal file
257
app/src/main/java/com/fenghoo/seven/base/BaseRecycleAdapter.java
Normal file
@@ -0,0 +1,257 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import static com.fenghoo.seven.common.Constants.LIMIT;
|
||||
|
||||
|
||||
/**
|
||||
* BaseRecycleAdapter
|
||||
* (๑• . •๑)
|
||||
* 类描述:普通RecycleView的普通BaseAdapter
|
||||
* 支持多类型item,支持加载更多,通过{{@link #canLoadMore}开启}
|
||||
* 支持Empty布局
|
||||
* simple{@link ProjectAdapter}
|
||||
* Created by LeiXiaoXing on 2017/3/17 14:26
|
||||
*/
|
||||
|
||||
public abstract class BaseRecycleAdapter<E, VH extends BaseViewHolder<E>> extends RecyclerView.Adapter<BaseViewHolder<E>> {
|
||||
|
||||
/**
|
||||
* Item类型: 加载更多
|
||||
*/
|
||||
private static final int ITEM_TYPE_LOAD_MORE = -1;
|
||||
/**
|
||||
* Item类型: Empty
|
||||
*/
|
||||
private static final int ITEM_TYPE_EMPTY = -2;
|
||||
public List<E> mEList;
|
||||
protected Context mContext;
|
||||
private OnItemClickListener<E> mListener;
|
||||
/**
|
||||
* 是否支付加载更多,默认不开启
|
||||
*/
|
||||
private boolean canLoadMore;
|
||||
/**
|
||||
* 是否加载完全部,默认可以加载更多
|
||||
*/
|
||||
private boolean isLoadAll;
|
||||
|
||||
/**
|
||||
* 构造Adapter
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param eList 数据集合
|
||||
* @param canLoadMore 是否支持加载更多
|
||||
*/
|
||||
protected BaseRecycleAdapter(Context context, List<E> eList, boolean canLoadMore) {
|
||||
mEList = eList;
|
||||
mContext = context;
|
||||
this.canLoadMore = canLoadMore;
|
||||
}
|
||||
|
||||
public List<E> getEList() {
|
||||
return mEList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseViewHolder<E> onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
if (viewType == ITEM_TYPE_LOAD_MORE) {
|
||||
//返回加载更多类型 ViewHolder
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.item_rcv_load_and_all, parent, false);
|
||||
return new LoadMoreViewHolder(view);
|
||||
} else if (viewType == ITEM_TYPE_EMPTY) {
|
||||
//返回空布局类型 ViewHolder
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.item_rcv_empty, parent, false);
|
||||
return new EmptyViewHolder(view);
|
||||
} else {
|
||||
View view = LayoutInflater.from(mContext).inflate(getItemLayout(viewType), parent, false);
|
||||
return createViewHolder(view, viewType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final BaseViewHolder<E> holder, final int position) {
|
||||
holder.bindView(mEList.get(position), position);
|
||||
if (!canLoadMore || position <= LIMIT
|
||||
|| position != mEList.size() - 1
|
||||
&& mEList.get(0) != null) {
|
||||
//在没有开启加载更多时,开启加更多但未满一页数据时,大于一页数据但不是加载更多的item时,并且为空内容时
|
||||
//点击事件生效
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mListener != null) {
|
||||
if (mEList.get(position) == null) {
|
||||
return;
|
||||
}
|
||||
mListener.onItemClick(mEList.get(position),position);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (canLoadMore && position > LIMIT - 1 && position == mEList.size() - 1) {
|
||||
//如果开启加载更多,显示加载中
|
||||
return ITEM_TYPE_LOAD_MORE;
|
||||
} else if (mEList.get(0) == null) {
|
||||
//如果无内容,显示空布局
|
||||
return ITEM_TYPE_EMPTY;
|
||||
}
|
||||
return getCustomItemViewType(position);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建自定义的item Type
|
||||
*
|
||||
* @param position item下标
|
||||
* @return 自定义item Type
|
||||
*/
|
||||
protected int getCustomItemViewType(int position) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建ViewHolder
|
||||
*
|
||||
* @param view item
|
||||
* @param viewType item视图类型
|
||||
* @return ViewHolder
|
||||
*/
|
||||
protected abstract VH createViewHolder(View view, int viewType);
|
||||
|
||||
/**
|
||||
* 获取子项布局文件id
|
||||
*
|
||||
* @return 子项布局文件id
|
||||
*/
|
||||
protected abstract int getItemLayout(int viewType);
|
||||
|
||||
/**
|
||||
* 刷新列表数据
|
||||
*
|
||||
* @param entitys 新的数据集合
|
||||
*/
|
||||
public void upDate(List<E> entitys) {
|
||||
this.mEList = entitys;
|
||||
isLoadAll = false;//刷新列表,取消已加载完全部状态
|
||||
if (entitys != null && entitys.size() != 0) {
|
||||
//有内容,移除EmptyView
|
||||
mEList.remove(null);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* 追加数据并更新
|
||||
*
|
||||
* @param entitys 新的数据集合
|
||||
*/
|
||||
public void upDateAdd(List<E> entitys) {
|
||||
|
||||
if (this.mEList == null) {
|
||||
mEList = entitys;
|
||||
} else if (entitys != null) {
|
||||
if (canLoadMore) {
|
||||
//k
|
||||
isLoadAll = entitys.size() == 0;
|
||||
if (entitys.size() != 0) {
|
||||
//移除加载更多
|
||||
isLoadAll = false;
|
||||
mEList.remove(null);
|
||||
}
|
||||
|
||||
}
|
||||
mEList.addAll(entitys);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (canLoadMore && mEList != null && mEList.size() >= LIMIT) {
|
||||
//数据条数大于每页条数时显示加载更多
|
||||
//添加加载更多到尾部
|
||||
if (!mEList.contains(null)) {
|
||||
mEList.add(null);
|
||||
}
|
||||
} else if (mEList == null || mEList.size() == 0) {
|
||||
//无内容,添加EmptyView
|
||||
mEList = new ArrayList<>();
|
||||
mEList.add(null);
|
||||
}
|
||||
return mEList.size();
|
||||
}
|
||||
|
||||
public boolean isLoadAll() {
|
||||
return isLoadAll;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<E> listener) {
|
||||
mListener = listener;
|
||||
}
|
||||
|
||||
|
||||
public interface OnItemClickListener<E> {
|
||||
void onItemClick(E entity, int position);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载更多item以及加载完全部 ViewHolder
|
||||
*/
|
||||
private class LoadMoreViewHolder extends BaseViewHolder<E> {
|
||||
|
||||
private View viewLoadAll;
|
||||
private View viewLoading;
|
||||
|
||||
LoadMoreViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView(View itemView) {
|
||||
viewLoadAll = itemView.findViewById(R.id.view_load_all);
|
||||
viewLoading = itemView.findViewById(R.id.view_loading);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bindView(E entity, int position) {
|
||||
viewLoadAll.setVisibility(isLoadAll ? View.VISIBLE : View.GONE);
|
||||
viewLoading.setVisibility(isLoadAll ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 空布局ViewHolder
|
||||
*/
|
||||
private class EmptyViewHolder extends BaseViewHolder<E> {
|
||||
|
||||
EmptyViewHolder(View view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView(View itemView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bindView(E entity, int position) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
233
app/src/main/java/com/fenghoo/seven/base/BaseTreeActivity.java
Normal file
233
app/src/main/java/com/fenghoo/seven/base/BaseTreeActivity.java
Normal file
@@ -0,0 +1,233 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.LoadingDialogy;
|
||||
import com.fenghoo.seven.utils.StatusBarUtil;
|
||||
import com.fenghoo.seven.widget.TitleBar;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpActivity;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpView;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
/**
|
||||
* BaseTreeActivity
|
||||
* (๑• . •๑)
|
||||
* 类描述: 使用第三方MVP库的BaseActivity
|
||||
* Created by LeiXiaoXing on 2017/3/14 09:54
|
||||
*/
|
||||
|
||||
public abstract class BaseTreeActivity<V extends MvpView, P extends MvpPresenter<V>> extends MvpActivity<V, P> implements BaseTreeView {
|
||||
private final String TAG = getClass().getSimpleName();
|
||||
protected Context mContext;
|
||||
private LoadingDialogy mProgressDialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(getLayoutId());
|
||||
mContext = this;
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.StatusBarLightMode(this); //设置白底黑字
|
||||
initView();
|
||||
initData();
|
||||
initEvent();
|
||||
initNormalBack();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取布局文件ID
|
||||
*
|
||||
* @return 布局文件ID
|
||||
*/
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
/**
|
||||
* 初始化视图状态
|
||||
*/
|
||||
protected abstract void initView();
|
||||
|
||||
/**
|
||||
* 初始化数据参数
|
||||
*/
|
||||
protected abstract void initData();
|
||||
|
||||
/**
|
||||
* 初始化操作事件
|
||||
*/
|
||||
protected abstract void initEvent();
|
||||
|
||||
|
||||
public void toast(String msg) {
|
||||
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public void toast(@StringRes int ids) {
|
||||
this.toast(getString(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 线程安全的toast
|
||||
*
|
||||
* @param ids toast内容
|
||||
*/
|
||||
public void toastThreadSafe(@StringRes final int ids) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toast(ids);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开启一个Activity
|
||||
*
|
||||
* @param clz 需要开启的Activity
|
||||
*/
|
||||
public void startActivity(Class<? extends Activity> clz) {
|
||||
startActivity(new Intent(this, clz));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启一个Activity并关闭当前Activity
|
||||
*
|
||||
* @param clz 需要开启的Activity
|
||||
*/
|
||||
public void startActivityAndFinishSelf(Class<? extends Activity> clz) {
|
||||
startActivity(clz);
|
||||
finish();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置标题栏参数
|
||||
*
|
||||
* @param titleIds 标题栏的id
|
||||
* @param title 标题
|
||||
* @param goneLeftBtn 左边按钮是否显示
|
||||
* @param goneRightBtn 右边按钮是否显示
|
||||
* @param titleBarClickListener 左右边的按钮点击事件回调接口
|
||||
* @return 返回设置好的titlebar
|
||||
*/
|
||||
public TitleBar setTitleBar(@IdRes int titleIds, String title
|
||||
, boolean goneLeftBtn, boolean goneRightBtn, TitleBar.OnTitleBarClickListener titleBarClickListener) {
|
||||
TitleBar titleBar = (TitleBar) findViewById(titleIds);
|
||||
titleBar.setTitle(title);
|
||||
titleBar.visibleIvLeftBtn(goneLeftBtn);
|
||||
titleBar.visibleIvRightBtn(goneRightBtn);
|
||||
titleBar.setOnTitleBarClickListener(titleBarClickListener);
|
||||
return titleBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化进度对话框
|
||||
*/
|
||||
@Override
|
||||
public void showProgressDialog(String dialogMessage) {
|
||||
mProgressDialog = LoadingDialogy.showDialog(mContext, dialogMessage);
|
||||
mProgressDialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭进度对话框
|
||||
*/
|
||||
@Override
|
||||
public void dismissProgressDialog() {
|
||||
if (null != mProgressDialog && mProgressDialog.isShowing()) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化刷新控件的参数
|
||||
*
|
||||
* @param ids 刷新控件的id
|
||||
*/
|
||||
protected SwipeRefreshLayout setSwipeRefreshLayout(@IdRes int ids) {
|
||||
SwipeRefreshLayout mRefreshLayout = (SwipeRefreshLayout) findViewById(ids);
|
||||
mRefreshLayout.setProgressViewOffset(false, 0,
|
||||
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics()));
|
||||
mRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
|
||||
return mRefreshLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示或隐藏软键盘,如果当时是显示则隐藏,如果当前是隐藏则显示
|
||||
*/
|
||||
public void showOrHide() {
|
||||
InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
// 得到InputMethodManager的实例
|
||||
if (imm.isActive()) {
|
||||
// 如果开启
|
||||
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,
|
||||
InputMethodManager.HIDE_NOT_ALWAYS);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 隐藏软键盘
|
||||
*/
|
||||
public void hintKb() {
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
/**点击空白处隐藏键盘*/
|
||||
if (getCurrentFocus() != null && getCurrentFocus().getWindowToken() != null) {
|
||||
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示软键盘
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
public void showKb(View view) {
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.showSoftInput(view, InputMethodManager.RESULT_SHOWN);
|
||||
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化一般返回按钮事件
|
||||
*/
|
||||
private void initNormalBack() {
|
||||
ImageButton ib_back = (ImageButton) findViewById(R.id.ib_back);
|
||||
ImageView iv_back = (ImageView) findViewById(R.id.iv_left_btn);
|
||||
if (ib_back != null) {
|
||||
ib_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (iv_back != null) {
|
||||
iv_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
306
app/src/main/java/com/fenghoo/seven/base/BaseTreeFragment.java
Normal file
306
app/src/main/java/com/fenghoo/seven/base/BaseTreeFragment.java
Normal file
@@ -0,0 +1,306 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.LoadingDialog;
|
||||
import com.fenghoo.seven.widget.TitleBar;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpFragment;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpView;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
/**
|
||||
* BaseTreeFragment
|
||||
* (๑• . •๑)
|
||||
* 类描述: Fragment基类,使用第三方MVP
|
||||
* Created by LeiXiaoXing on 2017/3/14 09:57
|
||||
*/
|
||||
|
||||
public abstract class BaseTreeFragment<V extends MvpView, P extends MvpPresenter<V>> extends MvpFragment<V, P> implements View.OnClickListener{
|
||||
|
||||
protected final String TAG = getClass().getSimpleName();
|
||||
protected Context mContext;
|
||||
protected Activity mActivity;
|
||||
private LoadingDialog mProgressDialog;
|
||||
/**
|
||||
* 视图是否已经初初始化
|
||||
*/
|
||||
protected boolean isInit = false;
|
||||
protected boolean isLoad = false;
|
||||
// 两次点击按钮之间的点击间隔不能少于1000毫秒
|
||||
private static final int MIN_CLICK_DELAY_TIME = 1000;
|
||||
private static long lastClickTime;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
return inflater.inflate(getFragmentLayoutId(), container, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
initView(view);
|
||||
initData();
|
||||
initEvent(view);
|
||||
isInit = true;
|
||||
isCanLoadData();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isFastClick())
|
||||
widgetClick(v);
|
||||
}
|
||||
/** View点击 **/
|
||||
public abstract void widgetClick(View v);
|
||||
/**
|
||||
* [防止快速点击]
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static boolean isFastClick() {
|
||||
boolean flag = false;
|
||||
long curClickTime = System.currentTimeMillis();
|
||||
if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
|
||||
flag = true;
|
||||
}
|
||||
lastClickTime = curClickTime;
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Fragment布局文件id
|
||||
*
|
||||
* @return Fragment布局文件id
|
||||
*/
|
||||
protected abstract int getFragmentLayoutId();
|
||||
|
||||
/**
|
||||
* 初始化视图状态
|
||||
*/
|
||||
protected abstract void initView(View view);
|
||||
|
||||
/**
|
||||
* 初始化数据参数
|
||||
*/
|
||||
protected abstract void initData();
|
||||
|
||||
/**
|
||||
* 初始化操作事件
|
||||
*/
|
||||
protected abstract void initEvent(View view);
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
mContext = context;
|
||||
mActivity = getActivity();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图是否已经对用户可见,系统的方法,setUserVisibleHint在onCreate之前调用
|
||||
* 1.第一次创建Fragment时,加载数据会报空指针异常,所以要加个判断是否已经初始化
|
||||
* 2.当Fragment已经初始化,再次可见时会直接调用此方法,此时可以直接加载数据
|
||||
* 所以要在两个地方调用加载数据
|
||||
*/
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
isCanLoadData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以加载数据
|
||||
* 可以加载数据的条件:
|
||||
* 1.视图已经初始化
|
||||
* 2.视图对用户可见
|
||||
*/
|
||||
private void isCanLoadData() {
|
||||
if (!isInit) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getUserVisibleHint()) {
|
||||
setUpView();
|
||||
isLoad = true;
|
||||
} else {
|
||||
if (isLoad) {
|
||||
stopLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当视图初始化并且对用户可见的时候去真正的加载数据
|
||||
*/
|
||||
protected void setUpView() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 当视图已经对用户不可见并且加载过数据,如果需要在切换到其他页面时停止加载数据,可以调用此方法
|
||||
*/
|
||||
protected void stopLoad() {
|
||||
}
|
||||
|
||||
/**
|
||||
* toast
|
||||
*
|
||||
* @param msg 吐丝的内容
|
||||
*/
|
||||
public void toast(String msg) {
|
||||
Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
/**
|
||||
* toast
|
||||
*
|
||||
* @param ids 吐丝的内容的字符串ids
|
||||
*/
|
||||
public void toast(@StringRes int ids) {
|
||||
toast(getString(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 线程安全的toast
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
public void toastThreadSafe(final String msg) {
|
||||
if (null != mActivity) {
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toast(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 线程安全的toast
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
public void toastThreadSafe(@StringRes final int ids) {
|
||||
if (null != mActivity) {
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toast(ids);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启一个Activity
|
||||
*
|
||||
* @param clz 需要开启的Activity
|
||||
*/
|
||||
public void startActivity(Class<? extends Activity> clz) {
|
||||
if (null != mContext) {
|
||||
startActivity(new Intent(mContext, clz));
|
||||
// getActivity().overridePendingTransition(R.anim.trans_next_in,R.anim.trans_next_out);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启一个Activity,并finish掉当前的Activity
|
||||
*
|
||||
* @param clz
|
||||
*/
|
||||
public void startActivityAndFinishSelf(Class<? extends Activity> clz) {
|
||||
if (null != mActivity) {
|
||||
startActivity(clz);
|
||||
mActivity.finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化进度对话框
|
||||
*/
|
||||
|
||||
public void showProgressDialog(String dialogMessage) {
|
||||
mProgressDialog = new LoadingDialog(mContext);
|
||||
mProgressDialog.setCanceledOnTouchOutside(false);
|
||||
// mProgressDialog.setMessage(dialogMessage);
|
||||
mProgressDialog.show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
Log.d(TAG, "onHiddenChanged");
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭进度对话框
|
||||
*/
|
||||
|
||||
public void dismissProgressDialog() {
|
||||
if (null != mProgressDialog && mProgressDialog.isShowing()) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化刷新控件的参数
|
||||
*
|
||||
* @param ids 刷新控件的id
|
||||
*/
|
||||
protected SwipeRefreshLayout setSwipeRefreshLayout(@IdRes int ids) {
|
||||
SwipeRefreshLayout mRefreshLayout = (SwipeRefreshLayout) getView().findViewById(ids);
|
||||
mRefreshLayout.setProgressViewOffset(false, 0,
|
||||
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics()));
|
||||
mRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
|
||||
return mRefreshLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置标题栏参数
|
||||
*
|
||||
* @param titleIds 标题栏的id
|
||||
* @param title 标题
|
||||
* @param goneLeftBtn 左边按钮是否显示
|
||||
* @param goneRightBtn 右边按钮是否显示
|
||||
* @param titleBarClickListener 左右边的按钮点击事件回调接口
|
||||
* @return 返回设置好的titlebar
|
||||
*/
|
||||
public TitleBar setTitleBar(@IdRes int titleIds, String title
|
||||
, boolean goneLeftBtn, boolean goneRightBtn, TitleBar.OnTitleBarClickListener titleBarClickListener) {
|
||||
TitleBar titleBar = (TitleBar) getView().findViewById(titleIds);
|
||||
titleBar.setTitle(title);
|
||||
titleBar.visibleIvLeftBtn(goneLeftBtn);
|
||||
titleBar.visibleIvRightBtn(goneRightBtn);
|
||||
titleBar.setOnTitleBarClickListener(titleBarClickListener);
|
||||
return titleBar;
|
||||
}
|
||||
}
|
||||
63
app/src/main/java/com/fenghoo/seven/base/BaseTreeView.java
Normal file
63
app/src/main/java/com/fenghoo/seven/base/BaseTreeView.java
Normal file
@@ -0,0 +1,63 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpView;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
/**
|
||||
* BaseTreeView
|
||||
* (๑• . •๑)
|
||||
* 类描述:基础View接口
|
||||
* Created by LeiXiaoXing on 2017/3/13 18:20
|
||||
*/
|
||||
|
||||
public interface BaseTreeView extends MvpView {
|
||||
|
||||
/**
|
||||
* 显示加载中对话框
|
||||
*/
|
||||
@UiThread
|
||||
|
||||
void showProgressDialog(String dialogMessage);
|
||||
|
||||
/**
|
||||
* 隐藏加载中对话框
|
||||
*/
|
||||
@UiThread
|
||||
|
||||
void dismissProgressDialog();
|
||||
|
||||
|
||||
/**
|
||||
* toast
|
||||
*
|
||||
* @param msg 吐丝的内容
|
||||
*/
|
||||
void toast(String msg);
|
||||
|
||||
/**
|
||||
* toast
|
||||
*
|
||||
* @param ids 吐丝的内容的字符串ids
|
||||
*/
|
||||
void toast(@StringRes int ids);
|
||||
|
||||
|
||||
/**
|
||||
* 开启一个Activity
|
||||
*
|
||||
* @param clz 需要开启的Activity
|
||||
*/
|
||||
void startActivity(Class<? extends Activity> clz);
|
||||
|
||||
/**
|
||||
* 开启一个Activity,并finish掉当前的Activity
|
||||
*
|
||||
* @param clz 消息内容
|
||||
*/
|
||||
void startActivityAndFinishSelf(Class<? extends Activity> clz);
|
||||
|
||||
}
|
||||
34
app/src/main/java/com/fenghoo/seven/base/BaseViewHolder.java
Normal file
34
app/src/main/java/com/fenghoo/seven/base/BaseViewHolder.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* BaseViewHolder
|
||||
* (๑• . •๑)
|
||||
* 类描述:普通的BaseViewHolder
|
||||
* Created by LeiXiaoXing on 2017/3/17 14:12
|
||||
*/
|
||||
|
||||
public abstract class BaseViewHolder<E> extends RecyclerView.ViewHolder {
|
||||
|
||||
protected BaseViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
initView(itemView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化视图
|
||||
*
|
||||
* @param itemView 子视图
|
||||
*/
|
||||
protected abstract void initView(View itemView);
|
||||
|
||||
/**
|
||||
* 绑定数据
|
||||
*
|
||||
* @param entity 实体对象
|
||||
*/
|
||||
protected abstract void bindView(E entity,int position);
|
||||
}
|
||||
280
app/src/main/java/com/fenghoo/seven/base/BasetwoFragment.java
Normal file
280
app/src/main/java/com/fenghoo/seven/base/BasetwoFragment.java
Normal file
@@ -0,0 +1,280 @@
|
||||
package com.fenghoo.seven.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.LoadingDialog;
|
||||
import com.fenghoo.seven.widget.TitleBar;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpFragment;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpView;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
/**
|
||||
* BaseTreeFragment
|
||||
* (๑• . •๑)
|
||||
* 类描述: Fragment基类,使用第三方MVP
|
||||
* Created by LeiXiaoXing on 2017/3/14 09:57
|
||||
*/
|
||||
|
||||
public abstract class BasetwoFragment<V extends MvpView, P extends MvpPresenter<V>> extends MvpFragment<V, P> {
|
||||
|
||||
protected final String TAG = getClass().getSimpleName();
|
||||
protected Context mContext;
|
||||
protected Activity mActivity;
|
||||
private LoadingDialog mProgressDialog;
|
||||
/**
|
||||
* 视图是否已经初初始化
|
||||
*/
|
||||
protected boolean isInit = false;
|
||||
protected boolean isLoad = false;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
return inflater.inflate(getFragmentLayoutId(), container, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
initView(view);
|
||||
initData();
|
||||
initEvent(view);
|
||||
isInit = true;
|
||||
isCanLoadData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Fragment布局文件id
|
||||
*
|
||||
* @return Fragment布局文件id
|
||||
*/
|
||||
protected abstract int getFragmentLayoutId();
|
||||
|
||||
/**
|
||||
* 初始化视图状态
|
||||
*/
|
||||
protected abstract void initView(View view);
|
||||
|
||||
/**
|
||||
* 初始化数据参数
|
||||
*/
|
||||
protected abstract void initData();
|
||||
|
||||
/**
|
||||
* 初始化操作事件
|
||||
*/
|
||||
protected abstract void initEvent(View view);
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
mContext = context;
|
||||
mActivity = getActivity();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 视图是否已经对用户可见,系统的方法,setUserVisibleHint在onCreate之前调用
|
||||
* 1.第一次创建Fragment时,加载数据会报空指针异常,所以要加个判断是否已经初始化
|
||||
* 2.当Fragment已经初始化,再次可见时会直接调用此方法,此时可以直接加载数据
|
||||
* 所以要在两个地方调用加载数据
|
||||
*/
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
isCanLoadData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以加载数据
|
||||
* 可以加载数据的条件:
|
||||
* 1.视图已经初始化
|
||||
* 2.视图对用户可见
|
||||
*/
|
||||
private void isCanLoadData() {
|
||||
if (!isInit) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getUserVisibleHint()) {
|
||||
setUpView();
|
||||
isLoad = true;
|
||||
} else {
|
||||
if (isLoad) {
|
||||
stopLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当视图初始化并且对用户可见的时候去真正的加载数据
|
||||
*/
|
||||
protected void setUpView() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 当视图已经对用户不可见并且加载过数据,如果需要在切换到其他页面时停止加载数据,可以调用此方法
|
||||
*/
|
||||
protected void stopLoad() {
|
||||
}
|
||||
|
||||
/**
|
||||
* toast
|
||||
*
|
||||
* @param msg 吐丝的内容
|
||||
*/
|
||||
public void toast(String msg) {
|
||||
Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
/**
|
||||
* toast
|
||||
*
|
||||
* @param ids 吐丝的内容的字符串ids
|
||||
*/
|
||||
public void toast(@StringRes int ids) {
|
||||
toast(getString(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 线程安全的toast
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
public void toastThreadSafe(final String msg) {
|
||||
if (null != mActivity) {
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toast(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 线程安全的toast
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
public void toastThreadSafe(@StringRes final int ids) {
|
||||
if (null != mActivity) {
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toast(ids);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启一个Activity
|
||||
*
|
||||
* @param clz 需要开启的Activity
|
||||
*/
|
||||
public void startActivity(Class<? extends Activity> clz) {
|
||||
if (null != mContext) {
|
||||
startActivity(new Intent(mContext, clz));
|
||||
// getActivity().overridePendingTransition(R.anim.trans_next_in,R.anim.trans_next_out);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启一个Activity,并finish掉当前的Activity
|
||||
*
|
||||
* @param clz
|
||||
*/
|
||||
public void startActivityAndFinishSelf(Class<? extends Activity> clz) {
|
||||
if (null != mActivity) {
|
||||
startActivity(clz);
|
||||
mActivity.finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化进度对话框
|
||||
*/
|
||||
|
||||
public void showProgressDialog(String dialogMessage) {
|
||||
mProgressDialog = new LoadingDialog(mContext);
|
||||
mProgressDialog.setCanceledOnTouchOutside(false);
|
||||
// mProgressDialog.setMessage(dialogMessage);
|
||||
mProgressDialog.show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
Log.d(TAG, "onHiddenChanged");
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭进度对话框
|
||||
*/
|
||||
|
||||
public void dismissProgressDialog() {
|
||||
if (null != mProgressDialog && mProgressDialog.isShowing()) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化刷新控件的参数
|
||||
*
|
||||
* @param ids 刷新控件的id
|
||||
*/
|
||||
protected SwipeRefreshLayout setSwipeRefreshLayout(@IdRes int ids) {
|
||||
SwipeRefreshLayout mRefreshLayout = (SwipeRefreshLayout) getView().findViewById(ids);
|
||||
mRefreshLayout.setProgressViewOffset(false, 0,
|
||||
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics()));
|
||||
mRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
|
||||
return mRefreshLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置标题栏参数
|
||||
*
|
||||
* @param titleIds 标题栏的id
|
||||
* @param title 标题
|
||||
* @param goneLeftBtn 左边按钮是否显示
|
||||
* @param goneRightBtn 右边按钮是否显示
|
||||
* @param titleBarClickListener 左右边的按钮点击事件回调接口
|
||||
* @return 返回设置好的titlebar
|
||||
*/
|
||||
public TitleBar setTitleBar(@IdRes int titleIds, String title
|
||||
, boolean goneLeftBtn, boolean goneRightBtn, TitleBar.OnTitleBarClickListener titleBarClickListener) {
|
||||
TitleBar titleBar = (TitleBar) getView().findViewById(titleIds);
|
||||
titleBar.setTitle(title);
|
||||
titleBar.visibleIvLeftBtn(goneLeftBtn);
|
||||
titleBar.visibleIvRightBtn(goneRightBtn);
|
||||
titleBar.setOnTitleBarClickListener(titleBarClickListener);
|
||||
return titleBar;
|
||||
}
|
||||
}
|
||||
88
app/src/main/java/com/fenghoo/seven/common/Constants.java
Normal file
88
app/src/main/java/com/fenghoo/seven/common/Constants.java
Normal file
@@ -0,0 +1,88 @@
|
||||
package com.fenghoo.seven.common;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2016/1/10.
|
||||
* 作者:xudiwei
|
||||
* <p>
|
||||
* 描述:常量类
|
||||
*/
|
||||
|
||||
public class Constants {
|
||||
/**
|
||||
* 模拟网络请求成功
|
||||
*/
|
||||
public static final int SUCCESS = 1;
|
||||
/**
|
||||
* 模拟网络请求失败
|
||||
*/
|
||||
public static final int FAILE = 0;
|
||||
|
||||
/**
|
||||
* 模拟数据网络耗时
|
||||
*/
|
||||
public static final int LOADING_TIME = 1500;
|
||||
|
||||
/**
|
||||
* 模拟数据每页长度
|
||||
*/
|
||||
public static final int LIMIT = 20;
|
||||
|
||||
/**
|
||||
* 讯飞语音appid
|
||||
*/
|
||||
public static final String IFLYTEK_APPID = "58a176c2";
|
||||
/**
|
||||
* 当前App创建在Sd卡里的根目录,其它的目录都要创建在App_root_dir里面。
|
||||
*/
|
||||
public static final String APP_ROOT_DIR = "LifeTree";
|
||||
/**
|
||||
* 存图片的dir
|
||||
*/
|
||||
public static final String IMG_DIR = APP_ROOT_DIR + "/img";
|
||||
/**
|
||||
* 图片预览里保存图片的目录
|
||||
*/
|
||||
public static final String SAVE_IMG_DIR = APP_ROOT_DIR + "/save";
|
||||
/**
|
||||
* apk下载存放目录
|
||||
*/
|
||||
public static final String APK_DIR = APP_ROOT_DIR + "/apk";
|
||||
/**
|
||||
* 缓存目录
|
||||
*/
|
||||
public static final String CACHE_DIR = APP_ROOT_DIR + "/cache";
|
||||
/**
|
||||
* SharedPreferences 文件名
|
||||
*/
|
||||
public static final String SP_CONFIG_FILE_NAME = "config";
|
||||
private static final String TAG = "Constants";
|
||||
/**
|
||||
* 当前用户的user_id(token)
|
||||
*/
|
||||
private static String userId = "";
|
||||
/**
|
||||
* 当前用户的角色 1=普通用户 2=老师 3=义工
|
||||
*/
|
||||
// private static int role = -1;
|
||||
/**
|
||||
* 当前用户所在的班级
|
||||
*/
|
||||
private static String classId = "";
|
||||
/**
|
||||
* 当前用户的IMidentify
|
||||
*/
|
||||
private static String identify = "";
|
||||
|
||||
|
||||
/**
|
||||
* 消息内存中的用户相关的信息。
|
||||
*/
|
||||
public static void clearAccountInfo() {
|
||||
userId = "";
|
||||
//role = -1;
|
||||
classId = "";
|
||||
identify = "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
4
app/src/main/java/com/fenghoo/seven/db/DbBean.java
Normal file
4
app/src/main/java/com/fenghoo/seven/db/DbBean.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package com.fenghoo.seven.db;
|
||||
|
||||
public class DbBean {
|
||||
}
|
||||
104
app/src/main/java/com/fenghoo/seven/db/DbRecordBeanData.java
Normal file
104
app/src/main/java/com/fenghoo/seven/db/DbRecordBeanData.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package com.fenghoo.seven.db;
|
||||
|
||||
import com.j256.ormlite.field.DatabaseField;
|
||||
import com.j256.ormlite.table.DatabaseTable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by Caiyn on 2018/7/5.
|
||||
* 名单管理实体类
|
||||
*/
|
||||
@DatabaseTable(tableName = "tab_record")
|
||||
public class DbRecordBeanData extends DbBean implements Serializable{
|
||||
|
||||
@DatabaseField(columnName = "headimg")
|
||||
private String headimg;
|
||||
|
||||
|
||||
@DatabaseField(columnName = "fp_num")
|
||||
private String fp_num;
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimg;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimg = headimg;
|
||||
}
|
||||
|
||||
public String getFp_num() {
|
||||
return fp_num;
|
||||
}
|
||||
|
||||
public void setFp_num(String fp_num) {
|
||||
this.fp_num = fp_num;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getWechat() {
|
||||
return wechat;
|
||||
}
|
||||
|
||||
public void setWechat(String wechat) {
|
||||
this.wechat = wechat;
|
||||
}
|
||||
|
||||
public String getCustomer_id() {
|
||||
return customer_id;
|
||||
}
|
||||
|
||||
public void setCustomer_id(String customer_id) {
|
||||
this.customer_id = customer_id;
|
||||
}
|
||||
|
||||
@DatabaseField(columnName = "phone")
|
||||
private String phone;
|
||||
@DatabaseField(columnName = "name")
|
||||
private String name;
|
||||
@DatabaseField(columnName = "wechat")
|
||||
private String wechat;
|
||||
@DatabaseField(columnName = "customer_id")
|
||||
private String customer_id;
|
||||
|
||||
@DatabaseField(columnName = "selectstuta")
|
||||
private String selectstuta = "0"; //0未选 1选中
|
||||
@DatabaseField(id = true,columnName = "Id")
|
||||
private String id;
|
||||
|
||||
|
||||
public String getSelectstuta() {
|
||||
return selectstuta;
|
||||
}
|
||||
|
||||
public void setSelectstuta(String selectstuta) {
|
||||
this.selectstuta = selectstuta;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
126
app/src/main/java/com/fenghoo/seven/db/dao/DataBaseHelper.java
Normal file
126
app/src/main/java/com/fenghoo/seven/db/dao/DataBaseHelper.java
Normal file
@@ -0,0 +1,126 @@
|
||||
package com.fenghoo.seven.db.dao;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.SQLException;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import com.fenghoo.seven.db.DbRecordBeanData;
|
||||
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
|
||||
import com.j256.ormlite.dao.Dao;
|
||||
import com.j256.ormlite.support.ConnectionSource;
|
||||
import com.j256.ormlite.table.TableUtils;
|
||||
|
||||
public class DataBaseHelper extends OrmLiteSqliteOpenHelper {
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private static final String TABLE_NAME = "sqlite-test.db";
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private static final int DBVERSION = 1;
|
||||
|
||||
private static Context mContext;
|
||||
/**
|
||||
* 单例
|
||||
*/
|
||||
private static DataBaseHelper mInstance;
|
||||
private static DataBaseHelper dataBaseHelper;
|
||||
|
||||
|
||||
private DataBaseHelper(Context context) {
|
||||
super(context, TABLE_NAME, null, DBVERSION);
|
||||
}
|
||||
|
||||
public synchronized static DataBaseHelper getInstance(Context mContext) {
|
||||
if (dataBaseHelper == null) {
|
||||
dataBaseHelper = new DataBaseHelper(mContext);
|
||||
}
|
||||
return dataBaseHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void initOrmLite(Context context) {
|
||||
mContext = context;
|
||||
getIntence();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建数据库表
|
||||
*
|
||||
* @param database
|
||||
* @param connectionSource
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase database,
|
||||
ConnectionSource connectionSource) {
|
||||
try {
|
||||
|
||||
TableUtils.createTable(connectionSource, DbRecordBeanData.class);
|
||||
|
||||
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 升级数据库
|
||||
*
|
||||
* @param database
|
||||
* @param connectionSource
|
||||
* @param oldVersion
|
||||
* @param newVersion
|
||||
*/
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase database,
|
||||
ConnectionSource connectionSource, int oldVersion, int newVersion) {
|
||||
try {
|
||||
|
||||
|
||||
onCreate(database, connectionSource);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 单例获取该Helper
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public static synchronized DataBaseHelper getIntence() {
|
||||
|
||||
if (null == mInstance) {
|
||||
synchronized (DataBaseHelper.class) {
|
||||
if (null == mInstance) {
|
||||
mInstance = new DataBaseHelper(mContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据对象
|
||||
*
|
||||
* @param classz 对应的表实体的字节码对象
|
||||
* @return Dao<T, ID> :T:表实体对象类型.ID:对应的表实体中被指定为id字段的属性类型
|
||||
* @throws SQLException
|
||||
*/
|
||||
@Override
|
||||
public Dao getDao(Class classz) throws SQLException, java.sql.SQLException {
|
||||
return super.getDao(classz);
|
||||
}
|
||||
|
||||
}
|
||||
119
app/src/main/java/com/fenghoo/seven/db/dao/DbRecordDao.java
Normal file
119
app/src/main/java/com/fenghoo/seven/db/dao/DbRecordDao.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.fenghoo.seven.db.dao;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.SQLException;
|
||||
|
||||
import com.fenghoo.seven.db.DbRecordBeanData;
|
||||
import com.j256.ormlite.dao.Dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class DbRecordDao {
|
||||
private static Dao<DbRecordBeanData, Integer> userAccountDao;
|
||||
|
||||
public DbRecordDao(Context mContext) {
|
||||
DataBaseHelper dataBaseHelper = DataBaseHelper.getInstance(mContext);
|
||||
try {
|
||||
try {
|
||||
userAccountDao = dataBaseHelper.getDao(DbRecordBeanData.class);
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public long addInsert(DbRecordBeanData userData) {
|
||||
int id = 0;
|
||||
try {
|
||||
try {
|
||||
id = userAccountDao.create(userData);
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public List<DbRecordBeanData> queryByCustom(String columnName, String columnValue) {
|
||||
List<DbRecordBeanData> ormTables = new ArrayList<>();
|
||||
try {
|
||||
ormTables = userAccountDao.queryBuilder().where().eq(columnName, columnValue).query();
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return ormTables;
|
||||
}
|
||||
|
||||
public List<DbRecordBeanData> queryByCustomtwo(String columnName, String columnValue) {
|
||||
List<DbRecordBeanData> ormTables = new ArrayList<>();
|
||||
try {
|
||||
// ormTables = userAccountDao.queryBuilder().where().eq(columnName, columnValue).query();
|
||||
ormTables= userAccountDao.queryBuilder().where().like("phone", "%"+columnValue+"%").or().like("name","%"+columnValue+"%").query();
|
||||
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return ormTables;
|
||||
}
|
||||
|
||||
public boolean updateData(DbRecordBeanData userData) {
|
||||
|
||||
try {
|
||||
int result = userAccountDao.update(userData);
|
||||
if (result != -1) {
|
||||
return true;
|
||||
|
||||
}
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static List<DbRecordBeanData> queryInByCustom(String columnName, String columnValues){
|
||||
List<DbRecordBeanData> ormTables = new ArrayList<>();
|
||||
try {
|
||||
List<String> strings = Arrays.asList(columnValues.split(","));
|
||||
|
||||
ormTables = userAccountDao.queryBuilder().where().in(columnName,strings ).query();
|
||||
}catch (java.sql.SQLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ormTables;
|
||||
}
|
||||
|
||||
public ArrayList<DbRecordBeanData> queryAll() {
|
||||
ArrayList<DbRecordBeanData> userAccountList = new ArrayList<>();
|
||||
try {
|
||||
userAccountList = (ArrayList<DbRecordBeanData>) userAccountDao.queryForAll();
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return userAccountList;
|
||||
}
|
||||
|
||||
public long delete(List<DbRecordBeanData> DATA){
|
||||
int id = 0;
|
||||
try {
|
||||
try {
|
||||
id = userAccountDao.delete(DATA);
|
||||
} catch (java.sql.SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
65
app/src/main/java/com/fenghoo/seven/dialog/BaseDialog.java
Normal file
65
app/src/main/java/com/fenghoo/seven/dialog/BaseDialog.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
/**
|
||||
* 日期:2017.01.11
|
||||
* <p>
|
||||
* 作者:xudiwei
|
||||
* <p>
|
||||
* 描述:base对话框
|
||||
*/
|
||||
public class BaseDialog extends Dialog implements View.OnClickListener {
|
||||
|
||||
protected Context mContext;
|
||||
private View view;
|
||||
private boolean isDismiss = true;
|
||||
|
||||
public BaseDialog(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public BaseDialog(Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
public BaseDialog(Context context, View view, int themeResId) {
|
||||
super(context, themeResId);
|
||||
this.mContext = context;
|
||||
this.view = view;
|
||||
this.view.setOnClickListener(this);
|
||||
setContentView(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
|
||||
WindowManager windowManager = ((Activity) mContext).getWindowManager();
|
||||
Display display = windowManager.getDefaultDisplay();
|
||||
WindowManager.LayoutParams lp = getWindow().getAttributes();
|
||||
lp.width = display.getWidth(); //设置宽度
|
||||
getWindow().setAttributes(lp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isDismiss) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当点击对话框外面时是否关闭对话框,默认是要关闭对话框
|
||||
*
|
||||
* @param b
|
||||
*/
|
||||
public void clickOutsideDismiss(boolean b) {
|
||||
this.isDismiss = b;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
|
||||
/**
|
||||
* Time: 2020/7/14
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class BaseTipsDialog {
|
||||
Context mcontext;
|
||||
ClickListener clickListener;
|
||||
|
||||
public void showDownloadDialog(Context mcontext,final String s1, final String s2, final ClickListener clickListener) {
|
||||
this.clickListener=clickListener;
|
||||
this.mcontext=mcontext;
|
||||
final Dialog dialog = new Dialog(mcontext, R.style.DialogStyle);
|
||||
dialog.setCancelable(false);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
View view = LayoutInflater.from(mcontext).inflate(R.layout.item_base_dialog, null);
|
||||
dialog.setContentView(view);
|
||||
TextView tv_title = (TextView) view.findViewById(R.id.tv_title);
|
||||
TextView tvSexCancel = (TextView) view.findViewById(R.id.tvSexCancel);
|
||||
TextView tvPhone = (TextView) view.findViewById(R.id.tvPhone);
|
||||
TextView tvSexSend = (TextView) view.findViewById(R.id.tvSexSend);
|
||||
tv_title.setText("温馨提示");
|
||||
tvPhone.setText(Html.fromHtml(s1));
|
||||
tvSexSend.setText(s2);
|
||||
tvPhone.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
});
|
||||
tvSexSend.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// if (pagetype.equals("3")) {
|
||||
// updClerkStore(updClerkStoreBean.getTrans_storeid(), updClerkStoreBean.getTrans_usertype(), updClerkStoreBean.getHand_uid());
|
||||
// } else {
|
||||
// updLeaveTime(updClerkStoreBean.getHand_uid());
|
||||
// }
|
||||
clickListener.confirm();
|
||||
dialog.dismiss();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
tvSexCancel.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
clickListener.cancle();
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
Window mWindow = dialog.getWindow();
|
||||
WindowManager.LayoutParams lp = mWindow.getAttributes();
|
||||
lp.width = MyDialog.getScreenWidth(mcontext);
|
||||
mWindow.setGravity(Gravity.CENTER);
|
||||
// mWindow.setWindowAnimations(R.style.dialogAnim);
|
||||
mWindow.setAttributes(lp);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public interface ClickListener{
|
||||
|
||||
void confirm();
|
||||
void cancle();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
|
||||
/**
|
||||
* Created by: xudiwei
|
||||
* <p>
|
||||
* on: 2017/5/16.
|
||||
* <p>
|
||||
* 描述:加载中禁止用户手机关闭的对话框
|
||||
*/
|
||||
|
||||
public class LoadingDialog extends BaseDialog {
|
||||
private boolean mClose = true;
|
||||
|
||||
public LoadingDialog(Context context) {
|
||||
super(context, View.inflate(context, R.layout.dialog_loading, null), R.style.avatar_dialog_style);
|
||||
setCanceledOnTouchOutside(false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// super.onClick(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
if (mClose) {
|
||||
((Activity) mContext).finish();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当用户按下返回键时是否关闭Activity
|
||||
* @param close
|
||||
*/
|
||||
public void setPressBackCloseActivity(boolean close) {
|
||||
this.mClose = close;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
|
||||
/**
|
||||
* on: 2018/11/2
|
||||
* <p>
|
||||
* 描述:加载中禁止用户手机关闭的对话框
|
||||
*/
|
||||
|
||||
public class LoadingDialogy extends Dialog {
|
||||
|
||||
|
||||
private Context context;
|
||||
private static LoadingDialogy dialog;
|
||||
private ProgressBar ivProgress;
|
||||
private String showContent;
|
||||
|
||||
|
||||
public LoadingDialogy(Context context , String showContent) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
this.showContent = showContent;
|
||||
}
|
||||
|
||||
public LoadingDialogy(Context context, int themeResId, String showContent) {
|
||||
super(context, themeResId);
|
||||
this.context = context;
|
||||
this.showContent = showContent;
|
||||
|
||||
|
||||
}
|
||||
//显示dialog的方法
|
||||
public static LoadingDialogy showDialog(Context context , String content){
|
||||
dialog = new LoadingDialogy(context, R.style.loadingDialog ,content);//dialog样式
|
||||
dialog.setContentView(R.layout.dialog_loading);//dialog布局文件
|
||||
dialog.setCanceledOnTouchOutside(false);//点击外部不允许关闭dialog
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
if(hasFocus && dialog != null){
|
||||
ivProgress = (ProgressBar) dialog.findViewById(R.id.ivProgress);
|
||||
TextView textView = (TextView) dialog.findViewById(R.id.tv_content);
|
||||
textView.setText(showContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
app/src/main/java/com/fenghoo/seven/dialog/MyDialog.java
Normal file
16
app/src/main/java/com/fenghoo/seven/dialog/MyDialog.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
|
||||
public class MyDialog {
|
||||
|
||||
|
||||
public static int getScreenWidth(Context context){
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
return dm.widthPixels;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.fenghoo.seven.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
|
||||
/**
|
||||
* Time: 2020/5/12
|
||||
* Author: jianbo
|
||||
* Description: 封装的自定义对话框
|
||||
*/
|
||||
public class PersonnelDialogHelptwo {
|
||||
|
||||
Context mcontext;
|
||||
ClickListener clickListener;
|
||||
|
||||
public void showDownloadDialog(Context mcontext,final String s1,final String s2, final ClickListener clickListener) {
|
||||
this.clickListener=clickListener;
|
||||
this.mcontext=mcontext;
|
||||
final Dialog dialog = new Dialog(mcontext, R.style.DialogStyle);
|
||||
dialog.setCancelable(false);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
View view = LayoutInflater.from(mcontext).inflate(R.layout.item_personnel_dialog_two, null);
|
||||
dialog.setContentView(view);
|
||||
TextView tvPhone = (TextView) view.findViewById(R.id.tvPhone);
|
||||
TextView tvSexSend = (TextView) view.findViewById(R.id.tvSexSend);
|
||||
tvPhone.setText(Html.fromHtml(s1));
|
||||
tvSexSend.setText(s2);
|
||||
tvPhone.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
});
|
||||
tvSexSend.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
clickListener.confirm();
|
||||
dialog.dismiss();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Window mWindow = dialog.getWindow();
|
||||
WindowManager.LayoutParams lp = mWindow.getAttributes();
|
||||
lp.width = MyDialog.getScreenWidth(mcontext);
|
||||
mWindow.setGravity(Gravity.CENTER);
|
||||
// mWindow.setWindowAnimations(R.style.dialogAnim);
|
||||
mWindow.setAttributes(lp);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public interface ClickListener{
|
||||
|
||||
void confirm();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package com.fenghoo.seven.main.Fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseFragment;
|
||||
import com.fenghoo.seven.main.entity.Savaselect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
|
||||
@SuppressLint("ValidFragment")
|
||||
public abstract class MoFragment extends BaseFragment {
|
||||
public static final String ARG_PAGE = "ARG_PAGE";
|
||||
private boolean IS_LOADED = false;
|
||||
private static int mSerial = 0;
|
||||
private boolean isFirst = true;
|
||||
@SuppressLint("HandlerLeak")
|
||||
private Handler handler = new Handler() {
|
||||
public void handleMessage(Message msg) {
|
||||
Log.e("tag", "IS_LOADED=" + IS_LOADED);
|
||||
if (!IS_LOADED) {
|
||||
IS_LOADED = true;
|
||||
//请求我的客户已流失数据
|
||||
requesdata();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
public Savaselect savaselectbean;
|
||||
private RelativeLayout rl_top;
|
||||
private RelativeLayout layTop_left_tv;
|
||||
|
||||
public MoFragment() {
|
||||
|
||||
}
|
||||
public BaseQuickAdapter markingtwoAdapter;
|
||||
public void sendMessage() {
|
||||
Message message = handler.obtainMessage();
|
||||
message.sendToTarget();
|
||||
}
|
||||
|
||||
private String uid;
|
||||
public RecyclerView mMarkingFragmentRecyclerView;
|
||||
public SwipeRefreshLayout mSwl;
|
||||
public int mNextRequestPage = 1;
|
||||
private static final int PAGE_SIZE = 10;
|
||||
View view;
|
||||
public View notDataView;
|
||||
public View errorView;
|
||||
public TextView mLayTopTitle;
|
||||
//头部图片(轮播图的高度)
|
||||
public int mRecyclerHeaderBannerHeight;
|
||||
//头部的高度
|
||||
public int mRecyclerHeaderHeight;
|
||||
private int mTextViewHeight;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mContext = getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
if (view != null) {
|
||||
ViewGroup parent = (ViewGroup) view.getParent();
|
||||
if (parent != null) {
|
||||
parent.removeView(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
view = inflater.inflate(R.layout.mobanfragment, container, false);
|
||||
initView(view);
|
||||
//设置页和当前页一致时加载,防止预加载
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
sendMessage();
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initView(View mContentView) {
|
||||
|
||||
rl_top = (RelativeLayout) view.findViewById(R.id.rl_top);
|
||||
mLayTopTitle = (TextView) view.findViewById(R.id.layTop_title);
|
||||
layTop_left_tv = (RelativeLayout) view.findViewById(R.id.layTop_left_tv);
|
||||
layTop_left_tv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
getActivity().finish();
|
||||
}
|
||||
});
|
||||
mLayTopTitle.setText("账户余额");
|
||||
Thickening(mLayTopTitle);
|
||||
//获取到文本的高度
|
||||
mTextViewHeight = rl_top.getHeight();
|
||||
//header高度
|
||||
mRecyclerHeaderBannerHeight = 400;
|
||||
mMarkingFragmentRecyclerView = (RecyclerView) view.findViewById(R.id.marking_fragment_recyclerView);
|
||||
mSwl = mContentView.findViewById(R.id.srl);
|
||||
notDataView = getActivity().getLayoutInflater().inflate(R.layout.empty_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
|
||||
notDataView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// refresh();
|
||||
}
|
||||
});
|
||||
errorView = getActivity().getLayoutInflater().inflate(R.layout.error_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
|
||||
errorView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// onRefresh();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
/**
|
||||
* 计算RecyclerView滑动的距离
|
||||
* @param hasHead 是否有头部
|
||||
* @param headerHeight RecyclerView的头部高度
|
||||
* @return 滑动的距离
|
||||
*/
|
||||
public int getScollYHeight(boolean hasHead, int headerHeight) {
|
||||
LinearLayoutManager layoutManager = (LinearLayoutManager) mMarkingFragmentRecyclerView.getLayoutManager();
|
||||
//获取到第一个可见的position,其添加的头部不算其position当中
|
||||
int position = layoutManager.findFirstVisibleItemPosition();
|
||||
//通过position获取其管理器中的视图
|
||||
View firstVisiableChildView = layoutManager.findViewByPosition(position);
|
||||
//获取自身的高度
|
||||
int itemHeight = firstVisiableChildView.getHeight();
|
||||
//有头部
|
||||
if(hasHead) {
|
||||
return headerHeight + itemHeight*position - firstVisiableChildView.getTop();
|
||||
}else {
|
||||
return itemHeight*position - firstVisiableChildView.getTop();
|
||||
}
|
||||
}
|
||||
|
||||
public void requesdata() {
|
||||
initAdapter();
|
||||
initRefreshLayout();
|
||||
mSwl.setRefreshing(true);
|
||||
refresh();
|
||||
}
|
||||
|
||||
public abstract void initAdapter();
|
||||
|
||||
|
||||
private void initRefreshLayout() {
|
||||
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refresh() {
|
||||
mNextRequestPage = 1;
|
||||
markingtwoAdapter.setEnableLoadMore(false);//这里的作用是防止下拉刷新的时候还可以上拉加载
|
||||
requestData();
|
||||
}
|
||||
|
||||
public void loadMore() {
|
||||
requestData();
|
||||
}
|
||||
|
||||
public void setData(boolean isRefresh, List data) {
|
||||
mNextRequestPage++;
|
||||
final int size = data == null ? 0 : data.size();
|
||||
if (isRefresh) {
|
||||
markingtwoAdapter.setNewData(data);
|
||||
} else {
|
||||
if (size > 0) {
|
||||
markingtwoAdapter.addData(data);
|
||||
}
|
||||
}
|
||||
if (size < PAGE_SIZE) {
|
||||
//第一页如果不够一页就不显示没有更多数据布局
|
||||
markingtwoAdapter.loadMoreEnd(isRefresh);
|
||||
} else {
|
||||
markingtwoAdapter.loadMoreComplete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract void requestData();
|
||||
|
||||
public void getAdpter(BaseQuickAdapter markingtwoAdapter){
|
||||
this.markingtwoAdapter=markingtwoAdapter;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.fenghoo.seven.main.Fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.adapter.mine.XikeInfoAdapter;
|
||||
import com.fenghoo.seven.main.entity.XikeInfoBean;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 惜客指数详情
|
||||
*/
|
||||
@SuppressLint("ValidFragment")
|
||||
public class XikeInfoFragment extends MoFragment {
|
||||
|
||||
private TextView xike_01;
|
||||
private String xike;
|
||||
|
||||
public XikeInfoFragment() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
XikeInfoAdapter markingtwoAdapter = new XikeInfoAdapter(mContext, null);
|
||||
getAdpter(markingtwoAdapter);
|
||||
final View headerView = getHeaderView();
|
||||
markingtwoAdapter.addHeaderView(headerView);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
||||
super.onScrollStateChanged(recyclerView, newState);
|
||||
|
||||
//onScrollStateChanged 方法
|
||||
RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
|
||||
//判断是当前layoutManager是否为LinearLayoutManager
|
||||
//只有LinearLayoutManager才有查找第一个和最后一个可见view位置的方法
|
||||
if (layoutManager instanceof LinearLayoutManager) {
|
||||
LinearLayoutManager linearManager = (LinearLayoutManager) layoutManager;
|
||||
//获取最后一个可见view的位置
|
||||
int lastItemPosition = linearManager.findLastVisibleItemPosition();
|
||||
Log.d("获取最后一个可见view的位置",lastItemPosition+"");
|
||||
//获取第一个可见view的位置
|
||||
int firstItemPosition = linearManager.findFirstVisibleItemPosition();
|
||||
Log.d("获取第一个可见view的位置",firstItemPosition+"");
|
||||
if(firstItemPosition==0){
|
||||
mLayTopTitle.setText("账户余额");
|
||||
}else {
|
||||
mLayTopTitle.setText("当前余额(元):128.56");
|
||||
}
|
||||
}}
|
||||
|
||||
@Override
|
||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
||||
super.onScrolled(recyclerView, dx, dy);
|
||||
//设置其透明度
|
||||
float alpha = 0;
|
||||
int scollYHeight = getScollYHeight(true, mRecyclerHeaderHeight);
|
||||
//起始截止变化高度,如可以变化高度为mRecyclerHeaderHeight
|
||||
//int baseHeight = mRecyclerHeaderBannerHeight + mTextViewHeight;
|
||||
int baseHeight = mRecyclerHeaderBannerHeight + dy;
|
||||
if(scollYHeight >= baseHeight) {
|
||||
//完全不透明
|
||||
alpha = 1;
|
||||
|
||||
}else {
|
||||
|
||||
//产生渐变效果
|
||||
// alpha = scollYHeight / (baseHeight*1.0f);
|
||||
alpha = (baseHeight*1.0f)/scollYHeight ;
|
||||
}
|
||||
Log.d("高度"," scollYHeight: "+scollYHeight+" baseHeight: "+baseHeight+" alpha: "+alpha);
|
||||
headerView.setAlpha(alpha);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private View getHeaderView() {
|
||||
View view = getLayoutInflater().inflate(R.layout.xikeinfo_head_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
|
||||
// xike_01 = (TextView) view.findViewById(R.id.xike_01);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
new NetApi().xikeInfo("b886798bdce09746a787651013f2c6e6").subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
XikeInfoBean.ResultBean esdv = JsonUtils.fromJson(body, XikeInfoBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (esdv != null && String.valueOf(esdv.getSuccess()).equals("0")) {
|
||||
xike = esdv.getXike();
|
||||
// WidgetTools.setTextfive(xike_01, "", xike);
|
||||
// List<XikeInfoBean.ResultBean.DataBean> data = esdv.getData();
|
||||
|
||||
|
||||
List<XikeInfoBean.ResultBean.DataBean> data = new ArrayList<XikeInfoBean.ResultBean.DataBean>();
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
XikeInfoBean.ResultBean.DataBean dataBean = new XikeInfoBean.ResultBean.DataBean();
|
||||
dataBean.setTime("2020-07-01 12:00:00");
|
||||
dataBean.setXike_num("+89.00");
|
||||
dataBean.setXike_remark("收益账户转入");
|
||||
data.add(dataBean);
|
||||
}
|
||||
|
||||
if (data.size() == 0) {
|
||||
//markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
}
|
||||
} else {
|
||||
setData(true, null);
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.fenghoo.seven.main.Fragment.mvp.contract;
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
|
||||
/**
|
||||
* MyContract
|
||||
* (๑• . •๑)
|
||||
* 类描述:
|
||||
* Created by LeiXiaoXing on 2017/5/25 14:04
|
||||
*/
|
||||
|
||||
public class MyContract {
|
||||
|
||||
public interface View extends BaseTreeView {
|
||||
/**
|
||||
* 获取微信APi
|
||||
*
|
||||
* @return 微信APi
|
||||
*/
|
||||
IWXAPI getWxApi();
|
||||
|
||||
/**
|
||||
* 刷新资料数据
|
||||
*/
|
||||
void refreshData();
|
||||
}
|
||||
|
||||
public interface Presenter {
|
||||
/**
|
||||
* 微信绑定
|
||||
*/
|
||||
void weChatBind();
|
||||
|
||||
/**
|
||||
* 刷新资料数据
|
||||
*/
|
||||
void refresh();
|
||||
}
|
||||
|
||||
public interface Model {
|
||||
/**
|
||||
* 是否绑定微信
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isBindWeChat();
|
||||
|
||||
/**
|
||||
* 微信绑定
|
||||
*/
|
||||
void weChatBind(ApiCallBack<TreeUserEntity> callBack);
|
||||
|
||||
/**
|
||||
* 刷新用户数据
|
||||
*/
|
||||
void refresh(ApiCallBack<TreeUserEntity> callBack);
|
||||
|
||||
/**
|
||||
* 保存用户资料
|
||||
*
|
||||
* @param entity 用户资料
|
||||
*/
|
||||
void save(TreeUserEntity entity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.fenghoo.seven.main.Fragment.mvp.model;
|
||||
|
||||
import com.fenghoo.seven.main.Fragment.mvp.contract.MyContract;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.network.http.ApiUtils;
|
||||
import com.fenghoo.seven.network.http.ResponseBean;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.fenghoo.seven.wxapi.WXEntryActivity;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.ObservableSource;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/05/25
|
||||
*/
|
||||
|
||||
public class MyModelImpl implements MyContract.Model {
|
||||
|
||||
@Override
|
||||
public boolean isBindWeChat() {
|
||||
return "2".equals("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void weChatBind(final ApiCallBack<TreeUserEntity> callBack) {
|
||||
WXEntryActivity.getObservable()
|
||||
.flatMap(new Function<ResponseBean<TreeUserEntity>, ObservableSource<ResponseBean<TreeUserEntity>>>() {
|
||||
@Override
|
||||
public ObservableSource<ResponseBean<TreeUserEntity>> apply(@NonNull final ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
if (treeUserEntityResponseBean.getStatus() != ResponseBean.SUCCESS) {
|
||||
return Observable.create(new ObservableOnSubscribe<ResponseBean<TreeUserEntity>>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<ResponseBean<TreeUserEntity>> e) throws Exception {
|
||||
// e.onError(new LifeTreeAPIException(-1,treeUserEntityResponseBean.getMsg()));
|
||||
}
|
||||
});
|
||||
}
|
||||
//绑定成功后刷新资料
|
||||
return ApiUtils.getApi()
|
||||
.userIdentity("");
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseBean<TreeUserEntity>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
callBack.onResponse(treeUserEntityResponseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Throwable throwable) throws Exception {
|
||||
callBack.onFailure(throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(final ApiCallBack<TreeUserEntity> callBack) {
|
||||
ApiUtils.getApi()
|
||||
.userIdentity("")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseBean<TreeUserEntity>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
callBack.onResponse(treeUserEntityResponseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Throwable throwable) throws Exception {
|
||||
callBack.onFailure(throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(TreeUserEntity entity) {
|
||||
ProfileSpUtils.getInstance().saveProfile(null );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.fenghoo.seven.main.Fragment.mvp.presenter;
|
||||
|
||||
import com.fenghoo.seven.main.Fragment.mvp.contract.MyContract;
|
||||
import com.fenghoo.seven.main.Fragment.mvp.model.MyModelImpl;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.wxapi.WXEntryActivity;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
|
||||
import com.tencent.mm.opensdk.modelmsg.SendAuth;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/05/25
|
||||
*/
|
||||
|
||||
public class MyPresenterImpl extends MvpBasePresenter<MyContract.View> implements MyContract.Presenter {
|
||||
|
||||
private MyModelImpl mModel;
|
||||
|
||||
public MyPresenterImpl() {
|
||||
mModel = new MyModelImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void weChatBind() {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean is_bind_wechat = mModel.isBindWeChat();
|
||||
|
||||
if (is_bind_wechat) {
|
||||
getView().toast("已绑定微信账号");
|
||||
return;
|
||||
}
|
||||
|
||||
IWXAPI wxApi = getView().getWxApi();
|
||||
wxApi.registerApp(WXEntryActivity.WEIXIN_APP_ID);
|
||||
|
||||
if (wxApi != null && wxApi.isWXAppInstalled()) {
|
||||
SendAuth.Req req = new SendAuth.Req();
|
||||
req.scope = "snsapi_userinfo";
|
||||
req.state = "wechat_sdk_demo_test_neng";
|
||||
getView().showProgressDialog("");
|
||||
wxApi.sendReq(req);
|
||||
} else {
|
||||
getView().toast("未安装微信");
|
||||
}
|
||||
|
||||
mModel.weChatBind(new ApiCallBack<TreeUserEntity>() {
|
||||
@Override
|
||||
protected void onSuccess(TreeUserEntity responseData, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFailure(String error) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().toast(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
|
||||
mModel.refresh(new ApiCallBack<TreeUserEntity>() {
|
||||
@Override
|
||||
protected void onSuccess(TreeUserEntity responseData, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
mModel.save(responseData);
|
||||
getView().refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFailure(String error) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().toast(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.fenghoo.seven.main.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseTreeActivity;
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginContract;
|
||||
import com.fenghoo.seven.main.activity.mvp.presenterImpl.LoginPresenterImpl;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* LoginActivity
|
||||
* 类描述:登录页面
|
||||
* 2018/10/30 5:06
|
||||
* mengjuan
|
||||
*/
|
||||
|
||||
public class LoginActivity extends BaseTreeActivity<LoginContract.View, LoginPresenterImpl> implements LoginContract.View,View.OnClickListener {
|
||||
|
||||
private EditText mEtcode;
|
||||
private Button mBtnsendcode;
|
||||
private CheckBox mCheckBox;
|
||||
private TextView loginTv;//登录
|
||||
/**
|
||||
* 请输入手机号
|
||||
*/
|
||||
private EditText mEtPhone;
|
||||
/**
|
||||
* 请输入验证码
|
||||
*/
|
||||
private EditText mEtCode;
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
private TextView mTvGetCode;
|
||||
/**
|
||||
* 验证码错误请重新输入!
|
||||
*/
|
||||
private TextView mTvCodeError;
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
private Button mBtnLogin;
|
||||
|
||||
private CountDownTimer timer = new CountDownTimer(60000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
mTvGetCode.setText(Html.fromHtml("<font color='red'>" + (millisUntilFinished / 1000) + "</font>秒后可重发"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
mTvGetCode.setClickable(true);
|
||||
mTvGetCode.setText("发送验证码");
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// TODO:OnCreate Method has been created, run FindViewById again to generate code
|
||||
setContentView(R.layout.activity_login);
|
||||
initView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_login;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mEtPhone = (EditText) findViewById(R.id.et_phone);
|
||||
mEtCode = (EditText) findViewById(R.id.et_code);
|
||||
mTvGetCode = (TextView) findViewById(R.id.tv_get_code);
|
||||
mTvGetCode.setOnClickListener(this);
|
||||
mTvCodeError = (TextView) findViewById(R.id.tv_code_error);
|
||||
mBtnLogin = (Button) findViewById(R.id.btn_login);
|
||||
mBtnLogin.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
getPresenter().initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initEvent() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.btn_login://登录
|
||||
getPresenter().login();
|
||||
break;
|
||||
case R.id.tv_get_code://获取验证码
|
||||
//发送验证码
|
||||
getPresenter().sendCode();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public LoginPresenterImpl createPresenter() {
|
||||
return new LoginPresenterImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMobile() {
|
||||
return mEtPhone.getText().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMobile(String mobile) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassWord() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPassWord(String passWord) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCode() {
|
||||
return mEtCode.getText().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSavePassword() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCodeBtnEnable(boolean enable) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCodeBtnText(String msg) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.fenghoo.seven.main.activity;
|
||||
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseTreeActivity;
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginPasswordContract;
|
||||
import com.fenghoo.seven.main.activity.mvp.presenterImpl.LoginPasswordPresenterImpl;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* LoginActivity
|
||||
* 类描述:登录页面
|
||||
*/
|
||||
|
||||
public class LoginPasswordActivity extends BaseTreeActivity<LoginPasswordContract.View, LoginPasswordPresenterImpl> implements LoginPasswordContract.View,View.OnClickListener {
|
||||
|
||||
private EditText et_pass;
|
||||
private EditText mEtPhone;
|
||||
private TextView mTvGetCode;
|
||||
private Button mBtnLogin;
|
||||
|
||||
private CountDownTimer timer = new CountDownTimer(60000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
mTvGetCode.setText(Html.fromHtml("<font color='red'>" + (millisUntilFinished / 1000) + "</font>秒后可重发"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
mTvGetCode.setClickable(true);
|
||||
mTvGetCode.setText("发送验证码");
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_password_login;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mEtPhone = (EditText) findViewById(R.id.et_phone);
|
||||
et_pass = (EditText) findViewById(R.id.et_pass);
|
||||
mBtnLogin = (Button) findViewById(R.id.btn_login);
|
||||
mBtnLogin.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
getPresenter().initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initEvent() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.btn_login://登录
|
||||
getPresenter().login();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMobile() {
|
||||
return mEtPhone.getText().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMobile(String mobile) {
|
||||
mEtPhone.setText(mobile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassWord() {
|
||||
return et_pass.getText().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPassWord(String passWord) {
|
||||
et_pass.setText(passWord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSavePassword() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public LoginPasswordPresenterImpl createPresenter() {
|
||||
return new LoginPasswordPresenterImpl();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.fenghoo.seven.main.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.main.Fragment.XikeInfoFragment;
|
||||
|
||||
public class Main2Activity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main2);
|
||||
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.container,new XikeInfoFragment()).commit();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
package com.fenghoo.seven.main.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.main.find.FindFragment;
|
||||
import com.fenghoo.seven.main.kehu.TraceFragment;
|
||||
import com.fenghoo.seven.main.my.MyFragment;
|
||||
import com.fenghoo.seven.main.task.HomeFragment;
|
||||
import com.fenghoo.seven.main.zhibo.LivebroFragment;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
public class MainActivity extends BaseActivity implements View.OnClickListener{
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
private TextView mTvHome;
|
||||
private TextView mTvHomeImg;
|
||||
|
||||
private RelativeLayout mRlHome;
|
||||
/**
|
||||
* 地图
|
||||
*/
|
||||
private TextView mTvMap;
|
||||
private RelativeLayout mRlMap;
|
||||
private TextView mTvMapImg;
|
||||
/**
|
||||
* 发现
|
||||
*/
|
||||
private TextView img_toggle_cms;
|
||||
/**
|
||||
* 配送
|
||||
*/
|
||||
private TextView mTvSend;
|
||||
private RelativeLayout mRlSend;
|
||||
private TextView mTvSendImg;
|
||||
/**
|
||||
* 我的
|
||||
*/
|
||||
private TextView mTvMy;
|
||||
private RelativeLayout mRlMine;
|
||||
private TextView mTvMineImg;
|
||||
|
||||
private FragmentManager fm;
|
||||
|
||||
private HomeFragment mHomeFragment;
|
||||
private LivebroFragment mSendFragment;
|
||||
private TraceFragment traceFragment;
|
||||
private FindFragment mapFragment;
|
||||
private MyFragment mMineFragment;
|
||||
private Fragment mCurrent;
|
||||
private RelativeLayout rl_faxian;
|
||||
private TextView tv_find;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
initView();
|
||||
initFragment();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mTvHomeImg = (TextView) findViewById(R.id.tv_home_img);
|
||||
mTvHome = (TextView) findViewById(R.id.tv_home);
|
||||
|
||||
|
||||
mRlHome = (RelativeLayout) findViewById(R.id.rl_home);
|
||||
mRlHome.setOnClickListener(this);
|
||||
rl_faxian = (RelativeLayout) findViewById(R.id.rl_faxian);
|
||||
rl_faxian.setOnClickListener(this);
|
||||
tv_find = (TextView) findViewById(R.id.tv_find);
|
||||
|
||||
mTvMapImg = (TextView) findViewById(R.id.tv_map_img);
|
||||
mTvMap = (TextView) findViewById(R.id.tv_map);
|
||||
mRlMap = (RelativeLayout) findViewById(R.id.rl_map);
|
||||
mRlMap.setOnClickListener(this);
|
||||
mTvSendImg = (TextView) findViewById(R.id.tv_send_img);
|
||||
mTvSend = (TextView) findViewById(R.id.tv_send);
|
||||
mRlSend = (RelativeLayout) findViewById(R.id.rl_send);
|
||||
mRlSend.setOnClickListener(this);
|
||||
mTvMineImg = (TextView) findViewById(R.id.tv_mine_img);
|
||||
mTvMy = (TextView) findViewById(R.id.tv_mine);
|
||||
mRlMine = (RelativeLayout) findViewById(R.id.rl_mine);
|
||||
mRlMine.setOnClickListener(this);
|
||||
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task);
|
||||
mTvHome.setTextColor(getResources().getColor(R.color.colortheme));
|
||||
}
|
||||
|
||||
private void initFragment(){
|
||||
mHomeFragment = new HomeFragment();
|
||||
fm = getSupportFragmentManager();
|
||||
fm.beginTransaction();
|
||||
FragmentTransaction fragmentTransaction = fm.beginTransaction();
|
||||
fragmentTransaction.replace(R.id.content_layout, mHomeFragment);
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
FragmentTransaction fragmentTransaction = fm.beginTransaction();
|
||||
switch (v.getId()) {
|
||||
case R.id.rl_home:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task);
|
||||
mTvSendImg.setBackgroundResource(R.mipmap.icon_zhibohui);
|
||||
mTvMapImg.setBackgroundResource(R.mipmap.icon_kehuhui);
|
||||
mTvMineImg.setBackgroundResource(R.mipmap.icon_wodehui);
|
||||
|
||||
mTvHome.setTextColor(getResources().getColor(R.color.colortheme));
|
||||
mTvSend.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
tv_find.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMap.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMy.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
|
||||
|
||||
hideFragment(mSendFragment, fragmentTransaction);
|
||||
hideFragment(traceFragment, fragmentTransaction);
|
||||
hideFragment(mapFragment, fragmentTransaction);
|
||||
hideFragment(mMineFragment, fragmentTransaction);
|
||||
if (mHomeFragment == null) {
|
||||
fragmentTransaction.add(R.id.content_layout, mHomeFragment);
|
||||
} else {
|
||||
mCurrent = mHomeFragment;
|
||||
fragmentTransaction.show(mHomeFragment);
|
||||
}
|
||||
break;
|
||||
case R.id.rl_send:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
mTvSendImg.setBackgroundResource(R.mipmap.icon_zhibo);
|
||||
mTvMapImg.setBackgroundResource(R.mipmap.icon_kehuhui);
|
||||
mTvMineImg.setBackgroundResource(R.mipmap.icon_wodehui);
|
||||
|
||||
mTvHome.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvSend.setTextColor(getResources().getColor(R.color.colortheme));
|
||||
tv_find.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMap.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMy.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
|
||||
|
||||
hideFragment(mHomeFragment, fragmentTransaction);
|
||||
hideFragment(traceFragment, fragmentTransaction);
|
||||
hideFragment(mapFragment, fragmentTransaction);
|
||||
hideFragment(mMineFragment, fragmentTransaction);
|
||||
if (mSendFragment == null) {
|
||||
mSendFragment = new LivebroFragment();
|
||||
fragmentTransaction.add(R.id.content_layout, mSendFragment);
|
||||
} else {
|
||||
mCurrent = mSendFragment;
|
||||
fragmentTransaction.show(mSendFragment);
|
||||
}
|
||||
break;
|
||||
case R.id.rl_faxian:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
mTvSendImg.setBackgroundResource(R.mipmap.icon_zhibohui);
|
||||
mTvMapImg.setBackgroundResource(R.mipmap.icon_kehuhui);
|
||||
mTvMineImg.setBackgroundResource(R.mipmap.icon_wodehui);
|
||||
|
||||
mTvHome.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvSend.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
tv_find.setTextColor(getResources().getColor(R.color.colortheme));
|
||||
mTvMap.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMy.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
|
||||
|
||||
hideFragment(mHomeFragment, fragmentTransaction);
|
||||
hideFragment(mSendFragment, fragmentTransaction);
|
||||
hideFragment(traceFragment, fragmentTransaction);
|
||||
hideFragment(mMineFragment, fragmentTransaction);
|
||||
if (mapFragment == null) {
|
||||
mapFragment = new FindFragment();
|
||||
fragmentTransaction.add(R.id.content_layout, mapFragment);
|
||||
} else {
|
||||
mCurrent = mapFragment;
|
||||
fragmentTransaction.show(mapFragment);
|
||||
}
|
||||
break;
|
||||
case R.id.rl_map:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
mTvSendImg.setBackgroundResource(R.mipmap.icon_zhibohui);
|
||||
mTvMapImg.setBackgroundResource(R.mipmap.icon_kehu);
|
||||
mTvMineImg.setBackgroundResource(R.mipmap.icon_wodehui);
|
||||
|
||||
mTvHome.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvSend.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
tv_find.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMap.setTextColor(getResources().getColor(R.color.colortheme));
|
||||
mTvMy.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
|
||||
|
||||
hideFragment(mHomeFragment, fragmentTransaction);
|
||||
hideFragment(mSendFragment, fragmentTransaction);
|
||||
hideFragment(mapFragment, fragmentTransaction);
|
||||
hideFragment(mMineFragment, fragmentTransaction);
|
||||
if (traceFragment == null) {
|
||||
traceFragment = new TraceFragment();
|
||||
fragmentTransaction.add(R.id.content_layout, traceFragment);
|
||||
} else {
|
||||
mCurrent = traceFragment;
|
||||
fragmentTransaction.show(traceFragment);
|
||||
}
|
||||
break;
|
||||
case R.id.rl_mine:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
mTvSendImg.setBackgroundResource(R.mipmap.icon_zhibohui);
|
||||
mTvMapImg.setBackgroundResource(R.mipmap.icon_kehuhui);
|
||||
mTvMineImg.setBackgroundResource(R.mipmap.icon_wode);
|
||||
|
||||
mTvHome.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvSend.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
tv_find.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMap.setTextColor(getResources().getColor(R.color.colorhui));
|
||||
mTvMy.setTextColor(getResources().getColor(R.color.colortheme));
|
||||
|
||||
|
||||
hideFragment(mHomeFragment, fragmentTransaction);
|
||||
hideFragment(mSendFragment, fragmentTransaction);
|
||||
hideFragment(mapFragment, fragmentTransaction);
|
||||
hideFragment(traceFragment, fragmentTransaction);
|
||||
if (mMineFragment == null) {
|
||||
mMineFragment = new MyFragment();
|
||||
fragmentTransaction.add(R.id.content_layout, mMineFragment);
|
||||
} else {
|
||||
mCurrent = mMineFragment;
|
||||
fragmentTransaction.show(mMineFragment);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
private void hideFragment(Fragment fragment, FragmentTransaction ft) {
|
||||
if (fragment != null) {
|
||||
ft.hide(fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.fenghoo.seven.main.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* SplashActivity
|
||||
* 类描述:启动页
|
||||
* 2018-9-30 9:17
|
||||
* author:mengjuan
|
||||
*/
|
||||
|
||||
public class SplashActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
//将屏幕设置为全屏
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
handler.sendEmptyMessageDelayed(0, 2000);
|
||||
}
|
||||
|
||||
private Handler handler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case 0:
|
||||
startActivity();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private void startActivity(){
|
||||
if (ProfileSpUtils.getInstance().isLogin()) {
|
||||
startActivity(MainActivity.class);
|
||||
} else {
|
||||
startActivity(LoginPasswordActivity.class);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
//禁用返回
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.fenghoo.seven.main.activity.mine;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.main.adapter.mine.InboundHistoryAdapter;
|
||||
import com.fenghoo.seven.main.entity.mine.InboundHistoryResBean;
|
||||
import com.fenghoo.seven.utils.SpaceItemDecoration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class InboundHistoryActivity extends BaseActivity {
|
||||
|
||||
private ImageView mIvBack;
|
||||
private TextView mTvTitle;
|
||||
private ImageView mIvSearch;
|
||||
private RecyclerView mRcyInboundHistory;
|
||||
private List<InboundHistoryResBean> inboundHistoryList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_mine_inbound_history);
|
||||
initView();
|
||||
initData();
|
||||
initRecyleview();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mIvBack = (ImageView) findViewById(R.id.iv_back);
|
||||
mTvTitle = (TextView) findViewById(R.id.tv_title);
|
||||
mIvSearch = (ImageView)findViewById(R.id.iv_search);
|
||||
mRcyInboundHistory = (RecyclerView) findViewById(R.id.rcy_inbound_history);
|
||||
}
|
||||
|
||||
private void initData(){
|
||||
mIvBack.setVisibility(View.VISIBLE);
|
||||
mTvTitle.setVisibility(View.VISIBLE);
|
||||
mTvTitle.setText(R.string.inbound_history);
|
||||
mIvSearch.setVisibility(View.VISIBLE);
|
||||
//
|
||||
InboundHistoryResBean messageNoticeResBean = new InboundHistoryResBean();
|
||||
InboundHistoryResBean messageNoticeResBean1 = new InboundHistoryResBean();
|
||||
InboundHistoryResBean messageNoticeResBean2 = new InboundHistoryResBean();
|
||||
InboundHistoryResBean messageNoticeResBean3 = new InboundHistoryResBean();
|
||||
InboundHistoryResBean messageNoticeResBean4 = new InboundHistoryResBean();
|
||||
inboundHistoryList.add(messageNoticeResBean);
|
||||
inboundHistoryList.add(messageNoticeResBean1);
|
||||
inboundHistoryList.add(messageNoticeResBean2);
|
||||
inboundHistoryList.add(messageNoticeResBean3);
|
||||
inboundHistoryList.add(messageNoticeResBean4);
|
||||
|
||||
}
|
||||
private void initRecyleview(){
|
||||
InboundHistoryAdapter messageNoticeAdapter = new InboundHistoryAdapter(this,inboundHistoryList);
|
||||
LinearLayoutManager manager = new LinearLayoutManager(this);
|
||||
mRcyInboundHistory.addItemDecoration(new SpaceItemDecoration(0, 20));
|
||||
mRcyInboundHistory.setLayoutManager(manager);
|
||||
mRcyInboundHistory.setAdapter(messageNoticeAdapter);
|
||||
messageNoticeAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
// mBean = messgeList.get(position);
|
||||
// MineMessagePresenterImpl.OneReadMessgae(messgeList.get(position).getId());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.fenghoo.seven.main.activity.mine;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.main.adapter.mine.MessageNoticeAdapter;
|
||||
import com.fenghoo.seven.main.entity.mine.MessageNoticeResBean;
|
||||
import com.fenghoo.seven.utils.SpaceItemDecoration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class MessageNoticeActivity extends BaseActivity implements View.OnClickListener{
|
||||
|
||||
|
||||
private ImageView mIvBack;
|
||||
private TextView mTvTitle;
|
||||
/**
|
||||
* 今天
|
||||
*/
|
||||
private TextView mTvToday;
|
||||
/**
|
||||
* 昨天
|
||||
*/
|
||||
private TextView mTvYesterday;
|
||||
/**
|
||||
* 历史
|
||||
*/
|
||||
private TextView mTvHistory;
|
||||
private RecyclerView mRcyContent;
|
||||
|
||||
private List<MessageNoticeResBean> messageNoticeResBeanList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_mine_messgae_notice);
|
||||
initView();
|
||||
initData();
|
||||
initRecyleview();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mIvBack = (ImageView) findViewById(R.id.iv_back);
|
||||
mTvTitle = (TextView) findViewById(R.id.tv_title);
|
||||
mTvToday = (TextView) findViewById(R.id.tv_today);
|
||||
mTvToday.setOnClickListener(this);
|
||||
mTvYesterday = (TextView) findViewById(R.id.tv_yesterday);
|
||||
mTvYesterday.setOnClickListener(this);
|
||||
mTvHistory = (TextView) findViewById(R.id.tv_history);
|
||||
mTvHistory.setOnClickListener(this);
|
||||
mRcyContent = (RecyclerView) findViewById(R.id.rcy_content);
|
||||
}
|
||||
|
||||
private void initData(){
|
||||
mIvBack.setVisibility(View.VISIBLE);
|
||||
mTvTitle.setVisibility(View.VISIBLE);
|
||||
mTvTitle.setText(R.string.message_notice);
|
||||
//
|
||||
MessageNoticeResBean messageNoticeResBean = new MessageNoticeResBean();
|
||||
MessageNoticeResBean messageNoticeResBean1 = new MessageNoticeResBean();
|
||||
MessageNoticeResBean messageNoticeResBean2 = new MessageNoticeResBean();
|
||||
MessageNoticeResBean messageNoticeResBean3 = new MessageNoticeResBean();
|
||||
MessageNoticeResBean messageNoticeResBean4 = new MessageNoticeResBean();
|
||||
messageNoticeResBeanList.add(messageNoticeResBean);
|
||||
messageNoticeResBeanList.add(messageNoticeResBean1);
|
||||
messageNoticeResBeanList.add(messageNoticeResBean2);
|
||||
messageNoticeResBeanList.add(messageNoticeResBean3);
|
||||
messageNoticeResBeanList.add(messageNoticeResBean4);
|
||||
|
||||
}
|
||||
|
||||
private void initRecyleview(){
|
||||
MessageNoticeAdapter messageNoticeAdapter = new MessageNoticeAdapter(this,messageNoticeResBeanList);
|
||||
LinearLayoutManager manager = new LinearLayoutManager(this);
|
||||
mRcyContent.addItemDecoration(new SpaceItemDecoration(0, 20));
|
||||
mRcyContent.setLayoutManager(manager);
|
||||
mRcyContent.setAdapter(messageNoticeAdapter);
|
||||
messageNoticeAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
// mBean = messgeList.get(position);
|
||||
// MineMessagePresenterImpl.OneReadMessgae(messgeList.get(position).getId());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.tv_today://今天
|
||||
mTvToday.setBackgroundResource(R.color.color_ffc107);
|
||||
mTvToday.setTextColor(getResources().getColor(R.color.colorBlack));
|
||||
mTvYesterday.setBackgroundResource(R.color.color_303030);
|
||||
mTvYesterday.setTextColor(getResources().getColor(R.color.colorWhite));
|
||||
mTvHistory.setBackgroundResource(R.color.color_303030);
|
||||
mTvHistory.setTextColor(getResources().getColor(R.color.colorWhite));
|
||||
break;
|
||||
case R.id.tv_yesterday://昨天
|
||||
mTvToday.setBackgroundResource(R.color.color_303030);
|
||||
mTvToday.setTextColor(getResources().getColor(R.color.colorWhite));
|
||||
mTvYesterday.setBackgroundResource(R.color.color_ffc107);
|
||||
mTvYesterday.setTextColor(getResources().getColor(R.color.colorBlack));
|
||||
mTvHistory.setBackgroundResource(R.color.color_303030);
|
||||
mTvHistory.setTextColor(getResources().getColor(R.color.colorWhite));
|
||||
break;
|
||||
case R.id.tv_history://历史
|
||||
mTvToday.setBackgroundResource(R.color.color_303030);
|
||||
mTvToday.setTextColor(getResources().getColor(R.color.colorWhite));
|
||||
mTvYesterday.setBackgroundResource(R.color.color_303030);
|
||||
mTvYesterday.setTextColor(getResources().getColor(R.color.colorWhite));
|
||||
mTvHistory.setBackgroundResource(R.color.color_ffc107);
|
||||
mTvHistory.setTextColor(getResources().getColor(R.color.colorBlack));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.fenghoo.seven.main.activity.mine;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.main.adapter.mine.OutboundHistoryAdapter;
|
||||
import com.fenghoo.seven.main.entity.mine.OutboundHistoryResBean;
|
||||
import com.fenghoo.seven.utils.SpaceItemDecoration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class OutboundHistoryActivity extends BaseActivity {
|
||||
|
||||
private ImageView mIvBack;
|
||||
private TextView mTvTitle;
|
||||
private ImageView mIvSearch;
|
||||
private RecyclerView mRcyOutboundHistory;
|
||||
private List<OutboundHistoryResBean> outboundHistoryList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_mine_outbound_history);
|
||||
initView();
|
||||
initData();
|
||||
initRecyleview();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mIvBack = (ImageView) findViewById(R.id.iv_back);
|
||||
mTvTitle = (TextView) findViewById(R.id.tv_title);
|
||||
mIvSearch = (ImageView)findViewById(R.id.iv_search);
|
||||
mRcyOutboundHistory = (RecyclerView) findViewById(R.id.rcy_outbound_history);
|
||||
}
|
||||
|
||||
private void initData(){
|
||||
mIvBack.setVisibility(View.VISIBLE);
|
||||
mTvTitle.setVisibility(View.VISIBLE);
|
||||
mTvTitle.setText(R.string.outbound_history);
|
||||
mIvSearch.setVisibility(View.VISIBLE);
|
||||
//
|
||||
OutboundHistoryResBean messageNoticeResBean = new OutboundHistoryResBean();
|
||||
OutboundHistoryResBean messageNoticeResBean1 = new OutboundHistoryResBean();
|
||||
OutboundHistoryResBean messageNoticeResBean2 = new OutboundHistoryResBean();
|
||||
OutboundHistoryResBean messageNoticeResBean3 = new OutboundHistoryResBean();
|
||||
OutboundHistoryResBean messageNoticeResBean4 = new OutboundHistoryResBean();
|
||||
outboundHistoryList.add(messageNoticeResBean);
|
||||
outboundHistoryList.add(messageNoticeResBean1);
|
||||
outboundHistoryList.add(messageNoticeResBean2);
|
||||
outboundHistoryList.add(messageNoticeResBean3);
|
||||
outboundHistoryList.add(messageNoticeResBean4);
|
||||
|
||||
}
|
||||
private void initRecyleview(){
|
||||
OutboundHistoryAdapter messageNoticeAdapter = new OutboundHistoryAdapter(this,outboundHistoryList);
|
||||
LinearLayoutManager manager = new LinearLayoutManager(this);
|
||||
mRcyOutboundHistory.addItemDecoration(new SpaceItemDecoration(0, 20));
|
||||
mRcyOutboundHistory.setLayoutManager(manager);
|
||||
mRcyOutboundHistory.setAdapter(messageNoticeAdapter);
|
||||
messageNoticeAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
// mBean = messgeList.get(position);
|
||||
// MineMessagePresenterImpl.OneReadMessgae(messgeList.get(position).getId());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.fenghoo.seven.main.activity.mvp.contract;
|
||||
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
|
||||
/**
|
||||
* LoginContract
|
||||
* (๑• . •๑)
|
||||
* 类描述:
|
||||
* Created by LeiXiaoXing on 2017/4/19 15:53
|
||||
*/
|
||||
|
||||
public class LoginContract {
|
||||
public interface View extends BaseTreeView {
|
||||
|
||||
/**
|
||||
* 获取手机号
|
||||
*
|
||||
* @return 手机号
|
||||
*/
|
||||
String getMobile();
|
||||
|
||||
/**
|
||||
* 设置手机号码
|
||||
*
|
||||
* @param mobile 手机号
|
||||
*/
|
||||
void setMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 获取密码
|
||||
*
|
||||
* @return 密码
|
||||
*/
|
||||
String getPassWord();
|
||||
|
||||
/**
|
||||
* 设置密码
|
||||
*
|
||||
* @param passWord 登陆密码
|
||||
*/
|
||||
void setPassWord(String passWord);
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*
|
||||
* @return 验证码
|
||||
*/
|
||||
String getCode();
|
||||
|
||||
/**
|
||||
* 是否记住密码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isSavePassword();
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置发送验证码按钮是否可用
|
||||
*
|
||||
* @param enable 是否可用
|
||||
*/
|
||||
void setCodeBtnEnable(boolean enable);
|
||||
|
||||
/**
|
||||
* 设置发送验证码按钮文本内容
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
void setCodeBtnText(String msg);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface Presenter {
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
void initData();
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
void login();
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
*/
|
||||
void sendCode();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface Model {
|
||||
|
||||
/**
|
||||
* 获取保存的手机号码
|
||||
*
|
||||
* @return 手机号码
|
||||
*/
|
||||
String getSaveMobli();
|
||||
|
||||
/**
|
||||
* 获取保存的密码
|
||||
*
|
||||
* @return 密码
|
||||
*/
|
||||
String getSavePassword();
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param code 验证码
|
||||
* @param callBack 回调函数
|
||||
*/
|
||||
void login(String mobile, String code, ApiCallBack<LoginBean> callBack);
|
||||
|
||||
|
||||
void sendCode(String mobile, ApiCallBack<LoginBean> callBack);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.fenghoo.seven.main.activity.mvp.contract;
|
||||
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
|
||||
/**
|
||||
* LoginContract
|
||||
* (๑• . •๑)
|
||||
* 类描述:
|
||||
* Created by LeiXiaoXing on 2017/4/19 15:53
|
||||
*/
|
||||
|
||||
public class LoginPasswordContract {
|
||||
public interface View extends BaseTreeView {
|
||||
|
||||
/**
|
||||
* 获取手机号
|
||||
*
|
||||
* @return 手机号
|
||||
*/
|
||||
String getMobile();
|
||||
|
||||
/**
|
||||
* 设置手机号码
|
||||
*
|
||||
* @param mobile 手机号
|
||||
*/
|
||||
void setMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 获取密码
|
||||
*
|
||||
* @return 密码
|
||||
*/
|
||||
String getPassWord();
|
||||
|
||||
/**
|
||||
* 设置密码
|
||||
*
|
||||
* @param passWord 登陆密码
|
||||
*/
|
||||
void setPassWord(String passWord);
|
||||
|
||||
/**
|
||||
* 是否记住密码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isSavePassword();
|
||||
|
||||
}
|
||||
|
||||
public interface Presenter {
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
void initData();
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
void login();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface Model {
|
||||
|
||||
/**
|
||||
* 获取保存的手机号码
|
||||
*
|
||||
* @return 手机号码
|
||||
*/
|
||||
String getSaveMobli();
|
||||
|
||||
/**
|
||||
* 设置登录状态
|
||||
*
|
||||
* @param isLogin
|
||||
*/
|
||||
void setLogin(boolean isLogin);
|
||||
|
||||
|
||||
/**
|
||||
* 保存用户数据
|
||||
*
|
||||
* @param data 用户数据
|
||||
*/
|
||||
void saveUserInfo(LoginBean data);
|
||||
|
||||
|
||||
/**
|
||||
* 记住密码
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param password 密码
|
||||
*/
|
||||
void savePassword(String mobile, String password);
|
||||
|
||||
/**
|
||||
* 获取保存的密码
|
||||
*
|
||||
* @return 密码
|
||||
*/
|
||||
String getSavePassword();
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param code 验证码
|
||||
* @param callBack 回调函数
|
||||
*/
|
||||
void login(String mobile, String code, ApiCallBack<LoginBean> callBack);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.fenghoo.seven.main.activity.mvp.model;
|
||||
|
||||
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginContract;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.network.http.ApiUtils;
|
||||
import com.fenghoo.seven.network.http.ResponseBean;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/04/19
|
||||
*/
|
||||
|
||||
public class LoginModelImpl implements LoginContract.Model {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getSaveMobli() {
|
||||
return ProfileSpUtils.getInstance().getKeyMobile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSavePassword() {
|
||||
return ProfileSpUtils.getInstance().getKeyPassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login(String mobile, String code, final ApiCallBack<LoginBean> callBack) {
|
||||
|
||||
ApiUtils.getApi()
|
||||
.login(mobile, code)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseBean>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean responseBean) throws Exception {
|
||||
callBack.onResponse(responseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Throwable throwable) throws Exception {
|
||||
callBack.onFailure(throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sendCode( String mobile, final ApiCallBack callBack) {
|
||||
ApiUtils.getApi()
|
||||
.pin(mobile)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseBean>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean responseBean) throws Exception {
|
||||
callBack.onResponse(responseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Throwable throwable) throws Exception {
|
||||
callBack.onFailure(throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.fenghoo.seven.main.activity.mvp.model;
|
||||
|
||||
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginPasswordContract;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.network.http.ApiUtils;
|
||||
import com.fenghoo.seven.network.http.ResponseBean;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/04/19
|
||||
*/
|
||||
|
||||
public class LoginPasswordModelImpl implements LoginPasswordContract.Model {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getSaveMobli() {
|
||||
return ProfileSpUtils.getInstance().getKeyMobile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogin(boolean isLogin) {
|
||||
ProfileSpUtils.getInstance().saveLoginSatus(isLogin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveUserInfo(LoginBean data) {
|
||||
ProfileSpUtils.getInstance().saveProfile(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void savePassword(String mobile, String password) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSavePassword() {
|
||||
return ProfileSpUtils.getInstance().getKeyPassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login(String mobile, String pwd, final ApiCallBack<LoginBean> callBack) {
|
||||
|
||||
ApiUtils.getApi()
|
||||
.loginpwd(mobile, pwd)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseBean>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean responseBean) throws Exception {
|
||||
callBack.onResponse(responseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Throwable throwable) throws Exception {
|
||||
callBack.onFailure(throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.fenghoo.seven.main.activity.mvp.presenterImpl;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fenghoo.seven.main.activity.MainActivity;
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginPasswordContract;
|
||||
import com.fenghoo.seven.main.activity.mvp.model.LoginPasswordModelImpl;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/10
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class LoginPasswordPresenterImpl extends MvpBasePresenter<LoginPasswordContract.View> implements LoginPasswordContract.Presenter, MvpPresenter<LoginPasswordContract.View> {
|
||||
|
||||
private LoginPasswordModelImpl mModel;
|
||||
|
||||
public LoginPasswordPresenterImpl() {
|
||||
mModel = new LoginPasswordModelImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
String saveMobli = mModel.getSaveMobli();
|
||||
if (!TextUtils.isEmpty(saveMobli)) {
|
||||
getView().setMobile(saveMobli);
|
||||
}
|
||||
String savePassword = mModel.getSavePassword();
|
||||
if (!TextUtils.isEmpty(savePassword)) {
|
||||
getView().setPassWord(savePassword);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login() {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
//验证手机号码规范
|
||||
final String mobile = getView().getMobile();
|
||||
if (TextUtils.isEmpty(mobile) || mobile.length() != 11) {
|
||||
getView().toast("请输入正确的手机号码");
|
||||
return;
|
||||
}
|
||||
//验证密码规范
|
||||
final String passWord = getView().getPassWord();
|
||||
|
||||
getView().showProgressDialog("登录中...");
|
||||
mModel.login(mobile, passWord, new ApiCallBack<LoginBean>() {
|
||||
@Override
|
||||
protected void onSuccess(LoginBean data, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
mModel.setLogin(true);
|
||||
mModel.saveUserInfo(data);
|
||||
Log.d("LoginPresenterImpl: ", data.toString());
|
||||
//记住密码
|
||||
// boolean savePassword = getView().isSavePassword();
|
||||
// mModel.savePassword(savePassword ? mobile : null, savePassword ? passWord : null);
|
||||
getView().startActivity(MainActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFailure(String error) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().toast(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.fenghoo.seven.main.activity.mvp.presenterImpl;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fenghoo.seven.main.activity.MainActivity;
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginContract;
|
||||
import com.fenghoo.seven.main.activity.mvp.model.LoginModelImpl;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.observers.DefaultObserver;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/04/19
|
||||
*/
|
||||
|
||||
public class LoginPresenterImpl extends MvpBasePresenter<LoginContract.View> implements LoginContract.Presenter{
|
||||
|
||||
private LoginModelImpl mModel;
|
||||
|
||||
public LoginPresenterImpl() {
|
||||
mModel = new LoginModelImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
String saveMobli = mModel.getSaveMobli();
|
||||
if (!TextUtils.isEmpty(saveMobli)) {
|
||||
getView().setMobile(saveMobli);
|
||||
}
|
||||
String savePassword = mModel.getSavePassword();
|
||||
if (!TextUtils.isEmpty(savePassword)) {
|
||||
getView().setPassWord(savePassword);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login() {
|
||||
getView().startActivity(MainActivity.class);
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
//验证手机号码规范
|
||||
final String mobile = getView().getMobile();
|
||||
if (TextUtils.isEmpty(mobile) || mobile.length() != 11) {
|
||||
getView().toast("请输入正确的手机号码");
|
||||
return;
|
||||
}
|
||||
//验证密码规范
|
||||
final String passWord = getView().getPassWord();
|
||||
|
||||
//验证验证规范
|
||||
String code = getView().getCode();
|
||||
if (TextUtils.isEmpty(code) || code.length() != 6) {
|
||||
getView().toast("请输入正确的验证码");
|
||||
return;
|
||||
}
|
||||
getView().showProgressDialog("登录中...");
|
||||
mModel.login(mobile, code, new ApiCallBack<LoginBean>() {
|
||||
@Override
|
||||
protected void onSuccess(LoginBean data, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
//getView().dismissProgressDialog();
|
||||
// mModel.setLogin(true);
|
||||
// mModel.saveUserInfo(data);
|
||||
Log.d("LoginPresenterImpl: ", data.toString());
|
||||
|
||||
//记住密码
|
||||
// boolean savePassword = getView().isSavePassword();
|
||||
// mModel.savePassword(savePassword ? mobile : null, savePassword ? passWord : null);
|
||||
|
||||
//toLive(ProfileSpUtils.getInstance().getUserProfie().getDefault_live_id());
|
||||
getView().startActivity(MainActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFailure(String error) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().toast(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sendCode() {
|
||||
//验证手机号码规范
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
String mobile = getView().getMobile();
|
||||
if (TextUtils.isEmpty(mobile) || mobile.length() != 11) {
|
||||
getView().toast("请输入正确的手机号码");
|
||||
return;
|
||||
}
|
||||
getView().showProgressDialog("验证码发送中");
|
||||
mModel.sendCode(mobile, new ApiCallBack() {
|
||||
@Override
|
||||
protected void onSuccess(Object responseData, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().toast("发送成功,请注意查收");
|
||||
//发送成功开始倒计时
|
||||
final int count = 60;
|
||||
Observable.interval(0, 1, TimeUnit.SECONDS)//设置0秒延迟,每隔1秒发送一次数据
|
||||
.take(count + 1)//循环61次
|
||||
.map(new Function<Long, Long>() {
|
||||
@Override
|
||||
public Long apply(@NonNull Long aLong) throws Exception {
|
||||
return count - aLong;
|
||||
}
|
||||
})
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnSubscribe(new Consumer<Disposable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Disposable disposable) throws Exception {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
//在发送数据时按钮不可点击
|
||||
getView().setCodeBtnEnable(false);
|
||||
}
|
||||
})
|
||||
.subscribe(new DefaultObserver<Long>() {
|
||||
@Override
|
||||
public void onNext(Long aLong) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().setCodeBtnText("(" + aLong + "s)获取验证码");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
//异常,停止计时
|
||||
getView().setCodeBtnEnable(true);
|
||||
getView().setCodeBtnText("获取验证码");
|
||||
getView().toast(e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().setCodeBtnEnable(true);
|
||||
getView().setCodeBtnText("获取验证码");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFailure(String error) {
|
||||
if (getView() != null) {
|
||||
getView().dismissProgressDialog();
|
||||
getView().toast(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.fenghoo.seven.main.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
|
||||
/**
|
||||
* 引导页适配器
|
||||
*/
|
||||
public class GuideViewPagerAdapter extends PagerAdapter {
|
||||
|
||||
private List<View> views;
|
||||
private Context context;
|
||||
|
||||
public GuideViewPagerAdapter(List<View> views, Context context){
|
||||
this.views = views;
|
||||
this.context = context;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||
container.removeView(views.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiateItem(ViewGroup container, int position) {
|
||||
container.addView(views.get(position));
|
||||
return views.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return views.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(View view, Object object) {
|
||||
return (view == object);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.fenghoo.seven.main.adapter.mine;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.entity.mine.InboundHistoryResBean;
|
||||
import com.fenghoo.seven.main.entity.mine.MessageNoticeResBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InboundHistoryAdapter extends BaseQuickAdapter<InboundHistoryResBean,BaseViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<MessageNoticeResBean> list;
|
||||
|
||||
public InboundHistoryAdapter(Context context, List list) {
|
||||
super(R.layout.mine_inbound_history_item, list);
|
||||
this.context = context;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, InboundHistoryResBean item) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.fenghoo.seven.main.adapter.mine;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.entity.mine.MessageNoticeResBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MessageNoticeAdapter extends BaseQuickAdapter<MessageNoticeResBean,BaseViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<MessageNoticeResBean> list;
|
||||
|
||||
public MessageNoticeAdapter(Context context, List list) {
|
||||
super(R.layout.mine_messgae_item, list);
|
||||
this.context = context;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, MessageNoticeResBean item) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.fenghoo.seven.main.adapter.mine;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.entity.mine.OutboundHistoryResBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OutboundHistoryAdapter extends BaseQuickAdapter<OutboundHistoryResBean,BaseViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<OutboundHistoryResBean> list;
|
||||
|
||||
public OutboundHistoryAdapter(Context context, List list) {
|
||||
super(R.layout.mine_outbound_history_item, list);
|
||||
this.context = context;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, OutboundHistoryResBean item) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.fenghoo.seven.main.adapter.mine;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.entity.XikeInfoBean;
|
||||
import com.fenghoo.seven.utils.WidgetTools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class XikeInfoAdapter extends BaseQuickAdapter<XikeInfoBean.ResultBean.DataBean, BaseViewHolder> {
|
||||
Context mcontext;
|
||||
public XikeInfoAdapter(Context context, List list) {
|
||||
super(R.layout.xikeinfo_item, list);
|
||||
this.mcontext = context;
|
||||
}
|
||||
@Override
|
||||
protected void convert(final BaseViewHolder helper, final XikeInfoBean.ResultBean.DataBean item) {
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_01), "", item.getXike_remark());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_02), "", item.getTime());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_03), "", item.getXike_num());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
127
app/src/main/java/com/fenghoo/seven/main/entity/LoginBean.java
Normal file
127
app/src/main/java/com/fenghoo/seven/main/entity/LoginBean.java
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.fenghoo.seven.main.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LoginBean implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* msg : 登陆成功
|
||||
* data : {"store_id":"1","industry_name":"家具","user_head":"","user_type":"2","user_name":"admin","phone_number":"18629010714","uuid":"1","status":"0"}
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
private int success;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public DataBean getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataBean data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* store_id : 1
|
||||
* industry_name : 家具
|
||||
* user_head :
|
||||
* user_type : 2
|
||||
* user_name : admin
|
||||
* phone_number : 18629010714
|
||||
* uuid : 1
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private String store_id;
|
||||
private String industry_name;
|
||||
private String user_head;
|
||||
private String user_type;
|
||||
private String user_name;
|
||||
private String phone_number;
|
||||
private String uuid;
|
||||
private String status;
|
||||
|
||||
public String getStore_id() {
|
||||
return store_id;
|
||||
}
|
||||
|
||||
public void setStore_id(String store_id) {
|
||||
this.store_id = store_id;
|
||||
}
|
||||
|
||||
public String getIndustry_name() {
|
||||
return industry_name;
|
||||
}
|
||||
|
||||
public void setIndustry_name(String industry_name) {
|
||||
this.industry_name = industry_name;
|
||||
}
|
||||
|
||||
public String getUser_head() {
|
||||
return user_head;
|
||||
}
|
||||
|
||||
public void setUser_head(String user_head) {
|
||||
this.user_head = user_head;
|
||||
}
|
||||
|
||||
public String getUser_type() {
|
||||
return user_type;
|
||||
}
|
||||
|
||||
public void setUser_type(String user_type) {
|
||||
this.user_type = user_type;
|
||||
}
|
||||
|
||||
public String getUser_name() {
|
||||
return user_name;
|
||||
}
|
||||
|
||||
public void setUser_name(String user_name) {
|
||||
this.user_name = user_name;
|
||||
}
|
||||
|
||||
public String getPhone_number() {
|
||||
return phone_number;
|
||||
}
|
||||
|
||||
public void setPhone_number(String phone_number) {
|
||||
this.phone_number = phone_number;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.fenghoo.seven.main.entity;
|
||||
|
||||
public class Savaselect {
|
||||
private String serchuid="";
|
||||
|
||||
public String getSerchuid() {
|
||||
return serchuid;
|
||||
}
|
||||
|
||||
public void setSerchuid(String serchuid) {
|
||||
this.serchuid = serchuid;
|
||||
}
|
||||
|
||||
public String getUser_name() {
|
||||
return user_name;
|
||||
}
|
||||
|
||||
public void setUser_name(String user_name) {
|
||||
this.user_name = user_name;
|
||||
}
|
||||
|
||||
private String user_name="";
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.fenghoo.seven.main.entity;
|
||||
|
||||
public class SendSmsBean {
|
||||
|
||||
|
||||
/**
|
||||
* result : {"msg":"发送成功","success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 发送成功
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int success;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.fenghoo.seven.main.entity;
|
||||
|
||||
import com.fenghoo.seven.base.BaseBean;
|
||||
|
||||
/**
|
||||
* 项目名:NewJiaJieSong
|
||||
* 包名:com.example.administrator.newjiajiesong
|
||||
* 创建者:任剑波
|
||||
* 创建时间:2018/8/28 11:14
|
||||
* 描述:TODO
|
||||
*/
|
||||
public class UserInfoModel extends BaseBean {
|
||||
|
||||
/**
|
||||
* status : 0
|
||||
* result : {"success":0,"msg":"登陆成功","data":{"store_name":"红星美凯龙太白店荣麟京瓷","uuid":"0a10f99c198b3cb659a62a765c83c648","phone_number":"13201532560","pet_name":"胡坚强","user_birthday":"","user_head":"http://www.fenghoo.cn/templates/fenghu/img/photo_icon.png","type":"1"}}
|
||||
*/
|
||||
|
||||
private int status;
|
||||
private ResultBean result;
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LoginRestwo{" +
|
||||
"status=" + status +
|
||||
", result=" + result +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class ResultBean{
|
||||
/**
|
||||
* success : 0
|
||||
* msg : 登陆成功
|
||||
* data : {"store_name":"红星美凯龙太白店荣麟京瓷","uuid":"0a10f99c198b3cb659a62a765c83c648","phone_number":"13201532560","pet_name":"胡坚强","user_birthday":"","user_head":"http://www.fenghoo.cn/templates/fenghu/img/photo_icon.png","type":"1"}
|
||||
*/
|
||||
|
||||
private int success;
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public DataBean getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataBean data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ResultBean{" +
|
||||
"success=" + success +
|
||||
", msg='" + msg + '\'' +
|
||||
", data=" + data +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class DataBean{
|
||||
/**
|
||||
* store_name : 红星美凯龙太白店荣麟京瓷
|
||||
* uuid : 0a10f99c198b3cb659a62a765c83c648
|
||||
* phone_number : 13201532560
|
||||
* pet_name : 胡坚强
|
||||
* user_birthday :
|
||||
* user_head : http://www.fenghoo.cn/templates/fenghu/img/photo_icon.png
|
||||
* type : 1
|
||||
*/
|
||||
|
||||
private String store_name;
|
||||
private String uuid;
|
||||
private String phone_number;
|
||||
private String pet_name;
|
||||
private String user_birthday;
|
||||
private String user_head;
|
||||
private String type;
|
||||
|
||||
public String getStore_name() {
|
||||
return store_name;
|
||||
}
|
||||
|
||||
public void setStore_name(String store_name) {
|
||||
this.store_name = store_name;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getPhone_number() {
|
||||
return phone_number;
|
||||
}
|
||||
|
||||
public void setPhone_number(String phone_number) {
|
||||
this.phone_number = phone_number;
|
||||
}
|
||||
|
||||
public String getPet_name() {
|
||||
return pet_name;
|
||||
}
|
||||
|
||||
public void setPet_name(String pet_name) {
|
||||
this.pet_name = pet_name;
|
||||
}
|
||||
|
||||
public String getUser_birthday() {
|
||||
return user_birthday;
|
||||
}
|
||||
|
||||
public void setUser_birthday(String user_birthday) {
|
||||
this.user_birthday = user_birthday;
|
||||
}
|
||||
|
||||
public String getUser_head() {
|
||||
return user_head;
|
||||
}
|
||||
|
||||
public void setUser_head(String user_head) {
|
||||
this.user_head = user_head;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DataBean{" +
|
||||
"store_name='" + store_name + '\'' +
|
||||
", uuid='" + uuid + '\'' +
|
||||
", phone_number='" + phone_number + '\'' +
|
||||
", pet_name='" + pet_name + '\'' +
|
||||
", user_birthday='" + user_birthday + '\'' +
|
||||
", user_head='" + user_head + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.fenghoo.seven.main.entity;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class XikeInfoBean extends BaseModel {
|
||||
|
||||
|
||||
/**
|
||||
* result : {"msg":"获取成功","xike":"98","data":[{"xike_remark":"待完善客户超时","time":"2020-07-17 13:34:33","xike_num":"-1"}],"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 获取成功
|
||||
* xike : 98
|
||||
* data : [{"xike_remark":"待完善客户超时","time":"2020-07-17 13:34:33","xike_num":"-1"}]
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private String xike;
|
||||
private int success;
|
||||
private List<DataBean> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getXike() {
|
||||
return xike;
|
||||
}
|
||||
|
||||
public void setXike(String xike) {
|
||||
this.xike = xike;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* xike_remark : 待完善客户超时
|
||||
* time : 2020-07-17 13:34:33
|
||||
* xike_num : -1
|
||||
*/
|
||||
|
||||
private String xike_remark;
|
||||
private String time;
|
||||
private String xike_num;
|
||||
|
||||
public String getXike_remark() {
|
||||
return xike_remark;
|
||||
}
|
||||
|
||||
public void setXike_remark(String xike_remark) {
|
||||
this.xike_remark = xike_remark;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getXike_num() {
|
||||
return xike_num;
|
||||
}
|
||||
|
||||
public void setXike_num(String xike_num) {
|
||||
this.xike_num = xike_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
public class InboundHistoryResBean {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
|
||||
public class MessageNoticeResBean {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
public class OutboundHistoryResBean {
|
||||
}
|
||||
@@ -0,0 +1,581 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* TreeUserEntity
|
||||
* (๑• . •๑)
|
||||
* 类描述:用户资料实体类
|
||||
* Created by LeiXiaoXing on 2017/4/11 10:56
|
||||
*/
|
||||
|
||||
public class TreeUserEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* id : eb4a5d4f6ded79f8b0bb09c895fc13fd
|
||||
* student_id : 10006496
|
||||
* im_identifier : a87ff679a2f3e71d9181a67b7542122c
|
||||
* im_user_sig : eJxljktPg0AUhff8CsLa6DwYHu4UpIEWBWlrZEPGebSTKox02rQ1-ncVm0ji3X7fOed*WLZtO-NZdUkZ63atacxRC8e*th3gXPxBrRVvqGlwz-9BcdCqFw2VRvQDhIQQBMDYUVy0Rkl1NmjgS*n5IUUSCx-yEAaQev6LT1wEEWKj5JZvmmH*t9r97kWB5*KxolYDzO*eo7SMimn0UDOeJCYuwXK*fs0EOLiQcB1PbhmNVpNFUIcKpnWZrm*m7318Yo*brDqJqqSFyxa5vzvm912VoT3OxbJ4ujI6mcliNGnUmzg-FBLoeRiQEd2Lfqu6dhAQgAQiDH7OsT6tLzv6YyM_
|
||||
* sig_expire_time : 1510718305
|
||||
* member_id : 4
|
||||
* recommend_id : 0
|
||||
* nick_name : 雷小星
|
||||
* squad_id : 19
|
||||
* class_manage_id : 1
|
||||
* class_last_time : 1497758305
|
||||
* position : 酱油
|
||||
* job : 打酱油
|
||||
* telephone : 10086
|
||||
* province_id : 44
|
||||
* province : 广东
|
||||
* city_id : 4401
|
||||
* city : 广州
|
||||
* district_id : 440101
|
||||
* district : 市辖区
|
||||
* address : 高德置地
|
||||
* openid : 0
|
||||
* unionid : 0
|
||||
* wx_info_id : 0
|
||||
* integral : 860
|
||||
* recommendnum : 0
|
||||
* role : 1
|
||||
*
|
||||
* is_study : 0
|
||||
* add_time : 1495166305
|
||||
* phone : 13628310040
|
||||
* is_bind_wechat : 1
|
||||
* im_group_id : ab97e028a5aae8d637cb1a70569638d7
|
||||
* number : 549111
|
||||
* class_name : 婆婆破
|
||||
* membernum : 49
|
||||
* intro : 口号啥的不重要吗好尴尬
|
||||
* mission : 使命啥的也不重要吗?
|
||||
* slogan : 重要的是看班级口号牛不牛吗SOHO哦寂寞
|
||||
* thumb : 20170526/5927c0931333d.jpg
|
||||
* wx_nick_name :
|
||||
* vip_level : 0
|
||||
* vip_last_time
|
||||
* uid : 4
|
||||
* origin_img : /Uploads/app_user_head_img/origin/20170519/591e6de477393.png
|
||||
* Home_Page_Size : /Uploads/app_user_head_img/Home_Page_Size/20170519/591e6de477393.png
|
||||
* info_page_size : /Uploads/app_user_head_img/info_page_size/20170519/591e6de477393.png
|
||||
* user_list_size : /Uploads/app_user_head_img/user_list_size/20170519/591e6de477393.png
|
||||
* user_token : eb4a5d4f6ded79f8b0bb09c895fc13fd
|
||||
* squad_im_group_id : 9b8a64a9b23d58fb021e0b2d20405b09
|
||||
* squad_name : 神
|
||||
*/
|
||||
|
||||
private String id;
|
||||
private String student_id;
|
||||
private String im_identifier;
|
||||
private String im_user_sig;
|
||||
private String sig_expire_time;
|
||||
private String member_id;
|
||||
private String recommend_id;
|
||||
private String nick_name;
|
||||
private String squad_id;
|
||||
private String class_manage_id;
|
||||
private String class_last_time;
|
||||
private String position;
|
||||
private String job;
|
||||
private String telephone;
|
||||
private String province_id;
|
||||
private String province;
|
||||
private String city_id;
|
||||
private String city;
|
||||
private String district_id;
|
||||
private String district;
|
||||
private String address;
|
||||
private String openid;
|
||||
private String unionid;
|
||||
private String wx_info_id;
|
||||
private String integral;
|
||||
private String recommendnum;
|
||||
private String role;
|
||||
private String role_1;
|
||||
private String role_2;
|
||||
private String role_3;
|
||||
private String role_4;
|
||||
private String role_5;
|
||||
private String is_study;
|
||||
private String add_time;
|
||||
private String phone;
|
||||
private String is_bind_wechat;
|
||||
private String im_group_id;
|
||||
private String number;
|
||||
private String class_name;
|
||||
private String membernum;
|
||||
private String intro;
|
||||
private String mission;
|
||||
private String slogan;
|
||||
private String thumb;
|
||||
private String wx_nick_name;
|
||||
private String vip_level;
|
||||
private String vip_last_time;
|
||||
private String uid;
|
||||
private String origin_img;
|
||||
private String Home_Page_Size;
|
||||
private String info_page_size;
|
||||
private String user_list_size;
|
||||
private String user_token;
|
||||
private String squad_im_group_id;
|
||||
private String squad_name;
|
||||
private String vip_log_id;
|
||||
private String default_live_id;
|
||||
|
||||
public String getDefault_live_id() {
|
||||
return default_live_id;
|
||||
}
|
||||
|
||||
public void setDefault_live_id(String default_live_id) {
|
||||
this.default_live_id = default_live_id;
|
||||
}
|
||||
|
||||
public String getVip_log_id() {
|
||||
return vip_log_id;
|
||||
}
|
||||
|
||||
public void setVip_log_id(String vip_log_id) {
|
||||
this.vip_log_id = vip_log_id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStudent_id() {
|
||||
return student_id;
|
||||
}
|
||||
|
||||
public void setStudent_id(String student_id) {
|
||||
this.student_id = student_id;
|
||||
}
|
||||
|
||||
public String getIm_identifier() {
|
||||
return im_identifier;
|
||||
}
|
||||
|
||||
public void setIm_identifier(String im_identifier) {
|
||||
this.im_identifier = im_identifier;
|
||||
}
|
||||
|
||||
public String getIm_user_sig() {
|
||||
return im_user_sig;
|
||||
}
|
||||
|
||||
public void setIm_user_sig(String im_user_sig) {
|
||||
this.im_user_sig = im_user_sig;
|
||||
}
|
||||
|
||||
public String getSig_expire_time() {
|
||||
return sig_expire_time;
|
||||
}
|
||||
|
||||
public void setSig_expire_time(String sig_expire_time) {
|
||||
this.sig_expire_time = sig_expire_time;
|
||||
}
|
||||
|
||||
public String getMember_id() {
|
||||
return member_id;
|
||||
}
|
||||
|
||||
public void setMember_id(String member_id) {
|
||||
this.member_id = member_id;
|
||||
}
|
||||
|
||||
public String getRecommend_id() {
|
||||
return recommend_id;
|
||||
}
|
||||
|
||||
public void setRecommend_id(String recommend_id) {
|
||||
this.recommend_id = recommend_id;
|
||||
}
|
||||
|
||||
public String getNick_name() {
|
||||
return nick_name;
|
||||
}
|
||||
|
||||
public void setNick_name(String nick_name) {
|
||||
this.nick_name = nick_name;
|
||||
}
|
||||
|
||||
public String getSquad_id() {
|
||||
return squad_id;
|
||||
}
|
||||
|
||||
public void setSquad_id(String squad_id) {
|
||||
this.squad_id = squad_id;
|
||||
}
|
||||
|
||||
public String getClass_manage_id() {
|
||||
return class_manage_id;
|
||||
}
|
||||
|
||||
public void setClass_manage_id(String class_manage_id) {
|
||||
this.class_manage_id = class_manage_id;
|
||||
}
|
||||
|
||||
public String getClass_last_time() {
|
||||
return class_last_time;
|
||||
}
|
||||
|
||||
public void setClass_last_time(String class_last_time) {
|
||||
this.class_last_time = class_last_time;
|
||||
}
|
||||
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(String position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getJob() {
|
||||
return job;
|
||||
}
|
||||
|
||||
public void setJob(String job) {
|
||||
this.job = job;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public String getProvince_id() {
|
||||
return province_id;
|
||||
}
|
||||
|
||||
public void setProvince_id(String province_id) {
|
||||
this.province_id = province_id;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getCity_id() {
|
||||
return city_id;
|
||||
}
|
||||
|
||||
public void setCity_id(String city_id) {
|
||||
this.city_id = city_id;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getDistrict_id() {
|
||||
return district_id;
|
||||
}
|
||||
|
||||
public void setDistrict_id(String district_id) {
|
||||
this.district_id = district_id;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public String getUnionid() {
|
||||
return unionid;
|
||||
}
|
||||
|
||||
public void setUnionid(String unionid) {
|
||||
this.unionid = unionid;
|
||||
}
|
||||
|
||||
public String getWx_info_id() {
|
||||
return wx_info_id;
|
||||
}
|
||||
|
||||
public void setWx_info_id(String wx_info_id) {
|
||||
this.wx_info_id = wx_info_id;
|
||||
}
|
||||
|
||||
public String getIntegral() {
|
||||
return integral;
|
||||
}
|
||||
|
||||
public void setIntegral(String integral) {
|
||||
this.integral = integral;
|
||||
}
|
||||
|
||||
public String getRecommendnum() {
|
||||
return recommendnum;
|
||||
}
|
||||
|
||||
public void setRecommendnum(String recommendnum) {
|
||||
this.recommendnum = recommendnum;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public String getRole_1() {
|
||||
return role_1;
|
||||
}
|
||||
|
||||
public void setRole_1(String role_1) {
|
||||
this.role_1 = role_1;
|
||||
}
|
||||
|
||||
public String getRole_2() {
|
||||
return role_2;
|
||||
}
|
||||
|
||||
public void setRole_2(String role_2) {
|
||||
this.role_2 = role_2;
|
||||
}
|
||||
|
||||
public String getRole_3() {
|
||||
return role_3;
|
||||
}
|
||||
|
||||
public void setRole_3(String role_3) {
|
||||
this.role_3 = role_3;
|
||||
}
|
||||
|
||||
public String getRole_4() {
|
||||
return role_4;
|
||||
}
|
||||
|
||||
public void setRole_4(String role_4) {
|
||||
this.role_4 = role_4;
|
||||
}
|
||||
|
||||
public String getRole_5() {
|
||||
return role_5;
|
||||
}
|
||||
|
||||
public void setRole_5(String role_5) {
|
||||
this.role_5 = role_5;
|
||||
}
|
||||
|
||||
public String getIs_study() {
|
||||
return is_study;
|
||||
}
|
||||
|
||||
public void setIs_study(String is_study) {
|
||||
this.is_study = is_study;
|
||||
}
|
||||
|
||||
public String getAdd_time() {
|
||||
return add_time;
|
||||
}
|
||||
|
||||
public void setAdd_time(String add_time) {
|
||||
this.add_time = add_time;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getIs_bind_wechat() {
|
||||
return is_bind_wechat;
|
||||
}
|
||||
|
||||
public void setIs_bind_wechat(String is_bind_wechat) {
|
||||
this.is_bind_wechat = is_bind_wechat;
|
||||
}
|
||||
|
||||
public String getIm_group_id() {
|
||||
return im_group_id;
|
||||
}
|
||||
|
||||
public void setIm_group_id(String im_group_id) {
|
||||
this.im_group_id = im_group_id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getClass_name() {
|
||||
return class_name;
|
||||
}
|
||||
|
||||
public void setClass_name(String class_name) {
|
||||
this.class_name = class_name;
|
||||
}
|
||||
|
||||
public String getMembernum() {
|
||||
return membernum;
|
||||
}
|
||||
|
||||
public void setMembernum(String membernum) {
|
||||
this.membernum = membernum;
|
||||
}
|
||||
|
||||
public String getIntro() {
|
||||
return intro;
|
||||
}
|
||||
|
||||
public void setIntro(String intro) {
|
||||
this.intro = intro;
|
||||
}
|
||||
|
||||
public String getMission() {
|
||||
return mission;
|
||||
}
|
||||
|
||||
public void setMission(String mission) {
|
||||
this.mission = mission;
|
||||
}
|
||||
|
||||
public String getSlogan() {
|
||||
return slogan;
|
||||
}
|
||||
|
||||
public void setSlogan(String slogan) {
|
||||
this.slogan = slogan;
|
||||
}
|
||||
|
||||
public String getThumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public void setThumb(String thumb) {
|
||||
this.thumb = thumb;
|
||||
}
|
||||
|
||||
public String getWx_nick_name() {
|
||||
return wx_nick_name;
|
||||
}
|
||||
|
||||
public void setWx_nick_name(String wx_nick_name) {
|
||||
this.wx_nick_name = wx_nick_name;
|
||||
}
|
||||
|
||||
public String getVip_level() {
|
||||
return vip_level;
|
||||
}
|
||||
|
||||
public void setVip_level(String vip_level) {
|
||||
this.vip_level = vip_level;
|
||||
}
|
||||
|
||||
public String getVip_last_time() {
|
||||
return vip_last_time;
|
||||
}
|
||||
|
||||
public void setVip_last_time(String vip_last_time) {
|
||||
this.vip_last_time = vip_last_time;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getOrigin_img() {
|
||||
return origin_img;
|
||||
}
|
||||
|
||||
public void setOrigin_img(String origin_img) {
|
||||
this.origin_img = origin_img;
|
||||
}
|
||||
|
||||
public String getHome_Page_Size() {
|
||||
return Home_Page_Size;
|
||||
}
|
||||
|
||||
public void setHome_Page_Size(String Home_Page_Size) {
|
||||
this.Home_Page_Size = Home_Page_Size;
|
||||
}
|
||||
|
||||
public String getInfo_page_size() {
|
||||
return info_page_size;
|
||||
}
|
||||
|
||||
public void setInfo_page_size(String info_page_size) {
|
||||
this.info_page_size = info_page_size;
|
||||
}
|
||||
|
||||
public String getUser_list_size() {
|
||||
return user_list_size;
|
||||
}
|
||||
|
||||
public void setUser_list_size(String user_list_size) {
|
||||
this.user_list_size = user_list_size;
|
||||
}
|
||||
|
||||
public String getUser_token() {
|
||||
return user_token;
|
||||
}
|
||||
|
||||
public void setUser_token(String user_token) {
|
||||
this.user_token = user_token;
|
||||
}
|
||||
|
||||
public String getSquad_im_group_id() {
|
||||
return squad_im_group_id;
|
||||
}
|
||||
|
||||
public void setSquad_im_group_id(String squad_im_group_id) {
|
||||
this.squad_im_group_id = squad_im_group_id;
|
||||
}
|
||||
|
||||
public String getSquad_name() {
|
||||
return squad_name;
|
||||
}
|
||||
|
||||
public void setSquad_name(String squad_name) {
|
||||
this.squad_name = squad_name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
/**
|
||||
* UserHeadEntity
|
||||
* (๑• . •๑)
|
||||
* 类描述: 修改头像成功后返回的实体类
|
||||
* Created by LeiXiaoXing on 2017/4/28 11:20
|
||||
*/
|
||||
|
||||
public class UserHeadEntity {
|
||||
|
||||
/**
|
||||
* 图片原图路径
|
||||
* origin : /Uploads/app_user_head_img/origin/20170428/5902b4f7c2b69.png
|
||||
* 主页使用的尺寸路径
|
||||
* Home_Page_Size : /Uploads/app_user_head_img/Home_Page_Size/20170428/5902b4f7c2b69.png
|
||||
* 个人信息使用尺寸路径
|
||||
* info_page_size : /Uploads/app_user_head_img/info_page_size/20170428/5902b4f7c2b69.png
|
||||
* 通讯录头像使用尺寸路径
|
||||
* user_list_size : /Uploads/app_user_head_img/user_list_size/20170428/5902b4f7c2b69.png
|
||||
*/
|
||||
|
||||
private String origin;
|
||||
private String Home_Page_Size;
|
||||
private String info_page_size;
|
||||
private String user_list_size;
|
||||
private String classThumb;//班级头像
|
||||
|
||||
public String getOrigin() {
|
||||
return origin;
|
||||
}
|
||||
|
||||
public void setOrigin(String origin) {
|
||||
this.origin = origin;
|
||||
}
|
||||
|
||||
public String getHome_Page_Size() {
|
||||
return Home_Page_Size;
|
||||
}
|
||||
|
||||
public void setHome_Page_Size(String Home_Page_Size) {
|
||||
this.Home_Page_Size = Home_Page_Size;
|
||||
}
|
||||
|
||||
public String getInfo_page_size() {
|
||||
return info_page_size;
|
||||
}
|
||||
|
||||
public void setInfo_page_size(String info_page_size) {
|
||||
this.info_page_size = info_page_size;
|
||||
}
|
||||
|
||||
public String getUser_list_size() {
|
||||
return user_list_size;
|
||||
}
|
||||
|
||||
public void setUser_list_size(String user_list_size) {
|
||||
this.user_list_size = user_list_size;
|
||||
}
|
||||
|
||||
public String getClassThumb() {
|
||||
return classThumb;
|
||||
}
|
||||
|
||||
public void setClassThumb(String classThumb) {
|
||||
this.classThumb = classThumb;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
/**
|
||||
* WeChatLoginEntity
|
||||
* (๑• . •๑)
|
||||
* 类描述: 微信登陆所需资料
|
||||
* Created by LeiXiaoXing on 2017/5/24 10:41
|
||||
*/
|
||||
|
||||
public class WeChatLoginEntity {
|
||||
|
||||
private String open_id;
|
||||
private String nickname;
|
||||
private String headimgurl;
|
||||
private String sex;
|
||||
private String union_id;
|
||||
|
||||
public String getOpen_id() {
|
||||
return open_id;
|
||||
}
|
||||
|
||||
public void setOpen_id(String open_id) {
|
||||
this.open_id = open_id;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimgurl;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimgurl = headimg;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getUnion_id() {
|
||||
return union_id;
|
||||
}
|
||||
|
||||
public void setUnion_id(String union_id) {
|
||||
this.union_id = union_id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WeChatLoginEntity{" +
|
||||
"nickname='" + nickname + '\'' +
|
||||
", headimg='" + headimgurl + '\'' +
|
||||
", sex='" + sex + '\'' +
|
||||
", union_id='" + union_id + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
/**
|
||||
* WeChatLoginResultEntity
|
||||
* (๑• . •๑)
|
||||
* 类描述:
|
||||
* Created by LeiXiaoXing on 2017/5/24 15:27
|
||||
*/
|
||||
|
||||
public class WeChatLoginResultEntity {
|
||||
|
||||
/**
|
||||
* access_token : 3fSyQQZMvezLXmmIqNqtXCBykOuoj6rsCBYLFTmGEGRiQEqoPeSXpswAfpUL9B76njcO4ZYhpHoCipjXdeLUKWn_qJ5YTKJHOzitN3cOOdk
|
||||
* expires_in : 7200
|
||||
* refresh_token : 2g6BVOcR1kPnE7e4aLV2trkOcsnnnECckv5RgUCm6k02-1AU22Jnxyntnjo6jHZQ7WLwYY1f0Zil9cD_MhTaWY0dn5T_D1Zm1IcfSdvBrR0
|
||||
* openid : oBBMzxK0-pNE5Jcstak1-QkoDtho
|
||||
* scope : snsapi_userinfo
|
||||
* unionid : oKqk-w7GJhuKe_7XKdvETXG5qhYg
|
||||
*/
|
||||
|
||||
private String access_token;
|
||||
private int expires_in;
|
||||
private String refresh_token;
|
||||
private String openid;
|
||||
private String scope;
|
||||
private String unionid;
|
||||
|
||||
public String getAccess_token() {
|
||||
return access_token;
|
||||
}
|
||||
|
||||
public void setAccess_token(String access_token) {
|
||||
this.access_token = access_token;
|
||||
}
|
||||
|
||||
public int getExpires_in() {
|
||||
return expires_in;
|
||||
}
|
||||
|
||||
public void setExpires_in(int expires_in) {
|
||||
this.expires_in = expires_in;
|
||||
}
|
||||
|
||||
public String getRefresh_token() {
|
||||
return refresh_token;
|
||||
}
|
||||
|
||||
public void setRefresh_token(String refresh_token) {
|
||||
this.refresh_token = refresh_token;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getUnionid() {
|
||||
return unionid;
|
||||
}
|
||||
|
||||
public void setUnionid(String unionid) {
|
||||
this.unionid = unionid;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationClientOption;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.zaaach.citypicker.CityPicker;
|
||||
import com.zaaach.citypicker.adapter.OnPickListener;
|
||||
import com.zaaach.citypicker.model.City;
|
||||
import com.zaaach.citypicker.model.HotCity;
|
||||
import com.zaaach.citypicker.model.LocateState;
|
||||
import com.zaaach.citypicker.model.LocatedCity;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class CloundSolutionActivity extends BaseActivity implements View.OnClickListener, AMapLocationListener {
|
||||
|
||||
private List<HotCity> hotCities;
|
||||
private int anim;
|
||||
private boolean enable;
|
||||
|
||||
|
||||
private TextView titleTv;
|
||||
private ImageView backIv;
|
||||
|
||||
/**
|
||||
* 西安
|
||||
*/
|
||||
private TextView mChengshi;
|
||||
|
||||
//声明AMapLocationClient类对象,定位发起端
|
||||
private AMapLocationClient mLocationClient = null;
|
||||
//声明mLocationOption对象,定位参数
|
||||
public AMapLocationClientOption mLocationOption = null;
|
||||
//标识,用于判断是否只显示一次定位信息和用户重新定位
|
||||
private boolean isFirstLoc = true;
|
||||
private String city;
|
||||
private String province;
|
||||
private String cityCode;
|
||||
private String adCode;
|
||||
private View view;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_clound_solution);
|
||||
initView();
|
||||
// HotCity();
|
||||
//开始定位
|
||||
// location();
|
||||
}
|
||||
|
||||
private void HotCity() {
|
||||
hotCities = new ArrayList<>();
|
||||
hotCities.add(new HotCity("北京", "北京", "101010100"));
|
||||
hotCities.add(new HotCity("上海", "上海", "101020100"));
|
||||
hotCities.add(new HotCity("广州", "广东", "101280101"));
|
||||
hotCities.add(new HotCity("深圳", "广东", "101280601"));
|
||||
hotCities.add(new HotCity("杭州", "浙江", "101210101"));
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
mChengshi = (TextView) findViewById(R.id.chengshi);
|
||||
mChengshi.setOnClickListener(this);
|
||||
view = (View) findViewById(R.id.view);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.leftIv:
|
||||
finish();
|
||||
break;
|
||||
case R.id.chengshi:
|
||||
CityPicker.from(CloundSolutionActivity.this)
|
||||
.enableAnimation(enable)
|
||||
.setAnimationStyle(anim)
|
||||
.setLocatedCity(null)
|
||||
.setHotCities(hotCities)
|
||||
.setOnPickListener(new OnPickListener() {
|
||||
@Override
|
||||
public void onPick(int position, City data) {
|
||||
// mDangqianchengshi.setText(String.format("当前城市:%s,%s", data.getName(), data.getCode()));
|
||||
mChengshi.setText(String.format(data.getName()));
|
||||
Toast.makeText(
|
||||
getApplicationContext(),
|
||||
String.format("点击的数据:%s,%s", data.getName(), data.getCode()),
|
||||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
Toast.makeText(getApplicationContext(), "取消选择", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocate() {
|
||||
//开始定位,这里模拟一下定位
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CityPicker.from(CloundSolutionActivity.this).locateComplete(new LocatedCity(city, province, adCode), LocateState.SUCCESS);
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
.show();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void location() {
|
||||
//初始化定位
|
||||
mLocationClient = new AMapLocationClient(getApplicationContext());
|
||||
//设置定位回调监听
|
||||
mLocationClient.setLocationListener(this);
|
||||
//初始化定位参数
|
||||
mLocationOption = new AMapLocationClientOption();
|
||||
//设置定位模式为Hight_Accuracy高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
|
||||
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||
//设置是否返回地址信息(默认返回地址信息)
|
||||
mLocationOption.setNeedAddress(true);
|
||||
//设置是否只定位一次,默认为false
|
||||
mLocationOption.setOnceLocation(false);
|
||||
//设置是否强制刷新WIFI,默认为强制刷新
|
||||
mLocationOption.setWifiActiveScan(true);
|
||||
//设置是否允许模拟位置,默认为false,不允许模拟位置
|
||||
mLocationOption.setMockEnable(false);
|
||||
//设置定位间隔,单位毫秒,默认为2000ms
|
||||
mLocationOption.setInterval(2000);
|
||||
//给定位客户端对象设置定位参数
|
||||
mLocationClient.setLocationOption(mLocationOption);
|
||||
//启动定位
|
||||
mLocationClient.startLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(AMapLocation aMapLocation) {
|
||||
if (aMapLocation != null) {
|
||||
if (aMapLocation.getErrorCode() == 0) {
|
||||
//定位成功回调信息,设置相关消息
|
||||
aMapLocation.getLocationType();//获取当前定位结果来源,如网络定位结果,详见官方定位类型表
|
||||
aMapLocation.getLatitude();//获取纬度
|
||||
aMapLocation.getLongitude();//获取经度
|
||||
aMapLocation.getAccuracy();//获取精度信息
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date(aMapLocation.getTime());
|
||||
df.format(date);//定位时间
|
||||
aMapLocation.getAddress();//地址,如果option中设置isNeedAddress为false,则没有此结果,网络定位结果中会有地址信息,GPS定位不返回地址信息。
|
||||
aMapLocation.getCountry();//国家信息
|
||||
aMapLocation.getProvince();//省信息
|
||||
aMapLocation.getCity();//城市信息
|
||||
aMapLocation.getDistrict();//城区信息
|
||||
aMapLocation.getStreet();//街道信息
|
||||
aMapLocation.getStreetNum();//街道门牌号信息
|
||||
aMapLocation.getCityCode();//城市编码
|
||||
aMapLocation.getAdCode();//地区编码
|
||||
|
||||
// 如果不设置标志位,此时再拖动地图时,它会不断将地图移动到当前的位置
|
||||
if (isFirstLoc) {
|
||||
//获取定位信息
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append(aMapLocation.getCountry() + ""
|
||||
+ aMapLocation.getProvince() + ""
|
||||
+ aMapLocation.getCity() + ""
|
||||
+ aMapLocation.getProvince() + ""
|
||||
+ aMapLocation.getDistrict() + ""
|
||||
+ aMapLocation.getStreet() + ""
|
||||
+ aMapLocation.getStreetNum());
|
||||
Toast.makeText(getApplicationContext(), buffer.toString(), Toast.LENGTH_LONG).show();
|
||||
|
||||
city = aMapLocation.getCity();
|
||||
mChengshi.setText(city);
|
||||
province = aMapLocation.getProvince();
|
||||
cityCode = aMapLocation.getCityCode();
|
||||
adCode = aMapLocation.getAdCode();
|
||||
isFirstLoc = false;
|
||||
mLocationClient.stopLocation();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//显示错误信息ErrCode是错误码,errInfo是错误信息,详见错误码表。
|
||||
Log.e("AmapError", "location Error, ErrCode:"
|
||||
+ aMapLocation.getErrorCode() + ", errInfo:"
|
||||
+ aMapLocation.getErrorInfo());
|
||||
Toast.makeText(getApplicationContext(), "定位失败", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.main.find.ui.CommentFragment;
|
||||
import com.fenghoo.seven.widget.TitleBar;
|
||||
|
||||
/**
|
||||
* 评论
|
||||
*/
|
||||
public class CommentActivity extends BaseActivity {
|
||||
|
||||
private TitleBar mTitleBar;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_comment);
|
||||
mTitleBar = findViewById(R.id.title_bar);
|
||||
initNormalBack();
|
||||
String num = getIntent().getStringExtra("num");
|
||||
mTitleBar.setTitle("新评论"+"("+num+")");
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.container,new CommentFragment()).commit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.widget.TitleBar;
|
||||
|
||||
/**
|
||||
* 会话
|
||||
*/
|
||||
public class ConversationActivity extends BaseActivity {
|
||||
private TitleBar mTitleBar;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_conversation);
|
||||
mTitleBar = findViewById(R.id.title_bar);
|
||||
initNormalBack();
|
||||
String num = getIntent().getStringExtra("num");
|
||||
mTitleBar.setTitle("抖音昵称"+"**");
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.container,new QuestionsFragment()).commit();
|
||||
}
|
||||
}
|
||||
112
app/src/main/java/com/fenghoo/seven/main/find/FindFragment.java
Normal file
112
app/src/main/java/com/fenghoo/seven/main/find/FindFragment.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.find.ui.FindFragmenttwo;
|
||||
import com.fenghoo.seven.main.kehu.activity.ShowAty;
|
||||
import com.fenghoo.seven.test.BaseFragment;
|
||||
import com.zaaach.citypicker.model.HotCity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发现
|
||||
*/
|
||||
public class FindFragment extends BaseFragment {
|
||||
private int anim;
|
||||
private boolean enable;
|
||||
private List<HotCity> hotCities;
|
||||
private String city;
|
||||
private String province;
|
||||
private String adCode;
|
||||
Context mContext;
|
||||
View view;
|
||||
private RelativeLayout rl_privateletter;
|
||||
private String pagetype="0";//0是家居 1是私信
|
||||
private RelativeLayout dianpubuju;
|
||||
private LinearLayout dianyuanbuju;
|
||||
private TextView marking_fragment;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mContext = getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
if (view != null) {
|
||||
ViewGroup parent = (ViewGroup) view.getParent();
|
||||
if (parent != null) {
|
||||
parent.removeView(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
view = inflater.inflate(R.layout.criclefragment, container, false);
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.container,new FindFragmenttwo()).commit();
|
||||
initView(view);
|
||||
HotCity();
|
||||
return view;
|
||||
}
|
||||
private void HotCity() {
|
||||
hotCities = new ArrayList<>();
|
||||
hotCities.add(new HotCity("北京", "北京", "101010100"));
|
||||
hotCities.add(new HotCity("上海", "上海", "101020100"));
|
||||
hotCities.add(new HotCity("广州", "广东", "101280101"));
|
||||
hotCities.add(new HotCity("深圳", "广东", "101280601"));
|
||||
hotCities.add(new HotCity("杭州", "浙江", "101210101"));
|
||||
}
|
||||
|
||||
private void initView(View mContentView) {
|
||||
marking_fragment = (TextView)view.findViewById(R.id.marking_fragment);
|
||||
dianpubuju = (RelativeLayout)view.findViewById(R.id.dianpubuju);
|
||||
dianyuanbuju = (LinearLayout)view.findViewById(R.id.dianyuanbuju);
|
||||
rl_privateletter = (RelativeLayout)view.findViewById(R.id.rl_privateletter);
|
||||
rl_privateletter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(pagetype.equals("0")){
|
||||
pagetype="1";
|
||||
dianpubuju.setVisibility(View.GONE);
|
||||
dianyuanbuju.setVisibility(View.VISIBLE);
|
||||
|
||||
}else {
|
||||
pagetype="0";
|
||||
dianpubuju.setVisibility(View.VISIBLE);
|
||||
dianyuanbuju.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
PriLetFragment priLetFragment = (PriLetFragment) getChildFragmentManager().findFragmentById(R.id.news_title_fragment);
|
||||
priLetFragment.cutover(new PriLetFragment.ClickCallback() {
|
||||
@Override
|
||||
public void onsuccess() {
|
||||
pagetype="0";
|
||||
dianpubuju.setVisibility(View.VISIBLE);
|
||||
dianyuanbuju.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
marking_fragment.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// ShowAty.CloundSolutionActivity(getActivity());
|
||||
ShowAty.MainActivitytwot(getActivity());
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.zaaach.citypicker.CityPicker;
|
||||
import com.zaaach.citypicker.adapter.OnPickListener;
|
||||
import com.zaaach.citypicker.model.City;
|
||||
import com.zaaach.citypicker.model.HotCity;
|
||||
import com.zaaach.citypicker.model.LocateState;
|
||||
import com.zaaach.citypicker.model.LocatedCity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class MainActivitytwot extends AppCompatActivity implements CompoundButton.OnCheckedChangeListener {
|
||||
private TextView currentTV;
|
||||
private CheckBox hotCB;
|
||||
private CheckBox animCB;
|
||||
private CheckBox enableCB;
|
||||
private Button themeBtn;
|
||||
|
||||
private static final String KEY = "current_theme";
|
||||
|
||||
private List<HotCity> hotCities;
|
||||
private int anim;
|
||||
private int theme;
|
||||
private boolean enable;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
theme = savedInstanceState.getInt(KEY);
|
||||
setTheme(theme > 0 ? theme : R.style.DefaultCityPickerTheme);
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_mainsss);
|
||||
|
||||
currentTV = findViewById(R.id.tv_current);
|
||||
hotCB = findViewById(R.id.cb_hot);
|
||||
animCB = findViewById(R.id.cb_anim);
|
||||
enableCB = findViewById(R.id.cb_enable_anim);
|
||||
themeBtn = findViewById(R.id.btn_style);
|
||||
|
||||
if (theme == R.style.DefaultCityPickerTheme){
|
||||
themeBtn.setText("默认主题");
|
||||
}
|
||||
hotCB.setOnCheckedChangeListener(this);
|
||||
animCB.setOnCheckedChangeListener(this);
|
||||
enableCB.setOnCheckedChangeListener(this);
|
||||
|
||||
themeBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (themeBtn.getText().toString().startsWith("自定义")){
|
||||
themeBtn.setText("默认主题");
|
||||
theme = R.style.DefaultCityPickerTheme;
|
||||
}
|
||||
recreate();
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.btn_pick).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CityPicker.from(MainActivitytwot.this)
|
||||
.enableAnimation(enable)
|
||||
.setAnimationStyle(anim)
|
||||
.setLocatedCity(null)
|
||||
.setHotCities(hotCities)
|
||||
.setOnPickListener(new OnPickListener() {
|
||||
@Override
|
||||
public void onPick(int position, City data) {
|
||||
currentTV.setText(String.format("当前城市:%s,%s", data.getName(), data.getCode()));
|
||||
Toast.makeText(
|
||||
getApplicationContext(),
|
||||
String.format("点击的数据:%s,%s", data.getName(), data.getCode()),
|
||||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
Toast.makeText(getApplicationContext(), "取消选择", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocate() {
|
||||
//开始定位,这里模拟一下定位
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CityPicker.from(MainActivitytwot.this).locateComplete(new LocatedCity("深圳", "广东", "101280601"), LocateState.SUCCESS);
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
switch (buttonView.getId()){
|
||||
case R.id.cb_hot:
|
||||
if (isChecked){
|
||||
hotCities = new ArrayList<>();
|
||||
hotCities.add(new HotCity("北京", "北京", "101010100"));
|
||||
hotCities.add(new HotCity("上海", "上海", "101020100"));
|
||||
hotCities.add(new HotCity("广州", "广东", "101280101"));
|
||||
hotCities.add(new HotCity("深圳", "广东", "101280601"));
|
||||
hotCities.add(new HotCity("杭州", "浙江", "101210101"));
|
||||
}else {
|
||||
hotCities = null;
|
||||
}
|
||||
break;
|
||||
case R.id.cb_anim:
|
||||
|
||||
break;
|
||||
case R.id.cb_enable_anim:
|
||||
enable = isChecked;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putInt(KEY, theme);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
/**
|
||||
* Created by ${hu} on 2017/5/27.
|
||||
*/
|
||||
|
||||
public interface OnSatisfactionListener {
|
||||
void onClick();
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.find.ui.PrivateletterFragment;
|
||||
import com.fenghoo.seven.test.BaseFragment;
|
||||
|
||||
/**
|
||||
* 私信
|
||||
*/
|
||||
public class PriLetFragment extends BaseFragment {
|
||||
|
||||
Context mContext;
|
||||
View view;
|
||||
private RelativeLayout rl_live;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mContext = getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
if (view != null) {
|
||||
ViewGroup parent = (ViewGroup) view.getParent();
|
||||
if (parent != null) {
|
||||
parent.removeView(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
view = inflater.inflate(R.layout.findfragment, container, false);
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.containerr,new PrivateletterFragment()).commit();
|
||||
initView(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initView(View mContentView) {
|
||||
rl_live = (RelativeLayout)view.findViewById(R.id.rl_live);
|
||||
|
||||
}
|
||||
|
||||
interface ClickCallback {
|
||||
void onsuccess();
|
||||
}
|
||||
|
||||
public void cutover(final ClickCallback callback) {
|
||||
rl_live.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
callback.onsuccess();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.fenghoo.seven.main.find;
|
||||
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseTreeFragment;
|
||||
import com.fenghoo.seven.main.find.adapter.QuestionsAdapter;
|
||||
import com.fenghoo.seven.main.find.entity.QuestionsEntity;
|
||||
import com.fenghoo.seven.main.find.mvp.contract.QuestionsContract;
|
||||
import com.fenghoo.seven.main.find.mvp.presenter.QuestionsPresenterImpl;
|
||||
import com.fenghoo.seven.widget.PastEditText;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
|
||||
/**
|
||||
* 日期:2017.01.03
|
||||
* <p>
|
||||
* 作者:
|
||||
* <p>
|
||||
* 描述:答疑Fragment
|
||||
*/
|
||||
public class QuestionsFragment extends BaseTreeFragment<QuestionsContract.View, QuestionsPresenterImpl> implements QuestionsContract.View {
|
||||
|
||||
|
||||
private Button btnSend;
|
||||
private PastEditText pastEditText;
|
||||
private RecyclerView mRecyclerView;
|
||||
private QuestionsAdapter mAdapter;
|
||||
private LinearLayoutManager mLayoutManager;
|
||||
|
||||
@Override
|
||||
public void widgetClick(View v) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getFragmentLayoutId() {
|
||||
return R.layout.fragment_questions;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView(View view) {
|
||||
btnSend = (Button) view.findViewById(R.id.btn_send);
|
||||
pastEditText = (PastEditText) view.findViewById(R.id.et_msg);
|
||||
mRecyclerView = (RecyclerView) view.findViewById(R.id.rcv);
|
||||
mLayoutManager = new LinearLayoutManager(mContext);
|
||||
mRecyclerView.setLayoutManager(mLayoutManager);
|
||||
mAdapter = new QuestionsAdapter(mContext, null, false);
|
||||
mRecyclerView.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
|
||||
//初始化
|
||||
List<QuestionsEntity> question = new ArrayList<>();
|
||||
QuestionsEntity questionsEntity = new QuestionsEntity();
|
||||
questionsEntity.setIs_self(0);//表明是自己发送的
|
||||
questionsEntity.setMsg("您好,很高兴为您服务。");//设置问题内容
|
||||
question.add(questionsEntity);
|
||||
mAdapter.upDate(question);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initEvent(View view) {
|
||||
pastEditText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
btnSend.setEnabled(!TextUtils.isEmpty(s));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
btnSend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//发送消息
|
||||
getPresenter().sendMsg();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public QuestionsPresenterImpl createPresenter() {
|
||||
return new QuestionsPresenterImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInput() {
|
||||
String msg = pastEditText.getText().toString();
|
||||
pastEditText.setText("");
|
||||
return msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upDataAdd(List<QuestionsEntity> list) {
|
||||
mAdapter.upDateAdd(list);
|
||||
mLayoutManager.scrollToPosition(mAdapter.getEList().size() - 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.fenghoo.seven.main.find.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.utils.WidgetTools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class FindListAdapter extends BaseQuickAdapter<CustomerListBean.ResultBean.DataBean, BaseViewHolder> {
|
||||
Context mcontext;
|
||||
OnViewClickListener onViewClickListener;
|
||||
|
||||
public FindListAdapter(Context context, List list) {
|
||||
super(R.layout.cuslist_item, list);
|
||||
this.mcontext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(final BaseViewHolder helper, final CustomerListBean.ResultBean.DataBean item) {
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_name), "", item.getName());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_phone), "", item.getPhone());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_watch), "", item.getWechat());
|
||||
TextView tv_cuslist_caozuo = (TextView)helper.getView(R.id.tv_cuslist_caozuo);
|
||||
tv_cuslist_caozuo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onViewClickListener.operation(item);
|
||||
}
|
||||
});
|
||||
RelativeLayout yichengjhiao_rv = (RelativeLayout)helper.getView(R.id.yichengjhiao_rv);
|
||||
yichengjhiao_rv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onViewClickListener.enterCusDetail(item);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void operationListenner(OnViewClickListener onViewClickListener){
|
||||
this.onViewClickListener = onViewClickListener;
|
||||
}
|
||||
|
||||
public interface OnViewClickListener{
|
||||
|
||||
void operation(CustomerListBean.ResultBean.DataBean item);
|
||||
|
||||
|
||||
void enterCusDetail(CustomerListBean.ResultBean.DataBean item);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.fenghoo.seven.main.find.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.utils.WidgetTools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class PrivateletAdapter extends BaseQuickAdapter<CustomerListBean.ResultBean.DataBean, BaseViewHolder> {
|
||||
Context mcontext;
|
||||
OnViewClickListener onViewClickListener;
|
||||
|
||||
public PrivateletAdapter(Context context, List list) {
|
||||
super(R.layout.private_let_item, list);
|
||||
this.mcontext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(final BaseViewHolder helper, final CustomerListBean.ResultBean.DataBean item) {
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_name), "", item.getName());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_phone), "", item.getPhone());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_watch), "", item.getWechat());
|
||||
TextView tv_cuslist_caozuo = (TextView)helper.getView(R.id.tv_cuslist_caozuo);
|
||||
tv_cuslist_caozuo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onViewClickListener.operation(item);
|
||||
}
|
||||
});
|
||||
RelativeLayout yichengjhiao_rv = (RelativeLayout)helper.getView(R.id.yichengjhiao_rv);
|
||||
yichengjhiao_rv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onViewClickListener.enterCusDetail(item);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void operationListenner(OnViewClickListener onViewClickListener){
|
||||
this.onViewClickListener = onViewClickListener;
|
||||
}
|
||||
|
||||
public interface OnViewClickListener{
|
||||
|
||||
void operation(CustomerListBean.ResultBean.DataBean item);
|
||||
|
||||
|
||||
void enterCusDetail(CustomerListBean.ResultBean.DataBean item);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
package com.fenghoo.seven.main.find.adapter;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseRecycleAdapter;
|
||||
import com.fenghoo.seven.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.main.find.entity.QuestionsEntity;
|
||||
import com.fenghoo.seven.utils.GlideTools;
|
||||
import com.fenghoo.seven.widget.CircleImageView;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
/**
|
||||
* QuestionsAdapter
|
||||
* (๑• . •๑)
|
||||
* 类描述: 答疑记录适配器
|
||||
* Created by LeiXiaoXing on 2017/5/22 19:53
|
||||
*/
|
||||
|
||||
public class QuestionsAdapter extends BaseRecycleAdapter<QuestionsEntity, QuestionsAdapter.ViewHolder> {
|
||||
|
||||
|
||||
private final int ITEM_TYPE_LEFT = 1;
|
||||
private final int ITEM_TYPE_RIGHT = 2;
|
||||
private Context mContext;
|
||||
|
||||
/**
|
||||
* 构造Adapter
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param questionEntities 数据集合
|
||||
* @param canLoadMore 是否支持加载更多
|
||||
*/
|
||||
public QuestionsAdapter(Context context, List<QuestionsEntity> questionEntities, boolean canLoadMore) {
|
||||
super(context, questionEntities, canLoadMore);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ViewHolder createViewHolder(View view, int viewType) {
|
||||
if (viewType == ITEM_TYPE_LEFT) {
|
||||
return new ViewHolder(view);
|
||||
} else if (viewType == ITEM_TYPE_RIGHT) {
|
||||
return new QuestionViewHolder(view);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCustomItemViewType(int position) {
|
||||
return 1 == mEList.get(position).getIs_self() ? ITEM_TYPE_RIGHT : ITEM_TYPE_LEFT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemLayout(int viewType) {
|
||||
if (viewType == ITEM_TYPE_LEFT) {
|
||||
return R.layout.item_question_left;
|
||||
} else if (viewType == ITEM_TYPE_RIGHT) {
|
||||
return R.layout.item_question_right;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建绿色健康文本
|
||||
*
|
||||
* @param msg 文本内容
|
||||
* @return
|
||||
*/
|
||||
private TextView createTextView(String msg) {
|
||||
TextView textView = new TextView(mContext);
|
||||
textView.setPadding(0, 10, 0, 10);
|
||||
textView.setTextColor(ContextCompat.getColor(mContext, R.color.colorAccent));
|
||||
textView.setText(msg);
|
||||
textView.setTextSize(16);
|
||||
return textView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建绿色健康文本
|
||||
*
|
||||
* @param msg 文本内容
|
||||
* @return
|
||||
*/
|
||||
private WebView createWebView(String msg) {
|
||||
WebView webView = new WebView(mContext);
|
||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
|
||||
RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
webView.setLayoutParams(layoutParams);
|
||||
// webView.getSettings().setLoadWithOverviewMode(true);// 缩放至屏幕的大小
|
||||
|
||||
webView.loadDataWithBaseURL(null, getNewContent(msg), "text/html", "utf-8", null);
|
||||
return webView;
|
||||
}
|
||||
|
||||
|
||||
class ViewHolder extends BaseViewHolder<QuestionsEntity> {
|
||||
|
||||
TextView tvContent;
|
||||
private FrameLayout view_content_fl;
|
||||
private LinearLayout view_content_ll;
|
||||
|
||||
protected ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView(View itemView) {
|
||||
tvContent = (TextView) itemView.findViewById(R.id.tv_content);
|
||||
view_content_fl = (FrameLayout) itemView.findViewById(R.id.view_content_fl);
|
||||
view_content_ll = (LinearLayout) itemView.findViewById(R.id.view_content_ll);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||
@Override
|
||||
protected void bindView(final QuestionsEntity entity, int position) {
|
||||
Log.e("entity.getMsg()", "bindView: " + entity.getMsg());
|
||||
tvContent.setText(entity.getMsg());
|
||||
//0 = 解答内容回复 , 1 = 回答满意/不满意 ,2 = 点击提交问题
|
||||
if (entity.getReply_type() == 1) {
|
||||
view_content_fl.setVisibility(View.GONE);//隐藏帧布局,使用线性布局
|
||||
view_content_ll.setVisibility(View.VISIBLE);
|
||||
view_content_ll.removeAllViews();
|
||||
view_content_ll.setOrientation(LinearLayout.HORIZONTAL);
|
||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.setMarginEnd(100);
|
||||
TextView tvUnsatisfy = createTextView("不满意");
|
||||
TextView tvSatisfy = createTextView("满意");
|
||||
tvUnsatisfy.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// mContext.startActivity(new Intent(mContext, QuestionsAddedActivity.class));
|
||||
}
|
||||
});
|
||||
tvSatisfy.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// Toast.makeText(mContext, "满意", Toast.LENGTH_SHORT).show();
|
||||
// mListener.onClick();
|
||||
}
|
||||
});
|
||||
view_content_ll.addView(tvUnsatisfy, layoutParams);
|
||||
view_content_ll.addView(tvSatisfy);
|
||||
} else if (entity.getReply_type() == 2) {
|
||||
view_content_ll.setVisibility(View.VISIBLE);
|
||||
view_content_fl.setVisibility(View.GONE);//隐藏帧布局,使用线性布局
|
||||
view_content_ll.removeAllViews();
|
||||
TextView textView = createTextView("点击提交问题和关键字 >");
|
||||
textView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// Intent intent=new Intent(mContext, QuestionsAddedActivity.class);
|
||||
// intent.putExtra("question",entity.getQuestion());//把问题传到提交问题界面
|
||||
// mContext.startActivity(intent);
|
||||
//mContext.startActivity(new Intent(mContext, QuestionsAddedActivity.class));
|
||||
}
|
||||
});
|
||||
view_content_ll.addView(textView);
|
||||
} else {
|
||||
view_content_fl.setVisibility(View.VISIBLE);
|
||||
view_content_ll.setVisibility(View.GONE);
|
||||
List<QuestionsEntity.DataEntity> data = entity.getData();
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
// view_content.setOrientation(LinearLayout.VERTICAL);
|
||||
view_content_fl.removeAllViews();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
//i + 1 + "." + data.get(i).getContent()
|
||||
view_content_fl.addView(createWebView(data.get(i).getContent()));
|
||||
// view_content.addView(createTextView(data.get(i).getContent()));
|
||||
Log.d("log","content:"+data.get(i).getContent());
|
||||
}
|
||||
Log.d("log",data.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getNewContent(String htmlText) {
|
||||
Document doc = Jsoup.parse(htmlText);
|
||||
Elements elements = doc.getElementsByTag("img");
|
||||
for (Element element : elements) {
|
||||
element.attr("width", "auto").attr("height", "auto");
|
||||
}
|
||||
return doc.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户提问方的ViewHolder
|
||||
*/
|
||||
private class QuestionViewHolder extends ViewHolder {
|
||||
|
||||
private CircleImageView ivAvatar;
|
||||
|
||||
private QuestionViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView(View itemView) {
|
||||
super.initView(itemView);
|
||||
ivAvatar = (CircleImageView) itemView.findViewById(R.id.iv_icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bindView(QuestionsEntity entity, int position) {
|
||||
tvContent.setText(entity.getMsg());
|
||||
GlideTools.init(mContext).displaypic(ivAvatar, "", R.mipmap.icon_default_head);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.fenghoo.seven.main.find.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* QuestionsEntity
|
||||
* (๑• . •๑)
|
||||
* 类描述:
|
||||
* Created by LeiXiaoXing on 2017/5/22 19:46
|
||||
*/
|
||||
|
||||
public class QuestionsEntity {
|
||||
|
||||
/**
|
||||
* msg : 关键字"为什么"的解答如下
|
||||
* is_self : 0
|
||||
* data : [{"id":"69","content":"每年农历冬至这天,不论贫富,饺子是必不可少的节日饭。这种习俗,据说是为了纪念\u201c医圣\u201d张仲景。"},{"id":"70","content":"为了纪念这位\u201c医圣\u201d也为了冬天不冻耳朵,人们学着\u201c娇耳\u201d的样子,包成食物,也叫\u201c饺子\u201d或\u201c扁食\u201d。"},{"id":"71","content":"金字塔是古代埃及劳动人民智慧的结晶,是世界古代文明史上的奇迹。"},{"id":"72","content":"在《圣经》中,记载着这么一个故事:耶稣和他的十二个门徒逾越节聚会。在晚餐时,耶稣说:\u201c你们中有一个人要出卖我。 \u201d果然,门徒中的犹大向统治者告发了耶稣,耶稣被钉死在十字架上。当时晚餐桌上正好是十三个人,人们就认为是这个\u201c13\u201d带来了不幸。"}]
|
||||
* reply_type : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int is_self;
|
||||
private int reply_type;
|
||||
private List<DataEntity> data;
|
||||
private String question;
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public void setQuestion(String question) {
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getIs_self() {
|
||||
return is_self;
|
||||
}
|
||||
|
||||
public void setIs_self(int is_self) {
|
||||
this.is_self = is_self;
|
||||
}
|
||||
|
||||
public int getReply_type() {
|
||||
return reply_type;
|
||||
}
|
||||
|
||||
public void setReply_type(int reply_type) {
|
||||
this.reply_type = reply_type;
|
||||
}
|
||||
|
||||
public List<DataEntity> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataEntity> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataEntity {
|
||||
/**
|
||||
* id : 69
|
||||
* content : 每年农历冬至这天,不论贫富,饺子是必不可少的节日饭。这种习俗,据说是为了纪念“医圣”张仲景。
|
||||
*/
|
||||
|
||||
private String id;
|
||||
private String content;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.fenghoo.seven.main.find.mvp.contract;
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.find.entity.QuestionsEntity;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* QuestionsContract
|
||||
* (๑• . •๑)
|
||||
* 类描述:
|
||||
* Created by LeiXiaoXing on 2017/5/22 19:43
|
||||
*/
|
||||
|
||||
public class QuestionsContract {
|
||||
|
||||
public interface View extends BaseTreeView {
|
||||
|
||||
/**
|
||||
* 获取输入内容
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getInput();
|
||||
|
||||
/**
|
||||
* 叠加数据
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
void upDataAdd(List<QuestionsEntity> list);
|
||||
}
|
||||
|
||||
public interface Presenter {
|
||||
void sendMsg();
|
||||
}
|
||||
|
||||
public interface Model {
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param qu_key 关键字
|
||||
* @param callBack 回调
|
||||
*/
|
||||
void sendMsg(String qu_key, ApiCallBack<List<QuestionsEntity>> callBack);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.fenghoo.seven.main.find.mvp.model;
|
||||
|
||||
import com.fenghoo.seven.main.find.entity.QuestionsEntity;
|
||||
import com.fenghoo.seven.main.find.mvp.contract.QuestionsContract;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.network.ApiUtils;
|
||||
import com.fenghoo.seven.network.http.ResponseBean;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by 雷小星🍀 on 2017/05/22
|
||||
*/
|
||||
|
||||
public class QuestionsModelImpl implements QuestionsContract.Model {
|
||||
|
||||
@Override
|
||||
public void sendMsg(String qu_key, final ApiCallBack<List<QuestionsEntity>> callBack) {
|
||||
ApiUtils.getApi()
|
||||
.ask(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid()
|
||||
, qu_key)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseBean<List<QuestionsEntity>>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<List<QuestionsEntity>> listResponseBean) throws Exception {
|
||||
callBack.onResponse(listResponseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Throwable throwable) throws Exception {
|
||||
callBack.onFailure(throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.fenghoo.seven.main.find.mvp.presenter;
|
||||
|
||||
import com.fenghoo.seven.main.find.entity.QuestionsEntity;
|
||||
import com.fenghoo.seven.main.find.mvp.contract.QuestionsContract;
|
||||
import com.fenghoo.seven.main.find.mvp.model.QuestionsModelImpl;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by 雷小星🍀 on 2017/05/22
|
||||
*/
|
||||
|
||||
public class QuestionsPresenterImpl extends MvpBasePresenter<QuestionsContract.View> implements QuestionsContract.Presenter {
|
||||
|
||||
private QuestionsModelImpl mModel;
|
||||
|
||||
public QuestionsPresenterImpl() {
|
||||
mModel = new QuestionsModelImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMsg() {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
//获取输入
|
||||
String input = getView().getInput();
|
||||
List<QuestionsEntity> question = new ArrayList<>();
|
||||
QuestionsEntity questionsEntity = new QuestionsEntity();
|
||||
questionsEntity.setIs_self(1);//表明是自己发送的
|
||||
questionsEntity.setMsg(input);//设置问题内容
|
||||
question.add(questionsEntity);
|
||||
getView().upDataAdd(question);
|
||||
//用户提问,获取服务器回答
|
||||
mModel.sendMsg(input, new ApiCallBack<List<QuestionsEntity>>() {
|
||||
@Override
|
||||
protected void onSuccess(List<QuestionsEntity> responseData, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().upDataAdd(responseData);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFailure(String error) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().toast(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.fenghoo.seven.main.find.ui;
|
||||
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.BaseTipsDialog;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.main.kehu.Dialog.CusOperationDialog;
|
||||
import com.fenghoo.seven.main.kehu.MobanFragment;
|
||||
import com.fenghoo.seven.main.kehu.activity.ShowAty;
|
||||
import com.fenghoo.seven.main.kehu.adapter.CusListAdapter;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
|
||||
public class CommentFragment extends MobanFragment {
|
||||
|
||||
|
||||
public CommentFragment() {
|
||||
super();
|
||||
|
||||
}
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
CusListAdapter markingtwoAdapter = new CusListAdapter(mContext, null);
|
||||
getAdpter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
markingtwoAdapter.operationListenner(new CusListAdapter.OnViewClickListener() {
|
||||
@Override
|
||||
public void operation(final CustomerListBean.ResultBean.DataBean item) {
|
||||
new CusOperationDialog(getActivity(), R.style.dialog, new CusOperationDialog.OnCloseListener() {
|
||||
@Override
|
||||
public void phoneClick() {//拨打电话
|
||||
if (item.getPhone() != null) {
|
||||
call(item.getPhone());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kaidanonClick() {//删除客户
|
||||
new BaseTipsDialog().showDownloadDialog(getActivity(), "确认删除该客户吗?", "确定", new BaseTipsDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
Toast.makeText(getActivity(), "还没调接口", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancle() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//信息完善
|
||||
@Override
|
||||
public void uploadAvatar() {
|
||||
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterCusDetail(CustomerListBean.ResultBean.DataBean item) {
|
||||
//进入查看评论
|
||||
ShowAty.CustomerDetailActivity(getActivity(),item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
new NetApi().customerList(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid(),"").subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
CustomerListBean.ResultBean result = JsonUtils.fromJson(body, CustomerListBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (result != null && String.valueOf(result.getSuccess()).equals("0")) {
|
||||
|
||||
List<CustomerListBean.ResultBean.DataBean> data = result.getData();
|
||||
if (data.size() == 0) {
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
}
|
||||
} else {
|
||||
setData(true, null);
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.fenghoo.seven.main.find.ui;
|
||||
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.BaseTipsDialog;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.main.kehu.Dialog.CusOperationDialog;
|
||||
import com.fenghoo.seven.main.kehu.MobanFragment;
|
||||
import com.fenghoo.seven.main.kehu.activity.ShowAty;
|
||||
import com.fenghoo.seven.main.kehu.adapter.CusListAdapter;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
|
||||
public class FindFragmenttwo extends MobanFragment {
|
||||
|
||||
|
||||
public FindFragmenttwo() {
|
||||
super();
|
||||
|
||||
}
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
CusListAdapter markingtwoAdapter = new CusListAdapter(mContext, null);
|
||||
getAdpter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
markingtwoAdapter.operationListenner(new CusListAdapter.OnViewClickListener() {
|
||||
@Override
|
||||
public void operation(final CustomerListBean.ResultBean.DataBean item) {
|
||||
new CusOperationDialog(getActivity(), R.style.dialog, new CusOperationDialog.OnCloseListener() {
|
||||
@Override
|
||||
public void phoneClick() {//拨打电话
|
||||
if (item.getPhone() != null) {
|
||||
call(item.getPhone());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kaidanonClick() {//删除客户
|
||||
new BaseTipsDialog().showDownloadDialog(getActivity(), "确认删除该客户吗?", "确定", new BaseTipsDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
Toast.makeText(getActivity(), "还没调接口", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancle() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//信息完善
|
||||
@Override
|
||||
public void uploadAvatar() {
|
||||
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterCusDetail(CustomerListBean.ResultBean.DataBean item) {
|
||||
//进入查看评论
|
||||
ShowAty.CommentActivity(getActivity(),20);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
new NetApi().customerList(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid(),"").subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
CustomerListBean.ResultBean result = JsonUtils.fromJson(body, CustomerListBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (result != null && String.valueOf(result.getSuccess()).equals("0")) {
|
||||
|
||||
List<CustomerListBean.ResultBean.DataBean> data = result.getData();
|
||||
if (data.size() == 0) {
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
}
|
||||
} else {
|
||||
setData(true, null);
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.fenghoo.seven.main.find.ui;
|
||||
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.BaseTipsDialog;
|
||||
import com.fenghoo.seven.main.find.adapter.PrivateletAdapter;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.main.kehu.Dialog.CusOperationDialog;
|
||||
import com.fenghoo.seven.main.kehu.MobanFragment;
|
||||
import com.fenghoo.seven.main.kehu.activity.ShowAty;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
/**
|
||||
* 私信
|
||||
*/
|
||||
public class PrivateletterFragment extends MobanFragment {
|
||||
|
||||
|
||||
public PrivateletterFragment() {
|
||||
super();
|
||||
|
||||
}
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
PrivateletAdapter markingtwoAdapter = new PrivateletAdapter(mContext, null);
|
||||
getAdpter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
markingtwoAdapter.operationListenner(new PrivateletAdapter.OnViewClickListener() {
|
||||
@Override
|
||||
public void operation(final CustomerListBean.ResultBean.DataBean item) {
|
||||
new CusOperationDialog(getActivity(), R.style.dialog, new CusOperationDialog.OnCloseListener() {
|
||||
@Override
|
||||
public void phoneClick() {//拨打电话
|
||||
if (item.getPhone() != null) {
|
||||
call(item.getPhone());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kaidanonClick() {//删除客户
|
||||
new BaseTipsDialog().showDownloadDialog(getActivity(), "确认删除该客户吗?", "确定", new BaseTipsDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
Toast.makeText(getActivity(), "还没调接口", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancle() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//信息完善
|
||||
@Override
|
||||
public void uploadAvatar() {
|
||||
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterCusDetail(CustomerListBean.ResultBean.DataBean item) {
|
||||
//进入回话页
|
||||
ShowAty.ConversationActivity(getActivity());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
new NetApi().customerList(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid(),"").subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
CustomerListBean.ResultBean result = JsonUtils.fromJson(body, CustomerListBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (result != null && String.valueOf(result.getSuccess()).equals("0")) {
|
||||
|
||||
List<CustomerListBean.ResultBean.DataBean> data = result.getData();
|
||||
if (data.size() == 0) {
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
}
|
||||
} else {
|
||||
setData(true, null);
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
public class CommitDesignModel extends BaseModel {
|
||||
|
||||
/**
|
||||
* msg : 提交成功
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int success;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/17
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class CustomerListBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* result : {"msg":"获取成功","total":0,"data":[{"headimg":"","phone":"15862656263","name":"text","wechat":"weixin","source":"1","customer_id":"3aaa642ed2f57470f62c51ee60d8a852","type":"old","source_name":"添加客户"}],"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 获取成功
|
||||
* total : 0
|
||||
* data : [{"headimg":"","phone":"15862656263","name":"text","wechat":"weixin","source":"1","customer_id":"3aaa642ed2f57470f62c51ee60d8a852","type":"old","source_name":"添加客户"}]
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int total;
|
||||
private int success;
|
||||
private List<DataBean> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* headimg :
|
||||
* phone : 15862656263
|
||||
* name : text
|
||||
* wechat : weixin
|
||||
* source : 1
|
||||
* customer_id : 3aaa642ed2f57470f62c51ee60d8a852
|
||||
* type : old
|
||||
* source_name : 添加客户
|
||||
*/
|
||||
|
||||
private String headimg;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String wechat;
|
||||
private String source;
|
||||
private String customer_id;
|
||||
private String type;
|
||||
private String source_name;
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimg;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimg = headimg;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getWechat() {
|
||||
return wechat;
|
||||
}
|
||||
|
||||
public void setWechat(String wechat) {
|
||||
this.wechat = wechat;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getCustomer_id() {
|
||||
return customer_id;
|
||||
}
|
||||
|
||||
public void setCustomer_id(String customer_id) {
|
||||
this.customer_id = customer_id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSource_name() {
|
||||
return source_name;
|
||||
}
|
||||
|
||||
public void setSource_name(String source_name) {
|
||||
this.source_name = source_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/17
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class FpListBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* result : {"msg":"获取成功","data":[{"headimg":"localhost/upload/2020081115530962805.jpg","fp_num":"2","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","industry":[{"industry":"家具","type":"0","customer_id":"ae0c5199fdf564f90796aec09482b85d"}],"customer_id":"ae0c5199fdf564f90796aec09482b85d"}],"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 获取成功
|
||||
* data : [{"headimg":"localhost/upload/2020081115530962805.jpg","fp_num":"2","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","industry":[{"industry":"家具","type":"0","customer_id":"ae0c5199fdf564f90796aec09482b85d"}],"customer_id":"ae0c5199fdf564f90796aec09482b85d"}]
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int success;
|
||||
private List<DataBean> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* headimg : localhost/upload/2020081115530962805.jpg
|
||||
* fp_num : 2
|
||||
* phone : 18831913290
|
||||
* name : demo
|
||||
* wechat : wangyuxin283425757
|
||||
* industry : [{"industry":"家具","type":"0","customer_id":"ae0c5199fdf564f90796aec09482b85d"}]
|
||||
* customer_id : ae0c5199fdf564f90796aec09482b85d
|
||||
*/
|
||||
|
||||
private String headimg;
|
||||
private String fp_num;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String wechat;
|
||||
private String customer_id;
|
||||
private List<IndustryBean> industry;
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimg;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimg = headimg;
|
||||
}
|
||||
|
||||
public String getFp_num() {
|
||||
return fp_num;
|
||||
}
|
||||
|
||||
public void setFp_num(String fp_num) {
|
||||
this.fp_num = fp_num;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getWechat() {
|
||||
return wechat;
|
||||
}
|
||||
|
||||
public void setWechat(String wechat) {
|
||||
this.wechat = wechat;
|
||||
}
|
||||
|
||||
public String getCustomer_id() {
|
||||
return customer_id;
|
||||
}
|
||||
|
||||
public void setCustomer_id(String customer_id) {
|
||||
this.customer_id = customer_id;
|
||||
}
|
||||
|
||||
public List<IndustryBean> getIndustry() {
|
||||
return industry;
|
||||
}
|
||||
|
||||
public void setIndustry(List<IndustryBean> industry) {
|
||||
this.industry = industry;
|
||||
}
|
||||
|
||||
public static class IndustryBean {
|
||||
/**
|
||||
* industry : 家具
|
||||
* type : 0
|
||||
* customer_id : ae0c5199fdf564f90796aec09482b85d
|
||||
*/
|
||||
|
||||
private String industry;
|
||||
private String type;
|
||||
private String customer_id;
|
||||
|
||||
public String getIndustry() {
|
||||
return industry;
|
||||
}
|
||||
|
||||
public void setIndustry(String industry) {
|
||||
this.industry = industry;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getCustomer_id() {
|
||||
return customer_id;
|
||||
}
|
||||
|
||||
public void setCustomer_id(String customer_id) {
|
||||
this.customer_id = customer_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TODO<json数据源>
|
||||
*
|
||||
* @author: 小嵩
|
||||
* @date: 2017/3/16 15:36
|
||||
*/
|
||||
|
||||
public class JsonBean implements IPickerViewData {
|
||||
|
||||
|
||||
/**
|
||||
* name : 省份
|
||||
* city : [{"name":"北京市","area":["东城区","西城区","崇文区","宣武区","朝阳区"]}]
|
||||
*/
|
||||
|
||||
private String name;
|
||||
private List<CityBean> city;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<CityBean> getCityList() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCityList(List<CityBean> city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
// 实现 IPickerViewData 接口,
|
||||
// 这个用来显示在PickerView上面的字符串,
|
||||
// PickerView会通过IPickerViewData获取getPickerViewText方法显示出来。
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
|
||||
public static class CityBean {
|
||||
/**
|
||||
* name : 城市
|
||||
* area : ["东城区","西城区","崇文区","昌平区"]
|
||||
*/
|
||||
|
||||
private String name;
|
||||
private List<String> area;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<String> getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(List<String> area) {
|
||||
this.area = area;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TODO<json数据源>
|
||||
*
|
||||
* @author: 小嵩
|
||||
* @date: 2017/3/16 15:36
|
||||
*/
|
||||
|
||||
public class JsonBeantwo implements IPickerViewData {
|
||||
|
||||
|
||||
/**
|
||||
* areaId : 110000
|
||||
* areaName : 北京市
|
||||
* cities : [{"areaId":"110000","areaName":"北京市","counties":[{"areaId":"110101","areaName":"东城区"},{"areaId":"110102","areaName":"西城区"},{"areaId":"110105","areaName":"朝阳区"},{"areaId":"110106","areaName":"丰台区"},{"areaId":"110107","areaName":"石景山区"},{"areaId":"110108","areaName":"海淀区"},{"areaId":"110109","areaName":"门头沟区"},{"areaId":"110111","areaName":"房山区"},{"areaId":"110112","areaName":"通州区"},{"areaId":"110113","areaName":"顺义区"},{"areaId":"110114","areaName":"昌平区"},{"areaId":"110115","areaName":"大兴区"},{"areaId":"110116","areaName":"怀柔区"},{"areaId":"110117","areaName":"平谷区"},{"areaId":"110228","areaName":"密云县"},{"areaId":"110229","areaName":"延庆县"}]}]
|
||||
*/
|
||||
|
||||
private String areaId;
|
||||
private String areaName;
|
||||
private List<CitiesBean> cities;
|
||||
|
||||
public String getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public List<CitiesBean> getCities() {
|
||||
return cities;
|
||||
}
|
||||
|
||||
public void setCities(List<CitiesBean> cities) {
|
||||
this.cities = cities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return this.areaName;
|
||||
}
|
||||
|
||||
public static class CitiesBean {
|
||||
/**
|
||||
* areaId : 110000
|
||||
* areaName : 北京市
|
||||
* counties : [{"areaId":"110101","areaName":"东城区"},{"areaId":"110102","areaName":"西城区"},{"areaId":"110105","areaName":"朝阳区"},{"areaId":"110106","areaName":"丰台区"},{"areaId":"110107","areaName":"石景山区"},{"areaId":"110108","areaName":"海淀区"},{"areaId":"110109","areaName":"门头沟区"},{"areaId":"110111","areaName":"房山区"},{"areaId":"110112","areaName":"通州区"},{"areaId":"110113","areaName":"顺义区"},{"areaId":"110114","areaName":"昌平区"},{"areaId":"110115","areaName":"大兴区"},{"areaId":"110116","areaName":"怀柔区"},{"areaId":"110117","areaName":"平谷区"},{"areaId":"110228","areaName":"密云县"},{"areaId":"110229","areaName":"延庆县"}]
|
||||
*/
|
||||
|
||||
private String areaId;
|
||||
private String areaName;
|
||||
private List<CountiesBean> counties;
|
||||
|
||||
public String getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public List<CountiesBean> getCounties() {
|
||||
return counties;
|
||||
}
|
||||
|
||||
public void setCounties(List<CountiesBean> counties) {
|
||||
this.counties = counties;
|
||||
}
|
||||
|
||||
public static class CountiesBean {
|
||||
/**
|
||||
* areaId : 110101
|
||||
* areaName : 东城区
|
||||
*/
|
||||
|
||||
private String areaId;
|
||||
private String areaName;
|
||||
|
||||
public String getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
/**
|
||||
* author:luck
|
||||
* project:PictureSelector
|
||||
* package:com.luck.picture.lib.entity
|
||||
* describe:for PictureSelector media entity.
|
||||
* email:893855882@qq.com
|
||||
* data:2017/5/24
|
||||
*/
|
||||
|
||||
public class LocalMedia implements Parcelable {
|
||||
private String path;
|
||||
private String compressPath;
|
||||
private String cutPath;
|
||||
private long duration;
|
||||
private boolean isChecked;
|
||||
private boolean isCut;
|
||||
public int position;
|
||||
private int num;
|
||||
private int mimeType;
|
||||
private String pictureType;
|
||||
private boolean compressed;
|
||||
private int width;
|
||||
private int height;
|
||||
|
||||
public LocalMedia() {
|
||||
|
||||
}
|
||||
|
||||
public LocalMedia(String path, long duration, int mimeType, String pictureType) {
|
||||
this.path = path;
|
||||
this.duration = duration;
|
||||
this.mimeType = mimeType;
|
||||
this.pictureType = pictureType;
|
||||
}
|
||||
|
||||
public LocalMedia(String path, long duration, int mimeType, String pictureType, int width, int height) {
|
||||
this.path = path;
|
||||
this.duration = duration;
|
||||
this.mimeType = mimeType;
|
||||
this.pictureType = pictureType;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public LocalMedia(String path, long duration,
|
||||
boolean isChecked, int position, int num, int mimeType) {
|
||||
this.path = path;
|
||||
this.duration = duration;
|
||||
this.isChecked = isChecked;
|
||||
this.position = position;
|
||||
this.num = num;
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
public String getPictureType() {
|
||||
if (TextUtils.isEmpty(pictureType)) {
|
||||
pictureType = "image/jpeg";
|
||||
}
|
||||
return pictureType;
|
||||
}
|
||||
|
||||
public void setPictureType(String pictureType) {
|
||||
this.pictureType = pictureType;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getCompressPath() {
|
||||
return compressPath;
|
||||
}
|
||||
|
||||
public void setCompressPath(String compressPath) {
|
||||
this.compressPath = compressPath;
|
||||
}
|
||||
|
||||
public String getCutPath() {
|
||||
return cutPath;
|
||||
}
|
||||
|
||||
public void setCutPath(String cutPath) {
|
||||
this.cutPath = cutPath;
|
||||
}
|
||||
|
||||
public long getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(long duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
|
||||
public boolean isChecked() {
|
||||
return isChecked;
|
||||
}
|
||||
|
||||
public void setChecked(boolean checked) {
|
||||
isChecked = checked;
|
||||
}
|
||||
|
||||
public boolean isCut() {
|
||||
return isCut;
|
||||
}
|
||||
|
||||
public void setCut(boolean cut) {
|
||||
isCut = cut;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(int position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public int getMimeType() {
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
public void setMimeType(int mimeType) {
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
public boolean isCompressed() {
|
||||
return compressed;
|
||||
}
|
||||
|
||||
public void setCompressed(boolean compressed) {
|
||||
this.compressed = compressed;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.path);
|
||||
dest.writeString(this.compressPath);
|
||||
dest.writeString(this.cutPath);
|
||||
dest.writeLong(this.duration);
|
||||
dest.writeByte(this.isChecked ? (byte) 1 : (byte) 0);
|
||||
dest.writeByte(this.isCut ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.position);
|
||||
dest.writeInt(this.num);
|
||||
dest.writeInt(this.mimeType);
|
||||
dest.writeString(this.pictureType);
|
||||
dest.writeByte(this.compressed ? (byte) 1 : (byte) 0);
|
||||
dest.writeInt(this.width);
|
||||
dest.writeInt(this.height);
|
||||
}
|
||||
|
||||
protected LocalMedia(Parcel in) {
|
||||
this.path = in.readString();
|
||||
this.compressPath = in.readString();
|
||||
this.cutPath = in.readString();
|
||||
this.duration = in.readLong();
|
||||
this.isChecked = in.readByte() != 0;
|
||||
this.isCut = in.readByte() != 0;
|
||||
this.position = in.readInt();
|
||||
this.num = in.readInt();
|
||||
this.mimeType = in.readInt();
|
||||
this.pictureType = in.readString();
|
||||
this.compressed = in.readByte() != 0;
|
||||
this.width = in.readInt();
|
||||
this.height = in.readInt();
|
||||
}
|
||||
|
||||
public static final Creator<LocalMedia> CREATOR = new Creator<LocalMedia>() {
|
||||
@Override
|
||||
public LocalMedia createFromParcel(Parcel source) {
|
||||
return new LocalMedia(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalMedia[] newArray(int size) {
|
||||
return new LocalMedia[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/18
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class PhotoeditorBean {
|
||||
|
||||
|
||||
private String city;
|
||||
private String customer_id;
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCustomer_id() {
|
||||
return customer_id;
|
||||
}
|
||||
|
||||
public void setCustomer_id(String customer_id) {
|
||||
this.customer_id = customer_id;
|
||||
}
|
||||
|
||||
public String getIndustry_id() {
|
||||
return industry_id;
|
||||
}
|
||||
|
||||
public void setIndustry_id(String industry_id) {
|
||||
this.industry_id = industry_id;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
private String industry_id;
|
||||
private String province;
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class WorkDetailModel extends BaseModel implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* status : 0
|
||||
* result : {"success":0,"msg":"获取成功","data":{"workid":"10af479c179dd7a1d23782624d861872","housename":"西安万科翡翠国宾","custorhead":"","custorname":"张笑妹","custorphone":"13575542727","house_img":"http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__2019121910503152324.jpg","house_img_cloud":"","housearea":"100","vr_styleid":"1,2","worktype":"1","budget":"20000","decorate":"2","remark":"出彩出差错错错","vrstyle":"[{\"styleid\":\"1\",\"stylename\":\"日式风格\",\"styleimg\":\"http:\\/\\/www.fenghoo.cn\\/templates\\/fenghu\\/img\\/photo_icon.png\"},{\"styleid\":\"2\",\"stylename\":\"北欧风格\",\"styleimg\":\"http:\\/\\/www.fenghoo.cn\\/templates\\/fenghu\\/img\\/photo_icon.png\"}]","decorate_img":["http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__10af479c179dd7a1d23782624d861872__2019121910503163605.jpg","http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__43651f74c3832e2f403a37d5138487b2__2019121910524819500.jpg"]}}
|
||||
*/
|
||||
|
||||
private int status;
|
||||
private ResultBean result;
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean implements Serializable{
|
||||
/**
|
||||
* success : 0
|
||||
* msg : 获取成功
|
||||
* data : {"workid":"10af479c179dd7a1d23782624d861872","housename":"西安万科翡翠国宾","custorhead":"","custorname":"张笑妹","custorphone":"13575542727","house_img":"http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__2019121910503152324.jpg","house_img_cloud":"","housearea":"100","vr_styleid":"1,2","worktype":"1","budget":"20000","decorate":"2","remark":"出彩出差错错错","vrstyle":"[{\"styleid\":\"1\",\"stylename\":\"日式风格\",\"styleimg\":\"http:\\/\\/www.fenghoo.cn\\/templates\\/fenghu\\/img\\/photo_icon.png\"},{\"styleid\":\"2\",\"stylename\":\"北欧风格\",\"styleimg\":\"http:\\/\\/www.fenghoo.cn\\/templates\\/fenghu\\/img\\/photo_icon.png\"}]","decorate_img":["http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__10af479c179dd7a1d23782624d861872__2019121910503163605.jpg","http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__43651f74c3832e2f403a37d5138487b2__2019121910524819500.jpg"]}
|
||||
*/
|
||||
|
||||
private int success;
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public DataBean getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataBean data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean implements Serializable {
|
||||
/**
|
||||
* workid : 10af479c179dd7a1d23782624d861872
|
||||
* housename : 西安万科翡翠国宾
|
||||
* custorhead :
|
||||
* custorname : 张笑妹
|
||||
* custorphone : 13575542727
|
||||
* house_img : http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__2019121910503152324.jpg
|
||||
* house_img_cloud :
|
||||
* housearea : 100
|
||||
* vr_styleid : 1,2
|
||||
* worktype : 1
|
||||
* budget : 20000
|
||||
* decorate : 2
|
||||
* remark : 出彩出差错错错
|
||||
* vrstyle : [{"styleid":"1","stylename":"日式风格","styleimg":"http:\/\/www.fenghoo.cn\/templates\/fenghu\/img\/photo_icon.png"},{"styleid":"2","stylename":"北欧风格","styleimg":"http:\/\/www.fenghoo.cn\/templates\/fenghu\/img\/photo_icon.png"}]
|
||||
* decorate_img : ["http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__10af479c179dd7a1d23782624d861872__2019121910503163605.jpg","http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__19__43651f74c3832e2f403a37d5138487b2__2019121910524819500.jpg"]
|
||||
*/
|
||||
|
||||
private String workid;//
|
||||
private String housename;//
|
||||
private String custorhead;//
|
||||
private String custorname;//
|
||||
private String custorphone;//
|
||||
private String house_img;//
|
||||
private String house_img_cloud;//
|
||||
private String housearea;//
|
||||
private String vr_styleid;
|
||||
private String worktype;
|
||||
private String budget;//
|
||||
private String decorate;//
|
||||
private String remark;//
|
||||
private List<Bean> vrstyle;//
|
||||
private List<String> decorate_img;//
|
||||
private String design_name;//
|
||||
private String design_uid;//
|
||||
private String vr_choosestyle;
|
||||
private String project_id;
|
||||
|
||||
private String is_robone;//
|
||||
|
||||
public String getIs_robone() {
|
||||
return is_robone;
|
||||
}
|
||||
|
||||
public void setIs_robone(String is_robone) {
|
||||
this.is_robone = is_robone;
|
||||
}
|
||||
|
||||
public String getVr_choosestyle() {
|
||||
return vr_choosestyle;
|
||||
}
|
||||
|
||||
public void setVr_choosestyle(String vr_choosestyle) {
|
||||
this.vr_choosestyle = vr_choosestyle;
|
||||
}
|
||||
|
||||
public String getProject_id() {
|
||||
return project_id;
|
||||
}
|
||||
|
||||
public void setProject_id(String project_id) {
|
||||
this.project_id = project_id;
|
||||
}
|
||||
|
||||
public String getDesign_uid() {
|
||||
return design_uid;
|
||||
}
|
||||
|
||||
public void setDesign_uid(String design_uid) {
|
||||
this.design_uid = design_uid;
|
||||
}
|
||||
|
||||
public String getDesign_name() {
|
||||
return design_name;
|
||||
}
|
||||
|
||||
public void setDesign_name(String design_name) {
|
||||
this.design_name = design_name;
|
||||
}
|
||||
|
||||
public String getWorkid() {
|
||||
return workid;
|
||||
}
|
||||
|
||||
public void setWorkid(String workid) {
|
||||
this.workid = workid;
|
||||
}
|
||||
|
||||
public String getHousename() {
|
||||
return housename;
|
||||
}
|
||||
|
||||
public void setHousename(String housename) {
|
||||
this.housename = housename;
|
||||
}
|
||||
|
||||
public String getCustorhead() {
|
||||
return custorhead;
|
||||
}
|
||||
|
||||
public void setCustorhead(String custorhead) {
|
||||
this.custorhead = custorhead;
|
||||
}
|
||||
|
||||
public String getCustorname() {
|
||||
return custorname;
|
||||
}
|
||||
|
||||
public void setCustorname(String custorname) {
|
||||
this.custorname = custorname;
|
||||
}
|
||||
|
||||
public String getCustorphone() {
|
||||
return custorphone;
|
||||
}
|
||||
|
||||
public void setCustorphone(String custorphone) {
|
||||
this.custorphone = custorphone;
|
||||
}
|
||||
|
||||
public String getHouse_img() {
|
||||
return house_img;
|
||||
}
|
||||
|
||||
public void setHouse_img(String house_img) {
|
||||
this.house_img = house_img;
|
||||
}
|
||||
|
||||
public String getHouse_img_cloud() {
|
||||
return house_img_cloud;
|
||||
}
|
||||
|
||||
public void setHouse_img_cloud(String house_img_cloud) {
|
||||
this.house_img_cloud = house_img_cloud;
|
||||
}
|
||||
|
||||
public String getHousearea() {
|
||||
return housearea;
|
||||
}
|
||||
|
||||
public void setHousearea(String housearea) {
|
||||
this.housearea = housearea;
|
||||
}
|
||||
|
||||
public String getVr_styleid() {
|
||||
return vr_styleid;
|
||||
}
|
||||
|
||||
public void setVr_styleid(String vr_styleid) {
|
||||
this.vr_styleid = vr_styleid;
|
||||
}
|
||||
|
||||
public String getWorktype() {
|
||||
return worktype;
|
||||
}
|
||||
|
||||
public void setWorktype(String worktype) {
|
||||
this.worktype = worktype;
|
||||
}
|
||||
|
||||
public String getBudget() {
|
||||
return budget;
|
||||
}
|
||||
|
||||
public void setBudget(String budget) {
|
||||
this.budget = budget;
|
||||
}
|
||||
|
||||
public String getDecorate() {
|
||||
return decorate;
|
||||
}
|
||||
|
||||
public void setDecorate(String decorate) {
|
||||
this.decorate = decorate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public List<Bean> getVrstyle() {
|
||||
return vrstyle;
|
||||
}
|
||||
|
||||
public void setVrstyle(List<Bean> vrstyle) {
|
||||
this.vrstyle = vrstyle;
|
||||
}
|
||||
|
||||
public List<String> getDecorate_img() {
|
||||
return decorate_img;
|
||||
}
|
||||
|
||||
public void setDecorate_img(List<String> decorate_img) {
|
||||
this.decorate_img = decorate_img;
|
||||
}
|
||||
|
||||
|
||||
public static class Bean implements Serializable{
|
||||
/**
|
||||
* styleid : 1
|
||||
* stylename : 日式风格
|
||||
* styleimg : http://www.fenghoo.cn/templates/fenghu/img/photo_icon.png
|
||||
*/
|
||||
|
||||
private String styleid;
|
||||
private String stylename;
|
||||
private String styleimg;
|
||||
|
||||
private boolean isCheck = false;//选中风格
|
||||
|
||||
public boolean isCheck() {
|
||||
return isCheck;
|
||||
}
|
||||
|
||||
public void setCheck(boolean check) {
|
||||
isCheck = check;
|
||||
}
|
||||
|
||||
public String getStyleid() {
|
||||
return styleid;
|
||||
}
|
||||
|
||||
public void setStyleid(String styleid) {
|
||||
this.styleid = styleid;
|
||||
}
|
||||
|
||||
public String getStylename() {
|
||||
return stylename;
|
||||
}
|
||||
|
||||
public void setStylename(String stylename) {
|
||||
this.stylename = stylename;
|
||||
}
|
||||
|
||||
public String getStyleimg() {
|
||||
return styleimg;
|
||||
}
|
||||
|
||||
public void setStyleimg(String styleimg) {
|
||||
this.styleimg = styleimg;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
/**
|
||||
* Created by chenss on 2018/7/7.
|
||||
*/
|
||||
|
||||
public class WxuSerinfo {
|
||||
|
||||
public String getHongbao() {
|
||||
return hongbao;
|
||||
}
|
||||
|
||||
public void setHongbao(String hongbao) {
|
||||
this.hongbao = hongbao;
|
||||
}
|
||||
|
||||
String hongbao=null;
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
String message="";
|
||||
|
||||
public String getMessageSource() {
|
||||
return messageSource;
|
||||
}
|
||||
|
||||
public void setMessageSource(String messageSource) {
|
||||
this.messageSource = messageSource;
|
||||
}
|
||||
|
||||
String messageSource="";//消息来源 2.调拨客户
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/17
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class customerDetailBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* result : {"msg":"成功","data":{"address":"陕西省西安市未央区某某路","headimg":"localhost/upload/2020081115530962805.jpg","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","source":"1","style_id":"1","decoration":"1","style_name":"北欧","budget":"120"},"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 成功
|
||||
* data : {"address":"陕西省西安市未央区某某路","headimg":"localhost/upload/2020081115530962805.jpg","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","source":"1","style_id":"1","decoration":"1","style_name":"北欧","budget":"120"}
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
private int success;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public DataBean getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataBean data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* address : 陕西省西安市未央区某某路
|
||||
* headimg : localhost/upload/2020081115530962805.jpg
|
||||
* phone : 18831913290
|
||||
* name : demo
|
||||
* wechat : wangyuxin283425757
|
||||
* source : 1
|
||||
* style_id : 1
|
||||
* decoration : 1
|
||||
* style_name : 北欧
|
||||
* budget : 120
|
||||
*/
|
||||
|
||||
private String address;
|
||||
private String headimg;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String wechat;
|
||||
private String source;
|
||||
private String style_id;
|
||||
private String decoration;
|
||||
private String style_name;
|
||||
private String budget;
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimg;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimg = headimg;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getWechat() {
|
||||
return wechat;
|
||||
}
|
||||
|
||||
public void setWechat(String wechat) {
|
||||
this.wechat = wechat;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getStyle_id() {
|
||||
return style_id;
|
||||
}
|
||||
|
||||
public void setStyle_id(String style_id) {
|
||||
this.style_id = style_id;
|
||||
}
|
||||
|
||||
public String getDecoration() {
|
||||
return decoration;
|
||||
}
|
||||
|
||||
public void setDecoration(String decoration) {
|
||||
this.decoration = decoration;
|
||||
}
|
||||
|
||||
public String getStyle_name() {
|
||||
return style_name;
|
||||
}
|
||||
|
||||
public void setStyle_name(String style_name) {
|
||||
this.style_name = style_name;
|
||||
}
|
||||
|
||||
public String getBudget() {
|
||||
return budget;
|
||||
}
|
||||
|
||||
public void setBudget(String budget) {
|
||||
this.budget = budget;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/17
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class customerFPListBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* result : {"msg":"获取成功","data":[{"headimg":"localhost/upload/2020081115530962805.jpg","fp_num":"0","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","customer_id":"ae0c5199fdf564f90796aec09482b85d"}],"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 获取成功
|
||||
* data : [{"headimg":"localhost/upload/2020081115530962805.jpg","fp_num":"0","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","customer_id":"ae0c5199fdf564f90796aec09482b85d"}]
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int success;
|
||||
private List<DataBean> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* headimg : localhost/upload/2020081115530962805.jpg
|
||||
* fp_num : 0
|
||||
* phone : 18831913290
|
||||
* name : demo
|
||||
* wechat : wangyuxin283425757
|
||||
* customer_id : ae0c5199fdf564f90796aec09482b85d
|
||||
*/
|
||||
|
||||
private String headimg;
|
||||
private String fp_num;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String wechat;
|
||||
private String customer_id;
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimg;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimg = headimg;
|
||||
}
|
||||
|
||||
public String getFp_num() {
|
||||
return fp_num;
|
||||
}
|
||||
|
||||
public void setFp_num(String fp_num) {
|
||||
this.fp_num = fp_num;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getWechat() {
|
||||
return wechat;
|
||||
}
|
||||
|
||||
public void setWechat(String wechat) {
|
||||
this.wechat = wechat;
|
||||
}
|
||||
|
||||
public String getCustomer_id() {
|
||||
return customer_id;
|
||||
}
|
||||
|
||||
public void setCustomer_id(String customer_id) {
|
||||
this.customer_id = customer_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
public class fenpeisuccess {
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
String msg="";
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
String message="";
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/20
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class industryBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* result : {"msg":"成功","data":[{"industry_id":"1","industry":"家具"}],"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 成功
|
||||
* data : [{"industry_id":"1","industry":"家具"}]
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int success;
|
||||
private List<DataBean> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* industry_id : 1
|
||||
* industry : 家具
|
||||
*/
|
||||
|
||||
private String industry_id;
|
||||
private String industry;
|
||||
|
||||
public String getIndustry_id() {
|
||||
return industry_id;
|
||||
}
|
||||
|
||||
public void setIndustry_id(String industry_id) {
|
||||
this.industry_id = industry_id;
|
||||
}
|
||||
|
||||
public String getIndustry() {
|
||||
return industry;
|
||||
}
|
||||
|
||||
public void setIndustry(String industry) {
|
||||
this.industry = industry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/4/13.
|
||||
*/
|
||||
|
||||
public class markingYiliushi extends BaseModel {
|
||||
|
||||
private int status;
|
||||
private ResultBean result;
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* success : 0
|
||||
* msg : 获取信息成功
|
||||
* data : [{"fistname":"李","name":"四","sex":"1","phone":"15826932658","marknamesec":"","record_id":"08db435b44162d09ec6c5e27d03b5b19","visitor_id":"a1c6c99e6f8a48119914a7d2d085fe89","record_time":"2018-03-08 16:34:55","visitor_head_img":"http://www.fenghoo.cn/images/articleImg/ZPJ15119502816390003342201803081634558137.jpg","store_id":"941f449de63cbd429dd18d9882febfa0","store_name":"红星美凯龙太白店荣麟京瓷","uuid":"0a10f99c198b3cb659a62a765c83c648","loss":"跑啦"},{"fistname":"王","name":"五","sex":"1","phone":"14758989869","marknamesec":"","record_id":"8bf7b195614b54f005356fb3b029ba37","visitor_id":"dd1d9b38a4d246fbb46f2043424f904a","record_time":"2018-03-08 16:19:44","visitor_head_img":"http://www.fenghoo.cn/images/articleImg/ZPJ15119502816390003342201803081619447061.jpg","store_id":"941f449de63cbd429dd18d9882febfa0","store_name":"红星美凯龙太白店荣麟京瓷","uuid":"0a10f99c198b3cb659a62a765c83c648","loss":"丢啦"},{"fistname":"李","name":"宁","sex":"2","phone":"13265985623","marknamesec":"","record_id":"2aa4c1cb8980e48d62513795e1816e23","visitor_id":"ea8c4fb7c3db4a95a2ed0578f301694e","record_time":"2018-03-08 16:10:39","visitor_head_img":"http://www.fenghoo.cn/images/articleImg/ZPJ15119502816390003342201803081610395112.jpg","store_id":"941f449de63cbd429dd18d9882febfa0","store_name":"红星美凯龙太白店荣麟京瓷","uuid":"0a10f99c198b3cb659a62a765c83c648","loss":"扔啦"}]
|
||||
*/
|
||||
|
||||
private int success;
|
||||
private String msg;
|
||||
private List<DataBean> data;
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* fistname : 李
|
||||
* name : 四
|
||||
* sex : 1
|
||||
* phone : 15826932658
|
||||
* marknamesec :
|
||||
* record_id : 08db435b44162d09ec6c5e27d03b5b19
|
||||
* visitor_id : a1c6c99e6f8a48119914a7d2d085fe89
|
||||
* record_time : 2018-03-08 16:34:55
|
||||
* visitor_head_img : http://www.fenghoo.cn/images/articleImg/ZPJ15119502816390003342201803081634558137.jpg
|
||||
* store_id : 941f449de63cbd429dd18d9882febfa0
|
||||
* store_name : 红星美凯龙太白店荣麟京瓷
|
||||
* uuid : 0a10f99c198b3cb659a62a765c83c648
|
||||
* loss : 跑啦
|
||||
*/
|
||||
|
||||
private String fistname;
|
||||
private String name;
|
||||
private String sex;
|
||||
private String phone;
|
||||
private String marknamesec;
|
||||
private String record_id;
|
||||
private String visitor_id;
|
||||
private String record_time;
|
||||
private String visitor_head_img;
|
||||
private String store_id;
|
||||
private String store_name;
|
||||
private String uuid;
|
||||
private String loss;
|
||||
private String user_name;
|
||||
|
||||
public String getUser_name() {
|
||||
return user_name;
|
||||
}
|
||||
|
||||
public void setUser_name(String user_name) {
|
||||
this.user_name = user_name;
|
||||
}
|
||||
|
||||
public String getFistname() {
|
||||
return fistname;
|
||||
}
|
||||
|
||||
public void setFistname(String fistname) {
|
||||
this.fistname = fistname;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getMarknamesec() {
|
||||
return marknamesec;
|
||||
}
|
||||
|
||||
public void setMarknamesec(String marknamesec) {
|
||||
this.marknamesec = marknamesec;
|
||||
}
|
||||
|
||||
public String getRecord_id() {
|
||||
return record_id;
|
||||
}
|
||||
|
||||
public void setRecord_id(String record_id) {
|
||||
this.record_id = record_id;
|
||||
}
|
||||
|
||||
public String getVisitor_id() {
|
||||
return visitor_id;
|
||||
}
|
||||
|
||||
public void setVisitor_id(String visitor_id) {
|
||||
this.visitor_id = visitor_id;
|
||||
}
|
||||
|
||||
public String getRecord_time() {
|
||||
return record_time;
|
||||
}
|
||||
|
||||
public void setRecord_time(String record_time) {
|
||||
this.record_time = record_time;
|
||||
}
|
||||
|
||||
public String getVisitor_head_img() {
|
||||
return visitor_head_img;
|
||||
}
|
||||
|
||||
public void setVisitor_head_img(String visitor_head_img) {
|
||||
this.visitor_head_img = visitor_head_img;
|
||||
}
|
||||
|
||||
public String getStore_id() {
|
||||
return store_id;
|
||||
}
|
||||
|
||||
public void setStore_id(String store_id) {
|
||||
this.store_id = store_id;
|
||||
}
|
||||
|
||||
public String getStore_name() {
|
||||
return store_name;
|
||||
}
|
||||
|
||||
public void setStore_name(String store_name) {
|
||||
this.store_name = store_name;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getLoss() {
|
||||
return loss;
|
||||
}
|
||||
|
||||
public void setLoss(String loss) {
|
||||
this.loss = loss;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/18
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class orderListBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* result : {"msg":"获取成功","data":[{"headimg":"localhost/upload/2020081115530962805.jpg","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","order_num":"1","customer_id":"ae0c5199fdf564f90796aec09482b85d"}],"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 获取成功
|
||||
* data : [{"headimg":"localhost/upload/2020081115530962805.jpg","phone":"18831913290","name":"demo","wechat":"wangyuxin283425757","order_num":"1","customer_id":"ae0c5199fdf564f90796aec09482b85d"}]
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int success;
|
||||
private List<DataBean> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* headimg : localhost/upload/2020081115530962805.jpg
|
||||
* phone : 18831913290
|
||||
* name : demo
|
||||
* wechat : wangyuxin283425757
|
||||
* order_num : 1
|
||||
* customer_id : ae0c5199fdf564f90796aec09482b85d
|
||||
*/
|
||||
|
||||
private String headimg;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String wechat;
|
||||
private String order_num;
|
||||
private String customer_id;
|
||||
|
||||
public String getHeadimg() {
|
||||
return headimg;
|
||||
}
|
||||
|
||||
public void setHeadimg(String headimg) {
|
||||
this.headimg = headimg;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getWechat() {
|
||||
return wechat;
|
||||
}
|
||||
|
||||
public void setWechat(String wechat) {
|
||||
this.wechat = wechat;
|
||||
}
|
||||
|
||||
public String getOrder_num() {
|
||||
return order_num;
|
||||
}
|
||||
|
||||
public void setOrder_num(String order_num) {
|
||||
this.order_num = order_num;
|
||||
}
|
||||
|
||||
public String getCustomer_id() {
|
||||
return customer_id;
|
||||
}
|
||||
|
||||
public void setCustomer_id(String customer_id) {
|
||||
this.customer_id = customer_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.fenghoo.seven.main.kehu.Bean;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
public class uploadImgBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* status : 0
|
||||
* result : {"success":0,"img":"http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__31__2019123117282518691.jpg","msg":"成功"}
|
||||
*/
|
||||
|
||||
private int status;
|
||||
private ResultBean result;
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* success : 0
|
||||
* img : http://www.fenghoo.com.cn:88/file.php?img=vr__2019__12__31__2019123117282518691.jpg
|
||||
* msg : 成功
|
||||
*/
|
||||
|
||||
private int success;
|
||||
private String img;
|
||||
private String msg;
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.fenghoo.seven.main.kehu;
|
||||
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.BaseTipsDialog;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.main.kehu.Dialog.CusOperationDialog;
|
||||
import com.fenghoo.seven.main.kehu.activity.ShowAty;
|
||||
import com.fenghoo.seven.main.kehu.adapter.CusListAdapter;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
/**
|
||||
* 客户列表
|
||||
*/
|
||||
public class CustomerFragment extends MobanFragment {
|
||||
|
||||
private static int mSerial = 0;
|
||||
private int mTabPos = 0;
|
||||
public CustomerFragment(int serial) {
|
||||
super();
|
||||
mSerial = serial;
|
||||
}
|
||||
public void setTabPos(int mTabPos) {
|
||||
this.mTabPos = mTabPos;
|
||||
}
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
CusListAdapter markingtwoAdapter = new CusListAdapter(mContext, null);
|
||||
getAdpter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
markingtwoAdapter.operationListenner(new CusListAdapter.OnViewClickListener() {
|
||||
@Override
|
||||
public void operation(final CustomerListBean.ResultBean.DataBean item) {
|
||||
new CusOperationDialog(getActivity(), R.style.dialog, new CusOperationDialog.OnCloseListener() {
|
||||
@Override
|
||||
public void phoneClick() {//拨打电话
|
||||
if (item.getPhone() != null) {
|
||||
call(item.getPhone());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kaidanonClick() {//删除客户
|
||||
new BaseTipsDialog().showDownloadDialog(getActivity(), "确认删除该客户吗?", "确定", new BaseTipsDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
Toast.makeText(getActivity(), "还没调接口", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancle() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//信息完善
|
||||
@Override
|
||||
public void uploadAvatar() {
|
||||
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterCusDetail(CustomerListBean.ResultBean.DataBean item) {
|
||||
//进入客户详情
|
||||
ShowAty.CustomerDetailActivity(getActivity(),item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
new NetApi().customerList(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid(),"").subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
CustomerListBean.ResultBean result = JsonUtils.fromJson(body, CustomerListBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (result != null && String.valueOf(result.getSuccess()).equals("0")) {
|
||||
|
||||
List<CustomerListBean.ResultBean.DataBean> data = result.getData();
|
||||
// List<CustomerListBean.ResultBean.DataBean> data = new ArrayList<CustomerListBean.ResultBean.DataBean>();
|
||||
// for (int i = 0; i < 20; i++)
|
||||
// {
|
||||
// CustomerListBean.ResultBean.DataBean dataBean = new CustomerListBean.ResultBean.DataBean();
|
||||
// dataBean.setName("小斐");
|
||||
// dataBean.setPhone("15862656263");
|
||||
// dataBean.setSource_name("添加客户");
|
||||
// dataBean.setWechat("weixin");
|
||||
// dataBean.setHeadimg("");
|
||||
// dataBean.setSource("1");
|
||||
// dataBean.setType("old");
|
||||
// data.add(dataBean);
|
||||
// }
|
||||
|
||||
if (data.size() == 0) {
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
}
|
||||
} else {
|
||||
setData(true, null);
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.fenghoo.seven.main.kehu;
|
||||
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.main.kehu.Bean.orderListBean;
|
||||
import com.fenghoo.seven.main.kehu.adapter.DeaListAdapter;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
/**
|
||||
* 成交列表
|
||||
*/
|
||||
|
||||
public class DealFragment extends MobanFragment {
|
||||
|
||||
private static int mSerial = 0;
|
||||
private int mTabPos = 0;
|
||||
public DealFragment(int serial) {
|
||||
super();
|
||||
mSerial = serial;
|
||||
}
|
||||
public void setTabPos(int mTabPos) {
|
||||
this.mTabPos = mTabPos;
|
||||
}
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
DeaListAdapter markingtwoAdapter = new DeaListAdapter(mContext, null);
|
||||
getAdpter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
new NetApi().orderList(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid(),"").subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
orderListBean.ResultBean result = JsonUtils.fromJson(body, orderListBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (result != null && String.valueOf(result.getSuccess()).equals("0")) {
|
||||
|
||||
List<orderListBean.ResultBean.DataBean> data = result.getData();
|
||||
|
||||
if (data.size() == 0) {
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
}
|
||||
} else {
|
||||
setData(true, null);
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.fenghoo.seven.main.kehu.Dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
|
||||
public class CusOperationDialog extends Dialog implements View.OnClickListener {
|
||||
|
||||
private Context mContext;
|
||||
private OnCloseListener listener;
|
||||
private TextView bt_draining_kehu;
|
||||
private RelativeLayout rl_tv_kaidan,rl_tv_uploadAvatar;
|
||||
private TextView tv_cancel;
|
||||
private ImageView img_hongdian_bg;
|
||||
private ImageView img_hongdian_kai;
|
||||
private LinearLayout ly_kaidan;
|
||||
|
||||
public CusOperationDialog(Context context) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
public CusOperationDialog(Context context, int themeResId, OnCloseListener listener) {
|
||||
super(context, themeResId);
|
||||
this.mContext = context;
|
||||
this.listener = listener;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.qiangdan_dialog);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
window.getDecorView().setPadding(0, 0, 0, 0);
|
||||
WindowManager.LayoutParams layoutParams = window.getAttributes();
|
||||
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
layoutParams.horizontalMargin = 0;
|
||||
window.setAttributes(layoutParams);
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
bt_draining_kehu = (TextView) findViewById(R.id.bt_draining_kehu);
|
||||
bt_draining_kehu.setOnClickListener(this);
|
||||
rl_tv_kaidan = (RelativeLayout) findViewById(R.id.rl_tv_kaidan);
|
||||
rl_tv_kaidan.setOnClickListener(this);
|
||||
rl_tv_uploadAvatar = (RelativeLayout) findViewById(R.id.rl_tv_uploadAvatar);
|
||||
rl_tv_uploadAvatar.setOnClickListener(this);
|
||||
tv_cancel = (TextView) findViewById(R.id.tv_cancel);
|
||||
tv_cancel.setOnClickListener(this);
|
||||
ly_kaidan = (LinearLayout) findViewById(R.id.ly_kaidan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.bt_draining_kehu://拨打电话
|
||||
if (listener != null) {
|
||||
listener.phoneClick();
|
||||
}
|
||||
dismiss();
|
||||
break;
|
||||
case R.id.rl_tv_kaidan://开单
|
||||
if (listener != null) {
|
||||
listener.kaidanonClick();
|
||||
}
|
||||
dismiss();
|
||||
break;
|
||||
case R.id.rl_tv_uploadAvatar://上传头像
|
||||
if (listener != null) {
|
||||
listener.uploadAvatar();
|
||||
}
|
||||
dismiss();
|
||||
break;
|
||||
case R.id.tv_cancel://取消
|
||||
this.dismiss();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public interface OnCloseListener {
|
||||
|
||||
void phoneClick();
|
||||
void kaidanonClick();
|
||||
void uploadAvatar();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.fenghoo.seven.main.kehu;
|
||||
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.main.kehu.Bean.FpListBean;
|
||||
import com.fenghoo.seven.main.kehu.adapter.DisListAdapter;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
/**
|
||||
* 分配列表
|
||||
*/
|
||||
public class DistriFragment extends MobanFragment {
|
||||
|
||||
private static int mSerial = 0;
|
||||
private int mTabPos = 0;
|
||||
public DistriFragment(int serial) {
|
||||
super();
|
||||
mSerial = serial;
|
||||
}
|
||||
public void setTabPos(int mTabPos) {
|
||||
this.mTabPos = mTabPos;
|
||||
}
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
DisListAdapter markingtwoAdapter = new DisListAdapter(mContext, null);
|
||||
getAdpter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
new NetApi().fpList(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid(),"").subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
FpListBean.ResultBean result = JsonUtils.fromJson(body, FpListBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (result != null && String.valueOf(result.getSuccess()).equals("0")) {
|
||||
List<FpListBean.ResultBean.DataBean> data = result.getData();
|
||||
if (data.size() == 0) {
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
}
|
||||
} else {
|
||||
setData(true, null);
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
173
app/src/main/java/com/fenghoo/seven/main/kehu/MobanFragment.java
Normal file
173
app/src/main/java/com/fenghoo/seven/main/kehu/MobanFragment.java
Normal file
@@ -0,0 +1,173 @@
|
||||
package com.fenghoo.seven.main.kehu;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseFragment;
|
||||
import com.fenghoo.seven.main.entity.Savaselect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
|
||||
@SuppressLint("ValidFragment")
|
||||
public abstract class MobanFragment extends BaseFragment {
|
||||
public static final String ARG_PAGE = "ARG_PAGE";
|
||||
private boolean IS_LOADED = false;
|
||||
private static int mSerial = 0;
|
||||
private boolean isFirst = true;
|
||||
@SuppressLint("HandlerLeak")
|
||||
private Handler handler = new Handler() {
|
||||
public void handleMessage(Message msg) {
|
||||
Log.e("tag", "IS_LOADED=" + IS_LOADED);
|
||||
if (!IS_LOADED) {
|
||||
IS_LOADED = true;
|
||||
//请求我的客户已流失数据
|
||||
requesdata();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
public Savaselect savaselectbean;
|
||||
private RelativeLayout rl_top;
|
||||
private RelativeLayout layTop_left_tv;
|
||||
|
||||
public MobanFragment() {
|
||||
|
||||
}
|
||||
public BaseQuickAdapter markingtwoAdapter;
|
||||
public void sendMessage() {
|
||||
Message message = handler.obtainMessage();
|
||||
message.sendToTarget();
|
||||
}
|
||||
|
||||
private String uid;
|
||||
public RecyclerView mMarkingFragmentRecyclerView;
|
||||
public SwipeRefreshLayout mSwl;
|
||||
public int mNextRequestPage = 1;
|
||||
private static final int PAGE_SIZE = 10;
|
||||
View view;
|
||||
public View notDataView;
|
||||
public View errorView;
|
||||
public TextView mLayTopTitle;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mContext = getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
if (view != null) {
|
||||
ViewGroup parent = (ViewGroup) view.getParent();
|
||||
if (parent != null) {
|
||||
parent.removeView(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
view = inflater.inflate(R.layout.kehumobanfragment, container, false);
|
||||
initView(view);
|
||||
//设置页和当前页一致时加载,防止预加载
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
sendMessage();
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initView(View mContentView) {
|
||||
mMarkingFragmentRecyclerView = (RecyclerView) view.findViewById(R.id.marking_fragment_recyclerView);
|
||||
mSwl = mContentView.findViewById(R.id.srl);
|
||||
notDataView = getActivity().getLayoutInflater().inflate(R.layout.empty_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
|
||||
notDataView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// refresh();
|
||||
}
|
||||
});
|
||||
errorView = getActivity().getLayoutInflater().inflate(R.layout.error_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
|
||||
errorView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// onRefresh();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void requesdata() {
|
||||
initAdapter();
|
||||
initRefreshLayout();
|
||||
mSwl.setRefreshing(true);
|
||||
refresh();
|
||||
}
|
||||
|
||||
public abstract void initAdapter();
|
||||
|
||||
|
||||
private void initRefreshLayout() {
|
||||
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refresh() {
|
||||
mNextRequestPage = 1;
|
||||
markingtwoAdapter.setEnableLoadMore(false);//这里的作用是防止下拉刷新的时候还可以上拉加载
|
||||
requestData();
|
||||
}
|
||||
|
||||
public void loadMore() {
|
||||
requestData();
|
||||
}
|
||||
|
||||
public void setData(boolean isRefresh, List data) {
|
||||
mNextRequestPage++;
|
||||
final int size = data == null ? 0 : data.size();
|
||||
if (isRefresh) {
|
||||
markingtwoAdapter.setNewData(data);
|
||||
} else {
|
||||
if (size > 0) {
|
||||
markingtwoAdapter.addData(data);
|
||||
}
|
||||
}
|
||||
if (size < PAGE_SIZE) {
|
||||
//第一页如果不够一页就不显示没有更多数据布局
|
||||
markingtwoAdapter.loadMoreEnd(isRefresh);
|
||||
} else {
|
||||
markingtwoAdapter.loadMoreComplete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract void requestData();
|
||||
|
||||
public void getAdpter(BaseQuickAdapter markingtwoAdapter){
|
||||
this.markingtwoAdapter=markingtwoAdapter;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
188
app/src/main/java/com/fenghoo/seven/main/kehu/TraceFragment.java
Normal file
188
app/src/main/java/com/fenghoo/seven/main/kehu/TraceFragment.java
Normal file
@@ -0,0 +1,188 @@
|
||||
package com.fenghoo.seven.main.kehu;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.entity.Savaselect;
|
||||
import com.fenghoo.seven.main.kehu.activity.ShowAty;
|
||||
import com.fenghoo.seven.test.BaseFragment;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
/**
|
||||
* 功能:追踪模块
|
||||
* Created by jianbo .
|
||||
* on 2017/8/31.
|
||||
*/
|
||||
|
||||
@SuppressLint("ValidFragment")
|
||||
public class TraceFragment extends BaseFragment implements View.OnClickListener {
|
||||
ViewPager viewPager;
|
||||
TabLayout tab;
|
||||
int curTab = 0;
|
||||
private boolean IS_LOADED = false;
|
||||
private ArrayList<Pair<String, Fragment>> items;
|
||||
private CustomerFragment genzongzhongFragment;
|
||||
private DistriFragment yiliushiFragment;
|
||||
private DealFragment yichengjiaoFragment;
|
||||
private Savaselect savaselect;
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
private Handler handler = new Handler() {
|
||||
|
||||
public void handleMessage(Message msg) {
|
||||
Log.e("tag", "IS_LOADED=" + IS_LOADED);
|
||||
if (!IS_LOADED) {
|
||||
IS_LOADED = true;
|
||||
savaselect = new Savaselect();
|
||||
items = new ArrayList<>();
|
||||
genzongzhongFragment = new CustomerFragment(curTab);
|
||||
genzongzhongFragment.setTabPos(0);
|
||||
items.add(new Pair<String, Fragment>("客户列表", genzongzhongFragment));
|
||||
yiliushiFragment = new DistriFragment(curTab);
|
||||
yiliushiFragment.setTabPos(1);
|
||||
items.add(new Pair<String, Fragment>("分配列表", yiliushiFragment));
|
||||
yichengjiaoFragment = new DealFragment(curTab);
|
||||
yichengjiaoFragment.setTabPos(2);
|
||||
items.add(new Pair<String, Fragment>("成交列表", yichengjiaoFragment));
|
||||
final MyAdaptertwo myAdaptertwo = new MyAdaptertwo(getChildFragmentManager());
|
||||
//mViewPager滑动监听
|
||||
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
}
|
||||
@Override
|
||||
public void onPageSelected(final int position) {
|
||||
Log.i("TAG", "position:" + position);
|
||||
if (position == 0) {
|
||||
mBtSousuoDitu.setVisibility(View.VISIBLE);
|
||||
((CustomerFragment) myAdaptertwo.getItem(position)).sendMessage();
|
||||
} else if (position == 1) {
|
||||
mBtSousuoDitu.setVisibility(View.GONE);
|
||||
((DistriFragment) myAdaptertwo.getItem(position)).sendMessage();
|
||||
} else {
|
||||
mBtSousuoDitu.setVisibility(View.GONE);
|
||||
((DealFragment) myAdaptertwo.getItem(position)).sendMessage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
viewPager.setAdapter(myAdaptertwo);
|
||||
tab.setupWithViewPager(viewPager);
|
||||
|
||||
// //设置下划线高度,宽度跟随tab的宽度
|
||||
// tab.setSelectedTabIndicatorHeight(10);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private RelativeLayout mBtSousuoDitu;
|
||||
private RelativeLayout mTitlebar;
|
||||
private String uid;
|
||||
private String clerkposition;
|
||||
private RelativeLayout mEnterShopShai;
|
||||
private TextView enter_shop_shaixuan;
|
||||
private TextView mEnterShopTitle;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mContext = getActivity();
|
||||
}
|
||||
|
||||
public void sendMessage() {
|
||||
Message message = handler.obtainMessage();
|
||||
message.sendToTarget();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_kehu, container, false);
|
||||
viewPager = (ViewPager) view.findViewById(R.id.main_vp);
|
||||
tab = (TabLayout) view.findViewById(R.id.main_tab_layout);
|
||||
sendMessage();
|
||||
initView(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
mBtSousuoDitu = (RelativeLayout) view.findViewById(R.id.bt_sousuo_ditu);
|
||||
mBtSousuoDitu.setOnClickListener(this);
|
||||
mTitlebar = (RelativeLayout) view.findViewById(R.id.titlebar);
|
||||
mTitlebar.setOnClickListener(this);
|
||||
mEnterShopShai = (RelativeLayout) view.findViewById(R.id.enter_shop_shai);
|
||||
mEnterShopShai.setOnClickListener(this);
|
||||
mEnterShopTitle = (TextView) view.findViewById(R.id.enter_shop_title);
|
||||
mEnterShopTitle.setOnClickListener(this);
|
||||
enter_shop_shaixuan = (TextView) view.findViewById(R.id.enter_shop_shaixuan);
|
||||
RelativeLayout bt_fenpei = (RelativeLayout)view.findViewById(R.id.bt_fenpei);
|
||||
bt_fenpei.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
default:
|
||||
break;
|
||||
case R.id.bt_sousuo_ditu:
|
||||
ShowAty.SearchActivity(getActivity());
|
||||
break;
|
||||
case R.id.enter_shop_shai:
|
||||
break;
|
||||
case R.id.bt_fenpei:
|
||||
ShowAty.AllocationActivity(getActivity());
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class MyAdaptertwo extends FragmentPagerAdapter {
|
||||
|
||||
public MyAdaptertwo(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return items.get(position).second;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return items.get(position).first;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user