245个文件已修改
93个文件已添加
4 文件已重命名
8个文件已删除
| | |
| | | </deviceKey> |
| | | </Target> |
| | | </targetSelectedWithDropDown> |
| | | <timeTargetWasSelectedWithDropDown value="2023-04-24T13:39:33.778993800Z" /> |
| | | <timeTargetWasSelectedWithDropDown value="2023-06-02T09:12:50.343936200Z" /> |
| | | </component> |
| | | </project> |
| | |
| | | <profile version="1.0"> |
| | | <option name="myName" value="Project Default" /> |
| | | <inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true"> |
| | | <option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,okhttp3.Interceptor.Chain,proceed" /> |
| | | <option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,okhttp3.Interceptor.Chain,proceed,android.content.Context,obtainStyledAttributes" /> |
| | | </inspection_tool> |
| | | <inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true"> |
| | | <option name="ADDITIONAL_TAGS" value="date,desc" /> |
| | |
| | | minSdk 24 |
| | | targetSdk 33 |
| | | versionCode 1 |
| | | versionName "1.0" |
| | | |
| | | versionName getVersionName() |
| | | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| | | } |
| | | signingConfigs { |
| | |
| | | implementation project(path: ':app_base') |
| | | |
| | | } |
| | | |
| | | def getVersionName() { |
| | | return new Date().format("yyyyMMddHHmmss", TimeZone.getTimeZone("UTC")) |
| | | } |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | > |
| | | <!-- 网络相关 --> |
| | | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| | | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> |
| | |
| | | <uses-permission android:name="android.permission.RECORD_AUDIO" /> <!-- Android 13版本适配,细化存储权限,READ_EXTERNAL_STORAGE无法再使用 --> |
| | | <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> |
| | | <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" /> |
| | | <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <!-- 震动权限 --> |
| | | <uses-permission android:name="android.permission.VIBRATE" /> <!-- 蓝牙权限 --> |
| | | <uses-permission android:name="android.permission.BLUETOOTH" /> <!-- 拍照权限 --> |
| | | <uses-permission android:name="android.permission.CAMERA" /> <!-- 安装权限 --> |
| | | <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <!-- 定位权限(用于 WebView 定位) --> |
| | | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
| | | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> |
| | | <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> |
| | | <!-- <uses-permission android:name="android.permission.VIBRATE" /> <!– 震动权限 –>--> |
| | | <!-- <uses-permission android:name="android.permission.BLUETOOTH" /> <!– 蓝牙权限 –>--> |
| | | <uses-permission android:name="android.permission.CAMERA" /> <!-- 拍照权限 --> |
| | | <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <!-- 安装权限 --> |
| | | <!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /><!– 定位权限(用于 WebView 定位) –>--> |
| | | <!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />--> |
| | | |
| | | <queries package="${applicationId}"> |
| | | <intent> |
| | |
| | | android:theme="@style/Theme.app" |
| | | android:usesCleartextTraffic="true" |
| | | tools:targetApi="31"> |
| | | |
| | | <!-- 沉浸式状态栏全面屏 --> |
| | | <meta-data |
| | | android:name="android.max_aspect" |
| | |
| | | android:name="design_height_in_dp" |
| | | android:value="640" /> |
| | | |
| | | <!-- 安装APP --> |
| | | <provider |
| | | android:name="androidx.core.content.FileProvider" |
| | | android:authorities="${applicationId}.fileprovider" |
| | | android:exported="false" |
| | | android:grantUriPermissions="true"> |
| | | <meta-data |
| | | android:name="android.support.FILE_PROVIDER_PATHS" |
| | | android:resource="@xml/file_paths" /> |
| | | </provider> |
| | | |
| | | <activity |
| | | android:name=".ui.main.MainActivity" |
| | | android:exported="true" /> |
| | | android:exported="true" |
| | | android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" |
| | | /> |
| | | <activity |
| | | android:name=".ui.login.LoginActivity" |
| | | android:exported="true" |
| | |
| | | android:name=".ui.function.FamilyMemorabiliaActivity" |
| | | android:exported="false" /> |
| | | <activity |
| | | android:name=".ui.function.CreateFamilyProjectActivity" |
| | | android:name=".ui.function.FamilyMemorabiliaDetailActivity" |
| | | android:exported="false" /> |
| | | <activity |
| | | android:name=".ui.function.FamilyAssetsActivity" |
| | |
| | | android:name=".ui.function.MarriageActivity" |
| | | android:exported="false" /> |
| | | <activity |
| | | android:name=".ui.function.PetActivity" |
| | | android:name=".ui.function.PetDetailActivity" |
| | | android:exported="false" /> |
| | | <activity |
| | | android:name=".ui.function.PetMemoActivity" |
| | |
| | | <activity |
| | | android:name=".ui.function.PersonalNotepadDetailActivity" |
| | | android:exported="false" /> |
| | | <activity |
| | | android:name=".ui.function.PetActivity" |
| | | android:exported="false" /> |
| | | <activity android:name=".ui.home.GenealogyActivity" |
| | | android:exported="false"/> |
| | | <activity android:name=".ui.TestActivity" |
| | | /> |
| | | <activity android:name=".ui.personal_center.LoginBgChangeActivity" |
| | | android:exported="false"/> |
| | | </application> |
| | | |
| | | </manifest> |
| | |
| | | |
| | | import com.android.app_base.base.BaseApplication; |
| | | import com.application.zhangshi_app_android.other.MyTitleBarStyle; |
| | | import com.github.gzuliyujiang.dialog.DialogColor; |
| | | import com.github.gzuliyujiang.dialog.DialogConfig; |
| | | import com.github.gzuliyujiang.dialog.DialogStyle; |
| | | import com.hjq.bar.TitleBar; |
| | | |
| | | //import me.jessyan.autosize.AutoSizeConfig; |
| | |
| | | super.onCreate(); |
| | | // 初始化 TitleBar 默认样式 |
| | | TitleBar.setDefaultStyle(new MyTitleBarStyle()); |
| | | |
| | | DialogConfig.setDialogStyle(DialogStyle.Three); |
| | | DialogConfig.setDialogColor(new DialogColor() |
| | | .cancelTextColor(0xFF999999) |
| | | .okTextColor(0xFF2B83DD)); |
| | | } |
| | | } |
| | |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemAnnualHealthStatusBinding; |
| | | import com.application.zhangshi_app_android.ui.function.AnnualHealthStatusActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.AnnualHealthStatusDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.28. 19:20 |
| | | * @desc |
| | | * @desc 年度健康状况适配器 |
| | | */ |
| | | public class AnnualHealthStatusRvAdapter extends BaseRVAdapter<AnnualHealthStatusBean, ItemAnnualHealthStatusBinding, AnnualHealthStatusRvAdapter.ViewHolder> { |
| | | public AnnualHealthStatusRvAdapter(Context context) { |
| | | private AnnualHealthStatusActivityViewModel viewModel; |
| | | private final Map<AnnualHealthStatusBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | public AnnualHealthStatusRvAdapter(Context context, AnnualHealthStatusActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<AnnualHealthStatusBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), AnnualHealthStatusDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), AnnualHealthStatusDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | } |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyDataSetChanged(); |
| | | } |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemAnnualHealthStatusBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemAnnualHealthStatusBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemCertificateOfHonorBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CertificateOfHonorDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 荣誉证书 Adapter |
| | | */ |
| | | public class CertificateOfHonorRvAdapter extends BaseRVAdapter<CertificateOfHonorBean, ItemCertificateOfHonorBinding, CertificateOfHonorRvAdapter.ViewHolder> { |
| | | private final Map<CertificateOfHonorBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public CertificateOfHonorRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), CertificateOfHonorDetailActivity.class) |
| | | new Intent(getRecyclerView().getContext(), FamilyAssetsDetailActivity.class) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemCertificateOfHonorBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemCertificateOfHonorBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemCleanStorageBinding; |
| | | import com.application.zhangshi_app_android.databinding.ItemFamilyAssetsBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageActivity; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class CleanStorageRvAdapter extends BaseRVAdapter<CleanStorageBean, ItemCleanStorageBinding, CleanStorageRvAdapter.ViewHolder>{ |
| | | public CleanStorageRvAdapter(Context context) { |
| | | private CleanStorageActivityViewModel viewModel; |
| | | private final Map<CleanStorageBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | public CleanStorageRvAdapter(Context context, CleanStorageActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<CleanStorageBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), CleanStorageDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), CleanStorageDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemCleanStorageBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemCleanStorageBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.text.Editable; |
| | | import android.text.TextWatcher; |
| | | import android.view.View; |
| | | |
| | | import androidx.lifecycle.LifecycleOwner; |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.utils.rxbus.MessageEvent; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.ConsumeRecordBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemConsumeRecordBinding; |
| | | import com.application.zhangshi_app_android.ui.function.TourismDetailActivityViewModel; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 消费记录适配器 |
| | | */ |
| | | public class ConsumeRecordRvAdapter extends BaseRVAdapter<ConsumeRecordBean, ItemConsumeRecordBinding,BaseRVAdapter.BaseViewHolder<ItemConsumeRecordBinding>> { |
| | | public ConsumeRecordRvAdapter(Context context) { |
| | | private TourismDetailActivityViewModel viewModel; |
| | | |
| | | public ConsumeRecordRvAdapter(Context context,TourismDetailActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | protected void onBind(BaseViewHolder<ItemConsumeRecordBinding> holder, int position) { |
| | | ConsumeRecordBean item = getItem(position); |
| | | holder.getBinding().setLifecycleOwner((LifecycleOwner) mContext); |
| | | holder.getBinding().setBean(getItem(position)); |
| | | holder.getBinding().setViewModel(viewModel); |
| | | holder.getBinding().ivDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该条消费记录吗") |
| | | .setContent("删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | removeItem(position); |
| | | RxBus.getInstance().post(new MessageEvent(MessageEvent.EVENT_TOURISM_CONSUME_CHANGE)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | TextWatcher textWatcher = 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) { |
| | | BigDecimal decimal = BigDecimal.valueOf(item.getEat()+item.getStay()+item.getShopping()+item.getTraffic()+item.getEntrance()); |
| | | holder.getBinding().etTotalCost.setText(decimal.stripTrailingZeros().toPlainString()); |
| | | RxBus.getInstance().post(new MessageEvent(MessageEvent.EVENT_TOURISM_CONSUME_CHANGE)); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }; |
| | | holder.getBinding().etEat.addTextChangedListener(textWatcher); |
| | | holder.getBinding().etStay.addTextChangedListener(textWatcher); |
| | | holder.getBinding().etShopping.addTextChangedListener(textWatcher); |
| | | holder.getBinding().etTraffic.addTextChangedListener(textWatcher); |
| | | holder.getBinding().etEntrance.addTextChangedListener(textWatcher); |
| | | } |
| | | |
| | | @Override |
| | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.12. 22:50 |
| | | * @desc |
| | | * @desc 通讯录详情 Adapter |
| | | */ |
| | | public class ContactsDetailAdapter extends BaseRVAdapter<ContactsDetailBean,ItemContactsDetailBinding,BaseRVAdapter.BaseViewHolder<ItemContactsDetailBinding>> { |
| | | public ContactsDetailAdapter(Context context) { |
| | |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.ContactsBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemContactsBinding; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Gss |
| | |
| | | * @desc 通讯录 recyclerView 的 adapter |
| | | */ |
| | | public class ContactsRvAdapter extends BaseRVAdapter<ContactsBean, ItemContactsBinding, ContactsRvAdapter.ViewHolder> { |
| | | |
| | | private final Map<ContactsBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public ContactsRvAdapter(Context context) { |
| | | super(context); |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(View.MeasureSpec.UNSPECIFIED,View.MeasureSpec.UNSPECIFIED); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemContactsBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemContactsBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.animation.Animator; |
| | | import android.animation.AnimatorListenerAdapter; |
| | | import android.animation.ValueAnimator; |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.graphics.Color; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.databinding.ViewDataBinding; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | import androidx.lifecycle.LifecycleOwner; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.utils.rxbus.MessageEvent; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.ConsumeRecordBean; |
| | | import com.application.zhangshi_app_android.bean.DailyConsumeRecordBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemDailyConsumeRecordBinding; |
| | | import com.application.zhangshi_app_android.databinding.ItemPropertyBinding; |
| | | import com.application.zhangshi_app_android.ui.function.TourismDetailActivityViewModel; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.entity.DateEntity; |
| | | import com.github.gzuliyujiang.wheelpicker.impl.UnitDateFormatter; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.DateWheelLayout; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Calendar; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import io.reactivex.functions.Consumer; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 每日消费记录适配器 |
| | | */ |
| | | public class DailyConsumeRecordRvAdapter extends BaseRVAdapter<DailyConsumeRecordBean, ItemDailyConsumeRecordBinding, DailyConsumeRecordRvAdapter.ViewHolder> { |
| | | public DailyConsumeRecordRvAdapter(Context context) { |
| | | private TourismDetailActivityViewModel viewModel; |
| | | |
| | | private Map<DailyConsumeRecordBean, Boolean> expendMap; |
| | | |
| | | public DailyConsumeRecordRvAdapter(Context context, TourismDetailActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | this.expendMap = new HashMap<>(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(getItem(position)); |
| | | holder.getBinding().setIsFold(holder.isExpended); |
| | | ConsumeRecordRvAdapter adapter = new ConsumeRecordRvAdapter(mContext); |
| | | DailyConsumeRecordBean item = getItem(position); |
| | | holder.getBinding().setLifecycleOwner((LifecycleOwner) mContext); |
| | | holder.getBinding().setBean(item); |
| | | holder.getBinding().setViewModel(viewModel); |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(v -> { |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().cardView.postDelayed(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.setLayoutParams(holder.getBinding().cardView.getLayoutParams()); |
| | | } |
| | | },500); |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | ConsumeRecordRvAdapter adapter = new ConsumeRecordRvAdapter(mContext,viewModel); |
| | | holder.getBinding().rvConsumeRecord.setAdapter(adapter); |
| | | adapter.setData(getItem(position).getConsumeRecordBeans()); |
| | | holder.getBinding().ivFold.setOnClickListener(v -> { |
| | | if (holder.isExpended) { |
| | | holder.isExpended = false; |
| | | holder.getBinding().setIsFold(false); |
| | | collapseView(holder.getBinding().rvConsumeRecord, holder.getBinding().rvConsumeRecord); |
| | | } else { |
| | | holder.isExpended = true; |
| | | holder.getBinding().setIsFold(true); |
| | | expandView(holder.getBinding().rvConsumeRecord); |
| | | |
| | | holder.getBinding().ivAdd.setOnClickListener(v -> { |
| | | ConsumeRecordBean bean = new ConsumeRecordBean(); |
| | | adapter.addItem(0,bean); |
| | | }); |
| | | holder.getBinding().ivDelete.setOnClickListener(v -> { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该日消费记录吗") |
| | | .setContent("删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | removeItem(position); |
| | | RxBus.getInstance().post(new MessageEvent(MessageEvent.EVENT_TOURISM_CONSUME_CHANGE)); |
| | | } |
| | | }) |
| | | .show(); |
| | | }); |
| | | |
| | | holder.getBinding().tvDate.setOnClickListener(v -> { |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | holder.getBinding().tvDate.setText(month+"月"+day+"日"); |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | }); |
| | | RxBus.getInstance().toObservable((LifecycleOwner) mContext, MessageEvent.class) |
| | | .subscribe(messageEvent -> { |
| | | if (messageEvent.getMessageEventCode() == MessageEvent.EVENT_TOURISM_CONSUME_CHANGE){ |
| | | if (adapter.getItemCount() == 0 || adapter.getData() == null){ |
| | | holder.getBinding().etDailyMoney.setText("0.0"); |
| | | return; |
| | | } |
| | | BigDecimal bigDecimal = new BigDecimal(0); |
| | | for (ConsumeRecordBean bean : adapter.getData()){ |
| | | bigDecimal = bigDecimal.add(BigDecimal.valueOf(bean.getTotalCost())); |
| | | } |
| | | holder.getBinding().etDailyMoney.setText(bigDecimal.stripTrailingZeros().toPlainString()); |
| | | for (ConsumeRecordBean bean : adapter.getData()){ |
| | | bean.setDayCost(item.getDailyMoney()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | |
| | | return new ViewHolder(itemBind); |
| | | } |
| | | |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemDailyConsumeRecordBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemDailyConsumeRecordBinding binding) { |
| | | super(binding); |
| | | } |
| | | } |
| | | |
| | | public void collapseView(View initialView, View collapsedView){ |
| | | int initialHeight = initialView.getMeasuredHeight(); |
| | | int collapsedHeight = collapsedView.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | initialView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | initialView.requestLayout(); |
| | | public void setFold(boolean isFold,int position){ |
| | | expendMap.put(getItem(position),isFold); |
| | | notifyItemChanged(position); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | initialView.startAnimation(a); |
| | | } |
| | | public void expandView(View initialView){ |
| | | int initialHeight = initialView.getMeasuredHeight(); |
| | | initialView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = initialView.getMeasuredHeight(); |
| | | ValueAnimator animator = ValueAnimator.ofInt(initialHeight,targetHeight); |
| | | animator.addUpdateListener(animation -> { |
| | | initialView.getLayoutParams().height = (int) animation.getAnimatedValue(); |
| | | initialView.requestLayout(); |
| | | }); |
| | | animator.addListener(new AnimatorListenerAdapter() { |
| | | @Override |
| | | public void onAnimationEnd(Animator animation) { |
| | | initialView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT; |
| | | initialView.setLayoutParams(initialView.getLayoutParams()); |
| | | } |
| | | }); |
| | | animator.setDuration(500); |
| | | animator.start(); |
| | | private DatePicker getDatePicker(){ |
| | | com.github.gzuliyujiang.wheelpicker.DatePicker datePicker = new DatePicker((Activity) mContext); |
| | | DateWheelLayout wheelLayout = datePicker.getWheelLayout(); |
| | | wheelLayout.getMonthWheelView().setCurtainCorner(0);//背景无圆角 |
| | | wheelLayout.getDayWheelView().setCurtainCorner(5);//背景右边有圆角 |
| | | wheelLayout.getYearWheelView().setCurtainCorner(4);//背景左边有圆角 |
| | | wheelLayout.setDateFormatter(new UnitDateFormatter()); |
| | | wheelLayout.setPadding(50, 0, 50, 0); |
| | | wheelLayout.setItemSpace(ScreenSizeUtils.dip2px(mContext, 20)); |
| | | wheelLayout.setCurtainEnabled(true); |
| | | wheelLayout.setCurtainColor(Color.parseColor("#4D2F63F8")); |
| | | wheelLayout.setCurtainRadius(ScreenSizeUtils.dip2px(mContext,4)); |
| | | wheelLayout.setSelectedTextColor(Color.parseColor("#FF2F63F8")); |
| | | wheelLayout.setTextColor(Color.parseColor("#FF999999")); |
| | | wheelLayout.setIndicatorEnabled(false); |
| | | //日期可选范围 |
| | | wheelLayout.setRange(DateEntity.target(1900, 1, 1), DateEntity.target(2500, 12, 31),DateEntity.target(Calendar.getInstance())); |
| | | datePicker.getWheelLayout().setResetWhenLinkage(false); |
| | | return datePicker; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.databinding.ItemElectronicFileBinding; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.15. 21:46 |
| | | * @desc 卡片里的 电子文件 适配器 |
| | | */ |
| | | public class ElectronicFileAdapter extends BaseRVAdapter<String,ItemElectronicFileBinding,BaseRVAdapter.BaseViewHolder<ItemElectronicFileBinding>> { |
| | | public ElectronicFileAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_electronic_file; |
| | | } |
| | | |
| | | @Override |
| | | protected void onBind(BaseViewHolder<ItemElectronicFileBinding> holder, int position) { |
| | | holder.getBinding().setUrl(mDataList.get(position)); |
| | | } |
| | | |
| | | @Override |
| | | protected BaseViewHolder<ItemElectronicFileBinding> getViewHolder(ItemElectronicFileBinding itemBind, int viewType) { |
| | | return new BaseViewHolder<>(itemBind); |
| | | } |
| | | } |
| | |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemFamilyAssetsBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CreateFamilyProjectActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsDetailActivity; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class FamilyAssetsRvAdapter extends BaseRVAdapter<FamilyAssetsBean, ItemFamilyAssetsBinding, FamilyAssetsRvAdapter.ViewHolder> { |
| | | |
| | | private FamilyAssetsActivityViewModel viewModel; |
| | | private final Map<FamilyAssetsBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public FamilyAssetsRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | public FamilyAssetsRvAdapter(Context context, FamilyAssetsActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | | protected int getLayoutId() { |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | new Intent(getRecyclerView().getContext(), FamilyAssetsDetailActivity.class) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | String time = mDataList.get(position).getCreateTime().split(" ")[0]; |
| | | holder.getBinding().tvTime.setText(time); |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemFamilyAssetsBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemFamilyAssetsBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.lifecycle.LiveData; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemFamilyMemorabiliaBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CreateFamilyProjectActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaActivityViewModel; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class FamilyMemorabiliaRvAdapter extends BaseRVAdapter<FamilyMemorabiliaBean, ItemFamilyMemorabiliaBinding, FamilyMemorabiliaRvAdapter.MyViewHolder> { |
| | | |
| | | |
| | | private FamilyMemorabiliaActivityViewModel viewModel; |
| | | private final Map<FamilyMemorabiliaBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | public FamilyMemorabiliaRvAdapter(Context context) { |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | } |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), FamilyMemorabiliaDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), CreateFamilyProjectActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | new Intent(getRecyclerView().getContext(), FamilyMemorabiliaDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | mDataList.get(position).setUrl(mDataList.get(position).getUrl()); |
| | | adapter.setData(mDataList.get(position).getUrlList()); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | } |
| | |
| | | |
| | | |
| | | public static class MyViewHolder extends BaseViewHolder<ItemFamilyMemorabiliaBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public MyViewHolder(ItemFamilyMemorabiliaBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | import androidx.databinding.DataBindingUtil; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAbroadConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemGrowthExperienceAbroadConditionBinding; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivity; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivityViewModel; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Gss |
| | |
| | | public class GrowthExperienceAbroadConditionRvAdapter extends BaseRVAdapter<GrowthExperienceAbroadConditionBean, ItemGrowthExperienceAbroadConditionBinding, GrowthExperienceAbroadConditionRvAdapter.ViewHolder> { |
| | | |
| | | private GrowthExperienceActivityViewModel viewModel; |
| | | private final Map<GrowthExperienceAbroadConditionBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | |
| | | public GrowthExperienceAbroadConditionRvAdapter(Context context) { |
| | | super(context); |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemGrowthExperienceAbroadConditionBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemGrowthExperienceAbroadConditionBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | import androidx.databinding.DataBindingUtil; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceHolderConditionBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemGrowthExperienceHolderConditionBinding; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivity; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivityViewModel; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Gss |
| | |
| | | */ |
| | | public class GrowthExperienceHolderConditionRvAdapter extends BaseRVAdapter<GrowthExperienceHolderConditionBean, ItemGrowthExperienceHolderConditionBinding, GrowthExperienceHolderConditionRvAdapter.ViewHolder> { |
| | | |
| | | private GrowthExperienceActivityViewModel viewModel; |
| | | |
| | | private final Map<GrowthExperienceHolderConditionBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public GrowthExperienceHolderConditionRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | public GrowthExperienceHolderConditionRvAdapter(Context context, GrowthExperienceActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | | protected int getLayoutId() { |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemGrowthExperienceHolderConditionBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemGrowthExperienceHolderConditionBinding binding) { |
| | | super(binding); |
| | |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemGrowthExperiencePrimaryBinding; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivity; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivityViewModel; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Gss |
| | |
| | | * @desc 成长经历(主要学习及工作经历) recyclerView 的 adapter |
| | | */ |
| | | public class GrowthExperiencePrimaryRvAdapter extends BaseRVAdapter<GrowthExperienceBean, ItemGrowthExperiencePrimaryBinding, GrowthExperiencePrimaryRvAdapter.ViewHolder> { |
| | | |
| | | private GrowthExperienceActivityViewModel viewModel; |
| | | private final Map<GrowthExperienceBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public GrowthExperiencePrimaryRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | public GrowthExperiencePrimaryRvAdapter(Context context, GrowthExperienceActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | }else{ |
| | | int recyclerviewHeight = mRecyclerView.getMeasuredHeight(); |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | import androidx.databinding.DataBindingUtil; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceRelationshipBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemGrowthExperienceRelationshipBinding; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivity; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivityViewModel; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Gss |
| | |
| | | * @desc 成长经历(家庭成员及主要社会关系情况) recyclerView 的 adapter |
| | | */ |
| | | public class GrowthExperienceRelationshipRvAdapter extends BaseRVAdapter<GrowthExperienceRelationshipBean, ItemGrowthExperienceRelationshipBinding, GrowthExperienceRelationshipRvAdapter.ViewHolder> { |
| | | private final Map<GrowthExperienceRelationshipBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | private GrowthExperienceActivityViewModel viewModel; |
| | | |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemGrowthExperienceRelationshipBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemGrowthExperienceRelationshipBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemFamilyAssetsBinding; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemHomeDevicesBinding; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.HomeDevicesActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.HomeDevicesDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 家庭设备 recyclerView 的 adapter |
| | | */ |
| | | public class HomeDevicesRvAdapter extends BaseRVAdapter<HomeDevicesBean, ItemHomeDevicesBinding, HomeDevicesRvAdapter.ViewHolder>{ |
| | | public HomeDevicesRvAdapter(Context context) { |
| | | private final HomeDevicesActivityViewModel viewModel; |
| | | private final Map<HomeDevicesBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | public HomeDevicesRvAdapter(Context context, HomeDevicesActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<HomeDevicesBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), HomeDevicesDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), HomeDevicesDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | } |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | @Override |
| | | protected ViewHolder getViewHolder(ItemHomeDevicesBinding itemBind,int viewType) { |
| | | return new ViewHolder(itemBind); |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemHomeDevicesBinding>{ |
| | | private boolean isExpended; |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemHomeDevicesBinding>{ |
| | | |
| | | public ViewHolder(ItemHomeDevicesBinding binding) { |
| | | super(binding); |
| | |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.HomeMemberBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemHomeMemberListBinding; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class HomeMemberAdapter extends BaseRVAdapter<HomeMemberBean, ItemHomeMemberListBinding, HomeMemberAdapter.ViewHolder> { |
| | | |
| | | private final Map<HomeMemberBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public HomeMemberAdapter(Context context) { |
| | | super(context); |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemHomeMemberListBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemHomeMemberListBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.HonorCollectionBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemFamilyAssetsBinding; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemHonorCollectionBinding; |
| | | import com.application.zhangshi_app_android.ui.function.HonorCollectionDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 荣誉收藏 Adapter |
| | | */ |
| | | public class HonorCollectionRvAdapter extends BaseRVAdapter<HonorCollectionBean, ItemHonorCollectionBinding, HonorCollectionRvAdapter.ViewHolder>{ |
| | | private final Map<HonorCollectionBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public HonorCollectionRvAdapter(Context context) { |
| | | super(context); |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | if (mDataList.get(position).getGetTime()!=null){ |
| | | String time = mDataList.get(position).getGetTime().split(" ")[0]; |
| | | holder.getBinding().tvTime.setText(time); |
| | | } |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemHonorCollectionBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemHonorCollectionBinding binding) { |
| | | super(binding); |
| | |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemHundredWishBinding; |
| | | import com.application.zhangshi_app_android.ui.function.HundredWishDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PropertyDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.23. 20:05 |
| | | * @desc |
| | | */public class HundredWishRvAdapter extends BaseRVAdapter<HundredWishBean, ItemHundredWishBinding, HundredWishRvAdapter.ViewHolder> { |
| | | private final Map<HundredWishBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public HundredWishRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | new Intent(getRecyclerView().getContext(), HundredWishDetailActivity.class) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemHundredWishBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemHundredWishBinding binding) { |
| | | super(binding); |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.media.Image; |
| | | import android.view.View; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemImageBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CreateFamilyProjectActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaDetailActivityViewModel; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.01. 22:42 |
| | | * @desc |
| | | * @desc 各详情Activity里的电子文件 Adapter |
| | | */ |
| | | public class ImageRvAdapter extends BaseRVAdapter<String, ItemImageBinding, BaseRVAdapter.BaseViewHolder<ItemImageBinding>> { |
| | | |
| | | private boolean isEdited = false; |
| | | private CreateFamilyProjectActivityViewModel viewModel; |
| | | private boolean isEdited = false;//是否显示图标,true 显示出图标,false 隐藏图标 (图标为删除时全部显示,图标为选择时只显示选中的那一个) |
| | | private boolean isSelected = false;//是否可选择,true 为 选择图标,false 为删除图标, |
| | | private String selectPosition;//选中的位置 |
| | | public ImageRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | public ImageRvAdapter(Context context, CreateFamilyProjectActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_image; |
| | |
| | | } else { |
| | | holder.getBinding().ivDelete.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().ivDelete.setOnClickListener(v -> { |
| | | FamilyMemorabiliaBean bean = viewModel.getBeanMutableLiveData().getValue(); |
| | | if (bean!=null){ |
| | | List<String> list = bean.getUrlList(); |
| | | list.remove(position); |
| | | bean.setUrlList(list); |
| | | viewModel.getBeanMutableLiveData().postValue(bean); |
| | | if (isSelected) { |
| | | holder.getBinding().ivDelete.setBackgroundResource(R.drawable.ic_image_select); |
| | | if (selectPosition.equals(getItem(position))){ |
| | | holder.getBinding().ivDelete.setVisibility(View.VISIBLE); |
| | | } else { |
| | | holder.getBinding().ivDelete.setVisibility(View.GONE); |
| | | } |
| | | }); |
| | | } else { |
| | | holder.getBinding().ivDelete.setBackgroundResource(R.drawable.ic_image_delete); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | public void setIsEdited(boolean edited) { |
| | | isEdited = edited; |
| | | this.isEdited = edited; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | public void setIsSelected(boolean isSelected) { |
| | | this.isSelected = isSelected; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | public void setSelectPosition(String selectPosition) { |
| | | this.selectPosition = selectPosition; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | } |
| | |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemCleanStorageBinding; |
| | | import com.application.zhangshi_app_android.databinding.ItemIncomeAndExpensesBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.IncomeAndExpensesActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.IncomeAndExpensesDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.LittleDoctorActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.LittleDoctorDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class IncomeAndExpensesRvAdapter extends BaseRVAdapter<IncomeAndExpensesBean, ItemIncomeAndExpensesBinding, IncomeAndExpensesRvAdapter.ViewHolder> { |
| | | public IncomeAndExpensesRvAdapter(Context context) { |
| | | |
| | | private IncomeAndExpensesActivityViewModel viewModel; |
| | | private final Map<IncomeAndExpensesBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | public IncomeAndExpensesRvAdapter(Context context, IncomeAndExpensesActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected int getLayoutId() { |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<IncomeAndExpensesBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), IncomeAndExpensesDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), IncomeAndExpensesDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | } |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyDataSetChanged(); |
| | | } |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemIncomeAndExpensesBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemIncomeAndExpensesBinding binding) { |
| | | super(binding); |
| | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemHonorCollectionBinding; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemLittleDoctorBinding; |
| | | import com.application.zhangshi_app_android.ui.function.HonorCollectionDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.LittleDoctorActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.LittleDoctorDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.15. 15:06 |
| | | * @desc |
| | | * @desc 小医生 recyclerView 的 adapter |
| | | */ |
| | | public class LittleDoctorRvAdapter extends BaseRVAdapter<LittleDoctorBean, ItemLittleDoctorBinding, LittleDoctorRvAdapter.ViewHolder> { |
| | | public LittleDoctorRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | private LittleDoctorActivityViewModel viewModel; |
| | | private final Map<LittleDoctorBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | private boolean isCheckable; |
| | | public LittleDoctorRvAdapter(Context context, LittleDoctorActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_little_doctor; |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<LittleDoctorBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), LittleDoctorDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), LittleDoctorDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | } |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | @Override |
| | | protected ViewHolder getViewHolder(ItemLittleDoctorBinding itemBind, int viewType) { |
| | | return new ViewHolder(itemBind); |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemLittleDoctorBinding>{ |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemLittleDoctorBinding>{ |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemLittleDoctorBinding binding) { |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.graphics.Color; |
| | | import android.view.View; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemMemoBinding; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.entity.DateEntity; |
| | | import com.github.gzuliyujiang.wheelpicker.impl.UnitDateFormatter; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.DateWheelLayout; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.06.12. 13:08 |
| | | * @desc |
| | | */ |
| | | public class MemoRvAdapter extends BaseRVAdapter<MemoBean,ItemMemoBinding,BaseRVAdapter.BaseViewHolder<ItemMemoBinding>> { |
| | | private final Map<MemoBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isEdited = false; |
| | | private List<MemoBean> deleteList; |
| | | private List<MemoBean> addList; |
| | | private List<MemoBean> updateList; |
| | | public MemoRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_memo; |
| | | } |
| | | |
| | | @Override |
| | | protected void onBind(BaseViewHolder<ItemMemoBinding> holder, int position) { |
| | | MemoBean item = getItem(position); |
| | | holder.getBinding().setBean(item); |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().etContent.setText(item.getContent()); |
| | | int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(view.getWidth(), View.MeasureSpec.EXACTLY); |
| | | int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); |
| | | holder.getBinding().cardView.measure(widthMeasureSpec, heightMeasureSpec); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | if (isEdited) { |
| | | holder.getBinding().ivDelete.setVisibility(View.VISIBLE); |
| | | holder.getBinding().etContent.setEnabled(true); |
| | | holder.getBinding().viewLine.setVisibility(View.VISIBLE); |
| | | holder.getBinding().tvDate.setClickable(true); |
| | | holder.getBinding().ivDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | removeItem(item); |
| | | if (deleteList == null) { |
| | | deleteList = new ArrayList<>(); |
| | | } |
| | | deleteList.add(item); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | holder.getBinding().tvDate.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | holder.getBinding().tvDate.setText(String.format(Locale.CHINA,"%d-%02d-%02d", year, month, day)); |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | } |
| | | }); |
| | | } else { |
| | | holder.getBinding().ivDelete.setVisibility(View.GONE); |
| | | holder.getBinding().etContent.setEnabled(false); |
| | | holder.getBinding().viewLine.setVisibility(View.GONE); |
| | | holder.getBinding().tvDate.setClickable(false); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected BaseViewHolder<ItemMemoBinding> getViewHolder(ItemMemoBinding itemBind, int viewType) { |
| | | return new BaseViewHolder<ItemMemoBinding>(itemBind); |
| | | } |
| | | |
| | | public void setFold(boolean isFold,int position){ |
| | | expendMap.put(getItem(position),isFold); |
| | | notifyItemChanged(position); |
| | | } |
| | | public List<MemoBean> getDeleteList() { |
| | | return deleteList; |
| | | } |
| | | |
| | | public List<MemoBean> getAddList() { |
| | | return addList; |
| | | } |
| | | |
| | | public List<MemoBean> getUpdateList() { |
| | | return updateList; |
| | | } |
| | | |
| | | public void setEdited(boolean edited) { |
| | | isEdited = edited; |
| | | notifyDataSetChanged(); |
| | | } |
| | | |
| | | @Override |
| | | public void addItem(int position, @NonNull MemoBean item) { |
| | | super.addItem(position, item); |
| | | if (addList == null) { |
| | | addList = new ArrayList<>(); |
| | | } |
| | | addList.add(item); |
| | | } |
| | | |
| | | @Override |
| | | public void setData(@Nullable List<MemoBean> data) { |
| | | super.setData(data); |
| | | for (MemoBean datum : data) { |
| | | if (updateList == null) { |
| | | updateList = new ArrayList<>(); |
| | | } |
| | | updateList.add(datum); |
| | | } |
| | | } |
| | | |
| | | private DatePicker getDatePicker(){ |
| | | com.github.gzuliyujiang.wheelpicker.DatePicker datePicker = new DatePicker((Activity) mContext); |
| | | DateWheelLayout wheelLayout = datePicker.getWheelLayout(); |
| | | wheelLayout.getMonthWheelView().setCurtainCorner(0);//背景无圆角 |
| | | wheelLayout.getDayWheelView().setCurtainCorner(5);//背景右边有圆角 |
| | | wheelLayout.getYearWheelView().setCurtainCorner(4);//背景左边有圆角 |
| | | wheelLayout.setDateFormatter(new UnitDateFormatter()); |
| | | wheelLayout.setPadding(50, 0, 50, 0); |
| | | wheelLayout.setItemSpace(ScreenSizeUtils.dip2px(mContext, 20)); |
| | | wheelLayout.setCurtainEnabled(true); |
| | | wheelLayout.setCurtainColor(Color.parseColor("#4D2F63F8")); |
| | | wheelLayout.setCurtainRadius(ScreenSizeUtils.dip2px(mContext,4)); |
| | | wheelLayout.setSelectedTextColor(Color.parseColor("#FF2F63F8")); |
| | | wheelLayout.setTextColor(Color.parseColor("#FF999999")); |
| | | wheelLayout.setIndicatorEnabled(false); |
| | | //日期可选范围 |
| | | wheelLayout.setRange(DateEntity.target(1900, 1, 1), DateEntity.target(2500, 12, 31),DateEntity.target(Calendar.getInstance())); |
| | | datePicker.getWheelLayout().setResetWhenLinkage(false); |
| | | return datePicker; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemConsumeRecordBinding; |
| | | import com.application.zhangshi_app_android.databinding.ItemOldSpouseBinding; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.23. 19:02 |
| | | * @desc 个人婚姻里 前任 列表Adapter |
| | | */ |
| | | public class OldSpouseRvAdapter extends BaseRVAdapter<MarriageInfoBean.OldSpouseBean, ItemOldSpouseBinding, BaseRVAdapter.BaseViewHolder<ItemOldSpouseBinding>> { |
| | | public OldSpouseRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_old_spouse; |
| | | } |
| | | |
| | | @Override |
| | | protected void onBind(BaseViewHolder<ItemOldSpouseBinding> holder, int position) { |
| | | holder.getBinding().setBean(getItem(position)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected BaseViewHolder<ItemOldSpouseBinding> getViewHolder(ItemOldSpouseBinding itemBind, int viewType) { |
| | | return new BaseViewHolder<>(itemBind); |
| | | } |
| | | } |
| | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemPersonalNotepadBinding; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class PersonalNotepadRvAdapter extends BaseRVAdapter<PersonalNotepadBean, ItemPersonalNotepadBinding, PersonalNotepadRvAdapter.ViewHolder> { |
| | | public PersonalNotepadRvAdapter(Context context) { |
| | | private PersonalNotepadActivityViewModel viewModel; |
| | | private final Map<PersonalNotepadBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | private boolean isCheckable; |
| | | public PersonalNotepadRvAdapter(Context context, PersonalNotepadActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | @Override |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<PersonalNotepadBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), PersonalNotepadDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), PersonalNotepadDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyDataSetChanged(); |
| | | } |
| | | adapter.setData(list); |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemPersonalNotepadBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemPersonalNotepadBinding binding) { |
| | | super(binding); |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | BigImageDialog.Builder builder = new BigImageDialog.Builder(mContext); |
| | | // builder.setBigImage(mDataList.get(position)); |
| | | builder.setBigImage(R.drawable.img_sakura); |
| | | builder.setBigImage(mDataList.get(position)); |
| | | builder.show(); |
| | | } |
| | | }); |
| | |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.PetMemoBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemPetMemoBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.HundredWishDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetMemoDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class PetMemoRvAdapter extends BaseRVAdapter<PetMemoBean, ItemPetMemoBinding, PetMemoRvAdapter.ViewHolder> { |
| | | private final Map<PetMemoBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public PetMemoRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | new Intent(getRecyclerView().getContext(), PetMemoDetailActivity.class) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemPetMemoBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemPetMemoBinding binding) { |
| | | super(binding); |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.PetBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemPetBinding; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetDetailActivity; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 23:04 |
| | | * @desc |
| | | */ |
| | | public class PetRvAdapter extends BaseRVAdapter<PetBean, ItemPetBinding,BaseRVAdapter.BaseViewHolder<ItemPetBinding>> { |
| | | |
| | | |
| | | public PetRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_pet; |
| | | } |
| | | |
| | | @Override |
| | | protected void onBind(BaseViewHolder<ItemPetBinding> holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(mContext, PetDetailActivity.class) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | protected BaseViewHolder<ItemPetBinding> getViewHolder(ItemPetBinding itemBind, int viewType) { |
| | | return new BaseViewHolder<ItemPetBinding>(itemBind); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.PrivacyBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemPrivacyBinding; |
| | | import com.application.zhangshi_app_android.ui.function.PrivacyDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class PrivacyRvAdapter extends BaseRVAdapter<PrivacyBean, ItemPrivacyBinding, PrivacyRvAdapter.ViewHolder> { |
| | | private final Map<PrivacyBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public PrivacyRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemPrivacyBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemPrivacyBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.PropertyBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemCleanStorageBinding; |
| | | import com.application.zhangshi_app_android.databinding.ItemPropertyBinding; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PropertyDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 个人财产 Adapter |
| | | */ |
| | | public class PropertyRvAdapter extends BaseRVAdapter<PropertyBean, ItemPropertyBinding, PropertyRvAdapter.ViewHolder> { |
| | | private final Map<PropertyBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public PropertyRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | new Intent(getRecyclerView().getContext(), PropertyDetailActivity.class) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | ElectronicFileAdapter adapter = new ElectronicFileAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext,3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemPropertyBinding> { |
| | |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.bean.TourismExperienceBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemPropertyBinding; |
| | | import com.application.zhangshi_app_android.databinding.ItemTourismExperienceBinding; |
| | | import com.application.zhangshi_app_android.ui.function.IncomeAndExpensesActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.IncomeAndExpensesDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PropertyDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.TourismExperienceActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.TourismExperienceDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class TourismExperienceRvAdapter extends BaseRVAdapter<TourismExperienceBean, ItemTourismExperienceBinding, TourismExperienceRvAdapter.ViewHolder> { |
| | | public TourismExperienceRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | private final Map<TourismExperienceBean, Boolean> expendMap = new HashMap<>(); |
| | | private TourismExperienceActivityViewModel viewModel; |
| | | private boolean isCheckable; |
| | | |
| | | |
| | | public TourismExperienceRvAdapter(Context context, TourismExperienceActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_tourism_experience; |
| | |
| | | } else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<TourismExperienceBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended) { |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1) { |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | } else { |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1) { |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | new Intent(getRecyclerView().getContext(), TourismExperienceDetailActivity.class) |
| | | .putExtra("bean", mDataList.get(position))); |
| | | }); |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), IncomeAndExpensesDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | |
| | | ImageRvAdapter adapter = new ImageRvAdapter(mContext); |
| | | holder.getBinding().rvImage.setLayoutManager(new GridLayoutManager(mContext, 3)); |
| | | holder.getBinding().rvImage.setAdapter(adapter); |
| | | String url = mDataList.get(position).getUrl(); |
| | | if (url == null || url.isEmpty()) { |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")) { |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | } else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | } |
| | | adapter.setData(Utils.splitString2List(mDataList.get(position).getUrl(),",")); |
| | | |
| | | } |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyDataSetChanged(); |
| | | } |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemTourismExperienceBinding> { |
| | | private boolean isExpended; |
| | | |
| | | public ViewHolder(ItemTourismExperienceBinding binding) { |
| | | super(binding); |
| | | } |
| | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.DailyConsumeRecordBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemFamilyMemorabiliaBinding; |
| | | import com.application.zhangshi_app_android.databinding.ItemTourismBinding; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.TourismActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.TourismDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.TourismExperienceActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.28. 21:18 |
| | | * @desc |
| | | * @desc 旅游经历列表 Adapter |
| | | */ |
| | | public class TourismRvAdapter extends BaseRVAdapter<TourismBean, ItemTourismBinding, TourismRvAdapter.ViewHolder> { |
| | | public TourismRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | private final TourismActivityViewModel viewModel; |
| | | private boolean isCheckable; |
| | | private final Map<TourismBean, Boolean> expendMap = new HashMap<>(); |
| | | |
| | | public TourismRvAdapter(Context context, TourismActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_tourism; |
| | |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | } |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | if (isCheckable){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | | if (viewModel.getCheckListLiveData().getValue() == null){ |
| | | viewModel.getCheckListLiveData().setValue(new ArrayList<>()); |
| | | } |
| | | List<TourismBean> list = new ArrayList<>(viewModel.getCheckListLiveData().getValue()); |
| | | if (isChecked){ |
| | | if (!list.contains(mDataList.get(position))){ |
| | | list.add(mDataList.get(position)); |
| | | } |
| | | }else{ |
| | | list.remove(mDataList.get(position)); |
| | | } |
| | | viewModel.getCheckListLiveData().setValue(list); |
| | | } |
| | | }); |
| | | holder.getBinding().checkbox.setChecked(viewModel.getCheckListLiveData().getValue().contains(mDataList.get(position))); |
| | | }else{ |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | if (holder.isExpended){ |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = false; |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int distanceToExpand = targetHeight - initialHeight; |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | holder.getBinding().cardView.getLayoutParams().height = (int) (initialHeight + (distanceToExpand * interpolatedTime)); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | holder.getBinding().cardView.startAnimation(a); |
| | | holder.isExpended = true; |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | holder.getBinding().layoutContent.setOnClickListener(v -> { |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), TourismDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), TourismDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | new UIDialog.Builder(mContext) |
| | | .setTitle("您确定要删除该项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteItem(mDataList.get(position)); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | holder.getBinding().tvDetail.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), TourismExperienceActivity.class) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | .putExtra("id",mDataList.get(position).getId())); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | public static class ViewHolder extends BaseRVAdapter.BaseViewHolder<ItemTourismBinding> { |
| | | private boolean isExpended; |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | |
| | | public static class ViewHolder extends BaseViewHolder<ItemTourismBinding>{ |
| | | public ViewHolder(ItemTourismBinding binding) { |
| | | super(binding); |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter.databinding; |
| | | |
| | | import android.graphics.drawable.Drawable; |
| | | import android.text.TextUtils; |
| | | import android.view.View; |
| | | import android.widget.ImageView; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | import androidx.core.content.res.ResourcesCompat; |
| | | import androidx.databinding.BindingAdapter; |
| | | import androidx.databinding.InverseBindingAdapter; |
| | | import androidx.databinding.InverseBindingListener; |
| | | |
| | | import com.application.zhangshi_app_android.MyApplication; |
| | | import com.application.zhangshi_app_android.R; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.23. 19:19 |
| | | * @desc |
| | | */ |
| | | public class ImageViewAdapter { |
| | | |
| | | /** |
| | | * 根据 int 状态值为 imageView设置背景 |
| | | * @param state 1 选中 0 未选中 |
| | | */ |
| | | @BindingAdapter("select_state") |
| | | public static void setSelectState(ImageView imageView, int state) { |
| | | if (state == 1){ |
| | | imageView.setBackgroundResource(R.drawable.ic_radio_button_selected); |
| | | }else { |
| | | imageView.setBackgroundResource(R.drawable.ic_radio_button_unselected); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据imageView的背景获取选中状态 |
| | | * @return 1 选中 0 未选中 |
| | | */ |
| | | @InverseBindingAdapter(attribute = "select_state") |
| | | public static int getSelectState(ImageView imageView) { |
| | | Drawable drawable = AppCompatResources.getDrawable(imageView.getContext(),R.drawable.ic_radio_button_selected); |
| | | if (imageView.getBackground().getConstantState().equals(drawable.getConstantState())) { |
| | | return 1; |
| | | } else{ |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 设置选中状态改变监听 |
| | | */ |
| | | @BindingAdapter("select_stateAttrChanged") |
| | | public static void setSelectStateAttrChanged(ImageView imageView, final InverseBindingListener listener) { |
| | | imageView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Drawable drawable = AppCompatResources.getDrawable(imageView.getContext(),R.drawable.ic_radio_button_selected); |
| | | boolean isSelect = imageView.getBackground().getConstantState().equals(drawable.getConstantState()); |
| | | if (isSelect) { |
| | | imageView.setBackgroundResource(R.drawable.ic_radio_button_unselected); |
| | | } else{ |
| | | imageView.setBackgroundResource(R.drawable.ic_radio_button_selected); |
| | | } |
| | | listener.onChange(); |
| | | } |
| | | }); |
| | | //默认一开始不可点击 |
| | | imageView.setClickable(false); |
| | | } |
| | | |
| | | } |
| | |
| | | //序号 |
| | | private int id; |
| | | //体检时间 |
| | | private String time; |
| | | private String checkTime; |
| | | //类别 |
| | | private String type; |
| | | //就病医院 |
| | | private String hospital; |
| | | //提名 |
| | | private String name; |
| | | private String title; |
| | | //注意事项 |
| | | private String attention; |
| | | private String notice; |
| | | //备注 |
| | | private String remark; |
| | | //电子文件 |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getTime() { |
| | | return time; |
| | | public String getCheckTime() { |
| | | return checkTime; |
| | | } |
| | | |
| | | public void setTime(String time) { |
| | | this.time = time; |
| | | public void setCheckTime(String checkTime) { |
| | | this.checkTime = checkTime; |
| | | } |
| | | |
| | | public String getType() { |
| | |
| | | this.hospital = hospital; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getAttention() { |
| | | return attention; |
| | | public String getNotice() { |
| | | return notice; |
| | | } |
| | | |
| | | public void setAttention(String attention) { |
| | | this.attention = attention; |
| | | public void setNotice(String notice) { |
| | | this.notice = notice; |
| | | } |
| | | |
| | | public String getRemark() { |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.12. 20:16 |
| | | * @desc |
| | | */ |
| | | public class AnnualHealthStatusRequestBean extends PageRequestBean{ |
| | | //题名 |
| | | private String title; |
| | | //就病医院 |
| | | private String hospital; |
| | | //类别 |
| | | private String type; |
| | | //发生时间开始 |
| | | private String happenStartTime; |
| | | //发生时间结束 |
| | | private String happenEndTime; |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getHospital() { |
| | | return hospital; |
| | | } |
| | | |
| | | public void setHospital(String hospital) { |
| | | this.hospital = hospital; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("title", title==null?"":title); |
| | | map.put("hospital", hospital==null?"":hospital); |
| | | map.put("type", type==null?"":type); |
| | | map.put("happenStartTime", happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime", happenEndTime==null?"":happenEndTime); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.17. 22:03 |
| | | * @desc 轮播图 bean |
| | | */ |
| | | public class BannerBean { |
| | | //id |
| | | private int id; |
| | | //个人id |
| | | private int uid; |
| | | //文件地址 |
| | | private String url; |
| | | //文件类型 1 视频 0 图片 |
| | | private int flag; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(int uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public int getFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(int flag) { |
| | | this.flag = flag; |
| | | } |
| | | } |
| | |
| | | * @desc 荣誉证书 Bean |
| | | */ |
| | | public class CertificateOfHonorBean implements Serializable { |
| | | private int id; |
| | | //用户id |
| | | private String userId; |
| | | //类别 0.证件 1.荣誉 2.资质 |
| | | private int type; |
| | | //名称 |
| | | private String name; |
| | | //时间 |
| | | private String time; |
| | | //类别 |
| | | private String type; |
| | | //证号 |
| | | private String certificateNumber; |
| | | //证号/专业 |
| | | private String idNo; |
| | | //级别 |
| | | private String level; |
| | | private String grade; |
| | | //有效时间 |
| | | private String effectiveTime; |
| | | private String validityDate; |
| | | //获得时间 |
| | | private String getTime; |
| | | private String getDate; |
| | | //存放位置 |
| | | private String location; |
| | | //备注 |
| | | private String remark; |
| | | //电子文件 |
| | | private String url; |
| | | //创建时间 |
| | | private String createTime; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getType() { |
| | | if (type == 0){ |
| | | return "证件"; |
| | | }else if (type == 1){ |
| | | return "荣誉"; |
| | | }else if (type == 2){ |
| | | return "资质"; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | switch (type) { |
| | | case "证件": |
| | | this.type = 0; |
| | | break; |
| | | case "荣誉": |
| | | this.type = 1; |
| | | break; |
| | | case "资质": |
| | | this.type = 2; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getTime() { |
| | | return time; |
| | | public String getIdNo() { |
| | | return idNo; |
| | | } |
| | | |
| | | public void setTime(String time) { |
| | | this.time = time; |
| | | public void setIdNo(String idNo) { |
| | | this.idNo = idNo; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | public String getGrade() { |
| | | return grade; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | public void setGrade(String grade) { |
| | | this.grade = grade; |
| | | } |
| | | |
| | | public String getCertificateNumber() { |
| | | return certificateNumber; |
| | | public String getValidityDate() { |
| | | return validityDate; |
| | | } |
| | | |
| | | public void setCertificateNumber(String certificateNumber) { |
| | | this.certificateNumber = certificateNumber; |
| | | public void setValidityDate(String validityDate) { |
| | | this.validityDate = validityDate; |
| | | } |
| | | |
| | | public String getLevel() { |
| | | return level; |
| | | public String getGetDate() { |
| | | return getDate; |
| | | } |
| | | |
| | | public void setLevel(String level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public String getEffectiveTime() { |
| | | return effectiveTime; |
| | | } |
| | | |
| | | public void setEffectiveTime(String effectiveTime) { |
| | | this.effectiveTime = effectiveTime; |
| | | } |
| | | |
| | | public String getGetTime() { |
| | | return getTime; |
| | | } |
| | | |
| | | public void setGetTime(String getTime) { |
| | | this.getTime = getTime; |
| | | public void setGetDate(String getDate) { |
| | | this.getDate = getDate; |
| | | } |
| | | |
| | | public String getLocation() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 20:15 |
| | | * @desc |
| | | */ |
| | | public class CertificateOfHonorRequestBean extends PageRequestBean{ |
| | | private String name; |
| | | private String type; |
| | | private String grade; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getGrade() { |
| | | return grade; |
| | | } |
| | | |
| | | public void setGrade(String grade) { |
| | | this.grade = grade; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("name",name==null?"":name); |
| | | map.put("type",type==null?"":type); |
| | | map.put("grade",grade==null?"":grade); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import androidx.databinding.BaseObservable; |
| | | import androidx.databinding.Bindable; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | |
| | | public class CleanStorageBean implements Serializable { |
| | | //序号 |
| | | private int id; |
| | | //类型 |
| | | private String type; |
| | | //类型 0.保洁 1.收纳 |
| | | private int kind; |
| | | //适用人 |
| | | private String suitablePeople; |
| | | private String suitable; |
| | | //类别 |
| | | private String category; |
| | | private String type; |
| | | //保洁方法 |
| | | private String cleanMethod; |
| | | private String method; |
| | | //材料存放地 |
| | | private String materialStorageLocation; |
| | | private String place; |
| | | //放置地点 |
| | | private String placementLocation; |
| | | private String location; |
| | | //备注 |
| | | private String remark; |
| | | private String url; |
| | | |
| | | public CleanStorageBean(int id, String type, String suitablePeople, String category, String cleanMethod, String materialStorageLocation, String placementLocation, String remark, String url) { |
| | | this.id = id; |
| | | this.type = type; |
| | | this.suitablePeople = suitablePeople; |
| | | this.category = category; |
| | | this.cleanMethod = cleanMethod; |
| | | this.materialStorageLocation = materialStorageLocation; |
| | | this.placementLocation = placementLocation; |
| | | this.remark = remark; |
| | | this.url = url; |
| | | } |
| | | //家庭id |
| | | private String familyId; |
| | | //创建时间 |
| | | private String createTime; |
| | | //发生时间 |
| | | private String happenTime; |
| | | |
| | | public int getId() { |
| | | return id; |
| | |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | |
| | | public void setKind(String kind) { |
| | | if (kind.equals("收纳")) { |
| | | this.kind = 1; |
| | | } else{ |
| | | this.kind = 0; |
| | | } |
| | | } |
| | | public String getKind() { |
| | | if (kind == 1) { |
| | | return "收纳"; |
| | | } else { |
| | | return "保洁"; |
| | | } |
| | | } |
| | | |
| | | public String getSuitable() { |
| | | return suitable; |
| | | } |
| | | |
| | | public void setSuitable(String suitable) { |
| | | this.suitable = suitable; |
| | | } |
| | | |
| | | public String getType() { |
| | |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getSuitablePeople() { |
| | | return suitablePeople; |
| | | public String getMethod() { |
| | | return method; |
| | | } |
| | | |
| | | public void setSuitablePeople(String suitablePeople) { |
| | | this.suitablePeople = suitablePeople; |
| | | public void setMethod(String method) { |
| | | this.method = method; |
| | | } |
| | | |
| | | public String getCategory() { |
| | | return category; |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setCategory(String category) { |
| | | this.category = category; |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public String getCleanMethod() { |
| | | return cleanMethod; |
| | | public String getLocation() { |
| | | return location; |
| | | } |
| | | |
| | | public void setCleanMethod(String cleanMethod) { |
| | | this.cleanMethod = cleanMethod; |
| | | } |
| | | |
| | | public String getMaterialStorageLocation() { |
| | | return materialStorageLocation; |
| | | } |
| | | |
| | | public void setMaterialStorageLocation(String materialStorageLocation) { |
| | | this.materialStorageLocation = materialStorageLocation; |
| | | } |
| | | |
| | | public String getPlacementLocation() { |
| | | return placementLocation; |
| | | } |
| | | |
| | | public void setPlacementLocation(String placementLocation) { |
| | | this.placementLocation = placementLocation; |
| | | public void setLocation(String location) { |
| | | this.location = location; |
| | | } |
| | | |
| | | public String getRemark() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getFamilyId() { |
| | | return familyId; |
| | | } |
| | | |
| | | public void setFamilyId(String familyId) { |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.20. 17:55 |
| | | * @desc |
| | | */ |
| | | public class CleanStorageRequestBean extends PageRequestBean{ |
| | | //序号 |
| | | private int id = -1; |
| | | //类型 0.保洁 1.收纳 |
| | | private String kind; |
| | | //类别 |
| | | private String type; |
| | | //保洁方法 |
| | | private String method; |
| | | //适用人 |
| | | private String suitable; |
| | | //材料存放地 |
| | | private String place; |
| | | //放置地点 |
| | | private String location; |
| | | //备注 |
| | | private String remark; |
| | | |
| | | |
| | | public String getKind() { |
| | | return kind; |
| | | } |
| | | |
| | | public void setKind(String kind) { |
| | | this.kind = kind; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getMethod() { |
| | | return method; |
| | | } |
| | | |
| | | public void setMethod(String method) { |
| | | this.method = method; |
| | | } |
| | | |
| | | public String getSuitable() { |
| | | return suitable; |
| | | } |
| | | |
| | | public void setSuitable(String suitable) { |
| | | this.suitable = suitable; |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public String getLocation() { |
| | | return location; |
| | | } |
| | | |
| | | public void setLocation(String location) { |
| | | this.location = location; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Map<String,Object> toMap() { |
| | | Map<String,Object> map = super.toMap(); |
| | | if (id != -1) { |
| | | map.put("id",id); |
| | | } |
| | | map.put("kind",kind==null?"":kind); |
| | | map.put("type",type==null?"":type); |
| | | map.put("method",method==null?"":method); |
| | | map.put("suitable",suitable==null?"":suitable); |
| | | map.put("place",place==null?"":place); |
| | | map.put("location",location==null?"":location); |
| | | map.put("remark",remark==null?"":remark); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | * @desc 消费详细记录 |
| | | */ |
| | | public class ConsumeRecordBean implements Serializable { |
| | | //id |
| | | private String id; |
| | | //对应的旅游费用记录id |
| | | private String feeId; |
| | | //消费时间 |
| | | private String happenTime; |
| | | //内容 |
| | | private String content; |
| | | //总金额 |
| | | private String totalMoney; |
| | | private double totalCost; |
| | | //餐费 |
| | | private String mealMoney; |
| | | private double eat; |
| | | //住宿费 |
| | | private String hotelMoney; |
| | | private double stay; |
| | | //交通费 |
| | | private String trafficMoney; |
| | | private double traffic; |
| | | //购物 |
| | | private String shoppingMoney; |
| | | private double shopping; |
| | | //门票 |
| | | private String ticketMoney; |
| | | private double entrance; |
| | | //每日金额 |
| | | private double dayCost; |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getFeeId() { |
| | | return feeId; |
| | | } |
| | | |
| | | public void setFeeId(String feeId) { |
| | | this.feeId = feeId; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | |
| | | this.content = content; |
| | | } |
| | | |
| | | public String getTotalMoney() { |
| | | return totalMoney; |
| | | public double getTotalCost() { |
| | | return totalCost; |
| | | } |
| | | |
| | | public void setTotalMoney(String totalMoney) { |
| | | this.totalMoney = totalMoney; |
| | | public void setTotalCost(double totalCost) { |
| | | this.totalCost = totalCost; |
| | | } |
| | | |
| | | public String getMealMoney() { |
| | | return mealMoney; |
| | | public double getEat() { |
| | | return eat; |
| | | } |
| | | |
| | | public void setMealMoney(String mealMoney) { |
| | | this.mealMoney = mealMoney; |
| | | public void setEat(double eat) { |
| | | this.eat = eat; |
| | | } |
| | | |
| | | public String getHotelMoney() { |
| | | return hotelMoney; |
| | | |
| | | public double getStay() { |
| | | return stay; |
| | | } |
| | | |
| | | public void setHotelMoney(String hotelMoney) { |
| | | this.hotelMoney = hotelMoney; |
| | | public void setStay(double stay) { |
| | | this.stay = stay; |
| | | } |
| | | |
| | | public String getTrafficMoney() { |
| | | return trafficMoney; |
| | | public void setStay(String stay) { |
| | | this.stay = Double.parseDouble(stay); |
| | | } |
| | | |
| | | public void setTrafficMoney(String trafficMoney) { |
| | | this.trafficMoney = trafficMoney; |
| | | public double getTraffic() { |
| | | return traffic; |
| | | } |
| | | |
| | | public String getShoppingMoney() { |
| | | return shoppingMoney; |
| | | public void setTraffic(double traffic) { |
| | | this.traffic = traffic; |
| | | } |
| | | |
| | | public void setShoppingMoney(String shoppingMoney) { |
| | | this.shoppingMoney = shoppingMoney; |
| | | public void setTraffic(String traffic) { |
| | | this.traffic = Double.parseDouble(traffic); |
| | | } |
| | | |
| | | public String getTicketMoney() { |
| | | return ticketMoney; |
| | | public double getShopping() { |
| | | return shopping; |
| | | } |
| | | |
| | | public void setTicketMoney(String ticketMoney) { |
| | | this.ticketMoney = ticketMoney; |
| | | public void setShopping(double shopping) { |
| | | this.shopping = shopping; |
| | | } |
| | | |
| | | public void setShopping(String shopping) { |
| | | this.shopping = Double.parseDouble(shopping); |
| | | } |
| | | |
| | | public double getEntrance() { |
| | | return entrance; |
| | | } |
| | | |
| | | public void setEntrance(double entrance) { |
| | | this.entrance = entrance; |
| | | } |
| | | |
| | | public void setEntrance(String entrance) { |
| | | this.entrance = Double.parseDouble(entrance); |
| | | } |
| | | |
| | | public double getDayCost() { |
| | | return dayCost; |
| | | } |
| | | |
| | | public void setDayCost(double dayCost) { |
| | | this.dayCost = dayCost; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public class ContactsBean { |
| | | //属于谁的通讯录 |
| | | private String myName; |
| | | |
| | | //具体通讯录 |
| | | private List<ContactsDetailBean> contactsDetailBeans; |
| | | |
| | | public String getMyName() { |
| | |
| | | * @date 2023.05.13. 0:29 |
| | | * @desc |
| | | */ |
| | | public class ContactsRequestBean { |
| | | public class ContactsRequestBean extends PageRequestBean{ |
| | | //成员姓名 |
| | | private String myName; |
| | | //称呼 |
| | |
| | | private String work; |
| | | //手机号码 |
| | | private String phone; |
| | | //微信 |
| | | private String wx; |
| | | //QQ |
| | | private String qq; |
| | | //推特 |
| | | private String twitter; |
| | | //是否常联系 0 否 1 是 |
| | | private int is_always; |
| | | //备注 |
| | | private String remark; |
| | | private int pageNum = 1; |
| | | private int pageSize = 20; |
| | | |
| | | public String getMyName() { |
| | | return myName; |
| | | } |
| | | |
| | | public void setMyName(String myName) { |
| | | this.myName = myName; |
| | | } |
| | | |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getWork() { |
| | | return work; |
| | | } |
| | | |
| | | public void setWork(String work) { |
| | | this.work = work; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (myName == null) { |
| | | myName = ""; |
| | | } |
| | | if (nickName == null) { |
| | | nickName = ""; |
| | | } |
| | | if (name == null) { |
| | | name = ""; |
| | | } |
| | | if (work == null) { |
| | | work = ""; |
| | | } |
| | | if (phone == null) { |
| | | phone = ""; |
| | | } |
| | | if (wx == null) { |
| | | wx = ""; |
| | | } |
| | | if (qq == null) { |
| | | qq = ""; |
| | | } |
| | | if (twitter == null) { |
| | | twitter = ""; |
| | | } |
| | | if (remark == null) { |
| | | remark = ""; |
| | | } |
| | | map.put("myName", myName); |
| | | map.put("nickName", nickName); |
| | | map.put("name", name); |
| | | map.put("work", work); |
| | | map.put("phone", phone); |
| | | map.put("wx", wx); |
| | | map.put("qq", qq); |
| | | map.put("twitter", twitter); |
| | | map.put("is_always", is_always); |
| | | map.put("remark", remark); |
| | | map.put("pageNum", pageNum); |
| | | map.put("pageSize", pageSize); |
| | | Map<String,Object> map = super.toMap(); |
| | | map.put("myName",myName==null?"":myName); |
| | | map.put("nickName",nickName==null?"":nickName); |
| | | map.put("name",name==null?"":name); |
| | | map.put("work",work==null?"":work); |
| | | map.put("phone",phone==null?"":phone); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | //日期 |
| | | private String date; |
| | | //每日金额 |
| | | private String dailyMoney; |
| | | private double dailyMoney; |
| | | //消费记录 |
| | | private List<ConsumeRecordBean> consumeRecordBeans; |
| | | private List<ConsumeRecordBean> consumeRecordBeans = new ArrayList<>(); |
| | | |
| | | public String getDate() { |
| | | return date; |
| | |
| | | this.consumeRecordBeans = consumeRecordBeans; |
| | | } |
| | | |
| | | public String getDailyMoney() { |
| | | public double getDailyMoney() { |
| | | return dailyMoney; |
| | | } |
| | | |
| | | public void setDailyMoney(String dailyMoney) { |
| | | public void setDailyMoney(double dailyMoney) { |
| | | this.dailyMoney = dailyMoney; |
| | | } |
| | | } |
| | | |
| | | public void setDailyMoney(String dailyMoney) { |
| | | this.dailyMoney = Double.parseDouble(dailyMoney); |
| | | }} |
| | |
| | | * @desc 家族资产 |
| | | */ |
| | | public class FamilyAssetsBean implements Serializable { |
| | | private String address; |
| | | private String createTime; |
| | | private String holder; |
| | | private long id; |
| | | private String location; |
| | | private String remark; |
| | | private String title; |
| | | //资产类型 |
| | | private String type; |
| | | //数据创建时间 |
| | | private String createTime; |
| | | //标题(账号、卡号) |
| | | private String title; |
| | | //开户行(资产地址) |
| | | private String location; |
| | | //持有人名字 |
| | | private String holder; |
| | | //存放地址 |
| | | private String address; |
| | | //备注 |
| | | private String remark; |
| | | //电子文件地址 |
| | | private String url; |
| | | //发生时间 |
| | | private String happenTime; |
| | | |
| | | public String getAddress() { return address; } |
| | | public void setAddress(String value) { this.address = value; } |
| | |
| | | |
| | | public String getUrl() { return url; } |
| | | public void setUrl(String value) { this.url = value; } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.16. 20:09 |
| | | * @desc 家族资产请求参数 |
| | | */ |
| | | public class FamilyAssetsRequestBean extends PageRequestBean { |
| | | //资产类型 |
| | | private String type; |
| | | //持有人名字 |
| | | private String holder; |
| | | //存放地址 |
| | | private String address; |
| | | //发生时间开始 |
| | | private String happenStartTime; |
| | | //发生时间结束 |
| | | private String happenEndTime; |
| | | |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | |
| | | public String getHolder() { |
| | | return holder; |
| | | } |
| | | |
| | | public void setHolder(String holder) { |
| | | this.holder = holder; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | public Map<String,Object> toMap(){ |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("pageNum",pageNum); |
| | | map.put("pageSize",pageSize); |
| | | map.put("type",type==null?"":type); |
| | | map.put("holder",holder==null?"":holder); |
| | | map.put("address",address==null?"":address); |
| | | map.put("happenStartTime",happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime",happenEndTime==null?"":happenEndTime); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public class FamilyMemorabiliaBean implements Serializable { |
| | | private long id; |
| | | private String address; |
| | | private String createTime; |
| | | private String people; |
| | | private String remark; |
| | | private String address; |
| | | private String title; |
| | | private String remark; |
| | | private String url; |
| | | private String happenTime; |
| | | |
| | | private List<String> urlList; |
| | | |
| | | public String getAddress() { return address; } |
| | |
| | | public String getTitle() { return title; } |
| | | public void setTitle(String value) { this.title = value; } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FamilyMemorabiliaBean{" + |
| | |
| | | * @date 2023.03.28. 15:57 |
| | | * @desc |
| | | */ |
| | | public class FamilyMemorabiliaRequestBean { |
| | | public class FamilyMemorabiliaRequestBean extends PageRequestBean{ |
| | | private String people; |
| | | private String address; |
| | | private String remark; |
| | | private String title; |
| | | |
| | | private String createTime; |
| | | private int pageNum = 1; |
| | | private int pageSize = 20; |
| | | private String happenStartTime; |
| | | private String happenEndTime; |
| | | |
| | | public String getPeople() { |
| | | return people; |
| | |
| | | this.title = title; |
| | | } |
| | | |
| | | public int getPageNum() { |
| | | return pageNum; |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setPageNum(int pageNum) { |
| | | this.pageNum = pageNum; |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public int getPageSize() { |
| | | return pageSize; |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setPageSize(int pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Map<String, Object> getMap() { |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (people == null) { |
| | | people = ""; |
| | | } |
| | | if (address == null) { |
| | | address = ""; |
| | | } |
| | | if (remark == null) { |
| | | remark = ""; |
| | | } |
| | | if (title == null) { |
| | | title = ""; |
| | | } |
| | | if (createTime == null) { |
| | | createTime = ""; |
| | | } |
| | | map.put("people", people); |
| | | map.put("address", address); |
| | | map.put("remark", remark); |
| | | map.put("title", title); |
| | | map.put("createTime", createTime); |
| | | map.put("people", people == null ? "" : people); |
| | | map.put("address", address == null ? "" : address); |
| | | map.put("remark", remark == null ? "" : remark); |
| | | map.put("title", title == null ? "" : title); |
| | | map.put("happenStartTime", happenStartTime == null ? "" : happenStartTime); |
| | | map.put("happenEndTime", happenEndTime == null ? "" : happenEndTime); |
| | | map.put("pageNum", pageNum); |
| | | map.put("pageSize", pageSize); |
| | | return map; |
| | |
| | | */ |
| | | public class GrowthExperienceInformationBean implements Serializable { |
| | | private int userId; |
| | | private String nickName; |
| | | private String oldName; |
| | | private int sex; |
| | | private String nationality; |
| | | private String nation; |
| | | private int maritalStatus; |
| | | private String politicalOutlook; |
| | | private String phoneNumber; |
| | | private String idNum; |
| | | private String locationAddress; |
| | | private String alwaysAddress; |
| | | private String alwaysPolice; |
| | | private String unit; |
| | | private String position; |
| | | private int outStatus; |
| | | private String idNo; |
| | | private String img; |
| | | private String birth; |
| | | private String url; |
| | | public int getUserId() { return userId; } |
| | | public void setUserId(int value) { this.userId = value; } |
| | | public String getNickName() { return nickName; } |
| | | public void setNickName(String value) { this.nickName = value; } |
| | | public String getOldName() { return oldName; } |
| | | public void setOldName(String value) { this.oldName = value; } |
| | | public int getSex() { return sex; } |
| | | public void setSex(int value) { this.sex = value; } |
| | | public String getNationality() { return nationality; } |
| | | public void setNationality(String value) { this.nationality = value; } |
| | | public String getNation() { return nation; } |
| | | public void setNation(String value) { this.nation = value; } |
| | | public int getMaritalStatus() { return maritalStatus; } |
| | | public void setMaritalStatus(int value) { this.maritalStatus = value; } |
| | | public String getPoliticalOutlook() { return politicalOutlook; } |
| | | public void setPoliticalOutlook(String value) { this.politicalOutlook = value; } |
| | | public String getPhoneNumber() { return phoneNumber; } |
| | | public void setPhoneNumber(String value) { this.phoneNumber = value; } |
| | | public String getIdNum() { return idNum; } |
| | | public void setIdNum(String value) { this.idNum = value; } |
| | | private String nickName;//姓名 |
| | | private String oldName;//曾用名 |
| | | private int sex;//性别 0 女 1 男 |
| | | private String nationality;//国籍 |
| | | private String nation;//民族 |
| | | private int maritalStatus;//婚姻状况 0 未婚 1 已婚 2 离婚 |
| | | private String politicalOutlook;//政治面貌 |
| | | private String phoneNumber; //手机号 |
| | | private String idNum; //身份证号 |
| | | private String locationAddress; //户籍地址 |
| | | private String alwaysAddress; //常住地址 |
| | | private String locationPolice;//户籍地公安机关 |
| | | private String alwaysPolice; //常住地公安机关 |
| | | private String unit; //所在单位/学校 |
| | | private String position; //职务/身份 |
| | | private int outStatus;//是否外籍、境外永久居留权 0 否 1 是 |
| | | private String idNo;//外籍、境外相关证件号码 |
| | | private String deadDay;//死亡日期 |
| | | private String constellation;//星座 |
| | | private String wxNo;//微信 |
| | | private String qqNo;//qq |
| | | private String shengXiao;//生肖 |
| | | private int isMyFamily; |
| | | private String familyName;// 所属家庭名字 |
| | | private String roleName;//所属角色 |
| | | private String img; //图片地址 |
| | | private String fatherId;//父亲id |
| | | private String spouseId; |
| | | private String momId;//母亲id |
| | | private String birth;//出生日期 |
| | | private String email;//邮箱 |
| | | private String createTime;//创建时间 |
| | | private String url;//个人背景视频、图片 |
| | | private String secondFamilyId;//其他家庭授权的家庭id |
| | | |
| | | public String getLocationAddress() { return locationAddress; } |
| | | public void setLocationAddress(String value) { this.locationAddress = value; } |
| | | public int getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public String getAlwaysAddress() { return alwaysAddress; } |
| | | public void setAlwaysAddress(String value) { this.alwaysAddress = value; } |
| | | public String getUnit() { return unit; } |
| | | public void setUnit(String value) { this.unit = value; } |
| | | public String getPosition() { return position; } |
| | | public void setPosition(String value) { this.position = value; } |
| | | public int getOutStatus() { return outStatus; } |
| | | public void setOutStatus(int value) { this.outStatus = value; } |
| | | public String getIdNo() { return idNo; } |
| | | public void setIdNo(String value) { this.idNo = value; } |
| | | public String getImg() { return img; } |
| | | public void setImg(String value) { this.img = value; } |
| | | public String getBirth() { return birth; } |
| | | public void setBirth(String value) { this.birth = value; } |
| | | public String getUrl() { return url; } |
| | | public void setUrl(String value) { this.url = value; } |
| | | public void setUserId(int userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | public String getOldName() { |
| | | return oldName; |
| | | } |
| | | |
| | | public void setOldName(String oldName) { |
| | | this.oldName = oldName; |
| | | } |
| | | |
| | | public void setSex(int sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public int getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public String getSexStr() { |
| | | return sex==0?"女":"男"; |
| | | } |
| | | |
| | | public void setSexStr(String sex) { |
| | | if (sex!=null){ |
| | | this.sex = sex.equals("女")?0:1; |
| | | } |
| | | } |
| | | |
| | | public String getNationality() { |
| | | return nationality; |
| | | } |
| | | |
| | | public void setNationality(String nationality) { |
| | | this.nationality = nationality; |
| | | } |
| | | |
| | | public String getNation() { |
| | | return nation; |
| | | } |
| | | |
| | | public void setNation(String nation) { |
| | | this.nation = nation; |
| | | } |
| | | |
| | | public String getMaritalStatus() { |
| | | if (maritalStatus==0){ |
| | | return "未婚"; |
| | | }else if (maritalStatus==1){ |
| | | return "已婚"; |
| | | }else if (maritalStatus==2){ |
| | | return "离婚"; |
| | | }else { |
| | | return "未知"; |
| | | } |
| | | } |
| | | |
| | | public void setMaritalStatus(String maritalStatus) { |
| | | if (maritalStatus!=null){ |
| | | if (maritalStatus.equals("未婚")){ |
| | | this.maritalStatus = 0; |
| | | }else if (maritalStatus.equals("已婚")){ |
| | | this.maritalStatus = 1; |
| | | }else if (maritalStatus.equals("离婚")){ |
| | | this.maritalStatus = 2; |
| | | }else { |
| | | this.maritalStatus = 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public String getPoliticalOutlook() { |
| | | return politicalOutlook; |
| | | } |
| | | |
| | | public void setPoliticalOutlook(String politicalOutlook) { |
| | | this.politicalOutlook = politicalOutlook; |
| | | } |
| | | |
| | | public String getPhoneNumber() { |
| | | return phoneNumber; |
| | | } |
| | | |
| | | public void setPhoneNumber(String phoneNumber) { |
| | | this.phoneNumber = phoneNumber; |
| | | } |
| | | |
| | | public String getIdNum() { |
| | | return idNum; |
| | | } |
| | | |
| | | public void setIdNum(String idNum) { |
| | | this.idNum = idNum; |
| | | } |
| | | |
| | | public String getLocationAddress() { |
| | | return locationAddress; |
| | | } |
| | | |
| | | public void setLocationAddress(String locationAddress) { |
| | | this.locationAddress = locationAddress; |
| | | } |
| | | |
| | | public String getAlwaysAddress() { |
| | | return alwaysAddress; |
| | | } |
| | | |
| | | public void setAlwaysAddress(String alwaysAddress) { |
| | | this.alwaysAddress = alwaysAddress; |
| | | } |
| | | |
| | | public String getLocationPolice() { |
| | | return locationPolice; |
| | | } |
| | | |
| | | public void setLocationPolice(String locationPolice) { |
| | | this.locationPolice = locationPolice; |
| | | } |
| | | |
| | | public String getAlwaysPolice() { |
| | | return alwaysPolice; |
| | | } |
| | | |
| | | public void setAlwaysPolice(String alwaysPolice) { |
| | | this.alwaysPolice = alwaysPolice; |
| | | } |
| | | |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public String getPosition() { |
| | | return position; |
| | | } |
| | | |
| | | public void setPosition(String position) { |
| | | this.position = position; |
| | | } |
| | | |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | | |
| | | public void setImg(String img) { |
| | | this.img = img; |
| | | } |
| | | |
| | | public String getFatherId() { |
| | | return fatherId; |
| | | } |
| | | |
| | | public void setFatherId(String fatherId) { |
| | | this.fatherId = fatherId; |
| | | } |
| | | |
| | | public String getMomId() { |
| | | return momId; |
| | | } |
| | | |
| | | public void setMomId(String momId) { |
| | | this.momId = momId; |
| | | } |
| | | |
| | | public String getBirth() { |
| | | return birth; |
| | | } |
| | | |
| | | public void setBirth(String birth) { |
| | | this.birth = birth; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public int getOutStatus() { |
| | | return outStatus; |
| | | } |
| | | |
| | | public void setOutStatus(int outStatus) { |
| | | this.outStatus = outStatus; |
| | | } |
| | | |
| | | public String getIdNo() { |
| | | return idNo; |
| | | } |
| | | |
| | | public void setIdNo(String idNo) { |
| | | this.idNo = idNo; |
| | | } |
| | | |
| | | public String getSecondFamilyId() { |
| | | return secondFamilyId; |
| | | } |
| | | |
| | | public void setSecondFamilyId(String secondFamilyId) { |
| | | this.secondFamilyId = secondFamilyId; |
| | | } |
| | | |
| | | public void setMaritalStatus(int maritalStatus) { |
| | | this.maritalStatus = maritalStatus; |
| | | } |
| | | |
| | | public String getDeadDay() { |
| | | return deadDay; |
| | | } |
| | | |
| | | public void setDeadDay(String deadDay) { |
| | | this.deadDay = deadDay; |
| | | } |
| | | |
| | | public String getConstellation() { |
| | | return constellation; |
| | | } |
| | | |
| | | public void setConstellation(String constellation) { |
| | | this.constellation = constellation; |
| | | } |
| | | |
| | | public String getWxNo() { |
| | | return wxNo; |
| | | } |
| | | |
| | | public void setWxNo(String wxNo) { |
| | | this.wxNo = wxNo; |
| | | } |
| | | |
| | | public String getQqNo() { |
| | | return qqNo; |
| | | } |
| | | |
| | | public void setQqNo(String qqNo) { |
| | | this.qqNo = qqNo; |
| | | } |
| | | |
| | | public String getShengXiao() { |
| | | return shengXiao; |
| | | } |
| | | |
| | | public void setShengXiao(String shengXiao) { |
| | | this.shengXiao = shengXiao; |
| | | } |
| | | |
| | | public int getIsMyFamily() { |
| | | return isMyFamily; |
| | | } |
| | | |
| | | public void setIsMyFamily(int isMyFamily) { |
| | | this.isMyFamily = isMyFamily; |
| | | } |
| | | |
| | | public String getFamilyName() { |
| | | return familyName; |
| | | } |
| | | |
| | | public void setFamilyName(String familyName) { |
| | | this.familyName = familyName; |
| | | } |
| | | |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) { |
| | | this.roleName = roleName; |
| | | } |
| | | |
| | | public String getSpouseId() { |
| | | return spouseId; |
| | | } |
| | | |
| | | public void setSpouseId(String spouseId) { |
| | | this.spouseId = spouseId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.21. 18:09 |
| | | * @desc 健康保健基本信息 |
| | | */ |
| | | public class HealthCareBaseInfoBean{ |
| | | private int id; |
| | | //用户id |
| | | private int uid; |
| | | //姓名 |
| | | private String name; |
| | | //性别 1 男 0 女 |
| | | private int sex; |
| | | //文化程度 |
| | | private String educationLevel; |
| | | //职业 |
| | | private String work; |
| | | //电话 |
| | | private String phone; |
| | | //邮箱 |
| | | private String email; |
| | | //地址 |
| | | private String address; |
| | | //血型 |
| | | private BloodClass bloodClass; |
| | | //过敏史 |
| | | private AllergyClass allergyClass; |
| | | //遗传病史 |
| | | private GeneticDiseaseClass geneticDiseaseClass; |
| | | //常用药物 |
| | | private String medicine; |
| | | //目前基础病 |
| | | private String baseDisease; |
| | | |
| | | public static class BloodClass { |
| | | //a血型 1是 0否 |
| | | private int a; |
| | | //b血型 |
| | | private int b; |
| | | //o |
| | | private int o; |
| | | //ab |
| | | private int ab; |
| | | //rh |
| | | private int rh; |
| | | //other |
| | | private int other; |
| | | //其他血型 |
| | | private String otherText; |
| | | //不清楚 |
| | | private int unknown; |
| | | |
| | | public int getA() { |
| | | return a; |
| | | } |
| | | |
| | | public void setA(int a) { |
| | | this.a = a; |
| | | } |
| | | |
| | | public int getB() { |
| | | return b; |
| | | } |
| | | |
| | | public void setB(int b) { |
| | | this.b = b; |
| | | } |
| | | |
| | | public int getO() { |
| | | return o; |
| | | } |
| | | |
| | | public void setO(int o) { |
| | | this.o = o; |
| | | } |
| | | |
| | | public int getAb() { |
| | | return ab; |
| | | } |
| | | |
| | | public void setAb(int ab) { |
| | | this.ab = ab; |
| | | } |
| | | |
| | | public int getRh() { |
| | | return rh; |
| | | } |
| | | |
| | | public void setRh(int rh) { |
| | | this.rh = rh; |
| | | } |
| | | |
| | | public int getOther() { |
| | | return other; |
| | | } |
| | | |
| | | public void setOther(int other) { |
| | | this.other = other; |
| | | } |
| | | |
| | | public String getOtherText() { |
| | | return otherText; |
| | | } |
| | | |
| | | public void setOtherText(String otherText) { |
| | | this.otherText = otherText; |
| | | } |
| | | |
| | | public int getUnknown() { |
| | | return unknown; |
| | | } |
| | | |
| | | public void setUnknown(int unknown) { |
| | | this.unknown = unknown; |
| | | } |
| | | } |
| | | public static class AllergyClass { |
| | | //药物 1是 0否 |
| | | private int medicine; |
| | | //食物 |
| | | private int food; |
| | | //其他 |
| | | private int other; |
| | | private String otherText; |
| | | |
| | | public int getMedicine() { |
| | | return medicine; |
| | | } |
| | | |
| | | public void setMedicine(int medicine) { |
| | | this.medicine = medicine; |
| | | } |
| | | |
| | | public int getFood() { |
| | | return food; |
| | | } |
| | | |
| | | public void setFood(int food) { |
| | | this.food = food; |
| | | } |
| | | |
| | | public int getOther() { |
| | | return other; |
| | | } |
| | | |
| | | public void setOther(int other) { |
| | | this.other = other; |
| | | } |
| | | |
| | | public String getOtherText() { |
| | | return otherText; |
| | | } |
| | | |
| | | public void setOtherText(String otherText) { |
| | | this.otherText = otherText; |
| | | } |
| | | } |
| | | public static class GeneticDiseaseClass{ |
| | | //高血压 1是 0否 |
| | | private int hypertension; |
| | | //糖尿病 |
| | | private int diabetes; |
| | | //肿瘤 |
| | | private int tumor; |
| | | private int other;//其他 |
| | | private String otherText; |
| | | |
| | | public int getHypertension() { |
| | | return hypertension; |
| | | } |
| | | |
| | | public void setHypertension(int hypertension) { |
| | | this.hypertension = hypertension; |
| | | } |
| | | |
| | | public int getDiabetes() { |
| | | return diabetes; |
| | | } |
| | | |
| | | public void setDiabetes(int diabetes) { |
| | | this.diabetes = diabetes; |
| | | } |
| | | |
| | | public int getTumor() { |
| | | return tumor; |
| | | } |
| | | |
| | | public void setTumor(int tumor) { |
| | | this.tumor = tumor; |
| | | } |
| | | |
| | | public int getOther() { |
| | | return other; |
| | | } |
| | | |
| | | public void setOther(int other) { |
| | | this.other = other; |
| | | } |
| | | |
| | | public String getOtherText() { |
| | | return otherText; |
| | | } |
| | | |
| | | public void setOtherText(String otherText) { |
| | | this.otherText = otherText; |
| | | } |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(int uid) { |
| | | this.uid = uid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(int sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getSexStr(){ |
| | | return sex == 1 ? "男" : "女"; |
| | | } |
| | | public void setSexStr(String sexStr){ |
| | | if (sexStr.equals("男")){ |
| | | setSex(1); |
| | | }else { |
| | | setSex(0); |
| | | } |
| | | } |
| | | |
| | | public String getEducationLevel() { |
| | | return educationLevel; |
| | | } |
| | | |
| | | public void setEducationLevel(String educationLevel) { |
| | | this.educationLevel = educationLevel; |
| | | } |
| | | |
| | | public String getWork() { |
| | | return work; |
| | | } |
| | | |
| | | public void setWork(String work) { |
| | | this.work = work; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public BloodClass getBloodClass() { |
| | | return bloodClass; |
| | | } |
| | | |
| | | public void setBloodClass(BloodClass bloodClass) { |
| | | this.bloodClass = bloodClass; |
| | | } |
| | | |
| | | public AllergyClass getAllergyClass() { |
| | | return allergyClass; |
| | | } |
| | | |
| | | public void setAllergyClass(AllergyClass allergyClass) { |
| | | this.allergyClass = allergyClass; |
| | | } |
| | | |
| | | public GeneticDiseaseClass getGeneticDiseaseClass() { |
| | | return geneticDiseaseClass; |
| | | } |
| | | |
| | | public void setGeneticDiseaseClass(GeneticDiseaseClass geneticDiseaseClass) { |
| | | this.geneticDiseaseClass = geneticDiseaseClass; |
| | | } |
| | | |
| | | public String getMedicine() { |
| | | return medicine; |
| | | } |
| | | |
| | | public void setMedicine(String medicine) { |
| | | this.medicine = medicine; |
| | | } |
| | | |
| | | public String getBaseDisease() { |
| | | return baseDisease; |
| | | } |
| | | |
| | | public void setBaseDisease(String baseDisease) { |
| | | this.baseDisease = baseDisease; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.21. 20:07 |
| | | * @desc 健康保健现存问题 |
| | | */ |
| | | public class HealthCareExistingProblemsBean { |
| | | //脑血管疾病 |
| | | private BrainDiseaseClass brainDiseaseClass; |
| | | //心脏疾病 |
| | | private HeartDiseaseClass heartDiseaseClass; |
| | | //血管疾病 |
| | | private VascularDiseaseClass vascularDiseaseClass; |
| | | //消化系统疾病 |
| | | private DigestiveSystemDiseaseClass digestiveSystemDiseaseClass; |
| | | //呼吸系统疾病 |
| | | private RespiratorySystemDiseaseClass respiratorySystemDiseaseClass; |
| | | //肾脏疾病 |
| | | private KidneyDiseaseClass kidneyDiseaseClass; |
| | | //内分泌系统疾病 |
| | | private OtherDiseaseClass otherDiseaseClass; |
| | | |
| | | public void setBrainDiseaseClass(BrainDiseaseClass brainDiseaseClass){ |
| | | this.brainDiseaseClass = brainDiseaseClass; |
| | | } |
| | | public BrainDiseaseClass getBrainDiseaseClass(){ |
| | | return this.brainDiseaseClass; |
| | | } |
| | | public void setHeartDiseaseClass(HeartDiseaseClass heartDiseaseClass){ |
| | | this.heartDiseaseClass = heartDiseaseClass; |
| | | } |
| | | public HeartDiseaseClass getHeartDiseaseClass(){ |
| | | return this.heartDiseaseClass; |
| | | } |
| | | public void setVascularDiseaseClass(VascularDiseaseClass vascularDiseaseClass){ |
| | | this.vascularDiseaseClass = vascularDiseaseClass; |
| | | } |
| | | public VascularDiseaseClass getVascularDiseaseClass(){ |
| | | return this.vascularDiseaseClass; |
| | | } |
| | | public void setDigestiveSystemDiseaseClass(DigestiveSystemDiseaseClass digestiveSystemDiseaseClass){ |
| | | this.digestiveSystemDiseaseClass = digestiveSystemDiseaseClass; |
| | | } |
| | | public DigestiveSystemDiseaseClass getDigestiveSystemDiseaseClass(){ |
| | | return this.digestiveSystemDiseaseClass; |
| | | } |
| | | public void setRespiratorySystemDiseaseClass(RespiratorySystemDiseaseClass respiratorySystemDiseaseClass){ |
| | | this.respiratorySystemDiseaseClass = respiratorySystemDiseaseClass; |
| | | } |
| | | public RespiratorySystemDiseaseClass getRespiratorySystemDiseaseClass(){ |
| | | return this.respiratorySystemDiseaseClass; |
| | | } |
| | | public void setKidneyDiseaseClass(KidneyDiseaseClass kidneyDiseaseClass){ |
| | | this.kidneyDiseaseClass = kidneyDiseaseClass; |
| | | } |
| | | public KidneyDiseaseClass getKidneyDiseaseClass(){ |
| | | return this.kidneyDiseaseClass; |
| | | } |
| | | public void setOtherDiseaseClass(OtherDiseaseClass otherDiseaseClass){ |
| | | this.otherDiseaseClass = otherDiseaseClass; |
| | | } |
| | | public OtherDiseaseClass getOtherDiseaseClass(){ |
| | | return this.otherDiseaseClass; |
| | | } |
| | | public static class BrainDiseaseClass { |
| | | //缺血性脑卒中 |
| | | private int ischemicStroke; |
| | | //脑出血 |
| | | private int cerebralHemorrhage; |
| | | //蛛网膜下腔出血 |
| | | private int subarachnoidHemorrhage; |
| | | //短暂性脑缺血发作 |
| | | private int tia; |
| | | //其他 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | |
| | | public void setIschemicStroke(int ischemicStroke){ |
| | | this.ischemicStroke = ischemicStroke; |
| | | } |
| | | public int getIschemicStroke(){ |
| | | return this.ischemicStroke; |
| | | } |
| | | public void setCerebralHemorrhage(int cerebralHemorrhage){ |
| | | this.cerebralHemorrhage = cerebralHemorrhage; |
| | | } |
| | | public int getCerebralHemorrhage(){ |
| | | return this.cerebralHemorrhage; |
| | | } |
| | | public void setSubarachnoidHemorrhage(int subarachnoidHemorrhage){ |
| | | this.subarachnoidHemorrhage = subarachnoidHemorrhage; |
| | | } |
| | | public int getSubarachnoidHemorrhage(){ |
| | | return this.subarachnoidHemorrhage; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | public void setTia(int tia){ |
| | | this.tia = tia; |
| | | } |
| | | public int getTia(){ |
| | | return this.tia; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class HeartDiseaseClass { |
| | | //心肌梗塞 |
| | | private int myocardialInfarct; |
| | | //心绞痛 |
| | | private int anginaPectoris; |
| | | //冠状动脉血运重建 |
| | | private int coronaryRevascularization; |
| | | //充血性心力衰竭 |
| | | private int congestiveHeartFailure; |
| | | //心前区疼痛 |
| | | private int precordialPain; |
| | | //其他 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setMyocardialInfarct(int myocardialInfarct){ |
| | | this.myocardialInfarct = myocardialInfarct; |
| | | } |
| | | public int getMyocardialInfarct(){ |
| | | return this.myocardialInfarct; |
| | | } |
| | | public void setAnginaPectoris(int anginaPectoris){ |
| | | this.anginaPectoris = anginaPectoris; |
| | | } |
| | | public int getAnginaPectoris(){ |
| | | return this.anginaPectoris; |
| | | } |
| | | public void setCoronaryRevascularization(int coronaryRevascularization){ |
| | | this.coronaryRevascularization = coronaryRevascularization; |
| | | } |
| | | public int getCoronaryRevascularization(){ |
| | | return this.coronaryRevascularization; |
| | | } |
| | | public void setCongestiveHeartFailure(int congestiveHeartFailure){ |
| | | this.congestiveHeartFailure = congestiveHeartFailure; |
| | | } |
| | | public int getCongestiveHeartFailure(){ |
| | | return this.congestiveHeartFailure; |
| | | } |
| | | public void setPrecordialPain(int precordialPain){ |
| | | this.precordialPain = precordialPain; |
| | | } |
| | | public int getPrecordialPain(){ |
| | | return this.precordialPain; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class VascularDiseaseClass { |
| | | //夹层动脉瘤 |
| | | private int dissectingAneurysm; |
| | | //动脉闭塞性疾病 |
| | | private int arterialOcclusiveDiseases; |
| | | //其他 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setDissectingAneurysm(int dissectingAneurysm){ |
| | | this.dissectingAneurysm = dissectingAneurysm; |
| | | } |
| | | public int getDissectingAneurysm(){ |
| | | return this.dissectingAneurysm; |
| | | } |
| | | public void setArterialOcclusiveDiseases(int arterialOcclusiveDiseases){ |
| | | this.arterialOcclusiveDiseases = arterialOcclusiveDiseases; |
| | | } |
| | | public int getArterialOcclusiveDiseases(){ |
| | | return this.arterialOcclusiveDiseases; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class DigestiveSystemDiseaseClass { |
| | | //胃十二指肠溃疡 |
| | | private int gastroduodenalUlcer; |
| | | //反流性食管炎 |
| | | private int esophagitis; |
| | | //慢性胃炎 |
| | | private int gastritis; |
| | | //溃疡性结肠炎 |
| | | private int colitis; |
| | | //肝炎 |
| | | private int hepatitis; |
| | | //胆囊炎 |
| | | private int cholecystitis; |
| | | //胆结石 |
| | | private int cholelithiasis; |
| | | //脂肪肝 |
| | | private int fattyLiver; |
| | | //高脂血症 |
| | | private int hyperlipidemia; |
| | | //痔疮 |
| | | private int haemorrhoids; |
| | | //其他 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setGastroduodenalUlcer(int gastroduodenalUlcer){ |
| | | this.gastroduodenalUlcer = gastroduodenalUlcer; |
| | | } |
| | | public int getGastroduodenalUlcer(){ |
| | | return this.gastroduodenalUlcer; |
| | | } |
| | | public void setEsophagitis(int esophagitis){ |
| | | this.esophagitis = esophagitis; |
| | | } |
| | | public int getEsophagitis(){ |
| | | return this.esophagitis; |
| | | } |
| | | public void setGastritis(int gastritis){ |
| | | this.gastritis = gastritis; |
| | | } |
| | | public int getGastritis(){ |
| | | return this.gastritis; |
| | | } |
| | | public void setColitis(int colitis){ |
| | | this.colitis = colitis; |
| | | } |
| | | public int getColitis(){ |
| | | return this.colitis; |
| | | } |
| | | public void setHepatitis(int hepatitis){ |
| | | this.hepatitis = hepatitis; |
| | | } |
| | | public int getHepatitis(){ |
| | | return this.hepatitis; |
| | | } |
| | | public void setCholecystitis(int cholecystitis){ |
| | | this.cholecystitis = cholecystitis; |
| | | } |
| | | public int getCholecystitis(){ |
| | | return this.cholecystitis; |
| | | } |
| | | public void setCholelithiasis(int cholelithiasis){ |
| | | this.cholelithiasis = cholelithiasis; |
| | | } |
| | | public int getCholelithiasis(){ |
| | | return this.cholelithiasis; |
| | | } |
| | | public void setFattyLiver(int fattyLiver){ |
| | | this.fattyLiver = fattyLiver; |
| | | } |
| | | public int getFattyLiver(){ |
| | | return this.fattyLiver; |
| | | } |
| | | public void setHyperlipidemia(int hyperlipidemia){ |
| | | this.hyperlipidemia = hyperlipidemia; |
| | | } |
| | | public int getHyperlipidemia(){ |
| | | return this.hyperlipidemia; |
| | | } |
| | | public void setHaemorrhoids(int haemorrhoids){ |
| | | this.haemorrhoids = haemorrhoids; |
| | | } |
| | | public int getHaemorrhoids(){ |
| | | return this.haemorrhoids; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class RespiratorySystemDiseaseClass { |
| | | //COPD |
| | | private int copd; |
| | | //肺炎 |
| | | private int pneumonia; |
| | | //支气管炎 |
| | | private int bronchitis; |
| | | //支气管哮喘 |
| | | private int bronchialAsthma; |
| | | //肺结核 |
| | | private int pulmonaryTuberculosis; |
| | | //上呼吸道感染 |
| | | private int upperRespiratoryTractInfection; |
| | | |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | |
| | | public void setPneumonia(int pneumonia){ |
| | | this.pneumonia = pneumonia; |
| | | } |
| | | public int getPneumonia(){ |
| | | return this.pneumonia; |
| | | } |
| | | public void setBronchitis(int bronchitis){ |
| | | this.bronchitis = bronchitis; |
| | | } |
| | | public int getBronchitis(){ |
| | | return this.bronchitis; |
| | | } |
| | | public void setBronchialAsthma(int bronchialAsthma){ |
| | | this.bronchialAsthma = bronchialAsthma; |
| | | } |
| | | public int getBronchialAsthma(){ |
| | | return this.bronchialAsthma; |
| | | } |
| | | public void setPulmonaryTuberculosis(int pulmonaryTuberculosis){ |
| | | this.pulmonaryTuberculosis = pulmonaryTuberculosis; |
| | | } |
| | | public int getPulmonaryTuberculosis(){ |
| | | return this.pulmonaryTuberculosis; |
| | | } |
| | | public void setUpperRespiratoryTractInfection(int upperRespiratoryTractInfection){ |
| | | this.upperRespiratoryTractInfection = upperRespiratoryTractInfection; |
| | | } |
| | | public int getUpperRespiratoryTractInfection(){ |
| | | return this.upperRespiratoryTractInfection; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | public void setCopd(int copd){ |
| | | this.copd = copd; |
| | | } |
| | | public int getCopd(){ |
| | | return this.copd; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class KidneyDiseaseClass { |
| | | //糖尿病肾病 |
| | | private int diabetes; |
| | | //肾功能衰竭 |
| | | private int renalFailure; |
| | | //急性肾炎 |
| | | private int acuteNephritis; |
| | | //慢性肾炎 |
| | | private int chronicNephritis; |
| | | //泌尿系统结石 |
| | | private int urinaryCalculus; |
| | | //泌尿系统感染 |
| | | private int urinaryTractInfection; |
| | | //其他 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setDiabetes(int diabetes){ |
| | | this.diabetes = diabetes; |
| | | } |
| | | public int getDiabetes(){ |
| | | return this.diabetes; |
| | | } |
| | | public void setRenalFailure(int renalFailure){ |
| | | this.renalFailure = renalFailure; |
| | | } |
| | | public int getRenalFailure(){ |
| | | return this.renalFailure; |
| | | } |
| | | public void setAcuteNephritis(int acuteNephritis){ |
| | | this.acuteNephritis = acuteNephritis; |
| | | } |
| | | public int getAcuteNephritis(){ |
| | | return this.acuteNephritis; |
| | | } |
| | | public void setChronicNephritis(int chronicNephritis){ |
| | | this.chronicNephritis = chronicNephritis; |
| | | } |
| | | public int getChronicNephritis(){ |
| | | return this.chronicNephritis; |
| | | } |
| | | public void setUrinaryCalculus(int urinaryCalculus){ |
| | | this.urinaryCalculus = urinaryCalculus; |
| | | } |
| | | public int getUrinaryCalculus(){ |
| | | return this.urinaryCalculus; |
| | | } |
| | | public void setUrinaryTractInfection(int urinaryTractInfection){ |
| | | this.urinaryTractInfection = urinaryTractInfection; |
| | | } |
| | | public int getUrinaryTractInfection(){ |
| | | return this.urinaryTractInfection; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class OtherDiseaseClass { |
| | | //孕期三个月内 |
| | | private int pregnant; |
| | | //病毒性重感 |
| | | private int cold; |
| | | //传染性疾病 |
| | | private int infectious; |
| | | //肺大疱 |
| | | private int pulmonaryBulla; |
| | | //结核性空洞形成的咯血 |
| | | private int hemoptysis; |
| | | //未经处理的气胸 |
| | | private int pneumothorax; |
| | | //活动性出血 |
| | | private int activeBleeding; |
| | | |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setPregnant(int pregnant){ |
| | | this.pregnant = pregnant; |
| | | } |
| | | public int getPregnant(){ |
| | | return this.pregnant; |
| | | } |
| | | public void setCold(int cold){ |
| | | this.cold = cold; |
| | | } |
| | | public int getCold(){ |
| | | return this.cold; |
| | | } |
| | | public void setInfectious(int infectious){ |
| | | this.infectious = infectious; |
| | | } |
| | | public int getInfectious(){ |
| | | return this.infectious; |
| | | } |
| | | public void setPulmonaryBulla(int pulmonaryBulla){ |
| | | this.pulmonaryBulla = pulmonaryBulla; |
| | | } |
| | | public int getPulmonaryBulla(){ |
| | | return this.pulmonaryBulla; |
| | | } |
| | | public void setHemoptysis(int hemoptysis){ |
| | | this.hemoptysis = hemoptysis; |
| | | } |
| | | public int getHemoptysis(){ |
| | | return this.hemoptysis; |
| | | } |
| | | public void setPneumothorax(int pneumothorax){ |
| | | this.pneumothorax = pneumothorax; |
| | | } |
| | | public int getPneumothorax(){ |
| | | return this.pneumothorax; |
| | | } |
| | | public void setActiveBleeding(int activeBleeding){ |
| | | this.activeBleeding = activeBleeding; |
| | | } |
| | | public int getActiveBleeding(){ |
| | | return this.activeBleeding; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.21. 20:06 |
| | | * @desc 健康保健生活习惯 |
| | | */ |
| | | public class HealthCareLifeHabitsBean { |
| | | private int id; |
| | | //用户id |
| | | private int uid; |
| | | //饮食习惯(喜) |
| | | private String eatGood; |
| | | //饮食习惯(忌) |
| | | private String eatBad; |
| | | //爱好 |
| | | private String hobby; |
| | | //嗜好 |
| | | private String addition; |
| | | //大便 |
| | | private String stool; |
| | | //小便 |
| | | private String urine; |
| | | //睡眠 |
| | | private SleepClass sleepClass; |
| | | //大便规律 |
| | | private StoolStatusClass stoolStatusClass; |
| | | //小便规律 |
| | | private UrineStatusClass urineStatusClass; |
| | | //饮食习惯 |
| | | private EatingHabitsClass eatingHabitsClass; |
| | | //生活事件 |
| | | private LifeEventClass lifeEventClass; |
| | | |
| | | public void setId(int id){ |
| | | this.id = id; |
| | | } |
| | | public int getId(){ |
| | | return this.id; |
| | | } |
| | | public void setUid(int uid){ |
| | | this.uid = uid; |
| | | } |
| | | public int getUid(){ |
| | | return this.uid; |
| | | } |
| | | public void setEatGood(String eatGood){ |
| | | this.eatGood = eatGood; |
| | | } |
| | | public String getEatGood(){ |
| | | return this.eatGood; |
| | | } |
| | | public void setEatBad(String eatBad){ |
| | | this.eatBad = eatBad; |
| | | } |
| | | public String getEatBad(){ |
| | | return this.eatBad; |
| | | } |
| | | public void setHobby(String hobby){ |
| | | this.hobby = hobby; |
| | | } |
| | | public String getHobby(){ |
| | | return this.hobby; |
| | | } |
| | | public void setAddition(String addition){ |
| | | this.addition = addition; |
| | | } |
| | | public String getAddition(){ |
| | | return this.addition; |
| | | } |
| | | public void setStool(String stool){ |
| | | this.stool = stool; |
| | | } |
| | | public String getStool(){ |
| | | return this.stool; |
| | | } |
| | | public void setUrine(String urine){ |
| | | this.urine = urine; |
| | | } |
| | | public String getUrine(){ |
| | | return this.urine; |
| | | } |
| | | public void setSleepClass(SleepClass sleepClass){ |
| | | this.sleepClass = sleepClass; |
| | | } |
| | | public SleepClass getSleepClass(){ |
| | | return this.sleepClass; |
| | | } |
| | | public void setStoolStatusClass(StoolStatusClass stoolStatusClass){ |
| | | this.stoolStatusClass = stoolStatusClass; |
| | | } |
| | | public StoolStatusClass getStoolStatusClass(){ |
| | | return this.stoolStatusClass; |
| | | } |
| | | public void setUrineStatusClass(UrineStatusClass urineStatusClass){ |
| | | this.urineStatusClass = urineStatusClass; |
| | | } |
| | | public UrineStatusClass getUrineStatusClass(){ |
| | | return this.urineStatusClass; |
| | | } |
| | | public void setEatingHabitsClass(EatingHabitsClass eatingHabitsClass){ |
| | | this.eatingHabitsClass = eatingHabitsClass; |
| | | } |
| | | public EatingHabitsClass getEatingHabitsClass(){ |
| | | return this.eatingHabitsClass; |
| | | } |
| | | public void setLifeEventClass(LifeEventClass lifeEventClass){ |
| | | this.lifeEventClass = lifeEventClass; |
| | | } |
| | | public LifeEventClass getLifeEventClass(){ |
| | | return this.lifeEventClass; |
| | | } |
| | | public static class SleepClass { |
| | | //良好 1 是 0 否 |
| | | private int good; |
| | | //一般 1 是 0 否 |
| | | private int general; |
| | | //易醒 1 是 0 否 |
| | | private int easyWake; |
| | | //多梦 1 是 0 否 |
| | | private int dreaminess; |
| | | //失眠 1 是 0 否 |
| | | private int sleepless; |
| | | //打鼾 1 是 0 否 |
| | | private int snore; |
| | | //睡不熟 1 是 0 否 |
| | | private int wakefulness; |
| | | //其他 1 是 0 否 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setGood(int good){ |
| | | this.good = good; |
| | | } |
| | | public int getGood(){ |
| | | return this.good; |
| | | } |
| | | public void setGeneral(int general){ |
| | | this.general = general; |
| | | } |
| | | public int getGeneral(){ |
| | | return this.general; |
| | | } |
| | | public void setEasyWake(int easyWake){ |
| | | this.easyWake = easyWake; |
| | | } |
| | | public int getEasyWake(){ |
| | | return this.easyWake; |
| | | } |
| | | public void setDreaminess(int dreaminess){ |
| | | this.dreaminess = dreaminess; |
| | | } |
| | | public int getDreaminess(){ |
| | | return this.dreaminess; |
| | | } |
| | | public void setSleepless(int sleepless){ |
| | | this.sleepless = sleepless; |
| | | } |
| | | public int getSleepless(){ |
| | | return this.sleepless; |
| | | } |
| | | public void setSnore(int snore){ |
| | | this.snore = snore; |
| | | } |
| | | public int getSnore(){ |
| | | return this.snore; |
| | | } |
| | | public void setWakefulness(int wakefulness){ |
| | | this.wakefulness = wakefulness; |
| | | } |
| | | public int getWakefulness(){ |
| | | return this.wakefulness; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class StoolStatusClass { |
| | | //正常 1 是 0 否 |
| | | private int normal; |
| | | //秘结 1 是 0 否 |
| | | private int constipation; |
| | | //腹泻 1 是 0 否 |
| | | private int diarrhea; |
| | | //失禁 1 是 0 否 |
| | | private int incontinence; |
| | | private int other; |
| | | private String otherText; |
| | | |
| | | public void setNormal(int normal){ |
| | | this.normal = normal; |
| | | } |
| | | public int getNormal(){ |
| | | return this.normal; |
| | | } |
| | | public void setConstipation(int constipation){ |
| | | this.constipation = constipation; |
| | | } |
| | | public int getConstipation(){ |
| | | return this.constipation; |
| | | } |
| | | public void setDiarrhea(int diarrhea){ |
| | | this.diarrhea = diarrhea; |
| | | } |
| | | public int getDiarrhea(){ |
| | | return this.diarrhea; |
| | | } |
| | | public void setIncontinence(int incontinence){ |
| | | this.incontinence = incontinence; |
| | | } |
| | | public int getIncontinence(){ |
| | | return this.incontinence; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class UrineStatusClass { |
| | | //正常 1 是 0 否 |
| | | private int normal; |
| | | //夜尿潴留 1 是 0 否 |
| | | private int nightUrinaryRetention; |
| | | //失禁 1 是 0 否 |
| | | private int incontinence; |
| | | //遗尿 1 是 0 否 |
| | | private int enuresis; |
| | | private int other; |
| | | private String otherText; |
| | | |
| | | public void setNormal(int normal){ |
| | | this.normal = normal; |
| | | } |
| | | public int getNormal(){ |
| | | return this.normal; |
| | | } |
| | | public void setNightUrinaryRetention(int nightUrinaryRetention){ |
| | | this.nightUrinaryRetention = nightUrinaryRetention; |
| | | } |
| | | public int getNightUrinaryRetention(){ |
| | | return this.nightUrinaryRetention; |
| | | } |
| | | public void setIncontinence(int incontinence){ |
| | | this.incontinence = incontinence; |
| | | } |
| | | public int getIncontinence(){ |
| | | return this.incontinence; |
| | | } |
| | | public void setEnuresis(int enuresis){ |
| | | this.enuresis = enuresis; |
| | | } |
| | | public int getEnuresis(){ |
| | | return this.enuresis; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class EatingHabitsClass { |
| | | //荤素均匀 1 是 0 否 |
| | | private int uniformityOfMeatAndVegetables; |
| | | //荤食为主 1 是 0 否 |
| | | private int meat; |
| | | //素食为主 1 是 0 否 |
| | | private int vegetable; |
| | | //嗜盐 1 是 0 否 |
| | | private int salt; |
| | | //嗜油 1 是 0 否 |
| | | private int oil; |
| | | //嗜糖 1 是 0 否 |
| | | private int sugar; |
| | | //嗜酒 1 是 0 否 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setUniformityOfMeatAndVegetables(int uniformityOfMeatAndVegetables){ |
| | | this.uniformityOfMeatAndVegetables = uniformityOfMeatAndVegetables; |
| | | } |
| | | public int getUniformityOfMeatAndVegetables(){ |
| | | return this.uniformityOfMeatAndVegetables; |
| | | } |
| | | public void setMeat(int meat){ |
| | | this.meat = meat; |
| | | } |
| | | public int getMeat(){ |
| | | return this.meat; |
| | | } |
| | | public void setVegetable(int vegetable){ |
| | | this.vegetable = vegetable; |
| | | } |
| | | public int getVegetable(){ |
| | | return this.vegetable; |
| | | } |
| | | public void setSalt(int salt){ |
| | | this.salt = salt; |
| | | } |
| | | public int getSalt(){ |
| | | return this.salt; |
| | | } |
| | | public void setOil(int oil){ |
| | | this.oil = oil; |
| | | } |
| | | public int getOil(){ |
| | | return this.oil; |
| | | } |
| | | public void setSugar(int sugar){ |
| | | this.sugar = sugar; |
| | | } |
| | | public int getSugar(){ |
| | | return this.sugar; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class LifeEventClass { |
| | | //丧偶 1 是 0 否 |
| | | private int bereave; |
| | | //独居 1 是 0 否 |
| | | private int liveAlone; |
| | | //一年内住院 1 是 0 否 |
| | | private int inHospital; |
| | | //子女分家 1 是 0 否 |
| | | private int divide; |
| | | |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setBereave(int bereave){ |
| | | this.bereave = bereave; |
| | | } |
| | | public int getBereave(){ |
| | | return this.bereave; |
| | | } |
| | | public void setLiveAlone(int liveAlone){ |
| | | this.liveAlone = liveAlone; |
| | | } |
| | | public int getLiveAlone(){ |
| | | return this.liveAlone; |
| | | } |
| | | public void setInHospital(int inHospital){ |
| | | this.inHospital = inHospital; |
| | | } |
| | | public int getInHospital(){ |
| | | return this.inHospital; |
| | | } |
| | | public void setDivide(int divide){ |
| | | this.divide = divide; |
| | | } |
| | | public int getDivide(){ |
| | | return this.divide; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.21. 20:07 |
| | | * @desc 健康保健笔记内容 |
| | | */ |
| | | public class HealthCareNotesContentBean { |
| | | //id |
| | | private int id; |
| | | //用户id |
| | | private int uid; |
| | | //生活习惯 |
| | | private String lifeHabits; |
| | | //以往病史 |
| | | private String historyDisease; |
| | | //诊治情况 |
| | | private String treatmentInfo; |
| | | //家族病史 |
| | | private String familyDisease; |
| | | //现病史 |
| | | private String nowDisease; |
| | | //疾病的发生 |
| | | private String diseaseHappen; |
| | | //疾病的发展 |
| | | private String diseaseDevelop; |
| | | //疾病的治疗 |
| | | private String diseaseTreat; |
| | | //疾病的转归 |
| | | private String diseaseBack; |
| | | |
| | | public void setId(int id){ |
| | | this.id = id; |
| | | } |
| | | public int getId(){ |
| | | return this.id; |
| | | } |
| | | public void setUid(int uid){ |
| | | this.uid = uid; |
| | | } |
| | | public int getUid(){ |
| | | return this.uid; |
| | | } |
| | | public void setLifeHabits(String lifeHabits){ |
| | | this.lifeHabits = lifeHabits; |
| | | } |
| | | public String getLifeHabits(){ |
| | | return this.lifeHabits; |
| | | } |
| | | public void setHistoryDisease(String historyDisease){ |
| | | this.historyDisease = historyDisease; |
| | | } |
| | | public String getHistoryDisease(){ |
| | | return this.historyDisease; |
| | | } |
| | | public void setTreatmentInfo(String treatmentInfo){ |
| | | this.treatmentInfo = treatmentInfo; |
| | | } |
| | | public String getTreatmentInfo(){ |
| | | return this.treatmentInfo; |
| | | } |
| | | public void setFamilyDisease(String familyDisease){ |
| | | this.familyDisease = familyDisease; |
| | | } |
| | | public String getFamilyDisease(){ |
| | | return this.familyDisease; |
| | | } |
| | | public void setNowDisease(String nowDisease){ |
| | | this.nowDisease = nowDisease; |
| | | } |
| | | public String getNowDisease(){ |
| | | return this.nowDisease; |
| | | } |
| | | public void setDiseaseHappen(String diseaseHappen){ |
| | | this.diseaseHappen = diseaseHappen; |
| | | } |
| | | public String getDiseaseHappen(){ |
| | | return this.diseaseHappen; |
| | | } |
| | | public void setDiseaseDevelop(String diseaseDevelop){ |
| | | this.diseaseDevelop = diseaseDevelop; |
| | | } |
| | | public String getDiseaseDevelop(){ |
| | | return this.diseaseDevelop; |
| | | } |
| | | public void setDiseaseTreat(String diseaseTreat){ |
| | | this.diseaseTreat = diseaseTreat; |
| | | } |
| | | public String getDiseaseTreat(){ |
| | | return this.diseaseTreat; |
| | | } |
| | | public void setDiseaseBack(String diseaseBack){ |
| | | this.diseaseBack = diseaseBack; |
| | | } |
| | | public String getDiseaseBack(){ |
| | | return this.diseaseBack; |
| | | } |
| | | |
| | | public List<String> getTabList(){ |
| | | List<String> tabList = new ArrayList<>(); |
| | | tabList.add("生活习惯"); |
| | | tabList.add("以往病史"); |
| | | tabList.add("诊治情况"); |
| | | tabList.add("家族病史"); |
| | | tabList.add("现病史"); |
| | | tabList.add("疾病的发生"); |
| | | tabList.add("疾病的发展"); |
| | | tabList.add("疾病的治疗"); |
| | | tabList.add("疾病的转归"); |
| | | return tabList; |
| | | } |
| | | |
| | | public List<String> getContentList() { |
| | | List<String> contentList = new ArrayList<>(); |
| | | contentList.add(lifeHabits); |
| | | contentList.add(historyDisease); |
| | | contentList.add(treatmentInfo); |
| | | contentList.add(familyDisease); |
| | | contentList.add(nowDisease); |
| | | contentList.add(diseaseHappen); |
| | | contentList.add(diseaseDevelop); |
| | | contentList.add(diseaseTreat); |
| | | contentList.add(diseaseBack); |
| | | return contentList; |
| | | } |
| | | |
| | | public void setContent(List<String> contentList) { |
| | | this.lifeHabits = contentList.get(0); |
| | | this.historyDisease = contentList.get(1); |
| | | this.treatmentInfo = contentList.get(2); |
| | | this.familyDisease = contentList.get(3); |
| | | this.nowDisease = contentList.get(4); |
| | | this.diseaseHappen = contentList.get(5); |
| | | this.diseaseDevelop = contentList.get(6); |
| | | this.diseaseTreat = contentList.get(7); |
| | | this.diseaseBack = contentList.get(8); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return super.toString() + ",HealthCareNotesContentBean{" + |
| | | "id=" + id + |
| | | ", uid=" + uid + |
| | | ", lifeHabits='" + lifeHabits + '\'' + |
| | | ", historyDisease='" + historyDisease + '\'' + |
| | | ", treatmentInfo='" + treatmentInfo + '\'' + |
| | | ", familyDisease='" + familyDisease + '\'' + |
| | | ", nowDisease='" + nowDisease + '\'' + |
| | | ", diseaseHappen='" + diseaseHappen + '\'' + |
| | | ", diseaseDevelop='" + diseaseDevelop + '\'' + |
| | | ", diseaseTreat='" + diseaseTreat + '\'' + |
| | | ", diseaseBack='" + diseaseBack + '\'' + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.21. 20:07 |
| | | * @desc 健康保健护理查体 |
| | | */ |
| | | public class HealthCareNursingExaminationBean { |
| | | //id |
| | | private int id; |
| | | //用户id |
| | | private int uid; |
| | | //体温 |
| | | private String temperature; |
| | | //脉搏 |
| | | private String pulse; |
| | | // |
| | | private String breathe; |
| | | //血压 |
| | | private String bloodPressure; |
| | | //体重 |
| | | private String weight; |
| | | //四肢活动 |
| | | private String movement; |
| | | //皮肤粘膜 |
| | | private SkinTypeClass skinTypeClass; |
| | | //心理状态 |
| | | private PsychologyTypeClass psychologyTypeClass; |
| | | //病理态度 |
| | | private AttitudeClass attitudeClass; |
| | | //营养状况 |
| | | private NutritionClass nutritionClass; |
| | | |
| | | public void setId(int id){ |
| | | this.id = id; |
| | | } |
| | | public int getId(){ |
| | | return this.id; |
| | | } |
| | | public void setUid(int uid){ |
| | | this.uid = uid; |
| | | } |
| | | public int getUid(){ |
| | | return this.uid; |
| | | } |
| | | public void setTemperature(String temperature){ |
| | | this.temperature = temperature; |
| | | } |
| | | public String getTemperature(){ |
| | | return this.temperature; |
| | | } |
| | | public void setPulse(String pulse){ |
| | | this.pulse = pulse; |
| | | } |
| | | public String getPulse(){ |
| | | return this.pulse; |
| | | } |
| | | public void setBreathe(String breathe){ |
| | | this.breathe = breathe; |
| | | } |
| | | public String getBreathe(){ |
| | | return this.breathe; |
| | | } |
| | | public void setBloodPressure(String bloodPressure){ |
| | | this.bloodPressure = bloodPressure; |
| | | } |
| | | public String getBloodPressure(){ |
| | | return this.bloodPressure; |
| | | } |
| | | public void setWeight(String weight){ |
| | | this.weight = weight; |
| | | } |
| | | public String getWeight(){ |
| | | return this.weight; |
| | | } |
| | | public void setMovement(String movement){ |
| | | this.movement = movement; |
| | | } |
| | | public String getMovement(){ |
| | | return this.movement; |
| | | } |
| | | public void setSkinTypeClass(SkinTypeClass skinTypeClass){ |
| | | this.skinTypeClass = skinTypeClass; |
| | | } |
| | | public SkinTypeClass getSkinTypeClass(){ |
| | | return this.skinTypeClass; |
| | | } |
| | | public void setPsychologyTypeClass(PsychologyTypeClass psychologyTypeClass){ |
| | | this.psychologyTypeClass = psychologyTypeClass; |
| | | } |
| | | public PsychologyTypeClass getPsychologyTypeClass(){ |
| | | return this.psychologyTypeClass; |
| | | } |
| | | public void setAttitudeClass(AttitudeClass attitudeClass){ |
| | | this.attitudeClass = attitudeClass; |
| | | } |
| | | public AttitudeClass getAttitudeClass(){ |
| | | return this.attitudeClass; |
| | | } |
| | | public void setNutritionClass(NutritionClass nutritionClass){ |
| | | this.nutritionClass = nutritionClass; |
| | | } |
| | | public NutritionClass getNutritionClass(){ |
| | | return this.nutritionClass; |
| | | } |
| | | public static class SkinTypeClass { |
| | | //青春痘 0否 1是 |
| | | private int acne; |
| | | //牛皮癣 0否 1是 |
| | | private int psoriasis; |
| | | //色素沉着 0否 1是 |
| | | private int color; |
| | | //水肿 0否 1是 |
| | | private int edema; |
| | | //皮疹 0否 1是 |
| | | private int rash; |
| | | //瘀斑 0否 1是 |
| | | private int bloodStasis; |
| | | //皮下结节或肿块 0否 1是 |
| | | private int snom; |
| | | //蜘蛛痣 0否 1是 |
| | | private int nevus; |
| | | //溃疡 0否 1是 |
| | | private int ulcer; |
| | | //其他 0否 1是 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setAcne(int acne){ |
| | | this.acne = acne; |
| | | } |
| | | public int getAcne(){ |
| | | return this.acne; |
| | | } |
| | | public void setPsoriasis(int psoriasis){ |
| | | this.psoriasis = psoriasis; |
| | | } |
| | | public int getPsoriasis(){ |
| | | return this.psoriasis; |
| | | } |
| | | public void setColor(int color){ |
| | | this.color = color; |
| | | } |
| | | public int getColor(){ |
| | | return this.color; |
| | | } |
| | | public void setEdema(int edema){ |
| | | this.edema = edema; |
| | | } |
| | | public int getEdema(){ |
| | | return this.edema; |
| | | } |
| | | public void setRash(int rash){ |
| | | this.rash = rash; |
| | | } |
| | | public int getRash(){ |
| | | return this.rash; |
| | | } |
| | | public void setBloodStasis(int bloodStasis){ |
| | | this.bloodStasis = bloodStasis; |
| | | } |
| | | public int getBloodStasis(){ |
| | | return this.bloodStasis; |
| | | } |
| | | public void setSnom(int snom){ |
| | | this.snom = snom; |
| | | } |
| | | public int getSnom(){ |
| | | return this.snom; |
| | | } |
| | | public void setNevus(int nevus){ |
| | | this.nevus = nevus; |
| | | } |
| | | public int getNevus(){ |
| | | return this.nevus; |
| | | } |
| | | public void setUlcer(int ulcer){ |
| | | this.ulcer = ulcer; |
| | | } |
| | | public int getUlcer(){ |
| | | return this.ulcer; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class PsychologyTypeClass { |
| | | //开朗 0否 1是 |
| | | private int optimistic; |
| | | //焦虑 0否 1是 |
| | | private int worry; |
| | | //忧愁恐惧 0否 1是 |
| | | private int fear; |
| | | //猜疑 0否 1是 |
| | | private int suspicion; |
| | | //压抑 0否 1是 |
| | | private int constrain; |
| | | //思念 0否 1是 |
| | | private int miss; |
| | | |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setOptimistic(int optimistic){ |
| | | this.optimistic = optimistic; |
| | | } |
| | | public int getOptimistic(){ |
| | | return this.optimistic; |
| | | } |
| | | public void setWorry(int worry){ |
| | | this.worry = worry; |
| | | } |
| | | public int getWorry(){ |
| | | return this.worry; |
| | | } |
| | | public void setFear(int fear){ |
| | | this.fear = fear; |
| | | } |
| | | public int getFear(){ |
| | | return this.fear; |
| | | } |
| | | public void setSuspicion(int suspicion){ |
| | | this.suspicion = suspicion; |
| | | } |
| | | public int getSuspicion(){ |
| | | return this.suspicion; |
| | | } |
| | | public void setConstrain(int constrain){ |
| | | this.constrain = constrain; |
| | | } |
| | | public int getConstrain(){ |
| | | return this.constrain; |
| | | } |
| | | public void setMiss(int miss){ |
| | | this.miss = miss; |
| | | } |
| | | public int getMiss(){ |
| | | return this.miss; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class AttitudeClass { |
| | | //明朗 0否 1是 |
| | | private int lucidity; |
| | | //不了解 0否 1是 |
| | | private int unknown; |
| | | //正常 0否 1是 |
| | | private int normal; |
| | | //不正常 0否 1是 |
| | | private int abnormal; |
| | | //其他 0否 1是 |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setLucidity(int lucidity){ |
| | | this.lucidity = lucidity; |
| | | } |
| | | public int getLucidity(){ |
| | | return this.lucidity; |
| | | } |
| | | public void setUnknown(int unknown){ |
| | | this.unknown = unknown; |
| | | } |
| | | public int getUnknown(){ |
| | | return this.unknown; |
| | | } |
| | | public void setNormal(int normal){ |
| | | this.normal = normal; |
| | | } |
| | | public int getNormal(){ |
| | | return this.normal; |
| | | } |
| | | public void setAbnormal(int abnormal){ |
| | | this.abnormal = abnormal; |
| | | } |
| | | public int getAbnormal(){ |
| | | return this.abnormal; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static class NutritionClass { |
| | | //良好 0否 1是 |
| | | private int good; |
| | | //中等 0否 1是 |
| | | private int medium; |
| | | //欠佳 0否 1是 |
| | | private int poor; |
| | | //肥胖 0否 1是 |
| | | private int obesity; |
| | | //消瘦 0否 1是 |
| | | private int thin; |
| | | //恶液质 0否 1是 |
| | | private int fluid; |
| | | |
| | | private int other; |
| | | |
| | | private String otherText; |
| | | |
| | | public void setGood(int good){ |
| | | this.good = good; |
| | | } |
| | | public int getGood(){ |
| | | return this.good; |
| | | } |
| | | public void setMedium(int medium){ |
| | | this.medium = medium; |
| | | } |
| | | public int getMedium(){ |
| | | return this.medium; |
| | | } |
| | | public void setPoor(int poor){ |
| | | this.poor = poor; |
| | | } |
| | | public int getPoor(){ |
| | | return this.poor; |
| | | } |
| | | public void setObesity(int obesity){ |
| | | this.obesity = obesity; |
| | | } |
| | | public int getObesity(){ |
| | | return this.obesity; |
| | | } |
| | | public void setThin(int thin){ |
| | | this.thin = thin; |
| | | } |
| | | public int getThin(){ |
| | | return this.thin; |
| | | } |
| | | public void setFluid(int fluid){ |
| | | this.fluid = fluid; |
| | | } |
| | | public int getFluid(){ |
| | | return this.fluid; |
| | | } |
| | | public void setOther(int other){ |
| | | this.other = other; |
| | | } |
| | | public int getOther(){ |
| | | return this.other; |
| | | } |
| | | public void setOtherText(String otherText){ |
| | | this.otherText = otherText; |
| | | } |
| | | public String getOtherText(){ |
| | | return this.otherText; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | * @desc 家庭设备 bean |
| | | */ |
| | | public class HomeDevicesBean implements Serializable { |
| | | private long id; |
| | | private String name; |
| | | private String createDate; |
| | | private String buyer; |
| | | private String content; |
| | | private String location; |
| | | private int id; |
| | | private String name;//设备名称 |
| | | private String createTime;//创建时间 |
| | | private String buyer;//购买人 |
| | | private String content;//事项内容 |
| | | private String location;//存放位置 |
| | | private String remark; |
| | | private String url; |
| | | private String familyId; |
| | | private String happenTime;//发生时间 |
| | | |
| | | public HomeDevicesBean(long id, String name, String createTime, String people, String content, String address, String remark, String url) { |
| | | this.id = id; |
| | | this.name = name; |
| | | this.createDate = createTime; |
| | | this.buyer = people; |
| | | this.content = content; |
| | | this.location = address; |
| | | this.remark = remark; |
| | | this.url = url; |
| | | } |
| | | private int status;//状态 0:未过期 1:已过期 |
| | | |
| | | public String getName() { |
| | | return name; |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getCreateDate() { |
| | | return createDate; |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateDate(String createDate) { |
| | | this.createDate = createDate; |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getBuyer() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | public long getId() { |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | |
| | | public void setFamilyId(String familyId) { |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.21. 17:11 |
| | | * @desc |
| | | */ |
| | | public class HomeDevicesRequestBean extends PageRequestBean{ |
| | | private String content;//事项内容 |
| | | private String name;//设备名称 |
| | | private String buyer;//购买人 |
| | | private String happenStartTime;//发生时间开始 |
| | | private String happenEndTime;//发生时间结束 |
| | | private String location;//存放位置 |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getBuyer() { |
| | | return buyer; |
| | | } |
| | | |
| | | public void setBuyer(String buyer) { |
| | | this.buyer = buyer; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | public String getLocation() { |
| | | return location; |
| | | } |
| | | |
| | | public void setLocation(String location) { |
| | | this.location = location; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("content",content==null?"":content); |
| | | map.put("name",name==null?"":name); |
| | | map.put("buyer",buyer==null?"":buyer); |
| | | map.put("location",location==null?"":location); |
| | | map.put("happenStartTime",happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime",happenEndTime==null?"":happenEndTime); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | * @desc 首页成员信息 |
| | | */ |
| | | public class HomeMemberBean { |
| | | private String generation; |
| | | private String name; |
| | | private String gender; |
| | | private String url; |
| | | private String birthday; |
| | | private String deathDay; |
| | | private String phone; |
| | | private String company; |
| | | private String spouse; |
| | | |
| | | public HomeMemberBean(String generation, String name, String gender, String url, String birthday, String deathDay, String phone, String company, String spouse) { |
| | | this.generation = generation; |
| | | this.name = name; |
| | | this.gender = gender; |
| | | this.url = url; |
| | | this.birthday = birthday; |
| | | this.deathDay = deathDay; |
| | | this.phone = phone; |
| | | this.company = company; |
| | | this.spouse = spouse; |
| | | //id |
| | | private int userId; |
| | | //身份代数 |
| | | private String identity; |
| | | //姓名 |
| | | private String nickName; |
| | | //性别 1男 0女 |
| | | private int sex; |
| | | //生日 |
| | | private String birth; |
| | | //死亡日期(全生命周期) |
| | | private String deadDay; |
| | | //手机号 |
| | | private String phoneNumber; |
| | | //所在单位 |
| | | private String unit; |
| | | //配偶名称 |
| | | private String spouseName; |
| | | //图像 |
| | | private String img; |
| | | //是否是我的家族 1是 0否 (用于判断是否显示身份代数) |
| | | private int isMyFamily; |
| | | public int getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public String getGeneration() { |
| | | return generation; |
| | | public void setUserId(int userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public void setGeneration(String generation) { |
| | | this.generation = generation; |
| | | public String getIdentity() { |
| | | return identity; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | public void setIdentity(String identity) { |
| | | this.identity = identity; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public String getGender() { |
| | | return gender; |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | public void setGender(String gender) { |
| | | this.gender = gender; |
| | | |
| | | public String getSex() { |
| | | return sex==1?"男":"女"; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | public void setSex(String sex) { |
| | | this.sex = sex.equals("男")?1:0; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | public String getBirth() { |
| | | return birth; |
| | | } |
| | | |
| | | public String getBirthday() { |
| | | return birthday; |
| | | public void setBirth(String birth) { |
| | | this.birth = birth; |
| | | } |
| | | |
| | | public void setBirthday(String birthday) { |
| | | this.birthday = birthday; |
| | | public String getDeadDay() { |
| | | return deadDay; |
| | | } |
| | | |
| | | public String getDeathDay() { |
| | | return deathDay; |
| | | public void setDeadDay(String deadDay) { |
| | | this.deadDay = deadDay; |
| | | } |
| | | |
| | | public void setDeathDay(String deathDay) { |
| | | this.deathDay = deathDay; |
| | | public String getPhoneNumber() { |
| | | return phoneNumber; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | public void setPhoneNumber(String phoneNumber) { |
| | | this.phoneNumber = phoneNumber; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public String getCompany() { |
| | | return company; |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public void setCompany(String company) { |
| | | this.company = company; |
| | | public String getSpouseName() { |
| | | return spouseName; |
| | | } |
| | | |
| | | public String getSpouse() { |
| | | return spouse; |
| | | public void setSpouseName(String spouseName) { |
| | | this.spouseName = spouseName; |
| | | } |
| | | |
| | | public void setSpouse(String spouse) { |
| | | this.spouse = spouse; |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | | |
| | | public void setImg(String img) { |
| | | this.img = img; |
| | | } |
| | | |
| | | public int getIsMyFamily() { |
| | | return isMyFamily; |
| | | } |
| | | |
| | | public void setIsMyFamily(int isMyFamily) { |
| | | this.isMyFamily = isMyFamily; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.06.12. 16:07 |
| | | * @desc |
| | | */ |
| | | public class HomeMemberRequestBean extends PageRequestBean{ |
| | | private String nickName;//姓名 |
| | | private int identity;//身份代数 |
| | | private int sex = -1;//性别 1男 0女 |
| | | private String birth;//生日 |
| | | |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | public int getIdentity() { |
| | | return identity; |
| | | } |
| | | |
| | | public void setIdentity(int identity) { |
| | | this.identity = identity; |
| | | } |
| | | public int getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(int sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getBirth() { |
| | | return birth; |
| | | } |
| | | |
| | | public void setBirth(String birth) { |
| | | this.birth = birth; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("nickName", nickName==null?"":nickName); |
| | | if (identity != 0) { |
| | | map.put("identity", identity); |
| | | } |
| | | if (sex != -1){ |
| | | map.put("sex",sex); |
| | | } |
| | | map.put("birth",birth==null?"":birth); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.11. 20:18 |
| | | * @desc 家根网 成员Bean |
| | | */ |
| | | public class HomeRootBean { |
| | | // id |
| | | int userId; |
| | | // 姓名 |
| | | String nickName; |
| | | // 曾用名 |
| | | String oldName; |
| | | // 性别 1男 0女 |
| | | int sex; |
| | | // 国家 |
| | | String nationality; |
| | | // 民族 |
| | | String nation; |
| | | // 婚姻状况 1已婚 0未婚 2离婚 |
| | | int maritalStatus; |
| | | // 政治面貌 |
| | | String politicalOutlook; |
| | | // 电话 |
| | | String phoneNumber; |
| | | // 身份证号 |
| | | String idNum; |
| | | // 户籍地址 |
| | | String locationAddress; |
| | | // 常住地址 |
| | | String alwaysAddress; |
| | | // 户籍地址公安机关 |
| | | String locationPolice; |
| | | // 常住地址公安机关 |
| | | String alwaysPolice; |
| | | // 单位 |
| | | String unit; |
| | | // 职务 |
| | | String position; |
| | | // 0、1 |
| | | String outStatus; |
| | | String idNo; |
| | | // 去世日期 |
| | | String deadDay; |
| | | // 星座 |
| | | String constellation; |
| | | // 微信号 |
| | | String wxNo; |
| | | // QQ号 |
| | | String qqNo; |
| | | // 生肖 |
| | | String shengXiao; |
| | | // 头像img |
| | | String img; |
| | | // 配偶id |
| | | int spouseId; |
| | | // 配偶信息 |
| | | HomeRootBean spouse; |
| | | // 父亲id |
| | | int fatherId; |
| | | // 母亲id |
| | | int momId; |
| | | // 生日 |
| | | String birth; |
| | | // 电子文件 |
| | | String url; |
| | | // 家庭id |
| | | String familyId; |
| | | // 第二家庭id |
| | | String secondFamilyId; |
| | | //身份代数 |
| | | int identity; |
| | | // 子代列表 |
| | | List<HomeRootBean> childList; |
| | | |
| | | public int getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(int userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | public String getOldName() { |
| | | return oldName; |
| | | } |
| | | |
| | | public void setOldName(String oldName) { |
| | | this.oldName = oldName; |
| | | } |
| | | |
| | | public int getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(int sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getNationality() { |
| | | return nationality; |
| | | } |
| | | |
| | | public void setNationality(String nationality) { |
| | | this.nationality = nationality; |
| | | } |
| | | |
| | | public String getNation() { |
| | | return nation; |
| | | } |
| | | |
| | | public void setNation(String nation) { |
| | | this.nation = nation; |
| | | } |
| | | |
| | | public int getMaritalStatus() { |
| | | return maritalStatus; |
| | | } |
| | | public String getMaritalStatusStr() { |
| | | if (maritalStatus == 0) { |
| | | return "未婚"; |
| | | } else if (maritalStatus == 1) { |
| | | return "已婚"; |
| | | } else if (maritalStatus == 2) { |
| | | return "离婚"; |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | public void setMaritalStatus(int maritalStatus) { |
| | | this.maritalStatus = maritalStatus; |
| | | } |
| | | |
| | | public String getPoliticalOutlook() { |
| | | return politicalOutlook; |
| | | } |
| | | |
| | | public void setPoliticalOutlook(String politicalOutlook) { |
| | | this.politicalOutlook = politicalOutlook; |
| | | } |
| | | |
| | | public String getPhoneNumber() { |
| | | return phoneNumber; |
| | | } |
| | | |
| | | public void setPhoneNumber(String phoneNumber) { |
| | | this.phoneNumber = phoneNumber; |
| | | } |
| | | |
| | | public String getIdNum() { |
| | | return idNum; |
| | | } |
| | | |
| | | public void setIdNum(String idNum) { |
| | | this.idNum = idNum; |
| | | } |
| | | |
| | | public String getLocationAddress() { |
| | | return locationAddress; |
| | | } |
| | | |
| | | public void setLocationAddress(String locationAddress) { |
| | | this.locationAddress = locationAddress; |
| | | } |
| | | |
| | | public String getAlwaysAddress() { |
| | | return alwaysAddress; |
| | | } |
| | | |
| | | public void setAlwaysAddress(String alwaysAddress) { |
| | | this.alwaysAddress = alwaysAddress; |
| | | } |
| | | |
| | | public String getLocationPolice() { |
| | | return locationPolice; |
| | | } |
| | | |
| | | public void setLocationPolice(String locationPolice) { |
| | | this.locationPolice = locationPolice; |
| | | } |
| | | |
| | | public String getAlwaysPolice() { |
| | | return alwaysPolice; |
| | | } |
| | | |
| | | public void setAlwaysPolice(String alwaysPolice) { |
| | | this.alwaysPolice = alwaysPolice; |
| | | } |
| | | |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public String getPosition() { |
| | | return position; |
| | | } |
| | | |
| | | public void setPosition(String position) { |
| | | this.position = position; |
| | | } |
| | | |
| | | public String getOutStatus() { |
| | | return outStatus; |
| | | } |
| | | |
| | | public void setOutStatus(String outStatus) { |
| | | this.outStatus = outStatus; |
| | | } |
| | | |
| | | public String getIdNo() { |
| | | return idNo; |
| | | } |
| | | |
| | | public void setIdNo(String idNo) { |
| | | this.idNo = idNo; |
| | | } |
| | | |
| | | public String getDeadDay() { |
| | | return deadDay; |
| | | } |
| | | |
| | | public void setDeadDay(String deadDay) { |
| | | this.deadDay = deadDay; |
| | | } |
| | | |
| | | public String getConstellation() { |
| | | return constellation; |
| | | } |
| | | |
| | | public void setConstellation(String constellation) { |
| | | this.constellation = constellation; |
| | | } |
| | | |
| | | public String getWxNo() { |
| | | return wxNo; |
| | | } |
| | | |
| | | public void setWxNo(String wxNo) { |
| | | this.wxNo = wxNo; |
| | | } |
| | | |
| | | public String getQqNo() { |
| | | return qqNo; |
| | | } |
| | | |
| | | public void setQqNo(String qqNo) { |
| | | this.qqNo = qqNo; |
| | | } |
| | | |
| | | public String getShengXiao() { |
| | | return shengXiao; |
| | | } |
| | | |
| | | public void setShengXiao(String shengXiao) { |
| | | this.shengXiao = shengXiao; |
| | | } |
| | | |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | | |
| | | public void setImg(String img) { |
| | | this.img = img; |
| | | } |
| | | |
| | | public int getSpouseId() { |
| | | return spouseId; |
| | | } |
| | | |
| | | public void setSpouseId(int spouseId) { |
| | | this.spouseId = spouseId; |
| | | } |
| | | |
| | | public int getFatherId() { |
| | | return fatherId; |
| | | } |
| | | |
| | | public void setFatherId(int fatherId) { |
| | | this.fatherId = fatherId; |
| | | } |
| | | |
| | | public int getMomId() { |
| | | return momId; |
| | | } |
| | | |
| | | public void setMomId(int momId) { |
| | | this.momId = momId; |
| | | } |
| | | |
| | | public String getBirth() { |
| | | return birth; |
| | | } |
| | | |
| | | public void setBirth(String birth) { |
| | | this.birth = birth; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getFamilyId() { |
| | | return familyId; |
| | | } |
| | | |
| | | public void setFamilyId(String familyId) { |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public String getSecondFamilyId() { |
| | | return secondFamilyId; |
| | | } |
| | | |
| | | public void setSecondFamilyId(String secondFamilyId) { |
| | | this.secondFamilyId = secondFamilyId; |
| | | } |
| | | |
| | | public int getIdentity() { |
| | | return identity; |
| | | } |
| | | |
| | | public void setIdentity(int identity) { |
| | | this.identity = identity; |
| | | } |
| | | |
| | | public List<HomeRootBean> getChildList() { |
| | | return childList; |
| | | } |
| | | |
| | | public void setChildList(List<HomeRootBean> childList) { |
| | | this.childList = childList; |
| | | } |
| | | |
| | | public HomeRootBean getSpouse() { |
| | | return spouse; |
| | | } |
| | | |
| | | public void setSpouse(HomeRootBean spouse) { |
| | | this.spouse = spouse; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public class HonorCollectionBean implements Serializable { |
| | | private int id; |
| | | private String happenTime;//获得时间 |
| | | private String type;//类型 |
| | | private String name;//名称 |
| | | private String getTime;//获得时间 |
| | | private String source;//来源 |
| | | private String price;//价值 |
| | | private String owner;//所有者 |
| | | private String price;//价值 |
| | | private String location;//存放地点 |
| | | private String remark;//备注 |
| | | private String url;//电子文件 |
| | | private String familyId;//家庭id |
| | | private int ownData;//拥有数据 |
| | | private String createTime;//创建时间 |
| | | |
| | | public String getName() { |
| | | return name; |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getGetTime() { |
| | | return getTime; |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setGetTime(String getTime) { |
| | | this.getTime = getTime; |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getSource() { |
| | |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public int getOwnData() { |
| | | return ownData; |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setOwnData(int ownData) { |
| | | this.ownData = ownData; |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
| | |
| | | * @desc 荣誉收藏 请求Bean |
| | | */ |
| | | public class HonorCollectionRequestBean { |
| | | private String type;//类型 |
| | | private String name;//名称 |
| | | private String getTime;//获得时间 |
| | | private String source;//来源 |
| | | private String price;//价值 |
| | | private String type;//类别 |
| | | private String owner;//所有者 |
| | | private String location;//存放地点 |
| | | private String remark;//备注 |
| | | |
| | | private int pageNum = 1;//页码 |
| | | private int pageSize = 20;//每页条数 |
| | | |
| | | private String happenStartTime;//搜索范围开始时间 |
| | | private String happenEndTime;//搜索范围结束时间 |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getGetTime() { |
| | | return getTime; |
| | | } |
| | | |
| | | public void setGetTime(String getTime) { |
| | | this.getTime = getTime; |
| | | } |
| | | |
| | | public String getSource() { |
| | | return source; |
| | | } |
| | | |
| | | public void setSource(String source) { |
| | | this.source = source; |
| | | } |
| | | |
| | | public String getPrice() { |
| | | return price; |
| | | } |
| | | |
| | | public void setPrice(String price) { |
| | | this.price = price; |
| | | } |
| | | |
| | | public String getOwner() { |
| | |
| | | this.location = location; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public int getPageNum() { |
| | | return pageNum; |
| | | } |
| | |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | //map |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("type", type == null ? "" : type); |
| | | map.put("name", name == null ? "" : name); |
| | | map.put("getTime", getTime == null ? "" : getTime); |
| | | map.put("source", source == null ? "" : source); |
| | | map.put("price", price == null ? "" : price); |
| | | map.put("owner", owner == null ? "" : owner); |
| | | map.put("location", location == null ? "" : location); |
| | | map.put("remark", remark == null ? "" : remark); |
| | | map.put("happenStartTime", happenStartTime == null ? "" : happenStartTime); |
| | | map.put("happenEndTime", happenEndTime == null ? "" : happenEndTime); |
| | | map.put("pageNum", pageNum); |
| | | map.put("pageSize", pageSize); |
| | | return map; |
| | |
| | | * @desc |
| | | */ |
| | | public class HundredWishBean implements Serializable { |
| | | //标题 |
| | | //id |
| | | private int id; |
| | | //理想标题/百年愿望 |
| | | private String title; |
| | | //创建时间 |
| | | private String createTime; |
| | | //始于何因 |
| | | private String reason; |
| | | private String cause; |
| | | //受惠人 |
| | | private String beneficiary; |
| | | //继承人 |
| | | private String heir; |
| | | //实现难度 |
| | | private String difficulty; |
| | | //继承人 |
| | | private String heir; |
| | | //是否依旧有效 1有效 0无效 |
| | | private int isEffective; |
| | | //创建时间 |
| | | private String createTime; |
| | | //备注 |
| | | private String remark; |
| | | //电子文件 |
| | | private String url; |
| | | //发生时间 |
| | | private String happenTime; |
| | | //所属用户id |
| | | private int uid; |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getReason() { |
| | | return reason; |
| | | public String getCause() { |
| | | return cause; |
| | | } |
| | | |
| | | public void setReason(String reason) { |
| | | this.reason = reason; |
| | | public void setCause(String cause) { |
| | | this.cause = cause; |
| | | } |
| | | |
| | | public String getBeneficiary() { |
| | |
| | | this.difficulty = difficulty; |
| | | } |
| | | |
| | | public int getIsEffective() { |
| | | return isEffective; |
| | | public String getIsEffective() { |
| | | return isEffective==1?"是":"否"; |
| | | } |
| | | |
| | | public void setIsEffective(int isEffective) { |
| | | this.isEffective = isEffective; |
| | | public void setIsEffective(String isEffective) { |
| | | this.isEffective = isEffective.equals("是")?1:0; |
| | | } |
| | | |
| | | public String getRemark() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public int getUid() { |
| | | return uid; |
| | | } |
| | | |
| | | public void setUid(int uid) { |
| | | this.uid = uid; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 22:17 |
| | | * @desc |
| | | */ |
| | | public class HundredWishRequestBean extends PageRequestBean{ |
| | | //标题 |
| | | private String title; |
| | | //受惠人 |
| | | private String beneficiary; |
| | | //继承人 |
| | | private String heir; |
| | | //时间 |
| | | private String happenStartTime; |
| | | private String happenEndTime; |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getBeneficiary() { |
| | | return beneficiary; |
| | | } |
| | | |
| | | public void setBeneficiary(String beneficiary) { |
| | | this.beneficiary = beneficiary; |
| | | } |
| | | |
| | | public String getHeir() { |
| | | return heir; |
| | | } |
| | | |
| | | public void setHeir(String heir) { |
| | | this.heir = heir; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("title",title==null?"":title); |
| | | map.put("beneficiary",beneficiary==null?"":beneficiary); |
| | | map.put("heir",heir==null?"":heir); |
| | | map.put("happenStartTime",happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime",happenEndTime==null?"":happenEndTime); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public class IncomeAndExpensesBean implements Serializable { |
| | | private int id; |
| | | private int type;//0=基金,1=台账 |
| | | private String type;//台账 |
| | | private String createTime; |
| | | private String price;//金额 |
| | | private String useFor;//用途 |
| | | private String usePeople;//使用人 |
| | | private int kind;//0=现金,1=自动划扣 |
| | | private String kind;//现金/自动划扣 |
| | | private String balance;//余额 |
| | | private String remark;//备注 |
| | | private String url;//电子文件 |
| | | private String familyId;//家庭id |
| | | private int ownData;//是否是本家庭的数据 0=否,1=是 |
| | | private String happenTime;//发生时间 |
| | | |
| | | public int getId() { |
| | | return id; |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getType() { |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getKind() { |
| | | return kind; |
| | | } |
| | | |
| | | public void setKind(String kind) { |
| | | this.kind = kind; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | |
| | | this.usePeople = usePeople; |
| | | } |
| | | |
| | | public int getKind() { |
| | | return kind; |
| | | } |
| | | |
| | | public void setKind(int kind) { |
| | | this.kind = kind; |
| | | } |
| | | |
| | | public String getBalance() { |
| | | return balance; |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.20. 22:59 |
| | | * @desc |
| | | */ |
| | | public class IncomeAndExpensesRequestBean extends PageRequestBean{ |
| | | private String type;//基金/台账 |
| | | private String happenStartTime;//发生时间开始 |
| | | private String happenEndTime;//发生时间结束 |
| | | private String useFor;//用途 |
| | | private String usePeople;//使用人 |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | public String getUseFor() { |
| | | return useFor; |
| | | } |
| | | |
| | | public void setUseFor(String useFor) { |
| | | this.useFor = useFor; |
| | | } |
| | | |
| | | public String getUsePeople() { |
| | | return usePeople; |
| | | } |
| | | |
| | | public void setUsePeople(String usePeople) { |
| | | this.usePeople = usePeople; |
| | | } |
| | | |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("type", type==null?"":type); |
| | | map.put("happenStartTime", happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime", happenEndTime==null?"":happenEndTime); |
| | | map.put("useFor", useFor==null?"":useFor); |
| | | map.put("usePeople", usePeople==null?"":usePeople); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | private String symptom;//症状 |
| | | private String duration;//持续时间 |
| | | private String cmedical;//中医处方 |
| | | private String wmedical; |
| | | private String effect; |
| | | private String suitable; |
| | | private String remark; |
| | | private String url; |
| | | private String wmedical;//西医处方 |
| | | private String effect;//功效 |
| | | private String suitable;//适用人群 |
| | | private String remark;//备注 |
| | | private String url;//电子文件地址 |
| | | |
| | | public LittleDoctorBean(int id, String symptoms, String usingPeople, String duration, String type, String tcmPrescription, String westernMedicinePrescription, String efficacy, String remark, String url) { |
| | | this.id = id; |
| | |
| | | this.url = url; |
| | | } |
| | | |
| | | public LittleDoctorBean() { |
| | | |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import android.text.TextUtils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @date 2023.04.15. 21:30 |
| | | * @desc |
| | | */ |
| | | public class LittleDoctorRequestBean { |
| | | private int pageNum = 1; |
| | | private int pageSize = 20; |
| | | public class LittleDoctorRequestBean extends PageRequestBean{ |
| | | private String type;//类型 |
| | | private String symptom;//症状 |
| | | private String prescription;//处方 |
| | | private String suitable;//适用人群 |
| | | |
| | | public LittleDoctorRequestBean() { |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("page", pageNum); |
| | | map.put("pageSize", pageSize); |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("type",type==null?"":type); |
| | | map.put("symptom",symptom==null?"":symptom); |
| | | if (!TextUtils.isEmpty(prescription)){ |
| | | map.put("prescription",prescription==null?"":prescription); |
| | | } |
| | | map.put("suitable",suitable==null?"":suitable); |
| | | return map; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getSymptom() { |
| | | return symptom; |
| | | } |
| | | |
| | | public void setSymptom(String symptom) { |
| | | this.symptom = symptom; |
| | | } |
| | | |
| | | public String getPrescription() { |
| | | return prescription; |
| | | } |
| | | |
| | | public void setPrescription(String prescription) { |
| | | this.prescription = prescription; |
| | | } |
| | | |
| | | public String getSuitable() { |
| | | return suitable; |
| | | } |
| | | |
| | | public void setSuitable(String suitable) { |
| | | this.suitable = suitable; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.21. 22:43 |
| | | * @desc 婚姻信息 |
| | | */ |
| | | public class MarriageInfoBean { |
| | | //本人信息 |
| | | //本人id |
| | | private String id; |
| | | //本人名字 |
| | | private String name; |
| | | //本人出生日期 |
| | | private String birthday; |
| | | //本人户籍地址 |
| | | private String address; |
| | | //工作地址 |
| | | private String workAddress; |
| | | //本人婚姻状态 0未婚 1初婚 2离婚 3再婚 |
| | | private int marryStatus; |
| | | //本人性别 0女 1男 |
| | | private int sex; |
| | | //本人民族 |
| | | private String nation; |
| | | //本人电话号码 |
| | | private String phone; |
| | | //本人身份证号码 |
| | | private String idNo; |
| | | |
| | | //配偶信息 |
| | | //配偶id |
| | | private String spouseId; |
| | | //配偶名字 |
| | | private String spouseName; |
| | | //配偶出生日期 |
| | | private String spouseBirthday; |
| | | //配偶户籍地址 |
| | | private String spouseAddress; |
| | | //配偶工作地址 |
| | | private String spouseWorkAddress; |
| | | //配偶婚姻状态 0未婚 1初婚 2离婚 3再婚 |
| | | private int spouseMarryStatus; |
| | | //配偶性别 0女 1男 |
| | | private int spouseSex; |
| | | //配偶民族 |
| | | private String spouseNation; |
| | | //配偶电话号码 |
| | | private String spousePhone; |
| | | //配偶身份证号码 |
| | | private String spouseIdNo; |
| | | |
| | | //结婚信息 |
| | | //结婚id |
| | | private int marryId; |
| | | //结婚时间 |
| | | private String marryTime; |
| | | //生育情况 0未生育 1在孕 2已生育 |
| | | private int bearStatus; |
| | | //是否领取计划生育服务手册 0未领取 1已领取 |
| | | private int handbookStatus; |
| | | //领取计划生育服务手册时间 |
| | | private String handbookTime; |
| | | //是否领取独生子女证 0未领取 1已领取 |
| | | private int oneBorn; |
| | | //领取独生子女证时间 |
| | | private String oneBornTime; |
| | | //需要声明的情况 |
| | | private String content; |
| | | private String contentTime; |
| | | //备注 |
| | | private String remark; |
| | | private String remarkTime; |
| | | |
| | | private List<OldSpouseBean> oldSpouseList; |
| | | |
| | | |
| | | public String getAddress() { return address; } |
| | | public void setAddress(String value) { this.address = value; } |
| | | |
| | | public String getBearStatus() { |
| | | if (bearStatus == 0) { |
| | | return "未生育"; |
| | | } else if (bearStatus == 1) { |
| | | return "在孕"; |
| | | } else if (bearStatus == 2) { |
| | | return "已生育"; |
| | | } else { |
| | | return "未知"; |
| | | } |
| | | } |
| | | |
| | | public void setBearStatus(int bearStatus) { |
| | | this.bearStatus = bearStatus; |
| | | } |
| | | |
| | | public String getBirthday() { return birthday; } |
| | | public void setBirthday(String value) { this.birthday = value; } |
| | | |
| | | public String getContent() { return content; } |
| | | public void setContent(String value) { this.content = value; } |
| | | |
| | | public String getHandbookStatus() { |
| | | return handbookStatus == 0 ? "否" : "是"; |
| | | } |
| | | |
| | | public void setHandbookStatus(int value) { this.handbookStatus = value; } |
| | | |
| | | public String getHandbookTime() { return handbookTime; } |
| | | public void setHandbookTime(String value) { this.handbookTime = value; } |
| | | |
| | | public String getid() { return id; } |
| | | public void setid(String value) { this.id = value; } |
| | | |
| | | public int getMarryId() { return marryId; } |
| | | public void setMarryId(int value) { this.marryId = value; } |
| | | |
| | | public String getMarryStatus() { |
| | | if (marryStatus == 0) { |
| | | return "未婚"; |
| | | } else if (marryStatus == 1) { |
| | | return "初婚"; |
| | | } else if (marryStatus == 2) { |
| | | return "离婚"; |
| | | } else if (marryStatus == 3) { |
| | | return "再婚"; |
| | | } else { |
| | | return "未知"; |
| | | } |
| | | } |
| | | |
| | | public void setMarryStatus(int marryStatus) { |
| | | this.marryStatus = marryStatus; |
| | | } |
| | | |
| | | public String getMarryTime() { return marryTime; } |
| | | public void setMarryTime(String value) { this.marryTime = value; } |
| | | |
| | | public String getName() { return name; } |
| | | public void setName(String value) { this.name = value; } |
| | | |
| | | public String getNation() { return nation; } |
| | | public void setNation(String value) { this.nation = value; } |
| | | |
| | | public String getIdNo() { |
| | | return idNo; |
| | | } |
| | | |
| | | public void setIdNo(String idNo) { |
| | | this.idNo = idNo; |
| | | } |
| | | |
| | | public String getSpouseIdNo() { |
| | | return spouseIdNo; |
| | | } |
| | | |
| | | public void setSpouseIdNo(String spouseIdNo) { |
| | | this.spouseIdNo = spouseIdNo; |
| | | } |
| | | |
| | | public String getContentTime() { |
| | | return contentTime; |
| | | } |
| | | |
| | | public void setContentTime(String contentTime) { |
| | | this.contentTime = contentTime; |
| | | } |
| | | |
| | | public String getRemarkTime() { |
| | | return remarkTime; |
| | | } |
| | | |
| | | public void setRemarkTime(String remarkTime) { |
| | | this.remarkTime = remarkTime; |
| | | } |
| | | |
| | | /** |
| | | * 前任的信息列表 |
| | | */ |
| | | public List<OldSpouseBean> getOldSpouseList() { return oldSpouseList; } |
| | | public void setOldSpouseList(List<OldSpouseBean> value) { this.oldSpouseList = value; } |
| | | |
| | | public String getOneBorn() { |
| | | return oneBorn == 0 ? "否" : "是"; |
| | | } |
| | | public void setOneBorn(int value) { this.oneBorn = value; } |
| | | |
| | | public String getOneBornTime() { return oneBornTime; } |
| | | public void setOneBornTime(String value) { this.oneBornTime = value; } |
| | | |
| | | public String getPhone() { return phone; } |
| | | public void setPhone(String value) { this.phone = value; } |
| | | |
| | | public String getRemark() { return remark; } |
| | | public void setRemark(String value) { this.remark = value; } |
| | | |
| | | public String getSex() { |
| | | return sex == 0 ? "女" : "男"; |
| | | } |
| | | public void setSex(String value) { |
| | | this.sex = value.equals("女") ? 0 : 1; |
| | | } |
| | | |
| | | public String getSpouseAddress() { return spouseAddress; } |
| | | public void setSpouseAddress(String value) { this.spouseAddress = value; } |
| | | |
| | | public String getSpouseBirthday() { return spouseBirthday; } |
| | | public void setSpouseBirthday(String value) { this.spouseBirthday = value; } |
| | | |
| | | /** |
| | | * 现任信息 |
| | | */ |
| | | public String getSpouseId() { return spouseId; } |
| | | public void setSpouseId(String value) { this.spouseId = value; } |
| | | |
| | | |
| | | public String getSpouseMarryStatus() { |
| | | if (spouseMarryStatus == 0) { |
| | | return "未婚"; |
| | | } else if (spouseMarryStatus == 1) { |
| | | return "初婚"; |
| | | } else if (spouseMarryStatus == 2) { |
| | | return "离婚"; |
| | | } else if (spouseMarryStatus == 3) { |
| | | return "再婚"; |
| | | } else { |
| | | return "未知"; |
| | | } |
| | | } |
| | | |
| | | public void setSpouseMarryStatus(int spouseMarryStatus) { |
| | | this.spouseMarryStatus = spouseMarryStatus; |
| | | } |
| | | |
| | | public String getSpouseName() { return spouseName; } |
| | | public void setSpouseName(String value) { this.spouseName = value; } |
| | | |
| | | public String getSpouseNation() { return spouseNation; } |
| | | public void setSpouseNation(String value) { this.spouseNation = value; } |
| | | |
| | | public String getSpousePhone() { return spousePhone; } |
| | | public void setSpousePhone(String value) { this.spousePhone = value; } |
| | | |
| | | public int getSpouseSex() { return spouseSex; } |
| | | public void setSpouseSex(int value) { this.spouseSex = value; } |
| | | |
| | | public String getSpouseWorkAddress() { return spouseWorkAddress; } |
| | | public void setSpouseWorkAddress(String value) { this.spouseWorkAddress = value; } |
| | | |
| | | public String getWorkAddress() { return workAddress; } |
| | | public void setWorkAddress(String value) { this.workAddress = value; } |
| | | |
| | | public static class OldSpouseBean { |
| | | private String id; |
| | | private String name; |
| | | private String address; |
| | | private String birthday; |
| | | private int marryStatus; |
| | | private Object myId; |
| | | private String nation; |
| | | private String phone; |
| | | private int sex; |
| | | private String workAddress; |
| | | |
| | | public String getAddress() { return address; } |
| | | public void setAddress(String value) { this.address = value; } |
| | | |
| | | public String getBirthday() { return birthday; } |
| | | public void setBirthday(String value) { this.birthday = value; } |
| | | |
| | | public String getid() { return id; } |
| | | public void setid(String value) { this.id = value; } |
| | | |
| | | public String getMarryStatus() { |
| | | if (marryStatus == 0) { |
| | | return "未婚"; |
| | | } else if (marryStatus == 1) { |
| | | return "初婚"; |
| | | } else if (marryStatus == 2) { |
| | | return "离婚"; |
| | | } else if (marryStatus == 3) { |
| | | return "再婚"; |
| | | } else { |
| | | return "未知"; |
| | | } |
| | | } |
| | | public void setMarryStatus(int value) { this.marryStatus = value; } |
| | | |
| | | public Object getMyId() { return myId; } |
| | | public void setMyId(Object value) { this.myId = value; } |
| | | |
| | | public String getName() { return name; } |
| | | public void setName(String value) { this.name = value; } |
| | | |
| | | public String getNation() { return nation; } |
| | | public void setNation(String value) { this.nation = value; } |
| | | |
| | | public String getPhone() { return phone; } |
| | | public void setPhone(String value) { this.phone = value; } |
| | | |
| | | public int getSex() { return sex; } |
| | | public void setSex(int value) { this.sex = value; } |
| | | |
| | | public String getWorkAddress() { return workAddress; } |
| | | public void setWorkAddress(String value) { this.workAddress = value; } |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.06.11. 23:15 |
| | | * @desc |
| | | */ |
| | | public class MemoBean implements Serializable { |
| | | //id |
| | | private int id; |
| | | //模块id 家庭资产2007 家庭设备2017 财产:2026 隐私:2031 |
| | | private int fid; |
| | | //时间 |
| | | private String happenTime; |
| | | //创建时间 |
| | | private String createTime; |
| | | //内容 |
| | | private String content; |
| | | //对应的记录id |
| | | private int cid; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getFid() { |
| | | return fid; |
| | | } |
| | | |
| | | public void setFid(int fid) { |
| | | this.fid = fid; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public int getCid() { |
| | | return cid; |
| | | } |
| | | |
| | | public void setCid(int cid) { |
| | | this.cid = cid; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.20. 17:57 |
| | | * @desc 分页请求参数 基类 |
| | | */ |
| | | public class PageRequestBean { |
| | | //页码 |
| | | protected int pageNum = 1; |
| | | //每页数量 |
| | | protected int pageSize = 20; |
| | | |
| | | public int getPageNum() { |
| | | return pageNum; |
| | | } |
| | | |
| | | public void setPageNum(int pageNum) { |
| | | this.pageNum = pageNum; |
| | | } |
| | | |
| | | public int getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(int pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public Map<String,Object> toMap() { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("pageNum",pageNum); |
| | | map.put("pageSize",pageSize); |
| | | return map; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.20. 17:59 |
| | | * @desc 数据分页返回类 |
| | | */ |
| | | public class PageResponseBean<T> { |
| | | private int pageNum; |
| | | private int pageSize; |
| | | private int total; |
| | | |
| | | private List<T> data; |
| | | |
| | | |
| | | public int getPageNum() { |
| | | return pageNum; |
| | | } |
| | | |
| | | public void setPageNum(int pageNum) { |
| | | this.pageNum = pageNum; |
| | | } |
| | | |
| | | public int getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(int pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(int total) { |
| | | this.total = total; |
| | | } |
| | | |
| | | public List<T> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(List<T> data) { |
| | | this.data = data; |
| | | } |
| | | } |
| | |
| | | //标题 |
| | | private String title; |
| | | //时间 |
| | | private String time; |
| | | private String happenTime; |
| | | //人物 |
| | | private String person; |
| | | private String people; |
| | | //地点 |
| | | private String place; |
| | | private String address; |
| | | //备注 |
| | | private String remark; |
| | | //电子文件 |
| | |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getTime() { |
| | | return time; |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setTime(String time) { |
| | | this.time = time; |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getPerson() { |
| | | return person; |
| | | public String getPeople() { |
| | | return people; |
| | | } |
| | | |
| | | public void setPerson(String person) { |
| | | this.person = person; |
| | | public void setPeople(String people) { |
| | | this.people = people; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getRemark() { |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 15:28 |
| | | * @desc |
| | | */ |
| | | public class PersonalNotepadRequestBean extends PageRequestBean{ |
| | | //标题 |
| | | private String title; |
| | | //地点 |
| | | private String address; |
| | | //人物 |
| | | private String people; |
| | | //发生时间开始 |
| | | private String happenStartTime; |
| | | //发生时间结束 |
| | | private String happenEndTime; |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getPeople() { |
| | | return people; |
| | | } |
| | | |
| | | public void setPeople(String people) { |
| | | this.people = people; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("title", title==null?"":title); |
| | | map.put("address", address ==null?"": address); |
| | | map.put("people", people ==null?"": people); |
| | | map.put("happenStartTime", happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime", happenEndTime==null?"":happenEndTime); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 22:58 |
| | | * @desc |
| | | */ |
| | | public class PetBean implements Serializable { |
| | | //id |
| | | private String id; |
| | | //犬证号码 |
| | | private String idNum; |
| | | //防伪码 |
| | | private String securityCode; |
| | | //犬种 |
| | | private String type; |
| | | //名字 |
| | | private String name; |
| | | //出生日期 |
| | | private String birth; |
| | | //性别 0 雌 1 雄 |
| | | private int sex; |
| | | //毛色 |
| | | private String color; |
| | | //犬只性质 |
| | | private String properties; |
| | | //饮食习惯(喜) |
| | | private String eatHabit; |
| | | //饮食习惯(忌) |
| | | private String disEatHabit; |
| | | //生活习惯(喜) |
| | | private String lifeHabit; |
| | | //生活习惯(忌) |
| | | private String disLifeHabit; |
| | | //居住地址 |
| | | private String address; |
| | | //能听懂的方言 |
| | | private String dialect; |
| | | |
| | | private int familyId; |
| | | private int ownData; |
| | | private String createTime; |
| | | private String headPicture; |
| | | //全身照 |
| | | private String fullPicture; |
| | | //犬主姓名 |
| | | private String masterName; |
| | | //犬主身份证号 |
| | | private String masterIdNum; |
| | | //犬主电话 |
| | | private String phone; |
| | | //犬主地址 |
| | | private String masterAddress; |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getIdNum() { |
| | | return idNum; |
| | | } |
| | | |
| | | public void setIdNum(String idNum) { |
| | | this.idNum = idNum; |
| | | } |
| | | |
| | | public String getSecurityCode() { |
| | | return securityCode; |
| | | } |
| | | |
| | | public void setSecurityCode(String securityCode) { |
| | | this.securityCode = securityCode; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getBirth() { |
| | | return birth; |
| | | } |
| | | |
| | | public void setBirth(String birth) { |
| | | this.birth = birth; |
| | | } |
| | | |
| | | public String getSex() { |
| | | return sex==0?"雌":"雄"; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex.equals("雌")?0:1; |
| | | } |
| | | |
| | | public String getColor() { |
| | | return color; |
| | | } |
| | | |
| | | public void setColor(String color) { |
| | | this.color = color; |
| | | } |
| | | |
| | | public String getProperties() { |
| | | return properties; |
| | | } |
| | | |
| | | public void setProperties(String properties) { |
| | | this.properties = properties; |
| | | } |
| | | |
| | | public String getEatHabit() { |
| | | return eatHabit; |
| | | } |
| | | |
| | | public void setEatHabit(String eatHabit) { |
| | | this.eatHabit = eatHabit; |
| | | } |
| | | |
| | | public String getDisEatHabit() { |
| | | return disEatHabit; |
| | | } |
| | | |
| | | public void setDisEatHabit(String disEatHabit) { |
| | | this.disEatHabit = disEatHabit; |
| | | } |
| | | |
| | | public String getLifeHabit() { |
| | | return lifeHabit; |
| | | } |
| | | |
| | | public void setLifeHabit(String lifeHabit) { |
| | | this.lifeHabit = lifeHabit; |
| | | } |
| | | |
| | | public String getDisLifeHabit() { |
| | | return disLifeHabit; |
| | | } |
| | | |
| | | public void setDisLifeHabit(String disLifeHabit) { |
| | | this.disLifeHabit = disLifeHabit; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getDialect() { |
| | | return dialect; |
| | | } |
| | | |
| | | public void setDialect(String dialect) { |
| | | this.dialect = dialect; |
| | | } |
| | | |
| | | |
| | | public int getFamilyId() { |
| | | return familyId; |
| | | } |
| | | |
| | | public void setFamilyId(int familyId) { |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public int getOwnData() { |
| | | return ownData; |
| | | } |
| | | |
| | | public void setOwnData(int ownData) { |
| | | this.ownData = ownData; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getHeadPicture() { |
| | | return headPicture; |
| | | } |
| | | |
| | | public void setHeadPicture(String headPicture) { |
| | | this.headPicture = headPicture; |
| | | } |
| | | |
| | | public String getFullPicture() { |
| | | return fullPicture; |
| | | } |
| | | |
| | | public void setFullPicture(String fullPicture) { |
| | | this.fullPicture = fullPicture; |
| | | } |
| | | |
| | | public String getMasterName() { |
| | | return masterName; |
| | | } |
| | | |
| | | public void setMasterName(String masterName) { |
| | | this.masterName = masterName; |
| | | } |
| | | |
| | | public String getMasterIdNum() { |
| | | return masterIdNum; |
| | | } |
| | | |
| | | public void setMasterIdNum(String masterIdNum) { |
| | | this.masterIdNum = masterIdNum; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public String getMasterAddress() { |
| | | return masterAddress; |
| | | } |
| | | |
| | | public void setMasterAddress(String masterAddress) { |
| | | this.masterAddress = masterAddress; |
| | | } |
| | | } |
| | |
| | | * @desc |
| | | */ |
| | | public class PetMemoBean implements Serializable { |
| | | //题名 |
| | | private String name; |
| | | //日期 |
| | | private String time; |
| | | private String id; |
| | | //宠物id |
| | | private String pid; |
| | | //创建时间 |
| | | private String createTime; |
| | | //提醒时间 |
| | | private String reminderTime; |
| | | private String remindTime; |
| | | //发生时间 |
| | | private String happenTime; |
| | | //题名 |
| | | private String title; |
| | | |
| | | private String remark; |
| | | private String url; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getTime() { |
| | | return time; |
| | | public String getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | public void setTime(String time) { |
| | | this.time = time; |
| | | public void setPid(String pid) { |
| | | this.pid = pid; |
| | | } |
| | | |
| | | public String getReminderTime() { |
| | | return reminderTime; |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setReminderTime(String reminderTime) { |
| | | this.reminderTime = reminderTime; |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getRemindTime() { |
| | | return remindTime; |
| | | } |
| | | |
| | | public void setRemindTime(String remindTime) { |
| | | this.remindTime = remindTime; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getRemark() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.23. 16:14 |
| | | * @desc |
| | | */ |
| | | public class PetMemoRequestBean extends PageRequestBean{ |
| | | //宠物id |
| | | private String pid; |
| | | //题名 |
| | | private String title; |
| | | //开始时间 |
| | | private String happenStartTime; |
| | | //结束时间 |
| | | private String happenEndTime; |
| | | //提醒时间开始 |
| | | private String remindStartTime; |
| | | //提醒时间结束 |
| | | private String remindEndTime; |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | public String getRemindStartTime() { |
| | | return remindStartTime; |
| | | } |
| | | |
| | | public void setRemindStartTime(String remindStartTime) { |
| | | this.remindStartTime = remindStartTime; |
| | | } |
| | | |
| | | public String getRemindEndTime() { |
| | | return remindEndTime; |
| | | } |
| | | |
| | | public void setRemindEndTime(String remindEndTime) { |
| | | this.remindEndTime = remindEndTime; |
| | | } |
| | | public void setPid(String pid) { |
| | | this.pid = pid; |
| | | } |
| | | |
| | | public String getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("pid", pid == null ? "" : pid); |
| | | map.put("title", title == null ? "" : title); |
| | | map.put("happenStartTime", happenStartTime == null ? "" : happenStartTime); |
| | | map.put("happenEndTime", happenEndTime == null ? "" : happenEndTime); |
| | | map.put("remindStartTime", remindStartTime == null ? "" : remindStartTime); |
| | | map.put("remindEndTime", remindEndTime == null ? "" : remindEndTime); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.23. 15:20 |
| | | * @desc 宠物主人 |
| | | */ |
| | | public class PetOwnerBean { |
| | | //id |
| | | private long id; |
| | | //宠物表Id |
| | | private String petId; |
| | | //宠物主人名称 |
| | | private String name; |
| | | //证件类型 |
| | | private String certificateType; |
| | | //证件号码 |
| | | private String certificateNo; |
| | | //固定号码 |
| | | private String fixedNo; |
| | | //移动号码 |
| | | private String phoneNo; |
| | | //拥有数量 |
| | | private int many; |
| | | //住所详细地址 |
| | | private String address; |
| | | //住所性质 |
| | | private String property; |
| | | //电子邮件 |
| | | private String email; |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getPetId() { |
| | | return petId; |
| | | } |
| | | |
| | | public void setPetId(String petId) { |
| | | this.petId = petId; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getCertificateType() { |
| | | return certificateType; |
| | | } |
| | | |
| | | public void setCertificateType(String certificateType) { |
| | | this.certificateType = certificateType; |
| | | } |
| | | |
| | | public String getCertificateNo() { |
| | | return certificateNo; |
| | | } |
| | | |
| | | public void setCertificateNo(String certificateNo) { |
| | | this.certificateNo = certificateNo; |
| | | } |
| | | |
| | | public String getFixedNo() { |
| | | return fixedNo; |
| | | } |
| | | |
| | | public void setFixedNo(String fixedNo) { |
| | | this.fixedNo = fixedNo; |
| | | } |
| | | |
| | | public String getPhoneNo() { |
| | | return phoneNo; |
| | | } |
| | | |
| | | public void setPhoneNo(String phoneNo) { |
| | | this.phoneNo = phoneNo; |
| | | } |
| | | |
| | | public int getMany() { |
| | | return many; |
| | | } |
| | | |
| | | public void setMany(int many) { |
| | | this.many = many; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getProperty() { |
| | | return property; |
| | | } |
| | | |
| | | public void setProperty(String property) { |
| | | this.property = property; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 22:59 |
| | | * @desc |
| | | */ |
| | | public class PetRequestBean extends PageRequestBean{ |
| | | //名字 |
| | | private String name; |
| | | //出生日期开始时间 |
| | | private String happenStartTime; |
| | | //出生日期结束时间 |
| | | private String happenEndTime; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("name",name==null?"":name); |
| | | map.put("happenStartTime",happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime",happenEndTime==null?"":happenEndTime); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class PrivacyBean implements Serializable { |
| | | private int id; |
| | | //类别 |
| | | private String type; |
| | | //账号(含理财收益) |
| | | private String accNo; |
| | | //时间 |
| | | private String time; |
| | | //账号 |
| | | private String account; |
| | | //密码 |
| | | private String password; |
| | | private String happenTime; |
| | | //有效时间 |
| | | private String effectiveTime; |
| | | //是否开启指纹 |
| | | private int isFingerprint; |
| | | //是否开启人脸识别 |
| | | private String validityDate; |
| | | //密码(存折和卡用逗号隔开) |
| | | private String password; |
| | | //是否开启指纹 0否 1是 |
| | | private int isFinger; |
| | | //是否开启人脸识别 0否 1是 |
| | | private int isFace; |
| | | //私有还是公有 |
| | | private int isPublic; |
| | | //是否私有 0否 1是 |
| | | private int isPrivate; |
| | | //存放位置 |
| | | private String location; |
| | | //备注 |
| | | private String remark; |
| | | //电子文件 |
| | | private String url; |
| | | //用户id |
| | | private String userId; |
| | | //创建时间 |
| | | private String createTime; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getTime() { |
| | | return time; |
| | | public String getAccNo() { |
| | | return accNo; |
| | | } |
| | | |
| | | public void setTime(String time) { |
| | | this.time = time; |
| | | public void setAccNo(String accNo) { |
| | | this.accNo = accNo; |
| | | } |
| | | |
| | | public String getAccount() { |
| | | return account; |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setAccount(String account) { |
| | | this.account = account; |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getValidityDate() { |
| | | return validityDate; |
| | | } |
| | | |
| | | public void setValidityDate(String validityDate) { |
| | | this.validityDate = validityDate; |
| | | } |
| | | |
| | | public String getPassword() { |
| | |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getEffectiveTime() { |
| | | return effectiveTime; |
| | | public String getIsFinger() { |
| | | return isFinger==0?"否":"是"; |
| | | } |
| | | |
| | | public void setEffectiveTime(String effectiveTime) { |
| | | this.effectiveTime = effectiveTime; |
| | | public void setIsFinger(String isFinger) { |
| | | if (isFinger != null){ |
| | | this.isFinger = isFinger.equals("否")?0:1; |
| | | } |
| | | } |
| | | |
| | | public int getIsFingerprint() { |
| | | return isFingerprint; |
| | | public String getIsFace() { |
| | | return isFace==0?"否":"是"; |
| | | } |
| | | |
| | | public void setIsFingerprint(int isFingerprint) { |
| | | this.isFingerprint = isFingerprint; |
| | | public void setIsFace(String isFace) { |
| | | if (isFace != null){ |
| | | this.isFace = isFace.equals("否")?0:1; |
| | | } |
| | | } |
| | | |
| | | public int getIsFace() { |
| | | return isFace; |
| | | public String getIsPrivate() { |
| | | return isPrivate==0?"公有":"私有"; |
| | | } |
| | | |
| | | public void setIsFace(int isFace) { |
| | | this.isFace = isFace; |
| | | public void setIsPrivate(String isPrivate) { |
| | | if (isPrivate != null){ |
| | | this.isPrivate = isPrivate.equals("否")?0:1; |
| | | } |
| | | |
| | | public int getIsPublic() { |
| | | return isPublic; |
| | | } |
| | | |
| | | public void setIsPublic(int isPublic) { |
| | | this.isPublic = isPublic; |
| | | } |
| | | |
| | | public String getLocation() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 19:33 |
| | | * @desc |
| | | */ |
| | | public class PrivacyRequestBean extends PageRequestBean{ |
| | | private String type;//类别 |
| | | private String accNo;//账号 |
| | | private String happenStartTime;//开始时间 |
| | | private String happenEndTime;//结束时间 |
| | | private int isPrivate = -1;//是否私有 0否 1是 |
| | | private String location;//存放位置 |
| | | private int isFinger = -1;//是否开启指纹 0否 1是 |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getAccNo() { |
| | | return accNo; |
| | | } |
| | | |
| | | public void setAccNo(String accNo) { |
| | | this.accNo = accNo; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | public int getIsPrivate() { |
| | | return isPrivate; |
| | | } |
| | | |
| | | public void setIsPrivate(int isPrivate) { |
| | | this.isPrivate = isPrivate; |
| | | } |
| | | |
| | | public String getLocation() { |
| | | return location; |
| | | } |
| | | |
| | | public void setLocation(String location) { |
| | | this.location = location; |
| | | } |
| | | |
| | | public int getIsFinger() { |
| | | return isFinger; |
| | | } |
| | | |
| | | public void setIsFinger(int isFinger) { |
| | | this.isFinger = isFinger; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("type",type==null?"":type); |
| | | map.put("accNo",accNo==null?"":accNo); |
| | | map.put("happenStartTime",happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime",happenEndTime==null?"":happenEndTime); |
| | | if (isFinger != -1){ |
| | | map.put("isFinger",isFinger); |
| | | } |
| | | if (isPrivate != -1){ |
| | | map.put("isPrivate",isPrivate); |
| | | } |
| | | map.put("location",location==null?"":location); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | * @desc 个人财产 Bean |
| | | */ |
| | | public class PropertyBean implements Serializable { |
| | | |
| | | private String type; |
| | | private String name; |
| | | private int id;//id |
| | | private int userId;//用户id |
| | | private String type;//财产类别 |
| | | private String incomeName;//收支名称 |
| | | private String price;//价值 |
| | | private String createTime;//时间 |
| | | private String term;//期限 |
| | | private String status;//变更或注销 |
| | | private String timeLimit;//期限 |
| | | private String isChange;//变更或注销 |
| | | private String propertyRight;//产权 |
| | | private String location;//位置 |
| | | private String createTime;//创建时间 |
| | | private String remark;//备注 |
| | | private String url;//电子文件 |
| | | private int status;//是否注销 1.是 0.否 |
| | | private String happenTime;//发生时间 |
| | | |
| | | public PropertyBean() { |
| | | } |
| | | public PropertyBean(String type, String name, String price, String createTime, String term, String status, String propertyRight, String location, String remark, String url) { |
| | | this.type = type; |
| | | this.name = name; |
| | | this.price = price; |
| | | this.createTime = createTime; |
| | | this.term = term; |
| | | this.status = status; |
| | | this.propertyRight = propertyRight; |
| | | this.location = location; |
| | | this.remark = remark; |
| | | this.url = url; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getType() { |
| | |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | public String getIncomeName() { |
| | | return incomeName; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public void setIncomeName(String incomeName) { |
| | | this.incomeName = incomeName; |
| | | } |
| | | |
| | | public String getPrice() { |
| | |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getTerm() { |
| | | return term; |
| | | public String getTimeLimit() { |
| | | return timeLimit; |
| | | } |
| | | |
| | | public void setTerm(String term) { |
| | | this.term = term; |
| | | public void setTimeLimit(String timeLimit) { |
| | | this.timeLimit = timeLimit; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | public String getIsChange() { |
| | | return isChange; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | public void setIsChange(String isChange) { |
| | | this.isChange = isChange; |
| | | } |
| | | |
| | | public String getPropertyRight() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public int getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(int userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status==1?"是":"否"; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status.equals("是")?1:0; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.05.22. 21:51 |
| | | * @desc |
| | | */ |
| | | public class PropertyRequestBean extends PageRequestBean{ |
| | | private String type;//类型 |
| | | private String name;//名称 |
| | | private String term;//期限 |
| | | private String happenStartTime;//时间开始 |
| | | private String happenEndTime;//时间结束 |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getTerm() { |
| | | return term; |
| | | } |
| | | |
| | | public void setTerm(String term) { |
| | | this.term = term; |
| | | } |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("type",type==null?"":type); |
| | | map.put("name",name==null?"":name); |
| | | map.put("term",term==null?"":term); |
| | | map.put("happenStartTime",happenStartTime==null?"":happenStartTime); |
| | | map.put("happenEndTime",happenEndTime==null?"":happenEndTime); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.28. 21:17 |
| | | * @desc |
| | | * @desc 旅游费用记录 |
| | | */ |
| | | public class TourismBean implements Serializable { |
| | | //id |
| | | private String id; |
| | | //标题 |
| | | private String title; |
| | | //开始时间 |
| | | private String startTime; |
| | | //结束时间 |
| | | private String endTime; |
| | | //创建时间 |
| | | private String createTime; |
| | | //总天数 |
| | | private String totalDay; |
| | | //总金额 |
| | | private String totalMoney; |
| | | private double totalCost; |
| | | //餐费 |
| | | private String mealMoney; |
| | | private double eat; |
| | | //住宿费 |
| | | private String hotelMoney; |
| | | private double stay; |
| | | //交通费 |
| | | private String trafficMoney; |
| | | private double traffic; |
| | | //购物 |
| | | private String shoppingMoney; |
| | | private double shopping; |
| | | //门票 |
| | | private String ticketMoney; |
| | | private double entrance; |
| | | //用户id |
| | | private String myId; |
| | | //每日消费详细记录 |
| | | private List<DailyConsumeRecordBean> dailyConsumeRecordBeans; |
| | | private List<ConsumeRecordBean> detailList = new ArrayList<>(); |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getTotalDay() { |
| | | return totalDay; |
| | | } |
| | |
| | | this.totalDay = totalDay; |
| | | } |
| | | |
| | | public String getTotalMoney() { |
| | | return totalMoney; |
| | | public double getTotalCost() { |
| | | return totalCost; |
| | | } |
| | | |
| | | public void setTotalMoney(String totalMoney) { |
| | | this.totalMoney = totalMoney; |
| | | public void setTotalCost(double totalCost) { |
| | | this.totalCost = totalCost; |
| | | } |
| | | |
| | | public String getMealMoney() { |
| | | return mealMoney; |
| | | public double getEat() { |
| | | return eat; |
| | | } |
| | | |
| | | public void setMealMoney(String mealMoney) { |
| | | this.mealMoney = mealMoney; |
| | | public void setEat(double eat) { |
| | | this.eat = eat; |
| | | } |
| | | |
| | | public String getHotelMoney() { |
| | | return hotelMoney; |
| | | public double getStay() { |
| | | return stay; |
| | | } |
| | | |
| | | public void setHotelMoney(String hotelMoney) { |
| | | this.hotelMoney = hotelMoney; |
| | | public void setStay(double stay) { |
| | | this.stay = stay; |
| | | } |
| | | |
| | | public String getTrafficMoney() { |
| | | return trafficMoney; |
| | | public double getTraffic() { |
| | | return traffic; |
| | | } |
| | | |
| | | public void setTrafficMoney(String trafficMoney) { |
| | | this.trafficMoney = trafficMoney; |
| | | public void setTraffic(double traffic) { |
| | | this.traffic = traffic; |
| | | } |
| | | |
| | | public String getShoppingMoney() { |
| | | return shoppingMoney; |
| | | public double getShopping() { |
| | | return shopping; |
| | | } |
| | | |
| | | public void setShoppingMoney(String shoppingMoney) { |
| | | this.shoppingMoney = shoppingMoney; |
| | | public void setShopping(double shopping) { |
| | | this.shopping = shopping; |
| | | } |
| | | |
| | | public String getTicketMoney() { |
| | | return ticketMoney; |
| | | public double getEntrance() { |
| | | return entrance; |
| | | } |
| | | |
| | | public void setTicketMoney(String ticketMoney) { |
| | | this.ticketMoney = ticketMoney; |
| | | public void setEntrance(double entrance) { |
| | | this.entrance = entrance; |
| | | } |
| | | |
| | | public List<DailyConsumeRecordBean> getDailyConsumeRecordBeans() { |
| | | return dailyConsumeRecordBeans; |
| | | public String getMyId() { |
| | | return myId; |
| | | } |
| | | |
| | | public void setDailyConsumeRecordBeans(List<DailyConsumeRecordBean> dailyConsumeRecordBeans) { |
| | | this.dailyConsumeRecordBeans = dailyConsumeRecordBeans; |
| | | public void setMyId(String myId) { |
| | | this.myId = myId; |
| | | } |
| | | |
| | | public List<ConsumeRecordBean> getDetailList() { |
| | | return detailList; |
| | | } |
| | | |
| | | public void setDetailList(List<ConsumeRecordBean> detailList) { |
| | | this.detailList = detailList; |
| | | } |
| | | } |
| | |
| | | * @desc 旅游经历 Bean |
| | | */ |
| | | public class TourismExperienceBean implements Serializable{ |
| | | //id |
| | | private int id; |
| | | //标题 |
| | | private String title; |
| | | //时间 |
| | | private String time; |
| | | //发生时间 |
| | | private String happenTime; |
| | | //地点 |
| | | private String address; |
| | | //人物 |
| | | private String person; |
| | | private String people; |
| | | //旅期 |
| | | private String travelTime; |
| | | private String travelPeriod; |
| | | //持证旅游 |
| | | private String certificate; |
| | | //费用 |
| | | private String cost; |
| | | //公费/自费 |
| | | private int free; |
| | | private String totalPrice; |
| | | //0.公费 1.自费 |
| | | private int self; |
| | | //备注 |
| | | private String remark; |
| | | //电子文件 |
| | | private String url; |
| | | //创建时间 |
| | | private String createTime; |
| | | //费用记录表id |
| | | private String feeId; |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getTime() { |
| | | return time; |
| | | public String getHappenTime() { |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setTime(String time) { |
| | | this.time = time; |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | public String getAddress() { |
| | |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getPerson() { |
| | | return person; |
| | | public String getPeople() { |
| | | return people; |
| | | } |
| | | |
| | | public void setPerson(String person) { |
| | | this.person = person; |
| | | public void setPeople(String people) { |
| | | this.people = people; |
| | | } |
| | | |
| | | public String getTravelTime() { |
| | | return travelTime; |
| | | public String getTravelPeriod() { |
| | | return travelPeriod; |
| | | } |
| | | |
| | | public void setTravelTime(String travelTime) { |
| | | this.travelTime = travelTime; |
| | | public void setTravelPeriod(String travelPeriod) { |
| | | this.travelPeriod = travelPeriod; |
| | | } |
| | | |
| | | public String getCertificate() { |
| | |
| | | this.certificate = certificate; |
| | | } |
| | | |
| | | public String getCost() { |
| | | return cost; |
| | | public String getTotalPrice() { |
| | | return totalPrice; |
| | | } |
| | | |
| | | public void setCost(String cost) { |
| | | this.cost = cost; |
| | | public void setTotalPrice(String totalPrice) { |
| | | this.totalPrice = totalPrice; |
| | | } |
| | | |
| | | public int getFree() { |
| | | return free; |
| | | public int getSelf() { |
| | | return self; |
| | | } |
| | | |
| | | public void setFree(int free) { |
| | | this.free = free; |
| | | public void setSelf(int self) { |
| | | this.self = self; |
| | | } |
| | | |
| | | public String getRemark() { |
| | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getFeeId() { |
| | | return feeId; |
| | | } |
| | | |
| | | public void setFeeId(String feeId) { |
| | | this.feeId = feeId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.06.11. 16:50 |
| | | * @desc |
| | | */ |
| | | public class TourismExperienceRequestBean extends PageRequestBean{ |
| | | //费用id |
| | | private String fid; |
| | | //开始时间 |
| | | private String happenStartTime; |
| | | //结束时间 |
| | | private String happenEndTime; |
| | | //标题 |
| | | private String title; |
| | | //地点 |
| | | private String address; |
| | | //人物 |
| | | private String people; |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getPeople() { |
| | | return people; |
| | | } |
| | | |
| | | public void setPeople(String people) { |
| | | this.people = people; |
| | | } |
| | | |
| | | public String getFid() { |
| | | return fid; |
| | | } |
| | | |
| | | public void setFid(String fid) { |
| | | this.fid = fid; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("fid",fid == null ? "" : fid); |
| | | map.put("happenStartTime",happenStartTime == null ? "" : happenStartTime); |
| | | map.put("happenEndTime",happenEndTime == null ? "" : happenEndTime); |
| | | map.put("title",title == null ? "" : title); |
| | | map.put("address",address == null ? "" : address); |
| | | map.put("people",people == null ? "" : people); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.06.06. 15:09 |
| | | * @desc |
| | | */ |
| | | public class TourismRequestBean extends PageRequestBean{ |
| | | private String start; |
| | | private String end; |
| | | private String totalDay; |
| | | |
| | | public String getStart() { |
| | | return start; |
| | | } |
| | | |
| | | public void setStart(String start) { |
| | | this.start = start; |
| | | } |
| | | |
| | | public String getEnd() { |
| | | return end; |
| | | } |
| | | |
| | | public void setEnd(String end) { |
| | | this.end = end; |
| | | } |
| | | |
| | | public String getTotalDay() { |
| | | return totalDay; |
| | | } |
| | | |
| | | public void setTotalDay(String totalDay) { |
| | | this.totalDay = totalDay; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("start", start == null ? "" : start); |
| | | map.put("end", end == null ? "" : end); |
| | | map.put("totalDay",totalDay == null ? "" : totalDay); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.25. 16:06 |
| | | * @desc |
| | | */ |
| | | public class UpdateVersionBean implements Serializable { |
| | | private int versionCode; |
| | | private String appUrl; |
| | | private String content; |
| | | private String publishTime; |
| | | private boolean forceUpdate; |
| | | |
| | | public int getVersionCode() { |
| | | return versionCode; |
| | | } |
| | | |
| | | public void setVersionCode(int versionCode) { |
| | | this.versionCode = versionCode; |
| | | } |
| | | |
| | | public String getAppUrl() { |
| | | return appUrl; |
| | | } |
| | | |
| | | public void setAppUrl(String appUrl) { |
| | | this.appUrl = appUrl; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public String getPublishTime() { |
| | | return publishTime; |
| | | } |
| | | |
| | | public void setPublishTime(String publishTime) { |
| | | this.publishTime = publishTime; |
| | | } |
| | | |
| | | public boolean isForceUpdate() { |
| | | return forceUpdate; |
| | | } |
| | | |
| | | public void setForceUpdate(boolean forceUpdate) { |
| | | this.forceUpdate = forceUpdate; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.android.app_base.base.model.BaseModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.BannerBean; |
| | | import com.application.zhangshi_app_android.bean.CaptchaImageBean; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaResponseBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAbroadConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAutobiographyBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceHolderConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceInformationBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceRelationshipBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareBaseInfoBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareExistingProblemsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareLifeHabitsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNotesContentBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNursingExaminationBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.HomeMemberBean; |
| | | import com.application.zhangshi_app_android.bean.HomeRootBean; |
| | | import com.application.zhangshi_app_android.bean.HonorCollectionResponseBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | import com.application.zhangshi_app_android.bean.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.bean.LoginRequestBean; |
| | | import com.application.zhangshi_app_android.bean.LoginResponseBean; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.bean.PetBean; |
| | | import com.application.zhangshi_app_android.bean.PetMemoBean; |
| | | import com.application.zhangshi_app_android.bean.PrivacyBean; |
| | | import com.application.zhangshi_app_android.bean.PropertyBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.bean.TourismExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.UpdateVersionBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.source.HttpDataSource; |
| | | import com.application.zhangshi_app_android.data.source.LocalDataSource; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import io.reactivex.Completable; |
| | | import io.reactivex.Observable; |
| | | import okhttp3.MultipartBody; |
| | | |
| | |
| | | * 获取家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<FamilyMemorabiliaResponseBean>> getFamilyMemorabilia(Map<String,Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<FamilyMemorabiliaBean>>> getFamilyMemorabilia(Map<String,Object> paramsMap) { |
| | | return mHttpDataSource.getFamilyMemorabilia(paramsMap); |
| | | } |
| | | /** |
| | |
| | | /** |
| | | * 获取家庭资产 |
| | | */ |
| | | public Observable<ResultData<FamilyAssetsResponseBean>> getFamilyAssets(Map<String,Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<FamilyAssetsBean>>> getFamilyAssets(Map<String,Object> paramsMap) { |
| | | return mHttpDataSource.getFamilyAssets(paramsMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取家庭设备 |
| | | */ |
| | | public Observable<ResultData<HomeDevicesResponseBean>> getHomeDevices(Map<String, Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<HomeDevicesBean>>> getHomeDevices(Map<String, Object> paramsMap) { |
| | | return mHttpDataSource.getHomeDevices(paramsMap); |
| | | } |
| | | /** |
| | | * 添加家庭设备 |
| | | */ |
| | | public Observable<ResultData<String>> addHomeDevices(HomeDevicesBean homeDevicesBean) { |
| | | return mHttpDataSource.addHomeDevices(homeDevicesBean); |
| | | } |
| | | /** |
| | | * 删除家庭设备 |
| | | */ |
| | | public Observable<ResultData<String>> deleteHomeDevices(String ids) { |
| | | return mHttpDataSource.deleteHomeDevices(ids); |
| | | } |
| | | /** |
| | | * 修改家庭设备 |
| | | */ |
| | | public Observable<ResultData<String>> updateHomeDevices(HomeDevicesBean homeDevicesBean) { |
| | | return mHttpDataSource.updateHomeDevices(homeDevicesBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取成长经历 |
| | | */ |
| | |
| | | */ |
| | | public Observable<ResultData<GrowthExperienceInformationBean>> getGrowthExperienceInformation() { |
| | | return mHttpDataSource.getGrowthExperienceInformation(); |
| | | } |
| | | |
| | | @Override |
| | | public Observable<ResultData<String>> updateGrowthExperienceInformation(GrowthExperienceInformationBean growthExperienceInformationBean) { |
| | | return mHttpDataSource.updateGrowthExperienceInformation(growthExperienceInformationBean); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 获取通讯录 |
| | | */ |
| | | public Observable<ResultData<ContactsResponseBean>> getContacts(Map<String, Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<ContactsDetailBean>>> getContacts(Map<String, Object> paramsMap) { |
| | | return mHttpDataSource.getContacts(paramsMap); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 获取小医生 |
| | | */ |
| | | public Observable<ResultData<LittleDoctorResponseBean>> getLittleDoctors(Map<String, Object> map) { |
| | | public Observable<ResultData<PageResponseBean<LittleDoctorBean>>> getLittleDoctors(Map<String, Object> map) { |
| | | return mHttpDataSource.getLittleDoctors(map); |
| | | } |
| | | /** |
| | | * 删除小医生 |
| | | */ |
| | | public Observable<ResultData<String>> deleteLittleDoctors(String ids) { |
| | | return mHttpDataSource.deleteLittleDoctors(ids); |
| | | } |
| | | /** |
| | | * 增加小医生 |
| | | */ |
| | | public Observable<ResultData<String>> addLittleDoctor(LittleDoctorBean littleDoctorBean) { |
| | | return mHttpDataSource.addLittleDoctor(littleDoctorBean); |
| | | } |
| | | |
| | | /** |
| | | * 修改小医生 |
| | | */ |
| | | public Observable<ResultData<String>> updateLittleDoctor(LittleDoctorBean littleDoctorBean) { |
| | | return mHttpDataSource.updateLittleDoctor(littleDoctorBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取收支台账 |
| | | */ |
| | | public Observable<ResultData<IncomeAndExpensesResponseBean>> getIncomeAndExpenses(Map<String, Object> map) { |
| | | public Observable<ResultData<PageResponseBean<IncomeAndExpensesBean>>> getIncomeAndExpenses(Map<String, Object> map) { |
| | | return mHttpDataSource.getIncomeAndExpenses(map); |
| | | } |
| | | |
| | | /** |
| | | * 增加收支台账 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addIncomeAndExpenses(IncomeAndExpensesBean incomeAndExpensesBean) { |
| | | return mHttpDataSource.addIncomeAndExpenses(incomeAndExpensesBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除收支台账 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteIncomeAndExpenses(String ids) { |
| | | return mHttpDataSource.deleteIncomeAndExpenses(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改收支台账 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateIncomeAndExpenses(IncomeAndExpensesBean incomeAndExpensesBean) { |
| | | return mHttpDataSource.updateIncomeAndExpenses(incomeAndExpensesBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取保洁收纳 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<CleanStorageBean>>> getCleanStorages(Map<String, Object> map) { |
| | | return mHttpDataSource.getCleanStorages(map); |
| | | } |
| | | /** |
| | | * 删除保洁收纳 |
| | | */ |
| | | public Observable<ResultData<String>> deleteCleanStorages(String ids) { |
| | | return mHttpDataSource.deleteCleanStorages(ids); |
| | | } |
| | | /** |
| | | * 增加保洁收纳 |
| | | */ |
| | | public Observable<ResultData<String>> addCleanStorage(CleanStorageBean cleanStorageBean) { |
| | | return mHttpDataSource.addCleanStorage(cleanStorageBean); |
| | | } |
| | | /** |
| | | * 修改保洁收纳 |
| | | */ |
| | | public Observable<ResultData<String>> updateCleanStorage(CleanStorageBean cleanStorageBean) { |
| | | return mHttpDataSource.updateCleanStorage(cleanStorageBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人婚姻信息 |
| | | */ |
| | | public Observable<ResultData<MarriageInfoBean>> getMarriageInfo() { |
| | | return mHttpDataSource.getMarriageInfo(); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人记事本 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<PersonalNotepadBean>>> getPersonalNotepad(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getPersonalNotepad(toMap); |
| | | } |
| | | /** |
| | | * 删除个人记事本 |
| | | */ |
| | | public Observable<ResultData<String>> deletePersonalNotepad(String ids) { |
| | | return mHttpDataSource.deletePersonalNotepad(ids); |
| | | } |
| | | /** |
| | | * 增加个人记事本 |
| | | */ |
| | | public Observable<ResultData<String>> addPersonalNotepad(PersonalNotepadBean personalNotepadBean) { |
| | | return mHttpDataSource.addPersonalNotepad(personalNotepadBean); |
| | | } |
| | | /** |
| | | * 修改个人记事本 |
| | | */ |
| | | public Observable<ResultData<String>> updatePersonalNotepad(PersonalNotepadBean personalNotepadBean) { |
| | | return mHttpDataSource.updatePersonalNotepad(personalNotepadBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人隐私 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<PrivacyBean>>> getPrivacy(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getPrivacy(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取荣誉证书 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<CertificateOfHonorBean>>> getCertificateOfHonor(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getCertificateOfHonor(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人资产 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<PropertyBean>>> getProperty(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getProperty(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取百年心愿 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<HundredWishBean>>> getHundredWish(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getHundredWish(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取魅宠 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<PetBean>>> getPets(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getPets(toMap); |
| | | } |
| | | |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<PetMemoBean>>> getPetMemo(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getPetMemo(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取旅游消费记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<TourismBean>>> getTourism(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getTourism(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 新增旅游消费记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addTourism(TourismBean tourismBean) { |
| | | return mHttpDataSource.addTourism(tourismBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除旅游消费记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteTourism(String ids) { |
| | | return mHttpDataSource.deleteTourism(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改旅游消费记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateTourism(TourismBean tourismBean) { |
| | | return mHttpDataSource.updateTourism(tourismBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取旅游经历 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<TourismExperienceBean>>> getTourismExperience(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getTourismExperience(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 新增旅游经历 |
| | | */ |
| | | public Observable<ResultData<String>> addTourismExperience(TourismExperienceBean tourismExperienceBean) { |
| | | return mHttpDataSource.addTourismExperience(tourismExperienceBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除旅游经历 |
| | | */ |
| | | public Observable<ResultData<String>> deleteTourismExperience(String ids) { |
| | | return mHttpDataSource.deleteTourismExperience(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改旅游经历 |
| | | */ |
| | | public Observable<ResultData<String>> updateTourismExperience(TourismExperienceBean tourismExperienceBean) { |
| | | return mHttpDataSource.updateTourismExperience(tourismExperienceBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取备忘本 |
| | | */ |
| | | public Observable<ResultData<List<MemoBean>>> getMemos(String fid, String cid) { |
| | | return mHttpDataSource.getMemos(fid,cid); |
| | | } |
| | | |
| | | /** |
| | | * 增加备忘本 |
| | | */ |
| | | public Observable<ResultData<String>> addMemo(MemoBean memoBean) { |
| | | return mHttpDataSource.addMemo(memoBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除备忘本 |
| | | */ |
| | | public Observable<ResultData<String>> deleteMemo(String ids) { |
| | | return mHttpDataSource.deleteMemo(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改备忘本 |
| | | */ |
| | | public Observable<ResultData<String>> updateMemo(MemoBean memoBean) { |
| | | return mHttpDataSource.updateMemo(memoBean); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取家谱 |
| | | */ |
| | | public Observable<ResultData<PageResponseBean<HomeMemberBean>>> getHomeMembers(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getHomeMembers(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取家根网 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<List<HomeRootBean>>> getHomeRoot(String depth) { |
| | | return mHttpDataSource.getHomeRoot(depth); |
| | | } |
| | | |
| | | /** |
| | | * 获取年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<AnnualHealthStatusBean>>> getAnnualHealthStatus(Map<String, Object> toMap) { |
| | | return mHttpDataSource.getAnnualHealthStatus(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 新增年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addAnnualHealthStatus(AnnualHealthStatusBean annualHealthStatusBean) { |
| | | return mHttpDataSource.addAnnualHealthStatus(annualHealthStatusBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteAnnualHealthStatus(String ids) { |
| | | return mHttpDataSource.deleteAnnualHealthStatus(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateAnnualHealthStatus(AnnualHealthStatusBean annualHealthStatusBean) { |
| | | return mHttpDataSource.updateAnnualHealthStatus(annualHealthStatusBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取轮播图数据 |
| | | */ |
| | | public Observable<ResultData<List<BannerBean>>> getBannerData() { |
| | | return mHttpDataSource.getBannerData(); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健基本信息 |
| | | */ |
| | | public Observable<ResultData<HealthCareBaseInfoBean>> getHealthCareBaseInfo() { |
| | | return mHttpDataSource.getHealthCareBaseInfo(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健基本信息 |
| | | */ |
| | | public Observable<ResultData<String>> updateHealthCareBaseInfo(HealthCareBaseInfoBean healthCareBaseInfoBean) { |
| | | return mHttpDataSource.updateHealthCareBaseInfo(healthCareBaseInfoBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健生活习惯 |
| | | */ |
| | | public Observable<ResultData<HealthCareLifeHabitsBean>> getHealthCareLifeHabits() { |
| | | return mHttpDataSource.getHealthCareLifeHabits(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健生活习惯 |
| | | */ |
| | | public Observable<ResultData<String>> updateHealthCareLifeHabits(HealthCareLifeHabitsBean healthCareLifeHabitsBean) { |
| | | return mHttpDataSource.updateHealthCareLifeHabits(healthCareLifeHabitsBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健护理查体 |
| | | */ |
| | | public Observable<ResultData<HealthCareNursingExaminationBean>> getHealthCareNursingExamination() { |
| | | return mHttpDataSource.getHealthCareNursingExamination(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健护理查体 |
| | | */ |
| | | public Observable<ResultData<String>> updateHealthCareNursingExamination(HealthCareNursingExaminationBean healthCareNursingExaminationBean) { |
| | | return mHttpDataSource.updateHealthCareNursingExamination(healthCareNursingExaminationBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健现存健康问题 |
| | | */ |
| | | public Observable<ResultData<HealthCareExistingProblemsBean>> getHealthCareExistingProblems() { |
| | | return mHttpDataSource.getHealthCareExistingProblems(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健现存健康问题 |
| | | */ |
| | | public Observable<ResultData<String>> updateHealthCareExistingProblems(HealthCareExistingProblemsBean healthCareExistingProblemsBean) { |
| | | return mHttpDataSource.updateHealthCareExistingProblems(healthCareExistingProblemsBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健笔记内容 |
| | | */ |
| | | public Observable<ResultData<HealthCareNotesContentBean>> getHealthCareNotesContent() { |
| | | return mHttpDataSource.getHealthCareNotesContent(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健笔记内容 |
| | | */ |
| | | public Observable<ResultData<String>> updateHealthCareNotesContent(HealthCareNotesContentBean healthCareNotesContentBean) { |
| | | return mHttpDataSource.updateHealthCareNotesContent(healthCareNotesContentBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取版本更新 |
| | | */ |
| | | public Observable<ResultData<UpdateVersionBean>> getUpdateVersion() { |
| | | return mHttpDataSource.getUpdateVersion(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @see LocalDataSourceImpl |
| | |
| | | package com.application.zhangshi_app_android.data.source; |
| | | |
| | | import com.android.app_base.http.ResultData; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.BannerBean; |
| | | import com.application.zhangshi_app_android.bean.CaptchaImageBean; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareBaseInfoBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareExistingProblemsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareLifeHabitsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNotesContentBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNursingExaminationBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.HomeMemberBean; |
| | | import com.application.zhangshi_app_android.bean.HomeRootBean; |
| | | import com.application.zhangshi_app_android.bean.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | import com.application.zhangshi_app_android.bean.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaResponseBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAbroadConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAutobiographyBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceHolderConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceInformationBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceRelationshipBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HonorCollectionResponseBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.bean.LoginRequestBean; |
| | | import com.application.zhangshi_app_android.bean.LoginResponseBean; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.bean.PetBean; |
| | | import com.application.zhangshi_app_android.bean.PetMemoBean; |
| | | import com.application.zhangshi_app_android.bean.PetOwnerBean; |
| | | import com.application.zhangshi_app_android.bean.PrivacyBean; |
| | | import com.application.zhangshi_app_android.bean.PropertyBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.bean.TourismExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.UpdateVersionBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import io.reactivex.Completable; |
| | | import io.reactivex.Observable; |
| | | import okhttp3.MultipartBody; |
| | | |
| | |
| | | /** |
| | | * 获取家大事记 |
| | | */ |
| | | Observable<ResultData<FamilyMemorabiliaResponseBean>> getFamilyMemorabilia(Map<String,Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<FamilyMemorabiliaBean>>> getFamilyMemorabilia(Map<String,Object> paramsMap); |
| | | |
| | | /** |
| | | * 增加家大事记 |
| | |
| | | Observable<ResultData<String>> deleteFamilyMemorabilia(String ids); |
| | | |
| | | /** |
| | | * 修改 |
| | | * 修改家大事记 |
| | | */ |
| | | Observable<ResultData<String>> updateFamilyMemorabilia(FamilyMemorabiliaBean familyMemorabiliaBean); |
| | | |
| | |
| | | /** |
| | | * 获取家庭资产 |
| | | */ |
| | | Observable<ResultData<FamilyAssetsResponseBean>> getFamilyAssets(Map<String, Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<FamilyAssetsBean>>> getFamilyAssets(Map<String, Object> paramsMap); |
| | | /** |
| | | * 获取家庭设备 |
| | | */ |
| | | Observable<ResultData<HomeDevicesResponseBean>> getHomeDevices(Map<String, Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<HomeDevicesBean>>> getHomeDevices(Map<String, Object> paramsMap); |
| | | /** |
| | | * 增加家庭设备 |
| | | */ |
| | | Observable<ResultData<String>> addHomeDevices(HomeDevicesBean homeDevicesBean); |
| | | /** |
| | | * 删除家庭设备 |
| | | */ |
| | | Observable<ResultData<String>> deleteHomeDevices(String ids); |
| | | /** |
| | | * 修改家庭设备 |
| | | */ |
| | | Observable<ResultData<String>> updateHomeDevices(HomeDevicesBean homeDevicesBean); |
| | | |
| | | /** |
| | | * 获取家庭荣誉 |
| | |
| | | /** |
| | | * 获取小医生 |
| | | */ |
| | | Observable<ResultData<LittleDoctorResponseBean>> getLittleDoctors(Map<String, Object> map); |
| | | Observable<ResultData<PageResponseBean<LittleDoctorBean>>> getLittleDoctors(Map<String, Object> map); |
| | | /** |
| | | * 增加小医生 |
| | | */ |
| | | Observable<ResultData<String>> addLittleDoctor(LittleDoctorBean littleDoctorBean); |
| | | /** |
| | | * 删除小医生 |
| | | */ |
| | | Observable<ResultData<String>> deleteLittleDoctors(String ids); |
| | | /** |
| | | * 修改小医生 |
| | | */ |
| | | Observable<ResultData<String>> updateLittleDoctor(LittleDoctorBean littleDoctorBean); |
| | | |
| | | /** |
| | | * 获取收支 |
| | | */ |
| | | Observable<ResultData<IncomeAndExpensesResponseBean>> getIncomeAndExpenses(Map<String, Object> map); |
| | | Observable<ResultData<PageResponseBean<IncomeAndExpensesBean>>> getIncomeAndExpenses(Map<String, Object> map); |
| | | /** |
| | | * 增加收支 |
| | | */ |
| | | Observable<ResultData<String>> addIncomeAndExpenses(IncomeAndExpensesBean incomeAndExpensesBean); |
| | | /** |
| | | * 删除收支 |
| | | */ |
| | | Observable<ResultData<String>> deleteIncomeAndExpenses(String ids); |
| | | /** |
| | | * 修改收支 |
| | | */ |
| | | Observable<ResultData<String>> updateIncomeAndExpenses(IncomeAndExpensesBean incomeAndExpensesBean); |
| | | /** |
| | | * 获取成长经历 |
| | | */ |
| | |
| | | * 获取成长经历个人信息 |
| | | */ |
| | | Observable<ResultData<GrowthExperienceInformationBean>> getGrowthExperienceInformation(); |
| | | |
| | | |
| | | /** |
| | | * 修改成长经历个人信息 |
| | | */ |
| | | Observable<ResultData<String>> updateGrowthExperienceInformation(GrowthExperienceInformationBean growthExperienceInformationBean); |
| | | |
| | | /** |
| | | * 获取成长经历关系情况 |
| | | */ |
| | |
| | | /** |
| | | * 获取通讯录 |
| | | */ |
| | | Observable<ResultData<ContactsResponseBean>> getContacts(Map<String, Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<ContactsDetailBean>>> getContacts(Map<String, Object> paramsMap); |
| | | |
| | | |
| | | /** |
| | | * 获取保洁收纳 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<CleanStorageBean>>> getCleanStorages(Map<String, Object> map); |
| | | /** |
| | | * 增加保洁收纳 |
| | | */ |
| | | Observable<ResultData<String>> addCleanStorage(CleanStorageBean cleanStorageBean); |
| | | /** |
| | | * 删除保洁收纳 |
| | | */ |
| | | Observable<ResultData<String>> deleteCleanStorages(String ids); |
| | | /** |
| | | * 修改保洁收纳 |
| | | */ |
| | | Observable<ResultData<String>> updateCleanStorage(CleanStorageBean cleanStorageBean); |
| | | |
| | | /** |
| | | * 获取个人婚姻信息 |
| | | */ |
| | | Observable<ResultData<MarriageInfoBean>> getMarriageInfo(); |
| | | |
| | | /** |
| | | * 获取个人记事本 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<PersonalNotepadBean>>> getPersonalNotepad(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 增加个人记事本 |
| | | */ |
| | | Observable<ResultData<String>> addPersonalNotepad(PersonalNotepadBean personalNotepadBean); |
| | | |
| | | /** |
| | | * 删除个人记事本 |
| | | */ |
| | | Observable<ResultData<String>> deletePersonalNotepad(String ids); |
| | | |
| | | /** |
| | | * 修改个人记事本 |
| | | */ |
| | | Observable<ResultData<String>> updatePersonalNotepad(PersonalNotepadBean personalNotepadBean); |
| | | |
| | | /** |
| | | * 获取个人信息 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<PrivacyBean>>> getPrivacy(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取荣誉证书 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<CertificateOfHonorBean>>> getCertificateOfHonor(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取个人财产 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<PropertyBean>>> getProperty(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取百年心愿 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<HundredWishBean>>> getHundredWish(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取魅宠 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<PetBean>>> getPets(Map<String, Object> toMap); |
| | | |
| | | |
| | | /** |
| | | * 获取宠物备忘录 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<PetMemoBean>>> getPetMemo(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取旅游费用记录 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<TourismBean>>> getTourism(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 新增旅游费用记录 |
| | | */ |
| | | Observable<ResultData<String>> addTourism(TourismBean tourismBean); |
| | | |
| | | /** |
| | | * 删除旅游费用记录 |
| | | */ |
| | | Observable<ResultData<String>> deleteTourism(String ids); |
| | | |
| | | /** |
| | | * 修改旅游费用记录 |
| | | */ |
| | | Observable<ResultData<String>> updateTourism(TourismBean tourismBean); |
| | | |
| | | /** |
| | | * 获取旅游经历 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<TourismExperienceBean>>> getTourismExperience(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 新增旅游经历 |
| | | */ |
| | | Observable<ResultData<String>> addTourismExperience(TourismExperienceBean tourismExperienceBean); |
| | | |
| | | /** |
| | | * 删除旅游经历 |
| | | */ |
| | | Observable<ResultData<String>> deleteTourismExperience(String ids); |
| | | |
| | | /** |
| | | * 修改旅游经历 |
| | | */ |
| | | Observable<ResultData<String>> updateTourismExperience(TourismExperienceBean tourismExperienceBean); |
| | | |
| | | /** |
| | | * 获取备忘本 |
| | | */ |
| | | Observable<ResultData<List<MemoBean>>> getMemos(String fid, String cid); |
| | | |
| | | /** |
| | | * 新增备忘本 |
| | | */ |
| | | Observable<ResultData<String>> addMemo(MemoBean memoBean); |
| | | |
| | | /** |
| | | * 删除备忘本 |
| | | */ |
| | | Observable<ResultData<String>> deleteMemo(String ids); |
| | | |
| | | /** |
| | | * 修改备忘本 |
| | | */ |
| | | Observable<ResultData<String>> updateMemo(MemoBean memoBean); |
| | | |
| | | /** |
| | | * 获取家谱 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<HomeMemberBean>>> getHomeMembers(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取家根网 |
| | | */ |
| | | Observable<ResultData<List<HomeRootBean>>> getHomeRoot(String depth); |
| | | |
| | | /** |
| | | * 获取年度健康状况 |
| | | */ |
| | | Observable<ResultData<PageResponseBean<AnnualHealthStatusBean>>> getAnnualHealthStatus(Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 添加年度健康状况 |
| | | */ |
| | | Observable<ResultData<String>> addAnnualHealthStatus(AnnualHealthStatusBean annualHealthStatusBean); |
| | | |
| | | /** |
| | | * 删除年度健康状况 |
| | | */ |
| | | Observable<ResultData<String>> deleteAnnualHealthStatus(String ids); |
| | | |
| | | /** |
| | | * 修改年度健康状况 |
| | | */ |
| | | Observable<ResultData<String>> updateAnnualHealthStatus(AnnualHealthStatusBean annualHealthStatusBean); |
| | | |
| | | /** |
| | | * 获取功能主页轮播图数据 |
| | | */ |
| | | Observable<ResultData<List<BannerBean>>> getBannerData(); |
| | | |
| | | /** |
| | | * 获取健康保健基本信息 |
| | | */ |
| | | Observable<ResultData<HealthCareBaseInfoBean>> getHealthCareBaseInfo(); |
| | | |
| | | /** |
| | | * 修改健康保健基本信息 |
| | | */ |
| | | Observable<ResultData<String>> updateHealthCareBaseInfo(HealthCareBaseInfoBean healthCareBaseInfoBean); |
| | | |
| | | /** |
| | | * 获取健康保健生活习惯 |
| | | */ |
| | | Observable<ResultData<HealthCareLifeHabitsBean>> getHealthCareLifeHabits(); |
| | | |
| | | /** |
| | | * 修改健康保健生活习惯 |
| | | */ |
| | | Observable<ResultData<String>> updateHealthCareLifeHabits(HealthCareLifeHabitsBean healthCareLifeHabitsBean); |
| | | |
| | | /** |
| | | * 获取健康保健护理查体 |
| | | */ |
| | | Observable<ResultData<HealthCareNursingExaminationBean>> getHealthCareNursingExamination(); |
| | | |
| | | /** |
| | | * 修改健康保健护理查体 |
| | | */ |
| | | Observable<ResultData<String>> updateHealthCareNursingExamination(HealthCareNursingExaminationBean healthCareNursingExaminationBean); |
| | | |
| | | /** |
| | | * 获取健康保健现存健康问题 |
| | | */ |
| | | Observable<ResultData<HealthCareExistingProblemsBean>> getHealthCareExistingProblems(); |
| | | |
| | | /** |
| | | * 修改健康保健现存健康问题 |
| | | */ |
| | | Observable<ResultData<String>> updateHealthCareExistingProblems(HealthCareExistingProblemsBean healthCareExistingProblemsBean); |
| | | |
| | | /** |
| | | * 获取健康保健笔记内容 |
| | | */ |
| | | Observable<ResultData<HealthCareNotesContentBean>> getHealthCareNotesContent(); |
| | | |
| | | /** |
| | | * 修改健康保健笔记内容 |
| | | */ |
| | | Observable<ResultData<String>> updateHealthCareNotesContent(HealthCareNotesContentBean healthCareNotesContentBean); |
| | | |
| | | /** |
| | | * 获取版本更新 |
| | | */ |
| | | Observable<ResultData<UpdateVersionBean>> getUpdateVersion(); |
| | | } |
| | | |
| | | |
| | |
| | | package com.application.zhangshi_app_android.data.source.http; |
| | | |
| | | import com.android.app_base.http.ResultData; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.BannerBean; |
| | | import com.application.zhangshi_app_android.bean.CaptchaImageBean; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareBaseInfoBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareExistingProblemsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareLifeHabitsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNotesContentBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNursingExaminationBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.HomeMemberBean; |
| | | import com.application.zhangshi_app_android.bean.HomeRootBean; |
| | | import com.application.zhangshi_app_android.bean.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | import com.application.zhangshi_app_android.bean.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaResponseBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAbroadConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAutobiographyBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceHolderConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceInformationBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceRelationshipBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HonorCollectionResponseBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.bean.LoginRequestBean; |
| | | import com.application.zhangshi_app_android.bean.LoginResponseBean; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.bean.PetBean; |
| | | import com.application.zhangshi_app_android.bean.PetMemoBean; |
| | | import com.application.zhangshi_app_android.bean.PetOwnerBean; |
| | | import com.application.zhangshi_app_android.bean.PrivacyBean; |
| | | import com.application.zhangshi_app_android.bean.PropertyBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.bean.TourismExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.UpdateVersionBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | |
| | | import java.util.List; |
| | |
| | | import retrofit2.http.PUT; |
| | | import retrofit2.http.Part; |
| | | import retrofit2.http.Path; |
| | | import retrofit2.http.Query; |
| | | import retrofit2.http.QueryMap; |
| | | import retrofit2.http.QueryName; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * 获取家大事件 |
| | | */ |
| | | @GET("family/zfEvent/all") |
| | | Observable<ResultData<FamilyMemorabiliaResponseBean>> getFamilyMemorabilia(@QueryMap Map<String,Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<FamilyMemorabiliaBean>>> getFamilyMemorabilia(@QueryMap Map<String,Object> paramsMap); |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | |
| | | * 获取家庭资产 |
| | | */ |
| | | @GET("/family/property/all") |
| | | Observable<ResultData<FamilyAssetsResponseBean>> getFamilyAssets(@QueryMap Map<String, Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<FamilyAssetsBean>>> getFamilyAssets(@QueryMap Map<String, Object> paramsMap); |
| | | |
| | | /** |
| | | * 获取家庭设备 |
| | | */ |
| | | @GET("/zfEquipment/all") |
| | | Observable<ResultData<HomeDevicesResponseBean>> getHomeDevices(@QueryMap Map<String, Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<HomeDevicesBean>>> getHomeDevices(@QueryMap Map<String, Object> paramsMap); |
| | | |
| | | /** |
| | | <<<<<<< HEAD |
| | | * 添加家庭设备 |
| | | */ |
| | | @POST("/zfEquipment") |
| | | Observable<ResultData<String>> addHomeDevices(@Body HomeDevicesBean homeDevicesBean); |
| | | |
| | | /** |
| | | * 删除家庭设备 |
| | | */ |
| | | @DELETE("/zfEquipment/{ids}") |
| | | Observable<ResultData<String>> deleteHomeDevices(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改家庭设备 |
| | | */ |
| | | @PUT("/zfEquipment") |
| | | Observable<ResultData<String>> updateHomeDevices(@Body HomeDevicesBean homeDevicesBean); |
| | | |
| | | /** |
| | | * 获取家庭荣誉 |
| | | */ |
| | | @GET("/zfCollection/all") |
| | |
| | | * 获取小医生 |
| | | */ |
| | | @GET("/zfDoctor/all") |
| | | Observable<ResultData<LittleDoctorResponseBean>> getLittleDoctors(@QueryMap Map<String, Object> map); |
| | | Observable<ResultData<PageResponseBean<LittleDoctorBean>>> getLittleDoctors(@QueryMap Map<String, Object> map); |
| | | |
| | | /** |
| | | * 添加小医生 |
| | | */ |
| | | @POST("/zfDoctor") |
| | | Observable<ResultData<String>> addLittleDoctor(@Body LittleDoctorBean littleDoctorBean); |
| | | |
| | | /** |
| | | * 删除小医生 |
| | | */ |
| | | @DELETE("/zfDoctor/{ids}") |
| | | Observable<ResultData<String>> deleteLittleDoctors(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改小医生 |
| | | */ |
| | | @PUT("/zfDoctor") |
| | | Observable<ResultData<String>> updateLittleDoctor(@Body LittleDoctorBean littleDoctorBean); |
| | | |
| | | /** |
| | | * 获取收支 |
| | | */ |
| | | @GET("/zfEconomy/all") |
| | | Observable<ResultData<IncomeAndExpensesResponseBean>> getIncomeAndExpenses(@QueryMap Map<String, Object> map); |
| | | Observable<ResultData<PageResponseBean<IncomeAndExpensesBean>>> getIncomeAndExpenses(@QueryMap Map<String, Object> map); |
| | | |
| | | /** |
| | | * 添加收支 |
| | | */ |
| | | @POST("/zfEconomy") |
| | | Observable<ResultData<String>> addIncomeAndExpenses(@Body IncomeAndExpensesBean incomeAndExpensesBean); |
| | | |
| | | /** |
| | | * 删除收支 |
| | | */ |
| | | @DELETE("/zfEconomy/{ids}") |
| | | Observable<ResultData<String>> deleteIncomeAndExpenses(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改收支 |
| | | */ |
| | | @PUT("/zfEconomy") |
| | | Observable<ResultData<String>> updateIncomeAndExpenses(@Body IncomeAndExpensesBean incomeAndExpensesBean); |
| | | |
| | | |
| | | /** |
| | | * 获取成长经历个人信息 |
| | | */ |
| | | @GET("/self/user") |
| | | Observable<ResultData<GrowthExperienceInformationBean>> getGrowthExperienceInformation(); |
| | | |
| | | /** |
| | | * 修改成长经历个人信息 |
| | | */ |
| | | @PUT("/self/user") |
| | | Observable<ResultData<String>> updateGrowthExperienceInformation(@Body GrowthExperienceInformationBean growthExperienceInformationBean); |
| | | |
| | | /** |
| | | * 获取成长经历(主要学习及工作经历) |
| | |
| | | * 获取通讯录 |
| | | */ |
| | | @GET("/zfContact/all") |
| | | Observable<ResultData<ContactsResponseBean>> getContacts(@QueryMap Map<String, Object> paramsMap); |
| | | Observable<ResultData<PageResponseBean<ContactsDetailBean>>> getContacts(@QueryMap Map<String, Object> paramsMap); |
| | | |
| | | /** |
| | | * 获取保洁收纳 |
| | | */ |
| | | @GET("/zfClean/all") |
| | | Observable<ResultData<PageResponseBean<CleanStorageBean>>> getCleanStorages(@QueryMap Map<String, Object> paramsMap); |
| | | |
| | | |
| | | /** |
| | | * 添加保洁收纳 |
| | | */ |
| | | @POST("/zfClean") |
| | | Observable<ResultData<String>> addCleanStorage(@Body CleanStorageBean cleanStorageBean); |
| | | |
| | | /** |
| | | * 删除保洁收纳 |
| | | */ |
| | | @DELETE("/zfClean/{ids}") |
| | | Observable<ResultData<String>> deleteCleanStorages(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改保洁收纳 |
| | | */ |
| | | @PUT("/zfClean") |
| | | Observable<ResultData<String>> updateCleanStorage(@Body CleanStorageBean cleanStorageBean); |
| | | |
| | | /** |
| | | * 获取个人婚姻信息 |
| | | */ |
| | | @GET("/zMarry/list") |
| | | Observable<ResultData<MarriageInfoBean>> getMarriageInfo(); |
| | | |
| | | /** |
| | | * 获取个人记事本 |
| | | */ |
| | | @GET("/zSelfNote/all") |
| | | Observable<ResultData<PageResponseBean<PersonalNotepadBean>>> getPersonalNotepad(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 添加个人记事本 |
| | | */ |
| | | @POST("/zSelfNote") |
| | | Observable<ResultData<String>> addPersonalNotepad(@Body PersonalNotepadBean personalNotepadBean); |
| | | |
| | | /** |
| | | * 删除个人记事本 |
| | | */ |
| | | @DELETE("/zSelfNote/{ids}") |
| | | Observable<ResultData<String>> deletePersonalNotepad(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改个人记事本 |
| | | */ |
| | | @PUT("/zSelfNote") |
| | | Observable<ResultData<String>> updatePersonalNotepad(@Body PersonalNotepadBean personalNotepadBean); |
| | | |
| | | /** |
| | | * 获取个人隐私 |
| | | */ |
| | | @GET("/zSecret/all") |
| | | Observable<ResultData<PageResponseBean<PrivacyBean>>> getPrivacy(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取荣誉证书 |
| | | */ |
| | | @GET("/zHonor/all") |
| | | Observable<ResultData<PageResponseBean<CertificateOfHonorBean>>> getCertificateOfHonor(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取个人资产 |
| | | */ |
| | | @GET("/zProperty/all") |
| | | Observable<ResultData<PageResponseBean<PropertyBean>>> getProperty(@QueryMap Map<String, Object> toMap); |
| | | |
| | | |
| | | /** |
| | | * 获取百年心愿 |
| | | */ |
| | | @GET("/zIdea/all") |
| | | Observable<ResultData<PageResponseBean<HundredWishBean>>> getHundredWish(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取宠物 |
| | | */ |
| | | @GET("/zfPet/all") |
| | | Observable<ResultData<PageResponseBean<PetBean>>> getPets(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取宠物备忘录 |
| | | */ |
| | | @GET("/family/zfPetNote") |
| | | Observable<ResultData<PageResponseBean<PetMemoBean>>> getPetMemo(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取旅游费用记录 |
| | | */ |
| | | @GET("/zTravelPrice/all") |
| | | Observable<ResultData<PageResponseBean<TourismBean>>> getTourism(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 添加旅游费用记录 |
| | | */ |
| | | @POST("/zTravelPrice") |
| | | Observable<ResultData<String>> addTourism(@Body TourismBean tourismBean); |
| | | |
| | | /** |
| | | * 删除旅游费用记录 |
| | | */ |
| | | @DELETE("/zTravelPrice/{ids}") |
| | | Observable<ResultData<String>> deleteTourism(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改旅游费用记录 |
| | | */ |
| | | @PUT("/zTravelPrice") |
| | | Observable<ResultData<String>> updateTourism(@Body TourismBean tourismBean); |
| | | |
| | | /** |
| | | * 获取旅游经历 |
| | | */ |
| | | @GET("/zTravelBase/all") |
| | | Observable<ResultData<PageResponseBean<TourismExperienceBean>>> getTourismExperience(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 新增旅游经历 |
| | | */ |
| | | @POST("/zTravelBase") |
| | | Observable<ResultData<String>> addTourismExperience(@Body TourismExperienceBean tourismExperienceBean); |
| | | |
| | | /** |
| | | * 删除旅游经历 |
| | | */ |
| | | @DELETE("/zTravelBase/{ids}") |
| | | Observable<ResultData<String>> deleteTourismExperience(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改旅游经历 |
| | | */ |
| | | @PUT("/zTravelBase") |
| | | Observable<ResultData<String>> updateTourismExperience(@Body TourismExperienceBean tourismExperienceBean); |
| | | |
| | | /** |
| | | * 获取备忘本 |
| | | */ |
| | | @GET("/memoBook/all") |
| | | Observable<ResultData<List<MemoBean>>> getMemos(@Query("fid") String fid,@Query("cid") String cid); |
| | | |
| | | /** |
| | | * 添加备忘本 |
| | | */ |
| | | @POST("/memoBook") |
| | | Observable<ResultData<String>> addMemo(@Body MemoBean memoBean); |
| | | |
| | | /** |
| | | * 删除备忘本 |
| | | */ |
| | | @DELETE("/memoBook") |
| | | Observable<ResultData<String>> deleteMemo(@Query("id") String ids); |
| | | |
| | | /** |
| | | * 修改备忘本 |
| | | */ |
| | | @PUT("/memoBook") |
| | | Observable<ResultData<String>> updateMemo(@Body MemoBean memoBean); |
| | | |
| | | |
| | | /** |
| | | * 获取家谱 |
| | | */ |
| | | @GET("/self/user/list/genealogy") |
| | | Observable<ResultData<PageResponseBean<HomeMemberBean>>> getHomeMembers(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 获取家根网 |
| | | * @param depth 代数,输入几就是查到第几代 |
| | | * @return |
| | | */ |
| | | @GET("/self/user/root") |
| | | Observable<ResultData<List<HomeRootBean>>> getHomeRoot(@Query("depth") String depth); |
| | | |
| | | /** |
| | | * 获取年度健康状况 |
| | | */ |
| | | @GET("/zYearInfo/all") |
| | | Observable<ResultData<PageResponseBean<AnnualHealthStatusBean>>> getAnnualHealthStatus(@QueryMap Map<String, Object> toMap); |
| | | |
| | | /** |
| | | * 删除年度健康状况 |
| | | */ |
| | | @DELETE("/zYearInfo/{ids}") |
| | | Observable<ResultData<String>> deleteAnnualHealthStatus(@Path("ids") String ids); |
| | | |
| | | /** |
| | | * 修改年度健康状况 |
| | | */ |
| | | @PUT("/zYearInfo") |
| | | Observable<ResultData<String>> updateAnnualHealthStatus(@Body AnnualHealthStatusBean annualHealthStatusBean); |
| | | |
| | | /** |
| | | * 添加年度健康状况 |
| | | */ |
| | | @POST("/zYearInfo") |
| | | Observable<ResultData<String>> addAnnualHealthStatus(@Body AnnualHealthStatusBean annualHealthStatusBean); |
| | | |
| | | /** |
| | | * 获取轮播图数据 |
| | | */ |
| | | @GET("/rotation/all") |
| | | Observable<ResultData<List<BannerBean>>> getBannerData(); |
| | | |
| | | |
| | | /** |
| | | * 获取健康保健基本信息 |
| | | */ |
| | | @GET("/zHealthBase/all") |
| | | Observable<ResultData<HealthCareBaseInfoBean>> getHealthCareBaseInfo(); |
| | | |
| | | /** |
| | | * 修改健康保健基本信息 |
| | | */ |
| | | @POST("/zHealthBase") |
| | | Observable<ResultData<String>> updateHealthCareBaseInfo(@Body HealthCareBaseInfoBean healthCareBaseInfoBean); |
| | | |
| | | /** |
| | | * 获取健康保健生活习惯 |
| | | */ |
| | | @GET("/zHealthHabit/all") |
| | | Observable<ResultData<HealthCareLifeHabitsBean>> getHealthCareLifeHabits(); |
| | | |
| | | /** |
| | | * 修改健康保健生活习惯 |
| | | */ |
| | | @POST("/zHealthHabit") |
| | | Observable<ResultData<String>> updateHealthCareLifeHabits(@Body HealthCareLifeHabitsBean healthCareLifeHabitsBean); |
| | | |
| | | /** |
| | | * 获取健康保健护理查体 |
| | | */ |
| | | @GET("/zHealthInfo/all") |
| | | Observable<ResultData<HealthCareNursingExaminationBean>> getHealthCareNursingExamination(); |
| | | |
| | | /** |
| | | * 修改健康保健护理查体 |
| | | */ |
| | | @POST("/zHealthInfo") |
| | | Observable<ResultData<String>> updateHealthCareNursingExamination(@Body HealthCareNursingExaminationBean healthCareNursingExaminationBean); |
| | | |
| | | /** |
| | | * 获取健康保健现存健康问题 |
| | | */ |
| | | @GET("/zHealthNow/all") |
| | | Observable<ResultData<HealthCareExistingProblemsBean>> getHealthCareExistingProblems(); |
| | | |
| | | /** |
| | | * 修改健康保健现存健康问题 |
| | | */ |
| | | @POST("/zHealthNow") |
| | | Observable<ResultData<String>> updateHealthCareExistingProblems(@Body HealthCareExistingProblemsBean healthCareExistingProblemsBean); |
| | | |
| | | /** |
| | | * 获取健康保健笔记内容 |
| | | */ |
| | | @GET("/zHealthNote") |
| | | Observable<ResultData<HealthCareNotesContentBean>> getHealthCareNotesContent(); |
| | | |
| | | /** |
| | | * 修改健康保健笔记内容 |
| | | */ |
| | | @POST("/zHealthNote") |
| | | Observable<ResultData<String>> updateHealthCareNotesContent(@Body HealthCareNotesContentBean healthCareNotesContentBean); |
| | | |
| | | /** |
| | | * 获取版本更新 |
| | | */ |
| | | @GET("/version") |
| | | Observable<ResultData<UpdateVersionBean>> getUpdateVersion(); |
| | | } |
| | |
| | | |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.http.RetrofitManager; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.BannerBean; |
| | | import com.application.zhangshi_app_android.bean.CaptchaImageBean; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareBaseInfoBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareExistingProblemsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareLifeHabitsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNotesContentBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNursingExaminationBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.HomeMemberBean; |
| | | import com.application.zhangshi_app_android.bean.HomeRootBean; |
| | | import com.application.zhangshi_app_android.bean.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | import com.application.zhangshi_app_android.bean.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaResponseBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAbroadConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAutobiographyBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceHolderConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceInformationBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceRelationshipBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HonorCollectionResponseBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorResponseBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.bean.LoginRequestBean; |
| | | import com.application.zhangshi_app_android.bean.LoginResponseBean; |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.bean.PetBean; |
| | | import com.application.zhangshi_app_android.bean.PetMemoBean; |
| | | import com.application.zhangshi_app_android.bean.PrivacyBean; |
| | | import com.application.zhangshi_app_android.bean.PropertyBean; |
| | | import com.application.zhangshi_app_android.bean.TourismBean; |
| | | import com.application.zhangshi_app_android.bean.TourismExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.UpdateVersionBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.source.HttpDataSource; |
| | | |
| | |
| | | |
| | | import io.reactivex.Observable; |
| | | import okhttp3.MultipartBody; |
| | | import retrofit2.http.QueryMap; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * 获取家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<FamilyMemorabiliaResponseBean>> getFamilyMemorabilia(Map<String,Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<FamilyMemorabiliaBean>>> getFamilyMemorabilia(Map<String,Object> paramsMap) { |
| | | return apiService.getFamilyMemorabilia(paramsMap); |
| | | } |
| | | /** |
| | |
| | | * 获取家庭资产 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<FamilyAssetsResponseBean>> getFamilyAssets(Map<String, Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<FamilyAssetsBean>>> getFamilyAssets(Map<String, Object> paramsMap) { |
| | | return apiService.getFamilyAssets(paramsMap); |
| | | } |
| | | |
| | |
| | | * 获取家庭设备 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<HomeDevicesResponseBean>> getHomeDevices(Map<String, Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<HomeDevicesBean>>> getHomeDevices(Map<String, Object> paramsMap) { |
| | | return apiService.getHomeDevices(paramsMap); |
| | | } |
| | | /** |
| | | * 增加家庭设备 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addHomeDevices(HomeDevicesBean homeDevicesBean) { |
| | | return apiService.addHomeDevices(homeDevicesBean); |
| | | } |
| | | /** |
| | | * 删除家庭设备 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteHomeDevices(String ids) { |
| | | return apiService.deleteHomeDevices(ids); |
| | | } |
| | | /** |
| | | * 修改家庭设备 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateHomeDevices(HomeDevicesBean homeDevicesBean) { |
| | | return apiService.updateHomeDevices(homeDevicesBean); |
| | | } |
| | | |
| | | /** |
| | | <<<<<<< HEAD |
| | | * 获取家庭荣誉 |
| | | */ |
| | | @Override |
| | |
| | | * 获取小医生 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<LittleDoctorResponseBean>> getLittleDoctors(Map<String, Object> map) { |
| | | public Observable<ResultData<PageResponseBean<LittleDoctorBean>>> getLittleDoctors(Map<String, Object> map) { |
| | | return apiService.getLittleDoctors(map); |
| | | } |
| | | /** |
| | | * 增加小医生 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addLittleDoctor(LittleDoctorBean littleDoctorBean) { |
| | | return apiService.addLittleDoctor(littleDoctorBean); |
| | | } |
| | | /** |
| | | * 删除小医生 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteLittleDoctors(String ids) { |
| | | return apiService.deleteLittleDoctors(ids); |
| | | } |
| | | /** |
| | | * 修改小医生 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateLittleDoctor(LittleDoctorBean littleDoctorBean) { |
| | | return apiService.updateLittleDoctor(littleDoctorBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取收支 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<IncomeAndExpensesResponseBean>> getIncomeAndExpenses(Map<String, Object> map) { |
| | | public Observable<ResultData<PageResponseBean<IncomeAndExpensesBean>>> getIncomeAndExpenses(Map<String, Object> map) { |
| | | return apiService.getIncomeAndExpenses(map); |
| | | } |
| | | |
| | | /** |
| | | * 增加收支 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addIncomeAndExpenses(IncomeAndExpensesBean incomeAndExpensesBean) { |
| | | return apiService.addIncomeAndExpenses(incomeAndExpensesBean); |
| | | } |
| | | /** |
| | | * 删除收支 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteIncomeAndExpenses(String ids) { |
| | | return apiService.deleteIncomeAndExpenses(ids); |
| | | } |
| | | /** |
| | | * 修改收支 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateIncomeAndExpenses(IncomeAndExpensesBean incomeAndExpensesBean) { |
| | | return apiService.updateIncomeAndExpenses(incomeAndExpensesBean); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取成长经历 |
| | |
| | | public Observable<ResultData<GrowthExperienceInformationBean>> getGrowthExperienceInformation() { |
| | | return apiService.getGrowthExperienceInformation(); |
| | | } |
| | | |
| | | /** |
| | | * 修改个人信息 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateGrowthExperienceInformation(GrowthExperienceInformationBean growthExperienceInformationBean) { |
| | | return apiService.updateGrowthExperienceInformation(growthExperienceInformationBean); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取成长经历关系情况 |
| | | */ |
| | |
| | | return apiService.getGrowthExperienceAutobiography(); |
| | | } |
| | | |
| | | /** |
| | | * 获取通讯录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<ContactsResponseBean>> getContacts(Map<String, Object> paramsMap) { |
| | | public Observable<ResultData<PageResponseBean<ContactsDetailBean>>> getContacts(Map<String, Object> paramsMap) { |
| | | return apiService.getContacts(paramsMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取保洁收纳 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<CleanStorageBean>>> getCleanStorages(Map<String, Object> map) { |
| | | return apiService.getCleanStorages(map); |
| | | } |
| | | |
| | | /** |
| | | * 增加保洁收纳 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addCleanStorage(CleanStorageBean cleanStorageBean) { |
| | | return apiService.addCleanStorage(cleanStorageBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除保洁收纳 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteCleanStorages(String ids) { |
| | | return apiService.deleteCleanStorages(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改保洁收纳 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateCleanStorage(CleanStorageBean cleanStorageBean) { |
| | | return apiService.updateCleanStorage(cleanStorageBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人婚姻信息 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<MarriageInfoBean>> getMarriageInfo() { |
| | | return apiService.getMarriageInfo(); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人记事本 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<PersonalNotepadBean>>> getPersonalNotepad(Map<String, Object> toMap) { |
| | | return apiService.getPersonalNotepad(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 增加个人记事本 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addPersonalNotepad(PersonalNotepadBean personalNotepadBean) { |
| | | return apiService.addPersonalNotepad(personalNotepadBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除个人记事本 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deletePersonalNotepad(String ids) { |
| | | return apiService.deletePersonalNotepad(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改个人记事本 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updatePersonalNotepad(PersonalNotepadBean personalNotepadBean) { |
| | | return apiService.updatePersonalNotepad(personalNotepadBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人隐私 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<PrivacyBean>>> getPrivacy(Map<String, Object> toMap) { |
| | | return apiService.getPrivacy(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取荣誉证书 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<CertificateOfHonorBean>>> getCertificateOfHonor(Map<String, Object> toMap) { |
| | | return apiService.getCertificateOfHonor(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取个人财产 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<PropertyBean>>> getProperty(Map<String, Object> toMap) { |
| | | return apiService.getProperty(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取百年心愿 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<HundredWishBean>>> getHundredWish(Map<String, Object> toMap) { |
| | | return apiService.getHundredWish(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取宠物 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<PetBean>>> getPets(Map<String, Object> toMap) { |
| | | return apiService.getPets(toMap); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取宠物备忘录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<PetMemoBean>>> getPetMemo(Map<String, Object> toMap) { |
| | | return apiService.getPetMemo(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取旅游费用记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<TourismBean>>> getTourism(Map<String, Object> toMap) { |
| | | return apiService.getTourism(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 新增旅游费用记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addTourism(TourismBean tourismBean) { |
| | | return apiService.addTourism(tourismBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除旅游费用记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteTourism(String ids) { |
| | | return apiService.deleteTourism(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改旅游费用记录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateTourism(TourismBean tourismBean) { |
| | | return apiService.updateTourism(tourismBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取旅游经历 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<TourismExperienceBean>>> getTourismExperience(Map<String, Object> toMap) { |
| | | return apiService.getTourismExperience(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 新增旅游经历 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addTourismExperience(TourismExperienceBean tourismExperienceBean) { |
| | | return apiService.addTourismExperience(tourismExperienceBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除旅游经历 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteTourismExperience(String ids) { |
| | | return apiService.deleteTourismExperience(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改旅游经历 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateTourismExperience(TourismExperienceBean tourismExperienceBean) { |
| | | return apiService.updateTourismExperience(tourismExperienceBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取备忘录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<List<MemoBean>>> getMemos(String fid, String cid) { |
| | | return apiService.getMemos(fid, cid); |
| | | } |
| | | |
| | | /** |
| | | * 新增备忘录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addMemo(MemoBean memoBean) { |
| | | return apiService.addMemo(memoBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除备忘录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteMemo(String ids) { |
| | | return apiService.deleteMemo(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改备忘录 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateMemo(MemoBean memoBean) { |
| | | return apiService.updateMemo(memoBean); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取家谱 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<HomeMemberBean>>> getHomeMembers(Map<String, Object> toMap) { |
| | | return apiService.getHomeMembers(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 获取家根网 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<List<HomeRootBean>>> getHomeRoot(String depth) { |
| | | return apiService.getHomeRoot(depth); |
| | | } |
| | | |
| | | /** |
| | | * 获取年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<AnnualHealthStatusBean>>> getAnnualHealthStatus(Map<String, Object> toMap) { |
| | | return apiService.getAnnualHealthStatus(toMap); |
| | | } |
| | | |
| | | /** |
| | | * 新增年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addAnnualHealthStatus(AnnualHealthStatusBean annualHealthStatusBean) { |
| | | return apiService.addAnnualHealthStatus(annualHealthStatusBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteAnnualHealthStatus(String ids) { |
| | | return apiService.deleteAnnualHealthStatus(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改年度健康状况 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateAnnualHealthStatus(AnnualHealthStatusBean annualHealthStatusBean) { |
| | | return apiService.updateAnnualHealthStatus(annualHealthStatusBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取轮播图数据 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<List<BannerBean>>> getBannerData() { |
| | | return apiService.getBannerData(); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健基本信息 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<HealthCareBaseInfoBean>> getHealthCareBaseInfo() { |
| | | return apiService.getHealthCareBaseInfo(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健基本信息 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateHealthCareBaseInfo(HealthCareBaseInfoBean healthCareBaseInfoBean) { |
| | | return apiService.updateHealthCareBaseInfo(healthCareBaseInfoBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健生活习惯 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<HealthCareLifeHabitsBean>> getHealthCareLifeHabits() { |
| | | return apiService.getHealthCareLifeHabits(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健生活习惯 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateHealthCareLifeHabits(HealthCareLifeHabitsBean healthCareLifeHabitsBean) { |
| | | return apiService.updateHealthCareLifeHabits(healthCareLifeHabitsBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健护理查体 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<HealthCareNursingExaminationBean>> getHealthCareNursingExamination() { |
| | | return apiService.getHealthCareNursingExamination(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健护理查体 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateHealthCareNursingExamination(HealthCareNursingExaminationBean healthCareNursingExaminationBean) { |
| | | return apiService.updateHealthCareNursingExamination(healthCareNursingExaminationBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健现存健康问题 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<HealthCareExistingProblemsBean>> getHealthCareExistingProblems() { |
| | | return apiService.getHealthCareExistingProblems(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健现存健康问题 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateHealthCareExistingProblems(HealthCareExistingProblemsBean healthCareExistingProblemsBean) { |
| | | return apiService.updateHealthCareExistingProblems(healthCareExistingProblemsBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健笔记内容 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<HealthCareNotesContentBean>> getHealthCareNotesContent() { |
| | | return apiService.getHealthCareNotesContent(); |
| | | } |
| | | |
| | | /** |
| | | * 修改健康保健笔记内容 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateHealthCareNotesContent(HealthCareNotesContentBean healthCareNotesContentBean) { |
| | | return apiService.updateHealthCareNotesContent(healthCareNotesContentBean); |
| | | } |
| | | |
| | | /** |
| | | * 获取版本更新 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<UpdateVersionBean>> getUpdateVersion() { |
| | | return apiService.getUpdateVersion(); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.res.ColorStateList; |
| | | import android.graphics.Typeface; |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.util.TypedValue; |
| | |
| | | * @desc TitleBar统一样式 |
| | | */ |
| | | public class MyTitleBarStyle extends CommonBarStyle { |
| | | |
| | | @Override |
| | | public TextView createLeftView(Context context) { |
| | | return super.createLeftView(context); |
| | | public Typeface getTitleTypeface(Context context, int style) { |
| | | return Typeface.createFromAsset(context.getAssets(), "roboto_regular.ttf"); |
| | | } |
| | | |
| | | @Override |
| | | public Typeface getLeftTitleTypeface(Context context, int style) { |
| | | return Typeface.createFromAsset(context.getAssets(), "roboto_regular.ttf"); |
| | | } |
| | | |
| | | @Override |
| | | public Typeface getRightTitleTypeface(Context context, int style) { |
| | | return Typeface.createFromAsset(context.getAssets(), "roboto_regular.ttf"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, context.getResources().getDisplayMetrics()); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.android.app_base.base.view.BaseActivity; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.ui.function.CertificateOfHonorActivity; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageActivity; |
| | |
| | | import com.application.zhangshi_app_android.ui.function.LittleDoctorActivity; |
| | | import com.application.zhangshi_app_android.ui.function.MarriageActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PrivacyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PropertyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.TourismActivity; |
| | | import com.application.zhangshi_app_android.ui.home.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.main.MainActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.OptionPicker; |
| | | import com.github.gzuliyujiang.wheelpicker.entity.DateEntity; |
| | | import com.github.gzuliyujiang.wheelpicker.impl.UnitDateFormatter; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.DateWheelLayout; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.OptionWheelLayout; |
| | | import com.hjq.bar.TitleBar; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | super.onCreate(savedInstanceState); |
| | | |
| | | if (mDrawerLayout != null) { |
| | | classMap.put(null,(LinearLayout) findViewById(R.id.dl_home_root_net)); |
| | | classMap.put(HomeFragment.class,(LinearLayout) findViewById(R.id.dl_home_root_net)); |
| | | classMap.put(FamilyMemorabiliaActivity.class,(LinearLayout) findViewById(R.id.dl_family_memorabilia)); |
| | | classMap.put(FamilyAssetsActivity.class,(LinearLayout) findViewById(R.id.dl_family_assets)); |
| | | classMap.put(HomeDevicesActivity.class,(LinearLayout) findViewById(R.id.dl_home_devices)); |
| | |
| | | if (linearLayout != null) { |
| | | linearLayout.setOnClickListener(v -> { |
| | | if (set.getKey() != null){ |
| | | if (set.getKey() == HomeFragment.class) { |
| | | MainActivity.start(this, HomeFragment.class); |
| | | }else{ |
| | | AppManager.getAppManager().startActivity(set.getKey()); |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | popupWindow.setOutsideTouchable(false); |
| | | return popupWindow; |
| | | } |
| | | |
| | | public DatePicker getDatePicker(){ |
| | | DatePicker datePicker = new DatePicker(this); |
| | | DateWheelLayout wheelLayout = datePicker.getWheelLayout(); |
| | | wheelLayout.getMonthWheelView().setCurtainCorner(0);//背景无圆角 |
| | | wheelLayout.getDayWheelView().setCurtainCorner(5);//背景右边有圆角 |
| | | wheelLayout.getYearWheelView().setCurtainCorner(4);//背景左边有圆角 |
| | | wheelLayout.setDateFormatter(new UnitDateFormatter()); |
| | | wheelLayout.setPadding(50, 0, 50, 0); |
| | | wheelLayout.setItemSpace(ScreenSizeUtils.dip2px(getSelfActivity(), 20)); |
| | | wheelLayout.setCurtainEnabled(true); |
| | | wheelLayout.setCurtainColor(Color.parseColor("#4D2F63F8")); |
| | | wheelLayout.setCurtainRadius(ScreenSizeUtils.dip2px(getSelfActivity(),4)); |
| | | wheelLayout.setSelectedTextColor(Color.parseColor("#FF2F63F8")); |
| | | wheelLayout.setTextColor(Color.parseColor("#FF999999")); |
| | | wheelLayout.setIndicatorEnabled(false); |
| | | //日期可选范围 |
| | | wheelLayout.setRange(DateEntity.target(1900, 1, 1), DateEntity.target(2500, 12, 31),DateEntity.target(Calendar.getInstance())); |
| | | datePicker.getWheelLayout().setResetWhenLinkage(false); |
| | | return datePicker; |
| | | } |
| | | |
| | | public OptionPicker getOptionPicker(List<String> list){ |
| | | OptionPicker picker = new OptionPicker(this); |
| | | OptionWheelLayout wheelLayout = picker.getWheelLayout(); |
| | | wheelLayout.setCurtainCorner(1);//背景无圆角 |
| | | wheelLayout.setPadding(50, 0, 50, 0); |
| | | wheelLayout.setItemSpace(ScreenSizeUtils.dip2px(getSelfActivity(), 20)); |
| | | wheelLayout.setCurtainEnabled(true); |
| | | wheelLayout.setCurtainColor(Color.parseColor("#4D2F63F8")); |
| | | wheelLayout.setCurtainRadius(ScreenSizeUtils.dip2px(getSelfActivity(),4)); |
| | | wheelLayout.setSelectedTextColor(Color.parseColor("#FF2F63F8")); |
| | | wheelLayout.setTextColor(Color.parseColor("#FF999999")); |
| | | wheelLayout.setIndicatorEnabled(false); |
| | | picker.setData(list); |
| | | return picker; |
| | | } |
| | | } |
| | |
| | | import androidx.databinding.ViewDataBinding; |
| | | import androidx.drawerlayout.widget.DrawerLayout; |
| | | |
| | | import com.android.app_base.base.view.BaseActivity; |
| | | import com.android.app_base.base.view.BaseFragment; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.manager.AppManager; |
| | |
| | | import com.application.zhangshi_app_android.ui.function.IncomeAndExpensesActivity; |
| | | import com.application.zhangshi_app_android.ui.function.LittleDoctorActivity; |
| | | import com.application.zhangshi_app_android.ui.function.MarriageActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PrivacyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PropertyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.TourismActivity; |
| | |
| | | classMap.put(LittleDoctorActivity.class,(LinearLayout) findViewById(R.id.dl_little_doctor)); |
| | | classMap.put(CleanStorageActivity.class,(LinearLayout) findViewById(R.id.dl_clean_storage)); |
| | | classMap.put(ContactsActivity.class,(LinearLayout) findViewById(R.id.dl_contacts)); |
| | | classMap.put(PetActivity.class,(LinearLayout) findViewById(R.id.dl_pet)); |
| | | classMap.put(PetDetailActivity.class,(LinearLayout) findViewById(R.id.dl_pet)); |
| | | classMap.put(IncomeAndExpensesActivity.class,(LinearLayout) findViewById(R.id.dl_income_and_expenses)); |
| | | classMap.put(GrowthExperienceActivity.class,(LinearLayout) findViewById(R.id.dl_growing_up)); |
| | | classMap.put(MarriageActivity.class,(LinearLayout) findViewById(R.id.dl_marriage)); |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui; |
| | | |
| | | import android.graphics.Color; |
| | | import android.view.Gravity; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.LinearLayout; |
| | | |
| | | import com.android.app_base.base.view.BaseActivity; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.databinding.ActivityTestBinding; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.annotation.DateMode; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.entity.DateEntity; |
| | | import com.github.gzuliyujiang.wheelpicker.impl.UnitDateFormatter; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.DateWheelLayout; |
| | | import com.github.gzuliyujiang.wheelview.annotation.CurtainCorner; |
| | | |
| | | import java.util.Calendar; |
| | | |
| | | |
| | | public class TestActivity extends BaseActivity<ActivityTestBinding,TestActivityViewModel>{ |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_test; |
| | | } |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initView() { |
| | | binding.btn.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void initData() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.06.06. 17:48 |
| | | * @desc |
| | | */ |
| | | public class TestActivityViewModel extends BaseViewModel<DataRepository> { |
| | | private String text; |
| | | public TestActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return null; |
| | | } |
| | | |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | } |
| | |
| | | import android.widget.ImageView; |
| | | |
| | | import androidx.databinding.DataBindingUtil; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.widget.GridSpaceItemDecoration; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.PetImageRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.databinding.DialogContactsInfoBinding; |
| | | |
| | |
| | | public class ContactsDialog { |
| | | public static class Builder extends BaseDialog.Builder<ContactsDialog.Builder> { |
| | | private DialogContactsInfoBinding binding; |
| | | private PetImageRvAdapter adapter; |
| | | public Builder(Context context) { |
| | | super(context); |
| | | binding = DataBindingUtil.inflate(LayoutInflater.from(getContext()),R.layout.dialog_contacts_info,new FrameLayout(getContext()),false); |
| | |
| | | ImageView iv_dialog_close = findViewById(R.id.iv_dialog_close); |
| | | setOnClickListener(iv_dialog_close); |
| | | |
| | | adapter = new PetImageRvAdapter(context); |
| | | GridSpaceItemDecoration decoration = new GridSpaceItemDecoration(3, ScreenSizeUtils.dip2px(context,10),ScreenSizeUtils.dip2px(context,20)); |
| | | binding.recyclerView.addItemDecoration(decoration); |
| | | binding.recyclerView.setLayoutManager(new GridLayoutManager(context,3)); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | public Builder setBean(ContactsDetailBean bean){ |
| | | binding.setBean(bean); |
| | | adapter.setData(Utils.splitString2List(bean.getUrl(),",")); |
| | | return this; |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.view.Gravity; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.ImageView; |
| | | |
| | | import androidx.annotation.DrawableRes; |
| | | import androidx.constraintlayout.utils.widget.ImageFilterView; |
| | | import androidx.databinding.DataBindingUtil; |
| | | |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.utils.GlideUtil; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.PetBean; |
| | | import com.application.zhangshi_app_android.bean.PetOwnerBean; |
| | | import com.application.zhangshi_app_android.databinding.DialogContactsInfoBinding; |
| | | import com.application.zhangshi_app_android.databinding.DialogPetOwnerInfoBinding; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class PetOwnerInfoDialog { |
| | | public static class Builder extends BaseDialog.Builder<PetOwnerInfoDialog.Builder> { |
| | | private DialogPetOwnerInfoBinding binding; |
| | | public Builder(Context context) { |
| | | super(context); |
| | | setContentView(R.layout.dialog_pet_owner_info); |
| | | binding = DataBindingUtil.inflate(LayoutInflater.from(getContext()),R.layout.dialog_pet_owner_info,new FrameLayout(getContext()),false); |
| | | setContentView(binding.getRoot()); |
| | | setAnimStyle(BaseDialog.ANIM_IOS); |
| | | setBackgroundDimEnabled(false); |
| | | setCancelable(false); |
| | | setGravity(Gravity.CENTER); |
| | | |
| | | ImageView iv_dialog_close = findViewById(R.id.iv_dialog_close); |
| | | setOnClickListener(iv_dialog_close); |
| | | |
| | | } |
| | | |
| | | |
| | | public PetOwnerInfoDialog.Builder setBean(PetBean bean){ |
| | | binding.setOwner(bean); |
| | | return this; |
| | | } |
| | | @Override |
| | | public void onClick(View v) { |
| | | super.onClick(v); |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.dialog; |
| | | |
| | | import static com.blankj.utilcode.util.StringUtils.getString; |
| | | |
| | | import android.annotation.SuppressLint; |
| | | import android.app.DownloadManager; |
| | | import android.content.Context; |
| | | import android.database.Cursor; |
| | | import android.net.Uri; |
| | | import android.os.Environment; |
| | | import android.os.Handler; |
| | | import android.util.Log; |
| | | import android.view.Gravity; |
| | | import android.view.View; |
| | | import android.widget.ProgressBar; |
| | | import android.widget.RelativeLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.annotation.StringRes; |
| | | |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.MyApplication; |
| | | import com.application.zhangshi_app_android.R; |
| | | |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.07.25. 16:59 |
| | | * @desc |
| | | */ |
| | | public final class VersionUpdateDialog { |
| | | @SuppressWarnings("unchecked") |
| | | public static class Builder<B extends VersionUpdateDialog.Builder<B>> |
| | | extends BaseDialog.Builder<B> { |
| | | |
| | | private boolean mAutoDismiss = true; |
| | | |
| | | private final TextView mTitleView; |
| | | private final TextView mContentView; |
| | | private final TextView mConfirmView; |
| | | private final ProgressBar progressBar; |
| | | private final TextView tv_pro; |
| | | private final TextView tv_pro_percent; |
| | | private final RelativeLayout layout_progress; |
| | | |
| | | private String downloadUrl; |
| | | |
| | | public Builder(Context context) { |
| | | super(context); |
| | | setContentView(R.layout.dialog_version_update); |
| | | setAnimStyle(BaseDialog.ANIM_IOS); |
| | | setGravity(Gravity.CENTER); |
| | | setBackgroundDimAmount(0.5F); |
| | | setCanceledOnTouchOutside(true); |
| | | mTitleView = findViewById(R.id.tv_update_dialog_title); |
| | | mContentView = findViewById(R.id.tv_update_dialog_content); |
| | | mConfirmView = findViewById(R.id.tv_update_dialog_confirm); |
| | | progressBar = findViewById(R.id.pb_download); |
| | | tv_pro = findViewById(R.id.tv_pro); |
| | | tv_pro_percent = findViewById(R.id.tv_pro_percent); |
| | | layout_progress = findViewById(R.id.layout_progress); |
| | | setOnClickListener(mConfirmView); |
| | | } |
| | | |
| | | public B setDownloadUrl(String downloadUrl) { |
| | | this.downloadUrl = downloadUrl; |
| | | return (B) this; |
| | | } |
| | | |
| | | public B setTitle(@StringRes int id) { |
| | | return setTitle(getString(id)); |
| | | } |
| | | |
| | | public B setTitle(CharSequence text) { |
| | | mTitleView.setText(text); |
| | | return (B) this; |
| | | } |
| | | |
| | | public B setContent(CharSequence text) { |
| | | mContentView.setText(text); |
| | | return (B) this; |
| | | } |
| | | |
| | | public B setConfirm(@StringRes int id) { |
| | | return setConfirm(getString(id)); |
| | | } |
| | | |
| | | public B setConfirm(CharSequence text) { |
| | | mConfirmView.setText(text); |
| | | return (B) this; |
| | | } |
| | | |
| | | public B setAutoDismiss(boolean dismiss) { |
| | | mAutoDismiss = dismiss; |
| | | return (B) this; |
| | | } |
| | | |
| | | public void autoDismiss() { |
| | | if (mAutoDismiss) { |
| | | dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (v == mConfirmView) { |
| | | changeVisi(View.GONE,View.VISIBLE); |
| | | if (downloadUrl != null){ |
| | | startDownLoadApp(downloadUrl); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public BaseDialog show() { |
| | | return super.show(); |
| | | } |
| | | |
| | | |
| | | public long totalBytes; |
| | | public long downloadBytes; |
| | | public int dl_progress; |
| | | |
| | | private Handler handler = new Handler(); |
| | | Runnable runnable = new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | // TODO Auto-generated method stub |
| | | progressBar.setProgress(dl_progress); |
| | | tv_pro.setText((downloadBytes * 100 / totalBytes) + "%"); |
| | | tv_pro_percent.setText((downloadBytes * 100 / totalBytes) + "/100"); |
| | | } |
| | | }; |
| | | |
| | | public void changeVisi(int a, int b) { |
| | | mConfirmView.setVisibility(a); |
| | | layout_progress.setVisibility(b); |
| | | progressBar.setProgress(0); |
| | | tv_pro.setText("0"); |
| | | tv_pro_percent.setText("0/100"); |
| | | } |
| | | |
| | | /** |
| | | * 不涉及数据库,单独下载文件 |
| | | */ |
| | | public void startDownLoadApp(String url) { |
| | | String fileName = "app_update"; |
| | | //创建下载任务,downloadUrl就是下载链接 |
| | | DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); |
| | | request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);//下载进行中和下载完成的通知栏是否显示 |
| | | //用于设置下载时时候在状态栏显示通知信息 |
| | | request.setNotificationVisibility(request.VISIBILITY_VISIBLE); |
| | | request.allowScanningByMediaScanner();//设置允许被扫描到 |
| | | request.setVisibleInDownloadsUi(true);//下载的文件可以被系统的Downloads应用扫描到并管理 |
| | | |
| | | request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName); //指定下载路径和下载文件名 |
| | | |
| | | final DownloadManager downloadManager = (DownloadManager) MyApplication.getInstance().getSystemService(Context.DOWNLOAD_SERVICE);//获取下载管理器 |
| | | final long downloadID = downloadManager.enqueue(request);//将下载任务加入下载队列,否则不会进行下载 |
| | | |
| | | final DownloadManager.Query query = new DownloadManager.Query(); |
| | | query.setFilterById(downloadID);//筛选下载任务,传入任务ID,可变参数 |
| | | |
| | | |
| | | final Timer mTimer = new Timer(); |
| | | mTimer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | updateDownloadSize(query, mTimer, downloadManager, fileName); |
| | | } |
| | | }, 0, 1000); |
| | | } |
| | | |
| | | @SuppressLint("Range") |
| | | private void updateDownloadSize(DownloadManager.Query query, Timer mTimer, DownloadManager downloadManager, String fileName) { |
| | | Cursor c = null; |
| | | try { |
| | | c = downloadManager.query(query); |
| | | if (c != null) { |
| | | if (c.moveToFirst()) { |
| | | int downloadBytesIdx = c.getColumnIndexOrThrow( |
| | | DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR); |
| | | int totalBytesIdx = c.getColumnIndexOrThrow( |
| | | DownloadManager.COLUMN_TOTAL_SIZE_BYTES); |
| | | totalBytes = c.getLong(totalBytesIdx); |
| | | downloadBytes = c.getLong(downloadBytesIdx); |
| | | int status = c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)); |
| | | // 已下载的字节大小 |
| | | final long downloadedSoFar = c.getLong(c.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)); |
| | | // 下载文件的总字节大小 |
| | | final long totalSize = c.getLong(c.getColumnIndex(DownloadManager.COLUMN_TOTAL_SIZE_BYTES)); |
| | | dl_progress = (int) (downloadedSoFar * 100 / totalSize); |
| | | switch (status) { |
| | | case DownloadManager.STATUS_PAUSED: |
| | | Log.d("APPUpdate", "下载暂停:" + fileName); |
| | | case DownloadManager.STATUS_PENDING: |
| | | Log.d("APPUpdate", "下载延迟:" + fileName); |
| | | case DownloadManager.STATUS_RUNNING: |
| | | Log.d("APPUpdate", "正在下载:" + fileName); |
| | | handler.postDelayed(runnable, 100); |
| | | break; |
| | | case DownloadManager.STATUS_SUCCESSFUL: |
| | | Log.d("APPUpdate", "下载完成:" + fileName); |
| | | mTimer.cancel(); |
| | | dismiss(); |
| | | handler=null; |
| | | //下载完成安装APK |
| | | Utils.installAPK(getContext(), fileName); |
| | | break; |
| | | case DownloadManager.STATUS_FAILED: |
| | | Log.d("APPUpdate", "下载失败:" + fileName); |
| | | setContent("下载失败,请重新下载"); |
| | | changeVisi(View.VISIBLE,View.GONE); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } finally { |
| | | if (c != null) { |
| | | c.close(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.content.Intent; |
| | | import android.text.Editable; |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.AnnualHealthStatusRvAdapter; |
| | | import com.application.zhangshi_app_android.adapter.CleanStorageRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityAnnualHealthStatusBinding; |
| | | import com.application.zhangshi_app_android.databinding.ActivityCleanStorageBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.hjq.bar.TitleBar; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | public class AnnualHealthStatusActivity extends DLBaseActivity<ActivityAnnualHealthStatusBinding,AnnualHealthStatusActivityViewModel > { |
| | | |
| | | private AnnualHealthStatusRvAdapter adapter; |
| | | |
| | | private boolean isSearchLayoutVisible; |
| | | private PopupWindow mOperatePopupWindow; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_annual_health_status; |
| | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new AnnualHealthStatusRvAdapter(this); |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreAnnualHealthStatus(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new AnnualHealthStatusRvAdapter(this,viewModel); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_12)); |
| | | itemDecoration.setHorizontalSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | itemDecoration.setFirstTop((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate,null)); |
| | | setOnClickListener( |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_add), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_select), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | //点击搜索框菜单下拉出 搜索参数 |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | if (!isSearchLayoutVisible){ |
| | | binding.layoutSearchParameter.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = binding.layoutSearchParameter.getMeasuredHeight(); |
| | | Utils.dropExpand(binding.containerSearchParameter,0,targetHeight); |
| | | isSearchLayoutVisible = true; |
| | | } |
| | | }); |
| | | //搜索参数layout添加空点击事件,防止点击它内部view时它后面的recycler还能响应点击事件 |
| | | binding.layoutSearchParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | } |
| | | }); |
| | | //点击搜索按钮进行搜索 |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getAnnualHealthStatus(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | //点击添加按钮跳转到创建家大事记页面 |
| | | binding.fabAdd.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity(new Intent(getSelfActivity(), AnnualHealthStatusDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | } |
| | | }); |
| | | binding.etStartTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etEndTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etEndTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etStartTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etStartTime.setOnClickListener(v -> { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择开始时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | //以yyyy-MM-dd的格式显示,月日小于10时前面补0 |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etEndTime.getText().toString().isEmpty()){ |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | }); |
| | | binding.etEndTime.setOnClickListener(v -> { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择结束时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etStartTime.getText().toString().isEmpty()){ |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | }); |
| | | binding.ivTimeClear.setOnClickListener(v -> { |
| | | binding.etStartTime.setText(""); |
| | | binding.etEndTime.setText(""); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | viewModel.getDataListLiveData().observe(this, dataList -> { |
| | | adapter.setData(dataList); |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, checkList -> { |
| | | if (0 == viewModel.getOperateTypeLiveData().getValue()){ |
| | | return; |
| | | } |
| | | if (checkList.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, moreList -> { |
| | | adapter.addData(moreList); |
| | | }); |
| | | viewModel.getOperateTypeLiveData().observe(this, integer -> { |
| | | if (integer == 0){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_operate); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | adapter.setCheckable(false); |
| | | }else if (integer == 1){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_operate_finish); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.getOperateTypeLiveData().postValue(0); |
| | | }); |
| | | adapter.setCheckable(true); |
| | | }else if (integer == 2){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_delete_white); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | new UIDialog.Builder(this) |
| | | .setTitle("您确定要删除选中的项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteCheckList(); |
| | | } |
| | | }) |
| | | .show(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | viewModel.getFinishDeleteListLiveData().observe(this, beans -> { |
| | | for (AnnualHealthStatusBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | |
| | | //观察数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据进行刷新 |
| | | RxBus.getInstance().toObservable(this, AnnualHealthStatusBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getAnnualHealthStatus(); |
| | | }); |
| | | } |
| | | @Override |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | | protected void dataFinish() { |
| | | super.dataFinish(); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | binding.refreshLayout.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | int id = v.getId(); |
| | | if (id == R.id.tv_add){ |
| | | AppManager.getAppManager().startActivity(new Intent(this, AnnualHealthStatusDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | mOperatePopupWindow.dismiss(); |
| | | }else if (id == R.id.tv_select){ |
| | | viewModel.getOperateTypeLiveData().postValue(1); |
| | | mOperatePopupWindow.dismiss(); |
| | | }else if (id == R.id.tv_from_new_to_old) { |
| | | viewModel.changeOrder(true); |
| | | mOperatePopupWindow.dismiss(); |
| | | } else if (id == R.id.tv_from_old_to_new) { |
| | | viewModel.changeOrder(false); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent event) { |
| | | float x = event.getX(); |
| | | float y = event.getY(); |
| | | if (isSearchLayoutVisible){ |
| | | if (!Utils.isPointInsideView(x, y, binding.layoutSearchParameter)) { |
| | | Utils.pullCollapse(binding.containerSearchParameter, binding.layoutSearchParameter.getMeasuredHeight(),0); |
| | | isSearchLayoutVisible = false; |
| | | return true; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(event); |
| | | } |
| | | |
| | | @Override |
| | | public void onLeftClick(TitleBar titleBar) { |
| | | finish(); |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | import android.text.TextUtils; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.LiveData; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusRequestBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusRequestBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class AnnualHealthStatusActivityViewModel extends BaseViewModel<DataRepository> { |
| | | private MutableLiveData<List<AnnualHealthStatusBean>> dataListLiveData; |
| | | private MutableLiveData<List<AnnualHealthStatusBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<AnnualHealthStatusBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<AnnualHealthStatusRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<AnnualHealthStatusBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | private MutableLiveData<Integer> operateTypeLiveData;//操作类型 0 选择操作 1.完成 2.删除 |
| | | public AnnualHealthStatusActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 获取年度健康情况 |
| | | */ |
| | | public void getAnnualHealthStatus() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new AnnualHealthStatusRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | model.getAnnualHealthStatus(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<AnnualHealthStatusBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<AnnualHealthStatusBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreAnnualHealthStatus() { |
| | | if (true){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | return; |
| | | } |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new AnnualHealthStatusRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getAnnualHealthStatus(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<AnnualHealthStatusBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<AnnualHealthStatusBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | messageLiveData.postValue("没有更多数据了"); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | moreListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除多选选中的数据 |
| | | */ |
| | | public void deleteCheckList() { |
| | | List<AnnualHealthStatusBean> deleteList = getCheckListLiveData().getValue(); |
| | | if (deleteList == null){ |
| | | return; |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | | deleteList.forEach(AnnualHealthStatusBean -> sb.append(AnnualHealthStatusBean.getId()).append(",")); |
| | | sb.deleteCharAt(sb.length()-1); |
| | | model.deleteAnnualHealthStatus(sb.toString()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | finishDeleteListLiveData.postValue(checkListLiveData.getValue()); |
| | | messageLiveData.postValue("删除成功"); |
| | | getCheckListLiveData().postValue(new ArrayList<>()); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除单个数据 |
| | | */ |
| | | public void deleteItem(AnnualHealthStatusBean AnnualHealthStatusBean) { |
| | | model.deleteAnnualHealthStatus(String.valueOf(AnnualHealthStatusBean.getId())) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | List<AnnualHealthStatusBean> list = new ArrayList<>(); |
| | | list.add(AnnualHealthStatusBean); |
| | | finishDeleteListLiveData.postValue(list); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public MutableLiveData<List<AnnualHealthStatusBean>> getCheckListLiveData() { |
| | | if (checkListLiveData==null){ |
| | | checkListLiveData = new MutableLiveData<>(); |
| | | checkListLiveData.postValue(new ArrayList<>()); |
| | | } |
| | | if (checkListLiveData.getValue() == null){ |
| | | checkListLiveData.postValue(new ArrayList<>()); |
| | | } |
| | | return checkListLiveData; |
| | | } |
| | | |
| | | public void setCheckListLiveData(MutableLiveData<List<AnnualHealthStatusBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<AnnualHealthStatusRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new AnnualHealthStatusRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<AnnualHealthStatusRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<AnnualHealthStatusBean>> getDataListLiveData() { |
| | |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 获取年度健康情况 |
| | | */ |
| | | public void getAnnualHealthStatus() { |
| | | List<AnnualHealthStatusBean> beans = new ArrayList<>(); |
| | | for (int i = 0; i < 10; i++) { |
| | | AnnualHealthStatusBean bean = new AnnualHealthStatusBean(); |
| | | bean.setId(i); |
| | | bean.setTime("2020-0" + i + "-01"); |
| | | bean.setType("体检"); |
| | | bean.setHospital("人民医院"); |
| | | bean.setName("体格检查"); |
| | | bean.setAttention("注意保健"); |
| | | bean.setRemark("全全身检查"); |
| | | beans.add(bean); |
| | | @NonNull |
| | | public MutableLiveData<List<AnnualHealthStatusBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | dataListLiveData.setValue(beans); |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<AnnualHealthStatusBean>> moreListLiveData) { |
| | | this.moreListLiveData = moreListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<Integer> getOperateTypeLiveData() { |
| | | if (operateTypeLiveData == null){ |
| | | operateTypeLiveData = new MutableLiveData<>(); |
| | | operateTypeLiveData.setValue(0); |
| | | } |
| | | return operateTypeLiveData; |
| | | } |
| | | |
| | | public void setOperateTypeLiveData(MutableLiveData<Integer> operateTypeLiveData) { |
| | | this.operateTypeLiveData = operateTypeLiveData; |
| | | } |
| | | |
| | | public LiveData<List<AnnualHealthStatusBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<AnnualHealthStatusBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | | */ |
| | | public void changeOrder(boolean b) { |
| | | List<AnnualHealthStatusBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | if (b) { |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getCheckTime(); |
| | | String happenTime2 = o2.getCheckTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return 1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return -1; |
| | | } else { |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date2.compareTo(date1); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } else { |
| | | // 从旧到新,null排最前 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getCheckTime(); |
| | | String happenTime2 = o2.getCheckTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return -1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return 1; |
| | | } else { |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date1.compareTo(date2); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
| | |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.EditText; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.ImageRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityAnnualHealthStatusDetailBinding; |
| | | import com.application.zhangshi_app_android.databinding.ActivityCertificateOfHonorDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.hjq.bar.TitleBar; |
| | | import com.luck.picture.lib.entity.LocalMedia; |
| | | import com.luck.picture.lib.interfaces.OnResultCallbackListener; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.function.Consumer; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | public class AnnualHealthStatusDetailActivity extends DLBaseActivity<ActivityAnnualHealthStatusDetailBinding,AnnualHealthStatusDetailActivityViewModel> { |
| | | |
| | | private ImageRvAdapter adapter; |
| | | |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_annual_health_status_detail; |
| | |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | if (getIntent().hasExtra("bean")){ |
| | | viewModel.getBeanLiveData().setValue((AnnualHealthStatusBean) getIntent().getSerializableExtra("bean")); |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0 || type == 2){ |
| | | AnnualHealthStatusBean bean = (AnnualHealthStatusBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean !=null){ |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | setIsEdited(false); |
| | | View footerView = View.inflate(this,R.layout.item_image_footer,null); |
| | | binding.rvImage.addFooterView(footerView); |
| | | binding.rvImage.requestLayout(); |
| | | footerView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | UserManager.getInstance().selectImage(getSelfActivity(), 9, new OnResultCallbackListener<LocalMedia>() { |
| | | @Override |
| | | public void onResult(ArrayList<LocalMedia> result) { |
| | | if (result.size() == 0) return; |
| | | for (LocalMedia media : result) { |
| | | String path = media.getRealPath(); |
| | | File file = new File(path); |
| | | if (file.exists()) { |
| | | viewModel.uploadFile(file); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | adapter.setOnChildClickListener(R.id.iv_delete, new BaseRVAdapter.OnChildClickListener() { |
| | | @Override |
| | | public void onChildClick(RecyclerView recyclerView, View childView, int position) { |
| | | AnnualHealthStatusBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.remove(adapter.getItem(position)); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | adapter.removeItem(position); |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | }); |
| | | binding.rvImage.setAdapter(adapter); |
| | | |
| | | if (type == 1){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else if (type == 0){ |
| | | popupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate_delete,null)); |
| | | popupWindow.getContentView().findViewById(R.id.tv_modify).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | popupWindow.dismiss(); |
| | | } |
| | | }); |
| | | popupWindow.getContentView().findViewById(R.id.tv_delete).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | popupWindow.dismiss(); |
| | | new UIDialog.Builder(getSelfActivity()) |
| | | .setTitle("您确定要删除项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.delete(); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().postValue(false); |
| | | }else if (type == 2){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | } |
| | | binding.etTime.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | DatePicker picker = getDatePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | String date = String.format(Locale.CHINA, "%d-%02d-%02d", year, month, day); |
| | | binding.etTime.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this,bean -> { |
| | | if (bean!=null){ |
| | | String url = bean.getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | adapter.setData(Utils.splitString2List(bean.getUrl(),",")); |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }); |
| | | viewModel.getTypeLiveData().observe(this,operateType -> { |
| | | if (operateType){ |
| | | if (type == 1) { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.update(); |
| | | }); |
| | | } |
| | | adapter.setData(list); |
| | | binding.rvImage.getFooterViews().forEach(new Consumer<View>() { |
| | | @Override |
| | | public void accept(View view) { |
| | | view.setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | setIsEdited(true); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | binding.rvImage.getFooterViews().forEach(new Consumer<View>() { |
| | | @Override |
| | | public void accept(View view) { |
| | | view.setVisibility(View.GONE); |
| | | } |
| | | }); |
| | | setIsEdited(false); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public void setIsEdited(boolean isEdited){ |
| | | disableAllEditText(getContentView(),isEdited); |
| | | adapter.setIsEdited(isEdited); |
| | | } |
| | | public void disableAllEditText(ViewGroup viewGroup, boolean isEdited) { |
| | | for (int i = 0; i < viewGroup.getChildCount(); i++) { |
| | | View child = viewGroup.getChildAt(i); |
| | | if (child instanceof ViewGroup) { |
| | | disableAllEditText((ViewGroup) child,isEdited); |
| | | } else if (child instanceof EditText) { |
| | | child.setEnabled(isEdited); |
| | | child.setFocusable(isEdited); |
| | | child.setFocusableInTouchMode(isEdited); |
| | | if (!isEdited){ |
| | | child.clearFocus(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onLeftClick(TitleBar titleBar) { |
| | | finish(); |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.io.File; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import okhttp3.MediaType; |
| | | import okhttp3.MultipartBody; |
| | | import okhttp3.RequestBody; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | public class AnnualHealthStatusDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<AnnualHealthStatusBean> beanLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | |
| | | public AnnualHealthStatusDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | */ |
| | | public void add() { |
| | | System.out.println(beanLiveData.getValue()); |
| | | model.addAnnualHealthStatus(beanLiveData.getValue()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanLiveData.getValue()); |
| | | messageLiveData.postValue("添加成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除 |
| | | */ |
| | | public void delete() { |
| | | if (beanLiveData.getValue() == null){ |
| | | return; |
| | | } |
| | | model.deleteAnnualHealthStatus(String.valueOf(beanLiveData.getValue().getId())) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanLiveData.getValue()); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 修改 |
| | | */ |
| | | public void update() { |
| | | model.updateAnnualHealthStatus(beanLiveData.getValue()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanLiveData.getValue()); |
| | | messageLiveData.postValue("修改成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 上传电子文件 |
| | | */ |
| | | public void uploadFile(File file) { |
| | | RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | model.uploadFile(body) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<UploadFileResponseBean>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<UploadFileResponseBean> resultData) { |
| | | if (resultData.getCode() == CODE_SUCCESS){ |
| | | AnnualHealthStatusBean bean = beanLiveData.getValue(); |
| | | String url; |
| | | if (bean != null){ |
| | | url = bean.getUrl(); |
| | | if (url == null){ |
| | | url = resultData.getData().getUrl(); |
| | | }else { |
| | | url = url + "," + resultData.getData().getUrl(); |
| | | } |
| | | bean.setUrl(url); |
| | | beanLiveData.postValue(bean); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(resultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | public MutableLiveData<Boolean> getTypeLiveData() { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | } |
| | | return typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(MutableLiveData<Boolean> typeLiveData) { |
| | | this.typeLiveData = typeLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<AnnualHealthStatusBean> getBeanLiveData() { |
| | | if (beanLiveData == null) { |
| | | beanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (beanLiveData.getValue() == null){ |
| | | beanLiveData.setValue(new AnnualHealthStatusBean()); |
| | | } |
| | | return beanLiveData; |
| | | } |
| | | |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.text.TextUtils; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.CertificateOfHonorRvAdapter; |
| | | import com.application.zhangshi_app_android.databinding.ActivityCertificateOfHonorBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.hjq.bar.TitleBarSupport; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | public class CertificateOfHonorActivity extends DLBaseActivity<ActivityCertificateOfHonorBinding, CertificateOfHonorActivityViewModel> { |
| | | |
| | | private CertificateOfHonorRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | |
| | | private boolean isSearchLayoutVisible; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_certificate_of_honor; |
| | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.loadMoreFamilyAssets(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new CertificateOfHonorRvAdapter(this); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_12)); |
| | |
| | | itemDecoration.setFirstTop((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate,null)); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.layout_add).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.layout_select).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old).setOnClickListener(v -> { |
| | | viewModel.sortDataList(0); |
| | | mOperatePopupWindow.dismiss(); |
| | | }); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new).setOnClickListener(v -> { |
| | | viewModel.sortDataList(1); |
| | | mOperatePopupWindow.dismiss(); |
| | | }); |
| | | //点击弹出操作弹窗 |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | //点击放大镜按钮显示出搜索框 |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | //点击搜索框菜单下拉出 搜索参数 |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | if (!isSearchLayoutVisible){ |
| | | binding.layoutSearchParameter.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = binding.layoutSearchParameter.getMeasuredHeight(); |
| | | Utils.dropExpand(binding.containerSearchParameter,0, targetHeight); |
| | | isSearchLayoutVisible = true; |
| | | } |
| | | }); |
| | | //搜索参数layout添加空点击事件,防止点击它内部view时它后面的recycler还能响应点击事件 |
| | | binding.layoutSearchParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | } |
| | | }); |
| | | //点击搜索按钮进行搜索 |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getCertificateOfHonor(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | |
| | | } |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent event) { |
| | | float x = event.getX(); |
| | | float y = event.getY(); |
| | | if (isSearchLayoutVisible){ |
| | | if (!Utils.isPointInsideView(x, y, binding.layoutSearchParameter)) { |
| | | Utils.pullCollapse(binding.containerSearchParameter, binding.layoutSearchParameter.getMeasuredHeight(),0); |
| | | isSearchLayoutVisible = false; |
| | | return true; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(event); |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | viewModel.getHundredWish(); |
| | | viewModel.getCertificateOfHonor(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | viewModel.getDataListLiveData().observe(this, dataList -> { |
| | | adapter.setData(dataList); |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, list -> { |
| | | adapter.addData(list); |
| | | }); |
| | | } |
| | | @Override |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | | protected void dataFinish() { |
| | | super.dataFinish(); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | binding.refreshLayout.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | import android.text.TextUtils; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorBean; |
| | | import com.application.zhangshi_app_android.bean.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.CertificateOfHonorRequestBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class CertificateOfHonorActivityViewModel extends BaseViewModel<DataRepository> { |
| | | private MutableLiveData<List<CertificateOfHonorBean>> dataListLiveData; |
| | | private MutableLiveData<List<CertificateOfHonorBean>> moreListLiveData;//加载更多数据 |
| | | |
| | | private MutableLiveData<CertificateOfHonorRequestBean> requestBeanLiveData;//请求参数 |
| | | public CertificateOfHonorActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 获取数据 |
| | | */ |
| | | public void getCertificateOfHonor(){ |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new CertificateOfHonorRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | model.getCertificateOfHonor(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<CertificateOfHonorBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<CertificateOfHonorBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void loadMoreFamilyAssets(){ |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new CertificateOfHonorRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getCertificateOfHonor(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<CertificateOfHonorBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<CertificateOfHonorBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | messageLiveData.postValue("没有更多数据了"); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | moreListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | public MutableLiveData<List<CertificateOfHonorBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null) { |
| | | dataListLiveData = new MutableLiveData<>(); |
| | |
| | | return dataListLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<CertificateOfHonorRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new CertificateOfHonorRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<CertificateOfHonorRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public void setDataListLiveData(MutableLiveData<List<CertificateOfHonorBean>> dataListLiveData) { |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | public void getHundredWish() { |
| | | List<CertificateOfHonorBean> beans = new ArrayList<>(); |
| | | for (int i = 0; i < 10; i++) { |
| | | CertificateOfHonorBean bean = new CertificateOfHonorBean(); |
| | | bean.setName("荣誉证书" + i); |
| | | bean.setTime("2023-01-01"); |
| | | bean.setType("类别" + i); |
| | | bean.setCertificateNumber("证号" + i); |
| | | bean.setLevel("级别" + i); |
| | | bean.setEffectiveTime("2030-01-01"); |
| | | bean.setGetTime("2020-01-01"); |
| | | bean.setLocation("存放位置" + i); |
| | | bean.setRemark("备注"); |
| | | beans.add(bean); |
| | | public MutableLiveData<List<CertificateOfHonorBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | dataListLiveData.setValue(beans); |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<CertificateOfHonorBean>> moreListLiveData) { |
| | | this.moreListLiveData = moreListLiveData; |
| | | } |
| | | |
| | | public void sortDataList(int type){ |
| | | List<CertificateOfHonorBean> list = dataListLiveData.getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | System.out.println(dataListLiveData.getValue().size()); |
| | | if (type == 0) { |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getCreateTime(); |
| | | String happenTime2 = o2.getCreateTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return 1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return -1; |
| | | } else { |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date2.compareTo(date1); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } else if (type == 1) { |
| | | // 从旧到新,null排最前 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getCreateTime(); |
| | | String happenTime2 = o2.getCreateTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return -1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return 1; |
| | | } else { |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date1.compareTo(date2); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } |
| | | dataListLiveData.postValue(list); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.ImageRvAdapter; |
| | |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | binding.rvImage.setAdapter(adapter); |
| | | setIsEdited(false); |
| | | } |
| | | |
| | |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this,bean -> { |
| | | if (bean!=null){ |
| | | String url = bean.getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | adapter.setData(Utils.splitString2List(bean.getUrl(),",")); |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | import androidx.appcompat.app.AppCompatActivity; |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.Editable; |
| | | import android.text.TextWatcher; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.CleanStorageRvAdapter; |
| | | import com.application.zhangshi_app_android.adapter.LittleDoctorRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityCleanStorageBinding; |
| | | import com.application.zhangshi_app_android.databinding.ActivityLittleDoctorBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | |
| | | public class CleanStorageActivity extends DLBaseActivity<ActivityCleanStorageBinding, CleanStorageActivityViewModel> { |
| | | |
| | | private CleanStorageRvAdapter adapter; |
| | | private boolean isSearchLayoutVisible; |
| | | private PopupWindow mOperatePopupWindow; |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new CleanStorageRvAdapter(this); |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreCleanStorages(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new CleanStorageRvAdapter(this,viewModel); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_12)); |
| | | itemDecoration.setHorizontalSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | itemDecoration.setFirstTop((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate,null)); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.view_select_underline).setVisibility(View.GONE); |
| | | setOnClickListener( |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_add), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_select) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | //点击搜索框菜单下拉出 搜索参数 |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | if (!isSearchLayoutVisible){ |
| | | binding.layoutSearchParameter.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = binding.layoutSearchParameter.getMeasuredHeight(); |
| | | Utils.dropExpand(binding.containerSearchParameter,0,targetHeight); |
| | | isSearchLayoutVisible = true; |
| | | } |
| | | }); |
| | | //搜索参数layout添加空点击事件,防止点击它内部view时它后面的recycler还能响应点击事件 |
| | | binding.layoutSearchParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | } |
| | | }); |
| | | //点击搜索按钮进行搜索 |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getCleanStorages(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | //点击添加按钮跳转到创建家大事记页面 |
| | | binding.fabAdd.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity(new Intent(getSelfActivity(), CleanStorageDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | } |
| | | }); |
| | | |
| | | binding.etSearchId.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) { |
| | | int id = -1; |
| | | try { |
| | | id = Integer.parseInt(s.toString()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | if (id == -1){ |
| | | return; |
| | | } |
| | | viewModel.getRequestBeanLiveData().getValue().setId(id); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | viewModel.getDataListLiveData().observe(this, dataList -> { |
| | | adapter.setData(dataList); |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, checkList -> { |
| | | if (0 == viewModel.getOperateTypeLiveData().getValue()){ |
| | | return; |
| | | } |
| | | if (checkList.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, moreList -> { |
| | | adapter.addData(moreList); |
| | | }); |
| | | viewModel.getOperateTypeLiveData().observe(this, integer -> { |
| | | if (integer == 0){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_operate); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | adapter.setCheckable(false); |
| | | }else if (integer == 1){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_operate_finish); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.getOperateTypeLiveData().postValue(0); |
| | | }); |
| | | adapter.setCheckable(true); |
| | | }else if (integer == 2){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_delete_white); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | new UIDialog.Builder(this) |
| | | .setTitle("您确定要删除选中的项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteCheckList(); |
| | | } |
| | | }) |
| | | .show(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | viewModel.getFinishDeleteListLiveData().observe(this, beans -> { |
| | | for (CleanStorageBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | |
| | | //观察数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据进行刷新 |
| | | RxBus.getInstance().toObservable(this, CleanStorageBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getCleanStorages(); |
| | | }); |
| | | } |
| | | @Override |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | | protected void dataFinish() { |
| | | super.dataFinish(); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | binding.refreshLayout.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | @Override |
| | | public void onClick(View v) { |
| | | int id = v.getId(); |
| | | if (id == R.id.tv_add){ |
| | | AppManager.getAppManager().startActivity(new Intent(this, CleanStorageDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | mOperatePopupWindow.dismiss(); |
| | | }else if (id == R.id.tv_select){ |
| | | viewModel.getOperateTypeLiveData().postValue(1); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent event) { |
| | | float x = event.getX(); |
| | | float y = event.getY(); |
| | | if (isSearchLayoutVisible){ |
| | | if (!Utils.isPointInsideView(x, y, binding.layoutSearchParameter)) { |
| | | Utils.pullCollapse(binding.containerSearchParameter, binding.layoutSearchParameter.getMeasuredHeight(),0); |
| | | isSearchLayoutVisible = false; |
| | | return true; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(event); |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.LiveData; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageRequestBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class CleanStorageActivityViewModel extends BaseViewModel<DataRepository> { |
| | | private MutableLiveData<List<CleanStorageBean>> dataListLiveData; |
| | | private MutableLiveData<List<CleanStorageBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<CleanStorageBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<CleanStorageRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<CleanStorageBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//操作类型 0 选择操作 1.完成 2.删除 |
| | | |
| | | public CleanStorageActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 获取数据 |
| | | */ |
| | | public void getCleanStorages() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new CleanStorageRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | model.getCleanStorages(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<CleanStorageBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<CleanStorageBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreCleanStorages() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new CleanStorageRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getCleanStorages(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<CleanStorageBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<CleanStorageBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | messageLiveData.postValue("没有更多数据了"); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | moreListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除多选选中的数据 |
| | | */ |
| | | public void deleteCheckList() { |
| | | List<CleanStorageBean> deleteList = getCheckListLiveData().getValue(); |
| | | if (deleteList == null){ |
| | | return; |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | | deleteList.forEach(CleanStorageBean -> sb.append(CleanStorageBean.getId()).append(",")); |
| | | sb.deleteCharAt(sb.length()-1); |
| | | model.deleteCleanStorages(sb.toString()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | finishDeleteListLiveData.postValue(checkListLiveData.getValue()); |
| | | messageLiveData.postValue("删除成功"); |
| | | getCheckListLiveData().postValue(new ArrayList<>()); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除单个数据 |
| | | */ |
| | | public void deleteItem(CleanStorageBean CleanStorageBean) { |
| | | model.deleteCleanStorages(String.valueOf(CleanStorageBean.getId())) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | List<CleanStorageBean> list = new ArrayList<>(); |
| | | list.add(CleanStorageBean); |
| | | finishDeleteListLiveData.postValue(list); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public MutableLiveData<List<CleanStorageBean>> getCheckListLiveData() { |
| | | if (checkListLiveData==null){ |
| | | checkListLiveData = new MutableLiveData<>(); |
| | | checkListLiveData.postValue(new ArrayList<>()); |
| | | } |
| | | if (checkListLiveData.getValue() == null){ |
| | | checkListLiveData.postValue(new ArrayList<>()); |
| | | } |
| | | return checkListLiveData; |
| | | } |
| | | |
| | | public void setCheckListLiveData(MutableLiveData<List<CleanStorageBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<CleanStorageRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new CleanStorageRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<CleanStorageRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<CleanStorageBean>> getDataListLiveData() { |
| | |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | public void getCleanStorages() { |
| | | List<CleanStorageBean> cleanStorageBeans = new ArrayList<>(); |
| | | cleanStorageBeans.add(new CleanStorageBean(1,"保洁","全体","玻璃窗","玻璃水洗","杂物房","窗户","擦干",null)); |
| | | cleanStorageBeans.add(new CleanStorageBean(1,"保洁","全体","玻璃窗","玻璃水洗","杂物房","窗户","擦干",null)); |
| | | cleanStorageBeans.add(new CleanStorageBean(1,"保洁","全体","玻璃窗","玻璃水洗","杂物房","窗户","擦干",null)); |
| | | cleanStorageBeans.add(new CleanStorageBean(1,"保洁","全体","玻璃窗","玻璃水洗","杂物房","窗户","擦干",null)); |
| | | dataListLiveData.setValue(cleanStorageBeans); |
| | | @NonNull |
| | | public MutableLiveData<List<CleanStorageBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<CleanStorageBean>> moreListLiveData) { |
| | | this.moreListLiveData = moreListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<Integer> getOperateTypeLiveData() { |
| | | if (operateTypeLiveData == null){ |
| | | operateTypeLiveData = new MutableLiveData<>(); |
| | | operateTypeLiveData.setValue(0); |
| | | } |
| | | return operateTypeLiveData; |
| | | } |
| | | |
| | | public void setOperateTypeLiveData(MutableLiveData<Integer> operateTypeLiveData) { |
| | | this.operateTypeLiveData = operateTypeLiveData; |
| | | } |
| | | |
| | | public LiveData<List<CleanStorageBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<CleanStorageBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import androidx.appcompat.app.AppCompatActivity; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.EditText; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.ImageRvAdapter; |
| | |
| | | import com.application.zhangshi_app_android.databinding.ActivityCleanStorageDetailBinding; |
| | | import com.application.zhangshi_app_android.databinding.ActivityLittleDoctorDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.luck.picture.lib.entity.LocalMedia; |
| | | import com.luck.picture.lib.interfaces.OnResultCallbackListener; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.function.Consumer; |
| | | |
| | | public class CleanStorageDetailActivity extends DLBaseActivity<ActivityCleanStorageDetailBinding,CleanStorageDetailActivityViewModel> { |
| | | |
| | | private ImageRvAdapter adapter; |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | if (getIntent().hasExtra("bean")){ |
| | | viewModel.getBeanLiveData().setValue((CleanStorageBean) getIntent().getSerializableExtra("bean")); |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0 || type == 2){ |
| | | CleanStorageBean bean = (CleanStorageBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean !=null){ |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | setIsEdited(false); |
| | | View footerView = View.inflate(this,R.layout.item_image_footer,null); |
| | | binding.rvImage.addFooterView(footerView); |
| | | binding.rvImage.requestLayout(); |
| | | footerView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | UserManager.getInstance().selectImage(getSelfActivity(), 9, new OnResultCallbackListener<LocalMedia>() { |
| | | @Override |
| | | public void onResult(ArrayList<LocalMedia> result) { |
| | | if (result.size() == 0) return; |
| | | for (LocalMedia media : result) { |
| | | String path = media.getRealPath(); |
| | | File file = new File(path); |
| | | if (file.exists()) { |
| | | viewModel.uploadFile(file); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | adapter.setOnChildClickListener(R.id.iv_delete, new BaseRVAdapter.OnChildClickListener() { |
| | | @Override |
| | | public void onChildClick(RecyclerView recyclerView, View childView, int position) { |
| | | CleanStorageBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.remove(adapter.getItem(position)); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | adapter.removeItem(position); |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | }); |
| | | binding.rvImage.setAdapter(adapter); |
| | | |
| | | if (type == 1){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else if (type == 0){ |
| | | popupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate_delete,null)); |
| | | popupWindow.getContentView().findViewById(R.id.tv_modify).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | popupWindow.dismiss(); |
| | | } |
| | | }); |
| | | popupWindow.getContentView().findViewById(R.id.tv_delete).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | popupWindow.dismiss(); |
| | | new UIDialog.Builder(getSelfActivity()) |
| | | .setTitle("您确定要删除项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.delete(); |
| | | } |
| | | }) |
| | | .show(); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().postValue(false); |
| | | }else if (type == 2){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this,bean -> { |
| | | if (bean!=null){ |
| | | String url = bean.getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | adapter.setData(Utils.splitString2List(bean.getUrl(),",")); |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }); |
| | | viewModel.getTypeLiveData().observe(this,operateType -> { |
| | | if (operateType){ |
| | | if (type == 1) { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.update(); |
| | | }); |
| | | } |
| | | adapter.setData(list); |
| | | binding.rvImage.getFooterViews().forEach(new Consumer<View>() { |
| | | @Override |
| | | public void accept(View view) { |
| | | view.setVisibility(View.VISIBLE); |
| | | } |
| | | }); |
| | | setIsEdited(true); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | binding.rvImage.getFooterViews().forEach(new Consumer<View>() { |
| | | @Override |
| | | public void accept(View view) { |
| | | view.setVisibility(View.GONE); |
| | | } |
| | | }); |
| | | setIsEdited(false); |
| | | } |
| | | }); |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.io.File; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import okhttp3.MediaType; |
| | | import okhttp3.MultipartBody; |
| | | import okhttp3.RequestBody; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | public class CleanStorageDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<CleanStorageBean> beanLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | |
| | | public CleanStorageDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 增加保洁收纳 |
| | | */ |
| | | public void add() { |
| | | model.addCleanStorage(beanLiveData.getValue()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanLiveData.getValue()); |
| | | messageLiveData.postValue("添加成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除保洁收纳 |
| | | */ |
| | | public void delete() { |
| | | if (beanLiveData.getValue() == null){ |
| | | return; |
| | | } |
| | | model.deleteLittleDoctors(String.valueOf(beanLiveData.getValue().getId())) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanLiveData.getValue()); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 修改小医生 |
| | | */ |
| | | public void update() { |
| | | model.updateCleanStorage(beanLiveData.getValue()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanLiveData.getValue()); |
| | | messageLiveData.postValue("修改成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 上传电子文件 |
| | | */ |
| | | public void uploadFile(File file) { |
| | | RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | model.uploadFile(body) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<UploadFileResponseBean>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<UploadFileResponseBean> resultData) { |
| | | if (resultData.getCode() == CODE_SUCCESS){ |
| | | CleanStorageBean bean = beanLiveData.getValue(); |
| | | String url; |
| | | if (bean != null){ |
| | | url = bean.getUrl(); |
| | | if (url == null){ |
| | | url = resultData.getData().getUrl(); |
| | | }else { |
| | | url = url + "," + resultData.getData().getUrl(); |
| | | } |
| | | bean.setUrl(url); |
| | | beanLiveData.postValue(bean); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(resultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public MutableLiveData<Boolean> getTypeLiveData() { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | } |
| | | return typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(MutableLiveData<Boolean> typeLiveData) { |
| | | this.typeLiveData = typeLiveData; |
| | | } |
| | | public MutableLiveData<CleanStorageBean> getBeanLiveData() { |
| | | if (beanLiveData == null) { |
| | | beanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (beanLiveData.getValue() == null){ |
| | | beanLiveData.setValue(new CleanStorageBean()); |
| | | } |
| | | return beanLiveData; |
| | | } |
| | | |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.PopupWindow; |
| | |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.R; |
| | | |
| | |
| | | public class ContactsActivity extends DLBaseActivity<ActivityContactsBinding,ContactsActivityViewModel> { |
| | | private ContactsRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | private boolean isSearchLayoutVisible; |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_contacts; |
| | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.loadMoreContacts(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new ContactsRvAdapter(this); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_12)); |
| | |
| | | itemDecoration.setFirstTop((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_contacts_import,null)); |
| | | |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.layout_contacts_import).setOnClickListener(v -> { |
| | | mOperatePopupWindow.dismiss(); |
| | | //TODO 导入通讯录 |
| | | }); |
| | | //点击弹出操作弹窗 |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | //点击放大镜按钮显示出搜索框 |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | //点击搜索框菜单下拉出 搜索参数 |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | if (!isSearchLayoutVisible){ |
| | | binding.layoutSearchParameter.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = binding.layoutSearchParameter.getMeasuredHeight(); |
| | | Utils.dropExpand(binding.containerSearchParameter,0, targetHeight); |
| | | isSearchLayoutVisible = true; |
| | | } |
| | | }); |
| | | //搜索参数layout添加空点击事件,防止点击它内部view时它后面的recycler还能响应点击事件 |
| | | binding.layoutSearchParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | } |
| | | }); |
| | | //点击搜索按钮进行搜索 |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getContacts(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent event) { |
| | | float x = event.getX(); |
| | | float y = event.getY(); |
| | | if (isSearchLayoutVisible){ |
| | | if (!Utils.isPointInsideView(x, y, binding.layoutSearchParameter)) { |
| | | Utils.pullCollapse(binding.containerSearchParameter, binding.layoutSearchParameter.getMeasuredHeight(),0); |
| | | isSearchLayoutVisible = false; |
| | | return true; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(event); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | adapter.setData(list); |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, list -> { |
| | | //已经有名字的,直接添加到对应的名字下面 |
| | | //没有名字的,新建一个名字,添加到对应的名字下面 |
| | | List<ContactsBean> data = adapter.getData(); |
| | | List<ContactsDetailBean> newData = new ArrayList<>(); |
| | | Set<String> maNames = new HashSet<>(); |
| | | for (ContactsDetailBean contactsDetailBean : list) { |
| | | boolean isAdd = false; |
| | | for (ContactsBean bean : data) { |
| | | if (contactsDetailBean.getMyName().equals(bean.getMyName())) { |
| | | bean.getContactsDetailBeans().add(contactsDetailBean); |
| | | isAdd = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!isAdd) { |
| | | maNames.add(contactsDetailBean.getMyName()); |
| | | newData.add(contactsDetailBean); |
| | | } |
| | | } |
| | | for (String name : maNames) { |
| | | ContactsBean bean = new ContactsBean(); |
| | | bean.setMyName(name); |
| | | List<ContactsDetailBean> detailBeans = new ArrayList<>(); |
| | | for (ContactsDetailBean detailBean : list) { |
| | | if (name.equals(detailBean.getMyName())) { |
| | | detailBeans.add(detailBean); |
| | | } |
| | | } |
| | | bean.setContactsDetailBeans(detailBeans); |
| | | adapter.addItem(bean); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | super.onClick(v); |
| | | if (v.getId() == R.id.layout_contacts_import){ |
| | | mOperatePopupWindow.dismiss(); |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | | protected void dataFinish() { |
| | | super.dataFinish(); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | binding.refreshLayout.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | } |
| | |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | |
| | | import com.application.zhangshi_app_android.bean.ContactsRequestBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | |
| | | /** |
| | | * @author Gss |
| | |
| | | |
| | | private MutableLiveData<ContactsRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<ContactsDetailBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<List<ContactsDetailBean>> moreListLiveData;//加载更多数据 |
| | | |
| | | |
| | | public ContactsActivityViewModel(@NonNull Application application) { |
| | |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取通讯录 |
| | | */ |
| | | public void getContacts(){ |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new ContactsRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | model.getContacts(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<ContactsResponseBean>>() { |
| | | .subscribe(new Observer<ResultData<PageResponseBean<ContactsDetailBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<ContactsResponseBean> data) { |
| | | public void onNext(ResultData<PageResponseBean<ContactsDetailBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void loadMoreContacts(){ |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new ContactsRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getContacts(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<ContactsDetailBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<ContactsDetailBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | messageLiveData.postValue("没有更多数据了"); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | moreListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | public MutableLiveData<List<ContactsDetailBean>> getDataListLiveData() { |
| | |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<ContactsDetailBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<ContactsDetailBean>> moreListLiveData) { |
| | | this.moreListLiveData = moreListLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<ContactsRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.text.Editable; |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.databinding.library.baseAdapters.BR; |
| | | |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.FamilyAssetsRvAdapter; |
| | | import com.application.zhangshi_app_android.databinding.ActivityFamilyAssetsBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.03. 19:40 |
| | | * @desc |
| | | * @desc 家庭资产 |
| | | */ |
| | | public class FamilyAssetsActivity extends DLBaseActivity<ActivityFamilyAssetsBinding,FamilyAssetsActivityViewModel> { |
| | | |
| | |
| | | private FamilyAssetsRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | |
| | | private boolean isSearchLayoutVisible; |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | // viewModel.getMoreFamilyMemorabilia(); |
| | | viewModel.loadMoreFamilyAssets(); |
| | | }); |
| | | |
| | | //recyclerView适配器 |
| | | adapter = new FamilyAssetsRvAdapter(this); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_12)); |
| | |
| | | itemDecoration.setFirstTop((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate,null)); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.layout_add).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.layout_select).setVisibility(View.GONE); |
| | |
| | | viewModel.sortDataList(1); |
| | | mOperatePopupWindow.dismiss(); |
| | | }); |
| | | //点击弹出操作弹窗 |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | //点击放大镜按钮显示出搜索框 |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | //点击搜索框菜单下拉出 搜索参数 |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | if (!isSearchLayoutVisible){ |
| | | binding.layoutSearchParameter.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = binding.layoutSearchParameter.getMeasuredHeight(); |
| | | Utils.dropExpand(binding.containerSearchParameter,0, targetHeight); |
| | | isSearchLayoutVisible = true; |
| | | } |
| | | }); |
| | | //搜索参数layout添加空点击事件,防止点击它内部view时它后面的recycler还能响应点击事件 |
| | | binding.layoutSearchParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | } |
| | | }); |
| | | //点击搜索按钮进行搜索 |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getFamilyAssets(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | |
| | | binding.etStartTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etEndTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etEndTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etStartTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etStartTime.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择开始时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | //以yyyy-MM-dd的格式显示,月日小于10时前面补0 |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etEndTime.getText().toString().isEmpty()){ |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | } |
| | | }); |
| | | binding.etEndTime.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择结束时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etStartTime.getText().toString().isEmpty()){ |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | } |
| | | }); |
| | | binding.ivTimeClear.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | binding.etStartTime.setText(""); |
| | | binding.etEndTime.setText(""); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent event) { |
| | | float x = event.getX(); |
| | | float y = event.getY(); |
| | | if (isSearchLayoutVisible){ |
| | | if (!Utils.isPointInsideView(x, y, binding.layoutSearchParameter)) { |
| | | Utils.pullCollapse(binding.containerSearchParameter, binding.layoutSearchParameter.getMeasuredHeight(),0); |
| | | isSearchLayoutVisible = false; |
| | | return true; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(event); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initData() { |
| | |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getDataListLiveData().observe(this, familyAssetsBeans -> { |
| | | adapter.setData(familyAssetsBeans); |
| | | viewModel.getDataListLiveData().observe(this, list -> { |
| | | adapter.setData(list); |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, list -> { |
| | | adapter.addData(list); |
| | | }); |
| | | } |
| | | public PopupWindow initPopUpWindow(View view){ |
| | | PopupWindow popupWindow = new PopupWindow(this); |
| | | // 设置布局文件 |
| | | popupWindow.setContentView(view); |
| | | // 为了避免部分机型不显示,需要重新设置一下宽高 |
| | | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | // 设置pop透明效果 |
| | | popupWindow.setBackgroundDrawable(new ColorDrawable(0x0000)); |
| | | // 设置pop出入动画 |
| | | popupWindow.setAnimationStyle(com.android.app_base.R.style.pop_operate); |
| | | // 设置pop获取焦点,如果为false点击返回按钮会退出当前Activity,如果pop中有Editor的话,focusable必须要为true |
| | | popupWindow.setFocusable(true); |
| | | // 设置pop可点击,为false点击事件无效,默认为true |
| | | popupWindow.setTouchable(true); |
| | | // 设置点击pop外侧消失,默认为false;在focusable为true时点击外侧始终消失 |
| | | popupWindow.setOutsideTouchable(false); |
| | | return popupWindow; |
| | | |
| | | @Override |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | | protected void dataFinish() { |
| | | super.dataFinish(); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | binding.refreshLayout.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | } |
| | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | import android.text.TextUtils; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsResponseBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsRequestBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc |
| | | */ |
| | | public class FamilyAssetsActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<List<FamilyAssetsBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<FamilyAssetsBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<List<FamilyAssetsBean>> moreListLiveData;//加载更多数据 |
| | | |
| | | private MutableLiveData<FamilyAssetsRequestBean> requestBeanLiveData;//请求参数 |
| | | |
| | | public FamilyAssetsActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取家庭资产 |
| | | */ |
| | | public void getFamilyAssets(){ |
| | | model.getFamilyAssets(new HashMap<>()) |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new FamilyAssetsRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | model.getFamilyAssets(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<FamilyAssetsResponseBean>>() { |
| | | .subscribe(new Observer<ResultData<PageResponseBean<FamilyAssetsBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<FamilyAssetsResponseBean> data) { |
| | | public void onNext(ResultData<PageResponseBean<FamilyAssetsBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | |
| | | }); |
| | | } |
| | | |
| | | public MutableLiveData<List<FamilyAssetsBean>> getCheckListLiveData() { |
| | | return checkListLiveData; |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void loadMoreFamilyAssets(){ |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new FamilyAssetsRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getFamilyAssets(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<FamilyAssetsBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | public void setCheckListLiveData(MutableLiveData<List<FamilyAssetsBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<FamilyAssetsBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | messageLiveData.postValue("没有更多数据了"); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | moreListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | public MutableLiveData<List<FamilyAssetsBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null){ |
| | |
| | | return dataListLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<FamilyAssetsRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new FamilyAssetsRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<FamilyAssetsRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public void setDataListLiveData(MutableLiveData<List<FamilyAssetsBean>> dataListLiveData) { |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<FamilyAssetsBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<FamilyAssetsBean>> moreListLiveData) { |
| | | this.moreListLiveData = moreListLiveData; |
| | | } |
| | | |
| | | public void sortDataList(int type){ |
| | |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | |
| | | list.sort(new Comparator<FamilyAssetsBean>() { |
| | | @Override |
| | | public int compare(FamilyAssetsBean o1, FamilyAssetsBean o2) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", java.util.Locale.getDefault()); |
| | | Date date1 = null; |
| | | Date date2 = null; |
| | | try { |
| | | date1 = format.parse(o1.getCreateTime()); |
| | | date2 = format.parse(o2.getCreateTime()); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (date1 != null && date2 != null) { |
| | | System.out.println(dataListLiveData.getValue().size()); |
| | | if (type == 0){ |
| | | return date2.compareTo(date1); |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getHappenTime(); |
| | | String happenTime2 = o2.getHappenTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return 1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return -1; |
| | | }else { |
| | | return date1.compareTo(date2); |
| | | } |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date2.compareTo(date1); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } else if (type == 1) { |
| | | // 从旧到新,null排最前 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getHappenTime(); |
| | | String happenTime2 = o2.getHappenTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return -1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return 1; |
| | | } else { |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date1.compareTo(date2); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } |
| | | dataListLiveData.postValue(list); |
| | | } |
| | | |
| | |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.ImageRvAdapter; |
| | | import com.application.zhangshi_app_android.adapter.MemoRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityFamilyAssetsDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | |
| | | */ |
| | | public class FamilyAssetsDetailActivity extends DLBaseActivity<ActivityFamilyAssetsDetailBinding,FamilyAssetsDetailActivityViewModel> { |
| | | private ImageRvAdapter adapter; |
| | | |
| | | private MemoRvAdapter memoRvAdapter; |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | binding.rvImage.setAdapter(adapter); |
| | | |
| | | memoRvAdapter = new MemoRvAdapter(this); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace(ScreenSizeUtils.dip2px(this, 15)); |
| | | binding.rvMemo.addItemDecoration(itemDecoration); |
| | | binding.rvMemo.setAdapter(memoRvAdapter); |
| | | |
| | | setIsEdited(false); |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | |
| | | viewModel.getMemos(); |
| | | } |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this,bean -> { |
| | | if (bean!=null){ |
| | | if (getTitleBar() != null){ |
| | | getTitleBar().setTitle(bean.getHolder() + "的" + bean.getType()); |
| | | adapter.setData(Utils.splitString2List(bean.getUrl(),",")); |
| | | } |
| | | String url = bean.getUrl(); |
| | | if (url == null||url.isEmpty()){ |
| | | return; |
| | | } |
| | | List<String> list; |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | list = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | list = new ArrayList<>(); |
| | | list.add(url); |
| | | } |
| | | adapter.setData(list); |
| | | }); |
| | | viewModel.getMemoListLiveData().observe(this, memoBeans -> { |
| | | if (memoBeans!=null){ |
| | | memoRvAdapter.setData(memoBeans); |
| | | } |
| | | }); |
| | | } |
| | |
| | | public void setIsEdited(boolean isEdited){ |
| | | disableAllEditText(getContentView(),isEdited); |
| | | adapter.setIsEdited(isEdited); |
| | | memoRvAdapter.setEdited(isEdited); |
| | | } |
| | | public void disableAllEditText(ViewGroup viewGroup, boolean isEdited) { |
| | | for (int i = 0; i < viewGroup.getChildCount(); i++) { |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.application.zhangshi_app_android.bean.CaptchaImageBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class FamilyAssetsDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | private MutableLiveData<FamilyAssetsBean> beanLiveData; |
| | | private MutableLiveData<List<MemoBean>> memoListLiveData; |
| | | |
| | | public MutableLiveData<FamilyAssetsBean> getBeanLiveData() { |
| | | if (beanLiveData == null){ |
| | |
| | | super(application); |
| | | } |
| | | |
| | | public MutableLiveData<List<MemoBean>> getMemoListLiveData() { |
| | | if (memoListLiveData == null){ |
| | | memoListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return memoListLiveData; |
| | | } |
| | | |
| | | public void setMemoListLiveData(MutableLiveData<List<MemoBean>> memoListLiveData) { |
| | | this.memoListLiveData = memoListLiveData; |
| | | } |
| | | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取备忘录 |
| | | */ |
| | | public void getMemos() { |
| | | if (beanLiveData.getValue() == null) { |
| | | return; |
| | | } |
| | | model.getMemos(BaseConfig.MEMO_FID_FAMILY_ASSETS+"", String.valueOf(beanLiveData.getValue().getId())) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<List<MemoBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<List<MemoBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | memoListLiveData.postValue(data.getData()); |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.content.Intent; |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.view.KeyEvent; |
| | | import android.view.LayoutInflater; |
| | | import android.text.Editable; |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.inputmethod.EditorInfo; |
| | | import android.widget.PopupWindow; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.databinding.DataBindingUtil; |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.FamilyMemorabiliaRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityFamilyMemorabiliaBinding; |
| | | import com.application.zhangshi_app_android.databinding.PopSearchBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.functions.Consumer; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | |
| | | FamilyMemorabiliaRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | private PopupWindow mSearchPopupWindow; |
| | | private PopSearchBinding mSearchPopBinding; |
| | | private boolean isSearchLayoutVisible; |
| | | private int dateType; //0:开始时间 1:结束时间 |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreFamilyMemorabilia(); |
| | | }); |
| | | |
| | | //recyclerView适配器 |
| | | adapter = new FamilyMemorabiliaRvAdapter(this,viewModel); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_12)); |
| | | itemDecoration.setHorizontalSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | itemDecoration.setFirstTop((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | |
| | | mSearchPopBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.pop_search, null, false); |
| | | mSearchPopBinding.setViewModel(viewModel); |
| | | mSearchPopupWindow = initPopUpWindow(mSearchPopBinding.getRoot()); |
| | | |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate,null)); |
| | | |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | hideSoftKeyboard(); |
| | | mSearchPopupWindow.setWidth(binding.layoutSearch.getMeasuredWidth()); |
| | | mSearchPopupWindow.showAsDropDown(binding.layoutSearch,0,0); |
| | | }); |
| | | |
| | | binding.etSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() { |
| | | @Override |
| | | public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { |
| | | if ((actionId == EditorInfo.IME_ACTION_UNSPECIFIED || actionId == EditorInfo.IME_ACTION_SEARCH) |
| | | && event != null) { |
| | | viewModel.getFamilyMemorabilia(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | }); |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getFamilyMemorabilia(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | mSearchPopupWindow.dismiss(); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | binding.fabAdd.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity(new Intent(getSelfActivity(),CreateFamilyProjectActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | } |
| | | }); |
| | | |
| | | setOnClickListener( |
| | | mSearchPopupWindow.getContentView().findViewById(R.id.iv_clear_person), |
| | | mSearchPopupWindow.getContentView().findViewById(R.id.iv_clear_place), |
| | | mSearchPopupWindow.getContentView().findViewById(R.id.iv_clear_time), |
| | | mSearchPopupWindow.getContentView().findViewById(R.id.iv_clear_title), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_add), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_select), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | //点击搜索框菜单下拉出 搜索参数 |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | if (!isSearchLayoutVisible){ |
| | | binding.layoutSearchParameter.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = binding.layoutSearchParameter.getMeasuredHeight(); |
| | | Utils.pullCollapse(binding.containerSearchParameter,0,targetHeight); |
| | | isSearchLayoutVisible = true; |
| | | } |
| | | }); |
| | | //搜索参数layout添加空点击事件,防止点击它内部view时它后面的recycler还能响应点击事件 |
| | | binding.layoutSearchParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | } |
| | | }); |
| | | //点击搜索按钮进行搜索 |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getFamilyMemorabilia(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | //点击添加按钮跳转到创建家大事记页面 |
| | | binding.fabAdd.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity(new Intent(getSelfActivity(), FamilyMemorabiliaDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | } |
| | | }); |
| | | binding.etStartTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etEndTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etEndTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etStartTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etStartTime.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择开始时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | //以yyyy-MM-dd的格式显示,月日小于10时前面补0 |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etEndTime.getText().toString().isEmpty()){ |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | } |
| | | }); |
| | | binding.etEndTime.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择结束时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etStartTime.getText().toString().isEmpty()){ |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | } |
| | | }); |
| | | binding.ivTimeClear.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | binding.etStartTime.setText(""); |
| | | binding.etEndTime.setText(""); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent event) { |
| | | float x = event.getX(); |
| | | float y = event.getY(); |
| | | if (isSearchLayoutVisible){ |
| | | if (!Utils.isPointInsideView(x, y, binding.layoutSearchParameter)) { |
| | | Utils.pullCollapse(binding.containerSearchParameter, binding.layoutSearchParameter.getMeasuredHeight(),0); |
| | | isSearchLayoutVisible = false; |
| | | return true; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(event); |
| | | } |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getDataListLiveData().observe(this, new Observer<List<FamilyMemorabiliaBean>>() { |
| | | @Override |
| | | public void onChanged(List<FamilyMemorabiliaBean> familyMemorabiliaBeans) { |
| | | adapter.setData(familyMemorabiliaBeans); |
| | | } |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, new Observer<List<FamilyMemorabiliaBean>>() { |
| | | @Override |
| | | public void onChanged(List<FamilyMemorabiliaBean> familyMemorabiliaBeans) { |
| | |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getDataListLiveData().observe(this, new Observer<List<FamilyMemorabiliaBean>>() { |
| | | @Override |
| | | public void onChanged(List<FamilyMemorabiliaBean> familyMemorabiliaBeans) { |
| | | adapter.setData(familyMemorabiliaBeans); |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, new Observer<List<FamilyMemorabiliaBean>>() { |
| | |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_delete_white); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | new UIDialog.Builder(this) |
| | | .setTitle("您确定要删除项目吗") |
| | | .setTitle("您确定要删除选中的项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.delete(); |
| | | viewModel.deleteCheckList(); |
| | | } |
| | | }) |
| | | .show(); |
| | | }); |
| | | } |
| | | }); |
| | | viewModel.getFinishDeleteListLiveData().observe(this, beans -> { |
| | | for (FamilyMemorabiliaBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | //观察家大事记数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据 |
| | | RxBus.getInstance().toObservable(this, FamilyMemorabiliaBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getFamilyMemorabilia(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | public PopupWindow initPopUpWindow(View view){ |
| | | PopupWindow popupWindow = new PopupWindow(this); |
| | | // 设置布局文件 |
| | | popupWindow.setContentView(view); |
| | | // 为了避免部分机型不显示,需要重新设置一下宽高 |
| | | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | // 设置pop透明效果 |
| | | popupWindow.setBackgroundDrawable(new ColorDrawable(0x0000)); |
| | | // 设置pop出入动画 |
| | | popupWindow.setAnimationStyle(com.android.app_base.R.style.pop_operate); |
| | | // // 设置pop获取焦点,如果为false点击返回按钮会退出当前Activity,如果pop中有Editor的话,focusable必须要为true |
| | | popupWindow.setFocusable(true); |
| | | // // 设置pop可点击,为false点击事件无效,默认为true |
| | | popupWindow.setTouchable(true); |
| | | // 设置点击pop外侧消失,默认为false;在focusable为true时点击外侧始终消失 |
| | | popupWindow.setOutsideTouchable(false); |
| | | return popupWindow; |
| | | } |
| | | |
| | | @Override |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | binding.recyclerView.setVisibility(View.GONE); |
| | | binding.refreshLayout.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | binding.recyclerView.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | |
| | | public void onClick(View v) { |
| | | int id = v.getId(); |
| | | if (id == R.id.tv_add){ |
| | | AppManager.getAppManager().startActivity(new Intent(this,CreateFamilyProjectActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | AppManager.getAppManager().startActivity(new Intent(this, FamilyMemorabiliaDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | }else if (id == R.id.tv_select){ |
| | | viewModel.getOperateTypeLiveData().postValue(1); |
| | | mOperatePopupWindow.dismiss(); |
| | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mSearchPopupWindow != null){ |
| | | mSearchPopupWindow.dismiss(); |
| | | } |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | import android.text.TextUtils; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.LiveData; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaRequestBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaResponseBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | |
| | | |
| | | private MutableLiveData<List<FamilyMemorabiliaBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<FamilyMemorabiliaBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//操作类型 0 选择操作 1.完成 2.删除 |
| | | |
| | | private MutableLiveData<FamilyMemorabiliaRequestBean> requestBeanMutableLiveData;//请求参数 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//右上角操作框 操作类型 0 弹出选择操作 1.完成 2.删除 |
| | | private MutableLiveData<FamilyMemorabiliaRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<FamilyMemorabiliaBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<List<FamilyMemorabiliaBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | public FamilyMemorabiliaActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | |
| | | * 获取家大事记 |
| | | */ |
| | | public void getFamilyMemorabilia() { |
| | | System.out.println(getRequestBeanMutableLiveData().getValue()); |
| | | model.getFamilyMemorabilia(getRequestBeanMutableLiveData().getValue().getMap()) |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new FamilyMemorabiliaRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | model.getFamilyMemorabilia(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<FamilyMemorabiliaResponseBean>>() { |
| | | .subscribe(new Observer<ResultData<PageResponseBean<FamilyMemorabiliaBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<FamilyMemorabiliaResponseBean> data) { |
| | | public void onNext(ResultData<PageResponseBean<FamilyMemorabiliaBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | |
| | | }); |
| | | } |
| | | /** |
| | | * 获取家大事记 加载更多 |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreFamilyMemorabilia() { |
| | | requestBeanMutableLiveData.getValue().setPageNum(requestBeanMutableLiveData.getValue().getPageNum() + 1); |
| | | model.getFamilyMemorabilia(getRequestBeanMutableLiveData().getValue().getMap()) |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new FamilyMemorabiliaRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getFamilyMemorabilia(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<FamilyMemorabiliaResponseBean>>() { |
| | | .subscribe(new Observer<ResultData<PageResponseBean<FamilyMemorabiliaBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<FamilyMemorabiliaResponseBean> data) { |
| | | public void onNext(ResultData<PageResponseBean<FamilyMemorabiliaBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | messageLiveData.postValue("没有更多数据了"); |
| | |
| | | /** |
| | | * 删除家大事记 |
| | | */ |
| | | public void delete() { |
| | | public void deleteCheckList() { |
| | | List<FamilyMemorabiliaBean> deleteList = getCheckListLiveData().getValue(); |
| | | if (deleteList == null){ |
| | | return; |
| | |
| | | StringBuffer sb = new StringBuffer(); |
| | | deleteList.forEach(familyMemorabiliaBean -> sb.append(familyMemorabiliaBean.getId()).append(",")); |
| | | sb.deleteCharAt(sb.length()-1); |
| | | System.out.println(); |
| | | model.deleteFamilyMemorabilia(sb.toString()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | List<FamilyMemorabiliaBean> list = getDataListLiveData().getValue(); |
| | | if (list != null) { |
| | | list.removeAll(getCheckListLiveData().getValue()); |
| | | } |
| | | getDataListLiveData().postValue(list); |
| | | messageLiveData.postValue("删除成功"); |
| | | finishDeleteListLiveData.postValue(checkListLiveData.getValue()); |
| | | getCheckListLiveData().postValue(new ArrayList<>()); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除单个数据 |
| | | */ |
| | | public void deleteItem(FamilyMemorabiliaBean bean) { |
| | | model.deleteLittleDoctors(String.valueOf(bean.getId())) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | List<FamilyMemorabiliaBean> list = new ArrayList<>(); |
| | | list.add(bean); |
| | | finishDeleteListLiveData.postValue(list); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<FamilyMemorabiliaRequestBean> getRequestBeanMutableLiveData() { |
| | | if (requestBeanMutableLiveData == null){ |
| | | requestBeanMutableLiveData = new MutableLiveData<>(); |
| | | @NonNull |
| | | public MutableLiveData<FamilyMemorabiliaRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanMutableLiveData.getValue() == null){ |
| | | requestBeanMutableLiveData.setValue(new FamilyMemorabiliaRequestBean()); |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new FamilyMemorabiliaRequestBean()); |
| | | } |
| | | return requestBeanMutableLiveData; |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanMutableLiveData(MutableLiveData<FamilyMemorabiliaRequestBean> requestBeanMutableLiveData) { |
| | | this.requestBeanMutableLiveData = requestBeanMutableLiveData; |
| | | public void setRequestBeanLiveData(MutableLiveData<FamilyMemorabiliaRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<FamilyMemorabiliaBean>> getDataListLiveData() { |
| | |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<List<FamilyMemorabiliaBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | |
| | | this.moreListLiveData = moreListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<Integer> getOperateTypeLiveData() { |
| | | if (operateTypeLiveData == null){ |
| | | operateTypeLiveData = new MutableLiveData<>(); |
| | |
| | | this.operateTypeLiveData = operateTypeLiveData; |
| | | } |
| | | |
| | | public LiveData<List<FamilyMemorabiliaBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<FamilyMemorabiliaBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | list.sort(new Comparator<FamilyMemorabiliaBean>() { |
| | | @Override |
| | | public int compare(FamilyMemorabiliaBean o1, FamilyMemorabiliaBean o2) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", java.util.Locale.getDefault()); |
| | | Date date1 = null; |
| | | Date date2 = null; |
| | | try { |
| | | date1 = format.parse(o1.getCreateTime()); |
| | | date2 = format.parse(o2.getCreateTime()); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (date1 != null && date2 != null) { |
| | | if (b){ |
| | | return date2.compareTo(date1); |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getHappenTime(); |
| | | String happenTime2 = o2.getHappenTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return 1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return -1; |
| | | }else { |
| | | return date1.compareTo(date2); |
| | | } |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date2.compareTo(date1); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | getDataListLiveData().postValue(list); |
| | | } else { |
| | | // 从旧到新,null排最前 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getHappenTime(); |
| | | String happenTime2 = o2.getHappenTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return -1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return 1; |
| | | } else { |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date1.compareTo(date2); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
File was renamed from app/src/main/java/com/application/zhangshi_app_android/ui/function/CreateFamilyProjectActivity.java |
| | |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.base.view.BaseActivity; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.ImageRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityFamilyMemorabiliaCreateBinding; |
| | | import com.application.zhangshi_app_android.bean.LittleDoctorBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityFamilyMemorabiliaDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.luck.picture.lib.entity.LocalMedia; |
| | | import com.luck.picture.lib.interfaces.OnResultCallbackListener; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.function.Consumer; |
| | | |
| | | |
| | | /** |
| | | * @author Gss |
| | | * @date 2023.03.25. 16:00 |
| | | * @desc 家大事记 CreateFamilyProjectActivity |
| | | * @desc 家大事记 FamilyMemorabiliaDetailActivity |
| | | */ |
| | | public class CreateFamilyProjectActivity extends BaseActivity<ActivityFamilyMemorabiliaCreateBinding,CreateFamilyProjectActivityViewModel> { |
| | | private int type; |
| | | public class FamilyMemorabiliaDetailActivity extends DLBaseActivity<ActivityFamilyMemorabiliaDetailBinding, FamilyMemorabiliaDetailActivityViewModel> { |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | private FamilyMemorabiliaBean bean; |
| | | private ImageRvAdapter adapter; |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_family_memorabilia_create; |
| | | return R.layout.activity_family_memorabilia_detail; |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void initParam() { |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0){ |
| | | bean = (FamilyMemorabiliaBean) getIntent().getSerializableExtra("bean"); |
| | | if (type == 0 || type == 2){ |
| | | FamilyMemorabiliaBean bean = (FamilyMemorabiliaBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean!=null){ |
| | | viewModel.getBeanMutableLiveData().postValue(bean); |
| | | viewModel.getBeanMutableLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new ImageRvAdapter(this,viewModel); |
| | | adapter = new ImageRvAdapter(this); |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | |
| | | }); |
| | | } |
| | | }); |
| | | adapter.setOnChildClickListener(R.id.iv_delete, new BaseRVAdapter.OnChildClickListener() { |
| | | @Override |
| | | public void onChildClick(RecyclerView recyclerView, View childView, int position) { |
| | | FamilyMemorabiliaBean bean = viewModel.getBeanMutableLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.remove(adapter.getItem(position)); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | adapter.removeItem(position); |
| | | viewModel.getBeanMutableLiveData().setValue(bean); |
| | | } |
| | | }); |
| | | binding.rvImage.setAdapter(adapter); |
| | | |
| | | if (type == 1){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | viewModel.getTypeLiveData().setValue(true); |
| | | binding.titleBar.setTitle("新增家大事记"); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else { |
| | | popupWindow = new PopupWindow(this); |
| | | // 设置布局文件 |
| | | popupWindow.setContentView(LayoutInflater.from(this).inflate(R.layout.pop_operate_delete, null)); |
| | | // 为了避免部分机型不显示,需要重新设置一下宽高 |
| | | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | // 设置pop透明效果 |
| | | popupWindow.setBackgroundDrawable(new ColorDrawable(0x0000)); |
| | | // 设置pop出入动画 |
| | | popupWindow.setAnimationStyle(com.android.app_base.R.style.pop_operate); |
| | | // 设置pop获取焦点,如果为false点击返回按钮会退出当前Activity,如果pop中有Editor的话,focusable必须要为true |
| | | popupWindow.setFocusable(true); |
| | | // 设置pop可点击,为false点击事件无效,默认为true |
| | | popupWindow.setTouchable(true); |
| | | // 设置点击pop外侧消失,默认为false;在focusable为true时点击外侧始终消失 |
| | | popupWindow.setOutsideTouchable(true); |
| | | |
| | | }else if (type == 0){ |
| | | popupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate_delete,null)); |
| | | popupWindow.getContentView().findViewById(R.id.tv_modify).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().postValue(false); |
| | | }else if (type == 2){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | } |
| | | |
| | | binding.etTime.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | DatePicker picker = getDatePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | String date = String.format(Locale.CHINA, "%d-%02d-%02d", year, month, day); |
| | | binding.etTime.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanMutableLiveData().observe(this,bean -> { |
| | | if (bean!=null){ |
| | | bean.setUrl(bean.getUrl()); |
| | | adapter.setData(bean.getUrlList()); |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | adapter.setData(urlList); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().observe(this,operateType -> { |
| | |
| | | } |
| | | |
| | | public void setIsEdited(boolean isEdited){ |
| | | disableAllEditText(getContentView(),isEdited); |
| | | adapter.setIsEdited(isEdited); |
| | | } |
| | | public void disableAllEditText(ViewGroup viewGroup,boolean isEdited) { |
| | | for (int i = 0; i < viewGroup.getChildCount(); i++) { |
| | | View child = viewGroup.getChildAt(i); |
| | | if (child instanceof ViewGroup) { |
| | | disableAllEditText((ViewGroup) child,isEdited); |
| | | } else if (child instanceof EditText) { |
| | | child.setEnabled(isEdited); |
| | | child.setFocusable(isEdited); |
| | | child.setFocusableInTouchMode(isEdited); |
| | | if (!isEdited){ |
| | | child.clearFocus(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
File was renamed from app/src/main/java/com/application/zhangshi_app_android/ui/function/CreateFamilyProjectActivityViewModel.java |
| | |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | |
| | | import okhttp3.MultipartBody; |
| | | import okhttp3.RequestBody; |
| | | |
| | | public class CreateFamilyProjectActivityViewModel extends BaseViewModel<DataRepository> { |
| | | public class FamilyMemorabiliaDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<FamilyMemorabiliaBean> beanMutableLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | public CreateFamilyProjectActivityViewModel(@NonNull Application application) { |
| | | public FamilyMemorabiliaDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | messageLiveData.postValue("添加成功"); |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanMutableLiveData.getValue()); |
| | | messageLiveData.postValue("添加成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | messageLiveData.postValue("删除成功"); |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanMutableLiveData.getValue()); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | messageLiveData.postValue("修改成功"); |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanMutableLiveData.getValue()); |
| | | messageLiveData.postValue("修改成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | |
| | | |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.ImageView; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import com.android.app_base.base.view.BaseFragment; |
| | | import androidx.fragment.app.Fragment; |
| | | import androidx.fragment.app.FragmentTransaction; |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.GlideUtil; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.BannerBean; |
| | | import com.application.zhangshi_app_android.databinding.FragmentFunctionBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseFragment; |
| | | import com.application.zhangshi_app_android.ui.TestActivity; |
| | | import com.application.zhangshi_app_android.ui.home.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.main.MainActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 功能 Fragment |
| | | */ |
| | | public class FunctionFragment extends DLBaseFragment<FragmentFunctionBinding,FunctionFragmentViewModel> { |
| | | public FunctionFragment() { |
| | | |
| | | private PopupWindow mOperatePopupWindow; |
| | | private ImageCarouselFragment imageCarouselFragment; |
| | | private VideoFragment videoFragment; |
| | | |
| | | private FunctionFragment() { |
| | | } |
| | | |
| | | public static FunctionFragment newInstance() { |
| | |
| | | |
| | | @Override |
| | | protected void initView() { |
| | | binding.layoutHomeRootNet.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | MainActivity.start(getSelfActivity(), HomeFragment.class); |
| | | } |
| | | }); |
| | | binding.layoutFamilyMemorabilia.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | |
| | | binding.layoutContacts.setOnClickListener(v->{ |
| | | AppManager.getAppManager().startActivity(ContactsActivity.class); |
| | | }); |
| | | } |
| | | binding.ivOperate.setOnClickListener(v->{ |
| | | AppManager.getAppManager().startActivity(TestActivity.class); |
| | | }); |
| | | |
| | | imageCarouselFragment = ImageCarouselFragment.newInstance(); |
| | | videoFragment = VideoFragment.newInstance(); |
| | | replaceFragment(imageCarouselFragment); |
| | | |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(getSelfActivity(),R.layout.pop_switch_video_or_image,null)); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_image).setOnClickListener(v -> { |
| | | mOperatePopupWindow.dismiss(); |
| | | if (imageCarouselFragment == null){ |
| | | imageCarouselFragment = ImageCarouselFragment.newInstance(); |
| | | } |
| | | replaceFragment(imageCarouselFragment); |
| | | |
| | | }); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_video).setOnClickListener(v -> { |
| | | mOperatePopupWindow.dismiss(); |
| | | if (videoFragment == null){ |
| | | videoFragment = VideoFragment.newInstance(); |
| | | } |
| | | replaceFragment(videoFragment); |
| | | }); |
| | | //点击弹出操作弹窗 |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(getSelfActivity(),85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | } |
| | | public void replaceFragment(Fragment fragment){ |
| | | FragmentTransaction transaction = getSelfActivity().getSupportFragmentManager().beginTransaction(); |
| | | transaction.replace(R.id.layout_frame,fragment); |
| | | transaction.commit(); |
| | | } |
| | | @Override |
| | | protected void initData() { |
| | | |
| | | viewModel.getBannerData(); |
| | | } |
| | | |
| | | @Override |
| | | protected void initLiveDataObserve() { |
| | | |
| | | viewModel.getBannerListLiveData().observe(this, new Observer<List<BannerBean>>() { |
| | | @Override |
| | | public void onChanged(List<BannerBean> bannerBeans) { |
| | | List<String> imageList = new ArrayList<>(); |
| | | List<String> videoList = new ArrayList<>(); |
| | | for (BannerBean bannerBean : bannerBeans) { |
| | | if (bannerBean.getFlag() == 0){ |
| | | //图片 |
| | | imageList.add(bannerBean.getUrl()); |
| | | }else if (bannerBean.getFlag() == 1){ |
| | | //视频 |
| | | videoList.add(bannerBean.getUrl()); |
| | | } |
| | | } |
| | | imageCarouselFragment.setImageList(imageList); |
| | | videoFragment.setVideoList(videoList); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutFrame.setVisibility(View.GONE); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | @Override |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutFrame.setVisibility(View.VISIBLE); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.application.zhangshi_app_android.bean.BannerBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesRequestBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 功能 Fragment的 ViewModel |
| | | */ |
| | | public class FunctionFragmentViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private final MutableLiveData<List<BannerBean>> bannerListLiveData = new MutableLiveData<>(); |
| | | public FunctionFragmentViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 获取banner 轮播图数据 |
| | | */ |
| | | public void getBannerData() { |
| | | model.getBannerData() |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<List<BannerBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<List<BannerBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | bannerListLiveData.postValue(data.getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public MutableLiveData<List<BannerBean>> getBannerListLiveData() { |
| | | return bannerListLiveData; |
| | | } |
| | | |
| | | public void setBannerListLiveData(List<BannerBean> bannerListLiveData) { |
| | | this.bannerListLiveData.postValue(bannerListLiveData); |
| | | } |
| | | } |
| | |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | |
| | | final int SCROLL_THRESHOLD = 400; // 滑动阈值,按钮在滑动超过该阈值后开始根据超出阈值距离渐渐显示出来 |
| | | final int SCROLL_DISTANCE = 400; // 按钮从隐藏到全部显示出来需要滑动的距离 |
| | | binding.fabMoveToTop.setAlpha(0f); |
| | | binding.nestedScrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() { |
| | | @Override |
| | | public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { |
| | | // 当滑动距离超过阈值一半时,开始慢慢显示按钮 |
| | | if (scrollY >= SCROLL_THRESHOLD) { |
| | | // 根据滑动距离设置按钮透明度 |
| | | float alpha = Math.min(1.0f, (float) (scrollY - SCROLL_THRESHOLD) / SCROLL_DISTANCE); |
| | | binding.fabMoveToTop.setAlpha(alpha); |
| | | } else { |
| | | binding.fabMoveToTop.setAlpha(0f); |
| | | } |
| | | } |
| | | }); |
| | | binding.fabMoveToTop.setOnClickListener(v -> { |
| | | // 点击按钮返回顶部 |
| | | binding.nestedScrollView.smoothScrollTo(0, 0); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void initLiveDataObserve() { |
| | | viewModel.getIsExperienceExpendedLiveData().observe(this, aBoolean -> { |
| | | if (aBoolean){ |
| | | binding.ivExperienceFold.setOnClickListener(view -> { |
| | | binding.layoutExperienceTitle.setOnClickListener(view -> { |
| | | collapseView(binding.layoutExperience,binding.layoutExperienceTitle); |
| | | viewModel.getIsExperienceExpendedLiveData().setValue(false); |
| | | }); |
| | | }else { |
| | | binding.ivExperienceFold.setOnClickListener(view -> { |
| | | binding.layoutExperienceTitle.setOnClickListener(view -> { |
| | | expendView(binding.layoutExperience); |
| | | viewModel.getIsExperienceExpendedLiveData().setValue(true); |
| | | }); |
| | |
| | | }); |
| | | viewModel.getIsRelationExpendedLiveData().observe(this, aBoolean -> { |
| | | if (aBoolean){ |
| | | binding.ivRelationFold.setOnClickListener(view -> { |
| | | binding.layoutRelationTitle.setOnClickListener(view -> { |
| | | collapseView(binding.layoutRelation,binding.layoutRelationTitle); |
| | | viewModel.getIsRelationExpendedLiveData().setValue(false); |
| | | }); |
| | | }else { |
| | | binding.ivRelationFold.setOnClickListener(view -> { |
| | | binding.layoutRelationTitle.setOnClickListener(view -> { |
| | | expendView(binding.layoutRelation); |
| | | viewModel.getIsRelationExpendedLiveData().setValue(true); |
| | | }); |
| | |
| | | }); |
| | | viewModel.getIsHolderExpendedLiveData().observe(this, aBoolean -> { |
| | | if (aBoolean){ |
| | | binding.ivHolderFold.setOnClickListener(view -> { |
| | | binding.layoutHolderTitle.setOnClickListener(view -> { |
| | | collapseView(binding.layoutHolder,binding.layoutHolderTitle); |
| | | viewModel.getIsHolderExpendedLiveData().setValue(false); |
| | | }); |
| | | }else { |
| | | binding.ivHolderFold.setOnClickListener(view -> { |
| | | binding.layoutHolderTitle.setOnClickListener(view -> { |
| | | expendView(binding.layoutHolder); |
| | | viewModel.getIsHolderExpendedLiveData().setValue(true); |
| | | }); |
| | |
| | | }); |
| | | viewModel.getIsAbroadExpendedLiveData().observe(this, aBoolean -> { |
| | | if (aBoolean){ |
| | | binding.ivAbroadFold.setOnClickListener(view -> { |
| | | binding.layoutAbroadTitle.setOnClickListener(view -> { |
| | | collapseView(binding.layoutAbroad,binding.layoutAbroadTitle); |
| | | viewModel.getIsAbroadExpendedLiveData().setValue(false); |
| | | }); |
| | | }else { |
| | | binding.ivAbroadFold.setOnClickListener(view -> { |
| | | binding.layoutAbroadTitle.setOnClickListener(view -> { |
| | | expendView(binding.layoutAbroad); |
| | | viewModel.getIsAbroadExpendedLiveData().setValue(true); |
| | | }); |
| | |
| | | viewModel.getAutobiographyLiveData().observe(this, new Observer<List<GrowthExperienceAutobiographyBean>>() { |
| | | @Override |
| | | public void onChanged(List<GrowthExperienceAutobiographyBean> beans) { |
| | | if (beans==null||beans.size() == 0 ){ |
| | | binding.tvFill.setVisibility(View.GONE); |
| | | return; |
| | | }else { |
| | | binding.tvFill.setVisibility(View.VISIBLE); |
| | | } |
| | | binding.tabLayout.removeAllTabs(); |
| | | for (int i = 0; i < beans.size(); i++) { |
| | | GrowthExperienceAutobiographyBean bean = beans.get(i); |
| | |
| | | import android.animation.Animator; |
| | | import android.animation.AnimatorListenerAdapter; |
| | | import android.animation.ValueAnimator; |
| | | import android.text.Editable; |
| | | import android.text.TextWatcher; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.animation.Animation; |
| | |
| | | import android.widget.FrameLayout; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAutobiographyBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNotesContentBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityHealthCareBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.OptionPicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener; |
| | | import com.google.android.material.tabs.TabLayout; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | AppManager.getAppManager().startActivity(AnnualHealthStatusActivity.class); |
| | | } |
| | | }); |
| | | |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,118) +binding.ivOperate.getWidth(),0); |
| | | view.findViewById(R.id.tv_edit).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | popupWindow.dismiss(); |
| | | viewModel.setTypeLiveData(true); |
| | | } |
| | | }); |
| | | |
| | | binding.tvSex.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | List<String> list = Arrays.asList("女","男"); |
| | | OptionPicker picker = getOptionPicker(list); |
| | | picker.setTitle("性别"); |
| | | picker.setOnOptionPickedListener(new OnOptionPickedListener() { |
| | | @Override |
| | | public void onOptionPicked(int position, Object item) { |
| | | binding.tvSex.setText(item.toString()); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | final int SCROLL_THRESHOLD = 400; // 滑动阈值,按钮在滑动超过该阈值后开始根据超出阈值距离渐渐显示出来 |
| | | final int SCROLL_DISTANCE = 400; // 按钮从隐藏到全部显示出来需要滑动的距离 |
| | | binding.fabMoveToTop.setAlpha(0f); |
| | | binding.nestedScrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() { |
| | | @Override |
| | | public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { |
| | | // 当滑动距离超过阈值一半时,开始慢慢显示按钮 |
| | | if (scrollY >= SCROLL_THRESHOLD) { |
| | | // 根据滑动距离设置按钮透明度 |
| | | float alpha = Math.min(1.0f, (float) (scrollY - SCROLL_THRESHOLD) / SCROLL_DISTANCE); |
| | | binding.fabMoveToTop.setAlpha(alpha); |
| | | } else { |
| | | binding.fabMoveToTop.setAlpha(0f); |
| | | } |
| | | } |
| | | }); |
| | | binding.fabMoveToTop.setOnClickListener(v -> { |
| | | // 点击按钮返回顶部 |
| | | binding.nestedScrollView.smoothScrollTo(0, 0); |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | |
| | | viewModel.getHealthCareBaseInfo(); |
| | | viewModel.getHealthCareLifeHabits(); |
| | | viewModel.getHealthCareNursingExamination(); |
| | | viewModel.getHealthCareExistingProblems(); |
| | | viewModel.getHealthCareNotesContent(); |
| | | } |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | System.out.println("我"+binding.ivA.isClickable()); |
| | | viewModel.getIsLifeHabitsExpendedLiveData().observe(this, aBoolean -> { |
| | | if (aBoolean){ |
| | | binding.ivLifeHabitsFold.setOnClickListener(view -> { |
| | | binding.layoutTitleLifeHabits.setOnClickListener(view -> { |
| | | collapseView(binding.cardLifeHabits,binding.layoutTitleLifeHabits); |
| | | viewModel.getIsLifeHabitsExpendedLiveData().setValue(false); |
| | | }); |
| | | }else { |
| | | binding.ivLifeHabitsFold.setOnClickListener(view -> { |
| | | binding.layoutTitleLifeHabits.setOnClickListener(view -> { |
| | | expendView(binding.cardLifeHabits); |
| | | viewModel.getIsLifeHabitsExpendedLiveData().setValue(true); |
| | | }); |
| | |
| | | }); |
| | | viewModel.getIsHealthExpendedLiveData().observe(this, aBoolean -> { |
| | | if (aBoolean){ |
| | | binding.ivHealthFold.setOnClickListener(view -> { |
| | | binding.layoutTitleHealth.setOnClickListener(view -> { |
| | | collapseView(binding.cardHealth,binding.layoutTitleHealth); |
| | | viewModel.getIsHealthExpendedLiveData().setValue(false); |
| | | }); |
| | | }else { |
| | | binding.ivHealthFold.setOnClickListener(view -> { |
| | | binding.layoutTitleHealth.setOnClickListener(view -> { |
| | | expendView(binding.cardHealth); |
| | | viewModel.getIsHealthExpendedLiveData().setValue(true); |
| | | }); |
| | |
| | | }); |
| | | viewModel.getIsNursingExpendedLiveData().observe(this, aBoolean -> { |
| | | if (aBoolean){ |
| | | binding.ivNursingFold.setOnClickListener(view -> { |
| | | binding.layoutTitleNursing.setOnClickListener(view -> { |
| | | collapseView(binding.cardNursing,binding.layoutTitleNursing); |
| | | viewModel.getIsNursingExpendedLiveData().setValue(false); |
| | | }); |
| | | }else { |
| | | binding.ivNursingFold.setOnClickListener(view -> { |
| | | binding.layoutTitleNursing.setOnClickListener(view -> { |
| | | expendView(binding.cardNursing); |
| | | viewModel.getIsNursingExpendedLiveData().setValue(true); |
| | | }); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().observe(this, new Observer<Boolean>() { |
| | | @Override |
| | | public void onChanged(Boolean aBoolean) { |
| | | if (aBoolean){ |
| | | binding.ivOperate.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | viewModel.setTypeLiveData(false); |
| | | viewModel.save(); |
| | | } |
| | | }); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(HealthCareActivity.this,118) +binding.ivOperate.getWidth(),0); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getHealthCareNotesContentBeanLiveData().observe(this, new Observer<HealthCareNotesContentBean>() { |
| | | @Override |
| | | public void onChanged(HealthCareNotesContentBean bean) { |
| | | List<String> tabList = bean.getTabList(); |
| | | List<String> contentList = bean.getContentList(); |
| | | if (tabList==null||tabList.size() == 0 ){ |
| | | binding.etFill.setVisibility(View.GONE); |
| | | return; |
| | | }else { |
| | | binding.etFill.setVisibility(View.VISIBLE); |
| | | } |
| | | binding.tabLayout.removeAllTabs(); |
| | | for (int i = 0; i < tabList.size(); i++) { |
| | | String tabText = tabList.get(i); |
| | | TabLayout.Tab tab = binding.tabLayout.newTab().setText(tabText); |
| | | if (i % 2 == 0){ |
| | | tab.view.setBackgroundResource(R.drawable.selector_tab_background_pink); |
| | | }else { |
| | | tab.view.setBackgroundResource(R.drawable.selector_tab_background_blue); |
| | | } |
| | | //取消tab的长按显示文本 |
| | | tab.view.setOnLongClickListener(new View.OnLongClickListener() { |
| | | @Override |
| | | public boolean onLongClick(View v) { |
| | | return true; |
| | | } |
| | | }); |
| | | binding.tabLayout.addTab(tab); |
| | | } |
| | | binding.etFill.setText(contentList.get(0)); |
| | | binding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { |
| | | @Override |
| | | public void onTabSelected(TabLayout.Tab tab) { |
| | | binding.etFill.setText(contentList.get(tab.getPosition())); |
| | | binding.etFill.clearFocus(); |
| | | } |
| | | |
| | | @Override |
| | | public void onTabUnselected(TabLayout.Tab tab) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onTabReselected(TabLayout.Tab tab) { |
| | | |
| | | } |
| | | }); |
| | | binding.etFill.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) { |
| | | int select = binding.tabLayout.getSelectedTabPosition(); |
| | | contentList.set(select,s.toString()); |
| | | viewModel.getHealthCareNotesContentBeanLiveData().getValue().setContent(contentList); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | binding.ivA.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | System.out.println("点击了A"); |
| | | System.out.println(v.isClickable()); |
| | | System.out.println(viewModel.getTypeLiveData().getValue()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | public void collapseView(View initialView,View collapsedView){ |
| | | int initialHeight = initialView.getMeasuredHeight(); |
| | | int collapsedHeight = collapsedView.getMeasuredHeight(); |
| | | int distanceToCollapse = (int) (initialHeight - collapsedHeight); |
| | | |
| | | Animation a = new Animation() { |
| | | @Override |
| | | protected void applyTransformation(float interpolatedTime, Transformation t) { |
| | | if (interpolatedTime == 1){ |
| | | } |
| | | initialView.getLayoutParams().height = (int) (initialHeight - (distanceToCollapse * interpolatedTime)); |
| | | initialView.requestLayout(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean willChangeBounds() { |
| | | return true; |
| | | } |
| | | }; |
| | | a.setDuration(500); |
| | | initialView.startAnimation(a); |
| | | Utils.pullCollapse(initialView,initialHeight,collapsedHeight); |
| | | } |
| | | public void expendView(View initialView){ |
| | | int initialHeight = initialView.getMeasuredHeight(); |
| | | initialView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = initialView.getMeasuredHeight(); |
| | | |
| | | ValueAnimator animator = ValueAnimator.ofInt(initialHeight,targetHeight); |
| | | animator.addUpdateListener(animation -> { |
| | | initialView.getLayoutParams().height = (int) animation.getAnimatedValue(); |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.databinding.Bindable; |
| | | import androidx.databinding.InverseBindingAdapter; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.application.zhangshi_app_android.bean.HealthCareBaseInfoBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareExistingProblemsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareLifeHabitsBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNotesContentBean; |
| | | import com.application.zhangshi_app_android.bean.HealthCareNursingExaminationBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import io.reactivex.Observable; |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Function5; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | public class HealthCareActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<Boolean> typeLiveData;//true:编辑 false:查看 |
| | | private MutableLiveData<HealthCareBaseInfoBean> healthCareBaseInfoBeanLiveData;//健康保健基本信息 |
| | | private MutableLiveData<HealthCareLifeHabitsBean> healthCareLifeHabitsBeanLiveData;//健康保健生活习惯 |
| | | private MutableLiveData<HealthCareNursingExaminationBean> healthCareNursingExaminationBeanLiveData;//健康保健护理检查 |
| | | private MutableLiveData<HealthCareExistingProblemsBean> healthCareExistingProblemsBeanLiveData;//健康保健现存问题 |
| | | private MutableLiveData<HealthCareNotesContentBean> healthCareNotesContentBeanLiveData;//健康保健笔记内容 |
| | | private MutableLiveData<Boolean> isLifeHabitsExpendedLiveData; |
| | | private MutableLiveData<Boolean> isNursingExpendedLiveData; |
| | | private MutableLiveData<Boolean> isHealthExpendedLiveData; |
| | | |
| | | |
| | | |
| | | public HealthCareActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | public <T> Observer<ResultData<T>> getObserver(MutableLiveData<T> resultData) { |
| | | return new Observer<ResultData<T>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<T> data) { |
| | | if (data.getCode() == CODE_SUCCESS) { |
| | | if (data.getData() == null) { |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | } else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | resultData.postValue(data.getData()); |
| | | } |
| | | } else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健基本信息 |
| | | */ |
| | | public void getHealthCareBaseInfo() { |
| | | model.getHealthCareBaseInfo() |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doOnSubscribe(disposable -> changeStateView(StateViewEnum.DATA_LOADING)) |
| | | .doFinally(() -> changeStateView(StateViewEnum.DATA_FINISH)) |
| | | .subscribe(getObserver(getHealthCareBaseInfoBeanLiveData())); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健生活习惯 |
| | | */ |
| | | public void getHealthCareLifeHabits() { |
| | | model.getHealthCareLifeHabits() |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doOnSubscribe(disposable -> changeStateView(StateViewEnum.DATA_LOADING)) |
| | | .doFinally(() -> changeStateView(StateViewEnum.DATA_FINISH)) |
| | | .subscribe(getObserver(getHealthCareLifeHabitsBeanLiveData())); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健护理查体 |
| | | */ |
| | | public void getHealthCareNursingExamination() { |
| | | model.getHealthCareNursingExamination() |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doOnSubscribe(disposable -> changeStateView(StateViewEnum.DATA_LOADING)) |
| | | .doFinally(() -> changeStateView(StateViewEnum.DATA_FINISH)) |
| | | .subscribe(getObserver(getHealthCareNursingExaminationBeanLiveData())); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健现存问题 |
| | | */ |
| | | public void getHealthCareExistingProblems() { |
| | | model.getHealthCareExistingProblems() |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doOnSubscribe(disposable -> changeStateView(StateViewEnum.DATA_LOADING)) |
| | | .doFinally(() -> changeStateView(StateViewEnum.DATA_FINISH)) |
| | | .subscribe(getObserver(getHealthCareExistingProblemsBeanLiveData())); |
| | | } |
| | | |
| | | /** |
| | | * 获取健康保健笔记内容 |
| | | */ |
| | | public void getHealthCareNotesContent() { |
| | | model.getHealthCareNotesContent() |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doOnSubscribe(disposable -> changeStateView(StateViewEnum.DATA_LOADING)) |
| | | .doFinally(() -> changeStateView(StateViewEnum.DATA_FINISH)) |
| | | .subscribe(getObserver(getHealthCareNotesContentBeanLiveData())); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存 |
| | | */ |
| | | public void save(){ |
| | | Observable.zip( |
| | | model.updateHealthCareBaseInfo(getHealthCareBaseInfoBeanLiveData().getValue()), |
| | | model.updateHealthCareLifeHabits(getHealthCareLifeHabitsBeanLiveData().getValue()), |
| | | model.updateHealthCareNursingExamination(getHealthCareNursingExaminationBeanLiveData().getValue()), |
| | | model.updateHealthCareExistingProblems(getHealthCareExistingProblemsBeanLiveData().getValue()), |
| | | model.updateHealthCareNotesContent(getHealthCareNotesContentBeanLiveData().getValue()), |
| | | new Function5<ResultData<String>, ResultData<String>, ResultData<String>, ResultData<String>, ResultData<String>, String>() { |
| | | @Override |
| | | public String apply(ResultData<String> stringResultData, ResultData<String> stringResultData2, ResultData<String> stringResultData3, ResultData<String> stringResultData4, ResultData<String> stringResultData5) throws Exception { |
| | | if (stringResultData.getCode() == CODE_SUCCESS |
| | | && stringResultData2.getCode() == CODE_SUCCESS |
| | | && stringResultData3.getCode() == CODE_SUCCESS |
| | | && stringResultData4.getCode() == CODE_SUCCESS |
| | | && stringResultData5.getCode() == CODE_SUCCESS) { |
| | | return "保存成功"; |
| | | } else { |
| | | throw new Exception("保存失败"); |
| | | } |
| | | } |
| | | } |
| | | ).compose(RxUtils.schedulersTransformer()).subscribe(new Observer<String>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | changeStateView(StateViewEnum.DATA_LOADING); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(String s) { |
| | | messageLiveData.postValue(s); |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public MutableLiveData<Boolean> getIsLifeHabitsExpendedLiveData() { |
| | |
| | | public void setIsHealthExpendedLiveData(MutableLiveData<Boolean> isHealthExpendedLiveData) { |
| | | this.isHealthExpendedLiveData = isHealthExpendedLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<HealthCareBaseInfoBean> getHealthCareBaseInfoBeanLiveData() { |
| | | if (healthCareBaseInfoBeanLiveData == null){ |
| | | healthCareBaseInfoBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | return healthCareBaseInfoBeanLiveData; |
| | | } |
| | | |
| | | public void setHealthCareBaseInfoBeanLiveData(MutableLiveData<HealthCareBaseInfoBean> healthCareBaseInfoBeanLiveData) { |
| | | this.healthCareBaseInfoBeanLiveData = healthCareBaseInfoBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<HealthCareLifeHabitsBean> getHealthCareLifeHabitsBeanLiveData() { |
| | | if (healthCareLifeHabitsBeanLiveData == null){ |
| | | healthCareLifeHabitsBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | return healthCareLifeHabitsBeanLiveData; |
| | | } |
| | | |
| | | public void setHealthCareLifeHabitsBeanLiveData(MutableLiveData<HealthCareLifeHabitsBean> healthCareLifeHabitsBeanLiveData) { |
| | | this.healthCareLifeHabitsBeanLiveData = healthCareLifeHabitsBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<HealthCareNursingExaminationBean> getHealthCareNursingExaminationBeanLiveData() { |
| | | if (healthCareNursingExaminationBeanLiveData == null){ |
| | | healthCareNursingExaminationBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | return healthCareNursingExaminationBeanLiveData; |
| | | } |
| | | |
| | | public void setHealthCareNursingExaminationBeanLiveData(MutableLiveData<HealthCareNursingExaminationBean> healthCareNursingExaminationBeanLiveData) { |
| | | this.healthCareNursingExaminationBeanLiveData = healthCareNursingExaminationBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<HealthCareExistingProblemsBean> getHealthCareExistingProblemsBeanLiveData() { |
| | | if (healthCareExistingProblemsBeanLiveData == null){ |
| | | healthCareExistingProblemsBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | return healthCareExistingProblemsBeanLiveData; |
| | | } |
| | | |
| | | public void setHealthCareExistingProblemsBeanLiveData(MutableLiveData<HealthCareExistingProblemsBean> healthCareExistingProblemsBeanLiveData) { |
| | | this.healthCareExistingProblemsBeanLiveData = healthCareExistingProblemsBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<HealthCareNotesContentBean> getHealthCareNotesContentBeanLiveData() { |
| | | if (healthCareNotesContentBeanLiveData == null){ |
| | | healthCareNotesContentBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | return healthCareNotesContentBeanLiveData; |
| | | } |
| | | |
| | | public void setHealthCareNotesContentBeanLiveData(MutableLiveData<HealthCareNotesContentBean> healthCareNotesContentBeanLiveData) { |
| | | this.healthCareNotesContentBeanLiveData = healthCareNotesContentBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<Boolean> getTypeLiveData() { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | typeLiveData.setValue(false); |
| | | } |
| | | return typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(MutableLiveData<Boolean> typeLiveData) { |
| | | this.typeLiveData = typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(boolean type) { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | } |
| | | typeLiveData.setValue(type); |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.content.Intent; |
| | | import android.text.Editable; |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.android.app_base.widget.LinearItemDecoration; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.adapter.HomeDevicesRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityHomeDevicesBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | public class HomeDevicesActivity extends DLBaseActivity<ActivityHomeDevicesBinding,HomeDevicesActivityViewModel> { |
| | | |
| | | private HomeDevicesRvAdapter adapter; |
| | | private boolean isSearchLayoutVisible; |
| | | private PopupWindow mOperatePopupWindow; |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new HomeDevicesRvAdapter(this); |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreHomeDevices(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new HomeDevicesRvAdapter(this,viewModel); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_12)); |
| | | itemDecoration.setHorizontalSpace((int) getResources().getDimension(com.android.app_base.R.dimen.dp_20)); |
| | |
| | | binding.recyclerView.addItemDecoration(itemDecoration); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | |
| | | //右上角操作弹窗 |
| | | mOperatePopupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate,null)); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.layout_add).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.layout_select).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old).setOnClickListener(v -> { |
| | | viewModel.sortDataList(0); |
| | | mOperatePopupWindow.dismiss(); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old).setVisibility(View.GONE); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new).setVisibility(View.GONE); |
| | | setOnClickListener( |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_add), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_select), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | binding.ivSearchDefault.setOnClickListener(v -> { |
| | | binding.layoutSearch.setVisibility(View.VISIBLE); |
| | | binding.layoutDefault.setVisibility(View.GONE); |
| | | }); |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new).setOnClickListener(v -> { |
| | | viewModel.sortDataList(1); |
| | | mOperatePopupWindow.dismiss(); |
| | | //点击搜索框菜单下拉出 搜索参数 |
| | | binding.ivSearchType.setOnClickListener(v -> { |
| | | if (!isSearchLayoutVisible){ |
| | | binding.layoutSearchParameter.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); |
| | | int targetHeight = binding.layoutSearchParameter.getMeasuredHeight(); |
| | | Utils.dropExpand(binding.containerSearchParameter,0,targetHeight); |
| | | isSearchLayoutVisible = true; |
| | | } |
| | | }); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | //搜索参数layout添加空点击事件,防止点击它内部view时它后面的recycler还能响应点击事件 |
| | | binding.layoutSearchParameter.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | } |
| | | }); |
| | | //点击搜索按钮进行搜索 |
| | | binding.ivSearch.setOnClickListener(v -> { |
| | | viewModel.getHomeDevices(); |
| | | binding.layoutSearch.setVisibility(View.GONE); |
| | | binding.layoutDefault.setVisibility(View.VISIBLE); |
| | | binding.tvTitle.setText("搜索结果"); |
| | | hideSoftKeyboard(); |
| | | }); |
| | | //点击添加按钮跳转到创建家大事记页面 |
| | | binding.fabAdd.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | AppManager.getAppManager().startActivity(new Intent(getSelfActivity(), HomeDevicesDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | } |
| | | }); |
| | | binding.etStartTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etEndTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etEndTime.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) { |
| | | if (!TextUtils.isEmpty(s)) { |
| | | binding.ivTimeClear.setVisibility(View.VISIBLE); |
| | | } else { |
| | | if (TextUtils.isEmpty(binding.etStartTime.getText().toString())) { |
| | | binding.ivTimeClear.setVisibility(View.INVISIBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }); |
| | | binding.etStartTime.setOnClickListener(v -> { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择开始时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | //以yyyy-MM-dd的格式显示,月日小于10时前面补0 |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etEndTime.getText().toString().isEmpty()){ |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | }); |
| | | binding.etEndTime.setOnClickListener(v -> { |
| | | hideSoftKeyboard(); |
| | | DatePicker datePicker = getDatePicker(); |
| | | datePicker.setTitle("请选择结束时间"); |
| | | datePicker.setOnDatePickedListener(new OnDatePickedListener() { |
| | | @Override |
| | | public void onDatePicked(int year, int month, int day) { |
| | | binding.etEndTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | if (binding.etStartTime.getText().toString().isEmpty()){ |
| | | binding.etStartTime.setText(String.format("%d-%02d-%02d", year, month, day)); |
| | | }else { |
| | | //比较开始时间和结束时间的大小 |
| | | String startTime = binding.etStartTime.getText().toString(); |
| | | String endTime = binding.etEndTime.getText().toString(); |
| | | if (Utils.compareDate(startTime,endTime) > 0){ |
| | | //交换 |
| | | binding.etStartTime.setText(endTime); |
| | | binding.etEndTime.setText(startTime); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | datePicker.show(); |
| | | }); |
| | | binding.ivTimeClear.setOnClickListener(v -> { |
| | | binding.etStartTime.setText(""); |
| | | binding.etEndTime.setText(""); |
| | | }); |
| | | } |
| | | |
| | |
| | | viewModel.getDataListLiveData().observe(this, homeDevices -> { |
| | | adapter.setData(homeDevices); |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, checkList -> { |
| | | if (0 == viewModel.getOperateTypeLiveData().getValue()){ |
| | | return; |
| | | } |
| | | public PopupWindow initPopUpWindow(View view){ |
| | | PopupWindow popupWindow = new PopupWindow(this); |
| | | // 设置布局文件 |
| | | popupWindow.setContentView(view); |
| | | // 为了避免部分机型不显示,需要重新设置一下宽高 |
| | | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
| | | // 设置pop透明效果 |
| | | popupWindow.setBackgroundDrawable(new ColorDrawable(0x0000)); |
| | | // 设置pop出入动画 |
| | | popupWindow.setAnimationStyle(com.android.app_base.R.style.pop_operate); |
| | | // 设置pop获取焦点,如果为false点击返回按钮会退出当前Activity,如果pop中有Editor的话,focusable必须要为true |
| | | popupWindow.setFocusable(true); |
| | | // 设置pop可点击,为false点击事件无效,默认为true |
| | | popupWindow.setTouchable(true); |
| | | // 设置点击pop外侧消失,默认为false;在focusable为true时点击外侧始终消失 |
| | | popupWindow.setOutsideTouchable(false); |
| | | return popupWindow; |
| | | if (checkList.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, moreList -> { |
| | | adapter.addData(moreList); |
| | | }); |
| | | viewModel.getOperateTypeLiveData().observe(this, integer -> { |
| | | if (integer == 0){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_operate); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | mOperatePopupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | adapter.setCheckable(false); |
| | | }else if (integer == 1){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_operate_finish); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.getOperateTypeLiveData().postValue(0); |
| | | }); |
| | | adapter.setCheckable(true); |
| | | }else if (integer == 2){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_delete_white); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | new UIDialog.Builder(this) |
| | | .setTitle("您确定要删除选中的项目吗") |
| | | .setContent("项目删除后将无法恢复") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | viewModel.deleteCheckList(); |
| | | } |
| | | }) |
| | | .show(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | viewModel.getFinishDeleteListLiveData().observe(this, beans -> { |
| | | for (HomeDevicesBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | |
| | | //观察数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据进行刷新 |
| | | RxBus.getInstance().toObservable(this, HomeDevicesBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getHomeDevices(); |
| | | }); |
| | | } |
| | | @Override |
| | | protected void dataNull() { |
| | | super.dataNull(); |
| | | binding.layoutDataNull.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.setVisibility(View.GONE); |
| | | } |
| | | |
| | | @Override |
| | | protected void dataFinish() { |
| | | super.dataFinish(); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | protected void hide() { |
| | | super.hide(); |
| | | binding.layoutDataNull.setVisibility(View.GONE); |
| | | binding.refreshLayout.setVisibility(View.VISIBLE); |
| | | binding.refreshLayout.finishLoadMore(); |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | int id = v.getId(); |
| | | if (id == R.id.tv_add){ |
| | | AppManager.getAppManager().startActivity(new Intent(this, HomeDevicesDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | mOperatePopupWindow.dismiss(); |
| | | }else if (id == R.id.tv_select){ |
| | | viewModel.getOperateTypeLiveData().postValue(1); |
| | | mOperatePopupWindow.dismiss(); |
| | | }else if (id == R.id.tv_from_new_to_old) { |
| | | viewModel.changeOrder(true); |
| | | mOperatePopupWindow.dismiss(); |
| | | } else if (id == R.id.tv_from_old_to_new) { |
| | | viewModel.changeOrder(false); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent event) { |
| | | float x = event.getX(); |
| | | float y = event.getY(); |
| | | if (isSearchLayoutVisible){ |
| | | if (!Utils.isPointInsideView(x, y, binding.layoutSearchParameter)) { |
| | | Utils.pullCollapse(binding.containerSearchParameter, binding.layoutSearchParameter.getMeasuredHeight(),0); |
| | | isSearchLayoutVisible = false; |
| | | return true; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(event); |
| | | } |
| | | } |
| | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | import android.text.TextUtils; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.LiveData; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesResponseBean; |
| | | import com.application.zhangshi_app_android.bean.HomeDevicesRequestBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Comparator; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | * @desc 家庭设备 ViewModel |
| | | */ |
| | | public class HomeDevicesActivityViewModel extends BaseViewModel<DataRepository> { |
| | | private MutableLiveData<List<HomeDevicesBean>> dataListLiveData;//数据 |
| | | private MutableLiveData<List<HomeDevicesBean>> dataListLiveData;//获取的数据 |
| | | private MutableLiveData<List<HomeDevicesBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<HomeDevicesBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<HomeDevicesRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<HomeDevicesBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | private MutableLiveData<Integer> operateTypeLiveData;//操作类型 0 选择操作 1.完成 2.删除 |
| | | |
| | | public HomeDevicesActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 获取数据 |
| | | */ |
| | | public void getHomeDevices(){ |
| | | model.getHomeDevices(new HashMap<>()) |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new HomeDevicesRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | model.getHomeDevices(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<HomeDevicesResponseBean>>() { |
| | | .subscribe(new Observer<ResultData<PageResponseBean<HomeDevicesBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<HomeDevicesResponseBean> data) { |
| | | public void onNext(ResultData<PageResponseBean<HomeDevicesBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreHomeDevices() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new HomeDevicesRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getHomeDevices(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<HomeDevicesBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<HomeDevicesBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | messageLiveData.postValue("没有更多数据了"); |
| | | }else { |
| | | changeStateView(StateViewEnum.HIDE); |
| | | moreListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除多选选中的数据 |
| | | */ |
| | | public void deleteCheckList() { |
| | | List<HomeDevicesBean> deleteList = getCheckListLiveData().getValue(); |
| | | if (deleteList == null){ |
| | | return; |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | | deleteList.forEach(HomeDevicesBean -> sb.append(HomeDevicesBean.getId()).append(",")); |
| | | sb.deleteCharAt(sb.length()-1); |
| | | model.deleteHomeDevices(sb.toString()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | finishDeleteListLiveData.postValue(checkListLiveData.getValue()); |
| | | messageLiveData.postValue("删除成功"); |
| | | getCheckListLiveData().postValue(new ArrayList<>()); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 删除单个数据 |
| | | */ |
| | | public void deleteItem(HomeDevicesBean HomeDevicesBean) { |
| | | model.deleteHomeDevices(String.valueOf(HomeDevicesBean.getId())) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .subscribe(new Observer<ResultData<String>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | List<HomeDevicesBean> list = new ArrayList<>(); |
| | | list.add(HomeDevicesBean); |
| | | finishDeleteListLiveData.postValue(list); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public MutableLiveData<List<HomeDevicesBean>> getCheckListLiveData() { |
| | | if (checkListLiveData==null){ |
| | | checkListLiveData = new MutableLiveData<>(); |
| | | checkListLiveData.postValue(new ArrayList<>()); |
| | | } |
| | | if (checkListLiveData.getValue() == null){ |
| | | checkListLiveData.postValue(new ArrayList<>()); |
| | | } |
| | | return checkListLiveData; |
| | | } |
| | | |
| | | public void setCheckListLiveData(MutableLiveData<List<HomeDevicesBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<HomeDevicesRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new HomeDevicesRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<HomeDevicesRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<HomeDevicesBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null){ |
| | |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<List<HomeDevicesBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<HomeDevicesBean>> moreListLiveData) { |
| | | this.moreListLiveData = moreListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<Integer> getOperateTypeLiveData() { |
| | | if (operateTypeLiveData == null){ |
| | | operateTypeLiveData = new MutableLiveData<>(); |
| | | operateTypeLiveData.setValue(0); |
| | | } |
| | | return operateTypeLiveData; |
| | | } |
| | | |
| | | public void setOperateTypeLiveData(MutableLiveData<Integer> operateTypeLiveData) { |
| | | this.operateTypeLiveData = operateTypeLiveData; |
| | | } |
| | | |
| | | public LiveData<List<HomeDevicesBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<HomeDevicesBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 按时间排序 |
| | | * @param type 0 从新到旧 1 从旧到新 |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | | */ |
| | | public void sortDataList(int type){ |
| | | List<HomeDevicesBean> list = dataListLiveData.getValue(); |
| | | public void changeOrder(boolean b) { |
| | | List<HomeDevicesBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | |
| | | list.sort(new Comparator<HomeDevicesBean>() { |
| | | @Override |
| | | public int compare(HomeDevicesBean o1, HomeDevicesBean o2) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", java.util.Locale.getDefault()); |
| | | Date date1 = null; |
| | | Date date2 = null; |
| | | try { |
| | | date1 = format.parse(o1.getCreateDate()); |
| | | date2 = format.parse(o2.getCreateDate()); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (date1 != null && date2 != null) { |
| | | if (type == 0){ |
| | | return date2.compareTo(date1); |
| | | if (b) { |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getHappenTime(); |
| | | String happenTime2 = o2.getHappenTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return 1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return -1; |
| | | }else { |
| | | return date1.compareTo(date2); |
| | | } |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date2.compareTo(date1); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | dataListLiveData.postValue(list); |
| | | } else { |
| | | // 从旧到新,null排最前 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getHappenTime(); |
| | | String happenTime2 = o2.getHappenTime(); |
| | | if (TextUtils.isEmpty(happenTime1) && TextUtils.isEmpty(happenTime2)) { |
| | | return 0; |
| | | } else if (TextUtils.isEmpty(happenTime1)) { |
| | | return -1; |
| | | } else if (TextUtils.isEmpty(happenTime2)) { |
| | | return 1; |
| | | } else { |
| | | Date date1 = Utils.parseDate(happenTime1); |
| | | Date date2 = Utils.parseDate(happenTime2); |
| | | if (date1 != null && date2 != null) { |
| | | return date1.compareTo(date2); |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | } |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
app/src/main/java/com/application/zhangshi_app_android/ui/function/HomeDevicesDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/HomeDevicesDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/HonorCollectionActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/HonorCollectionActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/HonorCollectionDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/HundredWishActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/HundredWishActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/HundredWishDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/ImageCarouselFragment.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/ImageCarouselFragmentViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/IncomeAndExpensesActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/IncomeAndExpensesActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/IncomeAndExpensesDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/IncomeAndExpensesDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/LittleDoctorActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/LittleDoctorActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/LittleDoctorDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/LittleDoctorDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/MarriageActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/MarriageActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PersonalNotepadActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PersonalNotepadActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PersonalNotepadDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PersonalNotepadDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PetActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PetActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PetDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PetDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PetMemoActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PetMemoActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PetMemoDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PrivacyActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PrivacyActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PrivacyDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PrivacyDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PropertyActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PropertyActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PropertyDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/PropertyDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismExperienceActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismExperienceActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismExperienceDetailActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/TourismExperienceDetailActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/VideoFragment.java
app/src/main/java/com/application/zhangshi_app_android/ui/function/VideoFragmentViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/home/GenealogyActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/home/GenealogyActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/home/HomeFragment.java
app/src/main/java/com/application/zhangshi_app_android/ui/home/HomeFragmentViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/login/LoginActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/login/LoginActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/main/MainActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/main/MainViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/personal_center/BasicInfoActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/personal_center/BasicInfoActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/personal_center/LoginBgChangeActivity.java
app/src/main/java/com/application/zhangshi_app_android/ui/personal_center/LoginBgChangeActivityViewModel.java
app/src/main/java/com/application/zhangshi_app_android/ui/personal_center/PersonalCenterFragment.java
app/src/main/java/com/application/zhangshi_app_android/ui/personal_center/PersonalCenterFragmentViewModel.java
app/src/main/java/com/application/zhangshi_app_android/widget/TreeView.java
app/src/main/res/drawable-xhdpi/bg_home_root_net_detail.png
app/src/main/res/drawable-xhdpi/bg_home_root_net_detail_first.png
app/src/main/res/drawable-xhdpi/bg_home_root_net_detail_second.png
app/src/main/res/drawable-xhdpi/bg_home_root_net_detail_third.png
app/src/main/res/drawable-xhdpi/ic_image_select.png
app/src/main/res/drawable-xhdpi/ic_indication_normal.png
app/src/main/res/drawable-xhdpi/ic_indication_selected.png
app/src/main/res/drawable-xhdpi/ic_move_to_top.png
app/src/main/res/drawable-xhdpi/ic_operate_select_white.png
app/src/main/res/drawable-xxhdpi/bg_home_root_net_detail.png
app/src/main/res/drawable-xxhdpi/bg_home_root_net_detail_exp.png
app/src/main/res/drawable-xxhdpi/bg_home_root_net_detail_first.png
app/src/main/res/drawable-xxhdpi/bg_home_root_net_detail_second.png
app/src/main/res/drawable-xxhdpi/bg_home_root_net_detail_third.png
app/src/main/res/drawable-xxhdpi/ic_image_select.png
app/src/main/res/drawable-xxhdpi/ic_indication_normal.png
app/src/main/res/drawable-xxhdpi/ic_indication_selected.png
app/src/main/res/drawable-xxhdpi/ic_move_to_top.png
app/src/main/res/drawable-xxhdpi/ic_operate_select_white.png
app/src/main/res/drawable/shape_f3f3f3_8.xml
app/src/main/res/drawable/shape_fffad1e0_10_10_0_10.xml
app/src/main/res/drawable/shape_gradient_update_progress.xml
app/src/main/res/layout/acitivity_tourism_experience_detail.xml
app/src/main/res/layout/activity_annual_health_status.xml
app/src/main/res/layout/activity_annual_health_status_detail.xml
app/src/main/res/layout/activity_basic_info.xml
app/src/main/res/layout/activity_certificate_of_honor.xml
app/src/main/res/layout/activity_certificate_of_honor_detail.xml
app/src/main/res/layout/activity_clean_storage.xml
app/src/main/res/layout/activity_clean_storage_detail.xml
app/src/main/res/layout/activity_contacts.xml
app/src/main/res/layout/activity_family_assets.xml
app/src/main/res/layout/activity_family_assets_detail.xml
app/src/main/res/layout/activity_family_memorabilia.xml
app/src/main/res/layout/activity_family_memorabilia_detail.xml
app/src/main/res/layout/activity_genealogy.xml
app/src/main/res/layout/activity_growth_experience.xml
app/src/main/res/layout/activity_health_care.xml
app/src/main/res/layout/activity_home_devices.xml
app/src/main/res/layout/activity_home_devices_detail.xml
app/src/main/res/layout/activity_honor_collection.xml
app/src/main/res/layout/activity_honor_collection_detail.xml
app/src/main/res/layout/activity_hundred_wish.xml
app/src/main/res/layout/activity_hundred_wish_detail.xml
app/src/main/res/layout/activity_income_and_expenses.xml
app/src/main/res/layout/activity_income_and_expenses_detail.xml
app/src/main/res/layout/activity_little_doctor.xml
app/src/main/res/layout/activity_little_doctor_detail.xml
app/src/main/res/layout/activity_login.xml
app/src/main/res/layout/activity_login_bg_change.xml
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_marriage.xml
app/src/main/res/layout/activity_personal_notepad.xml
app/src/main/res/layout/activity_personal_notepad_detail.xml
app/src/main/res/layout/activity_pet.xml
app/src/main/res/layout/activity_pet_detail.xml
app/src/main/res/layout/activity_pet_memo.xml
app/src/main/res/layout/activity_pet_memo_detail.xml
app/src/main/res/layout/activity_privacy.xml
app/src/main/res/layout/activity_privacy_detail.xml
app/src/main/res/layout/activity_property.xml
app/src/main/res/layout/activity_property_detail.xml
app/src/main/res/layout/activity_test.xml
app/src/main/res/layout/activity_tourism.xml
app/src/main/res/layout/activity_tourism_detail.xml
app/src/main/res/layout/activity_tourism_experience.xml
app/src/main/res/layout/dialog_add_daily_consume_record.xml
app/src/main/res/layout/dialog_contacts_info.xml
app/src/main/res/layout/dialog_pet_owner_info.xml
app/src/main/res/layout/dialog_version_update.xml
app/src/main/res/layout/fragment_function.xml
app/src/main/res/layout/fragment_home.xml
app/src/main/res/layout/fragment_image_carousel.xml
app/src/main/res/layout/fragment_personal_center.xml
app/src/main/res/layout/fragment_video.xml
app/src/main/res/layout/item_annual_health_status.xml
app/src/main/res/layout/item_certificate_of_honor.xml
app/src/main/res/layout/item_clean_storage.xml
app/src/main/res/layout/item_consume_record.xml
app/src/main/res/layout/item_contacts.xml
app/src/main/res/layout/item_contacts_detail.xml
app/src/main/res/layout/item_daily_consume_record.xml
app/src/main/res/layout/item_electronic_file.xml
app/src/main/res/layout/item_family_assets.xml
app/src/main/res/layout/item_family_memorabilia.xml
app/src/main/res/layout/item_growth_experience_abroad_condition.xml
app/src/main/res/layout/item_growth_experience_holder_condition.xml
app/src/main/res/layout/item_growth_experience_primary.xml
app/src/main/res/layout/item_growth_experience_relationship.xml
app/src/main/res/layout/item_home_devices.xml
app/src/main/res/layout/item_home_member_list.xml
app/src/main/res/layout/item_honor_collection.xml
app/src/main/res/layout/item_hundred_wish.xml
app/src/main/res/layout/item_image.xml
app/src/main/res/layout/item_income_and_expenses.xml
app/src/main/res/layout/item_little_doctor.xml
app/src/main/res/layout/item_memo.xml
app/src/main/res/layout/item_old_spouse.xml
app/src/main/res/layout/item_personal_notepad.xml
app/src/main/res/layout/item_pet.xml
app/src/main/res/layout/item_pet_image.xml
app/src/main/res/layout/item_pet_memo.xml
app/src/main/res/layout/item_privacy.xml
app/src/main/res/layout/item_property.xml
app/src/main/res/layout/item_tourism.xml
app/src/main/res/layout/item_tourism_experience.xml
app/src/main/res/layout/pop_annual_health_status.xml
app/src/main/res/layout/pop_basic_information.xml
app/src/main/res/layout/pop_operate.xml
app/src/main/res/layout/pop_operate_delete.xml
app/src/main/res/layout/pop_operate_home_root_net.xml
app/src/main/res/layout/pop_operate_person_center.xml
app/src/main/res/layout/pop_operate_pet.xml
app/src/main/res/layout/pop_search.xml (deleted)
app/src/main/res/layout/pop_switch_video_or_image.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/styles.xml
app/src/main/res/values/themes.xml
app/src/main/res/xml/file_paths.xml
app_base/build.gradle
app_base/src/main/assets/roboto_regular.ttf
app_base/src/main/java/com/android/app_base/action/TitleBarAction.java
app_base/src/main/java/com/android/app_base/base/BaseConfig.java
app_base/src/main/java/com/android/app_base/base/adapter/BaseRVAdapter.java
app_base/src/main/java/com/android/app_base/base/adapter/BaseVp2FragmentAdapter.java
app_base/src/main/java/com/android/app_base/base/adapter/EditTextAdapter.java (deleted)
app_base/src/main/java/com/android/app_base/base/adapter/databinding/EditTextAdapter.java
app_base/src/main/java/com/android/app_base/base/adapter/databinding/ImageViewAdapter.java
app_base/src/main/java/com/android/app_base/base/adapter/databinding/TextViewAdapter.java
app_base/src/main/java/com/android/app_base/base/adapter/databinding/ViewAdapter.java
app_base/src/main/java/com/android/app_base/base/view/BaseActivity.java
app_base/src/main/java/com/android/app_base/base/view/BaseFragment.java
app_base/src/main/java/com/android/app_base/base/viewmodel/BaseViewModel.java
app_base/src/main/java/com/android/app_base/http/RetrofitManager.java
app_base/src/main/java/com/android/app_base/utils/Converter.java
app_base/src/main/java/com/android/app_base/utils/RxUtils.java
app_base/src/main/java/com/android/app_base/utils/Utils.java
app_base/src/main/java/com/android/app_base/utils/rxbus/MessageEvent.java
app_base/src/main/java/com/android/app_base/utils/rxbus/RxBus.java
app_base/src/main/java/com/android/app_base/widget/ClearEditText.java
app_base/src/main/res/drawable/input_delete_ic.xml
app_base/src/main/res/font/cookie_regular.ttf
app_base/src/main/res/font/roboto_regular.ttf
app_base/src/main/res/layout/dialog_ui.xml
app_base/src/main/res/layout/wait_dialog.xml
app_base/src/main/res/values/arrts.xml
app_base/src/main/res/values/dimens.xml
app_base/src/main/res/values/styles.xml
screenMatch_example_dimens.xml |