144个文件已修改
35 文件已重命名
150个文件已添加
1个文件已删除
| | |
| | | </deviceKey> |
| | | </Target> |
| | | </targetSelectedWithDropDown> |
| | | <timeTargetWasSelectedWithDropDown value="2023-10-25T11:40:17.439780100Z" /> |
| | | <timeTargetWasSelectedWithDropDown value="2023-12-11T10:41:49.189704100Z" /> |
| | | </component> |
| | | </project> |
| | |
| | | applicationId "com.application.zhangshi_app_android" |
| | | minSdk 24 |
| | | targetSdk 33 |
| | | versionCode 3 |
| | | versionName "1.0.2" |
| | | versionCode 5 |
| | | versionName "1.0.4" |
| | | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| | | ndk { |
| | | //APP的build.gradle设置支持的SO库架构 |
| | |
| | | android:networkSecurityConfig="@xml/network_security_config" |
| | | android:resizeableActivity="true" |
| | | android:supportsRtl="true" |
| | | android:theme="@style/Theme.app" |
| | | android:theme="@style/AppTheme.Normal" |
| | | android:usesCleartextTraffic="true" |
| | | tools:targetApi="31"> |
| | | |
| | |
| | | package com.application.zhangshi_app_android; |
| | | |
| | | import com.android.app_base.base.BaseApplication; |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.http.OkHttpHelper; |
| | | import com.application.zhangshi_app_android.other.MyTitleBarStyle; |
| | | import com.github.gzuliyujiang.dialog.DialogColor; |
| | | import com.github.gzuliyujiang.dialog.DialogConfig; |
| | | import com.github.gzuliyujiang.dialog.DialogStyle; |
| | | import com.hjq.bar.TitleBar; |
| | | import com.hjq.http.EasyConfig; |
| | | import com.hjq.http.config.IRequestHandler; |
| | | import com.hjq.http.config.RequestServer; |
| | | |
| | | //import me.jessyan.autosize.AutoSizeConfig; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.02. 17:51 |
| | | * @desc |
| | | * @desc 自定义Application |
| | | */ |
| | | public class MyApplication extends BaseApplication { |
| | | @Override |
| | |
| | | |
| | | import android.content.Context; |
| | | 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.AnnualHealthStatusBean; |
| | | import com.application.zhangshi_app_android.bean.PersonalNotepadBean; |
| | | import com.application.zhangshi_app_android.databinding.ItemAnnualHealthStatusBinding; |
| | | import com.application.zhangshi_app_android.ui.function.AnnualHealthStatusActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.AnnualHealthStatusDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.CleanStorageDetailActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadActivityViewModel; |
| | | import com.application.zhangshi_app_android.ui.function.PersonalNotepadDetailActivity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | package com.application.zhangshi_app_android.adapter; |
| | | |
| | | import android.content.Context; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | ContactsDetailAdapter adapter = new ContactsDetailAdapter(mContext); |
| | | holder.getBinding().recyclerView.setAdapter(adapter); |
| | | adapter.setData(mDataList.get(position).getContactsDetailBeans()); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.graphics.Color; |
| | | import android.util.TypedValue; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import androidx.lifecycle.LifecycleOwner; |
| | |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().cardView.postDelayed(new Runnable() { |
| | | @Override |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | |
| | | protected void onBind(BaseViewHolder<ItemElectronicFileBinding> holder, int position) { |
| | | String item = mDataList.get(position); |
| | | if (item != null) { |
| | | if (item.endsWith(".pdf")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_pdf); |
| | | } else if (item.endsWith(".zip") || item.endsWith(".aar") || item.endsWith(".7z")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_zip); |
| | | } else if (item.endsWith(".doc") || item.endsWith(".docx")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_word); |
| | | } else if (item.endsWith(".xls") || item.endsWith(".xlsx")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_excel); |
| | | } else if (item.endsWith(".ppt") || item.endsWith(".pptx")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_ppt); |
| | | } else if (item.endsWith(".txt")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_txt); |
| | | } else if (item.endsWith(".jpg") || item.endsWith(".jpeg") || item.endsWith(".png") || item.endsWith(".gif")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_img); |
| | | } else if (item.endsWith(".mp4")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_video); |
| | | } else if (item.endsWith(".mp3") || item.endsWith(".m4a")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_audio); |
| | | int resid; |
| | | if (item.endsWith(".pdf") || item.endsWith(".PDF")) { |
| | | resid = R.attr.icPdf; |
| | | } else if (item.endsWith(".zip") || item.endsWith(".ZIP") || item.endsWith(".aar") || item.endsWith(".AAR") || item.endsWith(".7z")) { |
| | | resid = R.attr.icZip; |
| | | } else if (item.endsWith(".doc") || item.endsWith(".docx") || item.endsWith(".DOC") || item.endsWith(".DOCX") || item.endsWith(".wps") || item.endsWith(".WPS")) { |
| | | resid = R.attr.icWord; |
| | | } else if (item.endsWith(".xls") || item.endsWith(".xlsx") || item.endsWith(".XLS") || item.endsWith(".XLSX")) { |
| | | resid = R.attr.icExcel; |
| | | } else if (item.endsWith(".ppt") || item.endsWith(".PPT") || item.endsWith(".pptx") || item.endsWith(".PPTX")) { |
| | | resid = R.attr.icPpt; |
| | | } else if (item.endsWith(".txt") || item.endsWith(".TXT")) { |
| | | resid = R.attr.icTxt; |
| | | } else if (item.endsWith(".jpg") || item.endsWith(".JPG") || item.endsWith(".jpeg") || item.endsWith(".JPEG") || item.endsWith(".png") || item.endsWith(".PNG") || item.endsWith(".gif") || item.endsWith(".GIF") || item.endsWith(".bmp") || item.endsWith(".BMP")) { |
| | | resid = R.attr.icImage; |
| | | } else if (item.endsWith(".mp4") || item.endsWith(".MP4") ) { |
| | | resid = R.attr.icVideo; |
| | | } else if (item.endsWith(".mp3") || item.endsWith(".m4a") || item.endsWith(".MP3") || item.endsWith(".M4A")) { |
| | | resid = R.attr.icAudio; |
| | | } else { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_others); |
| | | resid = R.attr.icOther; |
| | | } |
| | | TypedValue typedValue = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(resid, typedValue, true); |
| | | holder.getBinding().ivImage.setImageResource(typedValue.resourceId); |
| | | } |
| | | } |
| | | |
| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.util.Base64; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | |
| | | import androidx.annotation.Nullable; |
| | |
| | | |
| | | if (item != null) { |
| | | //非图片视频,打开文件预览 |
| | | |
| | | if (item.endsWith(".pdf")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_pdf); |
| | | } else if (item.endsWith(".zip") || item.endsWith(".aar") || item.endsWith(".7z")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_zip); |
| | | } else if (item.endsWith(".doc") || item.endsWith(".docx")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_word); |
| | | } else if (item.endsWith(".xls") || item.endsWith(".xlsx")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_excel); |
| | | } else if (item.endsWith(".ppt") || item.endsWith(".pptx")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_ppt); |
| | | } else if (item.endsWith(".txt")) { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_txt); |
| | | } else if (item.endsWith(".jpg") || item.endsWith(".jpeg") || item.endsWith(".png") || item.endsWith(".gif")) { |
| | | if (item.endsWith(".pdf") || item.endsWith(".PDF")) { |
| | | TypedValue icPdf = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icPdf, icPdf, true); |
| | | holder.getBinding().ivImage.setImageResource(icPdf.resourceId); |
| | | } else if (item.endsWith(".zip") || item.endsWith(".ZIP") || item.endsWith(".aar") || item.endsWith(".AAR") || item.endsWith(".7z")) { |
| | | TypedValue icZip = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icZip, icZip, true); |
| | | holder.getBinding().ivImage.setImageResource(icZip.resourceId); |
| | | } else if (item.endsWith(".doc") || item.endsWith(".docx") || item.endsWith(".DOC") || item.endsWith(".DOCX") || item.endsWith(".wps") || item.endsWith(".WPS")) { |
| | | TypedValue icWord = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icWord, icWord, true); |
| | | holder.getBinding().ivImage.setImageResource(icWord.resourceId); |
| | | } else if (item.endsWith(".xls") || item.endsWith(".xlsx") || item.endsWith(".XLS") || item.endsWith(".XLSX")) { |
| | | TypedValue icExcel = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icExcel, icExcel, true); |
| | | holder.getBinding().ivImage.setImageResource(icExcel.resourceId); |
| | | } else if (item.endsWith(".ppt") || item.endsWith(".PPT") || item.endsWith(".pptx") || item.endsWith(".PPTX")) { |
| | | TypedValue icPpt = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icPpt, icPpt, true); |
| | | holder.getBinding().ivImage.setImageResource(icPpt.resourceId); |
| | | } else if (item.endsWith(".txt") || item.endsWith(".TXT")) { |
| | | TypedValue icTxt = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icTxt, icTxt, true); |
| | | holder.getBinding().ivImage.setImageResource(icTxt.resourceId); |
| | | } else if (item.endsWith(".jpg") || item.endsWith(".JPG") || item.endsWith(".jpeg") || item.endsWith(".JPEG") || item.endsWith(".png") || item.endsWith(".PNG") || item.endsWith(".gif") || item.endsWith(".GIF") || item.endsWith(".bmp") || item.endsWith(".BMP")) { |
| | | holder.getBinding().setUrl(item); |
| | | if (isPreview) { |
| | | holder.itemView.setOnClickListener(new View.OnClickListener() { |
| | |
| | | } |
| | | }); |
| | | } |
| | | } else if (item.endsWith(".mp4")) { |
| | | } else if (item.endsWith(".mp4") || item.endsWith(".MP4") ) { |
| | | holder.getBinding().flPlay.setVisibility(View.VISIBLE); |
| | | holder.getBinding().setUrl(item); |
| | | if (isPreview) { |
| | |
| | | }); |
| | | } |
| | | |
| | | } else if (item.endsWith(".mp3") || item.endsWith(".m4a")) { |
| | | } else if (item.endsWith(".mp3") || item.endsWith(".m4a") || item.endsWith(".MP3") || item.endsWith(".M4A")) { |
| | | // holder.getBinding().flPlay.setVisibility(View.VISIBLE); |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_audio); |
| | | TypedValue icAudio = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icAudio, icAudio, true); |
| | | holder.getBinding().ivImage.setImageResource(icAudio.resourceId); |
| | | } else { |
| | | holder.getBinding().ivImage.setImageResource(R.drawable.ic_others); |
| | | TypedValue icOther = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.icOther, icOther, true); |
| | | holder.getBinding().ivImage.setImageResource(icOther.resourceId); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(MyViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | expendMap.put(getItem(position),false); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | expendMap.put(getItem(position),true); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | |
| | | import android.content.Context; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.graphics.Color; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.FrameLayout; |
| | | |
| | |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | |
| | | holder.getBinding().cardView.measure(widthMeasureSpec, heightMeasureSpec); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | |
| | | import com.android.app_base.base.adapter.BaseRVAdapter; |
| | |
| | | @Override |
| | | protected void onBind(BaseViewHolder<ItemPetBinding> holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | if (mDataList.get(position).getOwnData() == 1){ |
| | | holder.getBinding().ivFlower.setVisibility(View.VISIBLE); |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.Transformation; |
| | |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.widget.CompoundButton; |
| | | import android.widget.FrameLayout; |
| | |
| | | @Override |
| | | protected void onBind(ViewHolder holder, int position) { |
| | | holder.getBinding().setBean(mDataList.get(position)); |
| | | //根据主题选择对应卡片背景色 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorFirst, typedValue1, true); |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | mContext.getTheme().resolveAttribute(R.attr.cardBackgroundColorSecond, typedValue2, true); |
| | | if (position % 2 != 0){ |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_blue)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue1.data); |
| | | }else { |
| | | holder.getBinding().cardView.setCardBackgroundColor(mContext.getColor(R.color.color_card_pink)); |
| | | holder.getBinding().cardView.setCardBackgroundColor(typedValue2.data); |
| | | } |
| | | 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(R.drawable.ic_unfold); |
| | | 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(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | holder.getBinding().cardView.post(() -> { |
| | | holder.getBinding().cardView.getLayoutParams().height = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | holder.getBinding().cardView.requestLayout(); |
| | |
| | | int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | int collapsedHeight = holder.getBinding().layoutTitle.getMeasuredHeight(); |
| | | Utils.pullCollapse(holder.getBinding().cardView,initialHeight,collapsedHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_fold); |
| | | holder.getBinding().ivFold.setBackgroundResource(foldIcon.resourceId); |
| | | expendMap.put(getItem(position),false); |
| | | }else{ |
| | | final int initialHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | holder.getBinding().cardView.measure(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); |
| | | int targetHeight = holder.getBinding().cardView.getMeasuredHeight(); |
| | | Utils.dropExpand(holder.getBinding().cardView,initialHeight,targetHeight); |
| | | holder.getBinding().ivFold.setBackgroundResource(R.drawable.ic_unfold); |
| | | holder.getBinding().ivFold.setBackgroundResource(unfoldIcon.resourceId); |
| | | expendMap.put(getItem(position),true); |
| | | } |
| | | } |
| | |
| | | private String publishTime; |
| | | // 是否强制更新 1是 0否 |
| | | private int forceUpdate; |
| | | // MD5 |
| | | private String md5; |
| | | |
| | | public int getVersionCode() { |
| | | return versionCode; |
| | |
| | | public void setForceUpdate(int forceUpdate) { |
| | | this.forceUpdate = forceUpdate; |
| | | } |
| | | |
| | | public String getMd5() { |
| | | return md5; |
| | | } |
| | | |
| | | public void setMd5(String md5) { |
| | | this.md5 = md5; |
| | | } |
| | | } |
| | |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.util.TypedValue; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.hjq.bar.style.CommonBarStyle; |
| | | |
| | |
| | | |
| | | @Override |
| | | public Drawable getTitleBarBackground(Context context) { |
| | | return new ColorDrawable(context.getColor(R.color.color_title_bar_background)); |
| | | //根据当前主题获取不同的背景颜色 |
| | | TypedValue typedValue = new TypedValue(); |
| | | context.getTheme().resolveAttribute(R.attr.titleBarBackgroundColor, typedValue, true); |
| | | return new ColorDrawable(typedValue.data); |
| | | } |
| | | |
| | | @Override |
| | |
| | | * @date 2023.10.15. 22:36 |
| | | * @desc 浏览器界面 |
| | | */ |
| | | public class BrowserActivity extends BaseActivity<ActivityBrowserBinding,SimpleViewModel> { |
| | | public class BrowserActivity extends DLBaseActivity<ActivityBrowserBinding,SimpleViewModel> { |
| | | |
| | | private static final String INTENT_URL = "url"; |
| | | |
| | | private String url; |
| | | private BaseDialog mWaitDialog; |
| | | |
| | | @Override |
| | | protected boolean isDrawerLayoutEnabled() { |
| | | return false; |
| | | } |
| | | |
| | | public static void start(Context context, String url) { |
| | | if (TextUtils.isEmpty(url)) { |
| | |
| | | import android.graphics.Color; |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.os.Bundle; |
| | | import android.util.TypedValue; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.ImageView; |
| | |
| | | import com.application.zhangshi_app_android.ui.function.PrivacyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PropertyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.TourismActivity; |
| | | import com.application.zhangshi_app_android.ui.home.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.home.TreeFragment; |
| | | import com.application.zhangshi_app_android.ui.main.MainActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.OptionPicker; |
| | |
| | | return R.layout.layout_drawer; |
| | | }; |
| | | |
| | | |
| | | @Override |
| | | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| | | |
| | | //设置主题 |
| | | if (UserManager.getInstance().getNightModeState()) { |
| | | setTheme(R.style.AppTheme_Night); |
| | | } else { |
| | | setTheme(R.style.AppTheme_Normal); |
| | | } |
| | | |
| | | super.onCreate(savedInstanceState); |
| | | |
| | | if (mDrawerLayout != null) { |
| | | classMap.put(HomeFragment.class,(LinearLayout) findViewById(R.id.dl_home_root_net)); |
| | | 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(FamilyAssetsActivity.class,(LinearLayout) findViewById(R.id.dl_family_assets)); |
| | | classMap.put(HomeDevicesActivity.class,(LinearLayout) findViewById(R.id.dl_home_devices)); |
| | |
| | | if (linearLayout != null) { |
| | | linearLayout.setOnClickListener(v -> { |
| | | if (set.getKey() != null){ |
| | | if (set.getKey() == HomeFragment.class) { |
| | | MainActivity.start(this, HomeFragment.class); |
| | | if (set.getKey() == TreeFragment.class) { |
| | | MainActivity.start(this, TreeFragment.class); |
| | | }else{ |
| | | if(this.getClass() != set.getKey()){ |
| | | AppManager.getAppManager().startActivity(set.getKey()); |
| | |
| | | } |
| | | TextView textView = (TextView) linearLayout.getChildAt(1); |
| | | ImageView imageView = (ImageView) linearLayout.getChildAt(2); |
| | | textView.setTextColor(Color.parseColor("#FFF6739F")); |
| | | imageView.setBackgroundResource(R.drawable.ic_vector_pink); |
| | | TypedValue textColor = new TypedValue(); |
| | | getTheme().resolveAttribute(R.attr.drawerTextColor, textColor, true); |
| | | textView.setTextColor(textColor.data); |
| | | TypedValue icon = new TypedValue(); |
| | | getTheme().resolveAttribute(R.attr.drawerSelectIcon, icon, true); |
| | | imageView.setBackgroundResource(icon.resourceId); |
| | | } |
| | | |
| | | |
| | |
| | | import android.graphics.Color; |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.os.Bundle; |
| | | import android.util.TypedValue; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | import com.application.zhangshi_app_android.ui.function.PrivacyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.PropertyActivity; |
| | | import com.application.zhangshi_app_android.ui.function.TourismActivity; |
| | | import com.application.zhangshi_app_android.ui.home.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.home.TreeFragment; |
| | | import com.application.zhangshi_app_android.ui.main.MainActivity; |
| | | import com.hjq.bar.TitleBar; |
| | | |
| | |
| | | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { |
| | | super.onViewCreated(view, savedInstanceState); |
| | | if (mDrawerLayout != null) { |
| | | classMap.put(HomeFragment.class,(LinearLayout) findViewById(R.id.dl_home_root_net)); |
| | | 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(FamilyAssetsActivity.class,(LinearLayout) findViewById(R.id.dl_family_assets)); |
| | | classMap.put(HomeDevicesActivity.class,(LinearLayout) findViewById(R.id.dl_home_devices)); |
| | |
| | | if (linearLayout != null) { |
| | | linearLayout.setOnClickListener(v -> { |
| | | if (set.getKey() != null){ |
| | | if (set.getKey() == HomeFragment.class) { |
| | | MainActivity.start(getContext(), HomeFragment.class); |
| | | if (set.getKey() == TreeFragment.class) { |
| | | MainActivity.start(getContext(), TreeFragment.class); |
| | | }else{ |
| | | AppManager.getAppManager().startActivity(set.getKey()); |
| | | } |
| | |
| | | } |
| | | TextView textView = (TextView) linearLayout.getChildAt(1); |
| | | ImageView imageView = (ImageView) linearLayout.getChildAt(2); |
| | | textView.setTextColor(Color.parseColor("#FFF6739F")); |
| | | imageView.setBackgroundResource(R.drawable.ic_vector_pink); |
| | | TypedValue textColor = new TypedValue(); |
| | | getContext().getTheme().resolveAttribute(R.attr.drawerTextColor, textColor, true); |
| | | textView.setTextColor(textColor.data); |
| | | TypedValue icon = new TypedValue(); |
| | | getContext().getTheme().resolveAttribute(R.attr.drawerSelectIcon, icon, true); |
| | | imageView.setBackgroundResource(icon.resourceId); |
| | | } |
| | | |
| | | public void setNameAndAvatar(String name,String avatar){ |
| | |
| | | |
| | | import androidx.annotation.DrawableRes; |
| | | import androidx.constraintlayout.utils.widget.ImageFilterView; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.utils.GlideUtil; |
| | | import com.application.zhangshi_app_android.R; |
| | |
| | | } |
| | | |
| | | public Builder setBigImage(String url) { |
| | | if (url.contains("profile/upload")) {//如果是上传到服务器的图片 |
| | | //只取profile/upload以后的部分 |
| | | url = url.substring(url.indexOf("profile/upload")); |
| | | url = BaseConfig.BASE_URL_DOMAIN + "/" + url; |
| | | } |
| | | GlideUtil.loadImage(url,iv_big_image); |
| | | return this; |
| | | } |
| | |
| | | import android.net.Uri; |
| | | import android.os.Build; |
| | | import android.os.Environment; |
| | | import android.text.TextUtils; |
| | | import android.text.method.ScrollingMovementMethod; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | |
| | | mApkFile = new File(pathname); |
| | | |
| | | if (mApkFile.isFile()) { |
| | | // 下载完毕,安装 Apk |
| | | // 如果有设置MD5,则判断MD5是否一致 |
| | | if (TextUtils.isEmpty(mFileMd5)) { |
| | | // 没有设置MD5,直接安装 |
| | | Utils.installAPK(getContext(),fileName); |
| | | } else { |
| | | // 设置了MD5,判断MD5是否一致 |
| | | String md5 = Utils.calculateMD5(mApkFile); |
| | | if (md5 != null && md5.equalsIgnoreCase(mFileMd5)) { |
| | | // 已下载,直接安装 |
| | | Utils.installAPK(getContext(),fileName); |
| | | } else { |
| | | // 删除旧 Apk |
| | | boolean delete = mApkFile.delete(); |
| | | if (!delete) { |
| | | ToastUtils.showShort("删除旧 Apk 失败,请先手动删除后重试"); |
| | | }else { |
| | | // 重新下载 |
| | | downloadApk(); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // 判断下载状态 |
| | | if (mDownloadComplete) { |
| | | // 下载完毕,安装 Apk |
| | |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.github.gzuliyujiang.wheelpicker.DatePicker; |
| | | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | import io.reactivex.functions.Consumer; |
| | | |
| | | /** |
| | | * @author Ljj |
File was renamed from app/src/main/java/com/application/zhangshi_app_android/ui/function/FunctionFragment.java |
| | |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.view.GestureDetector; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.widget.PopupWindow; |
| | |
| | | import com.application.zhangshi_app_android.databinding.FragmentFunctionBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseFragment; |
| | | import com.application.zhangshi_app_android.ui.dialog.TotalAddDialog; |
| | | import com.application.zhangshi_app_android.ui.home.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.home.TreeFragment; |
| | | import com.application.zhangshi_app_android.ui.main.MainActivity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.03.15. 20:14 |
| | | * @desc 功能 Fragment |
| | | * @desc 首页 Fragment |
| | | */ |
| | | public class FunctionFragment extends DLBaseFragment<FragmentFunctionBinding,FunctionFragmentViewModel> { |
| | | public class HomeFragment extends DLBaseFragment<FragmentFunctionBinding,FunctionFragmentViewModel> { |
| | | |
| | | private PopupWindow mOperatePopupWindow; |
| | | private PopupWindow mAddPopupWindow; |
| | | private ImageCarouselFragment imageCarouselFragment; |
| | | private VideoCarouselFragment videoCarouselFragment; |
| | | |
| | | private FunctionFragment() { |
| | | private HomeFragment() { |
| | | } |
| | | |
| | | public static FunctionFragment newInstance() { |
| | | FunctionFragment fragment = new FunctionFragment(); |
| | | public static HomeFragment newInstance() { |
| | | HomeFragment fragment = new HomeFragment(); |
| | | Bundle args = new Bundle(); |
| | | fragment.setArguments(args); |
| | | return fragment; |
| | |
| | | binding.layoutHomeRootNet.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | MainActivity.start(getSelfActivity(), HomeFragment.class); |
| | | MainActivity.start(getSelfActivity(), TreeFragment.class); |
| | | } |
| | | }); |
| | | binding.layoutFamilyMemorabilia.setOnClickListener(new View.OnClickListener() { |
| | |
| | | |
| | | import androidx.viewpager2.widget.ViewPager2; |
| | | |
| | | import com.android.app_base.base.BaseConfig; |
| | | import com.android.app_base.base.adapter.BaseVp2FragmentAdapter; |
| | | import com.android.app_base.base.view.BaseFragment; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.BannerBean; |
| | | import com.application.zhangshi_app_android.databinding.FragmentVideoCarouselBinding; |
| | | import com.application.zhangshi_app_android.ui.SimpleViewModel; |
| | | import com.application.zhangshi_app_android.ui.home.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.personal_center.PersonalCenterFragment; |
| | | import com.youth.banner.indicator.CircleIndicator; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
File was renamed from app/src/main/java/com/application/zhangshi_app_android/ui/home/HomeFragment.java |
| | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.3.15 |
| | | * @desc 首页 Fragment |
| | | * @desc 家族导图 Fragment |
| | | */ |
| | | public class HomeFragment extends DLBaseFragment<FragmentHomeBinding,HomeFragmentViewModel> { |
| | | public class TreeFragment extends DLBaseFragment<FragmentHomeBinding,HomeFragmentViewModel> { |
| | | private PopupWindow mOperatePopupWindow; |
| | | public HomeFragment() { |
| | | public TreeFragment() { |
| | | } |
| | | |
| | | public static HomeFragment newInstance() { |
| | | HomeFragment fragment = new HomeFragment(); |
| | | public static TreeFragment newInstance() { |
| | | TreeFragment fragment = new TreeFragment(); |
| | | Bundle args = new Bundle(); |
| | | fragment.setArguments(args); |
| | | return fragment; |
| | |
| | | @Override |
| | | public void initView() { |
| | | if (type == 1){ |
| | | binding.tvTitle.setText("张氏APP账号注册"); |
| | | binding.tvTitle.setText("本都都家网账号注册"); |
| | | binding.layoutPasswordAgain.setVisibility(View.VISIBLE); |
| | | binding.layoutWxLogin.setVisibility(View.GONE); |
| | | binding.tvLogin.setText("注册"); |
| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.util.TypedValue; |
| | | import android.view.Menu; |
| | | import android.view.MenuItem; |
| | | import android.view.View; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.fragment.app.Fragment; |
| | |
| | | import androidx.viewpager2.widget.ViewPager2; |
| | | |
| | | import com.android.app_base.base.adapter.BaseVp2FragmentAdapter; |
| | | import com.android.app_base.base.view.BaseActivity; |
| | | import com.android.app_base.base.view.BaseFragment; |
| | | import com.android.app_base.helper.DoubleClickHelper; |
| | | import com.android.app_base.manager.AppManager; |
| | |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceInformationBean; |
| | | import com.application.zhangshi_app_android.bean.UpdateVersionBean; |
| | | import com.application.zhangshi_app_android.databinding.ActivityMainBinding; |
| | | import com.application.zhangshi_app_android.ui.DLBaseActivity; |
| | | import com.application.zhangshi_app_android.ui.dialog.UpdateDialog; |
| | | import com.application.zhangshi_app_android.ui.function.FunctionFragment; |
| | | import com.application.zhangshi_app_android.ui.home.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.function.HomeFragment; |
| | | import com.application.zhangshi_app_android.ui.home.TreeFragment; |
| | | import com.application.zhangshi_app_android.ui.personal_center.PersonalCenterFragment; |
| | | import com.blankj.utilcode.util.AppUtils; |
| | | import com.blankj.utilcode.util.ToastUtils; |
| | | import com.google.android.material.navigation.NavigationBarView; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author Ljj |
| | | * @date 2023.3.15 |
| | | * @desc app主页 |
| | | */ |
| | | public class MainActivity extends BaseActivity<ActivityMainBinding, MainViewModel> { |
| | | public class MainActivity extends DLBaseActivity<ActivityMainBinding, MainViewModel> { |
| | | BaseVp2FragmentAdapter<BaseFragment> mPagerAdapter; |
| | | |
| | | @Override |
| | | protected boolean isDrawerLayoutEnabled() { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public int getLayoutId() { |
| | | return R.layout.activity_main; |
| | |
| | | |
| | | @Override |
| | | public void initParam() { |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void initView() { |
| | | mPagerAdapter = new BaseVp2FragmentAdapter<>(this); |
| | | mPagerAdapter.addFragment(HomeFragment.newInstance()); |
| | | mPagerAdapter.addFragment(FunctionFragment.newInstance()); |
| | | mPagerAdapter.addFragment(TreeFragment.newInstance()); |
| | | mPagerAdapter.addFragment(PersonalCenterFragment.newInstance()); |
| | | binding.mainVp.setAdapter(mPagerAdapter); |
| | | binding.mainVp.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { |
| | |
| | | case R.id.navigation_home: |
| | | binding.mainVp.setCurrentItem(0); |
| | | return true; |
| | | case R.id.navigation_function: |
| | | case R.id.navigation_tree: |
| | | binding.mainVp.setCurrentItem(1); |
| | | return true; |
| | | case R.id.navigation_personal_center: |
| | |
| | | return false; |
| | | } |
| | | }); |
| | | Menu menu = binding.mainBnv.getMenu(); |
| | | // 获取当前主题中的菜单图标资源 |
| | | TypedValue typedValue1 = new TypedValue(); |
| | | getTheme().resolveAttribute(R.attr.menuIconHome, typedValue1, true); |
| | | int icon1ResId = typedValue1.resourceId; |
| | | TypedValue typedValue2 = new TypedValue(); |
| | | getTheme().resolveAttribute(R.attr.menuIconTree, typedValue2, true); |
| | | int icon2ResId = typedValue2.resourceId; |
| | | TypedValue typedValue3 = new TypedValue(); |
| | | getTheme().resolveAttribute(R.attr.menuIconUser, typedValue3, true); |
| | | int icon3ResId = typedValue3.resourceId; |
| | | // 设置菜单项图标 |
| | | menu.findItem(R.id.navigation_home).setIcon(icon1ResId); |
| | | menu.findItem(R.id.navigation_tree).setIcon(icon2ResId); |
| | | menu.findItem(R.id.navigation_personal_center).setIcon(icon3ResId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .setUpdateLog(updateVersionBean.getContent()) |
| | | // 下载 URL |
| | | .setDownloadUrl(updateVersionBean.getAppUrl()) |
| | | // 文件 MD5 |
| | | .setFileMd5(updateVersionBean.getMd5()) |
| | | .show(); |
| | | } |
| | | } |
| | |
| | | private static final String INTENT_KEY_IN_FRAGMENT_CLASS = "fragmentClass"; |
| | | |
| | | public static void start(Context context) { |
| | | start(context, HomeFragment.class); |
| | | start(context, TreeFragment.class); |
| | | } |
| | | |
| | | public static void start(Context context, Class<? extends Fragment> fragmentClass) { |
| | |
| | | * @desc |
| | | */ |
| | | public class MainViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<UpdateVersionBean> updateVersionBeanLiveData = new MutableLiveData<>(); |
| | | private MutableLiveData<GrowthExperienceInformationBean> infoLiveData;//个人信息 |
| | | |
| | |
| | | package com.application.zhangshi_app_android.ui.personal_center; |
| | | |
| | | import android.content.ComponentName; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.graphics.Bitmap; |
| | |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | import com.android.app_base.base.dialog.BaseDialog; |
| | | import com.android.app_base.base.dialog.TipsDialog; |
| | | import com.android.app_base.base.dialog.UIDialog; |
| | | import com.android.app_base.base.dialog.WaitDialog; |
| | | import com.android.app_base.base.view.BaseFragment; |
| | |
| | | import com.android.app_base.utils.Utils; |
| | | import com.android.app_base.utils.rxbus.MessageEvent; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.android.app_base.widget.SwitchButton; |
| | | import com.application.zhangshi_app_android.BR; |
| | | import com.application.zhangshi_app_android.R; |
| | | import com.application.zhangshi_app_android.bean.AnnualHealthStatusBean; |
| | |
| | | import com.application.zhangshi_app_android.ui.dialog.PetOwnerInfoDialog; |
| | | import com.application.zhangshi_app_android.ui.function.PetMemoActivity; |
| | | import com.application.zhangshi_app_android.ui.login.LoginActivity; |
| | | import com.application.zhangshi_app_android.ui.main.MainActivity; |
| | | import com.bumptech.glide.Glide; |
| | | import com.bumptech.glide.request.target.CustomTarget; |
| | | import com.bumptech.glide.request.transition.Transition; |
| | |
| | | public class PersonalCenterFragment extends DLBaseFragment<FragmentPersonalCenterBinding,PersonalCenterFragmentViewModel> { |
| | | private PopupWindow popupWindow; |
| | | private BaseDialog mWaitDialog; |
| | | |
| | | |
| | | public PersonalCenterFragment() { |
| | | } |
| | |
| | | |
| | | } |
| | | }); |
| | | binding.ivTakePhoto.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | PictureSelector.create(getSelfActivity()) |
| | | .openGallery(SelectMimeType.ofImage()) |
| | | .setImageEngine(GlideEngine.createGlideEngine()) |
| | | .setCropEngine(new ImageFileCropEngine())// 设置裁剪引擎 |
| | | .isMaxSelectEnabledMask(true)// 达到最大选择数是否开启禁选蒙层 |
| | | .setMaxSelectNum(1) |
| | | .forResult(new OnResultCallbackListener<LocalMedia>() { |
| | | @Override |
| | | public void onResult(ArrayList<LocalMedia> result) { |
| | | if (result.size() == 0) return; |
| | | for (LocalMedia media : result) { |
| | | if (media.isCut()){ |
| | | viewModel.updateInfo(media.getCutPath()); |
| | | }else { |
| | | viewModel.updateInfo(media.getRealPath()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | binding.ivHead.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | binding.switchBtn.setChecked(UserManager.getInstance().getNightModeState()); |
| | | binding.switchBtn.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() { |
| | | @Override |
| | | public void onCheckedChanged(SwitchButton button, boolean checked) { |
| | | if (checked == UserManager.getInstance().getNightModeState()) return; |
| | | new UIDialog.Builder(getContext()) |
| | | .setTitle("提示") |
| | | .setContent("切换模式需要重启应用才能生效,是否重启?") |
| | | .setConfirm("确定") |
| | | .setCancel("取消") |
| | | .setListener(new UIDialog.OnListener() { |
| | | @Override |
| | | public void onConfirm(BaseDialog dialog) { |
| | | UserManager.getInstance().saveNightModeState(checked); |
| | | AppManager.getAppManager().restartApp(getContext()); |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel(BaseDialog dialog) { |
| | | UIDialog.OnListener.super.onCancel(dialog); |
| | | binding.switchBtn.setChecked(!checked); |
| | | } |
| | | }) |
| | | .setCancelable(false) |
| | | .show(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import androidx.databinding.DataBindingUtil; |
| | | |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.GlideUtil; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | import com.application.zhangshi_app_android.R; |
| | |
| | | //获取字体 |
| | | Typeface typeface = ResourcesCompat.getFont(context, com.android.app_base.R.font.roboto_regular); |
| | | binding.tvName.setTypeface(typeface); |
| | | |
| | | } |
| | | // 使用databinding无法测量view的带内容的准确宽高,所以这里手动设置一下 |
| | | binding.tvGeneration.setText(bean.getIdentity()+""); |
| | | if (bean.getNickName().equals(UserManager.getInstance().getUserName())){ |
| | | binding.cvContainer.setCardBackgroundColor(Color.parseColor("#FFCEE4FD")); |
| | | binding.ivMyself.setVisibility(View.VISIBLE); |
| | | } |
| | | } |
| | | familyMemberView.measure(View.MeasureSpec.makeMeasureSpec((1 << 30) - 1, View.MeasureSpec.AT_MOST), |
| | | View.MeasureSpec.makeMeasureSpec((1 << 30) - 1, View.MeasureSpec.AT_MOST)); |
New file |
| | |
| | | <vector xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:width="33dp" |
| | | android:height="25dp" |
| | | android:viewportWidth="33" |
| | | android:viewportHeight="25"> |
| | | <path |
| | | android:pathData="M22.661,9.828C25.371,9.828 27.575,7.624 27.575,4.914C27.575,2.204 25.371,0 22.661,0C19.951,0 17.747,2.204 17.747,4.914C17.747,7.624 19.951,9.828 22.661,9.828ZM22.661,2.313C24.095,2.313 25.262,3.48 25.262,4.914C25.262,6.349 24.095,7.516 22.661,7.516C21.226,7.516 20.059,6.349 20.059,4.914C20.059,3.48 21.226,2.313 22.661,2.313ZM10.238,10.009C12.948,10.009 15.152,7.805 15.152,5.095C15.152,2.385 12.948,0.181 10.238,0.181C7.528,0.181 5.324,2.385 5.324,5.095C5.324,7.805 7.528,10.009 10.238,10.009ZM10.238,2.493C11.673,2.493 12.84,3.66 12.84,5.095C12.84,6.529 11.673,7.696 10.238,7.696C8.804,7.696 7.637,6.529 7.637,5.095C7.637,3.66 8.804,2.493 10.238,2.493ZM31.528,20.972C32.167,20.972 32.684,20.455 32.684,19.815C32.684,17.152 31.647,14.648 29.764,12.766C27.882,10.883 25.378,9.846 22.715,9.846C21.165,9.846 19.68,10.193 18.299,10.876C17.729,11.158 17.494,11.852 17.775,12.426C18.057,13.001 18.751,13.232 19.326,12.95C20.384,12.426 21.526,12.159 22.715,12.159C26.935,12.159 30.371,15.595 30.371,19.815C30.371,20.455 30.888,20.972 31.528,20.972ZM1.48,21.152C2.119,21.152 2.636,20.635 2.636,19.996C2.636,15.776 6.072,12.339 10.292,12.339C11.481,12.339 12.616,12.603 13.671,13.123C14.245,13.405 14.936,13.17 15.221,12.599C15.503,12.025 15.268,11.335 14.697,11.049C13.32,10.37 11.839,10.027 10.296,10.027C7.633,10.027 5.129,11.064 3.247,12.946C1.364,14.829 0.327,17.333 0.327,19.996C0.323,20.635 0.84,21.152 1.48,21.152Z" |
| | | android:fillColor="#F6739F"/> |
| | | <path |
| | | android:pathData="M16.536,16.39C18.505,16.39 20.11,14.785 20.11,12.816C20.11,10.847 18.505,9.243 16.536,9.243C14.567,9.243 12.963,10.847 12.963,12.816C12.963,14.785 14.567,16.39 16.536,16.39ZM16.536,11.555C17.23,11.555 17.797,12.123 17.797,12.816C17.797,13.51 17.23,14.077 16.536,14.077C15.842,14.077 15.275,13.51 15.275,12.816C15.275,12.123 15.842,11.555 16.536,11.555ZM10.932,24.332C11.571,24.332 12.088,23.815 12.088,23.176C12.088,20.722 14.083,18.728 16.536,18.728C18.99,18.728 20.984,20.722 20.984,23.176C20.984,23.815 21.501,24.332 22.14,24.332C22.78,24.332 23.297,23.815 23.297,23.176C23.297,19.447 20.265,16.415 16.536,16.415C12.807,16.415 9.776,19.447 9.776,23.176C9.776,23.815 10.292,24.332 10.932,24.332Z" |
| | | android:fillColor="#F6739F"/> |
| | | </vector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <!-- 按压状态 --> |
| | | <item android:drawable="@drawable/ic_function_selected" android:state_checked="true" /> |
| | | |
| | | <!-- 默认状态 --> |
| | | <item android:drawable="@drawable/ic_function_default" /> |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <!-- 按压状态 --> |
| | | <item android:drawable="@drawable/ic_home_selected_night" android:state_checked="true" /> |
| | | |
| | | <!-- 默认状态 --> |
| | | <item android:drawable="@drawable/ic_home_default" /> |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <!-- 按压状态 --> |
| | | <item android:drawable="@drawable/ic_personal_center_selected_night" android:state_checked="true" /> |
| | | |
| | | <!-- 默认状态 --> |
| | | <item android:drawable="@drawable/ic_personal_center_default" /> |
| | | </selector> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <!-- 选中状态 --> |
| | | <item android:color="@color/color_FFF08EBA_text_pink" android:state_checked="true" /> |
| | | <item android:color="?attr/text_color_main" android:state_checked="true" /> |
| | | <!-- <item android:drawable="@drawable/yw_action_shape" android:state_checked="true" />--> |
| | | |
| | | <!-- 默认状态 --> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <!-- 按压状态 --> |
| | | <item android:drawable="@drawable/ic_tree_selected" android:state_checked="true" /> |
| | | |
| | | <!-- 默认状态 --> |
| | | <item android:drawable="@drawable/ic_tree_default" /> |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android" > |
| | | <item |
| | | android:state_checked="true" |
| | | android:drawable="@drawable/ic_checked_night" /> |
| | | <item |
| | | android:state_checked="false" |
| | | android:drawable="@drawable/ic_unchecked" /> |
| | | <item |
| | | android:drawable="@drawable/ic_unchecked" /><!-- The default one --> |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <gradient |
| | | android:startColor="#4DAAD3FF" |
| | | android:centerColor="#734EBDFF" |
| | | android:endColor="#8C00AAFF" |
| | | android:angle="270" |
| | | /> |
| | | <corners |
| | | android:radius="10dp" |
| | | /> |
| | | </shape> |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/title_bar" |
| | |
| | | android:id="@+id/parentLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | android:orientation="vertical" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:id="@+id/parentLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | android:orientation="vertical" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:id="@+id/parentLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | android:orientation="vertical" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:id="@+id/parentLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | android:orientation="vertical" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | tools:context=".ui.function.FamilyMemorabiliaDetailActivity" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".ui.function.FamilyMemorabiliaActivity" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | android:orientation="vertical" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:id="@+id/rv_relationship" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | tools:itemCount="3" |
| | | tools:listitem="@layout/item_growth_experience_relationship" /> |
| | | </LinearLayout> |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:layout_width="match_parent" |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:paddingHorizontal="30dp" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerInParent="true" |
| | | android:background="@drawable/bg_login_zhang" |
| | | app:imageUrl="@{viewModel.selectLoginBackgroundLiveData}" |
| | | android:scaleType="centerCrop" |
| | | /> |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerHorizontal="true" |
| | | android:layout_marginTop="15dp" |
| | | android:text="欢迎来到张氏APP" |
| | | android:text="欢迎来到本都都家网" |
| | | android:textColor="@color/black" |
| | | android:textSize="20sp" |
| | | android:textStyle="bold" /> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | |
| | | |
| | | |
| | | <androidx.viewpager2.widget.ViewPager2 |
| | | android:id="@+id/main_vp" |
| | | android:layout_width="match_parent" |
| | |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:background="@color/white" |
| | | android:background="?attr/bottomNavigationViewBackgroundColor" |
| | | app:itemBackground="@null" |
| | | app:itemIconTint="@null" |
| | | app:itemTextAppearanceActive="@style/bottom_navigation_title_active" |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | android:orientation="vertical" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | android:orientation="vertical" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:id="@+id/titleBar" |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".ui.function.FamilyMemorabiliaActivity" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/detailPageBackgroundColor" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | <ImageView |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:src="@drawable/function_notes" |
| | | android:src="@drawable/ic_function_notes" |
| | | android:layout_gravity="center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | <ImageView |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:src="@drawable/function_home_devices" |
| | | android:src="@drawable/ic_function_home_devices" |
| | | android:layout_gravity="center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | <ImageView |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:src="@drawable/function_little_doctor" |
| | | android:src="@drawable/ic_function_little_doctor" |
| | | android:layout_gravity="center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | <ImageView |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:src="@drawable/function_cleaning" |
| | | android:src="@drawable/ic_function_cleaning" |
| | | android:layout_gravity="center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | <ImageView |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:src="@drawable/function_income_expense" |
| | | android:src="@drawable/ic_function_income_expense" |
| | | android:layout_gravity="center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | <ImageView |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:src="@drawable/function_health" |
| | | android:src="@drawable/ic_function_health" |
| | | android:layout_gravity="center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | <ImageView |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:src="@drawable/function_tour" |
| | | android:src="@drawable/ic_function_tour" |
| | | android:layout_gravity="center_vertical" /> |
| | | |
| | | <TextView |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | android:orientation="vertical" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | |
| | | android:id="@+id/layout_frame" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/color_card_pink" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | <ImageView |
| | | android:id="@+id/iv_banner" |
| | |
| | | android:id="@+id/tv_core_module" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="@dimen/dp_20" |
| | | android:layout_marginTop="@dimen/dp_20" |
| | | android:layout_marginStart="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:text="核心模块" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_18" |
| | | android:textStyle="bold" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_home_root_net" |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_family_root_net" /> |
| | | android:background="?attr/icFunctionFamilyRootNet" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/function_notes" /> |
| | | android:background="?attr/icFunctionNotes" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_asset" /> |
| | | android:background="?attr/icFunctionAsset" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_honor" /> |
| | | android:background="?attr/icFunctionHonor" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_little_doctor" |
| | | android:background="?attr/icFunctionLittleDoctor" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_cleaning" |
| | | android:background="?attr/icFunctionCleaning" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_mail_list" /> |
| | | android:background="?attr/icFunctionMailList" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_pamper_pet" /> |
| | | android:background="?attr/icFunctionPamperPet" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_income_expense" /> |
| | | android:background="?attr/icFunctionIncomeExpense" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/function_home_devices" /> |
| | | android:background="?attr/icFunctionHomeDevices" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_growth" /> |
| | | android:background="?attr/icFunctionGrowth" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_marriage" /> |
| | | android:background="?attr/icFunctionMarriage" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_property"/> |
| | | android:background="?attr/icFunctionProperty" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_wish"/> |
| | | android:background="?attr/icFunctionWish" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_tour" /> |
| | | android:background="?attr/icFunctionTour" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_health" /> |
| | | android:background="?attr/icFunctionHealth" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_honor" /> |
| | | android:background="?attr/icFunctionCertificate" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:background="@drawable/function_privacy" /> |
| | | android:background="?attr/icFunctionPrivacy" |
| | | /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | </FrameLayout> |
| | | </com.android.app_base.widget.ExtendTitleBar> |
| | | |
| | | <com.otaliastudios.zoom.ZoomLayout |
| | | android:id="@+id/zoomLayout" |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | <ImageView |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | android:src="@drawable/bg_login_zhang" |
| | | android:scaleType="fitCenter" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | /> |
| | | |
| | | <com.otaliastudios.zoom.ZoomLayout |
| | | android:id="@+id/zoomLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:scrollbars="vertical|horizontal" |
| | | app:transformation="centerInside" |
| | | app:transformationGravity="auto" |
| | |
| | | app:maxZoomType="realZoom" |
| | | app:animationDuration="280" |
| | | app:hasClickableChildren="true" |
| | | android:background="@color/color_normal_background" |
| | | > |
| | | |
| | | <com.application.zhangshi_app_android.widget.HomeMindMapLayout |
| | | android:id="@+id/scrollHomeMindMapLayout" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | |
| | | </com.otaliastudios.zoom.ZoomLayout> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </LinearLayout> |
| | | </layout> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/color_normal_background" |
| | | android:background="?attr/pageBackgroundColor" |
| | | > |
| | | <com.android.app_base.widget.ExtendTitleBar |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:title="个人中心" |
| | | app:title="我的" |
| | | app:titleGravity="left" |
| | | android:elevation="5dp" |
| | | > |
| | |
| | | app:layout_constraintWidth_percent="0.3" |
| | | app:roundPercent="1" |
| | | app:imageUrl="@{viewModel.infoLiveData.img}" |
| | | android:scaleType="centerCrop" |
| | | /> |
| | | <ImageView |
| | | android:id="@+id/iv_take_photo" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_camera" |
| | |
| | | android:layout_height="1dp" |
| | | android:background="#33000000" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:paddingVertical="12dp" |
| | | android:paddingHorizontal="10dp" |
| | | android:gravity="center_vertical" |
| | | > |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_weight="1" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="18sp" |
| | | android:textColor="#FF212121" |
| | | android:text="护眼模式" |
| | | /> |
| | | <com.android.app_base.widget.SwitchButton |
| | | android:id="@+id/switchBtn" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | <TextView |
| | | android:id="@+id/tv_login_out" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_margin="2dp" |
| | | tools:layout_height="wrap_content" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | <androidx.constraintlayout.utils.widget.ImageFilterView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#73fab4cd" |
| | | android:background="?attr/electronicFileAddBackgroundColor" |
| | | app:round="10dp" |
| | | /> |
| | | <androidx.constraintlayout.utils.widget.ImageFilterView |
| | |
| | | android:layout_gravity="top|start" |
| | | /> |
| | | </FrameLayout> |
| | | <FrameLayout |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/fl_add" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintDimensionRatio="1:1" |
| | | android:layout_margin="7dp" |
| | | app:layout_constraintDimensionRatio="1:1" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:background="@drawable/shape_73fab4cd_solid" |
| | | |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | app:cardBackgroundColor="?attr/electronicFileAddBackgroundColor" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | |
| | | android:background="@drawable/ic_import_add" |
| | | android:layout_gravity="center" |
| | | /> |
| | | </FrameLayout> |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </layout> |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | tools:layout_height="wrap_content" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | </data> |
| | | |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/cv_container" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardCornerRadius="10dp" |
| | |
| | | app:cardBackgroundColor="@color/white" |
| | | android:layout_margin="1dp"> |
| | | |
| | | <androidx.constraintlayout.utils.widget.ImageFilterView |
| | | android:id="@+id/iv_myself" |
| | | android:layout_width="18dp" |
| | | android:layout_height="18dp" |
| | | android:layout_gravity="center_vertical" |
| | | android:layout_marginHorizontal="2dp" |
| | | android:background="@drawable/ic_myself" |
| | | app:roundPercent="1" |
| | | android:elevation="10dp" |
| | | android:visibility="gone" |
| | | tools:visibility="visible" |
| | | /> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginHorizontal="10dp" |
| | | android:layout_marginEnd="20dp" |
| | | android:layout_marginStart="20dp" |
| | | android:layout_marginVertical="5dp" |
| | | android:orientation="horizontal" |
| | | android:gravity="center" |
| | |
| | | android:textColor="#FFEBA4AA" |
| | | android:gravity="center" |
| | | android:maxLines="1" |
| | | tools:text="100" |
| | | tools:text="2" |
| | | |
| | | /> |
| | | |
| | | <!-- 头像 --> |
| | |
| | | android:id="@+id/iv_avatar" |
| | | android:layout_width="30dp" |
| | | android:layout_height="30dp" |
| | | android:layout_marginStart="8dp" |
| | | android:layout_marginStart="5dp" |
| | | android:layout_marginEnd="10dp" |
| | | android:scaleType="fitCenter" |
| | | app:roundPercent="1" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | tools:layout_height="wrap_content" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | app:cardElevation="0dp" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | tools:layout_height="wrap_content" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:background="@drawable/ic_flower" |
| | | android:background="?attr/icIsOwnFamilyDataFlower" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_margin="@dimen/dp_2" |
| | | tools:layout_height="wrap_content" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | tools:layout_height="wrap_content" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_height="40dp" |
| | | android:layout_margin="@dimen/dp_2" |
| | | app:cardCornerRadius="@dimen/dp_10" |
| | | app:cardBackgroundColor="@color/color_card_pink" |
| | | app:cardBackgroundColor="?attr/cardBackgroundColorFirst" |
| | | tools:layout_height="wrap_content" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:layout_height="18dp" |
| | | android:layout_marginStart="3dp" |
| | | android:layout_centerVertical="true" |
| | | android:button="@drawable/selector_checkbox" |
| | | android:button="?attr/checkboxSelector" |
| | | android:background="?selectableItemBackgroundBorderless" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_width="211dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_gravity="start" |
| | | android:background="@color/color_card_pink" |
| | | android:background="?attr/drawerBackgroundColor" |
| | | android:paddingTop="25dp" |
| | | > |
| | | <LinearLayout |
| | |
| | | android:id="@+id/dl_home_user_avatar" |
| | | android:layout_width="50dp" |
| | | android:layout_height="50dp" |
| | | android:scaleType="centerCrop" |
| | | app:roundPercent="1" |
| | | /> |
| | | <TextView |
| | |
| | | </LinearLayout> |
| | | <androidx.cardview.widget.CardView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="304dp" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="@color/white" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginBottom="8dp" |
| | | /> |
| | | <View |
| | | 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="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_family_root_net" |
| | | android:layout_width="13dp" |
| | | android:layout_height="10dp" |
| | | android:background="?attr/icFunctionFamilyRootNet" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_notes" |
| | | android:layout_width="13dp" |
| | | android:layout_height="15dp" |
| | | android:background="?attr/icFunctionNotes" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_asset" |
| | | android:layout_width="13dp" |
| | | android:layout_height="14dp" |
| | | android:background="?attr/icFunctionAsset" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_home_devices" |
| | | android:layout_width="13dp" |
| | | android:layout_height="13dp" |
| | | android:background="?attr/icFunctionHomeDevices" |
| | | /> |
| | | |
| | | <TextView |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_honor" |
| | | android:layout_width="13dp" |
| | | android:layout_height="12dp" |
| | | android:background="?attr/icFunctionHonor" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_little_doctor" |
| | | android:layout_width="13dp" |
| | | android:layout_height="15dp" |
| | | android:background="?attr/icFunctionLittleDoctor" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_cleaning" |
| | | android:layout_width="13dp" |
| | | android:layout_height="15dp" |
| | | android:background="?attr/icFunctionCleaning" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_mail_list" |
| | | android:layout_width="13dp" |
| | | android:layout_height="14dp" |
| | | android:background="?attr/icFunctionMailList" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_pet" |
| | | android:layout_width="13dp" |
| | | android:layout_height="10dp" |
| | | android:background="?attr/icFunctionPamperPet" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_income_expense" |
| | | android:layout_width="13dp" |
| | | android:layout_height="15dp" |
| | | android:background="?attr/icFunctionIncomeExpense" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | </androidx.cardview.widget.CardView> |
| | | <androidx.cardview.widget.CardView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="240dp" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="@color/white" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:paddingVertical="8dp" |
| | | > |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | android:text="个人板块" |
| | | android:textColor="@color/black" |
| | | android:textSize="12sp" |
| | | android:layout_marginVertical="8dp" |
| | | android:layout_marginBottom="8dp" |
| | | android:layout_marginStart="14dp" |
| | | /> |
| | | <View |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_growth" |
| | | android:layout_width="13dp" |
| | | android:layout_height="16dp" |
| | | android:background="?attr/icFunctionGrowth" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_marriage" |
| | | android:layout_width="13dp" |
| | | android:layout_height="13dp" |
| | | android:background="?attr/icFunctionMarriage" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_property" |
| | | android:layout_width="13dp" |
| | | android:layout_height="16dp" |
| | | android:background="?attr/icFunctionProperty" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_wish" |
| | | android:layout_width="13dp" |
| | | android:layout_height="13dp" |
| | | android:background="?attr/icFunctionWish" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_tour" |
| | | android:layout_width="13dp" |
| | | android:layout_height="13dp" |
| | | android:background="?attr/icFunctionTour" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_health" /> |
| | | android:layout_width="13dp" |
| | | android:layout_height="12dp" |
| | | android:background="?attr/icFunctionHealth" /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_certificate" |
| | | android:layout_width="13dp" |
| | | android:layout_height="14dp" |
| | | android:background="?attr/icFunctionCertificate" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:paddingHorizontal="15dp" |
| | | android:layout_marginVertical="3dp" |
| | | android:gravity="center" |
| | | > |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_privacy" |
| | | android:layout_width="13dp" |
| | | android:layout_height="15dp" |
| | | android:background="?attr/icFunctionPrivacy" |
| | | /> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:layout_height="wrap_content" |
| | | android:text="删除" |
| | | android:gravity="center" |
| | | android:textColor="#FF333333" |
| | | android:textColor="#FFE86F72" |
| | | android:textSize="12sp" |
| | | app:drawableStartCompat="@drawable/ic_delete" |
| | | android:drawablePadding="5dp" |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | android:orientation="vertical" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardBackgroundColor="#FFFAD1E0" |
| | | app:cardBackgroundColor="?attr/popupWindowBackgroundColor" |
| | | app:cardCornerRadius="10dp" |
| | | app:cardElevation="0dp" |
| | | > |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <menu xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <menu xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <item |
| | | android:id="@+id/navigation_home" |
| | | android:icon="@drawable/selector_bottom_navigation_home" |
| | | android:title="@string/title_home" /> |
| | | |
| | | android:title="@string/title_home" |
| | | /> |
| | | <item |
| | | android:id="@+id/navigation_function" |
| | | android:icon="@drawable/selector_bottom_navigation_function" |
| | | android:title="@string/title_function" /> |
| | | android:id="@+id/navigation_tree" |
| | | android:icon="@drawable/selector_bottom_navigation_tree" |
| | | android:title="@string/title_tree" |
| | | /> |
| | | |
| | | <item |
| | | android:id="@+id/navigation_personal_center" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <resources> |
| | | <declare-styleable name="AppTheme"> |
| | | <attr name="pageBackgroundColor" format="reference|color" /> |
| | | <attr name="detailPageBackgroundColor" format="reference|color" /> |
| | | <attr name="titleBarBackgroundColor" format="reference|color" /> |
| | | <attr name="bottomNavigationViewBackgroundColor" format="reference|color" /> |
| | | <attr name="text_color_main" format="reference|color" /> |
| | | <attr name="menuIconHome" format="reference" /> |
| | | <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="icFunctionHonor" format="reference" /> |
| | | <attr name="icFunctionLittleDoctor" format="reference" /> |
| | | <attr name="icFunctionCleaning" format="reference" /> |
| | | <attr name="icFunctionMailList" format="reference" /> |
| | | <attr name="icFunctionPamperPet" format="reference" /> |
| | | <attr name="icFunctionIncomeExpense" format="reference" /> |
| | | <attr name="icFunctionHomeDevices" format="reference" /> |
| | | <attr name="icFunctionGrowth" format="reference" /> |
| | | <attr name="icFunctionMarriage" format="reference" /> |
| | | <attr name="icFunctionProperty" format="reference" /> |
| | | <attr name="icFunctionWish" format="reference" /> |
| | | <attr name="icFunctionTour" format="reference" /> |
| | | <attr name="icFunctionHealth" format="reference" /> |
| | | <attr name="icFunctionCertificate" format="reference" /> |
| | | <attr name="icFunctionPrivacy" format="reference" /> |
| | | |
| | | <attr name="cardBackgroundColorFirst" format="reference|color"/> |
| | | <attr name="cardBackgroundColorSecond" format="reference|color"/> |
| | | |
| | | <attr name="drawerBackgroundColor" format="reference|color" /> |
| | | <attr name="drawerTextColor" format="reference|color" /> |
| | | <attr name="drawerSelectIcon" format="reference" /> |
| | | |
| | | <attr name="icIsOwnFamilyDataFlower" format="reference" /> |
| | | |
| | | <attr name="icUnfold" format="reference"/> |
| | | <attr name="icFold" format="reference"/> |
| | | |
| | | <attr name="popupWindowBackgroundColor" format="reference|color" /> |
| | | |
| | | <attr name="electronicFileAddBackgroundColor" format="reference|color" />" |
| | | |
| | | <attr name="icPdf" format="reference" /> |
| | | <attr name="icWord" format="reference" /> |
| | | <attr name="icExcel" format="reference" /> |
| | | <attr name="icPpt" format="reference" /> |
| | | <attr name="icTxt" format="reference" /> |
| | | <attr name="icOther" format="reference" /> |
| | | <attr name="icZip" format="reference" /> |
| | | <attr name="icVideo" format="reference" /> |
| | | <attr name="icAudio" format="reference" /> |
| | | <attr name="icImage" format="reference" /> |
| | | |
| | | <attr name="checkboxSelector" format="reference" /> |
| | | </declare-styleable> |
| | | </resources> |
| | |
| | | <color name="white">#FFFFFFFF</color> |
| | | |
| | | <!-- App 样式中引用的颜色 --> |
| | | <color name="colorPrimary">@color/color_main</color> |
| | | <color name="colorPrimary">#FFF08EBA</color> |
| | | <color name="colorPrimaryDark">@color/black</color> |
| | | <color name="colorAccent">#FFF08EBA</color> |
| | | <color name="windowBackground">#F4F4F4</color> |
| | | |
| | | |
| | | <color name="transparent">#00000000</color> |
| | | <color name="color_main">#FFF08EBA</color> |
| | | |
| | | <color name="color_normal_main">#FFF08EBA</color> |
| | | <color name="color_night_main">#FF61B15A</color> |
| | | |
| | | <color name="color_normal_background">#FFFEF7FC</color> |
| | | <color name="color_title_bar_background">#FFF08EBA</color> |
| | | <color name="color_night_background">#FFADCE74</color> |
| | | |
| | | <color name="color_normal_detail_page_background">#FFFEF7FC</color> |
| | | <color name="color_night_detail_page_background">#B3ADCE74</color> |
| | | |
| | | <color name="color_normal_title_bar_background">#FFF08EBA</color> |
| | | <color name="color_night_title_bar_background">#FF61B15A</color> |
| | | |
| | | <color name="color_normal_bottom_navigation_view_background">#FFFFFFFF</color> |
| | | <color name="color_night_bottom_navigation_view_background">#FFFFFFE8</color> |
| | | |
| | | <color name="color_FFF08EBA_text_pink">#FFF08EBA</color> |
| | | <color name="color_FF4E9F3D_text_green">#FF4E9F3D</color> |
| | | |
| | | <color name="color_FF666666_text_default">#FF666666</color> |
| | | |
| | | <color name="color_card_pink">#FFFFE2EF</color> |
| | | <color name="color_card_yellow">#FFFFF76A</color> |
| | | |
| | | <color name="color_card_blue">#FFE0EEFE</color> |
| | | <color name="color_card_orange">#FFFFCE89</color> |
| | | |
| | | <color name="color_card_green">#FFEBFFF2</color> |
| | | |
| | | <color name="color_normal_drawer_bg">#FFFFE2EF</color> |
| | | <color name="color_night_drawer_bg">#FFADCE74</color> |
| | | |
| | | <color name="color_normal_drawer_text_color">#FFF6739F</color> |
| | | <color name="color_night_drawer_text_color">#FF004225</color> |
| | | |
| | | <color name="color_normal_popup_window_bg">#FFFAD1E0</color> |
| | | <color name="color_night_popup_window_bg">#FFBEE181</color> |
| | | |
| | | <color name="color_normal_electronic_file_add_bg">#73FAB4CD</color>" |
| | | <color name="color_night_electronic_file_add_bg">#FFADCE74</color> |
| | | |
| | | <color name="color_shadow">#88666666</color> |
| | | <color name="color_non_editable">#AAf5f7fa</color> |
| | | </resources> |
| | |
| | | <string name="app_name">本都都家网</string> |
| | | |
| | | <string name="title_home">首页</string> |
| | | <string name="title_tree">家图</string> |
| | | <string name="title_function">功能</string> |
| | | <string name="title_family_memorabilia">家大事记</string> |
| | | <string name="title_personal_center">个人中心</string> |
| | | <string name="title_personal_center">我的</string> |
| | | <string name="title_family_create_project">张氏app立项</string> |
| | | <string name="iv_fold_1_description">这是一个展开控件</string> |
| | | <!-- TODO: Remove or change this placeholder text --> |
| | |
| | | |
| | | <!--主页底部导航栏选中文字样式 --> |
| | | <style name="bottom_navigation_title_active"> |
| | | <item name="android:textSize">@dimen/sp_14</item> |
| | | <item name="android:textColor">@color/color_FFF08EBA_text_pink</item> |
| | | <item name="android:textSize">14sp</item> |
| | | <item name="android:textColor">?attr/text_color_main</item> |
| | | </style> |
| | | |
| | | <!--主页底部导航栏没有选中文字样式,导航默认的字体大小就是12sp--> |
| | |
| | | <!-- Customize your theme here. --> |
| | | </style> |
| | | |
| | | <style name="Theme.app" parent="Theme.AppCompat.DayNight.NoActionBar"> |
| | | <!-- 正常主题 --> |
| | | <style name="AppTheme.Normal" parent="Theme.AppCompat.DayNight.NoActionBar"> |
| | | <!-- 全局字体 --> |
| | | <item name="android:fontFamily">@font/roboto_regular</item> |
| | | <!-- 窗口背景颜色 --> |
| | | <item name="android:windowBackground">@color/windowBackground</item> |
| | | <!-- 应用的主要色调,ActionBar Toolbar 默认使用该颜色 --> |
| | | <item name="colorPrimary">@color/colorPrimary</item> |
| | | <item name="colorPrimary">@color/color_normal_main</item> |
| | | <!-- 应用的主要暗色调,状态栏默认使用该颜色 --> |
| | | <item name="colorPrimaryDark">@color/colorPrimaryDark</item> |
| | | <!-- 应用的强调色,CheckBox RadioButton Switch 等一般控件的选中效果默认采用该颜色 --> |
| | |
| | | <item name="windowActionModeOverlay">true</item> |
| | | <item name="android:windowContentOverlay">@null</item> |
| | | <!-- ActionMode 的颜色 --> |
| | | <item name="actionModeBackground">@color/colorPrimary</item> |
| | | <item name="actionModeBackground">@color/color_normal_main</item> |
| | | <!-- 解决 Android 5.1 及以上版本 Button 英文字符串自动变大写的问题 --> |
| | | <item name="android:textAllCaps">false</item> |
| | | <!-- 默认隐藏输入法,开启这个选项后会导致输入对话框在关闭之后不能关闭软键盘 --> |
| | |
| | | <!-- 关闭 RecyclerView ScrollView ViewPager 水波纹效果 --> |
| | | <item name="android:overScrollMode">never</item> |
| | | |
| | | <!-- 页面背景颜色 --> |
| | | <item name="pageBackgroundColor">@color/color_normal_background</item> |
| | | <!-- 详情页背景颜色 --> |
| | | <item name="detailPageBackgroundColor">@color/color_normal_detail_page_background</item> |
| | | <!-- 标题栏背景颜色 --> |
| | | <item name="titleBarBackgroundColor">@color/color_normal_title_bar_background</item> |
| | | <!-- 底部导航栏背景颜色 --> |
| | | <item name="bottomNavigationViewBackgroundColor">@color/color_normal_bottom_navigation_view_background</item> |
| | | <!-- 底部导航栏选中文字样式 --> |
| | | <item name="text_color_main">@color/color_FFF08EBA_text_pink</item> |
| | | <!-- 底部导航栏选中图标样式 --> |
| | | <item name="menuIconHome">@drawable/selector_bottom_navigation_home</item> |
| | | <item name="menuIconTree">@drawable/selector_bottom_navigation_tree</item> |
| | | <item name="menuIconUser">@drawable/selector_bottom_navigation_personal_center</item> |
| | | |
| | | <!-- 功能图标 --> |
| | | <item name="icFunctionFamilyRootNet">@drawable/function_family_root_net</item> |
| | | <item name="icFunctionNotes">@drawable/ic_function_notes</item> |
| | | <item name="icFunctionAsset">@drawable/ic_function_asset</item> |
| | | <item name="icFunctionHonor">@drawable/ic_function_honor</item> |
| | | <item name="icFunctionLittleDoctor">@drawable/ic_function_little_doctor</item> |
| | | <item name="icFunctionCleaning">@drawable/ic_function_cleaning</item> |
| | | <item name="icFunctionMailList">@drawable/ic_function_mail_list</item> |
| | | <item name="icFunctionPamperPet">@drawable/ic_function_pamper_pet</item> |
| | | <item name="icFunctionIncomeExpense">@drawable/ic_function_income_expense</item> |
| | | <item name="icFunctionHomeDevices">@drawable/ic_function_home_devices</item> |
| | | <item name="icFunctionGrowth">@drawable/ic_function_growth</item> |
| | | <item name="icFunctionMarriage">@drawable/ic_function_marriage</item> |
| | | <item name="icFunctionProperty">@drawable/ic_function_property</item> |
| | | <item name="icFunctionWish">@drawable/ic_function_wish</item> |
| | | <item name="icFunctionTour">@drawable/ic_function_tour</item> |
| | | <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="cardBackgroundColorFirst">@color/color_card_pink</item> |
| | | <!-- 数据列表 间隔卡片背景色 --> |
| | | <item name="cardBackgroundColorSecond">@color/color_card_blue</item> |
| | | |
| | | <!-- 侧滑菜单背景色 --> |
| | | <item name="drawerBackgroundColor">@color/color_normal_drawer_bg</item> |
| | | <!-- 侧滑菜单选中文字样式 --> |
| | | <item name="drawerTextColor">@color/color_FFF08EBA_text_pink</item> |
| | | <!-- 侧滑菜单选中图标样式 --> |
| | | <item name="drawerSelectIcon">@drawable/ic_vector_pink</item> |
| | | |
| | | <!-- 是否是自己的家庭数据 --> |
| | | <item name="icIsOwnFamilyDataFlower">@drawable/ic_flower</item> |
| | | |
| | | <!-- 展开图标 --> |
| | | <item name="icUnfold">@drawable/ic_unfold</item> |
| | | <!-- 收起图标 --> |
| | | <item name="icFold">@drawable/ic_fold</item> |
| | | |
| | | <!-- 弹窗背景色 --> |
| | | <item name="popupWindowBackgroundColor">@color/color_normal_popup_window_bg</item> |
| | | |
| | | <!-- 电子文件添加按钮背景色 --> |
| | | <item name="electronicFileAddBackgroundColor">@color/color_normal_electronic_file_add_bg</item> |
| | | |
| | | <!-- 电子文件标识 --> |
| | | <item name="icPdf">@drawable/ic_pdf</item> |
| | | <item name="icWord">@drawable/ic_word</item> |
| | | <item name="icExcel">@drawable/ic_excel</item> |
| | | <item name="icPpt">@drawable/ic_ppt</item> |
| | | <item name="icTxt">@drawable/ic_txt</item> |
| | | <item name="icImage">@drawable/ic_img</item> |
| | | <item name="icVideo">@drawable/ic_video</item> |
| | | <item name="icAudio">@drawable/ic_audio</item> |
| | | <item name="icOther">@drawable/ic_others</item> |
| | | <item name="icZip">@drawable/ic_zip</item> |
| | | |
| | | <!-- 复选框样式 --> |
| | | <item name="checkboxSelector">@drawable/selector_checkbox</item> |
| | | |
| | | </style> |
| | | |
| | | <!-- 护眼模式主题 --> |
| | | <style name="AppTheme.Night" parent="AppTheme.Normal"> |
| | | |
| | | <!-- 应用的主要色调,ActionBar Toolbar 默认使用该颜色 --> |
| | | <item name="colorPrimary">@color/color_night_main</item> |
| | | <!-- 应用的强调色,CheckBox RadioButton Switch 等一般控件的选中效果默认采用该颜色 --> |
| | | <item name="colorAccent">@color/color_night_main</item> |
| | | |
| | | <!-- 页面背景颜色 --> |
| | | <item name="pageBackgroundColor">@color/color_night_background</item> |
| | | <!-- 详情页背景颜色 --> |
| | | <item name="detailPageBackgroundColor">@color/color_night_detail_page_background</item> |
| | | <!-- 标题栏背景颜色 --> |
| | | <item name="titleBarBackgroundColor">@color/color_night_title_bar_background</item> |
| | | <!-- 底部导航栏背景颜色 --> |
| | | <item name="bottomNavigationViewBackgroundColor">@color/color_night_bottom_navigation_view_background</item> |
| | | <!-- 底部导航栏选中文字样式 --> |
| | | <item name="text_color_main">@color/color_FF4E9F3D_text_green</item> |
| | | <!-- 底部导航栏选中图标样式 --> |
| | | <item name="menuIconHome">@drawable/selector_bottom_navigation_home_night</item> |
| | | <item name="menuIconTree">@drawable/selector_bottom_navigation_tree</item> |
| | | <item name="menuIconUser">@drawable/selector_bottom_navigation_personal_center_night</item> |
| | | |
| | | <!-- 功能图标 --> |
| | | <item name="icFunctionFamilyRootNet">@drawable/ic_function_family_root_net_night</item> |
| | | <item name="icFunctionNotes">@drawable/ic_function_notes_night</item> |
| | | <item name="icFunctionAsset">@drawable/ic_function_asset_night</item> |
| | | <item name="icFunctionHonor">@drawable/ic_function_honor_night</item> |
| | | <item name="icFunctionLittleDoctor">@drawable/ic_function_little_doctor_night</item> |
| | | <item name="icFunctionCleaning">@drawable/ic_function_cleaning_night</item> |
| | | <item name="icFunctionMailList">@drawable/ic_function_mail_list_night</item> |
| | | <item name="icFunctionPamperPet">@drawable/ic_function_pamper_pet_night</item> |
| | | <item name="icFunctionIncomeExpense">@drawable/ic_function_income_expense_night</item> |
| | | <item name="icFunctionHomeDevices">@drawable/ic_function_home_devices_night</item> |
| | | <item name="icFunctionGrowth">@drawable/ic_function_growth_night</item> |
| | | <item name="icFunctionMarriage">@drawable/ic_function_marriage_night</item> |
| | | <item name="icFunctionProperty">@drawable/ic_function_property_night</item> |
| | | <item name="icFunctionWish">@drawable/ic_function_wish_night</item> |
| | | <item name="icFunctionTour">@drawable/ic_function_tour_night</item> |
| | | <item name="icFunctionHealth">@drawable/ic_function_health_night</item> |
| | | <item name="icFunctionCertificate">@drawable/ic_function_certificate_night</item> |
| | | <item name="icFunctionPrivacy">@drawable/ic_function_privacy_night</item> |
| | | |
| | | <!-- 数据列表 卡片背景色 --> |
| | | <item name="cardBackgroundColorFirst" >@color/color_card_yellow</item> |
| | | <!-- 数据列表 间隔卡片背景色 --> |
| | | <item name="cardBackgroundColorSecond">@color/color_card_orange</item> |
| | | |
| | | <!-- 侧滑菜单背景颜色 --> |
| | | <item name="drawerBackgroundColor">@color/color_night_drawer_bg</item> |
| | | <!-- 侧滑菜单选中文字样式 --> |
| | | <item name="drawerTextColor">@color/color_night_drawer_text_color</item> |
| | | <!-- 侧滑菜单未选中文字样式 --> |
| | | <item name="drawerSelectIcon">@drawable/ic_vector_green</item> |
| | | |
| | | <!-- 是否是自己的家庭数据 --> |
| | | <item name="icIsOwnFamilyDataFlower">@drawable/ic_flower_night</item> |
| | | |
| | | <!-- 展开图标 --> |
| | | <item name="icUnfold">@drawable/ic_unfold_night</item> |
| | | <!-- 收起图标 --> |
| | | <item name="icFold">@drawable/ic_fold_night</item> |
| | | |
| | | <!-- 弹窗背景色 --> |
| | | <item name="popupWindowBackgroundColor">@color/color_night_popup_window_bg</item> |
| | | |
| | | <!-- 电子文件添加按钮背景色 --> |
| | | <item name="electronicFileAddBackgroundColor">@color/color_night_electronic_file_add_bg</item> |
| | | |
| | | <!-- 电子文件标识 --> |
| | | <item name="icPdf">@drawable/ic_pdf_night</item> |
| | | <item name="icWord">@drawable/ic_word_night</item> |
| | | <item name="icExcel">@drawable/ic_excel_night</item> |
| | | <item name="icPpt">@drawable/ic_ppt_night</item> |
| | | <item name="icTxt">@drawable/ic_txt_night</item> |
| | | <item name="icImage">@drawable/ic_img_night</item> |
| | | <item name="icVideo">@drawable/ic_video_night</item> |
| | | <item name="icAudio">@drawable/ic_audio_night</item> |
| | | <item name="icOther">@drawable/ic_others_night</item> |
| | | <item name="icZip">@drawable/ic_zip_night</item> |
| | | |
| | | <!-- 复选框样式 --> |
| | | <item name="checkboxSelector">@drawable/selector_checkbox_night</item> |
| | | </style> |
| | | |
| | | |
| | | <!-- 全屏主题样式 --> |
| | | <style name="FullScreenTheme" parent="Theme.app"> |
| | | <style name="FullScreenTheme" parent="AppTheme.Normal"> |
| | | <item name="android:windowFullscreen">true</item> |
| | | </style> |
| | | </resources> |
| | |
| | | package com.android.app_base.base.view; |
| | | |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | viewModel.getMessageLivaData().observe(this, new Observer<String>() { |
| | | @Override |
| | | public void onChanged(String message) { |
| | | if (message != null){ |
| | | if (!TextUtils.isEmpty(message)){ |
| | | ToastUtils.showShort(message); |
| | | } |
| | | } |
| | |
| | | JSONObject responseObject = new JSONObject(string); |
| | | int code = responseObject.getInt("code"); |
| | | if (code == BaseConfig.TOKEN_INVALID ) { |
| | | UserManager.getInstance().clearToken(); |
| | | UserManager.getInstance().loginOut(); |
| | | AppManager.getAppManager().finishAllActivity(); |
| | | AppManager.getAppManager().startActivityForName(BaseConfig.LOGIN_ACTIVITY); |
| | | throw new IOException("登录状态失效,请重新登录"); |
| | |
| | | package com.android.app_base.manager; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.AlarmManager; |
| | | import android.app.PendingIntent; |
| | | import android.content.ComponentName; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.pm.PackageManager; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | import com.blankj.utilcode.util.ActivityUtils; |
| | | import com.blankj.utilcode.util.AppUtils; |
| | | |
| | | import java.util.Stack; |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 重启应用 |
| | | */ |
| | | public void restartApp() { |
| | | AppUtils.relaunchApp(); |
| | | } |
| | | public void restartApp(Context context) { |
| | | Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | startActivity(intent); |
| | | AppExit(); |
| | | } |
| | | } |
| | |
| | | SPUtils.getInstance("userInfo").remove("userAvatar"); |
| | | } |
| | | |
| | | /** |
| | | * 退出登录,清除状态 |
| | | */ |
| | | public void loginOut(){ |
| | | clearToken(); |
| | | clearUserInfo(); |
| | | } |
| | | |
| | | /** |
| | | * 保存护眼模式 状态 |
| | | */ |
| | | // 保存护眼模式的状态 |
| | | public void saveNightModeState(boolean isNightMode) { |
| | | SPUtils.getInstance("nightMode").put("nightMode", isNightMode); |
| | | } |
| | | // 获取护眼模式的状态 |
| | | public boolean getNightModeState() { |
| | | return SPUtils.getInstance("nightMode").getBoolean("nightMode", false); |
| | | } |
| | | // 清除护眼模式的状态 |
| | | public void clearNightModeState() { |
| | | SPUtils.getInstance("nightMode").clear(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.android.app_base.utils; |
| | | |
| | | import android.animation.ValueAnimator; |
| | | import android.app.ActionBar; |
| | | import android.app.ActivityManager; |
| | | import android.app.Application; |
| | | import android.content.Context; |
| | |
| | | import com.blankj.utilcode.util.LogUtils; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URL; |
| | | import java.security.DigestInputStream; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | |
| | | return new BitmapDrawable(view.getResources(), bitmap); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 计算文件的MD5哈希值 |
| | | * |
| | | * @param file 文件 |
| | | * @return 文件的MD5哈希值,如果计算失败则返回null |
| | | */ |
| | | public static String calculateMD5(File file) { |
| | | try { |
| | | // 获取MD5消息摘要算法的实例 |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | // 创建文件URL |
| | | // 打开文件输入流,并使用DigestInputStream更新消息摘要 |
| | | try (FileInputStream is = new FileInputStream(file); |
| | | DigestInputStream dis = new DigestInputStream(is, md)) { |
| | | // 读取输入流并更新消息摘要 |
| | | byte[] buffer = new byte[1024*256]; |
| | | while(true){ |
| | | if (!(dis.read(buffer) > 0)) break; |
| | | } |
| | | // 获取MD5哈希值的字节数组 |
| | | md = dis.getMessageDigest(); |
| | | byte[] mdBytes = md.digest(); |
| | | // 将字节数组转换为十六进制字符串 |
| | | StringBuilder hexString = new StringBuilder(); |
| | | for (byte mdByte : mdBytes) { |
| | | hexString.append(Integer.toHexString(0xFF & mdByte)); |
| | | } |
| | | return hexString.toString(); |
| | | } |
| | | } catch (NoSuchAlgorithmException | IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.android.app_base.widget; |
| | | |
| | | import android.annotation.SuppressLint; |
| | | import android.content.Context; |
| | | import android.content.res.TypedArray; |
| | | import android.graphics.Canvas; |
| | | import android.graphics.Color; |
| | | import android.graphics.Paint; |
| | | import android.graphics.Path; |
| | | import android.graphics.RadialGradient; |
| | | import android.graphics.RectF; |
| | | import android.graphics.Shader; |
| | | import android.os.Parcel; |
| | | import android.os.Parcelable; |
| | | import android.util.AttributeSet; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.view.animation.AccelerateInterpolator; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | |
| | | import com.android.app_base.R; |
| | | import com.android.app_base.utils.ScreenSizeUtils; |
| | | |
| | | /** |
| | | * 高仿 ios 开关按钮 |
| | | */ |
| | | public final class SwitchButton extends View { |
| | | |
| | | private static final int STATE_SWITCH_OFF = 1; |
| | | private static final int STATE_SWITCH_OFF2 = 2; |
| | | private static final int STATE_SWITCH_ON = 3; |
| | | private static final int STATE_SWITCH_ON2 = 4; |
| | | |
| | | private final AccelerateInterpolator mInterpolator = new AccelerateInterpolator(2); |
| | | private final Paint mPaint = new Paint(); |
| | | private final Path mBackgroundPath = new Path(); |
| | | private final Path mBarPath = new Path(); |
| | | private final RectF mBound = new RectF(); |
| | | |
| | | private float mAnim1, mAnim2; |
| | | private RadialGradient mShadowGradient; |
| | | |
| | | /** 按钮宽高形状比率(0,1] 不推荐大幅度调整 */ |
| | | protected final float mAspectRatio = 0.68f; |
| | | /** (0,1] */ |
| | | protected final float mAnimationSpeed = 0.1f; |
| | | |
| | | /** 上一个选中状态 */ |
| | | private int mLastCheckedState; |
| | | /** 当前的选中状态 */ |
| | | private int mCheckedState; |
| | | |
| | | private boolean mCanVisibleDrawing = false; |
| | | |
| | | /** 是否显示按钮阴影 */ |
| | | protected boolean mShadow; |
| | | /** 是否选中 */ |
| | | protected boolean mChecked; |
| | | |
| | | /** 开启状态背景色 */ |
| | | protected int mAccentColor = 0xFF4BD763; |
| | | /** 开启状态按钮描边色 */ |
| | | protected int mPrimaryDarkColor = 0xFF3AC652; |
| | | /** 关闭状态描边色 */ |
| | | protected int mOffColor = 0xFFE3E3E3; |
| | | /** 关闭状态按钮描边色 */ |
| | | protected int mOffDarkColor = 0xFFBFBFBF; |
| | | /** 按钮阴影色 */ |
| | | protected int mShadowColor = 0xFF333333; |
| | | /** 监听器 */ |
| | | @Nullable |
| | | private OnCheckedChangeListener mListener; |
| | | |
| | | private float mRight; |
| | | private float mCenterX, mCenterY; |
| | | private float mScale; |
| | | |
| | | private float mOffset; |
| | | private float mRadius, mStrokeWidth; |
| | | private float mWidth; |
| | | private float mLeft; |
| | | private float bRight; |
| | | private float mOnLeftX, mOn2LeftX, mOff2LeftX, mOffLeftX; |
| | | |
| | | private float mShadowReservedHeight; |
| | | |
| | | public SwitchButton(Context context) { |
| | | this(context, null); |
| | | } |
| | | |
| | | public SwitchButton(Context context, @Nullable AttributeSet attrs) { |
| | | this(context, attrs, 0); |
| | | } |
| | | |
| | | public SwitchButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { |
| | | this(context, attrs, defStyleAttr, 0); |
| | | } |
| | | |
| | | public SwitchButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { |
| | | super(context, attrs, defStyleAttr, defStyleRes); |
| | | |
| | | setLayerType(LAYER_TYPE_SOFTWARE, null); |
| | | |
| | | TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.SwitchButton); |
| | | mChecked = array.getBoolean(R.styleable.SwitchButton_android_checked, mChecked); |
| | | setEnabled(array.getBoolean(R.styleable.SwitchButton_android_enabled, isEnabled())); |
| | | mLastCheckedState = mCheckedState = mChecked ? STATE_SWITCH_ON : STATE_SWITCH_OFF; |
| | | |
| | | array.recycle(); |
| | | } |
| | | |
| | | @Override |
| | | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { |
| | | switch (MeasureSpec.getMode(widthMeasureSpec)) { |
| | | case MeasureSpec.AT_MOST: |
| | | case MeasureSpec.UNSPECIFIED: |
| | | widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (ScreenSizeUtils.dip2px(56) + getPaddingLeft() + getPaddingRight()), MeasureSpec.EXACTLY); |
| | | break; |
| | | case MeasureSpec.EXACTLY: |
| | | default: |
| | | break; |
| | | } |
| | | switch (MeasureSpec.getMode(heightMeasureSpec)) { |
| | | case MeasureSpec.AT_MOST: |
| | | case MeasureSpec.UNSPECIFIED: |
| | | heightMeasureSpec = MeasureSpec.makeMeasureSpec((int) (MeasureSpec.getSize(widthMeasureSpec) * mAspectRatio) |
| | | + getPaddingTop() + getPaddingBottom(), MeasureSpec.EXACTLY); |
| | | break; |
| | | case MeasureSpec.EXACTLY: |
| | | default: |
| | | break; |
| | | } |
| | | setMeasuredDimension(widthMeasureSpec, heightMeasureSpec); |
| | | } |
| | | |
| | | @Override |
| | | protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) { |
| | | mCanVisibleDrawing = width > getPaddingLeft() + getPaddingRight() && height > getPaddingTop() + getPaddingBottom(); |
| | | |
| | | if (mCanVisibleDrawing) { |
| | | int actuallyDrawingAreaWidth = width - getPaddingLeft() - getPaddingRight(); |
| | | int actuallyDrawingAreaHeight = height - getPaddingTop() - getPaddingBottom(); |
| | | |
| | | int actuallyDrawingAreaLeft; |
| | | int actuallyDrawingAreaRight; |
| | | int actuallyDrawingAreaTop; |
| | | int actuallyDrawingAreaBottom; |
| | | if (actuallyDrawingAreaWidth * mAspectRatio < actuallyDrawingAreaHeight) { |
| | | actuallyDrawingAreaLeft = getPaddingLeft(); |
| | | actuallyDrawingAreaRight = width - getPaddingRight(); |
| | | int heightExtraSize = (int) (actuallyDrawingAreaHeight - actuallyDrawingAreaWidth * mAspectRatio); |
| | | actuallyDrawingAreaTop = getPaddingTop() + heightExtraSize / 2; |
| | | actuallyDrawingAreaBottom = getHeight() - getPaddingBottom() - heightExtraSize / 2; |
| | | } else { |
| | | int widthExtraSize = (int) (actuallyDrawingAreaWidth - actuallyDrawingAreaHeight / mAspectRatio); |
| | | actuallyDrawingAreaLeft = getPaddingLeft() + widthExtraSize / 2; |
| | | actuallyDrawingAreaRight = getWidth() - getPaddingRight() - widthExtraSize / 2; |
| | | actuallyDrawingAreaTop = getPaddingTop(); |
| | | actuallyDrawingAreaBottom = getHeight() - getPaddingBottom(); |
| | | } |
| | | |
| | | mShadowReservedHeight = (int) ((actuallyDrawingAreaBottom - actuallyDrawingAreaTop) * 0.07f); |
| | | float left = actuallyDrawingAreaLeft; |
| | | float top = actuallyDrawingAreaTop + mShadowReservedHeight; |
| | | mRight = actuallyDrawingAreaRight; |
| | | float bottom = actuallyDrawingAreaBottom - mShadowReservedHeight; |
| | | |
| | | float sHeight = bottom - top; |
| | | mCenterX = (mRight + left) / 2; |
| | | mCenterY = (bottom + top) / 2; |
| | | |
| | | mLeft = left; |
| | | mWidth = bottom - top; |
| | | bRight = left + mWidth; |
| | | // OfB |
| | | final float halfHeightOfS = mWidth / 2; |
| | | mRadius = halfHeightOfS * 0.95f; |
| | | // offset of switching |
| | | mOffset = mRadius * 0.2f; |
| | | mStrokeWidth = (halfHeightOfS - mRadius) * 2; |
| | | mOnLeftX = mRight - mWidth; |
| | | mOn2LeftX = mOnLeftX - mOffset; |
| | | mOffLeftX = left; |
| | | mOff2LeftX = mOffLeftX + mOffset; |
| | | mScale = 1 - mStrokeWidth / sHeight; |
| | | |
| | | mBackgroundPath.reset(); |
| | | RectF bound = new RectF(); |
| | | bound.top = top; |
| | | bound.bottom = bottom; |
| | | bound.left = left; |
| | | bound.right = left + sHeight; |
| | | mBackgroundPath.arcTo(bound, 90, 180); |
| | | bound.left = mRight - sHeight; |
| | | bound.right = mRight; |
| | | mBackgroundPath.arcTo(bound, 270, 180); |
| | | mBackgroundPath.close(); |
| | | |
| | | mBound.left = mLeft; |
| | | mBound.right = bRight; |
| | | // bTop = sTop |
| | | mBound.top = top + mStrokeWidth / 2; |
| | | // bBottom = sBottom |
| | | mBound.bottom = bottom - mStrokeWidth / 2; |
| | | float bCenterX = (bRight + mLeft) / 2; |
| | | float bCenterY = (bottom + top) / 2; |
| | | |
| | | int red = mShadowColor >> 16 & 0xFF; |
| | | int green = mShadowColor >> 8 & 0xFF; |
| | | int blue = mShadowColor & 0xFF; |
| | | mShadowGradient = new RadialGradient(bCenterX, bCenterY, mRadius, Color.argb(200, red, green, blue), |
| | | Color.argb(25, red, green, blue), Shader.TileMode.CLAMP); |
| | | } |
| | | } |
| | | |
| | | private void calcBPath(float percent) { |
| | | mBarPath.reset(); |
| | | mBound.left = mLeft + mStrokeWidth / 2; |
| | | mBound.right = bRight - mStrokeWidth / 2; |
| | | mBarPath.arcTo(mBound, 90, 180); |
| | | mBound.left = mLeft + percent * mOffset + mStrokeWidth / 2; |
| | | mBound.right = bRight + percent * mOffset - mStrokeWidth / 2; |
| | | mBarPath.arcTo(mBound, 270, 180); |
| | | mBarPath.close(); |
| | | } |
| | | |
| | | private float calcBTranslate(float percent) { |
| | | float result = 0; |
| | | switch (mCheckedState - mLastCheckedState) { |
| | | case 1: |
| | | if (mCheckedState == STATE_SWITCH_OFF2) { |
| | | // off -> off2 |
| | | result = mOffLeftX; |
| | | } else if (mCheckedState == STATE_SWITCH_ON) { |
| | | // on2 -> on |
| | | result = mOnLeftX - (mOnLeftX - mOn2LeftX) * percent; |
| | | } |
| | | break; |
| | | case 2: |
| | | if (mCheckedState == STATE_SWITCH_ON) { |
| | | // off2 -> on |
| | | result = mOnLeftX - (mOnLeftX - mOffLeftX) * percent; |
| | | } else if (mCheckedState == STATE_SWITCH_ON2) { |
| | | // off -> on2 |
| | | result = mOn2LeftX - (mOn2LeftX - mOffLeftX) * percent; |
| | | } |
| | | break; |
| | | case 3: |
| | | // off -> on |
| | | result = mOnLeftX - (mOnLeftX - mOffLeftX) * percent; |
| | | break; |
| | | case -1: |
| | | if (mCheckedState == STATE_SWITCH_ON2) { |
| | | // on -> on2 |
| | | result = mOn2LeftX + (mOnLeftX - mOn2LeftX) * percent; |
| | | } else if (mCheckedState == STATE_SWITCH_OFF) { |
| | | // off2 -> off |
| | | result = mOffLeftX; |
| | | } |
| | | break; |
| | | case -2: |
| | | if (mCheckedState == STATE_SWITCH_OFF) { |
| | | // on2 -> off |
| | | result = mOffLeftX + (mOn2LeftX - mOffLeftX) * percent; |
| | | } else if (mCheckedState == STATE_SWITCH_OFF2) { |
| | | // on -> off2 |
| | | result = mOff2LeftX + (mOnLeftX - mOff2LeftX) * percent; |
| | | } |
| | | break; |
| | | case -3: |
| | | // on -> off |
| | | result = mOffLeftX + (mOnLeftX - mOffLeftX) * percent; |
| | | break; |
| | | default: // init |
| | | case 0: |
| | | if (mCheckedState == STATE_SWITCH_OFF) { |
| | | // off -> off |
| | | result = mOffLeftX; |
| | | } else if (mCheckedState == STATE_SWITCH_ON) { |
| | | // on -> on |
| | | result = mOnLeftX; |
| | | } |
| | | break; |
| | | } |
| | | return result - mOffLeftX; |
| | | } |
| | | |
| | | @Override |
| | | protected void onDraw(Canvas canvas) { |
| | | if (!mCanVisibleDrawing) { |
| | | return; |
| | | } |
| | | |
| | | mPaint.setAntiAlias(true); |
| | | |
| | | final boolean isOn = (mCheckedState == STATE_SWITCH_ON || mCheckedState == STATE_SWITCH_ON2); |
| | | // Draw background |
| | | mPaint.setStyle(Paint.Style.FILL); |
| | | mPaint.setColor(isOn ? mAccentColor : mOffColor); |
| | | canvas.drawPath(mBackgroundPath, mPaint); |
| | | |
| | | mAnim1 = mAnim1 - mAnimationSpeed > 0 ? mAnim1 - mAnimationSpeed : 0; |
| | | mAnim2 = mAnim2 - mAnimationSpeed > 0 ? mAnim2 - mAnimationSpeed : 0; |
| | | |
| | | final float dsAnim = mInterpolator.getInterpolation(mAnim1); |
| | | final float dbAnim = mInterpolator.getInterpolation(mAnim2); |
| | | // Draw background animation |
| | | final float scale = mScale * (isOn ? dsAnim : 1 - dsAnim); |
| | | final float scaleOffset = (mRight - mCenterX - mRadius) * (isOn ? 1 - dsAnim : dsAnim); |
| | | canvas.save(); |
| | | canvas.scale(scale, scale, mCenterX + scaleOffset, mCenterY); |
| | | if (isEnabled()) { |
| | | mPaint.setColor(0xFFFFFFFF); |
| | | } else { |
| | | mPaint.setColor(0xFFBBBBBB); |
| | | } |
| | | canvas.drawPath(mBackgroundPath, mPaint); |
| | | canvas.restore(); |
| | | // To prepare center bar path |
| | | canvas.save(); |
| | | canvas.translate(calcBTranslate(dbAnim), mShadowReservedHeight); |
| | | final boolean isState2 = (mCheckedState == STATE_SWITCH_ON2 || mCheckedState == STATE_SWITCH_OFF2); |
| | | calcBPath(isState2 ? 1 - dbAnim : dbAnim); |
| | | // Use center bar path to draw shadow |
| | | if (mShadow) { |
| | | mPaint.setStyle(Paint.Style.FILL); |
| | | mPaint.setShader(mShadowGradient); |
| | | canvas.drawPath(mBarPath, mPaint); |
| | | mPaint.setShader(null); |
| | | } |
| | | canvas.translate(0, -mShadowReservedHeight); |
| | | // draw bar |
| | | canvas.scale(0.98f, 0.98f, mWidth / 2, mWidth / 2); |
| | | mPaint.setStyle(Paint.Style.FILL); |
| | | mPaint.setColor(0xFFFFFFFF); |
| | | canvas.drawPath(mBarPath, mPaint); |
| | | mPaint.setStyle(Paint.Style.STROKE); |
| | | mPaint.setStrokeWidth(mStrokeWidth * 0.5f); |
| | | mPaint.setColor(isOn ? mPrimaryDarkColor : mOffDarkColor); |
| | | canvas.drawPath(mBarPath, mPaint); |
| | | canvas.restore(); |
| | | |
| | | mPaint.reset(); |
| | | if (mAnim1 > 0 || mAnim2 > 0) { |
| | | invalidate(); |
| | | } |
| | | } |
| | | |
| | | @SuppressLint("ClickableViewAccessibility") |
| | | @Override |
| | | public boolean onTouchEvent(MotionEvent event) { |
| | | super.onTouchEvent(event); |
| | | |
| | | if (isEnabled() |
| | | && (mCheckedState == STATE_SWITCH_ON || mCheckedState == STATE_SWITCH_OFF) |
| | | && (mAnim1 * mAnim2 == 0)) { |
| | | |
| | | switch (event.getAction()) { |
| | | case MotionEvent.ACTION_UP: |
| | | mLastCheckedState = mCheckedState; |
| | | mAnim2 = 1; |
| | | |
| | | switch (mCheckedState) { |
| | | case STATE_SWITCH_OFF: |
| | | setChecked(true, false); |
| | | if (mListener != null) { |
| | | mListener.onCheckedChanged(this, true); |
| | | } |
| | | break; |
| | | case STATE_SWITCH_ON: |
| | | setChecked(false, false); |
| | | if (mListener != null) { |
| | | mListener.onCheckedChanged(this, false); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | break; |
| | | case MotionEvent.ACTION_DOWN: |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public Parcelable onSaveInstanceState() { |
| | | Parcelable superState = super.onSaveInstanceState(); |
| | | SavedState state = new SavedState(superState); |
| | | state.checked = mChecked; |
| | | return state; |
| | | } |
| | | |
| | | @Override |
| | | public void onRestoreInstanceState(Parcelable state) { |
| | | SavedState savedState = (SavedState) state; |
| | | super.onRestoreInstanceState(savedState.getSuperState()); |
| | | mChecked = savedState.checked; |
| | | mCheckedState = mChecked ? STATE_SWITCH_ON : STATE_SWITCH_OFF; |
| | | invalidate(); |
| | | } |
| | | |
| | | public void setColor(int newColorPrimary, int newColorPrimaryDark) { |
| | | setColor(newColorPrimary, newColorPrimaryDark, mOffColor, mOffDarkColor); |
| | | } |
| | | |
| | | public void setColor(int newColorPrimary, int newColorPrimaryDark, int newColorOff, int newColorOffDark) { |
| | | setColor(newColorPrimary, newColorPrimaryDark, newColorOff, newColorOffDark, mShadowColor); |
| | | } |
| | | |
| | | public void setColor(int newColorPrimary, int newColorPrimaryDark, int newColorOff, int newColorOffDark, int newColorShadow) { |
| | | mAccentColor = newColorPrimary; |
| | | mPrimaryDarkColor = newColorPrimaryDark; |
| | | mOffColor = newColorOff; |
| | | mOffDarkColor = newColorOffDark; |
| | | mShadowColor = newColorShadow; |
| | | invalidate(); |
| | | } |
| | | |
| | | /** |
| | | * 设置按钮阴影开关 |
| | | */ |
| | | public void setShadow(boolean shadow) { |
| | | mShadow = shadow; |
| | | invalidate(); |
| | | } |
| | | |
| | | /** |
| | | * 当前状态是否选中 |
| | | */ |
| | | public boolean isChecked() { |
| | | return mChecked; |
| | | } |
| | | |
| | | /** |
| | | * 设置选择状态(默认会回调监听器) |
| | | */ |
| | | public void setChecked(boolean checked) { |
| | | // 回调监听器 |
| | | setChecked(checked, true); |
| | | } |
| | | |
| | | /** |
| | | * 设置选择状态 |
| | | */ |
| | | public void setChecked(boolean checked, boolean callback) { |
| | | int newState = checked ? STATE_SWITCH_ON : STATE_SWITCH_OFF; |
| | | if (newState == mCheckedState) { |
| | | return; |
| | | } |
| | | if ((newState == STATE_SWITCH_ON && (mCheckedState == STATE_SWITCH_OFF || mCheckedState == STATE_SWITCH_OFF2)) |
| | | || (newState == STATE_SWITCH_OFF && (mCheckedState == STATE_SWITCH_ON || mCheckedState == STATE_SWITCH_ON2))) { |
| | | mAnim1 = 1; |
| | | } |
| | | mAnim2 = 1; |
| | | |
| | | if (!mChecked && newState == STATE_SWITCH_ON) { |
| | | mChecked = true; |
| | | } else if (mChecked && newState == STATE_SWITCH_OFF) { |
| | | mChecked = false; |
| | | } |
| | | mLastCheckedState = mCheckedState; |
| | | mCheckedState = newState; |
| | | postInvalidate(); |
| | | |
| | | if (callback && mListener != null) { |
| | | mListener.onCheckedChanged(this, checked); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置选中状态改变监听 |
| | | */ |
| | | public void setOnCheckedChangeListener(@Nullable OnCheckedChangeListener listener) { |
| | | mListener = listener; |
| | | } |
| | | |
| | | /** |
| | | * 选中监听器 |
| | | */ |
| | | public interface OnCheckedChangeListener { |
| | | /** |
| | | * 回调监听 |
| | | * |
| | | * @param button 切换按钮 |
| | | * @param checked 是否选中 |
| | | */ |
| | | void onCheckedChanged(SwitchButton button, boolean checked); |
| | | } |
| | | |
| | | /** |
| | | * 保存开关状态 |
| | | */ |
| | | private static final class SavedState extends BaseSavedState { |
| | | |
| | | private boolean checked; |
| | | |
| | | SavedState(Parcelable superState) { |
| | | super(superState); |
| | | } |
| | | |
| | | private SavedState(Parcel in) { |
| | | super(in); |
| | | checked = 1 == in.readInt(); |
| | | } |
| | | |
| | | @Override |
| | | public void writeToParcel(Parcel out, int flags) { |
| | | super.writeToParcel(out, flags); |
| | | out.writeInt(checked ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * fixed by Night99 https://github.com/g19980115 |
| | | */ |
| | | @Override |
| | | public int describeContents() { |
| | | return 0; |
| | | } |
| | | |
| | | public static final Creator<SavedState> CREATOR = new Creator<SavedState>() { |
| | | @Override |
| | | public SavedState createFromParcel(Parcel in) { |
| | | return new SavedState(in); |
| | | } |
| | | |
| | | @Override |
| | | public SavedState[] newArray(int size) { |
| | | return new SavedState[size]; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | <!-- 动画时间 --> |
| | | <attr name="pb_animDuration" format="integer" /> |
| | | </declare-styleable> |
| | | |
| | | <!-- 仿 ios 开关按钮 --> |
| | | <declare-styleable name="SwitchButton"> |
| | | <!-- 是否选中 --> |
| | | <attr name="android:checked" /> |
| | | <!-- 是否禁用 --> |
| | | <attr name="android:enabled" /> |
| | | </declare-styleable> |
| | | </resources> |