@@ -1,13 +1,29 @@ | |||
package com.bonait.bnframework.modules.home.fragment.from; | |||
import static com.bonait.bnframework.MainApplication.getContext; | |||
import android.support.v7.app.AppCompatActivity; | |||
import android.os.Bundle; | |||
import android.support.v7.widget.GridLayoutManager; | |||
import android.support.v7.widget.LinearLayoutManager; | |||
import android.support.v7.widget.RecyclerView; | |||
import android.view.View; | |||
import android.view.ViewGroup; | |||
import android.view.animation.AnimationUtils; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.mode.QDListSectionAdapter; | |||
import com.bonait.bnframework.modules.home.fragment.mode.SectionHeader; | |||
import com.bonait.bnframework.modules.home.fragment.mode.SectionItem; | |||
import com.orhanobut.logger.Logger; | |||
import com.qmuiteam.qmui.widget.QMUITopBar; | |||
import com.qmuiteam.qmui.widget.section.QMUISection; | |||
import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter; | |||
import com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
@@ -17,6 +33,11 @@ public class CpActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBar mTopBar; | |||
@BindView(R.id.qmuisection_layout) | |||
QMUIStickySectionLayout mSectionLayout; | |||
private RecyclerView.LayoutManager mLayoutManager; | |||
protected static QMUIStickySectionAdapter<SectionHeader, SectionItem, QMUIStickySectionAdapter.ViewHolder> mAdapter; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
@@ -24,11 +45,106 @@ public class CpActivity extends BaseActivity { | |||
//属性绑定 | |||
ButterKnife.bind(this); | |||
initTopBar(); | |||
initAdapter(); | |||
initAdapterLogicalOperation(); | |||
} | |||
private void initAdapter() { | |||
mLayoutManager = createLayoutManager(); | |||
mSectionLayout.setLayoutManager(mLayoutManager); | |||
mAdapter = createAdapter(); | |||
//mSectionLayout.setAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.aword_fade_enter)); | |||
} | |||
private void initAdapterLogicalOperation() { | |||
mAdapter.setCallback(new QMUIStickySectionAdapter.Callback<SectionHeader, SectionItem>() { | |||
@Override | |||
public void loadMore(final QMUISection<SectionHeader, SectionItem> section, final boolean loadMoreBefore) { | |||
} | |||
//点击事件 | |||
@Override | |||
public void onItemClick(QMUIStickySectionAdapter.ViewHolder holder, int position) { | |||
if (holder.getItemViewType() != 1) { | |||
int pos = holder.isForStickyHeader ? position : holder.getAdapterPosition(); | |||
mAdapter.toggleFold(pos, false); | |||
} | |||
ToastUtils.info(mAdapter.getItemIndex(position)+""); | |||
} | |||
//长按事件 | |||
@Override | |||
public boolean onItemLongClick(QMUIStickySectionAdapter.ViewHolder holder, int position) { | |||
int FirstPos = mAdapter.getSectionIndex(position); | |||
int SecondPos = mAdapter.getItemIndex(position); | |||
//ItemPopupWindow.show(getContext(), holder.itemView, holder.getItemViewType(), FirstPos, SecondPos); | |||
ToastUtils.info("一级条目" +FirstPos+ "二级"+ SecondPos); | |||
return true; | |||
} | |||
}); | |||
mSectionLayout.setAdapter(mAdapter, true); | |||
mAdapter.setData(getList()); | |||
} | |||
protected QMUIStickySectionAdapter<SectionHeader, SectionItem, QMUIStickySectionAdapter.ViewHolder> createAdapter() { | |||
return new QDListSectionAdapter(); | |||
} | |||
protected RecyclerView.LayoutManager createLayoutManager() { | |||
// return new LinearLayoutManager(getContext()) { | |||
// @Override | |||
// public RecyclerView.LayoutParams generateDefaultLayoutParams() { | |||
// return new RecyclerView.LayoutParams( | |||
// ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); | |||
// } | |||
// }; | |||
final GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 3); | |||
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { | |||
@Override | |||
public int getSpanSize(int i) { | |||
return mAdapter.getItemIndex(i) < 0 ? layoutManager.getSpanCount() : 1; | |||
} | |||
}); | |||
return layoutManager; | |||
} | |||
private static ArrayList<QMUISection<SectionHeader, SectionItem>> getList() { | |||
ArrayList<QMUISection<SectionHeader, SectionItem>> list = new ArrayList<>(); | |||
int n = 0; | |||
SectionHeader header = new SectionHeader("本地菜谱","",""); | |||
ArrayList<SectionItem> contents = new ArrayList<>(); | |||
for (int j = 0; j < 20/* 二级条目辅助数据*/; j++) { | |||
contents.add(new SectionItem("回锅肉"+j, "185" + n, "",j%4==0)); | |||
n++; | |||
} | |||
QMUISection<SectionHeader, SectionItem> section = new QMUISection<>(header, contents, false); | |||
list.add(section); | |||
header = new SectionHeader("收藏菜谱","",""); | |||
contents = new ArrayList<>(); | |||
for (int j = 0; j < 20/* 二级条目辅助数据*/; j++) { | |||
contents.add(new SectionItem("回锅肉"+j, "185" + n, "",j%4==0)); | |||
n++; | |||
} | |||
section = new QMUISection<>(header, contents, true); | |||
list.add(section); | |||
header = new SectionHeader("云端菜谱","",""); | |||
contents = new ArrayList<>(); | |||
for (int j = 0; j < 20/* 二级条目辅助数据*/; j++) { | |||
contents.add(new SectionItem("回锅肉"+j, "185" + n, "",j%4==0)); | |||
n++; | |||
} | |||
section = new QMUISection<>(header, contents, true); | |||
list.add(section); | |||
return list; | |||
} | |||
private void initTopBar() { | |||
mTopBar.setTitle("菜谱管理"); | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); | |||
@@ -0,0 +1,108 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.content.Context; | |||
import android.support.annotation.NonNull; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.view.ViewGroup; | |||
import android.widget.ImageView; | |||
import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter; | |||
import com.qmuiteam.qmui.widget.section.QMUISection; | |||
public class QDListSectionAdapter extends QMUIDefaultStickySectionAdapter { | |||
private TextView tvTag ,tvNote,tvAccount,Sc_text,delete_text; | |||
private RelativeLayout ImageUrl;//图片 | |||
private ImageView sc_image;//是否收藏 | |||
public boolean IsSC=false; | |||
@NonNull | |||
@Override | |||
protected ViewHolder onCreateSectionHeaderViewHolder(@NonNull ViewGroup viewGroup) { | |||
return new ViewHolder(new QDSectionHeaderView(viewGroup.getContext())); | |||
} | |||
public QDListSectionAdapter() { | |||
} | |||
@Override | |||
protected void onBindSectionHeader(final ViewHolder holder, final int position, QMUISection section) { | |||
QDSectionHeaderView itemView = (QDSectionHeaderView) holder.itemView; | |||
itemView.render((SectionHeader) section.getHeader(), section.isFold()); | |||
//点击事件 | |||
itemView.getArrowView().setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
int pos = holder.isForStickyHeader ? position : holder.getAdapterPosition(); | |||
toggleFold(pos, false); | |||
} | |||
}); | |||
} | |||
@Override | |||
protected void onBindSectionItem(ViewHolder holder, int position, QMUISection section, int itemIndex) { | |||
//获取id | |||
tvTag = holder.itemView.findViewById(R.id.Tag_text); | |||
tvNote = holder.itemView.findViewById(R.id.Note_text); | |||
Sc_text = holder.itemView.findViewById(R.id.Sc_text); | |||
delete_text = holder.itemView.findViewById(R.id.delete_text); | |||
sc_image=holder.itemView.findViewById(R.id.sc_image);//收藏 | |||
ImageUrl=holder.itemView.findViewById(R.id.ImageUrl);//图片 | |||
//设置文本 | |||
String name=((SectionItem)section.getItemAt(itemIndex)).getTag(); | |||
IsSC=((SectionItem)section.getItemAt(itemIndex)).getIsSC(); | |||
tvTag.setText(name); | |||
tvNote.setText("时间:"+ ((SectionItem)section.getItemAt(itemIndex)).getNote()+"秒"); | |||
//设置图片 | |||
ImageUrl.setBackground(holder.itemView.getContext().getResources().getDrawable(R.mipmap.hgr)); | |||
Sc_text.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ToastUtils.info("点击上传按钮,菜品:"+name); | |||
} | |||
}); | |||
delete_text.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
ToastUtils.info("点击删除按钮,菜品:"+name); | |||
} | |||
}); | |||
SetImage(sc_image,IsSC); | |||
sc_image.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
IsSC=!IsSC; | |||
SetImage(sc_image,IsSC); | |||
} | |||
}); | |||
} | |||
public void SetImage(ImageView image,boolean isxz) | |||
{ | |||
if(isxz) | |||
{ | |||
image.setImageResource(R.mipmap.sc3); | |||
}else | |||
{ | |||
image.setImageResource(R.mipmap.wsc3); | |||
} | |||
} | |||
@NonNull | |||
@Override | |||
protected ViewHolder onCreateSectionItemViewHolder(@NonNull ViewGroup viewGroup) { | |||
Context context = viewGroup.getContext(); | |||
//这里是通过xml绑定布局,当然你也可以用代码new出来,方法请看头部视图 | |||
View itemView = LayoutInflater.from(context).inflate(R.layout.note_rv_tree_second, viewGroup, false); | |||
return new ViewHolder(itemView); | |||
} | |||
} |
@@ -0,0 +1,62 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.content.Context; | |||
import android.graphics.Color; | |||
import android.support.annotation.Nullable; | |||
import android.support.v7.widget.AppCompatImageView; | |||
import android.util.AttributeSet; | |||
import android.view.Gravity; | |||
import android.view.ViewGroup; | |||
import android.widget.ImageView; | |||
import android.widget.LinearLayout; | |||
import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.qmuiteam.qmui.util.QMUIDisplayHelper; | |||
import com.qmuiteam.qmui.util.QMUIResHelper; | |||
public class QDSectionHeaderView extends LinearLayout { | |||
private TextView mTitleTv; | |||
private ImageView mArrowView; | |||
private int headerHeight = QMUIDisplayHelper.dp2px(getContext(), 56); | |||
public QDSectionHeaderView(Context context) { | |||
this(context, null); | |||
} | |||
public QDSectionHeaderView(Context context, @Nullable AttributeSet attrs) { | |||
super(context, attrs); | |||
setOrientation(LinearLayout.HORIZONTAL); | |||
setGravity(Gravity.CENTER_VERTICAL); | |||
setBackgroundColor(Color.WHITE); | |||
int paddingHor = QMUIDisplayHelper.dp2px(context, 24); | |||
mTitleTv = new TextView(getContext()); | |||
mTitleTv.setTextSize(16); | |||
mTitleTv.setTextColor(Color.BLACK); | |||
mTitleTv.setPadding(paddingHor, 0, paddingHor, 0); | |||
addView(mTitleTv, new LinearLayout.LayoutParams( | |||
0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f)); | |||
mArrowView = new AppCompatImageView(context); | |||
mArrowView.setImageDrawable(QMUIResHelper.getAttrDrawable(getContext(), | |||
R.attr.qmui_common_list_item_chevron)); | |||
mArrowView.setScaleType(ImageView.ScaleType.CENTER); | |||
addView(mArrowView, new LinearLayout.LayoutParams(headerHeight, headerHeight)); | |||
} | |||
public ImageView getArrowView() { | |||
return mArrowView; | |||
} | |||
public void render(SectionHeader header, boolean isFold) { | |||
mTitleTv.setText(header.getText()); | |||
mArrowView.setRotation(isFold ? 0f : 90f); | |||
} | |||
@Override | |||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |||
super.onMeasure(widthMeasureSpec, | |||
MeasureSpec.makeMeasureSpec(headerHeight, MeasureSpec.EXACTLY)); | |||
} | |||
} |
@@ -0,0 +1,64 @@ | |||
/* | |||
* Tencent is pleased to support the open source community by making QMUI_Android available. | |||
* | |||
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. | |||
* | |||
* Licensed under the MIT License (the "License"); you may not use this file except in | |||
* compliance with the License. You may obtain a copy of the License at | |||
* | |||
* http://opensource.org/licenses/MIT | |||
* | |||
* Unless required by applicable law or agreed to in writing, software distributed under the License is | |||
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | |||
* either express or implied. See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import com.qmuiteam.qmui.widget.section.QMUISection; | |||
/** | |||
* 选中头 | |||
*/ | |||
public class SectionHeader implements QMUISection.Model<SectionHeader> { | |||
private String tvText; | |||
private String tvDate; | |||
private String tvTotalAmount; | |||
public SectionHeader(String name1, String name2, String name3) { | |||
this.tvText = name1; | |||
this.tvDate = name2; | |||
this.tvTotalAmount = name3; | |||
} | |||
public String getText() { | |||
return tvText; | |||
} | |||
public String getDate() { | |||
return tvDate; | |||
} | |||
public String getTotalAmount() { | |||
return tvTotalAmount; | |||
} | |||
@Override | |||
public SectionHeader cloneForDiff() { | |||
return new SectionHeader(getText(), getDate(), getTotalAmount()); | |||
} | |||
@Override | |||
public boolean isSameItem(SectionHeader other) { | |||
return tvText == other.tvText || (tvText != null && tvText.equals(other.tvText)) | |||
&& tvDate == other.tvDate || (tvDate != null && tvDate.equals(other.tvDate)) | |||
&& tvTotalAmount == other.tvTotalAmount || (tvTotalAmount != null && tvTotalAmount.equals(other.tvTotalAmount)); | |||
} | |||
@Override | |||
public boolean isSameContent(SectionHeader other) { | |||
return true; | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
/* | |||
* Tencent is pleased to support the open source community by making QMUI_Android available. | |||
* | |||
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. | |||
* | |||
* Licensed under the MIT License (the "License"); you may not use this file except in | |||
* compliance with the License. You may obtain a copy of the License at | |||
* | |||
* http://opensource.org/licenses/MIT | |||
* | |||
* Unless required by applicable law or agreed to in writing, software distributed under the License is | |||
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | |||
* either express or implied. See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import com.qmuiteam.qmui.widget.section.QMUISection; | |||
/** | |||
* 选中Item | |||
*/ | |||
public class SectionItem implements QMUISection.Model<SectionItem> { | |||
/** | |||
* 标签 | |||
*/ | |||
private String tvTag; | |||
/** | |||
* 备注 | |||
*/ | |||
private String tvNote; | |||
/** | |||
* 金额 | |||
*/ | |||
private String tvAccount; | |||
/** | |||
* 是否收藏 | |||
*/ | |||
private Boolean IsSC; | |||
public SectionItem(String name1, String name2, String name3,boolean isSC) { | |||
this.tvTag = name1; | |||
this.tvNote = name2; | |||
this.tvAccount = name3; | |||
this.IsSC=isSC; | |||
} | |||
public String getTag() { | |||
return tvTag; | |||
} | |||
public String getNote() { | |||
return tvNote; | |||
} | |||
public String getAccount() { | |||
return tvAccount; | |||
} | |||
public Boolean getIsSC() { | |||
return IsSC; | |||
} | |||
@Override | |||
public SectionItem cloneForDiff() { | |||
return new SectionItem(getTag(), getNote(), getAccount(),getIsSC()); | |||
} | |||
@Override | |||
public boolean isSameItem(SectionItem other) { | |||
return tvTag == other.tvTag || (tvTag != null && tvTag.equals(other.tvTag)) | |||
&& tvNote == other.tvNote || (tvNote != null && tvNote.equals(other.tvNote)) | |||
&& IsSC == other.IsSC || (IsSC != null && IsSC.equals(other.IsSC)) | |||
&& tvAccount == other.tvAccount || (tvAccount != null && tvAccount.equals(other.tvAccount)); | |||
} | |||
@Override | |||
public boolean isSameContent(SectionItem other) { | |||
return true; | |||
} | |||
} |
@@ -0,0 +1,30 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:color="@color/black" | |||
android:radius="-1dp"> | |||
<item android:state_pressed="true"> | |||
<shape> | |||
<solid android:color="@color/gray_deep" /> | |||
<corners android:radius="3dp" /> | |||
</shape> | |||
</item> | |||
<item android:state_enabled="false"> | |||
<shape> | |||
<solid android:color="#cccccc" /> | |||
<corners android:radius="3dp" /> | |||
</shape> | |||
</item> | |||
<item> | |||
<shape> | |||
<solid android:color="@color/white" /> | |||
<corners android:radius="3dp" /> | |||
<stroke | |||
android:width="1dp" | |||
android:color="@color/gray" /> | |||
</shape> | |||
</item> | |||
</ripple> |
@@ -0,0 +1,30 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:color="@color/black" | |||
android:radius="-1dp"> | |||
<item android:state_pressed="true"> | |||
<shape> | |||
<solid android:color="@color/orange_primary_dark" /> | |||
<corners android:radius="3dp" /> | |||
</shape> | |||
</item> | |||
<item android:state_enabled="false"> | |||
<shape> | |||
<solid android:color="#cccccc" /> | |||
<corners android:radius="3dp" /> | |||
</shape> | |||
</item> | |||
<item> | |||
<shape> | |||
<solid android:color="@color/yellow_primary_dark" /> | |||
<corners android:radius="3dp" /> | |||
<stroke | |||
android:width="1dp" | |||
android:color="@color/amber_primary" /> | |||
</shape> | |||
</item> | |||
</ripple> |
@@ -0,0 +1,15 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<!-- 在Topbar下方的Tab面板的背景,带底部分割线 --> | |||
<inset xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:insetLeft="@dimen/list_divider_height_negative" | |||
android:insetTop="@dimen/list_divider_height_negative" | |||
android:insetRight="@dimen/list_divider_height_negative"> | |||
<shape> | |||
<solid android:color="@color/tab_panel_bg" /> | |||
<stroke | |||
android:width="1dp" | |||
android:color="@color/gray" /> | |||
</shape> | |||
</inset> |
@@ -15,14 +15,14 @@ | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/qmui_config_color_white"> | |||
<RelativeLayout style="@style/button_wrapper_style"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:text="这里请编写菜谱界面!"> | |||
</com.qmuiteam.qmui.widget.textview.QMUILinkTextView> | |||
android:background="@color/activity_background"> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout | |||
android:id="@+id/qmuisection_layout" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"/> | |||
</RelativeLayout> | |||
</ScrollView> | |||
</LinearLayout> |
@@ -16,13 +16,239 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/qmui_config_color_white"> | |||
<RelativeLayout style="@style/button_wrapper_style"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:text="功能研发中..."> | |||
</com.qmuiteam.qmui.widget.textview.QMUILinkTextView> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:layout_marginLeft="30dp" | |||
android:layout_marginRight="30dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginBottom="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="120dp"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||
android:layout_width="80dp" | |||
android:layout_height="80dp" | |||
android:src="@mipmap/hgr" | |||
/> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:paddingHorizontal="11dp" | |||
android:text="菜谱封面"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_alignParentRight="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="菜谱名称:"/> | |||
<!--账号输入框--> | |||
<EditText | |||
android:layout_width="160dp" | |||
android:layout_height="wrap_content" | |||
android:layout_gravity="fill" | |||
android:background="@drawable/input_bj" | |||
android:paddingLeft="5dp" | |||
android:hint="菜谱名称" | |||
android:maxLength="20" | |||
android:textColor="?attr/qmui_config_color_gray_5" | |||
android:textSize="?attr/qmui_common_list_item_detail_h_text_size" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="20dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="菜系选择:"/> | |||
<!--账号输入框--> | |||
<Spinner android:layout_width="160dp" | |||
android:layout_height="20dp" | |||
android:layout_gravity="fill" | |||
android:paddingLeft="5dp" | |||
android:background="@drawable/input_bj" | |||
> | |||
</Spinner> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<!--边框分割细线--> | |||
<LinearLayout | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="1dp" | |||
android:background="@drawable/qmui_s_list_item_bg_with_border_bottom" /> | |||
</RelativeLayout> | |||
<LinearLayout android:layout_width="match_parent" | |||
android:layout_height="400dp" | |||
android:layout_marginTop="@dimen/dp_10"> | |||
<RelativeLayout | |||
android:layout_width="160dp" | |||
android:layout_height="wrap_content"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="规格:"/> | |||
<Spinner android:layout_width="match_parent" | |||
android:layout_height="20dp" | |||
android:layout_gravity="fill" | |||
android:paddingLeft="5dp" | |||
android:background="@drawable/input_bj"/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="步骤:"/> | |||
<Button | |||
android:layout_width="50dp" | |||
android:layout_height="30dp" | |||
android:background="@drawable/button" | |||
android:text="上移" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="30dp" | |||
android:background="@drawable/button" | |||
android:text="下移" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<Button | |||
android:layout_centerHorizontal="true" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="30dp" | |||
android:background="@drawable/button1" | |||
android:text="操作模式" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<!--边框分割细线--> | |||
<LinearLayout | |||
android:layout_alignParentLeft="true" | |||
android:layout_marginTop="@dimen/dp_40" | |||
android:layout_marginBottom="@dimen/dp_40" | |||
android:layout_width="1dp" | |||
android:layout_height="match_parent" | |||
android:background="@drawable/qmui_s_list_item_bg_with_border_bottom" /> | |||
<LinearLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="烹饪工序:"/> | |||
<Spinner android:layout_width="match_parent" | |||
android:layout_height="20dp" | |||
android:layout_gravity="fill" | |||
android:paddingLeft="5dp" | |||
android:background="@drawable/input_bj"/> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:layout_width="50dp" | |||
android:layout_height="30dp" | |||
android:background="@drawable/button1" | |||
android:text="添加" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="30dp" | |||
android:background="@drawable/button" | |||
android:text="修改" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
<Button | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_width="50dp" | |||
android:layout_height="30dp" | |||
android:background="@drawable/button" | |||
android:text="删除" | |||
android:textColor="@color/black" | |||
android:textSize="14dp"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<Button | |||
android:layout_centerInParent="true" | |||
android:layout_marginTop="20dp" | |||
android:layout_centerHorizontal="true" | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="180dp" | |||
android:layout_height="wrap_content" | |||
android:background="@drawable/button1" | |||
android:text="生成菜谱" | |||
android:textColor="@color/black" | |||
android:textSize="19dp"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</ScrollView> | |||
</LinearLayout> |
@@ -17,9 +17,11 @@ android:orientation="vertical"> | |||
<ScrollView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/qmui_config_color_white"> | |||
android:background="@color/activity_background"> | |||
<RelativeLayout style="@style/button_wrapper_style"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<!-- <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton--> | |||
<!-- android:id="@+id/button"--> | |||
@@ -34,15 +36,94 @@ android:orientation="vertical"> | |||
<!-- app:qmui_borderColor="@color/qmui_s_link_color"--> | |||
<!-- app:qmui_borderWidth="1px"/>--> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:text="这里请编写主页小炒制作界面!https://129.33.4.5.com这里请编写主页小炒制作界面这里请编写主页小炒制作界面"> | |||
android:orientation="vertical"> | |||
<!-- 选择菜谱 --> | |||
<LinearLayout | |||
android:background="@color/qmui_config_color_white" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:padding="5dp"> | |||
<ImageView | |||
android:layout_width="20dp" | |||
android:layout_height="20dp" | |||
android:src="@mipmap/stcp"/> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="选择菜谱"/> | |||
</LinearLayout> | |||
</com.qmuiteam.qmui.widget.textview.QMUILinkTextView> | |||
<!-- 开始启动 --> | |||
<LinearLayout | |||
android:layout_marginTop="5dp" | |||
android:background="#E3DEDD" | |||
android:layout_width="match_parent" | |||
android:layout_height="60dp" | |||
android:padding="5dp"> | |||
<RelativeLayout | |||
android:layout_width="60dp" | |||
android:layout_height="match_parent"> | |||
<ImageView | |||
android:layout_centerInParent="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/qdzz"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="菜谱名称" | |||
android:textSize="16dp"/> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_alignParentRight="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="预计剩余时间:300s"/> | |||
<com.qmuiteam.qmui.widget.QMUIProgressBar | |||
android:layout_alignParentBottom="true" | |||
android:layout_width="match_parent" | |||
android:layout_height="24dp" | |||
android:textColor="@color/qmui_config_color_white" | |||
android:textSize="16sp" | |||
app:qmui_background_color="@color/qmui_config_color_gray_8" | |||
app:qmui_progress_color="@color/app_color_blue_2" | |||
app:qmui_type="type_rect" | |||
app:qmui_max_value="100" | |||
app:qmui_value="20"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<!-- 火力选择 --> | |||
<RelativeLayout | |||
android:layout_marginTop="5dp" | |||
android:padding="5dp" | |||
android:background="@color/qmui_config_color_white" | |||
android:layout_width="match_parent" | |||
android:layout_height="60dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerVertical="true" | |||
android:textSize="16dp" | |||
android:text="火力选择"/> | |||
</RelativeLayout> | |||
<!-- 液体 --> | |||
<RelativeLayout | |||
android:layout_marginTop="5dp" | |||
android:padding="5dp" | |||
android:background="#DAD6D6" | |||
android:layout_width="match_parent" | |||
android:layout_height="120dp"> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</ScrollView> | |||
@@ -0,0 +1,73 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:layout_width="150dp" | |||
android:layout_height="200dp" | |||
android:background="@color/white" | |||
android:layout_marginTop="5dp" | |||
android:layout_marginLeft="5dp" | |||
android:layout_marginBottom="5dp"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:id="@+id/ImageUrl" | |||
android:layout_margin="3dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="130dp" | |||
/> | |||
<TextView | |||
android:id="@+id/Tag_text" | |||
android:layout_marginLeft="5dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
tools:ignore="MissingConstraints" | |||
android:textColor="@color/gray_deep" | |||
android:text="清炒三月瓜"/> | |||
<TextView | |||
android:id="@+id/Note_text" | |||
android:textSize="10dp" | |||
android:textColor="@color/gray" | |||
android:layout_marginLeft="5dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
tools:ignore="MissingConstraints" | |||
android:text="时间:185秒"/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="5dp"> | |||
<TextView | |||
android:id="@+id/Sc_text" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:textSize="12dp" | |||
android:textColor="@color/light_blue_primary" | |||
android:text="上传"/> | |||
<TextView | |||
android:id="@+id/delete_text" | |||
android:layout_marginRight="20dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textSize="12dp" | |||
android:layout_alignParentRight="true" | |||
android:textColor="@color/red_primary_dark" | |||
android:text="删除"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<ImageView | |||
android:id="@+id/sc_image" | |||
android:layout_alignParentRight="true" | |||
android:layout_width="30dp" | |||
android:layout_height="30dp" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:src="@mipmap/wsc3"/> | |||
</RelativeLayout> |
@@ -0,0 +1,14 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<resources> | |||
<string-array name="chaiping"> | |||
<item>川菜</item> | |||
<item>鲁菜</item> | |||
<item>粤菜</item> | |||
<item>苏菜</item> | |||
<item>闽菜</item> | |||
<item>浙菜</item> | |||
<item>湘菜</item> | |||
<item>浙菜</item> | |||
<item>徽菜</item> | |||
</string-array> | |||
</resources> |
@@ -96,6 +96,11 @@ | |||
<item name="android:background">@drawable/qmui_divider_bottom_bitmap</item> | |||
</style> | |||
<style name="jb_style"> | |||
<item name="android:layout_width">wrap_content</item> | |||
<item name="android:layout_height">wrap_content</item> | |||
</style> | |||
<style name="DialogTheme2" parent="QMUI.Dialog"> | |||
<item name="qmui_dialog_wrapper_style">@style/dialog_wrapper_style_63</item> | |||
<item name="qmui_dialog_title_style">@style/DialogTheme2TitleStyle</item> | |||