1
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.example.ninefourone.nutritionmaster.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/9/9.
|
||||
*/
|
||||
|
||||
public class MenuAdapter extends RecyclerView.Adapter<MenuHolder> {
|
||||
private ArrayList<String> mList;
|
||||
private Context mContext;
|
||||
|
||||
public MenuAdapter(ArrayList mList, Context mContext) {
|
||||
this.mList = mList;
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MenuHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.menu_item, parent, false);
|
||||
return new MenuHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(MenuHolder holder, int position) {
|
||||
holder.bindView(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.example.ninefourone.nutritionmaster.adapter;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/9/9.
|
||||
*/
|
||||
|
||||
public class MenuHolder extends RecyclerView.ViewHolder {
|
||||
@BindView(R.id.text)
|
||||
TextView textView;
|
||||
|
||||
public MenuHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
}
|
||||
|
||||
public void bindView(String text) {
|
||||
textView.setText(text);
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,12 @@ package com.example.ninefourone.nutritionmaster.modules;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -62,20 +64,13 @@ public class MainActivity extends BaseActivity {
|
||||
NoScrollViewPager viewPager;
|
||||
@BindView(R.id.sliding_tab_layout)
|
||||
SlidingTabLayout slidingTabLayout;
|
||||
@BindView(R.id.bar_cover)
|
||||
FrameLayout barCover;
|
||||
@BindView(R.id.cb_rating_bar)
|
||||
CBRatingBar cbRatingBar;
|
||||
@BindView(R.id.toolbar_user_avatar)
|
||||
CircularImageView toolbarUserAvatar;
|
||||
@BindView(R.id.drawer_user_avatar)
|
||||
CircularImageView drawerUserAvatar;
|
||||
// @BindView(R.id.spiderWeb_mainActivity)
|
||||
// SpiderWebScoreView spiderWebMainActivity;
|
||||
// @BindView(R.id.layout_mainActivity_circular)
|
||||
// CircularLayout layoutMainActivityCircular;
|
||||
// @BindView(R.id.search_button)
|
||||
// ImageView searchButton;
|
||||
|
||||
@BindView(R.id.search_view)
|
||||
MaterialSearchView searchView;
|
||||
@BindView(R.id.tool_bar)
|
||||
@@ -88,6 +83,8 @@ public class MainActivity extends BaseActivity {
|
||||
ImageView addInformationButton;
|
||||
@BindView(R.id.information_layout)
|
||||
LinearLayout informationLayout;
|
||||
@BindView(R.id.title_layout)
|
||||
AppBarLayout titleLayout;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -99,14 +96,16 @@ public class MainActivity extends BaseActivity {
|
||||
public void initViews(Bundle savedInstanceState) {
|
||||
mDrawer.setTouchMode(ElasticDrawer.TOUCH_MODE_BEZEL);
|
||||
mDrawer.setOnDrawerStateChangeListener(new ElasticDrawer.OnDrawerStateChangeListener() {
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
@SuppressLint("ResourceAsColor")
|
||||
@Override
|
||||
public void onDrawerStateChange(int oldState, int newState) {
|
||||
if (newState == ElasticDrawer.STATE_CLOSED) {
|
||||
barCover.setVisibility(View.INVISIBLE);
|
||||
titleLayout.setBackgroundColor(getColor(R.color.colorPrimary));
|
||||
} else {
|
||||
barCover.setVisibility(View.VISIBLE);
|
||||
titleLayout.setBackgroundColor(getColor(R.color.bar_open));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,6 +153,7 @@ public class MainActivity extends BaseActivity {
|
||||
ButterKnife.bind(this);
|
||||
Logger.d("oncreate");
|
||||
setSupportActionBar(toolBar);
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
askPermission();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,43 @@
|
||||
package com.example.ninefourone.nutritionmaster.modules.RecipeActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.widget.NestedScrollView;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.adapter.MenuAdapter;
|
||||
import com.example.ninefourone.nutritionmaster.base.BaseActivity;
|
||||
import com.example.ninefourone.nutritionmaster.bean.Menu;
|
||||
import com.example.ninefourone.nutritionmaster.bean.RecommendFood;
|
||||
import com.example.ninefourone.nutritionmaster.utils.UiUtils;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
||||
public class RecipeActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.recipe_list)
|
||||
RecyclerView recipeList;
|
||||
@BindView(R.id.nested_scorll_view)
|
||||
NestedScrollView nestedScorllView;
|
||||
@BindView(R.id.tv_title)
|
||||
TextView tvTitle;
|
||||
@BindView(R.id.tv_subTitle)
|
||||
TextView tvSubTitle;
|
||||
@BindView(R.id.ll_title)
|
||||
LinearLayout llTitle;
|
||||
private RecommendFood recommendFood;
|
||||
private Menu menu;
|
||||
|
||||
private ArrayList<String> menuList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -27,9 +50,27 @@ public class RecipeActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void initViews(Bundle savedInstanceState) {
|
||||
|
||||
final int changedHeight = UiUtils.dp2px(this, 214);
|
||||
nestedScorllView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
|
||||
@Override
|
||||
public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||
|
||||
float scale = (float) v.getScrollY() / changedHeight;
|
||||
//变化范围0-255 表示从透明到纯色背景
|
||||
float alpha = scale * 255 >= 255 ? 255 : scale * 255;
|
||||
|
||||
llTitle.setBackgroundColor(Color.argb((int) alpha, 212, 62, 55));
|
||||
tvTitle.setTextColor(Color.argb((int) alpha, 255, 255, 255));
|
||||
tvSubTitle.setTextColor(Color.argb((int) alpha, 255, 255, 255));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Intent intent = getIntent();
|
||||
recommendFood = (RecommendFood) intent.getSerializableExtra("SEND_OBJECT");
|
||||
Logger.d(recommendFood.getItemType());
|
||||
initList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,4 +82,18 @@ public class RecipeActivity extends BaseActivity {
|
||||
public void onPointerCaptureChanged(boolean hasCapture) {
|
||||
|
||||
}
|
||||
|
||||
private void initList() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
menuList.add("1");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initRecyclerView() {
|
||||
super.initRecyclerView();
|
||||
MenuAdapter adapter = new MenuAdapter(menuList, this);
|
||||
recipeList.setAdapter(adapter);
|
||||
recipeList.setLayoutManager(new LinearLayoutManager(this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.example.ninefourone.nutritionmaster.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
|
||||
public class UiUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 动态获取屏幕的宽度
|
||||
* @param context context
|
||||
* @return
|
||||
*/
|
||||
public static int getDeviceWidth(Context context){
|
||||
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
|
||||
return metrics.widthPixels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态获取屏幕的高度
|
||||
* @param context context
|
||||
* @return
|
||||
*/
|
||||
public static int getDeviceHeight(Context context){
|
||||
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
|
||||
return metrics.heightPixels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将dp转为px
|
||||
* @param context context
|
||||
* @param dpValue dp值
|
||||
* @return
|
||||
*/
|
||||
public static int dp2px(Context context, float dpValue){
|
||||
float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int)(dpValue * scale +0.5f);
|
||||
}
|
||||
}
|
||||
@@ -21,90 +21,70 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="110dp">
|
||||
|
||||
<FrameLayout
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/tool_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:scaleType="fitXY"
|
||||
app:contentInsetStart="0dp"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/AppTheme">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/bar_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="110dp"
|
||||
android:background="@color/bar_open"
|
||||
android:visibility="gone">
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/tool_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:contentInsetStart="0dp"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/navigation_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:id="@+id/navigation_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<ImageView
|
||||
<ImageView
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_drawer_home" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_drawer_home" />
|
||||
|
||||
<com.github.siyamed.shapeimageview.CircularImageView
|
||||
android:id="@+id/toolbar_user_avatar"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:src="@drawable/test_avatar" />
|
||||
<com.github.siyamed.shapeimageview.CircularImageView
|
||||
android:id="@+id/toolbar_user_avatar"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="31dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:src="@drawable/test_avatar" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:maxLines="1"
|
||||
android:text="营养大师"
|
||||
android:textColor="#FFFF"
|
||||
android:textSize="15sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:maxLines="1"
|
||||
android:text="营养大师"
|
||||
android:textColor="#FFFF"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
|
||||
<com.flyco.tablayout.SlidingTabLayout
|
||||
android:id="@+id/sliding_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
app:tl_indicator_corner_radius="1dp"
|
||||
app:tl_indicator_height="2dp"
|
||||
app:tl_indicator_width="40dp"
|
||||
app:tl_tab_space_equal="true">
|
||||
|
||||
</com.flyco.tablayout.SlidingTabLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
|
||||
<com.flyco.tablayout.SlidingTabLayout
|
||||
android:id="@+id/sliding_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
app:tl_indicator_corner_radius="1dp"
|
||||
app:tl_indicator_height="2dp"
|
||||
app:tl_indicator_width="40dp"
|
||||
app:tl_tab_space_equal="true">
|
||||
|
||||
</com.flyco.tablayout.SlidingTabLayout>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<com.example.ninefourone.nutritionmaster.ui.NoScrollViewPager
|
||||
|
||||
@@ -1,9 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.ninefourone.nutritionmaster.modules.RecipeActivity.RecipeActivity">
|
||||
android:clipToPadding="false"
|
||||
android:fitsSystemWindows="true">
|
||||
<!--clipToPadding = false-->
|
||||
<!--令布局可以延伸到状态栏-->
|
||||
|
||||
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
android:id="@+id/nested_scorll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/layout_menu_head_info" />
|
||||
|
||||
|
||||
<!--<LinearLayout-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:orientation="vertical">-->
|
||||
|
||||
<!--<LinearLayout-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:orientation="horizontal">-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:text="花费:">-->
|
||||
|
||||
<!--</TextView>-->
|
||||
|
||||
<!--<ImageView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--android:paddingLeft="12dp"-->
|
||||
<!--android:src="@drawable/ic_right_arch" />-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/detail_cost_text_view"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:paddingLeft="5dp"-->
|
||||
<!--android:text="详细电话咨询">-->
|
||||
|
||||
<!--</TextView>-->
|
||||
|
||||
<!--</LinearLayout>-->
|
||||
|
||||
<!--<LinearLayout-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:orientation="horizontal"-->
|
||||
<!--android:paddingTop="10dp">-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:text="咨询电话:">-->
|
||||
|
||||
<!--</TextView>-->
|
||||
|
||||
<!--<ImageView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--android:paddingLeft="12dp"-->
|
||||
<!--android:src="@drawable/ic_back_button" />-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/detail_call_text_view"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:paddingLeft="5dp"-->
|
||||
<!--android:text="店家未填写">-->
|
||||
|
||||
<!--</TextView>-->
|
||||
|
||||
<!--</LinearLayout>-->
|
||||
<!--</LinearLayout>-->
|
||||
|
||||
<!--<ImageView-->
|
||||
<!--android:id="@+id/detail_make_call_button"-->
|
||||
<!--android:layout_width="60dp"-->
|
||||
<!--android:layout_height="60dp"-->
|
||||
<!--android:layout_alignParentRight="true"-->
|
||||
<!--android:layout_centerVertical="true"-->
|
||||
<!--android:layout_marginRight="24dp"-->
|
||||
<!--android:src="@drawable/ic_copy" />-->
|
||||
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recipe_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</android.support.v7.widget.RecyclerView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</android.support.v4.widget.NestedScrollView>
|
||||
|
||||
|
||||
<include layout="@layout/layout_menu_detail_title" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
82
app/src/main/res/layout/layout_menu_detail_title.xml
Normal file
82
app/src/main/res/layout/layout_menu_detail_title.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/status_bar_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_back"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/ic_back_button">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/ic_exchange" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="1px"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:layout_marginTop="14dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:textSize="@dimen/sp_16"
|
||||
tools:text="标题" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_subTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
tools:text="副标题" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_right_icon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_title_right_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
183
app/src/main/res/layout/layout_menu_head_info.xml
Normal file
183
app/src/main/res/layout/layout_menu_head_info.xml
Normal file
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rl_restaurant_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="284dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_blur_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/ic_exchange"
|
||||
android:foreground="@drawable/ic_back_button"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/fl_restaurant_img"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="14dp"
|
||||
android:background="@color/colorControlNormal"
|
||||
android:padding="1dp"
|
||||
app:cardCornerRadius="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_restaurant_img"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/fl_restaurant_img"
|
||||
android:layout_alignTop="@id/fl_restaurant_img"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="22dp"
|
||||
android:layout_toRightOf="@id/fl_restaurant_img"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_restaurant_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="店名"
|
||||
android:textColor="@color/color_bar_deeper"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_restaurant_score"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="8.5"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_snum"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/tv_restaurant_score"
|
||||
android:layout_alignTop="@id/tv_restaurant_score"
|
||||
android:layout_marginLeft="@dimen/dp_4"
|
||||
android:layout_toRightOf="@id/tv_restaurant_score"
|
||||
android:gravity="center_vertical"
|
||||
android:text="(16.2万人评)"
|
||||
android:textColor="@color/place_holder"
|
||||
android:textSize="11sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pro_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/tv_restaurant_score"
|
||||
android:layout_alignTop="@id/tv_restaurant_score"
|
||||
android:layout_marginLeft="@dimen/dp_4"
|
||||
android:layout_toRightOf="@id/tv_restaurant_score"
|
||||
android:gravity="center_vertical"
|
||||
android:text="(16.2万人评)"
|
||||
android:textColor="@color/bar_open"
|
||||
android:textSize="11sp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_src_dur"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:text="火锅、自助"
|
||||
android:textColor="@color/colorControlNormal"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:layout_marginLeft="14dp"
|
||||
android:layout_marginRight="14dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="6dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/ic_right_arch"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_search" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="14dp"
|
||||
android:drawablePadding="14dp"
|
||||
android:gravity="center"
|
||||
android:text="喜欢"
|
||||
android:textColor="@color/cardview_light_background" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/test_avatar"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_search" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="14dp"
|
||||
android:drawablePadding="14dp"
|
||||
android:text="评分"
|
||||
android:textColor="@color/colorControlNormal" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
12
app/src/main/res/layout/menu_item.xml
Normal file
12
app/src/main/res/layout/menu_item.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user