New file |
| | |
| | | zhangshi_app_android |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="CompilerConfiguration"> |
| | | <bytecodeTargetLevel target="11" /> |
| | | <bytecodeTargetLevel target="17" /> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="deploymentTargetDropDown"> |
| | | <value> |
| | | <entry key="AnnualHealthStatusActivity"> |
| | | <State /> |
| | | </entry> |
| | | <entry key="BaseActivity"> |
| | | <State /> |
| | | </entry> |
| | | <entry key="FamilyMemorabiliaActivity"> |
| | | <State /> |
| | | </entry> |
| | | <entry key="MeetingActivity"> |
| | | <State> |
| | | <targetSelectedWithDropDown> |
| | | <Target> |
| | | <type value="QUICK_BOOT_TARGET" /> |
| | | <deviceKey> |
| | | <Key> |
| | | <type value="VIRTUAL_DEVICE_PATH" /> |
| | | <value value="C:\Users\home\.android\avd\Pixel_7_Pro_API_30.avd" /> |
| | | </Key> |
| | | </deviceKey> |
| | | </Target> |
| | | </targetSelectedWithDropDown> |
| | | <timeTargetWasSelectedWithDropDown value="2024-04-30T04:26:21.217761800Z" /> |
| | | </State> |
| | | </entry> |
| | | <entry key="TextActivity"> |
| | | <State> |
| | | <targetSelectedWithDropDown> |
| | | <Target> |
| | | <type value="QUICK_BOOT_TARGET" /> |
| | | <deviceKey> |
| | | <Key> |
| | | <type value="VIRTUAL_DEVICE_PATH" /> |
| | | <value value="C:\Users\home\.android\avd\Pixel_7_Pro_API_30.avd" /> |
| | | </Key> |
| | | </deviceKey> |
| | | </Target> |
| | | </targetSelectedWithDropDown> |
| | | <timeTargetWasSelectedWithDropDown value="2024-04-01T07:28:32.980539900Z" /> |
| | | </State> |
| | | </entry> |
| | | <entry key="app"> |
| | | <State> |
| | | <targetSelectedWithDropDown> |
| | | <Target> |
| | | <type value="QUICK_BOOT_TARGET" /> |
| | | <deviceKey> |
| | | <Key> |
| | | <type value="VIRTUAL_DEVICE_PATH" /> |
| | | <value value="C:\Users\home\.android\avd\Pixel_7_Pro_API_30.avd" /> |
| | | </Key> |
| | | </deviceKey> |
| | | </Target> |
| | | </targetSelectedWithDropDown> |
| | | <timeTargetWasSelectedWithDropDown value="2024-05-07T02:34:49.481997500Z" /> |
| | | </State> |
| | | </entry> |
| | | </value> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="JavaDocConfiguration"> |
| | | <GENERAL> |
| | | <MODE>UPDATE</MODE> |
| | | <OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS> |
| | | <SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME> |
| | | <LEVELS> |
| | | <LEVEL>METHOD</LEVEL> |
| | | <LEVEL>FIELD</LEVEL> |
| | | <LEVEL>TYPE</LEVEL> |
| | | </LEVELS> |
| | | <VISIBILITIES> |
| | | <VISIBILITY>DEFAULT</VISIBILITY> |
| | | <VISIBILITY>PROTECTED</VISIBILITY> |
| | | <VISIBILITY>PUBLIC</VISIBILITY> |
| | | </VISIBILITIES> |
| | | </GENERAL> |
| | | <TEMPLATES> |
| | | <CLASSES> |
| | | <CLASS> |
| | | <KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY> |
| | | <VALUE>/**\n |
| | | * The interface ${name}.\n |
| | | <#if element.typeParameters?has_content> * \n |
| | | </#if> |
| | | <#list element.typeParameters as typeParameter> |
| | | * @param <${typeParameter.name}> the type parameter\n |
| | | </#list> |
| | | */</VALUE> |
| | | </CLASS> |
| | | <CLASS> |
| | | <KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY> |
| | | <VALUE>/**\n |
| | | * The enum ${name}.\n |
| | | */</VALUE> |
| | | </CLASS> |
| | | <CLASS> |
| | | <KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY> |
| | | <VALUE>/**\n |
| | | * The type ${name}.\n |
| | | <#if element.typeParameters?has_content> * \n |
| | | </#if> |
| | | <#list element.typeParameters as typeParameter> |
| | | * @param <${typeParameter.name}> the type parameter\n |
| | | </#list> |
| | | */</VALUE> |
| | | </CLASS> |
| | | <CLASS> |
| | | <KEY>.+</KEY> |
| | | <VALUE>/**\n |
| | | * The type ${name}.\n |
| | | */</VALUE> |
| | | </CLASS> |
| | | </CLASSES> |
| | | <CONSTRUCTORS> |
| | | <CONSTRUCTOR> |
| | | <KEY>.+</KEY> |
| | | <VALUE>/**\n |
| | | * Instantiates a new ${name}.\n |
| | | <#if element.parameterList.parameters?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.parameterList.parameters as parameter> |
| | | * @param ${parameter.name} the ${paramNames[parameter.name]}\n |
| | | </#list> |
| | | <#if element.throwsList.referenceElements?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.throwsList.referenceElements as exception> |
| | | * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n |
| | | </#list> |
| | | */</VALUE> |
| | | </CONSTRUCTOR> |
| | | </CONSTRUCTORS> |
| | | <METHODS> |
| | | <METHOD> |
| | | <KEY>^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+</KEY> |
| | | <VALUE>/**\n |
| | | * Gets ${partName}.\n |
| | | <#if element.typeParameters?has_content> * \n |
| | | </#if> |
| | | <#list element.typeParameters as typeParameter> |
| | | * @param <${typeParameter.name}> the type parameter\n |
| | | </#list> |
| | | <#if element.parameterList.parameters?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.parameterList.parameters as parameter> |
| | | * @param ${parameter.name} the ${paramNames[parameter.name]}\n |
| | | </#list> |
| | | <#if isNotVoid> |
| | | *\n |
| | | * @return the ${partName}\n |
| | | </#if> |
| | | <#if element.throwsList.referenceElements?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.throwsList.referenceElements as exception> |
| | | * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n |
| | | </#list> |
| | | */</VALUE> |
| | | </METHOD> |
| | | <METHOD> |
| | | <KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+</KEY> |
| | | <VALUE>/**\n |
| | | * Sets ${partName}.\n |
| | | <#if element.typeParameters?has_content> * \n |
| | | </#if> |
| | | <#list element.typeParameters as typeParameter> |
| | | * @param <${typeParameter.name}> the type parameter\n |
| | | </#list> |
| | | <#if element.parameterList.parameters?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.parameterList.parameters as parameter> |
| | | * @param ${parameter.name} the ${paramNames[parameter.name]}\n |
| | | </#list> |
| | | <#if isNotVoid> |
| | | *\n |
| | | * @return the ${partName}\n |
| | | </#if> |
| | | <#if element.throwsList.referenceElements?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.throwsList.referenceElements as exception> |
| | | * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n |
| | | </#list> |
| | | */</VALUE> |
| | | </METHOD> |
| | | <METHOD> |
| | | <KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY> |
| | | <VALUE>/**\n |
| | | * The entry point of application.\n |
| | | |
| | | <#if element.parameterList.parameters?has_content> |
| | | *\n |
| | | </#if> |
| | | * @param ${element.parameterList.parameters[0].name} the input arguments\n |
| | | <#if element.throwsList.referenceElements?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.throwsList.referenceElements as exception> |
| | | * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n |
| | | </#list> |
| | | */</VALUE> |
| | | </METHOD> |
| | | <METHOD> |
| | | <KEY>.+</KEY> |
| | | <VALUE>/**\n |
| | | * ${name}<#if isNotVoid> ${return}</#if>.\n |
| | | <#if element.typeParameters?has_content> * \n |
| | | </#if> |
| | | <#list element.typeParameters as typeParameter> |
| | | * @param <${typeParameter.name}> the type parameter\n |
| | | </#list> |
| | | <#if element.parameterList.parameters?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.parameterList.parameters as parameter> |
| | | * @param ${parameter.name} the ${paramNames[parameter.name]}\n |
| | | </#list> |
| | | <#if isNotVoid> |
| | | *\n |
| | | * @return the ${return}\n |
| | | </#if> |
| | | <#if element.throwsList.referenceElements?has_content> |
| | | *\n |
| | | </#if> |
| | | <#list element.throwsList.referenceElements as exception> |
| | | * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n |
| | | </#list> |
| | | */</VALUE> |
| | | </METHOD> |
| | | </METHODS> |
| | | <FIELDS> |
| | | <FIELD> |
| | | <KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY> |
| | | <VALUE>/**\n |
| | | * The constant ${element.getName()}.\n |
| | | */</VALUE> |
| | | </FIELD> |
| | | <FIELD> |
| | | <KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY> |
| | | <VALUE>/**\n |
| | | <#if element.parent.isInterface()> |
| | | * The constant ${element.getName()}.\n |
| | | <#else> |
| | | * The ${name}.\n |
| | | </#if> */</VALUE> |
| | | </FIELD> |
| | | <FIELD> |
| | | <KEY>.+</KEY> |
| | | <VALUE>/**\n |
| | | <#if element.parent.isEnum()> |
| | | *${name} ${typeName}.\n |
| | | <#else> |
| | | * The ${name}.\n |
| | | </#if>*/</VALUE> |
| | | </FIELD> |
| | | </FIELDS> |
| | | </TEMPLATES> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="ProjectMigrations"> |
| | | <option name="MigrateToGradleLocalJavaHome"> |
| | | <set> |
| | | <option value="$PROJECT_DIR$" /> |
| | | </set> |
| | | </option> |
| | | </component> |
| | | </project> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="ExternalStorageConfigurationManager" enabled="true" /> |
| | | <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK"> |
| | | <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> |
| | | <output url="file://$PROJECT_DIR$/build/classes" /> |
| | | </component> |
| | | <component name="ProjectType"> |
| | |
| | | implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1' |
| | | implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1' |
| | | implementation 'com.google.android.material:material:1.8.0' |
| | | |
| | | testImplementation 'junit:junit:4.13.2' |
| | | androidTestImplementation 'androidx.test.ext:junit:1.1.5' |
| | | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' |
| | |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | > |
| | | <!-- 网络相关 --> |
| | | <uses-feature |
| | | android:name="android.hardware.camera" |
| | | android:required="false" /> |
| | | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 网络状态 --> |
| | | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- wifi状态 --> |
| | | <uses-permission android:name="android.permission.INTERNET" /> <!-- 网络 --> |
| | |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" |
| | | /> |
| | | |
| | | <activity |
| | | android:name=".ui.function.MeetingActivity" |
| | | android:exported="true" |
| | | android:screenOrientation="portrait" /> |
| | | <activity |
| | | android:name=".ui.function.MeetingDetailActivity" |
| | | android:exported="true" |
| | | android:screenOrientation="portrait" |
| | | /> |
| | | <activity |
| | | android:name=".ui.function.MeetingapproveActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" /> |
| | | <activity |
| | | android:name=".ui.function.MeetingapproveDetailActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" |
| | | /> |
| | | <activity |
| | | android:name=".ui.function.MeetingStaActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" /> |
| | | |
| | | <activity |
| | | android:name=".ui.function.MeetingStaDetailActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" /> |
| | | |
| | | |
| | | <activity android:name=".ui.function.WebcastActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" |
| | | /> |
| | | |
| | | <activity android:name=".ui.function.WebcastDetailActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" |
| | | /> |
| | | |
| | | <activity android:name=".ui.function.WebbackActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" |
| | | /> |
| | | |
| | | <activity android:name=".ui.function.WebbackDetailActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" |
| | | /> |
| | | |
| | | <activity |
| | | android:name=".ui.function.FamilyAssetsActivity" |
| | | android:exported="false" |
| | |
| | | android:name=".ui.function.FamilyAssetsDetailActivity" |
| | | android:exported="false" |
| | | android:screenOrientation="portrait" /> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <activity |
| | | android:name=".ui.function.HomeDevicesActivity" |
| | | android:exported="false" |
| | |
| | | android:screenOrientation="portrait" /> |
| | | <activity |
| | | android:name=".ui.function.CertificateOfHonorActivity" |
| | | android:exported="false" |
| | | android:exported="true" |
| | | android:screenOrientation="portrait" /> |
| | | <activity |
| | | android:name=".ui.function.CertificateOfHonorDetailActivity" |
| | |
| | | android:screenOrientation="portrait" /> |
| | | <activity |
| | | android:name=".ui.function.AnnualHealthStatusActivity" |
| | | android:exported="false" |
| | | android:exported="true" |
| | | android:screenOrientation="portrait" /> |
| | | <activity |
| | | android:name=".ui.function.AnnualHealthStatusDetailActivity" |
| | |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | |
| | | 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.FamilyMemorabiliaDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | private final Map<FamilyMemorabiliaBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | |
| | | //接受一个上下文参数,用于初始化函数 |
| | | public FamilyMemorabiliaRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | //除了上下文参数外,还接受一个view Model对象作为参数,用于与视图模型进行交互和数据绑定 |
| | | public FamilyMemorabiliaRvAdapter(Context context, FamilyMemorabiliaActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | |
| | | //绑定item视图 |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_family_memorabilia; |
| | | } |
| | | |
| | | //创建视图持有者对象并返回,用于绑定视图和数据 |
| | | @Override |
| | | protected MyViewHolder getViewHolder(ItemFamilyMemorabiliaBinding itemBind,int viewType) { |
| | | return new MyViewHolder(itemBind); |
| | | } |
| | | |
| | | |
| | | //onBind() |
| | | @Override |
| | | protected void onBind(MyViewHolder holder, int position) { |
| | | //将当前位置的数据绑定到视图持有者中的布局绑定对象上,以便显示相应的家庭纪念品数据。 |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | |
| | | //typeValue1 存储解析后的属性值 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | |
| | | // |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | //position为奇数的时候,用typedValue1作为背景色,偶数时用typedValue2。 |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | |
| | | //expendMap 是一个用于存储列表项展开状态的 Map, |
| | | // 这里用来检查当前位置对应的数据是否已经在 Map 中存在, |
| | | // 如果不存在,则将其添加到 Map 中,并设置其展开状态为 false。 |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | |
| | | |
| | | |
| | | //根据主题选择对应图标 |
| | | TypedValue unfoldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icUnfold, unfoldIcon, true); |
| | | TypedValue foldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icFold, foldIcon, true); |
| | | |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | //这段代码的作用是根据条件显示或隐藏复选框,并在用户选择列表项时更新相应的 LiveData 数据以及界面上的复选框状态 |
| | | if (isCheckable){ |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | |
| | | }else { |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | holder.getBinding().checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
| | |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | //如果expendMap 中存储的当前位置的状态是 true,表示当前视图是展开状态,需要执行折叠操作: |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | |
| | | //获取卡片视图的初始高度 |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //获取标题布局的高度。 |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | |
| | | //调用 Utils.pullCollapse() 方法执行折叠动画,并传入卡片视图的初始高度和标题布局的高度。 |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | |
| | | //将状态设置为折叠 |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | //获取卡片视图的初始高度 initialHeight。 |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //测量卡片视图的目标高度 targetHeight |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //调用 Utils.dropExpand() 方法执行展开动画,并传入卡片视图的初始高度和目标高度。 |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | //更新折叠图标为展开状态。 |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //设置监听事件,当用户点击holder.itemView时,执行下面操作 |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 FamilyMemorabiliaDetailActivity 活动。 |
| | | |
| | | |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), FamilyMemorabiliaDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_modify时,执行下面操作 |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 FamilyMemorabiliaDetailActivity 活动。 |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), FamilyMemorabiliaDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_delete时,执行下面操作 |
| | | holder.getBinding().layoutDelete.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | |
| | | .show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //ElectronicFileAdapter 适配器来显示电子文件列表,并将其绑定到 视图layout中的rv_image |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //notifyItemRangeChanged(0, getItemCount()) 方法,通知适配器范围内的项已更改,以便在 RecyclerView 中更新相应的视图。 |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | 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.MeetingBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemMeetingBinding; |
| | | import com.application.zhangshi_app_android.ui.function.MeetingActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.MeetingDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:27 |
| | | * @desc 家大事记 recyclerView 的 adapter |
| | | */ |
| | | public class MeetingRvAdapter extends BaseRVAdapter<MeetingBean, ItemMeetingBinding, MeetingRvAdapter.MyViewHolder> { |
| | | |
| | | private MeetingActivityViewModel viewModel; |
| | | private final Map<MeetingBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | |
| | | //接受一个上下文参数,用于初始化函数 |
| | | public MeetingRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | //除了上下文参数外,还接受一个view Model对象作为参数,用于与视图模型进行交互和数据绑定 |
| | | public MeetingRvAdapter(Context context, MeetingActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | |
| | | //绑定item视图 |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_meeting; |
| | | } |
| | | |
| | | //创建视图持有者对象并返回,用于绑定视图和数据 |
| | | @Override |
| | | protected MyViewHolder getViewHolder(ItemMeetingBinding itemBind, int viewType) { |
| | | return new MyViewHolder(itemBind); |
| | | } |
| | | |
| | | |
| | | //onBind() |
| | | @Override |
| | | protected void onBind(MyViewHolder holder, int position) { |
| | | //将当前位置的数据绑定到视图持有者中的布局绑定对象上,以便显示相应的家庭纪念品数据。 |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | |
| | | //typeValue1 存储解析后的属性值 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | |
| | | // |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | //position为奇数的时候,用typedValue1作为背景色,偶数时用typedValue2。 |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | |
| | | //expendMap 是一个用于存储列表项展开状态的 Map, |
| | | // 这里用来检查当前位置对应的数据是否已经在 Map 中存在, |
| | | // 如果不存在,则将其添加到 Map 中,并设置其展开状态为 false。 |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | |
| | | |
| | | |
| | | //根据主题选择对应图标 |
| | | TypedValue unfoldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icUnfold, unfoldIcon, true); |
| | | TypedValue foldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icFold, foldIcon, true); |
| | | |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | //这段代码的作用是根据条件显示或隐藏复选框,并在用户选择列表项时更新相应的 LiveData 数据以及界面上的复选框状态 |
| | | if (isCheckable){ |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | 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<MeetingBean> 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); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().ivFlower.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | //如果expendMap 中存储的当前位置的状态是 true,表示当前视图是展开状态,需要执行折叠操作: |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | |
| | | //获取卡片视图的初始高度 |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //获取标题布局的高度。 |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | |
| | | //调用 Utils.pullCollapse() 方法执行折叠动画,并传入卡片视图的初始高度和标题布局的高度。 |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | |
| | | //将状态设置为折叠 |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | //获取卡片视图的初始高度 initialHeight。 |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //测量卡片视图的目标高度 targetHeight |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //调用 Utils.dropExpand() 方法执行展开动画,并传入卡片视图的初始高度和目标高度。 |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | //更新折叠图标为展开状态。 |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //设置监听事件,当用户点击holder.itemView时,执行下面操作 |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 MeetingDetailActivity 活动。 |
| | | |
| | | |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), MeetingDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_modify时,执行下面操作 |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 FamilyMemorabiliaDetailActivity 活动。 |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), MeetingDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_delete时,执行下面操作 |
| | | 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 适配器来显示电子文件列表,并将其绑定到 视图layout中的rv_image |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //notifyItemRangeChanged(0, getItemCount()) 方法,通知适配器范围内的项已更改,以便在 RecyclerView 中更新相应的视图。 |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | |
| | | public static class MyViewHolder extends BaseViewHolder<ItemMeetingBinding>{ |
| | | public MyViewHolder(ItemMeetingBinding binding) { |
| | | super(binding); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | | |
| | | 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.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemMeetingStaBinding; |
| | | import com.application.zhangshi_app_android.ui.function.MeetingStaActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.MeetingStaDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:27 |
| | | * @desc 家大事记 recyclerView 的 adapter |
| | | */ |
| | | public class MeetingStaRvAdapter extends BaseRVAdapter<MeetingStaBean, ItemMeetingStaBinding, MeetingStaRvAdapter.MyViewHolder> { |
| | | |
| | | private MeetingStaActivityViewModel viewModel; |
| | | private final Map<MeetingStaBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | |
| | | //接受一个上下文参数,用于初始化函数 |
| | | public MeetingStaRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | //除了上下文参数外,还接受一个view Model对象作为参数,用于与视图模型进行交互和数据绑定 |
| | | public MeetingStaRvAdapter(Context context, MeetingStaActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | |
| | | //绑定item视图 |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_meeting_sta; |
| | | } |
| | | |
| | | //创建视图持有者对象并返回,用于绑定视图和数据 |
| | | @Override |
| | | protected MyViewHolder getViewHolder(ItemMeetingStaBinding itemBind, int viewType) { |
| | | return new MyViewHolder(itemBind); |
| | | } |
| | | |
| | | |
| | | //onBind() |
| | | @Override |
| | | protected void onBind(MyViewHolder holder, int position) { |
| | | //将当前位置的数据绑定到视图持有者中的布局绑定对象上,以便显示相应的家庭纪念品数据。 |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | |
| | | //typeValue1 存储解析后的属性值 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | |
| | | // |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | //position为奇数的时候,用typedValue1作为背景色,偶数时用typedValue2。 |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | |
| | | //expendMap 是一个用于存储列表项展开状态的 Map, |
| | | // 这里用来检查当前位置对应的数据是否已经在 Map 中存在, |
| | | // 如果不存在,则将其添加到 Map 中,并设置其展开状态为 false。 |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | |
| | | |
| | | |
| | | //根据主题选择对应图标 |
| | | TypedValue unfoldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icUnfold, unfoldIcon, true); |
| | | TypedValue foldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icFold, foldIcon, true); |
| | | |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | //这段代码的作用是根据条件显示或隐藏复选框,并在用户选择列表项时更新相应的 LiveData 数据以及界面上的复选框状态 |
| | | if (isCheckable){ |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | 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<MeetingStaBean> 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); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().ivFlower.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | //如果expendMap 中存储的当前位置的状态是 true,表示当前视图是展开状态,需要执行折叠操作: |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | |
| | | //获取卡片视图的初始高度 |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //获取标题布局的高度。 |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | |
| | | //调用 Utils.pullCollapse() 方法执行折叠动画,并传入卡片视图的初始高度和标题布局的高度。 |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | |
| | | //将状态设置为折叠 |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | //获取卡片视图的初始高度 initialHeight。 |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //测量卡片视图的目标高度 targetHeight |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //调用 Utils.dropExpand() 方法执行展开动画,并传入卡片视图的初始高度和目标高度。 |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | //更新折叠图标为展开状态。 |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //设置监听事件,当用户点击holder.itemView时,执行下面操作 |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 MeetingDetailActivity 活动。 |
| | | |
| | | |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), MeetingStaDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // //设置监听事件,当用户点击layout中对应的layout_modify时,执行下面操作 |
| | | // holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // //创建一个新的 Intent 对象,该对象用于启动 FamilyMemorabiliaDetailActivity 活动。 |
| | | // AppManager.getAppManager().startActivity( |
| | | // new Intent(getRecyclerView().getContext(), MeetingStaDetailActivity.class) |
| | | // .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | // .putExtra("bean",mDataList.get(position))); |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_delete时,执行下面操作 |
| | | // 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 适配器来显示电子文件列表,并将其绑定到 视图layout中的rv_image |
| | | // 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //notifyItemRangeChanged(0, getItemCount()) 方法,通知适配器范围内的项已更改,以便在 RecyclerView 中更新相应的视图。 |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | |
| | | public static class MyViewHolder extends BaseViewHolder<ItemMeetingStaBinding>{ |
| | | public MyViewHolder(ItemMeetingStaBinding binding) { |
| | | super(binding); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | 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.MeetingBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemMeetingApproveBinding; |
| | | import com.application.zhangshi_app_android.ui.function.MeetingapproveActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.MeetingapproveDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:27 |
| | | * @desc 家大事记 recyclerView 的 adapter |
| | | */ |
| | | public class MeetingapproveRvAdapter extends BaseRVAdapter<MeetingBean, ItemMeetingApproveBinding, MeetingapproveRvAdapter.MyViewHolder> { |
| | | |
| | | private MeetingapproveActivityViewModel viewModel; |
| | | private final Map<MeetingBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | |
| | | //接受一个上下文参数,用于初始化函数 |
| | | public MeetingapproveRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | //除了上下文参数外,还接受一个view Model对象作为参数,用于与视图模型进行交互和数据绑定 |
| | | public MeetingapproveRvAdapter(Context context, MeetingapproveActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | |
| | | //绑定item视图 |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_meeting_approve; |
| | | } |
| | | |
| | | //创建视图持有者对象并返回,用于绑定视图和数据 |
| | | @Override |
| | | protected MyViewHolder getViewHolder(ItemMeetingApproveBinding itemBind, int viewType) { |
| | | return new MyViewHolder(itemBind); |
| | | } |
| | | |
| | | |
| | | //onBind() |
| | | @Override |
| | | protected void onBind(MyViewHolder holder, int position) { |
| | | //将当前位置的数据绑定到视图持有者中的布局绑定对象上,以便显示相应的家庭纪念品数据。 |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | |
| | | //typeValue1 存储解析后的属性值 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | |
| | | // |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | //position为奇数的时候,用typedValue1作为背景色,偶数时用typedValue2。 |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | |
| | | //expendMap 是一个用于存储列表项展开状态的 Map, |
| | | // 这里用来检查当前位置对应的数据是否已经在 Map 中存在, |
| | | // 如果不存在,则将其添加到 Map 中,并设置其展开状态为 false。 |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | |
| | | |
| | | |
| | | //根据主题选择对应图标 |
| | | TypedValue unfoldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icUnfold, unfoldIcon, true); |
| | | TypedValue foldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icFold, foldIcon, true); |
| | | |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | //这段代码的作用是根据条件显示或隐藏复选框,并在用户选择列表项时更新相应的 LiveData 数据以及界面上的复选框状态 |
| | | if (isCheckable){ |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | 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<MeetingBean> 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); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().ivFlower.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | //如果expendMap 中存储的当前位置的状态是 true,表示当前视图是展开状态,需要执行折叠操作: |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | |
| | | //获取卡片视图的初始高度 |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //获取标题布局的高度。 |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | |
| | | //调用 Utils.pullCollapse() 方法执行折叠动画,并传入卡片视图的初始高度和标题布局的高度。 |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | |
| | | //将状态设置为折叠 |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | //获取卡片视图的初始高度 initialHeight。 |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //测量卡片视图的目标高度 targetHeight |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //调用 Utils.dropExpand() 方法执行展开动画,并传入卡片视图的初始高度和目标高度。 |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | //更新折叠图标为展开状态。 |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //设置监听事件,当用户点击holder.itemView时,执行下面操作 |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 MeetingDetailActivity 活动。 |
| | | |
| | | |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), MeetingapproveDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_modify时,执行下面操作 |
| | | holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 FamilyMemorabiliaDetailActivity 活动。 |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), MeetingapproveDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_delete时,执行下面操作 |
| | | 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 适配器来显示电子文件列表,并将其绑定到 视图layout中的rv_image |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //notifyItemRangeChanged(0, getItemCount()) 方法,通知适配器范围内的项已更改,以便在 RecyclerView 中更新相应的视图。 |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | |
| | | public static class MyViewHolder extends BaseViewHolder<ItemMeetingApproveBinding>{ |
| | | public MyViewHolder(ItemMeetingApproveBinding binding) { |
| | | super(binding); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | 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.WebcastBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemWebcastBinding; |
| | | import com.application.zhangshi_app_android.ui.function.WebcastActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.WebcastDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:27 |
| | | * @desc 家大事记 recyclerView 的 adapter |
| | | */ |
| | | public class WebcastRvAdapter extends BaseRVAdapter<WebcastBean, ItemWebcastBinding, WebcastRvAdapter.MyViewHolder> { |
| | | |
| | | private WebcastActivityViewModel viewModel; |
| | | private final Map<WebcastBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | |
| | | //接受一个上下文参数,用于初始化函数 |
| | | public WebcastRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | //除了上下文参数外,还接受一个view Model对象作为参数,用于与视图模型进行交互和数据绑定 |
| | | public WebcastRvAdapter(Context context, WebcastActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | |
| | | //绑定item视图 |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_webcast; |
| | | } |
| | | |
| | | //创建视图持有者对象并返回,用于绑定视图和数据 |
| | | @Override |
| | | protected MyViewHolder getViewHolder(ItemWebcastBinding itemBind, int viewType) { |
| | | return new MyViewHolder(itemBind); |
| | | } |
| | | |
| | | |
| | | //onBind() |
| | | @Override |
| | | protected void onBind(MyViewHolder holder, int position) { |
| | | //将当前位置的数据绑定到视图持有者中的布局绑定对象上,以便显示相应的家庭纪念品数据。 |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | |
| | | //typeValue1 存储解析后的属性值 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | |
| | | // |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | //position为奇数的时候,用typedValue1作为背景色,偶数时用typedValue2。 |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | |
| | | //expendMap 是一个用于存储列表项展开状态的 Map, |
| | | // 这里用来检查当前位置对应的数据是否已经在 Map 中存在, |
| | | // 如果不存在,则将其添加到 Map 中,并设置其展开状态为 false。 |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | |
| | | |
| | | |
| | | //根据主题选择对应图标 |
| | | TypedValue unfoldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icUnfold, unfoldIcon, true); |
| | | TypedValue foldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icFold, foldIcon, true); |
| | | |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | //这段代码的作用是根据条件显示或隐藏复选框,并在用户选择列表项时更新相应的 LiveData 数据以及界面上的复选框状态 |
| | | if (isCheckable){ |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | 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<WebcastBean> 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); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().ivFlower.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | //如果expendMap 中存储的当前位置的状态是 true,表示当前视图是展开状态,需要执行折叠操作: |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | |
| | | //获取卡片视图的初始高度 |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //获取标题布局的高度。 |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | |
| | | //调用 Utils.pullCollapse() 方法执行折叠动画,并传入卡片视图的初始高度和标题布局的高度。 |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | |
| | | //将状态设置为折叠 |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | //获取卡片视图的初始高度 initialHeight。 |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //测量卡片视图的目标高度 targetHeight |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //调用 Utils.dropExpand() 方法执行展开动画,并传入卡片视图的初始高度和目标高度。 |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | //更新折叠图标为展开状态。 |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //设置监听事件,当用户点击holder.itemView时,执行下面操作 |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 WebcastDetailActivity 活动。 |
| | | |
| | | |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), WebcastDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_modify时,执行下面操作 |
| | | // holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // //创建一个新的 Intent 对象,该对象用于启动 FamilyMemorabiliaDetailActivity 活动。 |
| | | // AppManager.getAppManager().startActivity( |
| | | // new Intent(getRecyclerView().getContext(), MeetingDetailActivity.class) |
| | | // .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | // .putExtra("bean",mDataList.get(position))); |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_delete时,执行下面操作 |
| | | // 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 适配器来显示电子文件列表,并将其绑定到 视图layout中的rv_image |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //notifyItemRangeChanged(0, getItemCount()) 方法,通知适配器范围内的项已更改,以便在 RecyclerView 中更新相应的视图。 |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | |
| | | public static class MyViewHolder extends BaseViewHolder<ItemWebcastBinding>{ |
| | | public MyViewHolder(ItemWebcastBinding binding) { |
| | | super(binding); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.application.zhangshi_app_android.adapter.databinding; |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | 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.adapter.ElectronicFileAdapter; |
| | | import com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemWebbackBinding; |
| | | import com.application.zhangshi_app_android.ui.function.WebbackActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.WebbackDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:27 |
| | | * @desc 家大事记 recyclerView 的 adapter |
| | | */ |
| | | public class WebbackRvAdapter extends BaseRVAdapter<WebbackBean, ItemWebbackBinding, WebbackRvAdapter.MyViewHolder> { |
| | | |
| | | private WebbackActivityViewModel viewModel; |
| | | private final Map<WebbackBean, Boolean> expendMap = new HashMap<>(); |
| | | private boolean isCheckable; |
| | | |
| | | |
| | | //接受一个上下文参数,用于初始化函数 |
| | | public WebbackRvAdapter(Context context) { |
| | | super(context); |
| | | } |
| | | |
| | | //除了上下文参数外,还接受一个view Model对象作为参数,用于与视图模型进行交互和数据绑定 |
| | | public WebbackRvAdapter(Context context, WebbackActivityViewModel viewModel) { |
| | | super(context); |
| | | this.viewModel = viewModel; |
| | | } |
| | | |
| | | |
| | | //绑定item视图 |
| | | @Override |
| | | protected int getLayoutId() { |
| | | return R.layout.item_webback; |
| | | } |
| | | |
| | | //创建视图持有者对象并返回,用于绑定视图和数据 |
| | | @Override |
| | | protected MyViewHolder getViewHolder(ItemWebbackBinding itemBind, int viewType) { |
| | | return new MyViewHolder(itemBind); |
| | | } |
| | | |
| | | |
| | | //onBind() |
| | | @Override |
| | | protected void onBind(MyViewHolder holder, int position) { |
| | | //将当前位置的数据绑定到视图持有者中的布局绑定对象上,以便显示相应的家庭纪念品数据。 |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | |
| | | //typeValue1 存储解析后的属性值 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | |
| | | // |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | //position为奇数的时候,用typedValue1作为背景色,偶数时用typedValue2。 |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | |
| | | //expendMap 是一个用于存储列表项展开状态的 Map, |
| | | // 这里用来检查当前位置对应的数据是否已经在 Map 中存在, |
| | | // 如果不存在,则将其添加到 Map 中,并设置其展开状态为 false。 |
| | | if (!expendMap.containsKey(getItem(position))){ |
| | | expendMap.put(getItem(position),false); |
| | | } |
| | | |
| | | |
| | | |
| | | //根据主题选择对应图标 |
| | | TypedValue unfoldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icUnfold, unfoldIcon, true); |
| | | TypedValue foldIcon = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icFold, foldIcon, true); |
| | | |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = FrameLayout.LayoutParams.WRAP_CONTENT; |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | }else{ |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | //这段代码的作用是根据条件显示或隐藏复选框,并在用户选择列表项时更新相应的 LiveData 数据以及界面上的复选框状态 |
| | | if (isCheckable){ |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().checkbox.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().checkbox.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | 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<WebbackBean> 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); |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().ivFlower.setVisibility(View.VISIBLE); |
| | | }else { |
| | | holder.getBinding().ivFlower.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | holder.getBinding().layoutTitle.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | //如果expendMap 中存储的当前位置的状态是 true,表示当前视图是展开状态,需要执行折叠操作: |
| | | if (Boolean.TRUE.equals(expendMap.get(getItem(position)))){ |
| | | |
| | | //获取卡片视图的初始高度 |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //获取标题布局的高度。 |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | |
| | | //调用 Utils.pullCollapse() 方法执行折叠动画,并传入卡片视图的初始高度和标题布局的高度。 |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | |
| | | //将状态设置为折叠 |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | //获取卡片视图的初始高度 initialHeight。 |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //测量卡片视图的目标高度 targetHeight |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | //调用 Utils.dropExpand() 方法执行展开动画,并传入卡片视图的初始高度和目标高度。 |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | //更新折叠图标为展开状态。 |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //设置监听事件,当用户点击holder.itemView时,执行下面操作 |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //创建一个新的 Intent 对象,该对象用于启动 WebbackDetailActivity 活动。 |
| | | |
| | | |
| | | AppManager.getAppManager().startActivity( |
| | | new Intent(getRecyclerView().getContext(), WebbackDetailActivity.class) |
| | | .putExtra(BaseConfig.EXTRA_TYPE,0) |
| | | .putExtra("bean",mDataList.get(position))); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_modify时,执行下面操作 |
| | | // holder.getBinding().layoutModify.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // //创建一个新的 Intent 对象,该对象用于启动 FamilyMemorabiliaDetailActivity 活动。 |
| | | // AppManager.getAppManager().startActivity( |
| | | // new Intent(getRecyclerView().getContext(), WebbackDetailActivity.class) |
| | | // .putExtra(BaseConfig.EXTRA_TYPE,2) |
| | | // .putExtra("bean",mDataList.get(position))); |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | //设置监听事件,当用户点击layout中对应的layout_delete时,执行下面操作 |
| | | // 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 适配器来显示电子文件列表,并将其绑定到 视图layout中的rv_image |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //notifyItemRangeChanged(0, getItemCount()) 方法,通知适配器范围内的项已更改,以便在 RecyclerView 中更新相应的视图。 |
| | | public void setCheckable(boolean b) { |
| | | isCheckable = b; |
| | | notifyItemRangeChanged(0,getItemCount()); |
| | | } |
| | | |
| | | |
| | | public static class MyViewHolder extends BaseViewHolder<ItemWebbackBinding>{ |
| | | public MyViewHolder(ItemWebbackBinding binding) { |
| | | super(binding); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | public class MeetingBean implements Serializable{ |
| | | private long id; |
| | | private String title; |
| | | private String place; |
| | | private String conPeople; |
| | | |
| | | public String getHappenTime() { |
| | | // happenTime = happenTime.split(" ")[0]; |
| | | return happenTime; |
| | | } |
| | | |
| | | public void setHappenTime(String happenTime) { |
| | | this.happenTime = happenTime; |
| | | } |
| | | |
| | | private String happenTime; |
| | | private transient int familyId;//所属家庭 id |
| | | |
| | | public int getFamilyId() { |
| | | return familyId; |
| | | } |
| | | |
| | | public void setFamilyId(int familyId) { |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public String getConn_Phone() { |
| | | return conn_Phone; |
| | | } |
| | | |
| | | public void setConn_Phone(String conn_Phone) { |
| | | this.conn_Phone = conn_Phone; |
| | | } |
| | | |
| | | private int ownData = 1;//是否是自己家庭的数据 1 是 0 不是 |
| | | |
| | | |
| | | |
| | | public String getPartPeople() { |
| | | return partPeople; |
| | | } |
| | | |
| | | public void setPartPeople(String partPeople) { |
| | | this.partPeople = partPeople; |
| | | } |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | public String getApplyApart() { |
| | | // applyApart = applyPerson + dd1; |
| | | return applyApart; |
| | | } |
| | | |
| | | public void setApplyApart(String applyApart) { |
| | | this.applyApart = applyApart; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | if(getDate1()!=null){ |
| | | if(getTime1()==null){ |
| | | startTime = getDate1().toString()+" 00:00:00"; |
| | | } |
| | | if (getTime1()!=null){ |
| | | startTime = getDate1().toString() +" "+ getTime1().toString(); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | // public void setStartTime(String startTime) { |
| | | // if (getDate1().toString() != null) { |
| | | // if (getTime1().toString() == null) { |
| | | // this.startTime = getDate1().toString() + " 00:00:00"; |
| | | // } else { |
| | | // this.startTime = getDate1().toString() + " " + getTime1().toString(); |
| | | // } |
| | | // } |
| | | // this.startTime = startTime; |
| | | // } |
| | | |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | if (getDate2()!=null){ |
| | | if(getTime2()==null){ |
| | | endTime = getDate2() + " 00:00:00"; |
| | | } |
| | | if (getTime2()!=null){ |
| | | endTime = getDate2() + " " +getTime2(); |
| | | } |
| | | } |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | // 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 getConnPhone() { |
| | | return connPhone; |
| | | } |
| | | |
| | | public void setConnPhone(String connPhone) { |
| | | this.connPhone = connPhone; |
| | | } |
| | | |
| | | |
| | | public String getConPeople() { |
| | | return conPeople; |
| | | } |
| | | |
| | | public void setConPeople(String conPeople) { |
| | | this.conPeople = conPeople; |
| | | } |
| | | |
| | | public String getIsPlacebrand() { |
| | | return isPlacebrand; |
| | | } |
| | | |
| | | public void setIsPlacebrand(String isPlacebrand) { |
| | | this.isPlacebrand = isPlacebrand; |
| | | } |
| | | |
| | | public String getConnPerson() { |
| | | return connPerson; |
| | | } |
| | | |
| | | public void setConnPerson(String connPerson) { |
| | | this.connPerson = connPerson; |
| | | } |
| | | |
| | | public String getStatu() { |
| | | // if(statu == "0"){ |
| | | // statu = "拒绝"; |
| | | // }else if (statu == "1"){ |
| | | // statu = "同意"; |
| | | // }else{ |
| | | // statu = "待审批"; |
| | | // } |
| | | return statu; |
| | | } |
| | | |
| | | public void setStatu(String statu) { |
| | | |
| | | this.statu = statu; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | private String partPeople; |
| | | private String applyPerson; |
| | | private String applyApart; |
| | | private String startTime; |
| | | private String endTime; |
| | | // private String happenStartTime; |
| | | // private String happenEndTime; |
| | | private String isPlacebrand; |
| | | private String connPerson; |
| | | private String connPhone; |
| | | private String statu; |
| | | private String createTime; |
| | | |
| | | private String conn_Phone; |
| | | private List<String> urlList; |
| | | private String url; |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getPlace() { |
| | | if (place==null){ |
| | | place = null; |
| | | } |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // private String url; |
| | | // private List<String> urlList; |
| | | //List<String> Java 中的集合类,列表,它是一个接口.适合于需要频繁增删元素的情况 |
| | | // String[] Java 中的数组,更适合于固定大小、不需要频繁修改的情况 |
| | | // private int ownData = 1;//是否是自己家庭的数据 1 是 0 不是 |
| | | |
| | | |
| | | |
| | | public int getOwnData() { return ownData; } |
| | | public void setOwnData(int value) { this.ownData = value; } |
| | | |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | if (url == null){ |
| | | return; |
| | | } |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | if (urlList == null){ |
| | | urlList = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | urlList.clear(); |
| | | urlList.addAll(Arrays.asList(split)); |
| | | } |
| | | }else { |
| | | if (urlList == null){ |
| | | urlList = new ArrayList<>(); |
| | | }else { |
| | | urlList.clear(); |
| | | } |
| | | urlList.add(url); |
| | | } |
| | | } |
| | | |
| | | public List<String> getUrlList() { |
| | | return urlList; |
| | | } |
| | | |
| | | public void setUrlList(List<String> urlList) { |
| | | this.urlList = urlList; |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (String s : urlList) { |
| | | sb.append(s).append(","); |
| | | } |
| | | //去掉最后一个逗号 |
| | | if (sb.length() > 0) { |
| | | sb.deleteCharAt(sb.length() - 1); |
| | | } |
| | | this.url = sb.toString(); |
| | | } |
| | | |
| | | private String date1 ; |
| | | private String time1 ; |
| | | |
| | | public String getDate1() { |
| | | // date1 = null; |
| | | String data = getStartTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | date1 = parts[0]; |
| | | } |
| | | return date1; |
| | | } |
| | | |
| | | public void setDate1(String date1) { |
| | | |
| | | this.date1 = date1; |
| | | } |
| | | |
| | | public String getTime1() { |
| | | // time1 = null; |
| | | String data = getStartTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | String hour = "00"; |
| | | String min = "00"; |
| | | String second = "00"; |
| | | |
| | | if(parts.length>1){ |
| | | String time = parts[1]; |
| | | |
| | | String[] parts2 = time.split(":"); |
| | | if(parts2.length>1){ |
| | | hour = parts2[0]; |
| | | min = parts2[1]; |
| | | second = parts2[3]; |
| | | time1 = hour +":" + min+":"+second; |
| | | } |
| | | }else{ |
| | | time1 ="00:00:00"; |
| | | } |
| | | } |
| | | return time1; |
| | | } |
| | | |
| | | public void setTime1(String time1) { |
| | | //// time1 = time1 + ":00"; |
| | | // time1 = getTime1(); |
| | | |
| | | this.time1 = time1; |
| | | } |
| | | |
| | | |
| | | private String date2; |
| | | private String time2; |
| | | |
| | | public String getDate2() { |
| | | // date2 = null; |
| | | String data = getEndTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | date2 = parts[0]; |
| | | } |
| | | |
| | | return date2; |
| | | } |
| | | |
| | | public void setDate2(String date2) { |
| | | |
| | | this.date2 = date2; |
| | | } |
| | | |
| | | public String getTime2() { |
| | | // time2 = null; |
| | | String data = getEndTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | |
| | | String hour = "00"; |
| | | String min = "00"; |
| | | // String second = "00"; |
| | | |
| | | if(parts.length>1){ |
| | | String time = parts[1]; |
| | | |
| | | String[] parts2 = time.split(":"); |
| | | if(parts2.length>1){ |
| | | hour = parts2[0]; |
| | | min = parts2[1]; |
| | | |
| | | time1 = hour +":" + min+":00"; |
| | | }else{ |
| | | time1 = parts2[0]+":00:00"; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | return time2; |
| | | } |
| | | |
| | | public void setTime2(String time2) { |
| | | |
| | | this.time2 = time2; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "MeetingBean{" + |
| | | "id=" + id + |
| | | ", title='" + title + '\'' + |
| | | ", connPerson='" + connPerson + '\'' + |
| | | ", partPeople='" + partPeople + '\'' + |
| | | ", place='" + place + '\'' + |
| | | ", applyApart='" + applyApart + '\'' + |
| | | ", connPhone='" + connPhone + '\'' + |
| | | ", applyPerson='" + applyPerson + '\'' + |
| | | ", conPeople='" + conPeople + '\'' + |
| | | ", startTime='" + startTime + '\'' + |
| | | // ", date1='" + date1 + '\'' + |
| | | // ", time1='" + time1 + '\'' + |
| | | ", endTime='" + endTime + '\'' + |
| | | // ", date2='" + date2 + '\'' + |
| | | // ", time2='" + time2 + '\'' + |
| | | ", isPlacebrand='" + isPlacebrand + '\'' + |
| | | // ", happenStartTime='" + happenStartTime + '\'' + |
| | | // ", happenEndTime='" + happenEndTime + '\'' + |
| | | ", statu='" + statu + '\'' + |
| | | ", createTime='" + createTime + '\'' + |
| | | ", url='" + url + '\'' + |
| | | ", urlList=" + urlList + |
| | | '}'; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.28. 15:57 |
| | | * @desc |
| | | */ |
| | | public class MeetingRequestBean extends PageRequestBean{ |
| | | |
| | | |
| | | private String place; |
| | | private String applyApart; |
| | | private String startTime; |
| | | private String applyPerson; |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | // private String endTime; |
| | | private String happenStartTime; |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | happenStartTime = happenStartTime + " " + "00:00:00"; |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | happenEndTime = happenEndTime + " " +"00:00:00"; |
| | | |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | private String happenEndTime; |
| | | |
| | | public String getApplyApart() { |
| | | return applyApart; |
| | | } |
| | | |
| | | public void setApplyApart(String applyApart) { |
| | | this.applyApart = applyApart; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | // public String getEndTime() { |
| | | // return endTime; |
| | | // } |
| | | // |
| | | // public void setEndTime(String endTime) { |
| | | // this.endTime = endTime; |
| | | // } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("place", place == null ? "" : place); |
| | | map.put("applyApart", applyApart == null ? "" : applyApart); |
| | | map.put("applyPerson", applyPerson == null ? "" : applyPerson); |
| | | |
| | | map.put("happenStartTime", happenStartTime == null ? "" : happenStartTime); |
| | | map.put("happenEndTime", happenEndTime == null ? "" : happenEndTime); |
| | | // map.put("endTime", endTime == null ? "" : endTime); |
| | | map.put("startTime", startTime == null ? "" : startTime); |
| | | map.put("pageNum", pageNum); |
| | | map.put("pageSize", pageSize); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | public class MeetingStaBean extends MeetingStaRequestBean implements Serializable{ |
| | | private long id; |
| | | private String familyId; |
| | | private String title; |
| | | |
| | | public void setFamilyId(String familyId) { |
| | | this.familyId = familyId; |
| | | } |
| | | |
| | | public String getFamilyId() { |
| | | return familyId; |
| | | } |
| | | |
| | | private String conferenceRoom; |
| | | private String applyPerson; |
| | | private String ratifyPerson; |
| | | private String status; |
| | | private String useTime; |
| | | |
| | | private int ownData = 1; |
| | | |
| | | private List<String> urlList; |
| | | private String url; |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getConferenceRoom() { |
| | | return conferenceRoom; |
| | | } |
| | | |
| | | public void setConferenceRoom(String conferenceRoom) { |
| | | this.conferenceRoom = conferenceRoom; |
| | | } |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | public String getRatifyPerson() { |
| | | return ratifyPerson; |
| | | } |
| | | |
| | | public void setRatifyPerson(String ratifyPerson) { |
| | | this.ratifyPerson = ratifyPerson; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getUseTime() { |
| | | return useTime; |
| | | } |
| | | |
| | | public void setUseTime(String useTime) { |
| | | this.useTime = useTime; |
| | | } |
| | | |
| | | public int getOwnData() { |
| | | return ownData; |
| | | } |
| | | |
| | | public void setOwnData(int ownData) { |
| | | this.ownData = ownData; |
| | | } |
| | | |
| | | public List<String> getUrlList() { |
| | | return urlList; |
| | | } |
| | | |
| | | public void setUrlList(List<String> urlList) { |
| | | this.urlList = urlList; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | |
| | | public String toString() { |
| | | return "MeetingStaBean{" + |
| | | "id=" + id + |
| | | ", title='" + title + '\'' + |
| | | ", familyId='" + familyId + '\'' + |
| | | ", conferenceRoom='" + conferenceRoom + '\'' + |
| | | ", applyPerson='" + applyPerson + '\'' + |
| | | ", ratifyPerson='" + ratifyPerson + '\'' + |
| | | ", status='" + status + '\'' + |
| | | ", useTime='" + useTime + '\'' + |
| | | ", url='" + url + '\'' + |
| | | ", urlList=" + urlList + |
| | | '}'; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.28. 15:57 |
| | | * @desc |
| | | */ |
| | | public class MeetingStaRequestBean extends PageRequestBean{ |
| | | |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | |
| | | map.put("pageNum", pageNum); |
| | | map.put("pageSize", pageSize); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class MeetingapproveBean extends MeetingBean implements Serializable{ |
| | | private long id; |
| | | private String statu; |
| | | |
| | | private List<String> urlList; |
| | | private String url; |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getStatu() { |
| | | return statu; |
| | | } |
| | | |
| | | public void setStatu(String statu) { |
| | | this.statu = statu; |
| | | } |
| | | |
| | | public List<String> getUrlList() { |
| | | return urlList; |
| | | } |
| | | |
| | | public void setUrlList(List<String> urlList) { |
| | | this.urlList = urlList; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "MeetingBean{" + |
| | | "id=" + id + |
| | | ", statu='" + statu + '\'' + |
| | | |
| | | ", url='" + url + '\'' + |
| | | ", urlList=" + urlList + |
| | | '}'; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.28. 15:57 |
| | | * @desc |
| | | */ |
| | | public class MeetingapproveRequestBean extends PageRequestBean{ |
| | | |
| | | |
| | | private String place; |
| | | private String applyApart; |
| | | private String startTime; |
| | | private String applyPerson; |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | // private String endTime; |
| | | private String happenStartTime; |
| | | |
| | | public String getHappenStartTime() { |
| | | return happenStartTime; |
| | | } |
| | | |
| | | public void setHappenStartTime(String happenStartTime) { |
| | | happenStartTime = happenStartTime + " " + "00:00:00"; |
| | | this.happenStartTime = happenStartTime; |
| | | } |
| | | |
| | | public String getHappenEndTime() { |
| | | return happenEndTime; |
| | | } |
| | | |
| | | public void setHappenEndTime(String happenEndTime) { |
| | | happenEndTime = happenEndTime + " " +"00:00:00"; |
| | | |
| | | this.happenEndTime = happenEndTime; |
| | | } |
| | | |
| | | private String happenEndTime; |
| | | |
| | | public String getApplyApart() { |
| | | return applyApart; |
| | | } |
| | | |
| | | public void setApplyApart(String applyApart) { |
| | | this.applyApart = applyApart; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | // public String getEndTime() { |
| | | // return endTime; |
| | | // } |
| | | // |
| | | // public void setEndTime(String endTime) { |
| | | // this.endTime = endTime; |
| | | // } |
| | | |
| | | public String getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(String place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("place", place == null ? "" : place); |
| | | map.put("applyApart", applyApart == null ? "" : applyApart); |
| | | map.put("applyPerson", applyPerson == null ? "" : applyPerson); |
| | | |
| | | map.put("happenStartTime", happenStartTime == null ? "" : happenStartTime); |
| | | map.put("happenEndTime", happenEndTime == null ? "" : happenEndTime); |
| | | // map.put("endTime", endTime == null ? "" : endTime); |
| | | map.put("startTime", startTime == null ? "" : startTime); |
| | | map.put("pageNum", pageNum); |
| | | map.put("pageSize", pageSize); |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | public class WebbackBean implements Serializable { |
| | | private long id; |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | | private int ownData = 1;//是否是自己家庭的数据 1 是 0 不是 |
| | | |
| | | public int getOwnData() { |
| | | return ownData; |
| | | } |
| | | |
| | | public void setOwnData(int ownData) { |
| | | this.ownData = ownData; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | private String pageSize; |
| | | private String pageNum; |
| | | private String title; |
| | | private String applyPerson; |
| | | private String contactPerson; |
| | | private String contactPhone; |
| | | private String startTime; |
| | | |
| | | public String getContactPhone() { |
| | | return contactPhone; |
| | | } |
| | | |
| | | public void setContactPhone(String contactPhone) { |
| | | this.contactPhone = contactPhone; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | private String endTime; |
| | | |
| | | private String date1 ; |
| | | private String time1 ; |
| | | |
| | | public String getDate1() { |
| | | date1 = null; |
| | | String data = getStartTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | date1 = parts[0]; |
| | | } |
| | | return date1; |
| | | } |
| | | |
| | | public void setDate1(String date1) { |
| | | this.date1 = date1; |
| | | } |
| | | |
| | | public String getTime1() { |
| | | time1 = null; |
| | | String data = getStartTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | String hour = "00"; |
| | | String min = "00"; |
| | | String second = "00"; |
| | | |
| | | if(parts.length>1){ |
| | | String time = parts[1]; |
| | | |
| | | String[] parts2 = time.split(":"); |
| | | if(parts2.length>1){ |
| | | hour = parts2[0]; |
| | | min = parts2[1]; |
| | | second = parts2[3]; |
| | | time1 = hour +":" + min+":"+second; |
| | | } |
| | | }else{ |
| | | time1 ="00:00:00"; |
| | | } |
| | | } |
| | | return time1; |
| | | } |
| | | |
| | | public void setTime1(String time1) { |
| | | this.time1 = time1; |
| | | } |
| | | |
| | | private String date2; |
| | | private String time2; |
| | | |
| | | public String getDate2() { |
| | | date2 = null; |
| | | String data = getEndTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | date2 = parts[0]; |
| | | } |
| | | return date2; |
| | | } |
| | | |
| | | public void setDate2(String date2) { |
| | | this.date2 = date2; |
| | | } |
| | | |
| | | public String getTime2() { |
| | | time2 = null; |
| | | String data = getEndTime(); |
| | | if (data!= null && !data.isEmpty()){ |
| | | String[] parts = data.split(" "); |
| | | String hour = "00"; |
| | | String min = "00"; |
| | | String second = "00"; |
| | | |
| | | if(parts.length>1){ |
| | | String time = parts[1]; |
| | | |
| | | String[] parts2 = time.split(":"); |
| | | if(parts2.length>1){ |
| | | hour = parts2[0]; |
| | | min = parts2[1]; |
| | | second = parts2[3]; |
| | | time2 = hour +":" + min+":"+second; |
| | | } |
| | | }else{ |
| | | time2 ="00:00:00"; |
| | | } |
| | | } |
| | | return time2; |
| | | } |
| | | |
| | | public void setTime2(String time2) { |
| | | this.time2 = time2; |
| | | } |
| | | |
| | | public String getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(String pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public String getPageNum() { |
| | | return pageNum; |
| | | } |
| | | |
| | | public void setPageNum(String pageNum) { |
| | | this.pageNum = pageNum; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | public String getContactPerson() { |
| | | return contactPerson; |
| | | } |
| | | |
| | | public void setContactPerson(String contactPerson) { |
| | | this.contactPerson = contactPerson; |
| | | } |
| | | |
| | | |
| | | private String url; |
| | | private List<String> urlList; |
| | | |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | if (url == null){ |
| | | return; |
| | | } |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | if (urlList == null){ |
| | | urlList = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | urlList.clear(); |
| | | urlList.addAll(Arrays.asList(split)); |
| | | } |
| | | }else { |
| | | if (urlList == null){ |
| | | urlList = new ArrayList<>(); |
| | | }else { |
| | | urlList.clear(); |
| | | } |
| | | urlList.add(url); |
| | | } |
| | | } |
| | | |
| | | public List<String> getUrlList() { |
| | | return urlList; |
| | | } |
| | | |
| | | public void setUrlList(List<String> urlList) { |
| | | this.urlList = urlList; |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (String s : urlList) { |
| | | sb.append(s).append(","); |
| | | } |
| | | //去掉最后一个逗号 |
| | | if (sb.length() > 0) { |
| | | sb.deleteCharAt(sb.length() - 1); |
| | | } |
| | | this.url = sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "WebbackBean{" + |
| | | "id=" + id + |
| | | "startTime=" + startTime + |
| | | "endTime=" + endTime + |
| | | "title=" + title + |
| | | "applyPerson=" + applyPerson + |
| | | "contactPerson=" + contactPerson + |
| | | "contactPhone=" + contactPhone + |
| | | "pageSize=" + pageSize + |
| | | "pageNum=" + pageNum + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class WebbackRequestBean extends PageRequestBean { |
| | | // private long id; |
| | | // |
| | | // public long getId() { |
| | | // return id; |
| | | // } |
| | | // |
| | | // public void setId(long id) { |
| | | // this.id = id; |
| | | // } |
| | | |
| | | private String pageSize; |
| | | private String pageNum; |
| | | private String title; |
| | | private String applyPerson; |
| | | private String contactPerson; |
| | | private String contactPhone; |
| | | private String startTime; |
| | | |
| | | public String getContactPhone() { |
| | | return contactPhone; |
| | | } |
| | | |
| | | public void setContactPhone(String contactPhone) { |
| | | this.contactPhone = contactPhone; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private String endTime; |
| | | |
| | | // public String getPageSize() { |
| | | // return pageSize; |
| | | // } |
| | | // |
| | | // public void setPageSize(String pageSize) { |
| | | // this.pageSize = pageSize; |
| | | // } |
| | | // |
| | | // public String getPageNum() { |
| | | // return pageNum; |
| | | // } |
| | | // |
| | | // public void setPageNum(String pageNum) { |
| | | // this.pageNum = pageNum; |
| | | // } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | public String getContactPerson() { |
| | | return contactPerson; |
| | | } |
| | | |
| | | public void setContactPerson(String contactPerson) { |
| | | this.contactPerson = contactPerson; |
| | | } |
| | | |
| | | |
| | | // private String url; |
| | | // private List<String> urlList; |
| | | |
| | | |
| | | // public String getUrl() { |
| | | // return url; |
| | | // } |
| | | // |
| | | // public void setUrl(String url) { |
| | | // this.url = url; |
| | | // if (url == null){ |
| | | // return; |
| | | // } |
| | | // if (url.contains(",")){ |
| | | // String[] split = url.split(","); |
| | | // if (urlList == null){ |
| | | // urlList = new ArrayList<>(Arrays.asList(split)); |
| | | // }else { |
| | | // urlList.clear(); |
| | | // urlList.addAll(Arrays.asList(split)); |
| | | // } |
| | | // }else { |
| | | // if (urlList == null){ |
| | | // urlList = new ArrayList<>(); |
| | | // }else { |
| | | // urlList.clear(); |
| | | // } |
| | | // urlList.add(url); |
| | | // } |
| | | // } |
| | | |
| | | // public List<String> getUrlList() { |
| | | // return urlList; |
| | | // } |
| | | // |
| | | // public void setUrlList(List<String> urlList) { |
| | | // this.urlList = urlList; |
| | | // StringBuilder sb = new StringBuilder(); |
| | | // for (String s : urlList) { |
| | | // sb.append(s).append(","); |
| | | // } |
| | | // //去掉最后一个逗号 |
| | | // if (sb.length() > 0) { |
| | | // sb.deleteCharAt(sb.length() - 1); |
| | | // } |
| | | // this.url = sb.toString(); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("startTime", startTime == null ? "" : startTime); |
| | | map.put("endTime", endTime == null ? "" : endTime); |
| | | map.put("title", title == null ? "" : title); |
| | | |
| | | map.put("applyPerson", applyPerson == null ? "" : applyPerson); |
| | | map.put("contactPerson", contactPerson == null ? "" : contactPerson); |
| | | // map.put("endTime", endTime == null ? "" : endTime); |
| | | map.put("contactPhone", contactPhone == null ? "" : contactPhone); |
| | | // map.put("pageNum", pageNum); |
| | | // map.put("pageSize", pageSize); |
| | | return map; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | public class WebcastBean implements Serializable { |
| | | private long id; |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | | private int ownData = 1;//是否是自己家庭的数据 1 是 0 不是 |
| | | |
| | | public int getOwnData() { |
| | | return ownData; |
| | | } |
| | | |
| | | public void setOwnData(int ownData) { |
| | | this.ownData = ownData; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | private String pageSize; |
| | | private String pageNum; |
| | | private String title; |
| | | private String applyPerson; |
| | | private String contactPerson; |
| | | private String contactPhone; |
| | | private String startTime; |
| | | |
| | | public String getContactPhone() { |
| | | return contactPhone; |
| | | } |
| | | |
| | | public void setContactPhone(String contactPhone) { |
| | | this.contactPhone = contactPhone; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | private String endTime; |
| | | |
| | | private String date1 ; |
| | | private String time1 ; |
| | | |
| | | public String getDate1() { |
| | | // date1 = null; |
| | | // String data = getStartTime(); |
| | | // if (data!= null && !data.isEmpty()){ |
| | | // String[] parts = data.split(" "); |
| | | // date1 = parts[0]; |
| | | // } |
| | | return date1; |
| | | } |
| | | |
| | | public void setDate1(String date1) { |
| | | this.date1 = date1; |
| | | } |
| | | |
| | | public String getTime1() { |
| | | // time1 = null; |
| | | // String data = getStartTime(); |
| | | // if (data!= null && !data.isEmpty()){ |
| | | // String[] parts = data.split(" "); |
| | | // String hour = "00"; |
| | | // String min = "00"; |
| | | // String second = "00"; |
| | | // |
| | | // if(parts.length>1){ |
| | | // String time = parts[1]; |
| | | // |
| | | // String[] parts2 = time.split(":"); |
| | | // if(parts2.length>1){ |
| | | // hour = parts2[0]; |
| | | // min = parts2[1]; |
| | | // second = parts2[3]; |
| | | // time1 = hour +":" + min+":"+second; |
| | | // } |
| | | // }else{ |
| | | // time1 ="00:00:00"; |
| | | // } |
| | | // } |
| | | return time1; |
| | | } |
| | | |
| | | public void setTime1(String time1) { |
| | | this.time1 = time1; |
| | | } |
| | | |
| | | private String date2; |
| | | private String time2; |
| | | |
| | | public String getDate2() { |
| | | // date2 = null; |
| | | // String data = getEndTime(); |
| | | // if (data!= null && !data.isEmpty()){ |
| | | // String[] parts = data.split(" "); |
| | | // date2 = parts[0]; |
| | | // } |
| | | return date2; |
| | | } |
| | | |
| | | public void setDate2(String date2) { |
| | | this.date2 = date2; |
| | | } |
| | | |
| | | public String getTime2() { |
| | | // time2 = null; |
| | | // String data = getEndTime(); |
| | | // if (data!= null && !data.isEmpty()){ |
| | | // String[] parts = data.split(" "); |
| | | // String hour = "00"; |
| | | // String min = "00"; |
| | | // String second = "00"; |
| | | // |
| | | // if(parts.length>1){ |
| | | // String time = parts[1]; |
| | | // |
| | | // String[] parts2 = time.split(":"); |
| | | // if(parts2.length>1){ |
| | | // hour = parts2[0]; |
| | | // min = parts2[1]; |
| | | // second = parts2[3]; |
| | | // time2 = hour +":" + min+":"+second; |
| | | // } |
| | | // }else{ |
| | | // time2 ="00:00:00"; |
| | | // } |
| | | // } |
| | | return time2; |
| | | } |
| | | |
| | | public void setTime2(String time2) { |
| | | this.time2 = time2; |
| | | } |
| | | |
| | | public String getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(String pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public String getPageNum() { |
| | | return pageNum; |
| | | } |
| | | |
| | | public void setPageNum(String pageNum) { |
| | | this.pageNum = pageNum; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | public String getContactPerson() { |
| | | return contactPerson; |
| | | } |
| | | |
| | | public void setContactPerson(String contactPerson) { |
| | | this.contactPerson = contactPerson; |
| | | } |
| | | |
| | | |
| | | private String url; |
| | | private List<String> urlList; |
| | | |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | if (url == null){ |
| | | return; |
| | | } |
| | | if (url.contains(",")){ |
| | | String[] split = url.split(","); |
| | | if (urlList == null){ |
| | | urlList = new ArrayList<>(Arrays.asList(split)); |
| | | }else { |
| | | urlList.clear(); |
| | | urlList.addAll(Arrays.asList(split)); |
| | | } |
| | | }else { |
| | | if (urlList == null){ |
| | | urlList = new ArrayList<>(); |
| | | }else { |
| | | urlList.clear(); |
| | | } |
| | | urlList.add(url); |
| | | } |
| | | } |
| | | |
| | | public List<String> getUrlList() { |
| | | return urlList; |
| | | } |
| | | |
| | | public void setUrlList(List<String> urlList) { |
| | | this.urlList = urlList; |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (String s : urlList) { |
| | | sb.append(s).append(","); |
| | | } |
| | | //去掉最后一个逗号 |
| | | if (sb.length() > 0) { |
| | | sb.deleteCharAt(sb.length() - 1); |
| | | } |
| | | this.url = sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "WebcastBean{" + |
| | | "id=" + id + |
| | | "startTime=" + startTime + |
| | | "endTime=" + endTime + |
| | | "title=" + title + |
| | | "applyPerson=" + applyPerson + |
| | | "contactPerson=" + contactPerson + |
| | | "contactPhone=" + contactPhone + |
| | | "pageSize=" + pageSize + |
| | | "pageNum=" + pageNum + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.bean; |
| | | |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class WebcastRequestBean extends PageRequestBean { |
| | | // private long id; |
| | | // |
| | | // public long getId() { |
| | | // return id; |
| | | // } |
| | | // |
| | | // public void setId(long id) { |
| | | // this.id = id; |
| | | // } |
| | | |
| | | private String pageSize; |
| | | private String pageNum; |
| | | private String title; |
| | | private String applyPerson; |
| | | private String contactPerson; |
| | | private String contactPhone; |
| | | private String startTime; |
| | | |
| | | public String getContactPhone() { |
| | | return contactPhone; |
| | | } |
| | | |
| | | public void setContactPhone(String contactPhone) { |
| | | this.contactPhone = contactPhone; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | private String endTime; |
| | | |
| | | // public String getPageSize() { |
| | | // return pageSize; |
| | | // } |
| | | // |
| | | // public void setPageSize(String pageSize) { |
| | | // this.pageSize = pageSize; |
| | | // } |
| | | // |
| | | // public String getPageNum() { |
| | | // return pageNum; |
| | | // } |
| | | // |
| | | // public void setPageNum(String pageNum) { |
| | | // this.pageNum = pageNum; |
| | | // } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getApplyPerson() { |
| | | return applyPerson; |
| | | } |
| | | |
| | | public void setApplyPerson(String applyPerson) { |
| | | this.applyPerson = applyPerson; |
| | | } |
| | | |
| | | public String getContactPerson() { |
| | | return contactPerson; |
| | | } |
| | | |
| | | public void setContactPerson(String contactPerson) { |
| | | this.contactPerson = contactPerson; |
| | | } |
| | | |
| | | |
| | | // private String url; |
| | | // private List<String> urlList; |
| | | |
| | | |
| | | // public String getUrl() { |
| | | // return url; |
| | | // } |
| | | // |
| | | // public void setUrl(String url) { |
| | | // this.url = url; |
| | | // if (url == null){ |
| | | // return; |
| | | // } |
| | | // if (url.contains(",")){ |
| | | // String[] split = url.split(","); |
| | | // if (urlList == null){ |
| | | // urlList = new ArrayList<>(Arrays.asList(split)); |
| | | // }else { |
| | | // urlList.clear(); |
| | | // urlList.addAll(Arrays.asList(split)); |
| | | // } |
| | | // }else { |
| | | // if (urlList == null){ |
| | | // urlList = new ArrayList<>(); |
| | | // }else { |
| | | // urlList.clear(); |
| | | // } |
| | | // urlList.add(url); |
| | | // } |
| | | // } |
| | | |
| | | // public List<String> getUrlList() { |
| | | // return urlList; |
| | | // } |
| | | // |
| | | // public void setUrlList(List<String> urlList) { |
| | | // this.urlList = urlList; |
| | | // StringBuilder sb = new StringBuilder(); |
| | | // for (String s : urlList) { |
| | | // sb.append(s).append(","); |
| | | // } |
| | | // //去掉最后一个逗号 |
| | | // if (sb.length() > 0) { |
| | | // sb.deleteCharAt(sb.length() - 1); |
| | | // } |
| | | // this.url = sb.toString(); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = super.toMap(); |
| | | map.put("startTime", startTime == null ? "" : startTime); |
| | | map.put("endTime", endTime == null ? "" : endTime); |
| | | map.put("title", title == null ? "" : title); |
| | | |
| | | map.put("applyPerson", applyPerson == null ? "" : applyPerson); |
| | | map.put("contactPerson", contactPerson == null ? "" : contactPerson); |
| | | // map.put("endTime", endTime == null ? "" : endTime); |
| | | map.put("contactPhone", contactPhone == null ? "" : contactPhone); |
| | | // map.put("pageNum", pageNum); |
| | | // map.put("pageSize", pageSize); |
| | | return map; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.application.zhangshi_app_android.bean.HonorCollectionResponseBean; |
| | | 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.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | 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.TourismExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.UpdateVersionBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | import com.application.zhangshi_app_android.data.source.HttpDataSource; |
| | | import com.application.zhangshi_app_android.data.source.LocalDataSource; |
| | | import com.application.zhangshi_app_android.data.source.http.HttpDataSourceImpl; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import io.reactivex.Completable; |
| | | import io.reactivex.Observable; |
| | | import io.reactivex.ObservableSource; |
| | | import okhttp3.MultipartBody; |
| | | |
| | | /** |
| | |
| | | public Observable<ResultData<String>> addFamilyMemorabilia(FamilyMemorabiliaBean familyMemorabiliaBean) { |
| | | return mHttpDataSource.addFamilyMemorabilia(familyMemorabiliaBean); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<MeetingStaBean>>> getMeetingSta(Map<String,Object> paramsMap) { |
| | | return mHttpDataSource.getMeetingSta(paramsMap); |
| | | } |
| | | |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<MeetingBean>>> getMeeting(Map<String,Object> paramsMap) { |
| | | return mHttpDataSource.getMeeting(paramsMap); |
| | | } |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addMeeting(MeetingBean meetingBean) { |
| | | return mHttpDataSource.addMeeting(meetingBean); |
| | | } |
| | | |
| | | /** |
| | | * 删除家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteMeeting(String ids) { |
| | | return mHttpDataSource.deleteMeeting(ids); |
| | | } |
| | | |
| | | /** |
| | | *更新家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateMeeting(MeetingBean meetingBean) { |
| | | return mHttpDataSource.updateMeeting(meetingBean); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Observable<ResultData<String>> approveMeeting(Integer id,Integer statu) { |
| | | return mHttpDataSource.approveMeeting(id,statu); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除家大事记 |
| | | */ |
| | |
| | | public Observable<ResultData<String>> deleteFamilyMemorabilia(String ids) { |
| | | return mHttpDataSource.deleteFamilyMemorabilia(ids); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //获取直播 |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<WebcastBean>>> getWebcast(Map<String,Object> paramsMap) { |
| | | return mHttpDataSource.getWebcast(paramsMap); |
| | | } |
| | | |
| | | @Override |
| | | public Observable<ResultData<String>> addWebcast(WebcastBean webcastBean) { |
| | | return mHttpDataSource.addWebcast(webcastBean); |
| | | } |
| | | |
| | | |
| | | //获取直播回放 |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<WebbackBean>>> getWebback(Map<String,Object> paramsMap){ |
| | | return mHttpDataSource.getWebback(paramsMap); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除家大事记 |
| | | *更新家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateFamilyMemorabilia(FamilyMemorabiliaBean familyMemorabiliaBean) { |
| | | return mHttpDataSource.updateFamilyMemorabilia(familyMemorabiliaBean); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上传文件 |
| | |
| | | public Observable<ResultData<PageResponseBean<FamilyAssetsBean>>> getFamilyAssets(Map<String,Object> paramsMap) { |
| | | return mHttpDataSource.getFamilyAssets(paramsMap); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取家庭设备 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @see LocalDataSourceImpl |
| | | */ |
| | |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.ExaminationInfoBean; |
| | | 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.GrowthExperienceAbroadConditionBean; |
| | |
| | | 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.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.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | 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.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | 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 com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import io.reactivex.Completable; |
| | | import io.reactivex.Observable; |
| | | import okhttp3.MultipartBody; |
| | | |
| | |
| | | * 增加家大事记 |
| | | */ |
| | | Observable<ResultData<String>> addFamilyMemorabilia(FamilyMemorabiliaBean familyMemorabiliaBean); |
| | | |
| | | Observable<ResultData<PageResponseBean<MeetingStaBean>>> getMeetingSta(Map<String, Object> paramsMap); |
| | | |
| | | Observable<ResultData<PageResponseBean<MeetingBean>>> getMeeting(Map<String, Object> paramsMap); |
| | | |
| | | Observable<ResultData<String>> addMeeting(MeetingBean meetingBean); |
| | | |
| | | Observable<ResultData<String>> deleteMeeting(String ids); |
| | | |
| | | Observable<ResultData<String>> updateMeeting(MeetingBean meetingBean); |
| | | |
| | | Observable<ResultData<String>> approveMeeting(Integer id, Integer statu); |
| | | |
| | | /** |
| | | * 删除家大事记 |
| | | */ |
| | | Observable<ResultData<String>> deleteFamilyMemorabilia(String ids); |
| | | |
| | | //获取直播 |
| | | Observable<ResultData<PageResponseBean<WebcastBean>>> getWebcast(Map<String, Object> paramsMap); |
| | | |
| | | Observable<ResultData<String>> addWebcast(WebcastBean webcastBean); |
| | | |
| | | //获取直播回放 |
| | | Observable<ResultData<PageResponseBean<WebbackBean>>> getWebback(Map<String, Object> paramsMap); |
| | | |
| | | /** |
| | | * 修改家大事记 |
| | | */ |
| | |
| | | import com.application.zhangshi_app_android.bean.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.ExaminationInfoBean; |
| | | 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.GrowthExperienceAbroadConditionBean; |
| | |
| | | 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.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.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | 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.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | 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 com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import retrofit2.http.Path; |
| | | import retrofit2.http.Query; |
| | | import retrofit2.http.QueryMap; |
| | | import retrofit2.http.QueryName; |
| | | |
| | | /** |
| | | * @author Ljj |
| | |
| | | */ |
| | | @DELETE("/family/zfEvent/{ids}") |
| | | Observable<ResultData<String>> deleteFamilyMemorabilia(@Path("ids") String ids); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取家大事件 |
| | | */ |
| | | @GET("/zMeeting/all") |
| | | Observable<ResultData<PageResponseBean<MeetingBean>>> getMeeting(@QueryMap Map<String,Object> paramsMap); |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | | @POST("/zMeeting") |
| | | Observable<ResultData<String>> addMeeting(@Body MeetingBean meetingBean); |
| | | /** |
| | | * 删除家大事记 |
| | | */ |
| | | @DELETE("/zMeeting/{ids}") |
| | | Observable<ResultData<String>> deleteMeeting(@Path("ids") String ids); |
| | | /** |
| | | * 修改家大事记 |
| | | */ |
| | | @PUT("/zMeeting") |
| | | Observable<ResultData<String>> updateMeeting(@Body MeetingBean meetingBean); |
| | | |
| | | @PUT("/zMeetingRatify") |
| | | Observable<ResultData<String>> approveMeeting(@Body Integer id,Integer statu); |
| | | |
| | | @GET("/zMeetingStatistic/all") |
| | | Observable<ResultData<PageResponseBean<MeetingStaBean>>> getMeetingSta(@QueryMap Map<String,Object> paramsMap); |
| | | |
| | | //直播申请 |
| | | @POST("/zLiveStreaming") |
| | | Observable<ResultData<String>> addWebcast(@Body WebcastBean webcastBean); |
| | | @GET("/zLiveStreaming/all") |
| | | Observable<ResultData<PageResponseBean<WebcastBean>>> getWebcast(@QueryMap Map<String,Object> paramsMap); |
| | | |
| | | //直播回放 |
| | | @GET("/zLiveStreamingBack/all") |
| | | Observable<ResultData<PageResponseBean<WebbackBean>>> getWebback(@QueryMap Map<String,Object> paramsMap); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除保养 |
| | | */ |
| | | @DELETE("/zMeeting/{ids}") |
| | | Observable<ResultData<String>> deleteText(@Path("ids") String ids); |
| | | |
| | | |
| | | /** |
| | | * 修改家大事记 |
| | | */ |
| | | @PUT("/family/zfEvent") |
| | | Observable<ResultData<String>> updateFamilyMemorabilia(@Body FamilyMemorabiliaBean familyMemorabiliaBean); |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @GET("/family/property/all") |
| | | Observable<ResultData<PageResponseBean<FamilyAssetsBean>>> getFamilyAssets(@QueryMap Map<String, Object> paramsMap); |
| | | |
| | | /** |
| | | * 获取家庭设备 |
| | | |
| | | |
| | | |
| | | |
| | | /** * 获取家庭设备 |
| | | */ |
| | | @GET("/zfEquipment/all") |
| | | Observable<ResultData<PageResponseBean<HomeDevicesBean>>> getHomeDevices(@QueryMap Map<String, Object> paramsMap); |
| | |
| | | package com.application.zhangshi_app_android.data.source.http; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | 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.CleanStorageBean; |
| | | import com.application.zhangshi_app_android.bean.ContactsDetailBean; |
| | | import com.application.zhangshi_app_android.bean.ExaminationInfoBean; |
| | | 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.GrowthExperienceAbroadConditionBean; |
| | |
| | | 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.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.HundredWishBean; |
| | | import com.application.zhangshi_app_android.bean.IncomeAndExpensesBean; |
| | | 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.MarriageInfoBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.bean.MemoBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | 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.TourismExperienceBean; |
| | | import com.application.zhangshi_app_android.bean.UpdateVersionBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | import com.application.zhangshi_app_android.data.source.HttpDataSource; |
| | | |
| | | import java.util.List; |
| | |
| | | public Observable<ResultData<String>> addFamilyMemorabilia(FamilyMemorabiliaBean familyMemorabiliaBean) { |
| | | return apiService.addFamilyMemorabilia(familyMemorabiliaBean); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<MeetingStaBean>>> getMeetingSta(Map<String,Object> paramsMap) { |
| | | return apiService.getMeetingSta(paramsMap); |
| | | } |
| | | /** |
| | | * 获取家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<MeetingBean>>> getMeeting(Map<String,Object> paramsMap) { |
| | | return apiService.getMeeting(paramsMap); |
| | | } |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addMeeting(MeetingBean meetingBean) { |
| | | return apiService.addMeeting(meetingBean); |
| | | } |
| | | /** |
| | | * 删除家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> deleteMeeting(String ids) { |
| | | return apiService.deleteMeeting(ids); |
| | | } |
| | | |
| | | /** |
| | | * 修改家大事记 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> updateMeeting(MeetingBean meetingBean) { |
| | | return apiService.updateMeeting(meetingBean); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Observable<ResultData<String>> approveMeeting(Integer id, Integer statu) { |
| | | return apiService.approveMeeting(id,statu); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除家大事记 |
| | | */ |
| | |
| | | public Observable<ResultData<String>> deleteFamilyMemorabilia(String ids) { |
| | | return apiService.deleteFamilyMemorabilia(ids); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改家大事记 |
| | |
| | | return apiService.updateFamilyMemorabilia(familyMemorabiliaBean); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上传文件 |
| | | */ |
| | |
| | | return apiService.uploadFile(file); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取直播 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<WebcastBean>>> getWebcast(Map<String,Object> paramsMap) { |
| | | return apiService.getWebcast(paramsMap); |
| | | } |
| | | /** |
| | | * 增加直播申请 |
| | | */ |
| | | @Override |
| | | public Observable<ResultData<String>> addWebcast(WebcastBean webcastBean) { |
| | | return apiService.addWebcast(webcastBean); |
| | | } |
| | | |
| | | @Override |
| | | public Observable<ResultData<PageResponseBean<WebbackBean>>> getWebback(Map<String,Object> paramsMap){ |
| | | return apiService.getWebback(paramsMap); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取家庭资产 |
| | | */ |
| | |
| | | return apiService.getFamilyAssets(paramsMap); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取家庭设备 |
| | | */ |
| | |
| | | package com.application.zhangshi_app_android.ui; |
| | | |
| | | |
| | | import android.graphics.Color; |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.os.Bundle; |
| | |
| | | import com.application.zhangshi_app_android.ui.function.ContactsActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyAssetsActivity; |
| | | import com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaActivity; |
| | | import com.application.zhangshi_app_android.ui.function.GrowthExperienceActivity; |
| | | import com.application.zhangshi_app_android.ui.function.HomeDevicesActivity; |
| | | import com.application.zhangshi_app_android.ui.function.HonorCollectionActivity; |
| | | import com.application.zhangshi_app_android.ui.function.HundredWishActivity; |
| | | 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.MeetingActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PrivacyActivity; |
| | |
| | | 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.TimePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.entity.DateEntity; |
| | | import com.github.gzuliyujiang.wheelpicker.impl.UnitDateFormatter; |
| | | import com.github.gzuliyujiang.wheelpicker.impl.UnitTimeFormatter; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.DateWheelLayout; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.OptionWheelLayout; |
| | | import com.github.gzuliyujiang.wheelpicker.widget.TimeWheelLayout; |
| | | import com.hjq.bar.TitleBar; |
| | | |
| | | import java.util.Calendar; |
| | |
| | | if (mDrawerLayout != null) { |
| | | classMap.put(TreeFragment.class,(LinearLayout) findViewById(R.id.dl_home_root_net)); |
| | | classMap.put(FamilyMemorabiliaActivity.class,(LinearLayout) findViewById(R.id.dl_family_memorabilia)); |
| | | classMap.put(MeetingActivity.class,(LinearLayout) findViewById(R.id.dl_family_meeting)); |
| | | classMap.put(FamilyAssetsActivity.class,(LinearLayout) findViewById(R.id.dl_family_assets)); |
| | | classMap.put(HomeDevicesActivity.class,(LinearLayout) findViewById(R.id.dl_home_devices)); |
| | | classMap.put(HonorCollectionActivity.class,(LinearLayout) findViewById(R.id.dl_honor_collection)); |
| | |
| | | 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 TimePicker getTimePicker(){ |
| | | TimePicker timePicker = new TimePicker(this); |
| | | TimeWheelLayout wheelLayout = timePicker.getWheelLayout(); |
| | | wheelLayout.getHourWheelView().setCurtainCorner(0);//背景无圆角 |
| | | wheelLayout.getMinuteWheelView().setCurtainCorner(5);//背景右边有圆角 |
| | | wheelLayout.getSecondWheelView().setCurtainCorner(4);//背景左边有圆角 |
| | | wheelLayout.setTimeFormatter(new UnitTimeFormatter()); |
| | | 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())); |
| | | |
| | | timePicker.getWheelLayout().setResetWhenLinkage(false); |
| | | return timePicker; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public OptionPicker getOptionPicker(List<String> list){ |
| | | OptionPicker picker = new OptionPicker(this); |
| | | OptionWheelLayout wheelLayout = picker.getWheelLayout(); |
| | |
| | | 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.MeetingActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PetDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PrivacyActivity; |
| | |
| | | */ |
| | | private DrawerLayout mDrawerLayout; |
| | | private Map<Class, LinearLayout> classMap = new HashMap<>(); |
| | | |
| | | |
| | | @Override |
| | | protected VDB initViewBinding(LayoutInflater inflater, @Nullable ViewGroup container) { |
| | |
| | | if (mDrawerLayout != null) { |
| | | classMap.put(TreeFragment.class,(LinearLayout) findViewById(R.id.dl_home_root_net)); |
| | | classMap.put(FamilyMemorabiliaActivity.class,(LinearLayout) findViewById(R.id.dl_family_memorabilia)); |
| | | classMap.put(MeetingActivity.class,(LinearLayout) findViewById(R.id.dl_family_meeting)); |
| | | classMap.put(FamilyAssetsActivity.class,(LinearLayout) findViewById(R.id.dl_family_assets)); |
| | | classMap.put(HomeDevicesActivity.class,(LinearLayout) findViewById(R.id.dl_home_devices)); |
| | | classMap.put(HonorCollectionActivity.class,(LinearLayout) findViewById(R.id.dl_honor_collection)); |
| | |
| | | private boolean isSearchLayoutVisible; |
| | | private PopupWindow mOperatePopupWindow; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_annual_health_status; |
| | | public int getLayoutId() {return R.layout.activity_annual_health_status; |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | | 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; |
| | |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | binding.rvImage.setAdapter(adapter); |
| | | |
| | | |
| | | memoRvAdapter = new MemoRvAdapter(this); |
| | | LinearItemDecoration itemDecoration = new LinearItemDecoration(); |
| | | itemDecoration.setBottomSpace(ScreenSizeUtils.dip2px(this, 15)); |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.Editable; |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.util.Log; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | |
| | | 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.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityFamilyMemorabiliaBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, new Observer<List<FamilyMemorabiliaBean>>() { |
| | | @Override |
| | | public void onChanged(List<FamilyMemorabiliaBean> familyMemorabiliaBeans) { |
| | | adapter.addData(familyMemorabiliaBeans); |
| | | } |
| | | }); |
| | | // viewModel.getMoreListLiveData().observe(this, new Observer<List<FamilyMemorabiliaBean>>() { |
| | | // @Override |
| | | // public void onChanged(List<FamilyMemorabiliaBean> familyMemorabiliaBeans) { |
| | | // adapter.addData(familyMemorabiliaBeans); |
| | | // } |
| | | // }); |
| | | viewModel.getOperateTypeLiveData().observe(this, integer -> { |
| | | if (integer == 0){ |
| | | binding.ivOperate.setBackgroundResource(R.drawable.ic_operate); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private MutableLiveData<FamilyMemorabiliaRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<FamilyMemorabiliaBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<List<FamilyMemorabiliaBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | //创建并初始化ViewModel |
| | | public FamilyMemorabiliaActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | |
| | | //DataRepository 是一个数据仓库类,负责管理数据的获取和存储, |
| | | // 该方法通过调用 DataRepository.getInstance() 来获取 DataRepository 的单例实例,并将其返回model。 |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | |
| | | /** |
| | | * 获取家大事记 |
| | | */ |
| | | |
| | | |
| | | |
| | | //getRequestBeanLiveData().getValue() 检查请求数据的 LiveData 是否为空。 |
| | | // 如果为空,则创建一个新的 FamilyMemorabiliaRequestBean 对象,并将其设置为 LiveData 的值,以确保请求数据不为 null。 |
| | | public void getFamilyMemorabilia() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new FamilyMemorabiliaRequestBean()); |
| | | } |
| | | //设置请求数据对象的页码为 1,表示要获取第一页的数据。 |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | |
| | | //通过model(ViewModel 中的数据仓库对象)发起网络请求,并将请求数据转换为 Map 类型,以便发送给服务器。 |
| | | model.getFamilyMemorabilia(getRequestBeanLiveData().getValue().toMap()) |
| | | |
| | | //应用线程调度器,确保观察者在正确的线程上运行。 |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | |
| | | //订阅这个网络请求的结果 |
| | | .subscribe(new Observer<ResultData<PageResponseBean<FamilyMemorabiliaBean>>>() { |
| | | @Override |
| | | |
| | | //将订阅对象添加到 addSubscribe() 中,以便在不再需要时取消订阅。 |
| | | //创建 Disposable 对象来管理订阅 |
| | | // 使用 Disposable,可以有效地管理异步操作的生命周期,确保资源在不再需要时被正确释放。 |
| | | |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | //onNext()处理成功获取数据的情况 |
| | | public void onNext(ResultData<PageResponseBean<FamilyMemorabiliaBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | |
| | | //更新界面状态为 StateViewEnum.DATA_NULL |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | //隐藏状态视图并将数据列表发布到 dataListLiveData |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | |
| | | //如果返回的数据不成功,则将服务器返回的消息发布到 messageLiveData,以便通知用户。 |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | //onError()处理发生错误的情况,将错误消息发布到 messageLiveData。 |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | @NonNull //NonNull 用于标记方法参数、返回值、字段或方法的返回类型不允许为 null |
| | | |
| | | //getRequestBeanLiveData() 获取一个包含 FamilyMemorabiliaRequestBean 数据的 MutableLiveData 对象。 |
| | | public MutableLiveData<FamilyMemorabiliaRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | |
| | | AppManager.getAppManager().startActivity(FamilyAssetsActivity.class); |
| | | } |
| | | }); |
| | | |
| | | |
| | | binding.layoutFamilyMeeting.setOnClickListener(view -> { |
| | | AppManager.getAppManager().startActivity(MeetingActivity.class); |
| | | }); |
| | | binding.layoutMeetingApprove.setOnClickListener(view -> { |
| | | AppManager.getAppManager().startActivity(MeetingapproveActivity.class); |
| | | }); |
| | | binding.layoutMeetingSta.setOnClickListener(view -> { |
| | | AppManager.getAppManager().startActivity(MeetingStaActivity.class); |
| | | }); |
| | | binding.layoutWebcast.setOnClickListener(view ->{ |
| | | AppManager.getAppManager().startActivity(WebcastActivity.class); |
| | | }); |
| | | binding.layoutWebback.setOnClickListener(view ->{ |
| | | AppManager.getAppManager().startActivity(WebbackActivity.class); |
| | | }); |
| | | |
| | | |
| | | |
| | | binding.layoutHomeDevices.setOnClickListener(view -> { |
| | | AppManager.getAppManager().startActivity(HomeDevicesActivity.class); |
| | | }); |
| | |
| | | transaction.replace(R.id.layout_frame,fragment); |
| | | transaction.commit(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void initData() { |
| | | viewModel.getBannerData(); |
New file |
| | |
| | | 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 androidx.lifecycle.Observer; |
| | | |
| | | 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.MeetingRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityMeetingBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 Activity |
| | | */ |
| | | public class MeetingActivity extends DLBaseActivity<ActivityMeetingBinding,MeetingActivityViewModel>{ |
| | | |
| | | MeetingRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | private boolean isSearchLayoutVisible; |
| | | private int dateType; //0:开始时间 1:结束时间 |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_meeting; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreMeeting(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new MeetingRvAdapter(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)); |
| | | 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), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_own_top) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | 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.getMeeting(); |
| | | 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(), MeetingDetailActivity.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 |
| | | public void initData() { |
| | | viewModel.getMeeting(); |
| | | |
| | | } |
| | | |
| | | @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<MeetingBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingBean> meetingBeans) { |
| | | adapter.setData(meetingBeans); |
| | | } |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, new Observer<List<MeetingBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingBean> meetingBeans) { |
| | | if (viewModel.getOperateTypeLiveData().getValue() == 0){ |
| | | return; |
| | | } |
| | | if (meetingBeans.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, new Observer<List<MeetingBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingBean> meetingBeans) { |
| | | adapter.addData(meetingBeans); |
| | | } |
| | | }); |
| | | 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 (MeetingBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | //观察家大事记数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据 |
| | | RxBus.getInstance().toObservable(this, MeetingBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getMeeting(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | @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, MeetingDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | }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(); |
| | | } else if (id == R.id.tv_own_top) { |
| | | viewModel.ownTop(); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | |
| | | } |
| | | |
| | | // private static final String TAG = "Meeting123"; |
| | | // @Override |
| | | // protected void onCreate(Bundle savedInstanceState){ |
| | | // super.onCreate(savedInstanceState); |
| | | // setContentView(R.layout.activity_meeting); |
| | | // MeetingBean data = new MeetingBean(); |
| | | // String b = String.valueOf(data.getDate1()); |
| | | // String c = String.valueOf(data.getTime1()); |
| | | // String d = String.valueOf(data.getStartTime()); |
| | | // Log.d(TAG,b+c+d); |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import static com.android.app_base.base.BaseConfig.CODE_SUCCESS; |
| | | |
| | | import android.app.Application; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | 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.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingRequestBean; |
| | | 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 |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 viewmodel |
| | | */ |
| | | public class MeetingActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<List<MeetingBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<MeetingBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//右上角操作框 操作类型 0 弹出选择操作 1.完成 2.删除 |
| | | private MutableLiveData<MeetingRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<MeetingBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<List<MeetingBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | //创建并初始化ViewModel |
| | | public MeetingActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | |
| | | //DataRepository 是一个数据仓库类,负责管理数据的获取和存储, |
| | | // 该方法通过调用 DataRepository.getInstance() 来获取 DataRepository 的单例实例,并将其返回model。 |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | /** |
| | | * 获取家大事 |
| | | * 记 |
| | | */ |
| | | |
| | | |
| | | |
| | | //getRequestBeanLiveData().getValue() 检查请求数据的 LiveData 是否为空。 |
| | | // 如果为空,则创建一个新的MeetingRequestBean 对象,并将其设置为 LiveData 的值,以确保请求数据不为 null。 |
| | | public void getMeeting() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new MeetingRequestBean()); |
| | | } |
| | | //设置请求数据对象的页码为 1,表示要获取第一页的数据。 |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | |
| | | //通过model(ViewModel 中的数据仓库对象)发起网络请求,并将请求数据转换为 Map 类型,以便发送给服务器。 |
| | | model.getMeeting(getRequestBeanLiveData().getValue().toMap()) |
| | | |
| | | //应用线程调度器,确保观察者在正确的线程上运行。 |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | |
| | | //订阅这个网络请求的结果 |
| | | .subscribe(new Observer<ResultData<PageResponseBean<MeetingBean>>>() { |
| | | @Override |
| | | |
| | | //将订阅对象添加到 addSubscribe() 中,以便在不再需要时取消订阅。 |
| | | //创建 Disposable 对象来管理订阅 |
| | | // 使用 Disposable,可以有效地管理异步操作的生命周期,确保资源在不再需要时被正确释放。 |
| | | |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | //onNext()处理成功获取数据的情况 |
| | | public void onNext(ResultData<PageResponseBean<MeetingBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | |
| | | //更新界面状态为 StateViewEnum.DATA_NULL |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | //隐藏状态视图并将数据列表发布到 dataListLiveData |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | |
| | | //如果返回的数据不成功,则将服务器返回的消息发布到 messageLiveData,以便通知用户。 |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | //onError()处理发生错误的情况,将错误消息发布到 messageLiveData。 |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreMeeting() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new MeetingRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getMeeting(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<MeetingBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<MeetingBean>> 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<MeetingBean> deleteList = getCheckListLiveData().getValue(); |
| | | if (deleteList == null){ |
| | | return; |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | | deleteList.forEach(MeetingBean -> sb.append(MeetingBean.getId()).append(",")); |
| | | sb.deleteCharAt(sb.length()-1); |
| | | model.deleteMeeting(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){ |
| | | 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(MeetingBean bean) { |
| | | model.deleteMeeting(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<MeetingBean> list = new ArrayList<>(); |
| | | list.add(bean); |
| | | 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<MeetingBean>> 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<MeetingBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull //NonNull 用于标记方法参数、返回值、字段或方法的返回类型不允许为 null |
| | | |
| | | //getRequestBeanLiveData() 获取一个包含MeetingRequestBean 数据的 MutableLiveData 对象。 |
| | | public MutableLiveData<MeetingRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new MeetingRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<MeetingRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<MeetingBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null){ |
| | | dataListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return dataListLiveData; |
| | | } |
| | | |
| | | public void setDataListLiveData(MutableLiveData<List<MeetingBean>> dataListLiveData) { |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<List<MeetingBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<MeetingBean>> 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<MeetingBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<MeetingBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | | */ |
| | | public void changeOrder(boolean b) { |
| | | List<MeetingBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | 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 { |
| | | 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.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); |
| | | } |
| | | |
| | | /** |
| | | * 本家数据 置顶 |
| | | */ |
| | | public void ownTop(){ |
| | | List<MeetingBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | //根据ownData值为1的 放到前面 |
| | | list.sort((o1, o2) -> { |
| | | if (o1.getOwnData() == 1 && o2.getOwnData() == 0) { |
| | | return -1; |
| | | } else if (o1.getOwnData() == 0 && o2.getOwnData() == 1) { |
| | | return 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.ClipData; |
| | | import android.content.Intent; |
| | | import android.net.Uri; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.activity.result.ActivityResult; |
| | | import androidx.activity.result.ActivityResultCallback; |
| | | import androidx.activity.result.ActivityResultLauncher; |
| | | import androidx.activity.result.contract.ActivityResultContracts; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | 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.WaitDialog; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.GetFilePathFromUri; |
| | | 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.ElectronicFileAddAdapter; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityMeetingDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.OptionPicker; |
| | | import com.github.gzuliyujiang.wheelpicker.TimePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnTimePickedListener; |
| | | import com.luck.picture.lib.entity.LocalMedia; |
| | | import com.luck.picture.lib.interfaces.OnResultCallbackListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | |
| | | |
| | | /** |
| | | * @author Gss |
| | | * @date 2023.03.25. 16:00 |
| | | * @desc 家大事记 MeetingDetailActivity |
| | | */ |
| | | public class MeetingDetailActivity extends DLBaseActivity<ActivityMeetingDetailBinding, MeetingDetailActivityViewModel> { |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | private MutableLiveData<MeetingBean> beanLiveData; |
| | | private ElectronicFileAddAdapter adapter; |
| | | private BaseDialog mWaitDialog; |
| | | private ActivityResultLauncher<Intent> activityResultLauncher; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_meeting_detail; |
| | | } |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0 || type == 2){ |
| | | MeetingBean bean = (MeetingBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean !=null){ |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new ElectronicFileAddAdapter(this); |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | adapter.setItemAndAddClickListener(new ElectronicFileAddAdapter.OnItemAndAddClickListener() { |
| | | @Override |
| | | public void onItemClick(View v, int position) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAddClick() { |
| | | OptionPicker picker = getOptionPicker(Arrays.asList("图片视频","其他文件")); |
| | | picker.setTitle("选择文件类型"); |
| | | picker.setOnOptionPickedListener(new OnOptionPickedListener() { |
| | | @Override |
| | | public void onOptionPicked(int position, Object item) { |
| | | if (item.equals("图片视频")) { |
| | | UserManager.getInstance().selectImage(getSelfActivity(), 0,9, new OnResultCallbackListener<LocalMedia>() { |
| | | @Override |
| | | public void onResult(ArrayList<LocalMedia> result) { |
| | | if (result.size() == 0) return; |
| | | for (LocalMedia media : result) { |
| | | String path = media.getRealPath(); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | MeetingBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | Intent intent = new Intent(Intent.ACTION_GET_CONTENT); |
| | | // Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); |
| | | intent.setType("*/*"); // 限制文件类型 |
| | | intent.addCategory(Intent.CATEGORY_OPENABLE); // 添加 CATEGORY_OPENABLE 分类,告诉系统要选择的内容可以被打开,这样系统会过滤掉不能被应用打开的文件,以提供更好的用户体验。 |
| | | intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); // 允许多选 |
| | | activityResultLauncher.launch(intent); |
| | | } |
| | | } |
| | | }); |
| | | picker.show(); |
| | | |
| | | } |
| | | }); |
| | | adapter.setOnChildClickListener(R.id.iv_delete, new BaseRVAdapter.OnChildClickListener() { |
| | | @Override |
| | | public void onChildClick(RecyclerView recyclerView, View childView, int position) { |
| | | MeetingBean 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().setValue(true); |
| | | binding.titleBar.setTitle("新增家大事记"); |
| | | 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(); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().postValue(false); |
| | | }else if (type == 2){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | binding.etDate1.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.etDate1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etDate2.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.etDate2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etTime1.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | |
| | | @Override |
| | | |
| | | public void onTimePicked(int hour, int Minute,int second) { |
| | | // second = '0'; |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second); |
| | | binding.etTime1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | binding.etTime2.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | @Override |
| | | public void onTimePicked(int hour, int Minute, int second) { |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second ); |
| | | binding.etTime2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() { |
| | | @Override |
| | | public void onActivityResult(ActivityResult result) { |
| | | if (result.getResultCode() == Activity.RESULT_OK) { |
| | | if (result.getData() == null){ |
| | | return; |
| | | } |
| | | // 获取选中的多个文件的 URI |
| | | ClipData clipData = result.getData().getClipData(); |
| | | if (clipData != null) { |
| | | int itemCount = clipData.getItemCount(); |
| | | for (int i = 0; i < itemCount; i++) { |
| | | Uri uri = clipData.getItemAt(i).getUri(); |
| | | // 使用选中的文件 URI 进行后续操作,比如读取文件内容等 |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),uri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | MeetingBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | }else { |
| | | // 获取选中的单个文件的 URI |
| | | Uri selectedFileUri = result.getData().getData(); |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),selectedFileUri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | MeetingBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | // beanLiveData.setValue=MeetingBean; |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this, bean -> { |
| | | if (bean!=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | adapter.setData(urlList); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().observe(this,operateType -> { |
| | | if (operateType){ |
| | | if (type == 1) { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.update(); |
| | | }); |
| | | } |
| | | setIsEdited(true); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | setIsEdited(false); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public void setIsEdited(boolean isEdited){ |
| | | adapter.setIsEdited(isEdited); |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogLoading() { |
| | | if (mWaitDialog == null) { |
| | | mWaitDialog = new WaitDialog.Builder(this) |
| | | // 消息文本可以不用填写 |
| | | .setMessage("正在上传") |
| | | .create(); |
| | | } |
| | | if (!mWaitDialog.isShowing()) { |
| | | mWaitDialog.show(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogDismiss() { |
| | | if (mWaitDialog != null && mWaitDialog.isShowing()) { |
| | | mWaitDialog.dismiss(); |
| | | mWaitDialog = null; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 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.manager.AppManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observable; |
| | | import io.reactivex.ObservableSource; |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | import io.reactivex.functions.Consumer; |
| | | import io.reactivex.functions.Function; |
| | | import okhttp3.MediaType; |
| | | import okhttp3.MultipartBody; |
| | | import okhttp3.RequestBody; |
| | | |
| | | public class MeetingDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<MeetingBean> beanLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | private final List<String> uploadFileList = new ArrayList<>();//需要上传的文件列表 |
| | | public MeetingDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | | public void add() { |
| | | if (uploadFileList.size() > 0) { |
| | | List<Observable<String>> observables = new ArrayList<>(); |
| | | for (String path : uploadFileList) { |
| | | File file = new File(path); |
| | | RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | Observable<String> uploadObservable = model.uploadFile(body) |
| | | .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | @Override |
| | | public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | if (resultData.getCode() == CODE_SUCCESS) { |
| | | MeetingBean bean = getBeanLiveData().getValue(); |
| | | if (bean != null) { |
| | | String urls = bean.getUrl(); |
| | | //替换图片地址 |
| | | urls = urls.replace(path, resultData.getData().getUrl()); |
| | | bean.setUrl(urls); |
| | | getBeanLiveData().postValue(bean); |
| | | } |
| | | return Observable.just(path); |
| | | } else { |
| | | return Observable.error(new Exception(resultData.getMsg())); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | observables.add(uploadObservable); |
| | | } |
| | | Observable.zip(observables, result -> result) |
| | | .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | @Override |
| | | public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | //移除已经上传的文件 |
| | | //把objects数组转换成list,然后移除 |
| | | for (Object object : objects) { |
| | | uploadFileList.remove((String) object); |
| | | } |
| | | return model.addMeeting(beanLiveData.getValue()); |
| | | } |
| | | }) |
| | | .doOnSubscribe(new Consumer<Disposable>() { |
| | | @Override |
| | | public void accept(Disposable disposable) throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | } |
| | | }) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | } |
| | | }) |
| | | .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() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | model.addMeeting(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() { |
| | | model.deleteMeeting(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() { |
| | | if (uploadFileList.size() > 0){ |
| | | List<Observable<String>> observables = new ArrayList<>(); |
| | | for (String path : uploadFileList) { |
| | | File file = new File(path); |
| | | RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | Observable<String> uploadObservable = model.uploadFile(body) |
| | | .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | @Override |
| | | public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | if (resultData.getCode() == CODE_SUCCESS){ |
| | | MeetingBean bean = getBeanLiveData().getValue(); |
| | | if (bean != null){ |
| | | String urls = bean.getUrl(); |
| | | //替换图片地址 |
| | | urls = urls.replace(path,resultData.getData().getUrl()); |
| | | bean.setUrl(urls); |
| | | getBeanLiveData().postValue(bean); |
| | | } |
| | | return Observable.just(path); |
| | | }else { |
| | | return Observable.error(new Exception(resultData.getMsg())); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | observables.add(uploadObservable); |
| | | } |
| | | Observable.zip(observables,result -> result) |
| | | .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | @Override |
| | | public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | //移除已经上传的文件 |
| | | //把objects数组转换成list,然后移除 |
| | | for (Object object : objects) { |
| | | uploadFileList.remove((String) object); |
| | | } |
| | | return model.updateMeeting(beanLiveData.getValue()); |
| | | } |
| | | }) |
| | | .doOnSubscribe(new Consumer<Disposable>() { |
| | | @Override |
| | | public void accept(Disposable disposable) throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | } |
| | | }) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | } |
| | | }) |
| | | .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() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | model.updateMeeting(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 MutableLiveData<MeetingBean> getBeanLiveData() { |
| | | if (beanLiveData == null){ |
| | | beanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (beanLiveData.getValue() == null){ |
| | | beanLiveData.setValue(new MeetingBean()); |
| | | } |
| | | return beanLiveData; |
| | | } |
| | | |
| | | public void setBeanLiveData(MutableLiveData<MeetingBean> beanLiveData) { |
| | | this.beanLiveData = beanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<Boolean> getTypeLiveData() { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | } |
| | | return typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(MutableLiveData<Boolean> typeLiveData) { |
| | | this.typeLiveData = typeLiveData; |
| | | } |
| | | |
| | | public List<String> getUploadFileList() { |
| | | return uploadFileList; |
| | | } |
| | | |
| | | public void addUploadFile(String url) { |
| | | uploadFileList.add(url); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | 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.MeetingStaRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityMeetingStaBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 Activity |
| | | */ |
| | | public class MeetingStaActivity extends DLBaseActivity<ActivityMeetingStaBinding,MeetingStaActivityViewModel>{ |
| | | |
| | | MeetingStaRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | private boolean isSearchLayoutVisible; |
| | | private int dateType; //0:开始时间 1:结束时间 |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_meeting_sta; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreMeeting(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new MeetingStaRvAdapter(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)); |
| | | 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), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_own_top) |
| | | ); |
| | | // //点击放大镜按钮显示出搜索框 |
| | | // 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.getMeeting(); |
| | | // 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(), MeetingStaDetailActivity.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 |
| | | public void initData() { |
| | | viewModel.getMeetingSta(); |
| | | |
| | | } |
| | | |
| | | // @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<MeetingStaBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingStaBean> meetingstaBeans) { |
| | | adapter.setData(meetingstaBeans); |
| | | } |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, new Observer<List<MeetingStaBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingStaBean> meetingStaBeans) { |
| | | if (viewModel.getOperateTypeLiveData().getValue() == 0){ |
| | | return; |
| | | } |
| | | if (meetingStaBeans.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, new Observer<List<MeetingStaBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingStaBean> meetingStaBeans) { |
| | | adapter.addData(meetingStaBeans); |
| | | } |
| | | }); |
| | | 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 (MeetingStaBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | //观察家大事记数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据 |
| | | RxBus.getInstance().toObservable(this, MeetingStaBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getMeetingSta(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | @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, MeetingDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | // }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(); |
| | | // } else if (id == R.id.tv_own_top) { |
| | | // viewModel.ownTop(); |
| | | // mOperatePopupWindow.dismiss(); |
| | | // } |
| | | // } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | |
| | | } |
| | | |
| | | // private static final String TAG = "Meeting123"; |
| | | // @Override |
| | | // protected void onCreate(Bundle savedInstanceState){ |
| | | // super.onCreate(savedInstanceState); |
| | | // setContentView(R.layout.activity_meeting); |
| | | // MeetingBean data = new MeetingBean(); |
| | | // String b = String.valueOf(data.getDate1()); |
| | | // String c = String.valueOf(data.getTime1()); |
| | | // String d = String.valueOf(data.getStartTime()); |
| | | // Log.d(TAG,b+c+d); |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | 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.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaRequestBean; |
| | | 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 |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 viewmodel |
| | | */ |
| | | public class MeetingStaActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<List<MeetingStaBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<MeetingStaBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//右上角操作框 操作类型 0 弹出选择操作 1.完成 2.删除 |
| | | private MutableLiveData<MeetingStaRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<MeetingStaBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<List<MeetingStaBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | //创建并初始化ViewModel |
| | | public MeetingStaActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | |
| | | //DataRepository 是一个数据仓库类,负责管理数据的获取和存储, |
| | | // 该方法通过调用 DataRepository.getInstance() 来获取 DataRepository 的单例实例,并将其返回model。 |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | /** |
| | | * 获取家大事 |
| | | * 记 |
| | | */ |
| | | |
| | | |
| | | |
| | | //getRequestBeanLiveData().getValue() 检查请求数据的 LiveData 是否为空。 |
| | | // 如果为空,则创建一个新的MeetingRequestBean 对象,并将其设置为 LiveData 的值,以确保请求数据不为 null。 |
| | | public void getMeetingSta() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new MeetingStaRequestBean()); |
| | | } |
| | | //设置请求数据对象的页码为 1,表示要获取第一页的数据。 |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | |
| | | //通过model(ViewModel 中的数据仓库对象)发起网络请求,并将请求数据转换为 Map 类型,以便发送给服务器。 |
| | | model.getMeetingSta(getRequestBeanLiveData().getValue().toMap()) |
| | | |
| | | //应用线程调度器,确保观察者在正确的线程上运行。 |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | |
| | | //订阅这个网络请求的结果 |
| | | .subscribe(new Observer<ResultData<PageResponseBean<MeetingStaBean>>>() { |
| | | @Override |
| | | |
| | | //将订阅对象添加到 addSubscribe() 中,以便在不再需要时取消订阅。 |
| | | //创建 Disposable 对象来管理订阅 |
| | | // 使用 Disposable,可以有效地管理异步操作的生命周期,确保资源在不再需要时被正确释放。 |
| | | |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | //onNext()处理成功获取数据的情况 |
| | | public void onNext(ResultData<PageResponseBean<MeetingStaBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | |
| | | //更新界面状态为 StateViewEnum.DATA_NULL |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | //隐藏状态视图并将数据列表发布到 dataListLiveData |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData |
| | | |
| | | |
| | | ()); |
| | | } |
| | | |
| | | //如果返回的数据不成功,则将服务器返回的消息发布到 messageLiveData,以便通知用户。 |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | //onError()处理发生错误的情况,将错误消息发布到 messageLiveData。 |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreMeeting() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new MeetingStaBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getMeetingSta(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<MeetingStaBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<MeetingStaBean>> 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<MeetingBean> deleteList = getCheckListLiveData().getValue(); |
| | | // if (deleteList == null){ |
| | | // return; |
| | | // } |
| | | // StringBuffer sb = new StringBuffer(); |
| | | // deleteList.forEach(MeetingBean -> sb.append(MeetingBean.getId()).append(",")); |
| | | // sb.deleteCharAt(sb.length()-1); |
| | | // model.deleteMeeting(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){ |
| | | // 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(MeetingBean bean) { |
| | | // model.deleteMeeting(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<MeetingStaBean> list = new ArrayList<>(); |
| | | // list.add(bean); |
| | | // 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<MeetingStaBean>> 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<MeetingStaBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull //NonNull 用于标记方法参数、返回值、字段或方法的返回类型不允许为 null |
| | | |
| | | //getRequestBeanLiveData() 获取一个包含MeetingRequestBean 数据的 MutableLiveData 对象。 |
| | | public MutableLiveData<MeetingStaRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new MeetingStaRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<MeetingStaRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<MeetingStaBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null){ |
| | | dataListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return dataListLiveData; |
| | | } |
| | | |
| | | public void setDataListLiveData(MutableLiveData<List<MeetingStaBean>> dataListLiveData) { |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<List<MeetingStaBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<MeetingStaBean>> 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<MeetingStaBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<MeetingStaBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | | */ |
| | | // public void changeOrder(boolean b) { |
| | | // List<MeetingStaBean> list = getDataListLiveData().getValue(); |
| | | // if (list == null || list.isEmpty()){ |
| | | // return; |
| | | // } |
| | | // 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 { |
| | | // 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.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); |
| | | // } |
| | | |
| | | /** |
| | | * 本家数据 置顶 |
| | | */ |
| | | public void ownTop(){ |
| | | List<MeetingStaBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | //根据ownData值为1的 放到前面 |
| | | list.sort((o1, o2) -> { |
| | | if (o1.getOwnData() == 1 && o2.getOwnData() == 0) { |
| | | return -1; |
| | | } else if (o1.getOwnData() == 0 && o2.getOwnData() == 1) { |
| | | return 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.content.Intent; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.activity.result.ActivityResultLauncher; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.WaitDialog; |
| | | 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.ElectronicFileAddAdapter; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityMeetingStaDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @author Gss |
| | | * @date 2023.03.25. 16:00 |
| | | * @desc 家大事记 MeetingDetailActivity |
| | | */ |
| | | public class MeetingStaDetailActivity extends DLBaseActivity<ActivityMeetingStaDetailBinding, MeetingStaDetailActivityViewModel> { |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | private MutableLiveData<MeetingStaBean> beanLiveData; |
| | | private ElectronicFileAddAdapter adapter; |
| | | private BaseDialog mWaitDialog; |
| | | private ActivityResultLauncher<Intent> activityResultLauncher; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_meeting_sta_detail; |
| | | } |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0 || type == 2){ |
| | | MeetingStaBean bean = (MeetingStaBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean !=null){ |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new ElectronicFileAddAdapter(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) { |
| | | // MeetingStaBean 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().setValue(true); |
| | | // binding.titleBar.setTitle("新增家大事记"); |
| | | // 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(); |
| | | // } |
| | | // }); |
| | | // viewModel.getTypeLiveData().postValue(false); |
| | | // }else if (type == 2){ |
| | | // viewModel.getTypeLiveData().postValue(true); |
| | | // |
| | | // } |
| | | |
| | | |
| | | |
| | | // binding.etDate1.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.etDate1.setText(date); |
| | | // } |
| | | // }); |
| | | // picker.show(); |
| | | // } |
| | | // }); |
| | | |
| | | // binding.etDate2.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.etDate2.setText(date); |
| | | // } |
| | | // }); |
| | | // picker.show(); |
| | | // } |
| | | // }); |
| | | |
| | | // binding.etTime1.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // TimePicker picker = getTimePicker(); |
| | | // picker.setTitle("选择时间"); |
| | | // picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | // |
| | | // @Override |
| | | // |
| | | // public void onTimePicked(int hour, int Minute,int second) { |
| | | //// second = '0'; |
| | | // String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second); |
| | | // binding.etTime1.setText(date); |
| | | // } |
| | | // }); |
| | | // picker.show(); |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | |
| | | |
| | | // binding.etTime2.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // TimePicker picker = getTimePicker(); |
| | | // picker.setTitle("选择时间"); |
| | | // picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | // @Override |
| | | // public void onTimePicked(int hour, int Minute, int second) { |
| | | // String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second ); |
| | | // binding.etTime2.setText(date); |
| | | // } |
| | | // }); |
| | | // picker.show(); |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() { |
| | | // @Override |
| | | // public void onActivityResult(ActivityResult result) { |
| | | // if (result.getResultCode() == Activity.RESULT_OK) { |
| | | // if (result.getData() == null){ |
| | | // return; |
| | | // } |
| | | // // 获取选中的多个文件的 URI |
| | | // ClipData clipData = result.getData().getClipData(); |
| | | // if (clipData != null) { |
| | | // int itemCount = clipData.getItemCount(); |
| | | // for (int i = 0; i < itemCount; i++) { |
| | | // Uri uri = clipData.getItemAt(i).getUri(); |
| | | // // 使用选中的文件 URI 进行后续操作,比如读取文件内容等 |
| | | // String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),uri); |
| | | // if (path!=null){ |
| | | // viewModel.addUploadFile(path); |
| | | // MeetingStaBean bean = viewModel.getBeanLiveData().getValue(); |
| | | // if (bean !=null){ |
| | | // List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | // urlList.add(path); |
| | | // bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | // } |
| | | // viewModel.getBeanLiveData().setValue(bean); |
| | | // } |
| | | // } |
| | | // }else { |
| | | // // 获取选中的单个文件的 URI |
| | | // Uri selectedFileUri = result.getData().getData(); |
| | | // String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),selectedFileUri); |
| | | // if (path!=null){ |
| | | // viewModel.addUploadFile(path); |
| | | // MeetingStaBean bean = viewModel.getBeanLiveData().getValue(); |
| | | // if (bean !=null){ |
| | | // List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | // urlList.add(path); |
| | | // bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | // } |
| | | // viewModel.getBeanLiveData().setValue(bean); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | // beanLiveData.setValue=MeetingStaBean; |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this, bean -> { |
| | | if (bean!=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | adapter.setData(urlList); |
| | | } |
| | | }); |
| | | // viewModel.getTypeLiveData().observe(this,operateType -> { |
| | | // if (operateType){ |
| | | // if (type == 1) { |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // viewModel.add(); |
| | | // }); |
| | | // }else { |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // viewModel.update(); |
| | | // }); |
| | | // } |
| | | // setIsEdited(true); |
| | | // }else { |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | // }); |
| | | // setIsEdited(false); |
| | | // } |
| | | // }); |
| | | } |
| | | |
| | | public void setIsEdited(boolean isEdited){ |
| | | adapter.setIsEdited(isEdited); |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogLoading() { |
| | | if (mWaitDialog == null) { |
| | | mWaitDialog = new WaitDialog.Builder(this) |
| | | // 消息文本可以不用填写 |
| | | .setMessage("正在上传") |
| | | .create(); |
| | | } |
| | | if (!mWaitDialog.isShowing()) { |
| | | mWaitDialog.show(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogDismiss() { |
| | | if (mWaitDialog != null && mWaitDialog.isShowing()) { |
| | | mWaitDialog.dismiss(); |
| | | mWaitDialog = null; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.application.zhangshi_app_android.bean.MeetingStaBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.04.21. 21:16 |
| | | * @desc |
| | | */ |
| | | public class MeetingStaDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<MeetingStaBean> beanLiveData; |
| | | private MutableLiveData<List<MeetingStaBean>> meetingStaListLiveData; |
| | | |
| | | public MeetingStaDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 获取备忘录 |
| | | */ |
| | | // public void getMeetingSta() { |
| | | // if (beanLiveData.getValue() == null) { |
| | | // return; |
| | | // } |
| | | // |
| | | // model.getMeetingSta(getBeanLiveData().getValue().toMap()) |
| | | // .compose(RxUtils.schedulersTransformer()) |
| | | // .subscribe(new Observer<ResultData<List<MeetingStaBean>>>() { |
| | | // @Override |
| | | // public void onSubscribe(Disposable d) { |
| | | // addSubscribe(d); |
| | | // } |
| | | // |
| | | // @Override |
| | | // public void onNext(ResultData<List<MeetingStaBean>> data) { |
| | | // if (data.getCode() == CODE_SUCCESS){ |
| | | // meetingStaListLiveData.postValue(data.getData()); |
| | | // }else { |
| | | // messageLiveData.postValue(data.getMsg()); |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // public void onError(Throwable e) { |
| | | // messageLiveData.postValue(e.getMessage()); |
| | | // } |
| | | // |
| | | // @Override |
| | | // public void onComplete() { |
| | | // |
| | | // } |
| | | // }); |
| | | // } |
| | | public MutableLiveData<MeetingStaBean> getBeanLiveData() { |
| | | if (beanLiveData == null) { |
| | | beanLiveData = new MutableLiveData<>(); |
| | | } |
| | | return beanLiveData; |
| | | } |
| | | |
| | | public void setBeanLiveData(MutableLiveData<MeetingStaBean> beanLiveData) { |
| | | this.beanLiveData = beanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<MeetingStaBean>> getMeetingStaListLiveData() { |
| | | if (meetingStaListLiveData == null){ |
| | | meetingStaListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return meetingStaListLiveData; |
| | | } |
| | | |
| | | public void setMeetingStaListLiveData(MutableLiveData<List<MeetingStaBean>> meetingStaListLiveData) { |
| | | this.meetingStaListLiveData = meetingStaListLiveData; |
| | | } |
| | | } |
New file |
| | |
| | | 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 androidx.lifecycle.Observer; |
| | | |
| | | 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.MeetingapproveRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityMeetingApproveBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 Activity |
| | | */ |
| | | public class MeetingapproveActivity extends DLBaseActivity<ActivityMeetingApproveBinding,MeetingapproveActivityViewModel>{ |
| | | |
| | | MeetingapproveRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | private boolean isSearchLayoutVisible; |
| | | private int dateType; //0:开始时间 1:结束时间 |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_meeting_approve; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreMeeting(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new MeetingapproveRvAdapter(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)); |
| | | 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), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_own_top) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | 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.getMeeting(); |
| | | 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(), MeetingapproveDetailActivity.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 |
| | | public void initData() { |
| | | viewModel.getMeeting(); |
| | | |
| | | } |
| | | |
| | | @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<MeetingBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingBean> meetingBeans) { |
| | | adapter.setData(meetingBeans); |
| | | } |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, new Observer<List<MeetingBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingBean> meetingBeans) { |
| | | if (viewModel.getOperateTypeLiveData().getValue() == 0){ |
| | | return; |
| | | } |
| | | if (meetingBeans.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, new Observer<List<MeetingBean>>() { |
| | | @Override |
| | | public void onChanged(List<MeetingBean> meetingBeans) { |
| | | adapter.addData(meetingBeans); |
| | | } |
| | | }); |
| | | 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 (MeetingBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | //观察家大事记数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据 |
| | | RxBus.getInstance().toObservable(this, MeetingBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getMeeting(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | @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, MeetingapproveDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | }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(); |
| | | } else if (id == R.id.tv_own_top) { |
| | | viewModel.ownTop(); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | |
| | | } |
| | | |
| | | // private static final String TAG = "Meeting123"; |
| | | // @Override |
| | | // protected void onCreate(Bundle savedInstanceState){ |
| | | // super.onCreate(savedInstanceState); |
| | | // setContentView(R.layout.activity_meeting); |
| | | // MeetingBean data = new MeetingBean(); |
| | | // String b = String.valueOf(data.getDate1()); |
| | | // String c = String.valueOf(data.getTime1()); |
| | | // String d = String.valueOf(data.getStartTime()); |
| | | // Log.d(TAG,b+c+d); |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | 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.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.MeetingRequestBean; |
| | | 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 |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 viewmodel |
| | | */ |
| | | public class MeetingapproveActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<List<MeetingBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<MeetingBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//右上角操作框 操作类型 0 弹出选择操作 1.完成 2.删除 |
| | | private MutableLiveData<MeetingRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<MeetingBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<List<MeetingBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | //创建并初始化ViewModel |
| | | public MeetingapproveActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | |
| | | //DataRepository 是一个数据仓库类,负责管理数据的获取和存储, |
| | | // 该方法通过调用 DataRepository.getInstance() 来获取 DataRepository 的单例实例,并将其返回model。 |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | /** |
| | | * 获取家大事 |
| | | * 记 |
| | | */ |
| | | |
| | | |
| | | |
| | | //getRequestBeanLiveData().getValue() 检查请求数据的 LiveData 是否为空。 |
| | | // 如果为空,则创建一个新的MeetingRequestBean 对象,并将其设置为 LiveData 的值,以确保请求数据不为 null。 |
| | | public void getMeeting() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new MeetingRequestBean()); |
| | | } |
| | | //设置请求数据对象的页码为 1,表示要获取第一页的数据。 |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | |
| | | //通过model(ViewModel 中的数据仓库对象)发起网络请求,并将请求数据转换为 Map 类型,以便发送给服务器。 |
| | | model.getMeeting(getRequestBeanLiveData().getValue().toMap()) |
| | | |
| | | //应用线程调度器,确保观察者在正确的线程上运行。 |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | |
| | | //订阅这个网络请求的结果 |
| | | .subscribe(new Observer<ResultData<PageResponseBean<MeetingBean>>>() { |
| | | @Override |
| | | |
| | | //将订阅对象添加到 addSubscribe() 中,以便在不再需要时取消订阅。 |
| | | //创建 Disposable 对象来管理订阅 |
| | | // 使用 Disposable,可以有效地管理异步操作的生命周期,确保资源在不再需要时被正确释放。 |
| | | |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | //onNext()处理成功获取数据的情况 |
| | | public void onNext(ResultData<PageResponseBean<MeetingBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | |
| | | //更新界面状态为 StateViewEnum.DATA_NULL |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | //隐藏状态视图并将数据列表发布到 dataListLiveData |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | |
| | | //如果返回的数据不成功,则将服务器返回的消息发布到 messageLiveData,以便通知用户。 |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | //onError()处理发生错误的情况,将错误消息发布到 messageLiveData。 |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreMeeting() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new MeetingRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getMeeting(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<MeetingBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<MeetingBean>> 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<MeetingBean> deleteList = getCheckListLiveData().getValue(); |
| | | if (deleteList == null){ |
| | | return; |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | | deleteList.forEach(MeetingBean -> sb.append(MeetingBean.getId()).append(",")); |
| | | sb.deleteCharAt(sb.length()-1); |
| | | model.deleteMeeting(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){ |
| | | 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(MeetingBean bean) { |
| | | model.deleteMeeting(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<MeetingBean> list = new ArrayList<>(); |
| | | list.add(bean); |
| | | 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<MeetingBean>> 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<MeetingBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull //NonNull 用于标记方法参数、返回值、字段或方法的返回类型不允许为 null |
| | | |
| | | //getRequestBeanLiveData() 获取一个包含MeetingRequestBean 数据的 MutableLiveData 对象。 |
| | | public MutableLiveData<MeetingRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new MeetingRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<MeetingRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<MeetingBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null){ |
| | | dataListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return dataListLiveData; |
| | | } |
| | | |
| | | public void setDataListLiveData(MutableLiveData<List<MeetingBean>> dataListLiveData) { |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<List<MeetingBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<MeetingBean>> 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<MeetingBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<MeetingBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | | */ |
| | | public void changeOrder(boolean b) { |
| | | List<MeetingBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | 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 { |
| | | 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.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); |
| | | } |
| | | |
| | | /** |
| | | * 本家数据 置顶 |
| | | */ |
| | | public void ownTop(){ |
| | | List<MeetingBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | //根据ownData值为1的 放到前面 |
| | | list.sort((o1, o2) -> { |
| | | if (o1.getOwnData() == 1 && o2.getOwnData() == 0) { |
| | | return -1; |
| | | } else if (o1.getOwnData() == 0 && o2.getOwnData() == 1) { |
| | | return 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.ClipData; |
| | | import android.content.Intent; |
| | | import android.net.Uri; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.activity.result.ActivityResult; |
| | | import androidx.activity.result.ActivityResultCallback; |
| | | import androidx.activity.result.ActivityResultLauncher; |
| | | import androidx.activity.result.contract.ActivityResultContracts; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | 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.WaitDialog; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.GetFilePathFromUri; |
| | | 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.ElectronicFileAddAdapter; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityMeetingApproveDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.OptionPicker; |
| | | import com.github.gzuliyujiang.wheelpicker.TimePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnTimePickedListener; |
| | | import com.luck.picture.lib.entity.LocalMedia; |
| | | import com.luck.picture.lib.interfaces.OnResultCallbackListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | |
| | | |
| | | /** |
| | | * @author Gss |
| | | * @date 2023.03.25. 16:00 |
| | | * @desc 家大事记 MeetingDetailActivity |
| | | */ |
| | | public class MeetingapproveDetailActivity extends DLBaseActivity<ActivityMeetingApproveDetailBinding, MeetingapproveDetailActivityViewModel> { |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | private MutableLiveData<MeetingBean> beanLiveData; |
| | | private ElectronicFileAddAdapter adapter; |
| | | private BaseDialog mWaitDialog; |
| | | private ActivityResultLauncher<Intent> activityResultLauncher; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_meeting_approve_detail; |
| | | } |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0 || type == 2){ |
| | | MeetingBean bean = (MeetingBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean !=null){ |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new ElectronicFileAddAdapter(this); |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | adapter.setItemAndAddClickListener(new ElectronicFileAddAdapter.OnItemAndAddClickListener() { |
| | | @Override |
| | | public void onItemClick(View v, int position) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAddClick() { |
| | | OptionPicker picker = getOptionPicker(Arrays.asList("图片视频","其他文件")); |
| | | picker.setTitle("选择文件类型"); |
| | | picker.setOnOptionPickedListener(new OnOptionPickedListener() { |
| | | @Override |
| | | public void onOptionPicked(int position, Object item) { |
| | | if (item.equals("图片视频")) { |
| | | UserManager.getInstance().selectImage(getSelfActivity(), 0,9, new OnResultCallbackListener<LocalMedia>() { |
| | | @Override |
| | | public void onResult(ArrayList<LocalMedia> result) { |
| | | if (result.size() == 0) return; |
| | | for (LocalMedia media : result) { |
| | | String path = media.getRealPath(); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | MeetingBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | Intent intent = new Intent(Intent.ACTION_GET_CONTENT); |
| | | // Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); |
| | | intent.setType("*/*"); // 限制文件类型 |
| | | intent.addCategory(Intent.CATEGORY_OPENABLE); // 添加 CATEGORY_OPENABLE 分类,告诉系统要选择的内容可以被打开,这样系统会过滤掉不能被应用打开的文件,以提供更好的用户体验。 |
| | | intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); // 允许多选 |
| | | activityResultLauncher.launch(intent); |
| | | } |
| | | } |
| | | }); |
| | | picker.show(); |
| | | |
| | | } |
| | | }); |
| | | adapter.setOnChildClickListener(R.id.iv_delete, new BaseRVAdapter.OnChildClickListener() { |
| | | @Override |
| | | public void onChildClick(RecyclerView recyclerView, View childView, int position) { |
| | | MeetingBean 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().setValue(true); |
| | | binding.titleBar.setTitle("新增家大事记"); |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else if (type == 0){ |
| | | popupWindow = initPopUpWindow(View.inflate(this,R.layout.pop_operate_approve,null)); |
| | | popupWindow.getContentView().findViewById(R.id.tv_disagree).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | popupWindow.dismiss(); |
| | | viewModel.disagree(); |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | popupWindow.getContentView().findViewById(R.id.tv_agreed).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | popupWindow.dismiss(); |
| | | viewModel.agree(); |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | } |
| | | }); |
| | | |
| | | viewModel.getTypeLiveData().postValue(false); |
| | | }else if (type == 2){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | binding.etDate1.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.etDate1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etDate2.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.etDate2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etTime1.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | |
| | | @Override |
| | | |
| | | public void onTimePicked(int hour, int Minute,int second) { |
| | | // second = '0'; |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second); |
| | | binding.etTime1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | binding.etTime2.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | @Override |
| | | public void onTimePicked(int hour, int Minute, int second) { |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second ); |
| | | binding.etTime2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() { |
| | | @Override |
| | | public void onActivityResult(ActivityResult result) { |
| | | if (result.getResultCode() == Activity.RESULT_OK) { |
| | | if (result.getData() == null){ |
| | | return; |
| | | } |
| | | // 获取选中的多个文件的 URI |
| | | ClipData clipData = result.getData().getClipData(); |
| | | if (clipData != null) { |
| | | int itemCount = clipData.getItemCount(); |
| | | for (int i = 0; i < itemCount; i++) { |
| | | Uri uri = clipData.getItemAt(i).getUri(); |
| | | // 使用选中的文件 URI 进行后续操作,比如读取文件内容等 |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),uri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | MeetingBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | }else { |
| | | // 获取选中的单个文件的 URI |
| | | Uri selectedFileUri = result.getData().getData(); |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),selectedFileUri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | MeetingBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | // beanLiveData.setValue=MeetingBean; |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this, bean -> { |
| | | if (bean!=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | adapter.setData(urlList); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().observe(this,operateType -> { |
| | | if (operateType){ |
| | | if (type == 1) { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.update(); |
| | | }); |
| | | } |
| | | setIsEdited(true); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | setIsEdited(false); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public void setIsEdited(boolean isEdited){ |
| | | adapter.setIsEdited(isEdited); |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogLoading() { |
| | | if (mWaitDialog == null) { |
| | | mWaitDialog = new WaitDialog.Builder(this) |
| | | // 消息文本可以不用填写 |
| | | .setMessage("正在上传") |
| | | .create(); |
| | | } |
| | | if (!mWaitDialog.isShowing()) { |
| | | mWaitDialog.show(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogDismiss() { |
| | | if (mWaitDialog != null && mWaitDialog.isShowing()) { |
| | | mWaitDialog.dismiss(); |
| | | mWaitDialog = null; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | 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.manager.AppManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.MeetingBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observable; |
| | | import io.reactivex.ObservableSource; |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | import io.reactivex.functions.Consumer; |
| | | import io.reactivex.functions.Function; |
| | | import okhttp3.MediaType; |
| | | import okhttp3.MultipartBody; |
| | | import okhttp3.RequestBody; |
| | | |
| | | public class MeetingapproveDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<MeetingBean> beanLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | private final List<String> uploadFileList = new ArrayList<>();//需要上传的文件列表 |
| | | public MeetingapproveDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | | public void add() { |
| | | if (uploadFileList.size() > 0) { |
| | | List<Observable<String>> observables = new ArrayList<>(); |
| | | for (String path : uploadFileList) { |
| | | File file = new File(path); |
| | | RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | Observable<String> uploadObservable = model.uploadFile(body) |
| | | .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | @Override |
| | | public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | if (resultData.getCode() == CODE_SUCCESS) { |
| | | MeetingBean bean = getBeanLiveData().getValue(); |
| | | if (bean != null) { |
| | | String urls = bean.getUrl(); |
| | | //替换图片地址 |
| | | urls = urls.replace(path, resultData.getData().getUrl()); |
| | | bean.setUrl(urls); |
| | | getBeanLiveData().postValue(bean); |
| | | } |
| | | return Observable.just(path); |
| | | } else { |
| | | return Observable.error(new Exception(resultData.getMsg())); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | observables.add(uploadObservable); |
| | | } |
| | | Observable.zip(observables, result -> result) |
| | | .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | @Override |
| | | public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | //移除已经上传的文件 |
| | | //把objects数组转换成list,然后移除 |
| | | for (Object object : objects) { |
| | | uploadFileList.remove((String) object); |
| | | } |
| | | return model.addMeeting(beanLiveData.getValue()); |
| | | } |
| | | }) |
| | | .doOnSubscribe(new Consumer<Disposable>() { |
| | | @Override |
| | | public void accept(Disposable disposable) throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | } |
| | | }) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | } |
| | | }) |
| | | .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() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | model.addMeeting(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 agree() { |
| | | model.approveMeeting(Integer.valueOf((int) beanLiveData.getValue().getId()),1) |
| | | .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 disagree() { |
| | | model.approveMeeting(Integer.valueOf((int) beanLiveData.getValue().getId()),0) |
| | | .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() { |
| | | model.deleteMeeting(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() { |
| | | if (uploadFileList.size() > 0){ |
| | | List<Observable<String>> observables = new ArrayList<>(); |
| | | for (String path : uploadFileList) { |
| | | File file = new File(path); |
| | | RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | Observable<String> uploadObservable = model.uploadFile(body) |
| | | .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | @Override |
| | | public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | if (resultData.getCode() == CODE_SUCCESS){ |
| | | MeetingBean bean = getBeanLiveData().getValue(); |
| | | if (bean != null){ |
| | | String urls = bean.getUrl(); |
| | | //替换图片地址 |
| | | urls = urls.replace(path,resultData.getData().getUrl()); |
| | | bean.setUrl(urls); |
| | | getBeanLiveData().postValue(bean); |
| | | } |
| | | return Observable.just(path); |
| | | }else { |
| | | return Observable.error(new Exception(resultData.getMsg())); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | observables.add(uploadObservable); |
| | | } |
| | | Observable.zip(observables,result -> result) |
| | | .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | @Override |
| | | public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | //移除已经上传的文件 |
| | | //把objects数组转换成list,然后移除 |
| | | for (Object object : objects) { |
| | | uploadFileList.remove((String) object); |
| | | } |
| | | return model.updateMeeting(beanLiveData.getValue()); |
| | | } |
| | | }) |
| | | .doOnSubscribe(new Consumer<Disposable>() { |
| | | @Override |
| | | public void accept(Disposable disposable) throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | } |
| | | }) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | } |
| | | }) |
| | | .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() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | model.updateMeeting(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 MutableLiveData<MeetingBean> getBeanLiveData() { |
| | | if (beanLiveData == null){ |
| | | beanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (beanLiveData.getValue() == null){ |
| | | beanLiveData.setValue(new MeetingBean()); |
| | | } |
| | | return beanLiveData; |
| | | } |
| | | |
| | | public void setBeanLiveData(MutableLiveData<MeetingBean> beanLiveData) { |
| | | this.beanLiveData = beanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<Boolean> getTypeLiveData() { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | } |
| | | return typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(MutableLiveData<Boolean> typeLiveData) { |
| | | this.typeLiveData = typeLiveData; |
| | | } |
| | | |
| | | public List<String> getUploadFileList() { |
| | | return uploadFileList; |
| | | } |
| | | |
| | | public void addUploadFile(String url) { |
| | | uploadFileList.add(url); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | 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 androidx.lifecycle.Observer; |
| | | |
| | | 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.databinding.WebbackRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityWebbackBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 Activity |
| | | */ |
| | | public class WebbackActivity extends DLBaseActivity<ActivityWebbackBinding,WebbackActivityViewModel>{ |
| | | |
| | | WebbackRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | private boolean isSearchLayoutVisible; |
| | | private int dateType; //0:开始时间 1:结束时间 |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_webback; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreWebback(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new WebbackRvAdapter(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_read,null)); |
| | | setOnClickListener( |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_new_to_old), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_from_old_to_new), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_own_top) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | 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.getWebback(); |
| | | 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(), WebbackDetailActivity.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 |
| | | public void initData() { |
| | | viewModel.getWebback(); |
| | | |
| | | } |
| | | |
| | | @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<WebbackBean>>() { |
| | | @Override |
| | | public void onChanged(List<WebbackBean> webbackBeans) { |
| | | adapter.setData(webbackBeans); |
| | | } |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, new Observer<List<WebbackBean>>() { |
| | | @Override |
| | | public void onChanged(List<WebbackBean> webbackBeans) { |
| | | if (viewModel.getOperateTypeLiveData().getValue() == 0){ |
| | | return; |
| | | } |
| | | if (webbackBeans.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, new Observer<List<WebbackBean>>() { |
| | | @Override |
| | | public void onChanged(List<WebbackBean> webbackBeans) { |
| | | adapter.addData(webbackBeans); |
| | | } |
| | | }); |
| | | 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 (WebbackBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | //观察家大事记数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据 |
| | | RxBus.getInstance().toObservable(this, WebbackBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getWebback(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | @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_from_new_to_old) { |
| | | viewModel.changeOrder(true); |
| | | mOperatePopupWindow.dismiss(); |
| | | } else if (id == R.id.tv_from_old_to_new) { |
| | | viewModel.changeOrder(false); |
| | | mOperatePopupWindow.dismiss(); |
| | | } else if (id == R.id.tv_own_top) { |
| | | viewModel.ownTop(); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | |
| | | } |
| | | |
| | | // private static final String TAG = "Meeting123"; |
| | | // @Override |
| | | // protected void onCreate(Bundle savedInstanceState){ |
| | | // super.onCreate(savedInstanceState); |
| | | // setContentView(R.layout.activity_meeting); |
| | | // MeetingBean data = new MeetingBean(); |
| | | // String b = String.valueOf(data.getDate1()); |
| | | // String c = String.valueOf(data.getTime1()); |
| | | // String d = String.valueOf(data.getStartTime()); |
| | | // Log.d(TAG,b+c+d); |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | 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.PageResponseBean; |
| | | import com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.bean.WebbackRequestBean; |
| | | 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 |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 viewmodel |
| | | */ |
| | | public class WebbackActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<List<WebbackBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<WebbackBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//右上角操作框 操作类型 0 弹出选择操作 1.完成 2.删除 |
| | | private MutableLiveData<WebbackRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<WebbackBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<List<WebbackBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | //创建并初始化ViewModel |
| | | public WebbackActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | |
| | | //DataRepository 是一个数据仓库类,负责管理数据的获取和存储, |
| | | // 该方法通过调用 DataRepository.getInstance() 来获取 DataRepository 的单例实例,并将其返回model。 |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | /** |
| | | * 获取家大事 |
| | | * 记 |
| | | */ |
| | | |
| | | |
| | | |
| | | //getRequestBeanLiveData().getValue() 检查请求数据的 LiveData 是否为空。 |
| | | // 如果为空,则创建一个新的WebbackRequestBean 对象,并将其设置为 LiveData 的值,以确保请求数据不为 null。 |
| | | public void getWebback() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new WebbackRequestBean()); |
| | | } |
| | | //设置请求数据对象的页码为 1,表示要获取第一页的数据。 |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | |
| | | //通过model(ViewModel 中的数据仓库对象)发起网络请求,并将请求数据转换为 Map 类型,以便发送给服务器。 |
| | | model.getWebback(getRequestBeanLiveData().getValue().toMap()) |
| | | |
| | | //应用线程调度器,确保观察者在正确的线程上运行。 |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | |
| | | //订阅这个网络请求的结果 |
| | | .subscribe(new Observer<ResultData<PageResponseBean<WebbackBean>>>() { |
| | | @Override |
| | | |
| | | //将订阅对象添加到 addSubscribe() 中,以便在不再需要时取消订阅。 |
| | | //创建 Disposable 对象来管理订阅 |
| | | // 使用 Disposable,可以有效地管理异步操作的生命周期,确保资源在不再需要时被正确释放。 |
| | | |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | //onNext()处理成功获取数据的情况 |
| | | public void onNext(ResultData<PageResponseBean<WebbackBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | |
| | | //更新界面状态为 StateViewEnum.DATA_NULL |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | //隐藏状态视图并将数据列表发布到 dataListLiveData |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | |
| | | //如果返回的数据不成功,则将服务器返回的消息发布到 messageLiveData,以便通知用户。 |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | //onError()处理发生错误的情况,将错误消息发布到 messageLiveData。 |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreWebback() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new WebbackRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getWebback(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<WebbackBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<WebbackBean>> 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<WebbackBean> deleteList = getCheckListLiveData().getValue(); |
| | | // if (deleteList == null){ |
| | | // return; |
| | | // } |
| | | // StringBuffer sb = new StringBuffer(); |
| | | // deleteList.forEach(WebbackBean -> sb.append(WebbackBean.getId()).append(",")); |
| | | // sb.deleteCharAt(sb.length()-1); |
| | | // model.deleteWebback(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){ |
| | | // 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(WebbackBean bean) { |
| | | // model.deleteWebback(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<WebbackBean> list = new ArrayList<>(); |
| | | // list.add(bean); |
| | | // 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<WebbackBean>> 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<WebbackBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull //NonNull 用于标记方法参数、返回值、字段或方法的返回类型不允许为 null |
| | | |
| | | //getRequestBeanLiveData() 获取一个包含WebbackRequestBean 数据的 MutableLiveData 对象。 |
| | | public MutableLiveData<WebbackRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new WebbackRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<WebbackRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<WebbackBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null){ |
| | | dataListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return dataListLiveData; |
| | | } |
| | | |
| | | public void setDataListLiveData(MutableLiveData<List<WebbackBean>> dataListLiveData) { |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<List<WebbackBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<WebbackBean>> 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<WebbackBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<WebbackBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | | */ |
| | | public void changeOrder(boolean b) { |
| | | List<WebbackBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | if (b) { |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getDate1(); |
| | | String happenTime2 = o2.getDate2(); |
| | | 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.getDate1(); |
| | | String happenTime2 = o2.getDate2(); |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 本家数据 置顶 |
| | | */ |
| | | public void ownTop(){ |
| | | List<WebbackBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | //根据ownData值为1的 放到前面 |
| | | list.sort((o1, o2) -> { |
| | | if (o1.getOwnData() == 1 && o2.getOwnData() == 0) { |
| | | return -1; |
| | | } else if (o1.getOwnData() == 0 && o2.getOwnData() == 1) { |
| | | return 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.ClipData; |
| | | import android.content.Intent; |
| | | import android.net.Uri; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.activity.result.ActivityResult; |
| | | import androidx.activity.result.ActivityResultCallback; |
| | | import androidx.activity.result.ActivityResultLauncher; |
| | | import androidx.activity.result.contract.ActivityResultContracts; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.WaitDialog; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.GetFilePathFromUri; |
| | | 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.ElectronicFileAddAdapter; |
| | | import com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityWebbackDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.OptionPicker; |
| | | import com.github.gzuliyujiang.wheelpicker.TimePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnTimePickedListener; |
| | | import com.luck.picture.lib.entity.LocalMedia; |
| | | import com.luck.picture.lib.interfaces.OnResultCallbackListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | |
| | | |
| | | /** |
| | | * @author Gss |
| | | * @date 2023.03.25. 16:00 |
| | | * @desc 家大事记 MeetingDetailActivity |
| | | */ |
| | | public class WebbackDetailActivity extends DLBaseActivity<ActivityWebbackDetailBinding, WebbackDetailActivityViewModel> { |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | private MutableLiveData<WebbackBean> beanLiveData; |
| | | private ElectronicFileAddAdapter adapter; |
| | | private BaseDialog mWaitDialog; |
| | | private ActivityResultLauncher<Intent> activityResultLauncher; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_webback_detail; |
| | | } |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0 || type == 2){ |
| | | WebbackBean bean = (WebbackBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean !=null){ |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new ElectronicFileAddAdapter(this); |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | adapter.setItemAndAddClickListener(new ElectronicFileAddAdapter.OnItemAndAddClickListener() { |
| | | @Override |
| | | public void onItemClick(View v, int position) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAddClick() { |
| | | OptionPicker picker = getOptionPicker(Arrays.asList("图片视频","其他文件")); |
| | | picker.setTitle("选择文件类型"); |
| | | picker.setOnOptionPickedListener(new OnOptionPickedListener() { |
| | | @Override |
| | | public void onOptionPicked(int position, Object item) { |
| | | if (item.equals("图片视频")) { |
| | | UserManager.getInstance().selectImage(getSelfActivity(), 0,9, new OnResultCallbackListener<LocalMedia>() { |
| | | @Override |
| | | public void onResult(ArrayList<LocalMedia> result) { |
| | | if (result.size() == 0) return; |
| | | for (LocalMedia media : result) { |
| | | String path = media.getRealPath(); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | WebbackBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | Intent intent = new Intent(Intent.ACTION_GET_CONTENT); |
| | | // Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); |
| | | intent.setType("*/*"); // 限制文件类型 |
| | | intent.addCategory(Intent.CATEGORY_OPENABLE); // 添加 CATEGORY_OPENABLE 分类,告诉系统要选择的内容可以被打开,这样系统会过滤掉不能被应用打开的文件,以提供更好的用户体验。 |
| | | intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); // 允许多选 |
| | | activityResultLauncher.launch(intent); |
| | | } |
| | | } |
| | | }); |
| | | picker.show(); |
| | | |
| | | } |
| | | }); |
| | | // adapter.setOnChildClickListener(R.id.iv_delete, new BaseRVAdapter.OnChildClickListener() { |
| | | // @Override |
| | | // public void onChildClick(RecyclerView recyclerView, View childView, int position) { |
| | | // WebbackBean 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().setValue(true); |
| | | // binding.titleBar.setTitle("新增家大事记"); |
| | | // 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(); |
| | | // } |
| | | // }); |
| | | // viewModel.getTypeLiveData().postValue(false); |
| | | // }else if (type == 2){ |
| | | // viewModel.getTypeLiveData().postValue(true); |
| | | // |
| | | // } |
| | | |
| | | |
| | | |
| | | binding.etDate1.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.etDate1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etDate2.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.etDate2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etTime1.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | |
| | | @Override |
| | | |
| | | public void onTimePicked(int hour, int Minute,int second) { |
| | | // second = '0'; |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second); |
| | | binding.etTime1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | binding.etTime2.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | @Override |
| | | public void onTimePicked(int hour, int Minute, int second) { |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second ); |
| | | binding.etTime2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() { |
| | | @Override |
| | | public void onActivityResult(ActivityResult result) { |
| | | if (result.getResultCode() == Activity.RESULT_OK) { |
| | | if (result.getData() == null){ |
| | | return; |
| | | } |
| | | // 获取选中的多个文件的 URI |
| | | ClipData clipData = result.getData().getClipData(); |
| | | if (clipData != null) { |
| | | int itemCount = clipData.getItemCount(); |
| | | for (int i = 0; i < itemCount; i++) { |
| | | Uri uri = clipData.getItemAt(i).getUri(); |
| | | // 使用选中的文件 URI 进行后续操作,比如读取文件内容等 |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),uri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | WebbackBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | }else { |
| | | // 获取选中的单个文件的 URI |
| | | Uri selectedFileUri = result.getData().getData(); |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),selectedFileUri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | WebbackBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | // beanLiveData.setValue=WebbackBean; |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this, bean -> { |
| | | if (bean!=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | adapter.setData(urlList); |
| | | } |
| | | }); |
| | | // viewModel.getTypeLiveData().observe(this,operateType -> { |
| | | // if (operateType){ |
| | | // if (type == 1) { |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // viewModel.add(); |
| | | // }); |
| | | // }else { |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // viewModel.update(); |
| | | // }); |
| | | // } |
| | | // setIsEdited(true); |
| | | // }else { |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | // }); |
| | | // setIsEdited(false); |
| | | // } |
| | | // }); |
| | | } |
| | | |
| | | public void setIsEdited(boolean isEdited){ |
| | | adapter.setIsEdited(isEdited); |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogLoading() { |
| | | if (mWaitDialog == null) { |
| | | mWaitDialog = new WaitDialog.Builder(this) |
| | | // 消息文本可以不用填写 |
| | | .setMessage("正在上传") |
| | | .create(); |
| | | } |
| | | if (!mWaitDialog.isShowing()) { |
| | | mWaitDialog.show(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogDismiss() { |
| | | if (mWaitDialog != null && mWaitDialog.isShowing()) { |
| | | mWaitDialog.dismiss(); |
| | | mWaitDialog = null; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.app.Application; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.application.zhangshi_app_android.bean.WebbackBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class WebbackDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<WebbackBean> beanLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | private final List<String> uploadFileList = new ArrayList<>();//需要上传的文件列表 |
| | | public WebbackDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | | // public void add() { |
| | | // if (uploadFileList.size() > 0) { |
| | | // List<Observable<String>> observables = new ArrayList<>(); |
| | | // for (String path : uploadFileList) { |
| | | // File file = new File(path); |
| | | // RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | // MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | // Observable<String> uploadObservable = model.uploadFile(body) |
| | | // .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | // @Override |
| | | // public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | // if (resultData.getCode() == CODE_SUCCESS) { |
| | | // WebbackBean bean = getBeanLiveData().getValue(); |
| | | // if (bean != null) { |
| | | // String urls = bean.getUrl(); |
| | | // //替换图片地址 |
| | | // urls = urls.replace(path, resultData.getData().getUrl()); |
| | | // bean.setUrl(urls); |
| | | // getBeanLiveData().postValue(bean); |
| | | // } |
| | | // return Observable.just(path); |
| | | // } else { |
| | | // return Observable.error(new Exception(resultData.getMsg())); |
| | | // } |
| | | // } |
| | | // }); |
| | | // |
| | | // observables.add(uploadObservable); |
| | | // } |
| | | // Observable.zip(observables, result -> result) |
| | | // .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | // @Override |
| | | // public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | // //移除已经上传的文件 |
| | | // //把objects数组转换成list,然后移除 |
| | | // for (Object object : objects) { |
| | | // uploadFileList.remove((String) object); |
| | | // } |
| | | // return model.addWebback(beanLiveData.getValue()); |
| | | // } |
| | | // }) |
| | | // .doOnSubscribe(new Consumer<Disposable>() { |
| | | // @Override |
| | | // public void accept(Disposable disposable) throws Exception { |
| | | // changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | // } |
| | | // }) |
| | | // .doFinally(new Action() { |
| | | // @Override |
| | | // public void run() throws Exception { |
| | | // changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | // } |
| | | // }) |
| | | // .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() { |
| | | // |
| | | // } |
| | | // }); |
| | | // }else { |
| | | // model.addMeeting(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() { |
| | | // model.deleteMeeting(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() { |
| | | // if (uploadFileList.size() > 0){ |
| | | // List<Observable<String>> observables = new ArrayList<>(); |
| | | // for (String path : uploadFileList) { |
| | | // File file = new File(path); |
| | | // RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | // MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | // Observable<String> uploadObservable = model.uploadFile(body) |
| | | // .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | // @Override |
| | | // public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | // if (resultData.getCode() == CODE_SUCCESS){ |
| | | // MeetingBean bean = getBeanLiveData().getValue(); |
| | | // if (bean != null){ |
| | | // String urls = bean.getUrl(); |
| | | // //替换图片地址 |
| | | // urls = urls.replace(path,resultData.getData().getUrl()); |
| | | // bean.setUrl(urls); |
| | | // getBeanLiveData().postValue(bean); |
| | | // } |
| | | // return Observable.just(path); |
| | | // }else { |
| | | // return Observable.error(new Exception(resultData.getMsg())); |
| | | // } |
| | | // } |
| | | // }); |
| | | // |
| | | // observables.add(uploadObservable); |
| | | // } |
| | | // Observable.zip(observables,result -> result) |
| | | // .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | // @Override |
| | | // public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | // //移除已经上传的文件 |
| | | // //把objects数组转换成list,然后移除 |
| | | // for (Object object : objects) { |
| | | // uploadFileList.remove((String) object); |
| | | // } |
| | | // return model.updateMeeting(beanLiveData.getValue()); |
| | | // } |
| | | // }) |
| | | // .doOnSubscribe(new Consumer<Disposable>() { |
| | | // @Override |
| | | // public void accept(Disposable disposable) throws Exception { |
| | | // changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | // } |
| | | // }) |
| | | // .doFinally(new Action() { |
| | | // @Override |
| | | // public void run() throws Exception { |
| | | // changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | // } |
| | | // }) |
| | | // .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() { |
| | | // |
| | | // } |
| | | // }); |
| | | // }else { |
| | | // model.updateMeeting(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 MutableLiveData<WebbackBean> getBeanLiveData() { |
| | | if (beanLiveData == null){ |
| | | beanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (beanLiveData.getValue() == null){ |
| | | beanLiveData.setValue(new WebbackBean()); |
| | | } |
| | | return beanLiveData; |
| | | } |
| | | |
| | | public void setBeanLiveData(MutableLiveData<WebbackBean> beanLiveData) { |
| | | this.beanLiveData = beanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<Boolean> getTypeLiveData() { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | } |
| | | return typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(MutableLiveData<Boolean> typeLiveData) { |
| | | this.typeLiveData = typeLiveData; |
| | | } |
| | | |
| | | public List<String> getUploadFileList() { |
| | | return uploadFileList; |
| | | } |
| | | |
| | | public void addUploadFile(String url) { |
| | | uploadFileList.add(url); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | 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 androidx.lifecycle.Observer; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | 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.WebcastRvAdapter; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityWebcastBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 Activity |
| | | */ |
| | | public class WebcastActivity extends DLBaseActivity<ActivityWebcastBinding,WebcastActivityViewModel>{ |
| | | |
| | | WebcastRvAdapter adapter; |
| | | private PopupWindow mOperatePopupWindow; |
| | | private boolean isSearchLayoutVisible; |
| | | private int dateType; //0:开始时间 1:结束时间 |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_webcast; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | //下拉刷新布局 |
| | | binding.refreshLayout.setEnableRefresh(false); |
| | | binding.refreshLayout.setEnableLoadMore(true); |
| | | binding.refreshLayout.setEnableOverScrollDrag(true); |
| | | binding.refreshLayout.setOnLoadMoreListener(refreshLayout -> { |
| | | viewModel.getMoreWebcast(); |
| | | }); |
| | | //recyclerView适配器 |
| | | adapter = new WebcastRvAdapter(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)); |
| | | 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), |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_own_top) |
| | | ); |
| | | //点击放大镜按钮显示出搜索框 |
| | | 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.getWebcast(); |
| | | 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(),WebcastDetailActivity.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 |
| | | public void initData() { |
| | | viewModel.getWebcast(); |
| | | |
| | | } |
| | | |
| | | @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<WebcastBean>>() { |
| | | @Override |
| | | public void onChanged(List<WebcastBean> webcastBeans) { |
| | | adapter.setData(webcastBeans); |
| | | } |
| | | }); |
| | | viewModel.getCheckListLiveData().observe(this, new Observer<List<WebcastBean>>() { |
| | | @Override |
| | | public void onChanged(List<WebcastBean> webcastBeans) { |
| | | if (viewModel.getOperateTypeLiveData().getValue() == 0){ |
| | | return; |
| | | } |
| | | if (webcastBeans.isEmpty()){ |
| | | viewModel.getOperateTypeLiveData().setValue(1); |
| | | }else{ |
| | | viewModel.getOperateTypeLiveData().setValue(2); |
| | | } |
| | | } |
| | | }); |
| | | viewModel.getMoreListLiveData().observe(this, new Observer<List<WebcastBean>>() { |
| | | @Override |
| | | public void onChanged(List<WebcastBean> webcastBeans) { |
| | | adapter.addData(webcastBeans); |
| | | } |
| | | }); |
| | | 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 (WebcastBean bean : beans) { |
| | | adapter.removeItem(bean); |
| | | } |
| | | }); |
| | | //观察家大事记数据的变化,有变化包括添加、修改、删除都会发送消息,接收到消息后重新获取数据 |
| | | RxBus.getInstance().toObservable(this,WebcastBean.class) |
| | | .subscribe(bean -> { |
| | | viewModel.getWebcast(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | @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,WebcastDetailActivity.class).putExtra(BaseConfig.EXTRA_TYPE,1)); |
| | | }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(); |
| | | } else if (id == R.id.tv_own_top) { |
| | | viewModel.ownTop(); |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mOperatePopupWindow != null){ |
| | | mOperatePopupWindow.dismiss(); |
| | | } |
| | | |
| | | } |
| | | |
| | | // private static final String TAG = "Webcast123"; |
| | | // @Override |
| | | // protected void onCreate(Bundle savedInstanceState){ |
| | | // super.onCreate(savedInstanceState); |
| | | // setContentView(R.layout.activity_Webcast); |
| | | // WebcastBean data = newWebcastBean(); |
| | | // String b = String.valueOf(data.getDate1()); |
| | | // String c = String.valueOf(data.getTime1()); |
| | | // String d = String.valueOf(data.getStartTime()); |
| | | // Log.d(TAG,b+c+d); |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | 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.PageResponseBean; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | import com.application.zhangshi_app_android.bean.WebcastRequestBean; |
| | | 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 |
| | | * @date 2023.03.18. 10:00 |
| | | * @desc 家大事记 viewmodel |
| | | */ |
| | | public class WebcastActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<List<WebcastBean>> checkListLiveData;//选中的数据 |
| | | private MutableLiveData<List<WebcastBean>> dataListLiveData;//所有数据 |
| | | private MutableLiveData<Integer> operateTypeLiveData;//右上角操作框 操作类型 0 弹出选择操作 1.完成 2.删除 |
| | | private MutableLiveData<WebcastRequestBean> requestBeanLiveData;//请求参数 |
| | | private MutableLiveData<List<WebcastBean>> moreListLiveData;//下拉加载数据 |
| | | private MutableLiveData<List<WebcastBean>> finishDeleteListLiveData;//已经完成删除的数据,用于adapter的remove操作 |
| | | |
| | | //创建并初始化ViewModel |
| | | public WebcastActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | |
| | | //DataRepository 是一个数据仓库类,负责管理数据的获取和存储, |
| | | // 该方法通过调用 DataRepository.getInstance() 来获取 DataRepository 的单例实例,并将其返回model。 |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | /** |
| | | * 获取家大事 |
| | | * 记 |
| | | */ |
| | | |
| | | |
| | | |
| | | //getRequestBeanLiveData().getValue() 检查请求数据的 LiveData 是否为空。 |
| | | // 如果为空,则创建一个新的WebcastRequestBean 对象,并将其设置为 LiveData 的值,以确保请求数据不为 null。 |
| | | public void getWebcast() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new WebcastRequestBean()); |
| | | } |
| | | //设置请求数据对象的页码为 1,表示要获取第一页的数据。 |
| | | getRequestBeanLiveData().getValue().setPageNum(1); |
| | | |
| | | //通过model(ViewModel 中的数据仓库对象)发起网络请求,并将请求数据转换为 Map 类型,以便发送给服务器。 |
| | | model.getWebcast(getRequestBeanLiveData().getValue().toMap()) |
| | | |
| | | //应用线程调度器,确保观察者在正确的线程上运行。 |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | |
| | | //订阅这个网络请求的结果 |
| | | .subscribe(new Observer<ResultData<PageResponseBean<WebcastBean>>>() { |
| | | @Override |
| | | |
| | | //将订阅对象添加到 addSubscribe() 中,以便在不再需要时取消订阅。 |
| | | //创建 Disposable 对象来管理订阅 |
| | | // 使用 Disposable,可以有效地管理异步操作的生命周期,确保资源在不再需要时被正确释放。 |
| | | |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | //onNext()处理成功获取数据的情况 |
| | | public void onNext(ResultData<PageResponseBean<WebcastBean>> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | if (data.getData().getData().isEmpty()){ |
| | | |
| | | //更新界面状态为 StateViewEnum.DATA_NULL |
| | | changeStateView(StateViewEnum.DATA_NULL); |
| | | }else { |
| | | //隐藏状态视图并将数据列表发布到 dataListLiveData |
| | | changeStateView(StateViewEnum.HIDE); |
| | | dataListLiveData.postValue(data.getData().getData()); |
| | | } |
| | | |
| | | //如果返回的数据不成功,则将服务器返回的消息发布到 messageLiveData,以便通知用户。 |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | //onError()处理发生错误的情况,将错误消息发布到 messageLiveData。 |
| | | public void onError(Throwable e) { |
| | | messageLiveData.postValue(e.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void onComplete() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 加载更多 |
| | | */ |
| | | public void getMoreWebcast() { |
| | | if (getRequestBeanLiveData().getValue() == null){ |
| | | getRequestBeanLiveData().setValue(new WebcastRequestBean()); |
| | | } |
| | | getRequestBeanLiveData().getValue().setPageNum(getRequestBeanLiveData().getValue().getPageNum() + 1); |
| | | model.getWebcast(getRequestBeanLiveData().getValue().toMap()) |
| | | .compose(RxUtils.schedulersTransformer()) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DATA_FINISH); |
| | | } |
| | | }) |
| | | .subscribe(new Observer<ResultData<PageResponseBean<WebcastBean>>>() { |
| | | @Override |
| | | public void onSubscribe(Disposable d) { |
| | | addSubscribe(d); |
| | | } |
| | | |
| | | @Override |
| | | public void onNext(ResultData<PageResponseBean<WebcastBean>> 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<WebcastBean> deleteList = getCheckListLiveData().getValue(); |
| | | // if (deleteList == null){ |
| | | // return; |
| | | // } |
| | | // StringBuffer sb = new StringBuffer(); |
| | | // deleteList.forEach(WebcastBean -> sb.append(WebcastBean.getId()).append(",")); |
| | | // sb.deleteCharAt(sb.length()-1); |
| | | // model.deleteWebcast(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){ |
| | | // 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(WebcastBean bean) { |
| | | // model.deleteWebcast(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<WebcastBean> list = new ArrayList<>(); |
| | | // list.add(bean); |
| | | // 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<WebcastBean>> 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<WebcastBean>> checkListLiveData) { |
| | | this.checkListLiveData = checkListLiveData; |
| | | } |
| | | |
| | | @NonNull //NonNull 用于标记方法参数、返回值、字段或方法的返回类型不允许为 null |
| | | |
| | | //getRequestBeanLiveData() 获取一个包含WebcastRequestBean 数据的 MutableLiveData 对象。 |
| | | public MutableLiveData<WebcastRequestBean> getRequestBeanLiveData() { |
| | | if (requestBeanLiveData == null){ |
| | | requestBeanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (requestBeanLiveData.getValue() == null){ |
| | | requestBeanLiveData.setValue(new WebcastRequestBean()); |
| | | } |
| | | return requestBeanLiveData; |
| | | } |
| | | |
| | | public void setRequestBeanLiveData(MutableLiveData<WebcastRequestBean> requestBeanLiveData) { |
| | | this.requestBeanLiveData = requestBeanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<List<WebcastBean>> getDataListLiveData() { |
| | | if (dataListLiveData == null){ |
| | | dataListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return dataListLiveData; |
| | | } |
| | | |
| | | public void setDataListLiveData(MutableLiveData<List<WebcastBean>> dataListLiveData) { |
| | | this.dataListLiveData = dataListLiveData; |
| | | } |
| | | |
| | | @NonNull |
| | | public MutableLiveData<List<WebcastBean>> getMoreListLiveData() { |
| | | if (moreListLiveData == null){ |
| | | moreListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return moreListLiveData; |
| | | } |
| | | |
| | | public void setMoreListLiveData(MutableLiveData<List<WebcastBean>> 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<WebcastBean>> getFinishDeleteListLiveData() { |
| | | if (finishDeleteListLiveData == null){ |
| | | finishDeleteListLiveData = new MutableLiveData<>(); |
| | | } |
| | | return finishDeleteListLiveData; |
| | | } |
| | | |
| | | public void setFinishDeleteListLiveData(MutableLiveData<List<WebcastBean>> finishDeleteListLiveData) { |
| | | this.finishDeleteListLiveData = finishDeleteListLiveData; |
| | | } |
| | | |
| | | /** |
| | | * 改变排序 |
| | | * @param b true 降序 false 升序 |
| | | */ |
| | | public void changeOrder(boolean b) { |
| | | List<WebcastBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | if (b) { |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | | String happenTime1 = o1.getDate1(); |
| | | String happenTime2 = o2.getDate2(); |
| | | 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.getDate1(); |
| | | String happenTime2 = o2.getDate2(); |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 本家数据 置顶 |
| | | */ |
| | | public void ownTop(){ |
| | | List<WebcastBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | //根据ownData值为1的 放到前面 |
| | | list.sort((o1, o2) -> { |
| | | if (o1.getOwnData() == 1 && o2.getOwnData() == 0) { |
| | | return -1; |
| | | } else if (o1.getOwnData() == 0 && o2.getOwnData() == 1) { |
| | | return 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |
New file |
| | |
| | | package com.application.zhangshi_app_android.ui.function; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.ClipData; |
| | | import android.content.Intent; |
| | | import android.net.Uri; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | | |
| | | import androidx.activity.result.ActivityResult; |
| | | import androidx.activity.result.ActivityResultCallback; |
| | | import androidx.activity.result.ActivityResultLauncher; |
| | | import androidx.activity.result.contract.ActivityResultContracts; |
| | | import androidx.lifecycle.MutableLiveData; |
| | | 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.WaitDialog; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.GetFilePathFromUri; |
| | | 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.ElectronicFileAddAdapter; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityWebcastDetailBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.OptionPicker; |
| | | import com.github.gzuliyujiang.wheelpicker.TimePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnTimePickedListener; |
| | | import com.luck.picture.lib.entity.LocalMedia; |
| | | import com.luck.picture.lib.interfaces.OnResultCallbackListener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | |
| | | |
| | | /** |
| | | * @author Gss |
| | | * @date 2023.03.25. 16:00 |
| | | * @desc 家大事记 WebcastDetailActivity |
| | | */ |
| | | public class WebcastDetailActivity extends DLBaseActivity<ActivityWebcastDetailBinding, WebcastDetailActivityViewModel> { |
| | | private int type;// 0 查看可修改删除 1 新增 2 直接修改 |
| | | private PopupWindow popupWindow; |
| | | private MutableLiveData<WebcastBean> beanLiveData; |
| | | private ElectronicFileAddAdapter adapter; |
| | | private BaseDialog mWaitDialog; |
| | | private ActivityResultLauncher<Intent> activityResultLauncher; |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_webcast_detail; |
| | | } |
| | | |
| | | @Override |
| | | public int getVariableId() { |
| | | return BR.viewModel; |
| | | } |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | type = getIntent().getIntExtra(BaseConfig.EXTRA_TYPE,0); |
| | | if (type == 0 || type == 2){ |
| | | WebcastBean bean = (WebcastBean) getIntent().getSerializableExtra("bean"); |
| | | if (bean !=null){ |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | adapter = new ElectronicFileAddAdapter(this); |
| | | GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); |
| | | binding.rvImage.setLayoutManager(gridLayoutManager); |
| | | binding.rvImage.setNestedScrollingEnabled(false); |
| | | adapter.setItemAndAddClickListener(new ElectronicFileAddAdapter.OnItemAndAddClickListener() { |
| | | @Override |
| | | public void onItemClick(View v, int position) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAddClick() { |
| | | OptionPicker picker = getOptionPicker(Arrays.asList("图片视频","其他文件")); |
| | | picker.setTitle("选择文件类型"); |
| | | picker.setOnOptionPickedListener(new OnOptionPickedListener() { |
| | | @Override |
| | | public void onOptionPicked(int position, Object item) { |
| | | if (item.equals("图片视频")) { |
| | | UserManager.getInstance().selectImage(getSelfActivity(), 0,9, new OnResultCallbackListener<LocalMedia>() { |
| | | @Override |
| | | public void onResult(ArrayList<LocalMedia> result) { |
| | | if (result.size() == 0) return; |
| | | for (LocalMedia media : result) { |
| | | String path = media.getRealPath(); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | WebcastBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | Intent intent = new Intent(Intent.ACTION_GET_CONTENT); |
| | | // Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); |
| | | intent.setType("*/*"); // 限制文件类型 |
| | | intent.addCategory(Intent.CATEGORY_OPENABLE); // 添加 CATEGORY_OPENABLE 分类,告诉系统要选择的内容可以被打开,这样系统会过滤掉不能被应用打开的文件,以提供更好的用户体验。 |
| | | intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); // 允许多选 |
| | | activityResultLauncher.launch(intent); |
| | | } |
| | | } |
| | | }); |
| | | picker.show(); |
| | | |
| | | } |
| | | }); |
| | | adapter.setOnChildClickListener(R.id.iv_delete, new BaseRVAdapter.OnChildClickListener() { |
| | | @Override |
| | | public void onChildClick(RecyclerView recyclerView, View childView, int position) { |
| | | WebcastBean 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().setValue(true); |
| | | binding.titleBar.setTitle("新增家大事记"); |
| | | 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(); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().postValue(false); |
| | | }else if (type == 2){ |
| | | viewModel.getTypeLiveData().postValue(true); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | binding.etDate1.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.etDate1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etDate2.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.etDate2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | binding.etTime1.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | |
| | | @Override |
| | | |
| | | public void onTimePicked(int hour, int Minute,int second) { |
| | | // second = '0'; |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second); |
| | | binding.etTime1.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | binding.etTime2.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | TimePicker picker = getTimePicker(); |
| | | picker.setTitle("选择时间"); |
| | | picker.setOnTimePickedListener(new OnTimePickedListener() { |
| | | @Override |
| | | public void onTimePicked(int hour, int Minute, int second) { |
| | | String date = String.format(Locale.CHINA, "%d:%02d:%02d",hour,Minute,second ); |
| | | binding.etTime2.setText(date); |
| | | } |
| | | }); |
| | | picker.show(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | activityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() { |
| | | @Override |
| | | public void onActivityResult(ActivityResult result) { |
| | | if (result.getResultCode() == Activity.RESULT_OK) { |
| | | if (result.getData() == null){ |
| | | return; |
| | | } |
| | | // 获取选中的多个文件的 URI |
| | | ClipData clipData = result.getData().getClipData(); |
| | | if (clipData != null) { |
| | | int itemCount = clipData.getItemCount(); |
| | | for (int i = 0; i < itemCount; i++) { |
| | | Uri uri = clipData.getItemAt(i).getUri(); |
| | | // 使用选中的文件 URI 进行后续操作,比如读取文件内容等 |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),uri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | WebcastBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | }else { |
| | | // 获取选中的单个文件的 URI |
| | | Uri selectedFileUri = result.getData().getData(); |
| | | String path = GetFilePathFromUri.getFileAbsolutePath(getSelfActivity(),selectedFileUri); |
| | | if (path!=null){ |
| | | viewModel.addUploadFile(path); |
| | | WebcastBean bean = viewModel.getBeanLiveData().getValue(); |
| | | if (bean !=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | urlList.add(path); |
| | | bean.setUrl(Utils.appendList2String(urlList,",")); |
| | | } |
| | | viewModel.getBeanLiveData().setValue(bean); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void initData() { |
| | | // beanLiveData.setValue=WebcastBean; |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void initLiveDataObserve() { |
| | | viewModel.getBeanLiveData().observe(this, bean -> { |
| | | if (bean!=null){ |
| | | List<String> urlList = Utils.splitString2List(bean.getUrl(),","); |
| | | adapter.setData(urlList); |
| | | } |
| | | }); |
| | | viewModel.getTypeLiveData().observe(this,operateType -> { |
| | | if (operateType){ |
| | | if (type == 1) { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | viewModel.add(); |
| | | }); |
| | | } |
| | | // else { |
| | | // binding.ivOperate.setOnClickListener(v -> { |
| | | // viewModel.update(); |
| | | // }); |
| | | // } |
| | | setIsEdited(true); |
| | | }else { |
| | | binding.ivOperate.setOnClickListener(v -> { |
| | | popupWindow.showAsDropDown(binding.ivOperate,-ScreenSizeUtils.dip2px(this,85) +binding.ivOperate.getWidth(),0); |
| | | }); |
| | | setIsEdited(false); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public void setIsEdited(boolean isEdited){ |
| | | adapter.setIsEdited(isEdited); |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogLoading() { |
| | | if (mWaitDialog == null) { |
| | | mWaitDialog = new WaitDialog.Builder(this) |
| | | // 消息文本可以不用填写 |
| | | .setMessage("正在上传") |
| | | .create(); |
| | | } |
| | | if (!mWaitDialog.isShowing()) { |
| | | mWaitDialog.show(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void dialogDismiss() { |
| | | if (mWaitDialog != null && mWaitDialog.isShowing()) { |
| | | mWaitDialog.dismiss(); |
| | | mWaitDialog = null; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 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.manager.AppManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.WebcastBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.Observable; |
| | | import io.reactivex.ObservableSource; |
| | | import io.reactivex.Observer; |
| | | import io.reactivex.disposables.Disposable; |
| | | import io.reactivex.functions.Action; |
| | | import io.reactivex.functions.Consumer; |
| | | import io.reactivex.functions.Function; |
| | | import okhttp3.MediaType; |
| | | import okhttp3.MultipartBody; |
| | | import okhttp3.RequestBody; |
| | | |
| | | public class WebcastDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<WebcastBean> beanLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | private final List<String> uploadFileList = new ArrayList<>();//需要上传的文件列表 |
| | | public WebcastDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | | @Override |
| | | protected DataRepository initModel() { |
| | | return DataRepository.getInstance(); |
| | | } |
| | | |
| | | /** |
| | | * 增加家大事记 |
| | | */ |
| | | public void add() { |
| | | if (uploadFileList.size() > 0) { |
| | | List<Observable<String>> observables = new ArrayList<>(); |
| | | for (String path : uploadFileList) { |
| | | File file = new File(path); |
| | | RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | Observable<String> uploadObservable = model.uploadFile(body) |
| | | .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | @Override |
| | | public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | if (resultData.getCode() == CODE_SUCCESS) { |
| | | WebcastBean bean = getBeanLiveData().getValue(); |
| | | if (bean != null) { |
| | | String urls = bean.getUrl(); |
| | | //替换图片地址 |
| | | urls = urls.replace(path, resultData.getData().getUrl()); |
| | | bean.setUrl(urls); |
| | | getBeanLiveData().postValue(bean); |
| | | } |
| | | return Observable.just(path); |
| | | } else { |
| | | return Observable.error(new Exception(resultData.getMsg())); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | observables.add(uploadObservable); |
| | | } |
| | | Observable.zip(observables, result -> result) |
| | | .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | @Override |
| | | public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | //移除已经上传的文件 |
| | | //把objects数组转换成list,然后移除 |
| | | for (Object object : objects) { |
| | | uploadFileList.remove((String) object); |
| | | } |
| | | return model.addWebcast(beanLiveData.getValue()); |
| | | } |
| | | }) |
| | | .doOnSubscribe(new Consumer<Disposable>() { |
| | | @Override |
| | | public void accept(Disposable disposable) throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | } |
| | | }) |
| | | .doFinally(new Action() { |
| | | @Override |
| | | public void run() throws Exception { |
| | | changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | } |
| | | }) |
| | | .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() { |
| | | |
| | | } |
| | | }); |
| | | }else { |
| | | model.addWebcast(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() { |
| | | // model.deleteWebcast(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() { |
| | | // if (uploadFileList.size() > 0){ |
| | | // List<Observable<String>> observables = new ArrayList<>(); |
| | | // for (String path : uploadFileList) { |
| | | // File file = new File(path); |
| | | // RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); |
| | | // MultipartBody.Part body = MultipartBody.Part.createFormData("uploadFile", file.getName(), requestBody); |
| | | // Observable<String> uploadObservable = model.uploadFile(body) |
| | | // .flatMap(new Function<ResultData<UploadFileResponseBean>, ObservableSource<String>>() { |
| | | // @Override |
| | | // public ObservableSource<String> apply(ResultData<UploadFileResponseBean> resultData) throws Exception { |
| | | // if (resultData.getCode() == CODE_SUCCESS){ |
| | | // WebcastBean bean = getBeanLiveData().getValue(); |
| | | // if (bean != null){ |
| | | // String urls = bean.getUrl(); |
| | | // //替换图片地址 |
| | | // urls = urls.replace(path,resultData.getData().getUrl()); |
| | | // bean.setUrl(urls); |
| | | // getBeanLiveData().postValue(bean); |
| | | // } |
| | | // return Observable.just(path); |
| | | // }else { |
| | | // return Observable.error(new Exception(resultData.getMsg())); |
| | | // } |
| | | // } |
| | | // }); |
| | | // |
| | | // observables.add(uploadObservable); |
| | | // } |
| | | // Observable.zip(observables,result -> result) |
| | | // .flatMap(new Function<Object[], Observable<ResultData<String>>>() { |
| | | // @Override |
| | | // public Observable<ResultData<String>> apply(Object[] objects) throws Exception { |
| | | // //移除已经上传的文件 |
| | | // //把objects数组转换成list,然后移除 |
| | | // for (Object object : objects) { |
| | | // uploadFileList.remove((String) object); |
| | | // } |
| | | // return model.updateWebcast(beanLiveData.getValue()); |
| | | // } |
| | | // }) |
| | | // .doOnSubscribe(new Consumer<Disposable>() { |
| | | // @Override |
| | | // public void accept(Disposable disposable) throws Exception { |
| | | // changeStateView(StateViewEnum.DIALOG_LOADING); |
| | | // } |
| | | // }) |
| | | // .doFinally(new Action() { |
| | | // @Override |
| | | // public void run() throws Exception { |
| | | // changeStateView(StateViewEnum.DIALOG_DISMISS); |
| | | // } |
| | | // }) |
| | | // .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() { |
| | | // |
| | | // } |
| | | // }); |
| | | // }else { |
| | | // model.updateWebcast(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 MutableLiveData<WebcastBean> getBeanLiveData() { |
| | | if (beanLiveData == null){ |
| | | beanLiveData = new MutableLiveData<>(); |
| | | } |
| | | if (beanLiveData.getValue() == null){ |
| | | beanLiveData.setValue(new WebcastBean()); |
| | | } |
| | | return beanLiveData; |
| | | } |
| | | |
| | | public void setBeanLiveData(MutableLiveData<WebcastBean> beanLiveData) { |
| | | this.beanLiveData = beanLiveData; |
| | | } |
| | | |
| | | public MutableLiveData<Boolean> getTypeLiveData() { |
| | | if (typeLiveData == null){ |
| | | typeLiveData = new MutableLiveData<>(); |
| | | } |
| | | return typeLiveData; |
| | | } |
| | | |
| | | public void setTypeLiveData(MutableLiveData<Boolean> typeLiveData) { |
| | | this.typeLiveData = typeLiveData; |
| | | } |
| | | |
| | | public List<String> getUploadFileList() { |
| | | return uploadFileList; |
| | | } |
| | | |
| | | public void addUploadFile(String url) { |
| | | uploadFileList.add(url); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | <vector android:height="24dp" android:tint="#000000" |
| | | android:viewportHeight="24" android:viewportWidth="24" |
| | | android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <path android:fillColor="#FF000000" android:pathData="M17.6,11.48 L19.44,8.3a0.63,0.63 0,0 0,-1.09 -0.63l-1.88,3.24a11.43,11.43 0,0 0,-8.94 0L5.65,7.67a0.63,0.63 0,0 0,-1.09 0.63L6.4,11.48A10.81,10.81 0,0 0,1 20L23,20A10.81,10.81 0,0 0,17.6 11.48ZM7,17.25A1.25,1.25 0,1 1,8.25 16,1.25 1.25,0 0,1 7,17.25ZM17,17.25A1.25,1.25 0,1 1,18.25 16,1.25 1.25,0 0,1 17,17.25Z"/> |
| | | </vector> |
| | |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | > |
| | | |
| | | <com.scwang.smart.refresh.header.MaterialHeader |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/container_search_parameter" |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | android:layout_marginTop="-4dp" |
| | | tools:layout_height="wrap_content"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_search_parameter" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | android:layout_marginHorizontal="56dp" |
| | | android:background="@color/white" |
| | | android:orientation="vertical" |
| | | android:paddingStart="5dp" |
| | | android:paddingEnd="12dp"> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.5dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:text="题名" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_weight="4" |
| | | android:background="@null" |
| | | android:hint="请输入题名" |
| | | android:inputType="text" |
| | | android:maxLines="1" |
| | | android:text="@={viewModel.requestBeanLiveData.title}" |
| | | android:textColor="#FF333333" |
| | | android:textColorHint="#61000000" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" |
| | | app:background="@drawable/ic_clear" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:text="时间" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="4" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_start_time" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:hint="开始时间" |
| | | android:lines="1" |
| | | android:maxLines="1" |
| | | android:text="@={viewModel.requestBeanLiveData.happenStartTime}" |
| | | android:textColor="#FF333333" |
| | | android:textColorHint="#61000000" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" |
| | | tools:text="2022-01-01" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="—" /> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_end_time" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:hint="结束时间" |
| | | android:maxLines="1" |
| | | android:text="@={viewModel.requestBeanLiveData.happenEndTime}" |
| | | android:textColor="#FF333333" |
| | | android:textColorHint="#61000000" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" |
| | | tools:text="2022-01-01" /> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_time_clear" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_clear" |
| | | android:visibility="invisible" /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:text="类别" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_weight="4" |
| | | android:background="@null" |
| | | android:hint="请输入类别" |
| | | android:inputType="text" |
| | | android:maxLines="1" |
| | | android:text="@={viewModel.requestBeanLiveData.type}" |
| | | android:textColor="#FF333333" |
| | | android:textColorHint="#61000000" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" |
| | | app:background="@drawable/ic_clear" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:lines="1" |
| | | android:maxLines="1" |
| | | android:text="就病医院" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_weight="4" |
| | | android:background="@null" |
| | | android:hint="请输入就病医院" |
| | | android:inputType="text" |
| | | android:maxLines="1" |
| | | android:text="@={viewModel.requestBeanLiveData.hospital}" |
| | | android:textColor="#FF333333" |
| | | android:textColorHint="#61000000" |
| | | android:textSize="14sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeTextType="uniform" |
| | | app:background="@drawable/ic_clear" /> |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </RelativeLayout> |
| | | </com.scwang.smart.refresh.header.MaterialHeader> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | <RelativeLayout |
| | | android:id="@+id/container_search_parameter" |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="-4dp" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:id="@+id/layout_search_parameter" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/white" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:paddingEnd="12dp" |
| | | android:paddingStart="5dp" |
| | | > |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.5dp" |
| | | android:background="#FF939393" /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="题名" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.title}" |
| | | android:hint="请输入题名" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center" |
| | | > |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="时间" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="4" |
| | | android:gravity="center" |
| | | > |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_start_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.happenStartTime}" |
| | | android:hint="开始时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="—" |
| | | /> |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_end_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={viewModel.requestBeanLiveData.happenEndTime}" |
| | | android:hint="结束时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_time_clear" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_clear" |
| | | android:visibility="invisible" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="类别" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.type}" |
| | | android:hint="请输入类别" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="match_parent" |
| | | android:text="就病医院" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.hospital}" |
| | | android:hint="请输入就病医院" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </RelativeLayout> |
| | | <com.google.android.material.floatingactionbutton.FloatingActionButton |
| | | android:id="@+id/fab_add" |
| | | android:layout_width="56dp" |
| | |
| | | android:layout_marginHorizontal="16dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | > |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@drawable/ic_operate" |
| | | /> |
| | | android:background="@drawable/ic_operate" /> |
| | | </FrameLayout> |
| | | <LinearLayout |
| | | android:id="@+id/layout_search" |
| | |
| | | android:background="@drawable/ic_operate" |
| | | /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_default" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | android:gravity="center_vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="16dp" |
| | | android:text="家庭资产(仅供查看)" |
| | | android:layout_weight="1" |
| | | android:text="家庭资产(仅供查看)" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | app:textOverflowMode="@{4}" |
| | | /> |
| | | app:textOverflowMode="@{4}" /> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_search_default" |
| | | android:layout_width="@dimen/dp_24" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:background="@drawable/ic_search" |
| | | /> |
| | | android:background="@drawable/ic_search" /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:id="@+id/layout_search" |
| | |
| | | type="com.application.zhangshi_app_android.ui.function.FamilyMemorabiliaActivityViewModel"/> |
| | | </data> |
| | | |
| | | <!--约束布局,解决布局嵌套过多的问题,以灵活的方式定位和调整小部件。--> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <!--标题栏,它紧挨状态栏的下面,正常情况下它的布局和主题样式都是使用系统定义好的,且默认情况下只显示图标和文本。--> |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | > |
| | | android:layout_marginHorizontal="16dp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@drawable/ic_operate" |
| | | /> |
| | | android:background="@drawable/ic_operate" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | > |
| | | <data> |
| | | <import type="android.view.View"/> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.MeetingActivityViewModel"/> |
| | | </data> |
| | | |
| | | <!--约束布局,解决布局嵌套过多的问题,以灵活的方式定位和调整小部件。--> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".ui.function.MeetingActivity" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <!--标题栏,它紧挨状态栏的下面,正常情况下它的布局和主题样式都是使用系统定义好的,且默认情况下只显示图标和文本。--> |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:layout_marginHorizontal="16dp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@drawable/ic_operate" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_default" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="16dp" |
| | | android:text="会议申请" |
| | | android:layout_weight="1" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_default" |
| | | android:layout_width="@dimen/dp_24" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:background="@drawable/ic_search" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_search" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginVertical="4dp" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | android:background="@color/white" |
| | | android:paddingHorizontal="5dp" |
| | | android:visibility="gone" |
| | | > |
| | | <ImageView |
| | | android:id="@+id/iv_search" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_gray" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_search" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:layout_marginStart="5dp" |
| | | android:textSize="14sp" |
| | | android:textColor="#61000000" |
| | | android:background="@null" |
| | | android:imeOptions="actionSearch" |
| | | android:text="" |
| | | android:singleLine="true" |
| | | android:hint="在“会议申请“中搜索" |
| | | android:focusable="false" |
| | | android:clickable="false" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_type" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_by" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_data_null" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:gravity="center" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/img_data_null" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="18dp" |
| | | android:text="暂时还没有数据哦~\n点击”+”立即创建" |
| | | android:textSize="14sp" |
| | | android:textColor="#73000000" |
| | | /> |
| | | </LinearLayout> |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | > |
| | | <com.scwang.smart.refresh.header.MaterialHeader |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | tools:itemCount="20" |
| | | tools:listitem="@layout/item_meeting" /> |
| | | <com.scwang.smart.refresh.footer.BallPulseFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | <RelativeLayout |
| | | android:id="@+id/container_search_parameter" |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="-4dp" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:id="@+id/layout_search_parameter" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/white" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:paddingEnd="12dp" |
| | | android:paddingStart="5dp" |
| | | > |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.5dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center" |
| | | > |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="时间" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="4" |
| | | android:gravity="center" |
| | | > |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_start_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.happenStartTime}" |
| | | android:hint="开始时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="—" |
| | | /> |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_end_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={viewModel.requestBeanLiveData.happenEndTime}" |
| | | android:hint="结束时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_time_clear" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_clear" |
| | | android:visibility="invisible" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="地点" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.place}" |
| | | android:hint="请输入地点" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请部门" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.applyApart}" |
| | | android:hint="请输入申请部门" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.applyPerson}" |
| | | android:hint="请输入申请人" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </RelativeLayout> |
| | | <com.google.android.material.floatingactionbutton.FloatingActionButton |
| | | android:id="@+id/fab_add" |
| | | android:layout_width="56dp" |
| | | android:layout_height="56dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="25dp" |
| | | android:layout_marginBottom="@dimen/dp_44" |
| | | android:src="@drawable/ic_add" |
| | | app:fabCustomSize="56dp" |
| | | /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | > |
| | | <data> |
| | | <import type="android.view.View"/> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.MeetingapproveActivityViewModel"/> |
| | | </data> |
| | | |
| | | <!--约束布局,解决布局嵌套过多的问题,以灵活的方式定位和调整小部件。--> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".ui.function.MeetingapproveActivity" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <!--标题栏,它紧挨状态栏的下面,正常情况下它的布局和主题样式都是使用系统定义好的,且默认情况下只显示图标和文本。--> |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:layout_marginHorizontal="16dp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@drawable/ic_operate" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_default" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="16dp" |
| | | android:text="会议审批" |
| | | android:layout_weight="1" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_default" |
| | | android:layout_width="@dimen/dp_24" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:background="@drawable/ic_search" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_search" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginVertical="4dp" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | android:background="@color/white" |
| | | android:paddingHorizontal="5dp" |
| | | android:visibility="gone" |
| | | > |
| | | <ImageView |
| | | android:id="@+id/iv_search" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_gray" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_search" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:layout_marginStart="5dp" |
| | | android:textSize="14sp" |
| | | android:textColor="#61000000" |
| | | android:background="@null" |
| | | android:imeOptions="actionSearch" |
| | | android:text="" |
| | | android:singleLine="true" |
| | | android:hint="在“会议申请“中搜索" |
| | | android:focusable="false" |
| | | android:clickable="false" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_type" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_by" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_data_null" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:gravity="center" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/img_data_null" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="18dp" |
| | | android:text="暂时还没有数据哦~\n点击”+”立即创建" |
| | | android:textSize="14sp" |
| | | android:textColor="#73000000" |
| | | /> |
| | | </LinearLayout> |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | > |
| | | <com.scwang.smart.refresh.header.MaterialHeader |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | tools:itemCount="20" |
| | | tools:listitem="@layout/item_meeting_approve" /> |
| | | <com.scwang.smart.refresh.footer.BallPulseFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | <RelativeLayout |
| | | android:id="@+id/container_search_parameter" |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="-4dp" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:id="@+id/layout_search_parameter" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/white" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:paddingEnd="12dp" |
| | | android:paddingStart="5dp" |
| | | > |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.5dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center" |
| | | > |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="时间" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="4" |
| | | android:gravity="center" |
| | | > |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_start_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.happenStartTime}" |
| | | android:hint="开始时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="—" |
| | | /> |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_end_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={viewModel.requestBeanLiveData.happenEndTime}" |
| | | android:hint="结束时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_time_clear" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_clear" |
| | | android:visibility="invisible" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="地点" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.place}" |
| | | android:hint="请输入地点" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请部门" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.applyApart}" |
| | | android:hint="请输入申请部门" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.applyPerson}" |
| | | android:hint="请输入申请人" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </RelativeLayout> |
| | | <com.google.android.material.floatingactionbutton.FloatingActionButton |
| | | android:id="@+id/fab_add" |
| | | android:layout_width="56dp" |
| | | android:layout_height="56dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="25dp" |
| | | android:layout_marginBottom="@dimen/dp_44" |
| | | android:src="@drawable/ic_add" |
| | | app:fabCustomSize="56dp" |
| | | /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.MeetingapproveDetailActivityViewModel" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:title="@{viewModel.beanLiveData.id==0?`会议申请详情`:viewModel.beanLiveData.title}" |
| | | app:titleGravity="left" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:visibility="@{viewModel.beanLiveData.ownData==1}" |
| | | > |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@{viewModel.typeLiveData?@drawable/ic_operate_finish:@drawable/ic_operate}" |
| | | /> |
| | | |
| | | </FrameLayout> |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <androidx.core.widget.NestedScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="20dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="标题" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/editTextsequence" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入标题`:``}" |
| | | android:text="@={viewModel.beanLiveData.title}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="地点" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入地点`:``}" |
| | | android:text="@={viewModel.beanLiveData.place}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="可容纳人数" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/cp" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入可容纳人数`:``}" |
| | | android:text="@={viewModel.beanLiveData.conPeople}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="参与人数" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData ? `请输入参与人数` : ``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.partPeople}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="申请人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请人`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.applyPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="申请部门或家庭" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请部门或家庭`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.applyApart}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="开始时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="结束时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="是否摆放水牌" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入是或否`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.isPlacebrand}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入联系人`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.connPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系电话" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入联系电话`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.connPhone}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="状态" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入状态`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.statu}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | |
| | | |
| | | |
| | | |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <com.android.app_base.widget.WrapRecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_6b0000_stroke" |
| | | android:layout_marginBottom="20dp" |
| | | android:layout_marginTop="2dp" |
| | | android:paddingStart="10dp" |
| | | android:paddingEnd="5dp" |
| | | android:paddingVertical="10dp" |
| | | tools:itemCount="30" |
| | | /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | | </LinearLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.MeetingDetailActivityViewModel" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:title="@{viewModel.beanLiveData.id==0?`会议申请详情`:viewModel.beanLiveData.title}" |
| | | app:titleGravity="left" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:visibility="@{viewModel.beanLiveData.ownData==1}" |
| | | > |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@{viewModel.typeLiveData?@drawable/ic_operate_finish:@drawable/ic_operate}" |
| | | /> |
| | | |
| | | </FrameLayout> |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <androidx.core.widget.NestedScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="20dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="标题" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/editTextsequence" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入标题`:``}" |
| | | android:text="@={viewModel.beanLiveData.title}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="地点" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入地点`:``}" |
| | | android:text="@={viewModel.beanLiveData.place}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="可容纳人数" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/cp" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入可容纳人数`:``}" |
| | | android:text="@={viewModel.beanLiveData.conPeople}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="参与人数" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData ? `请输入参与人数` : ``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.partPeople}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="申请人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请人`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.applyPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="申请部门或家庭" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请部门或家庭`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.applyApart}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="开始时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="结束时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="是否摆放水牌" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入是或否`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.isPlacebrand}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入联系人`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.connPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系电话" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入联系电话`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.connPhone}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="状态" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="none" |
| | | android:hint="@{viewModel.typeLiveData?`请输入状态`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.statu}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:clickable="false" |
| | | android:focusable="false" |
| | | /> |
| | | |
| | | |
| | | |
| | | |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <com.android.app_base.widget.WrapRecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_6b0000_stroke" |
| | | android:layout_marginBottom="20dp" |
| | | android:layout_marginTop="2dp" |
| | | android:paddingStart="10dp" |
| | | android:paddingEnd="5dp" |
| | | android:paddingVertical="10dp" |
| | | tools:itemCount="30" |
| | | /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | | </LinearLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | > |
| | | <data> |
| | | <import type="android.view.View"/> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.MeetingStaActivityViewModel"/> |
| | | </data> |
| | | |
| | | <!--约束布局,解决布局嵌套过多的问题,以灵活的方式定位和调整小部件。--> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".ui.function.MeetingStaActivity" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <!--标题栏,它紧挨状态栏的下面,正常情况下它的布局和主题样式都是使用系统定义好的,且默认情况下只显示图标和文本。--> |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:layout_marginHorizontal="16dp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@drawable/ic_operate" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_default" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="16dp" |
| | | android:text="会议统计" |
| | | android:layout_weight="1" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | /> |
| | | <!-- <ImageView--> |
| | | <!-- android:id="@+id/iv_search_default"--> |
| | | <!-- android:layout_width="@dimen/dp_24"--> |
| | | <!-- android:layout_height="@dimen/dp_24"--> |
| | | <!-- android:background="@drawable/ic_search"--> |
| | | <!-- />--> |
| | | </LinearLayout> |
| | | |
| | | <!-- <LinearLayout--> |
| | | <!-- android:id="@+id/layout_search"--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="match_parent"--> |
| | | <!-- android:layout_marginVertical="4dp"--> |
| | | <!-- android:layout_marginHorizontal="56dp"--> |
| | | <!-- android:gravity="center_vertical"--> |
| | | <!-- android:background="@color/white"--> |
| | | <!-- android:paddingHorizontal="5dp"--> |
| | | <!-- android:visibility="gone"--> |
| | | <!-- >--> |
| | | <!-- <ImageView--> |
| | | <!-- android:id="@+id/iv_search"--> |
| | | <!-- android:layout_width="24dp"--> |
| | | <!-- android:layout_height="24dp"--> |
| | | <!-- android:background="@drawable/ic_search_gray"--> |
| | | <!-- />--> |
| | | <!-- <EditText--> |
| | | <!-- android:id="@+id/et_search"--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:layout_marginStart="5dp"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:textColor="#61000000"--> |
| | | <!-- android:background="@null"--> |
| | | <!-- android:imeOptions="actionSearch"--> |
| | | <!-- android:text=""--> |
| | | <!-- android:singleLine="true"--> |
| | | <!-- android:hint="在“会议申请“中搜索"--> |
| | | <!-- android:focusable="false"--> |
| | | <!-- android:clickable="false"--> |
| | | <!-- />--> |
| | | <!-- <ImageView--> |
| | | <!-- android:id="@+id/iv_search_type"--> |
| | | <!-- android:layout_width="24dp"--> |
| | | <!-- android:layout_height="24dp"--> |
| | | <!-- android:background="@drawable/ic_search_by"--> |
| | | <!-- />--> |
| | | <!-- </LinearLayout>--> |
| | | |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_data_null" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:gravity="center" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/img_data_null" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="18dp" |
| | | android:text="暂时还没有数据哦~\n点击”+”立即创建" |
| | | android:textSize="14sp" |
| | | android:textColor="#73000000" |
| | | /> |
| | | </LinearLayout> |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | > |
| | | <com.scwang.smart.refresh.header.MaterialHeader |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | tools:itemCount="20" |
| | | tools:listitem="@layout/item_meeting_sta" /> |
| | | <com.scwang.smart.refresh.footer.BallPulseFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | <RelativeLayout |
| | | android:id="@+id/container_search_parameter" |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="-4dp" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <!-- <LinearLayout--> |
| | | <!-- android:id="@+id/layout_search_parameter"--> |
| | | <!-- android:orientation="vertical"--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@color/white"--> |
| | | <!-- android:layout_marginHorizontal="56dp"--> |
| | | <!-- android:paddingEnd="12dp"--> |
| | | <!-- android:paddingStart="5dp"--> |
| | | <!-- >--> |
| | | <!-- <View--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="0.5dp"--> |
| | | <!-- android:background="#FF939393" />--> |
| | | |
| | | |
| | | <!-- <View--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="0.3dp"--> |
| | | <!-- android:background="#FF939393" />--> |
| | | |
| | | |
| | | <!-- <LinearLayout--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="40dp"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- >--> |
| | | |
| | | <!-- <androidx.appcompat.widget.AppCompatTextView--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="时间"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- />--> |
| | | |
| | | <!-- <LinearLayout--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:layout_weight="4"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- >--> |
| | | <!-- <androidx.appcompat.widget.AppCompatTextView--> |
| | | <!-- android:id="@+id/et_start_time"--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- android:layout_marginStart="6dp"--> |
| | | <!-- android:text="@={viewModel.requestBeanLiveData.happenStartTime}"--> |
| | | <!-- android:hint="开始时间"--> |
| | | <!-- android:textColorHint="#61000000"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- android:lines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- tools:text="2022-01-01"--> |
| | | <!-- />--> |
| | | <!-- <TextView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="—"--> |
| | | <!-- />--> |
| | | <!-- <androidx.appcompat.widget.AppCompatTextView--> |
| | | <!-- android:id="@+id/et_end_time"--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="@={viewModel.requestBeanLiveData.happenEndTime}"--> |
| | | <!-- android:hint="结束时间"--> |
| | | <!-- android:textColorHint="#61000000"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- tools:text="2022-01-01"--> |
| | | <!-- />--> |
| | | <!-- <ImageView--> |
| | | <!-- android:id="@+id/iv_time_clear"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@drawable/ic_clear"--> |
| | | <!-- android:visibility="invisible"--> |
| | | <!-- />--> |
| | | <!-- </LinearLayout>--> |
| | | |
| | | <!-- </LinearLayout>--> |
| | | |
| | | |
| | | <!-- <View--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="0.3dp"--> |
| | | <!-- android:background="#FF939393" />--> |
| | | <!-- <LinearLayout--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="40dp"--> |
| | | <!-- android:gravity="center">--> |
| | | |
| | | <!-- <androidx.appcompat.widget.AppCompatTextView--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="地点"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- android:lines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- />--> |
| | | |
| | | <!-- <com.android.app_base.widget.ClearEditText--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="4"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@null"--> |
| | | <!-- android:inputType="text"--> |
| | | <!-- android:layout_marginStart="6dp"--> |
| | | <!-- android:text="@={viewModel.requestBeanLiveData.place}"--> |
| | | <!-- android:hint="请输入地点"--> |
| | | <!-- android:textColorHint="#61000000"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- app:background="@drawable/ic_clear"--> |
| | | <!-- />--> |
| | | <!-- </LinearLayout>--> |
| | | |
| | | |
| | | <!-- <View--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="0.3dp"--> |
| | | <!-- android:background="#FF939393" />--> |
| | | |
| | | <!-- <LinearLayout--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="40dp"--> |
| | | <!-- android:gravity="center">--> |
| | | |
| | | <!-- <androidx.appcompat.widget.AppCompatTextView--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="申请部门"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- />--> |
| | | |
| | | <!-- <com.android.app_base.widget.ClearEditText--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="4"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@null"--> |
| | | <!-- android:inputType="text"--> |
| | | <!-- android:layout_marginStart="6dp"--> |
| | | <!-- android:text="@={viewModel.requestBeanLiveData.applyApart}"--> |
| | | <!-- android:hint="请输入申请部门"--> |
| | | <!-- android:textColorHint="#61000000"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- app:background="@drawable/ic_clear"--> |
| | | <!-- />--> |
| | | |
| | | |
| | | <!-- </LinearLayout>--> |
| | | |
| | | |
| | | |
| | | <!-- <View--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="0.3dp"--> |
| | | <!-- android:background="#FF939393" />--> |
| | | |
| | | <!-- <LinearLayout--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="40dp"--> |
| | | <!-- android:gravity="center">--> |
| | | |
| | | <!-- <androidx.appcompat.widget.AppCompatTextView--> |
| | | <!-- android:layout_width="0dp"--> |
| | | <!-- android:layout_weight="1"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="申请人"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:gravity="center"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- />--> |
| | | |
| | | <!-- <com.android.app_base.widget.ClearEditText--> |
| | | <!-- android:layout_width="0dp"--> |
| | | |
| | | <!-- android:layout_weight="4"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@null"--> |
| | | <!-- android:inputType="text"--> |
| | | <!-- android:layout_marginStart="6dp"--> |
| | | <!-- android:text="@={viewModel.requestBeanLiveData.applyPerson}"--> |
| | | <!-- android:hint="请输入申请人"--> |
| | | <!-- android:textColorHint="#61000000"--> |
| | | <!-- android:textColor="#FF333333"--> |
| | | <!-- android:textSize="14sp"--> |
| | | <!-- android:maxLines="1"--> |
| | | <!-- app:autoSizeTextType="uniform"--> |
| | | <!-- app:autoSizeMinTextSize="8sp"--> |
| | | <!-- app:autoSizeMaxTextSize="14sp"--> |
| | | <!-- app:background="@drawable/ic_clear"--> |
| | | <!-- />--> |
| | | |
| | | |
| | | <!-- </LinearLayout>--> |
| | | |
| | | <!-- <View--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="0.3dp"--> |
| | | <!-- android:background="#FF939393" />--> |
| | | |
| | | |
| | | <!-- <View--> |
| | | <!-- android:layout_width="match_parent"--> |
| | | <!-- android:layout_height="0.3dp"--> |
| | | <!-- android:background="#FF939393" />--> |
| | | |
| | | <!-- </LinearLayout>--> |
| | | |
| | | </RelativeLayout> |
| | | <!-- <com.google.android.material.floatingactionbutton.FloatingActionButton--> |
| | | <!-- android:id="@+id/fab_add"--> |
| | | <!-- android:layout_width="56dp"--> |
| | | <!-- android:layout_height="56dp"--> |
| | | <!-- app:layout_constraintBottom_toBottomOf="parent"--> |
| | | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
| | | <!-- android:layout_marginEnd="25dp"--> |
| | | <!-- android:layout_marginBottom="@dimen/dp_44"--> |
| | | <!-- android:src="@drawable/ic_add"--> |
| | | <!-- app:fabCustomSize="56dp"--> |
| | | <!-- />--> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.MeetingDetailActivityViewModel" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:title="@{viewModel.beanLiveData.id==0?`会议申请详情`:viewModel.beanLiveData.title}" |
| | | app:titleGravity="left" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:visibility="@{viewModel.beanLiveData.ownData==1}" |
| | | > |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@{viewModel.typeLiveData?@drawable/ic_operate_finish:@drawable/ic_operate}" |
| | | /> |
| | | |
| | | </FrameLayout> |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <androidx.core.widget.NestedScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="20dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="家庭号" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/editTextsequence" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入标题`:``}" |
| | | android:text="@={viewModel.beanLiveData.title}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="使用时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入地点`:``}" |
| | | android:text="@={viewModel.beanLiveData.place}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="会议室名称" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/cp" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入可容纳人数`:``}" |
| | | android:text="@={viewModel.beanLiveData.conPeople}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="标题" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData ? `请输入参与人数` : ``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.partPeople}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="申请人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请人`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.applyPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="审批人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请部门或家庭`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.applyApart}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="状态" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="none" |
| | | android:hint="@{viewModel.typeLiveData?`请输入状态`:``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.statu}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:clickable="false" |
| | | android:focusable="false" |
| | | /> |
| | | </LinearLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | > |
| | | <data> |
| | | <import type="android.view.View"/> |
| | | <import type="com.android.app_base.utils.DateTimeConverter"/> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.WebbackActivityViewModel"/> |
| | | </data> |
| | | |
| | | <!--约束布局,解决布局嵌套过多的问题,以灵活的方式定位和调整小部件。--> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".ui.function.WebcastActivity" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <!--标题栏,它紧挨状态栏的下面,正常情况下它的布局和主题样式都是使用系统定义好的,且默认情况下只显示图标和文本。--> |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:layout_marginHorizontal="16dp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@drawable/ic_operate" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_default" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="16dp" |
| | | android:text="直播回放" |
| | | android:layout_weight="1" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_default" |
| | | android:layout_width="@dimen/dp_24" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:background="@drawable/ic_search" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_search" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginVertical="4dp" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | android:background="@color/white" |
| | | android:paddingHorizontal="5dp" |
| | | android:visibility="gone" |
| | | > |
| | | <ImageView |
| | | android:id="@+id/iv_search" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_gray" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_search" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:layout_marginStart="5dp" |
| | | android:textSize="14sp" |
| | | android:textColor="#61000000" |
| | | android:background="@null" |
| | | android:imeOptions="actionSearch" |
| | | android:text="" |
| | | android:singleLine="true" |
| | | android:hint="在“直播回放“中搜索" |
| | | android:focusable="false" |
| | | android:clickable="false" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_type" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_by" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_data_null" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:gravity="center" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/img_data_null" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="18dp" |
| | | android:text="暂时还没有数据哦~\n点击”+”立即创建" |
| | | android:textSize="14sp" |
| | | android:textColor="#73000000" |
| | | /> |
| | | </LinearLayout> |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | > |
| | | <com.scwang.smart.refresh.header.MaterialHeader |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | tools:itemCount="20" |
| | | tools:listitem="@layout/item_webback" /> |
| | | <com.scwang.smart.refresh.footer.BallPulseFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | <RelativeLayout |
| | | android:id="@+id/container_search_parameter" |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="-4dp" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:id="@+id/layout_search_parameter" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/white" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:paddingEnd="12dp" |
| | | android:paddingStart="5dp" |
| | | > |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.5dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center" |
| | | > |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="时间" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="4" |
| | | android:gravity="center" |
| | | > |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_start_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={DateTimeConverter.dateFromString(viewModel.requestBeanLiveData.startTime)}" |
| | | android:hint="开始时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="—" |
| | | /> |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_end_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={DateTimeConverter.dateFromString(viewModel.requestBeanLiveData.endTime)}" |
| | | android:hint="结束时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_time_clear" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_clear" |
| | | android:visibility="invisible" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="直播标题" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.title}" |
| | | android:hint="请输入标题" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.applyPerson}" |
| | | android:hint="请输入申请人" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </RelativeLayout> |
| | | <!-- <com.google.android.material.floatingactionbutton.FloatingActionButton--> |
| | | <!-- android:id="@+id/fab_add"--> |
| | | <!-- android:layout_width="56dp"--> |
| | | <!-- android:layout_height="56dp"--> |
| | | <!-- app:layout_constraintBottom_toBottomOf="parent"--> |
| | | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
| | | <!-- android:layout_marginEnd="25dp"--> |
| | | <!-- android:layout_marginBottom="@dimen/dp_44"--> |
| | | <!-- android:src="@drawable/ic_add"--> |
| | | <!-- app:fabCustomSize="56dp"--> |
| | | <!-- />--> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.WebbackDetailActivityViewModel" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:title="@{viewModel.beanLiveData.id==0?`会议申请详情`:viewModel.beanLiveData.title}" |
| | | app:titleGravity="left" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:visibility="@{viewModel.beanLiveData.ownData==1}" |
| | | > |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@{viewModel.typeLiveData?@drawable/ic_operate_finish:@drawable/ic_operate}" |
| | | /> |
| | | |
| | | </FrameLayout> |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <androidx.core.widget.NestedScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="20dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="标题" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/editTextsequence" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入标题`:``}" |
| | | android:text="@={viewModel.beanLiveData.title}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="申请人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请人`:``}" |
| | | android:text="@={viewModel.beanLiveData.applyPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/cp" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入联系人`:``}" |
| | | android:text="@={viewModel.beanLiveData.contactPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系电话" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData ? `请输入联系电话` : ``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.contactPhone}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="开始时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="结束时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <com.android.app_base.widget.WrapRecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_6b0000_stroke" |
| | | android:layout_marginBottom="20dp" |
| | | android:layout_marginTop="2dp" |
| | | android:paddingStart="10dp" |
| | | android:paddingEnd="5dp" |
| | | android:paddingVertical="10dp" |
| | | tools:itemCount="30" |
| | | /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | | </LinearLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | > |
| | | <data> |
| | | <import type="android.view.View"/> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.WebcastActivityViewModel"/> |
| | | </data> |
| | | |
| | | <!--约束布局,解决布局嵌套过多的问题,以灵活的方式定位和调整小部件。--> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".ui.function.WebcastActivity" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <!--标题栏,它紧挨状态栏的下面,正常情况下它的布局和主题样式都是使用系统定义好的,且默认情况下只显示图标和文本。--> |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:layout_marginHorizontal="16dp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@drawable/ic_operate" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_default" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="16dp" |
| | | android:text="直播申请" |
| | | android:layout_weight="1" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_default" |
| | | android:layout_width="@dimen/dp_24" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:background="@drawable/ic_search" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_search" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginVertical="4dp" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:gravity="center_vertical" |
| | | android:background="@color/white" |
| | | android:paddingHorizontal="5dp" |
| | | android:visibility="gone" |
| | | > |
| | | <ImageView |
| | | android:id="@+id/iv_search" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_gray" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_search" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:layout_marginStart="5dp" |
| | | android:textSize="14sp" |
| | | android:textColor="#61000000" |
| | | android:background="@null" |
| | | android:imeOptions="actionSearch" |
| | | android:text="" |
| | | android:singleLine="true" |
| | | android:hint="在“直播申请“中搜索" |
| | | android:focusable="false" |
| | | android:clickable="false" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_search_type" |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/ic_search_by" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_data_null" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:gravity="center" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/img_data_null" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="18dp" |
| | | android:text="暂时还没有数据哦~\n点击”+”立即创建" |
| | | android:textSize="14sp" |
| | | android:textColor="#73000000" |
| | | /> |
| | | </LinearLayout> |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | > |
| | | <com.scwang.smart.refresh.header.MaterialHeader |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/titleBar" |
| | | tools:itemCount="20" |
| | | tools:listitem="@layout/item_webcast" /> |
| | | <com.scwang.smart.refresh.footer.BallPulseFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | <RelativeLayout |
| | | android:id="@+id/container_search_parameter" |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="-4dp" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:id="@+id/layout_search_parameter" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/white" |
| | | android:layout_marginHorizontal="56dp" |
| | | android:paddingEnd="12dp" |
| | | android:paddingStart="5dp" |
| | | > |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.5dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center" |
| | | > |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="时间" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="4" |
| | | android:gravity="center" |
| | | > |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_start_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.startTime}" |
| | | android:hint="开始时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="—" |
| | | /> |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:id="@+id/et_end_time" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={viewModel.requestBeanLiveData.endTime}" |
| | | android:hint="结束时间" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | tools:text="2022-01-01" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_time_clear" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_clear" |
| | | android:visibility="invisible" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="直播标题" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | android:lines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.title}" |
| | | android:hint="请输入标题" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center"> |
| | | |
| | | <androidx.appcompat.widget.AppCompatTextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | /> |
| | | |
| | | <com.android.app_base.widget.ClearEditText |
| | | android:layout_width="0dp" |
| | | android:layout_weight="4" |
| | | android:layout_height="wrap_content" |
| | | android:background="@null" |
| | | android:inputType="text" |
| | | android:layout_marginStart="6dp" |
| | | android:text="@={viewModel.requestBeanLiveData.applyPerson}" |
| | | android:hint="请输入申请人" |
| | | android:textColorHint="#61000000" |
| | | android:textColor="#FF333333" |
| | | android:textSize="14sp" |
| | | android:maxLines="1" |
| | | app:autoSizeTextType="uniform" |
| | | app:autoSizeMinTextSize="8sp" |
| | | app:autoSizeMaxTextSize="14sp" |
| | | app:background="@drawable/ic_clear" |
| | | /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </RelativeLayout> |
| | | <com.google.android.material.floatingactionbutton.FloatingActionButton |
| | | android:id="@+id/fab_add" |
| | | android:layout_width="56dp" |
| | | android:layout_height="56dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="25dp" |
| | | android:layout_marginBottom="@dimen/dp_44" |
| | | android:src="@drawable/ic_add" |
| | | app:fabCustomSize="56dp" |
| | | /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.function.WebcastDetailActivityViewModel" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:title="@{viewModel.beanLiveData.id==0?`会议申请详情`:viewModel.beanLiveData.title}" |
| | | app:titleGravity="left" |
| | | > |
| | | |
| | | <FrameLayout |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:layout_gravity="center_vertical|end" |
| | | android:visibility="@{viewModel.beanLiveData.ownData==1}" |
| | | > |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_operate" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:background="@{viewModel.typeLiveData?@drawable/ic_operate_finish:@drawable/ic_operate}" |
| | | /> |
| | | |
| | | </FrameLayout> |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <androidx.core.widget.NestedScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/titleBar" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="20dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="标题" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/editTextsequence" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData?`请输入标题`:``}" |
| | | android:text="@={viewModel.beanLiveData.title}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="申请人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入申请人`:``}" |
| | | android:text="@={viewModel.beanLiveData.applyPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系人" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/cp" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:hint="@{viewModel.typeLiveData?`请输入联系人`:``}" |
| | | android:text="@={viewModel.beanLiveData.contactPerson}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="联系电话" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="text" |
| | | android:hint="@{viewModel.typeLiveData ? `请输入联系电话` : ``}" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | android:text="@={viewModel.beanLiveData.contactPhone}" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="开始时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time1" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入开始时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time1}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:text="结束时间" |
| | | android:textColor="#ff000000" |
| | | android:textSize="12sp" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:textColorHint="#6b000000" |
| | | android:textColor="#DE000000" |
| | | android:textSize="16sp" |
| | | > |
| | | |
| | | <EditText |
| | | android:id="@+id/et_date2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的年月日`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.date2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text=" " |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_time2" |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:enabled="@{viewModel.typeLiveData}" |
| | | android:hint="@{viewModel.typeLiveData?`请输入结束时间的时分秒`:``}" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.beanLiveData.time2}" |
| | | android:textColor="#DE000000" |
| | | android:textColorHint="#6b000000" |
| | | android:textSize="16sp" |
| | | app:isEditable="@{false}" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <com.android.app_base.widget.WrapRecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:orientation="vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_6b0000_stroke" |
| | | android:layout_marginBottom="20dp" |
| | | android:layout_marginTop="2dp" |
| | | android:paddingStart="10dp" |
| | | android:paddingEnd="5dp" |
| | | android:paddingVertical="10dp" |
| | | tools:itemCount="30" |
| | | /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | | </LinearLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </layout> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | |
| | | |
| | | <layout |
| | | <layout xmlns:tools="http://schemas.android.com/tools" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | app:layout_constraintGuide_percent="0.25" |
| | | /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_core_module" |
| | |
| | | android:textSize="@dimen/sp_14" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_personal_module" |
| | | android:id="@+id/tv_family_module" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_20" |
| | | android:text="个人模块" |
| | | android:layout_marginTop="20dp" |
| | | android:text="家庭会议" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_18" |
| | | android:textStyle="bold" |
| | |
| | | app:layout_constraintTop_toBottomOf="@+id/layout_income_and_expenses" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_family_meeting" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:gravity="center" |
| | | android:orientation="vertical" |
| | | app:layout_constraintEnd_toStartOf="@+id/gl_v_0.25" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_family_module"> |
| | | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="?attr/icFunctionLittleDoctor" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_4" |
| | | android:text="会议申请" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_14" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_meeting_approve" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:orientation="vertical" |
| | | app:layout_constraintEnd_toStartOf="@+id/gl_v_0.5" |
| | | app:layout_constraintStart_toStartOf="@+id/gl_v_0.25" |
| | | app:layout_constraintTop_toTopOf="@id/layout_family_meeting"> |
| | | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="?attr/icFunctionLittleDoctor" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_4" |
| | | android:text="会议审批" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_14" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_meeting_sta" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:orientation="vertical" |
| | | app:layout_constraintEnd_toEndOf="@+id/layout_contacts" |
| | | app:layout_constraintStart_toStartOf="@+id/layout_contacts" |
| | | app:layout_constraintTop_toTopOf="@id/layout_family_meeting"> |
| | | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="?attr/icFunctionLittleDoctor" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_4" |
| | | android:text="会议统计" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_14" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_webcast" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:orientation="vertical" |
| | | app:layout_constraintEnd_toEndOf="@+id/layout_pet" |
| | | app:layout_constraintStart_toStartOf="@+id/layout_pet" |
| | | app:layout_constraintTop_toTopOf="@id/layout_family_meeting"> |
| | | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="?attr/icFunctionLittleDoctor" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_4" |
| | | android:text="直播申请" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_14" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_webback" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | |
| | | app:layout_constraintStart_toStartOf="@id/layout_family_meeting" |
| | | app:layout_constraintEnd_toEndOf="@id/layout_family_meeting" |
| | | app:layout_constraintTop_toBottomOf="@id/layout_family_meeting" |
| | | android:layout_marginTop="@dimen/dp_20" |
| | | android:gravity="center" |
| | | > |
| | | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="?attr/icFunctionLittleDoctor" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_4" |
| | | android:textSize="@dimen/sp_14" |
| | | android:text="直播回放" |
| | | android:textColor="@color/black" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_personal_module" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="90dp" |
| | | android:text="个人模块" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_18" |
| | | android:textStyle="bold" |
| | | app:layout_constraintStart_toStartOf="@+id/tv_family_module" |
| | | app:layout_constraintTop_toBottomOf="@+id/layout_family_meeting" /> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_growing_up" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="bean" |
| | | type="com.application.zhangshi_app_android.bean.MeetingBean" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/cardView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | > |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/layout_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <CheckBox |
| | | android:id="@+id/checkbox" |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_flower" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:ellipsize="end" |
| | | android:maxLines="1" |
| | | android:text="@{bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="16sp" |
| | | android:layout_marginStart="24dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintWidth_percent="0.5" |
| | | tools:text="张氏App立项" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="16sp" |
| | | android:textColor="@color/black" |
| | | android:text="@{bean.startTime}" |
| | | android:layout_alignParentEnd="true" |
| | | android:layout_centerVertical="true" |
| | | tools:text="2023-05-16" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_fold" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_fold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_fold" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="@dimen/dp_24" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="地点:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.place}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="可容纳人数:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.conPeople}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="参与人数:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.partPeople}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.applyPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请部门或家庭:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.applyApart}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="开始时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.startTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="结束时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.endTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="是否摆放水牌:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.isPlacebrand}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.connPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系电话:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.connPhone}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="状态:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.statu}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="6dp" |
| | | android:text="电子文件:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="15dp" |
| | | > |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | tools:listitem="@layout/item_electronic_file" |
| | | tools:itemCount="3" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | tools:visibility="visible" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:layout_marginBottom="@dimen/dp_12" |
| | | android:visibility="gone" |
| | | > |
| | | <LinearLayout |
| | | android:id="@+id/layout_modify" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_modify" |
| | | android:layout_gravity="center" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="修改" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_14" |
| | | |
| | | android:layout_marginStart="@dimen/dp_4" |
| | | /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:id="@+id/layout_delete" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="@dimen/dp_52" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_delete" |
| | | android:layout_gravity="center" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="删除" |
| | | android:textColor="#FFE86F72" |
| | | android:textSize="@dimen/sp_14" |
| | | |
| | | android:layout_marginStart="@dimen/dp_4" |
| | | /> |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="bean" |
| | | type="com.application.zhangshi_app_android.bean.MeetingBean" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/cardView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | > |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/layout_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <CheckBox |
| | | android:id="@+id/checkbox" |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_flower" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:ellipsize="end" |
| | | android:maxLines="1" |
| | | android:text="@{bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="16sp" |
| | | android:layout_marginStart="24dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintWidth_percent="0.5" |
| | | tools:text="张氏App立项" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="16sp" |
| | | android:textColor="@color/black" |
| | | android:text="@{bean.startTime}" |
| | | android:layout_alignParentEnd="true" |
| | | android:layout_centerVertical="true" |
| | | tools:text="2023-05-16" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_fold" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_fold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_fold" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="@dimen/dp_24" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="地点:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.place}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="可容纳人数:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.conPeople}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="参与人数:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.partPeople}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.applyPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请部门或家庭:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.applyApart}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="开始时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.startTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="结束时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.endTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="是否摆放水牌:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.isPlacebrand}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.connPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系电话:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.connPhone}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="状态:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.statu}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="6dp" |
| | | android:text="电子文件:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="15dp" |
| | | > |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | tools:listitem="@layout/item_electronic_file" |
| | | tools:itemCount="3" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | tools:visibility="visible" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:layout_marginBottom="@dimen/dp_12" |
| | | android:visibility="gone" |
| | | > |
| | | <LinearLayout |
| | | android:id="@+id/layout_modify" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_modify" |
| | | android:layout_gravity="center" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="修改" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_14" |
| | | |
| | | android:layout_marginStart="@dimen/dp_4" |
| | | /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:id="@+id/layout_delete" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="@dimen/dp_52" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_delete" |
| | | android:layout_gravity="center" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="删除" |
| | | android:textColor="#FFE86F72" |
| | | android:textSize="@dimen/sp_14" |
| | | |
| | | android:layout_marginStart="@dimen/dp_4" |
| | | /> |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="bean" |
| | | type="com.application.zhangshi_app_android.bean.MeetingStaBean" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/cardView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | > |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/layout_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <CheckBox |
| | | android:id="@+id/checkbox" |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_flower" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:ellipsize="end" |
| | | android:maxLines="1" |
| | | android:text="@{bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="16sp" |
| | | android:layout_marginStart="24dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintWidth_percent="0.5" |
| | | tools:text="张氏App立项" /> |
| | | <!-- <TextView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:textSize="16sp"--> |
| | | <!-- android:textColor="@color/black"--> |
| | | <!-- android:text="@{bean.startTime}"--> |
| | | <!-- android:layout_alignParentEnd="true"--> |
| | | <!-- android:layout_centerVertical="true"--> |
| | | <!-- tools:text="2023-05-16"--> |
| | | <!-- app:layout_constraintBottom_toBottomOf="parent"--> |
| | | <!-- app:layout_constraintTop_toTopOf="parent"--> |
| | | <!-- app:layout_constraintEnd_toStartOf="@id/iv_fold"--> |
| | | <!-- android:layout_marginEnd="10dp"--> |
| | | <!-- />--> |
| | | <ImageView |
| | | android:id="@+id/iv_fold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_fold" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="@dimen/dp_24" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="家庭号:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.familyId}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="使用时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.useTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="会议室名称:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.conferenceRoom}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="标题:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.applyPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="审批人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.ratifyPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="状态:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.status}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="15dp" |
| | | > |
| | | |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | tools:visibility="visible" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:layout_marginBottom="@dimen/dp_12" |
| | | android:visibility="gone" |
| | | > |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="bean" |
| | | type="com.application.zhangshi_app_android.bean.WebbackBean" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/cardView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | > |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/layout_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <CheckBox |
| | | android:id="@+id/checkbox" |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_flower" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:ellipsize="end" |
| | | android:maxLines="1" |
| | | android:text="@{bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="16sp" |
| | | android:layout_marginStart="24dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintWidth_percent="0.5" |
| | | tools:text="张氏App立项" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="16sp" |
| | | android:textColor="@color/black" |
| | | android:text="@{bean.startTime}" |
| | | android:layout_alignParentEnd="true" |
| | | android:layout_centerVertical="true" |
| | | tools:text="2023-05-16" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_fold" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_fold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_fold" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="@dimen/dp_24" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="直播标题:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.applyPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.contactPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系电话:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.contactPhone}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="开始时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.startTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="结束时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.endTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="6dp" |
| | | android:text="直播:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="15dp" |
| | | > |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | tools:listitem="@layout/item_electronic_file" |
| | | tools:itemCount="3" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | <!-- <LinearLayout--> |
| | | <!-- tools:visibility="visible"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:layout_gravity="center"--> |
| | | <!-- android:layout_marginBottom="@dimen/dp_12"--> |
| | | <!-- android:visibility="gone"--> |
| | | <!-- >--> |
| | | <!-- <LinearLayout--> |
| | | <!-- android:id="@+id/layout_modify"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- >--> |
| | | <!-- <ImageView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@drawable/ic_modify"--> |
| | | <!-- android:layout_gravity="center"--> |
| | | <!-- />--> |
| | | <!-- <TextView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="修改"--> |
| | | <!-- android:textColor="@color/black"--> |
| | | <!-- android:textSize="@dimen/sp_14"--> |
| | | |
| | | <!-- android:layout_marginStart="@dimen/dp_4"--> |
| | | <!-- />--> |
| | | <!-- </LinearLayout>--> |
| | | <!-- <LinearLayout--> |
| | | <!-- android:id="@+id/layout_delete"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:layout_marginStart="@dimen/dp_52"--> |
| | | <!-- >--> |
| | | <!-- <ImageView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@drawable/ic_delete"--> |
| | | <!-- android:layout_gravity="center"--> |
| | | <!-- />--> |
| | | <!-- <TextView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="删除"--> |
| | | <!-- android:textColor="#FFE86F72"--> |
| | | <!-- android:textSize="@dimen/sp_14"--> |
| | | |
| | | <!-- android:layout_marginStart="@dimen/dp_4"--> |
| | | <!-- />--> |
| | | <!-- </LinearLayout>--> |
| | | <!-- </LinearLayout>--> |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </layout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <data> |
| | | <variable |
| | | name="bean" |
| | | type="com.application.zhangshi_app_android.bean.WebcastBean" /> |
| | | </data> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | > |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/cardView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | > |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/layout_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <CheckBox |
| | | android:id="@+id/checkbox" |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_flower" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerVertical="true" |
| | | android:ellipsize="end" |
| | | android:maxLines="1" |
| | | android:text="@{bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="16sp" |
| | | android:layout_marginStart="24dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintWidth_percent="0.5" |
| | | tools:text="张氏App立项" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="16sp" |
| | | android:textColor="@color/black" |
| | | android:text="@{bean.startTime}" |
| | | android:layout_alignParentEnd="true" |
| | | android:layout_centerVertical="true" |
| | | tools:text="2023-05-16" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_fold" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_fold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_fold" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="10dp" |
| | | /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:paddingHorizontal="@dimen/dp_24" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="直播标题:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.title}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="申请人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.applyPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系人:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.contactPerson}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="联系电话:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@{bean.contactPhone}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="开始时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.startTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="6dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="结束时间:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@={bean.endTime}" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="6dp" |
| | | android:text="直播:" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginBottom="15dp" |
| | | > |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_image" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | tools:listitem="@layout/item_electronic_file" |
| | | tools:itemCount="3" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | <!-- <LinearLayout--> |
| | | <!-- tools:visibility="visible"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:layout_gravity="center"--> |
| | | <!-- android:layout_marginBottom="@dimen/dp_12"--> |
| | | <!-- android:visibility="gone"--> |
| | | <!-- >--> |
| | | <!-- <LinearLayout--> |
| | | <!-- android:id="@+id/layout_modify"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- >--> |
| | | <!-- <ImageView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@drawable/ic_modify"--> |
| | | <!-- android:layout_gravity="center"--> |
| | | <!-- />--> |
| | | <!-- <TextView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="修改"--> |
| | | <!-- android:textColor="@color/black"--> |
| | | <!-- android:textSize="@dimen/sp_14"--> |
| | | |
| | | <!-- android:layout_marginStart="@dimen/dp_4"--> |
| | | <!-- />--> |
| | | <!-- </LinearLayout>--> |
| | | <!-- <LinearLayout--> |
| | | <!-- android:id="@+id/layout_delete"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:layout_marginStart="@dimen/dp_52"--> |
| | | <!-- >--> |
| | | <!-- <ImageView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:background="@drawable/ic_delete"--> |
| | | <!-- android:layout_gravity="center"--> |
| | | <!-- />--> |
| | | <!-- <TextView--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="删除"--> |
| | | <!-- android:textColor="#FFE86F72"--> |
| | | <!-- android:textSize="@dimen/sp_14"--> |
| | | |
| | | <!-- android:layout_marginStart="@dimen/dp_4"--> |
| | | <!-- />--> |
| | | <!-- </LinearLayout>--> |
| | | <!-- </LinearLayout>--> |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </layout> |
| | |
| | | android:layout_marginStart="16dp" |
| | | /> |
| | | </LinearLayout> |
| | | <!--CardView卡片布局 用于显示阴影和圆角效果的UI 继承自FrameLayout帧布局 --> |
| | | <androidx.cardview.widget.CardView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | | <!--cardElevation设置Z轴高度,表现出立体的阴影效果,从而增强视觉层级和空间感知--> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginBottom="8dp" |
| | | /> |
| | | <!--View 一条横线--> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1dp" |
| | | android:background="#FFF3F3F3" |
| | | /> |
| | | <!--paddingHorizontal水平方向填充,相当于整体左右移,有正负 |
| | | marginVertical 边缘垂直,相当于整体上下移动 |
| | | --> |
| | | <LinearLayout |
| | | android:id="@+id/dl_home_root_net" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | |
| | | android:layout_height="10dp" |
| | | android:background="?attr/icFunctionFamilyRootNet" |
| | | /> |
| | | <!--marginStart边缘距离左边的距离--> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | |
| | | |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | <androidx.cardview.widget.CardView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="@color/white" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | android:layout_marginTop="30dp" |
| | | android:layout_marginBottom="10dp" |
| | | > |
| | | <!--cardElevation设置Z轴高度,表现出立体的阴影效果,从而增强视觉层级和空间感知--> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:paddingVertical="8dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="会议板块" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginBottom="8dp" |
| | | /> |
| | | <!--View 一条横线--> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1dp" |
| | | android:background="#FFF3F3F3" |
| | | /> |
| | | <!--paddingHorizontal水平方向填充,相当于整体左右移,有正负 |
| | | marginVertical 边缘垂直,相当于整体上下移动 |
| | | --> |
| | | <LinearLayout |
| | | android:id="@+id/dl_family_meeting" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="13dp" |
| | | android:layout_height="10dp" |
| | | android:background="@drawable/ic_function_meeting" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="会议申请" |
| | | android:textColor="@color/black" |
| | | android:textSize="14sp" |
| | | android:layout_marginStart="15dp" |
| | | /> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_vector_gray" |
| | | /> |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:id="@+id/dl_family_webcast" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="13dp" |
| | | android:layout_height="15dp" |
| | | android:background="@drawable/ic_function_webcast" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="家庭直播" |
| | | android:textColor="@color/black" |
| | | android:textSize="14sp" |
| | | android:layout_marginStart="15dp" |
| | | /> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_vector_gray" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/dl_back" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="13dp" |
| | | android:layout_height="15dp" |
| | | android:background="@drawable/ic_fuction_back" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="直播回放" |
| | | android:textColor="@color/black" |
| | | android:textSize="14sp" |
| | | android:layout_marginStart="15dp" |
| | | /> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_vector_gray" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | |
| | | <androidx.cardview.widget.CardView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="85dp" |
| | | android:layout_height="63dp" |
| | | android:orientation="vertical" |
| | | android:gravity="center_horizontal" |
| | | > |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_agreed" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:drawablePadding="5dp" |
| | | android:gravity="center" |
| | | android:text="同意" |
| | | android:textColor="#FF333333" |
| | | android:textSize="12sp" |
| | | app:drawableStartCompat="@drawable/ic_modify" |
| | | /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" |
| | | /> |
| | | <TextView |
| | | android:id="@+id/tv_disagree" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="拒绝" |
| | | android:gravity="center" |
| | | android:textColor="#FFE86F72" |
| | | android:textSize="12sp" |
| | | app:drawableStartCompat="@drawable/ic_modify" |
| | | android:drawablePadding="5dp" |
| | | android:layout_weight="1" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </androidx.cardview.widget.CardView> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="85dp" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:gravity="center_horizontal" |
| | | > |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_from_new_to_old" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="32dp" |
| | | android:text="由新到旧" |
| | | android:gravity="center" |
| | | android:textColor="#FF333333" |
| | | android:textSize="12sp" |
| | | app:drawableStartCompat="@drawable/ic_operate_order" |
| | | android:drawablePadding="3dp" |
| | | /> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" |
| | | /> |
| | | <TextView |
| | | android:id="@+id/tv_from_old_to_new" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="32dp" |
| | | android:text="由旧到新" |
| | | android:gravity="center" |
| | | android:textColor="#FF333333" |
| | | android:textSize="12sp" |
| | | app:drawableStartCompat="@drawable/ic_operate_order" |
| | | android:drawablePadding="3dp" |
| | | /> |
| | | <LinearLayout |
| | | android:id="@+id/layout_own_top" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:gravity="center_horizontal" |
| | | > |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0.3dp" |
| | | android:background="#FF939393" |
| | | /> |
| | | <TextView |
| | | android:id="@+id/tv_own_top" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="32dp" |
| | | android:text="本家置顶" |
| | | android:gravity="center" |
| | | android:textColor="#FF333333" |
| | | android:textSize="12sp" |
| | | app:drawableStartCompat="@drawable/ic_operate_order" |
| | | android:drawablePadding="3dp" |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </androidx.cardview.widget.CardView> |
| | |
| | | <attr name="menuIconTree" format="reference" /> |
| | | <attr name="menuIconUser" format="reference" /> |
| | | |
| | | |
| | | <attr name="icFunctionFamilyRootNet" format="reference" /> |
| | | <attr name="icFunctionNotes" format="reference" /> |
| | | <attr name="icFunctionAsset" format="reference" /> |
| | |
| | | <attr name="icFunctionIncomeExpense" format="reference" /> |
| | | <attr name="icFunctionHomeDevices" format="reference" /> |
| | | <attr name="icFunctionGrowth" format="reference" /> |
| | | <attr name="icFunctionMeeting" format="reference" /> |
| | | <attr name="icFunctionMarriage" format="reference" /> |
| | | <attr name="icFunctionProperty" format="reference" /> |
| | | <attr name="icFunctionWish" format="reference" /> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <resources></resources> |
| | |
| | | <item name="icFunctionHealth">@drawable/ic_function_health</item> |
| | | <item name="icFunctionCertificate">@drawable/ic_function_certificate</item> |
| | | <item name="icFunctionPrivacy">@drawable/ic_function_privacy</item> |
| | | <item name="icFunctionMeeting">@drawable/ic_function_meeting</item> |
| | | |
| | | |
| | | |
| | | <!-- 数据列表 卡片背景色 --> |
| | | <item name="cardBackgroundColorFirst">@color/color_card_pink</item> |
| | |
| | | package com.android.app_base.base.viewmodel; |
| | | |
| | | import android.app.Application; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.lifecycle.AndroidViewModel; |
| | |
| | | |
| | | import com.android.app_base.base.StateViewEnum; |
| | | import com.android.app_base.base.model.BaseModel; |
| | | |
| | | |
| | | import org.reactivestreams.Subscriber; |
| | | |
| | | import io.reactivex.disposables.CompositeDisposable; |
| | | import io.reactivex.disposables.Disposable; |
| | |
| | | public void onDestroy(@NonNull LifecycleOwner owner) { |
| | | DefaultLifecycleObserver.super.onDestroy(owner); |
| | | } |
| | | |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | } |
| | | } |
New file |
| | |
| | | package com.android.app_base.utils; |
| | | |
| | | /** |
| | | * Created by guoshen on 2024/6/29 |
| | | */ |
| | | |
| | | import androidx.databinding.InverseMethod; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Locale; |
| | | |
| | | public class DateTimeConverter { |
| | | |
| | | // 日期时间格式化模板 |
| | | private static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; |
| | | // 日期格式化模板 |
| | | private static final String DATE_FORMAT = "yyyy-MM-dd"; |
| | | // 时间格式化模板 |
| | | private static final String TIME_FORMAT = "HH:mm:ss"; |
| | | |
| | | // 将完整的日期时间字符串转换为日期部分(yyyy-MM-dd) |
| | | public static String dateFromString(String dateTime) { |
| | | if (dateTime == null || dateTime.isEmpty()) { |
| | | return ""; |
| | | } |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_TIME_FORMAT, Locale.getDefault()); |
| | | try { |
| | | Date date = dateFormat.parse(dateTime); |
| | | SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT, Locale.getDefault()); |
| | | return dateFormatter.format(date); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | // 将完整的日期时间字符串转换为时间部分(HH:mm:ss) |
| | | public static String timeFromString(String dateTime) { |
| | | if (dateTime == null || dateTime.isEmpty()) { |
| | | return ""; |
| | | } |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_TIME_FORMAT, Locale.getDefault()); |
| | | try { |
| | | Date date = dateFormat.parse(dateTime); |
| | | SimpleDateFormat timeFormatter = new SimpleDateFormat(TIME_FORMAT, Locale.getDefault()); |
| | | return timeFormatter.format(date); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | // 反向转换:从日期和时间部分生成完整的日期时间字符串 |
| | | @InverseMethod("dateFromString") |
| | | public static String stringFromDate(String date) { |
| | | // Not needed for this case |
| | | return null; |
| | | } |
| | | |
| | | @InverseMethod("timeFromString") |
| | | public static String stringFromTime(String time) { |
| | | // Not needed for this case |
| | | return null; |
| | | } |
| | | } |
| | | |