仿途牛旅游详情页面 置顶功能

仿途牛旅游详情页面 置顶功能_第1张图片

仿途牛旅游详情页面 置顶功能_第2张图片

这个是从项目中抽取出来的
很多东西没有删除,
有需要的可以自己修改,并不是很复杂。就是东西多了一点


public class MainActivity extends Activity implements OnClickListener,
        OnScrollListener {

    private PullToRefreshScrollView mScrollView;// 下拉刷新上拉加载
    // private TextView preprice;// 原来价格

    private int screen_width;// 获取到手机屏幕宽度的变量
    private int table_width;// 在手机上显示的每一个标签的宽度变量
    private View otherline;// 下划线
    private View mytitlebarline;// 分割线
    private TextView wurixing;// 五日行程
    private TextView chanpin;// 产品特色
    private TextView feiyong;// 费用说明
    private TextView yuding;// 预定须知
    private int indicatebarTop;// 中部导航栏距离
    private int productcharaTop;// 产品特色距离
    private int feestateTop;// 费用说明距离
    private int ordernoticeTop;// 预定须知距离
    private RelativeLayout indicatebarcontext;// 中部导航内容
    private LinearLayout indicatebar;// 中部导航栏
    private LinearLayout topindicatebar;// 滑动到顶部的中部导航栏
    private LinearLayout productchara;// 产品特色
    private LinearLayout feestate;// 费用说明
    private LinearLayout ordernotice;// 预定须知
    private LinearLayout tourist_comment;// 游客点评
    private LayoutParams lp;// 设置控件参数
    private ImageView triptedail;// 行程详情
    private ImageView backtop;// 回到顶部
    private LinearLayout savetrip;// 收藏
    private TextView orderNow;// 立即预定
    private ListViewExt tdetail_listview;// 行程详情

    private boolean isTrue;

    private int num = 0;
    private String[] data = { "第一天钓鱼", "第二天打酱油", "第三天上网", "第四天爬山", "第五天旅游",
            "第六天旅游", "第七天打酱油" };

    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);// 去掉标题栏
        setContentView(R.layout.activity_main);

        findViews();
        initViews();
        layoutSize();
    }

    protected void findViews() {

        // preprice = (TextView) findViewById(R.id.proprice);
        otherline = findViewById(R.id.otherline);
        mytitlebarline = findViewById(R.id.mytitlebarline);
        wurixing = (TextView) findViewById(R.id.wurixing);
        chanpin = (TextView) findViewById(R.id.chanpin);
        feiyong = (TextView) findViewById(R.id.feiyong);
        yuding = (TextView) findViewById(R.id.yuding);
        indicatebar = (LinearLayout) findViewById(R.id.indicatebar);
        topindicatebar = (LinearLayout) findViewById(R.id.topindicatebar);
        indicatebarcontext = (RelativeLayout) findViewById(R.id.indicatebarcontext);
        productchara = (LinearLayout) findViewById(R.id.productchara);
        feestate = (LinearLayout) findViewById(R.id.feestate);
        ordernotice = (LinearLayout) findViewById(R.id.ordernotice);
        tourist_comment = (LinearLayout) findViewById(R.id.tourist_comment);
        triptedail = (ImageView) findViewById(R.id.triptedail);
        backtop = (ImageView) findViewById(R.id.backtop);
        savetrip = (LinearLayout) findViewById(R.id.savetrip);
        orderNow = (TextView) findViewById(R.id.orderNow);

        tdetail_listview = (ListViewExt) findViewById(R.id.tdetail_listview);
        mScrollView = (PullToRefreshScrollView) findViewById(R.id.mScrollView);

    }

    protected void initViews() {

        wurixing.setOnClickListener(this);
        chanpin.setOnClickListener(this);
        feiyong.setOnClickListener(this);
        yuding.setOnClickListener(this);
        triptedail.setOnClickListener(this);
        backtop.setOnClickListener(this);
        savetrip.setOnClickListener(this);
        orderNow.setOnClickListener(this);
        tourist_comment.setOnClickListener(this);
        mScrollView.setOnScrollListener(this);

        ArrayAdapter adapter = new ArrayAdapter(
                MainActivity.this, android.R.layout.simple_list_item_1, data);
        tdetail_listview.setAdapter(adapter);

        // 获取手机频幕的宽高
        Display display = getWindow().getWindowManager().getDefaultDisplay();
        DisplayMetrics metris = new DisplayMetrics();
        display.getMetrics(metris);
        // 将手机的宽赋值给一个变量
        screen_width = metris.widthPixels;
        table_width = screen_width / 4;
        lp = (LayoutParams) otherline.getLayoutParams();
        lp.width = table_width;
        otherline.setLayoutParams(lp);

        // preprice.getPaint().setAntiAlias(true);// 抗锯齿
        // preprice.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG); // 中划线

        mScrollView.setOnRefreshListener(new OnRefreshListener2() {

            @Override
            public void onPullDownToRefresh(
                    PullToRefreshBase refreshView) {
                mScrollView.onRefreshComplete();
            }

            @Override
            public void onPullUpToRefresh(
                    PullToRefreshBase refreshView) {
                mScrollView.onRefreshComplete();
            }

        });
    }

    @SuppressWarnings("deprecation")
    @Override
    public void onScroll(int scrollY) {

        // 设置中部导航栏
        if (scrollY >= productcharaTop && scrollY < feestateTop) {
            lp.leftMargin = (int) (1 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_222222));
            chanpin.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            feiyong.setTextColor(getResources().getColor(R.color.color_222222));
            yuding.setTextColor(getResources().getColor(R.color.color_222222));
            triptedail.setVisibility(View.GONE);

        } else if (scrollY >= feestateTop && scrollY < ordernoticeTop) {
            lp.leftMargin = (int) (2 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_222222));
            chanpin.setTextColor(getResources().getColor(R.color.color_222222));
            feiyong.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            yuding.setTextColor(getResources().getColor(R.color.color_222222));
            triptedail.setVisibility(View.GONE);

        } else if (scrollY >= ordernoticeTop) {
            lp.leftMargin = (int) (3 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_222222));
            chanpin.setTextColor(getResources().getColor(R.color.color_222222));
            feiyong.setTextColor(getResources().getColor(R.color.color_222222));
            yuding.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            triptedail.setVisibility(View.GONE);

        } else if (scrollY >= indicatebarTop) {
            if (indicatebarcontext.getParent() != topindicatebar) {
                indicatebar.removeView(indicatebarcontext);
                topindicatebar.addView(indicatebarcontext);
            }
            lp.leftMargin = (int) (0 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            chanpin.setTextColor(getResources().getColor(R.color.color_222222));
            feiyong.setTextColor(getResources().getColor(R.color.color_222222));
            yuding.setTextColor(getResources().getColor(R.color.color_222222));

            triptedail.setVisibility(View.VISIBLE);
            backtop.setVisibility(View.VISIBLE);
        } else if (scrollY < indicatebarTop) {
            if (indicatebarcontext.getParent() != indicatebar) {
                topindicatebar.removeView(indicatebarcontext);
                indicatebar.addView(indicatebarcontext);
            }
            triptedail.setVisibility(View.GONE);
            backtop.setVisibility(View.GONE);
        }

    }

    /**
     * dip,dp转化成px 用来处理不同分辨路的屏幕
     * 
     * @param context
     * @param dpValue
     * @return
     */
    private int dip2px(Context context, float dpValue) {
        float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dpValue * scale + 0.5f);
    }

    /**
     * 测量各个控件的顶部距离
     * */
    public void layoutSize() {
        ViewTreeObserver vto = indicatebar.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @SuppressWarnings("deprecation")
            @Override
            public void onGlobalLayout() {
                indicatebar.getViewTreeObserver().removeGlobalOnLayoutListener(
                        this);
                indicatebarTop = indicatebar.getTop()
                        - dip2px(MainActivity.this, 50);
            }
        });

        vto = productchara.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                productchara.getViewTreeObserver()
                        .removeGlobalOnLayoutListener(this);
                productcharaTop = productchara.getTop()
                        - dip2px(MainActivity.this, 96);
            }
        });

        vto = feestate.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                feestate.getViewTreeObserver().removeGlobalOnLayoutListener(
                        this);
                feestateTop = feestate.getTop() - dip2px(MainActivity.this, 96);
            }
        });

        vto = ordernotice.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                ordernotice.getViewTreeObserver().removeGlobalOnLayoutListener(
                        this);
                ordernoticeTop = ordernotice.getTop()
                        - dip2px(MainActivity.this, 96);
                ;
            }
        });
    }

    /**
     * 设置GirdView属性
     */
    public void setGrid(GridView gridview) {
        DisplayMetrics dm = new DisplayMetrics();
        this.getWindowManager().getDefaultDisplay().getMetrics(dm);
        int itemWidth = 170;
        int divider = 10;
        int size = 4;
        int gridviewWidth = (int) (size * (itemWidth + divider));
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                gridviewWidth, LinearLayout.LayoutParams.WRAP_CONTENT);
        gridview.setLayoutParams(params); // 设置GirdView布局参数,横向布局的关键
        gridview.setColumnWidth(itemWidth); // 设置列表项宽
        gridview.setHorizontalSpacing(divider);
        // grid.setHorizontalSpacing(divider); // 设置列表项水平间距
        // grid.setStretchMode(GridView.NO_STRETCH);
        gridview.setNumColumns(size); // 设置列数量=列表集合数
    }

    @Override
    public void onClick(View view) {

        switch (view.getId()) {

        case R.id.wurixing:
            // 五日行程
            lp.leftMargin = (int) (0 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            chanpin.setTextColor(getResources().getColor(R.color.color_222222));
            feiyong.setTextColor(getResources().getColor(R.color.color_222222));
            yuding.setTextColor(getResources().getColor(R.color.color_222222));

            mScrollView.getRefreshableView().smoothScrollTo(0, indicatebarTop);
            if (indicatebarcontext.getParent() != topindicatebar) {
                indicatebar.removeView(indicatebarcontext);
                topindicatebar.addView(indicatebarcontext);
            }
            triptedail.setVisibility(View.VISIBLE);
            backtop.setVisibility(View.VISIBLE);

            break;

        case R.id.chanpin:
            // 产品特色
            lp.leftMargin = (int) (1 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_222222));
            chanpin.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            feiyong.setTextColor(getResources().getColor(R.color.color_222222));
            yuding.setTextColor(getResources().getColor(R.color.color_222222));

            mScrollView.getRefreshableView().smoothScrollTo(0, productcharaTop);
            if (indicatebarcontext.getParent() != topindicatebar) {
                indicatebar.removeView(indicatebarcontext);
                topindicatebar.addView(indicatebarcontext);
            }
            backtop.setVisibility(View.VISIBLE);
            triptedail.setVisibility(View.GONE);

            break;

        case R.id.feiyong:
            // 费用说明
            lp.leftMargin = (int) (2 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_222222));
            chanpin.setTextColor(getResources().getColor(R.color.color_222222));
            feiyong.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            yuding.setTextColor(getResources().getColor(R.color.color_222222));

            mScrollView.getRefreshableView().smoothScrollTo(0, feestateTop);
            if (indicatebarcontext.getParent() != topindicatebar) {
                indicatebar.removeView(indicatebarcontext);
                topindicatebar.addView(indicatebarcontext);
            }
            backtop.setVisibility(View.VISIBLE);
            triptedail.setVisibility(View.GONE);

            break;

        case R.id.yuding:
            // 预定须知
            lp.leftMargin = (int) (3 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_222222));
            chanpin.setTextColor(getResources().getColor(R.color.color_222222));
            feiyong.setTextColor(getResources().getColor(R.color.color_222222));
            yuding.setTextColor(getResources().getColor(R.color.color_2ea0f9));

            mScrollView.getRefreshableView().smoothScrollTo(0, ordernoticeTop);
            if (indicatebarcontext.getParent() != topindicatebar) {
                indicatebar.removeView(indicatebarcontext);
                topindicatebar.addView(indicatebarcontext);
            }
            backtop.setVisibility(View.VISIBLE);
            triptedail.setVisibility(View.GONE);

            break;

        case R.id.triptedail:
            layoutSize();

            break;

        case R.id.backtop:
            // 回到顶部
            mScrollView.getRefreshableView().smoothScrollTo(0, 0);
            if (indicatebarcontext.getParent() != indicatebar) {
                topindicatebar.removeView(indicatebarcontext);
                indicatebar.addView(indicatebarcontext);
            }
            backtop.setVisibility(View.GONE);
            triptedail.setVisibility(View.GONE);
            lp.leftMargin = (int) (0 * table_width);
            otherline.setLayoutParams(lp);
            wurixing.setTextColor(getResources().getColor(R.color.color_2ea0f9));
            chanpin.setTextColor(getResources().getColor(R.color.color_222222));
            feiyong.setTextColor(getResources().getColor(R.color.color_222222));
            yuding.setTextColor(getResources().getColor(R.color.color_222222));

            mytitlebarline.setBackgroundColor(Color.argb(0, 217, 217, 217));

            break;

        default:
            break;
        }
    }

}

这里是XML布局


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="50dp" >

        

        <com.handmark.pulltorefresh.library.PullToRefreshScrollView
            xmlns:ptr="http://schemas.android.com/apk/res-auto"
            android:id="@+id/mScrollView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="none"
            ptr:ptrAnimationStyle="flip"
            ptr:ptrListViewExtrasEnabled="true"
            ptr:ptrMode="both"
            ptr:ptrScrollingWhileRefreshingEnabled="true" >

            

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:descendantFocusability="blocksDescendants"
                android:orientation="vertical" >

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="210dp" >

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_alignParentBottom="true"
                        android:layout_margin="10dp"
                        android:orientation="horizontal" >

                        <TextView
                            android:id="@+id/triptype"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="跟团游"
                            android:textSize="14sp" />

                        <TextView
                            android:id="@+id/tripnumber"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="产品编号:210050902"
                            android:textSize="14sp" />
                    LinearLayout>
                RelativeLayout>

                <TextView
                    android:id="@+id/triptitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="22dp"
                    android:text=""
                    android:textSize="16sp" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="15dp"
                    android:orientation="horizontal" >

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="¥"
                        android:textSize="15sp" />

                    <TextView
                        android:id="@+id/price"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text=""
                        android:textSize="18sp"
                        android:textStyle="bold" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="起"
                        android:textSize="15sp" />

                    

                    <TextView
                        android:id="@+id/proprice"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="14dp"
                        android:text="¥2519"
                        android:textSize="13sp"
                        android:visibility="gone" />
                LinearLayout>

                <TextView
                    android:id="@+id/decribe"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="15dp"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="8dp"
                    android:text=""
                    android:textSize="10sp" />

                

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="15dp"
                    android:background="#fff5f5"
                    android:orientation="vertical"
                    android:visibility="gone" >

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="10dp"
                        android:layout_marginTop="12dp"
                        android:gravity="center_vertical"
                        android:orientation="horizontal" >

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="优惠活动"
                            android:textSize="12sp" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="10dp"
                            android:gravity="center"
                            android:text="立减优惠"
                            android:textSize="10sp" />
                    LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="12dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginTop="15dp"
                        android:gravity="center_vertical"
                        android:orientation="horizontal" >

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="领券活动"
                            android:textSize="12sp" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="10dp"
                            android:gravity="center"
                            android:paddingLeft="5dp"
                            android:paddingRight="5dp"
                            android:text="40元"
                            android:textSize="10sp" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="5dp"
                            android:gravity="center"
                            android:paddingLeft="5dp"
                            android:paddingRight="5dp"
                            android:text="500元"
                            android:textSize="10sp" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="5dp"
                            android:gravity="center"
                            android:paddingLeft="5dp"
                            android:paddingRight="5dp"
                            android:text="2000元"
                            android:textSize="10sp" />
                    LinearLayout>
                LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="vertical"
                    android:padding="10dp" >

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:orientation="horizontal" >

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="出发日期"
                            android:textSize="15sp" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="10dp"
                            android:text="以下价格均为起价"
                            android:textSize="12sp" />
                    LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:orientation="horizontal" >

                        <com.example.topsuspensiondemo.ext.GridViewExt
                            android:id="@+id/departdate"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="10dp"
                            android:layout_marginTop="10dp"
                            android:layout_weight="1"
                            android:horizontalSpacing="10dp"
                            android:listSelector="#00000000"
                            android:numColumns="4"
                            android:verticalSpacing="10dp" />

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="20dp"
                            android:layout_marginRight="10dp" />
                    LinearLayout>
                LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="vertical"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp" >

                    <LinearLayout
                        android:id="@+id/tourist_comment"
                        android:layout_width="match_parent"
                        android:layout_height="46dp"
                        android:gravity="center_vertical"
                        android:orientation="horizontal" >

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="游客点评"
                            android:textSize="15sp" />

                        <View
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:layout_weight="1" />

                        <TextView
                            android:id="@+id/comment_number"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textSize="12sp" />

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="10dp" />
                    LinearLayout>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d9d9d9" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="46dp"
                        android:gravity="center_vertical"
                        android:orientation="horizontal" >

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="游记"
                            android:textSize="15sp" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="共22个游记"
                            android:textSize="12sp" />

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="10dp" />
                    LinearLayout>
                LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                

                <LinearLayout
                    android:id="@+id/indicatebar"
                    android:layout_width="match_parent"
                    android:layout_height="46dp"
                    android:orientation="horizontal" >

                    <RelativeLayout
                        android:id="@+id/indicatebarcontext"
                        android:layout_width="match_parent"
                        android:layout_height="45dp"
                        android:background="@color/white" >

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="45dp"
                            android:orientation="horizontal" >

                            <TextView
                                android:id="@+id/wurixing"
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:layout_weight="1"
                                android:gravity="center"
                                android:text="0日行程"
                                android:textSize="15sp" />

                            <TextView
                                android:id="@+id/chanpin"
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:layout_weight="1"
                                android:gravity="center"
                                android:text="产品特色"
                                android:textSize="15sp" />

                            <TextView
                                android:id="@+id/feiyong"
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:layout_weight="1"
                                android:gravity="center"
                                android:text="费用说明"
                                android:textSize="15sp" />

                            <TextView
                                android:id="@+id/yuding"
                                android:layout_width="0dp"
                                android:layout_height="match_parent"
                                android:layout_weight="1"
                                android:gravity="center"
                                android:text="预定须知"
                                android:textSize="15sp" />
                        LinearLayout>

                        <View
                            android:id="@+id/otherline"
                            android:layout_width="80dp"
                            android:layout_height="3dp"
                            android:layout_alignParentBottom="true"
                            android:layout_marginBottom="1dp"
                            android:background="#2ea0f9" />

                        <View
                            android:layout_width="match_parent"
                            android:layout_height="1dp"
                            android:layout_alignParentBottom="true"
                            android:background="#d9d9d9" />
                    RelativeLayout>
                LinearLayout>
                

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <com.example.topsuspensiondemo.ext.ListViewExt
                    android:id="@+id/tdetail_listview"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:divider="@null"
                    android:listSelector="#00000000" />

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <LinearLayout
                    android:id="@+id/productchara"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp" >

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="46dp"
                        android:gravity="center_vertical"
                        android:text="产品特色"
                        android:textSize="15sp" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d9d9d9" />

                    <TextView
                        android:id="@+id/managerecommend"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="15dp"
                        android:layout_marginTop="17dp"
                        android:gravity="center_vertical"
                        android:lineSpacingExtra="13dp"
                        android:paddingLeft="3dp"
                        android:paddingRight="3dp"
                        android:text="产品特色站位\n产品特色站位\n产品特色站位\n产品特色站位\n产品特色站位\n产品特色站位\n产品特色站位\n产品特色站位\n产品特色站位\n产品特色站位\n"
                        android:textSize="30sp" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:layout_marginTop="17dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:visibility="gone" >

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content" />
                    LinearLayout>
                LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <LinearLayout
                    android:id="@+id/feestate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp" >

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="46dp"
                        android:gravity="center_vertical"
                        android:text="费用说明"
                        android:textSize="15sp" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d9d9d9" />

                    <TextView
                        android:id="@+id/feestatment"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginRight="15dp"
                        android:layout_marginTop="10dp"
                        android:gravity="center_vertical"
                        android:lineSpacingExtra="10dp"
                        android:paddingLeft="3dp"
                        android:paddingRight="3dp"
                        android:text="费用说明站位\n费用说明站位\n费用说明站位\n费用说明站位\n费用说明站位\n费用说明站位\n费用说明站位\n"
                        android:textSize="25sp" />
                LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="vertical"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp" >

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="46dp"
                        android:gravity="center_vertical"
                        android:text="签证信息"
                        android:textSize="15sp" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d9d9d9" />

                    <TextView
                        android:id="@+id/visainfo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginRight="15dp"
                        android:layout_marginTop="10dp"
                        android:gravity="center_vertical"
                        android:lineSpacingExtra="10dp"
                        android:paddingLeft="3dp"
                        android:paddingRight="3dp"
                        android:text="签证信息站位\n"
                        android:textSize="22sp" />
                LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <LinearLayout
                    android:id="@+id/ordernotice"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="vertical"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp" >

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="46dp"
                        android:gravity="center_vertical"
                        android:text="预定须知"
                        android:textSize="15sp" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d9d9d9" />

                    <TextView
                        android:id="@+id/orderknow"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginRight="15dp"
                        android:layout_marginTop="10dp"
                        android:gravity="center_vertical"
                        android:lineSpacingExtra="10dp"
                        android:paddingLeft="3dp"
                        android:paddingRight="3dp"
                        android:text="预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n预定须知站位\n"
                        android:textSize="18sp" />
                LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="10dp"
                    android:background="#f0f0f0" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="vertical" >

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="46dp"
                        android:gravity="center_vertical"
                        android:orientation="horizontal"
                        android:paddingLeft="10dp"
                        android:paddingRight="10dp" >

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="相关产品推荐"
                            android:textSize="15sp" />
                    LinearLayout>
                LinearLayout>

                <com.example.topsuspensiondemo.ext.GridViewExt
                    android:id="@+id/recommendgd"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:horizontalSpacing="10dp"
                    android:listSelector="#00000000"
                    android:numColumns="2"
                    android:verticalSpacing="10dp" />
            LinearLayout>
        com.handmark.pulltorefresh.library.PullToRefreshScrollView>
    RelativeLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="15dp"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/triptedail"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone" />

        <ImageView
            android:id="@+id/backtop"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="9dp"
            android:visibility="gone" />
    LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_alignParentBottom="true"
        android:orientation="vertical" >

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#d9d9d9" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="49dp"
            android:gravity="center_vertical"
            android:orientation="horizontal" >

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginLeft="10dp"
                android:gravity="center"
                android:orientation="vertical" >

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="在线客服"
                    android:textSize="11sp" />
            LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginLeft="7dp"
                android:gravity="center"
                android:orientation="vertical" >

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="电话客服"
                    android:textSize="11sp" />
            LinearLayout>

            <LinearLayout
                android:id="@+id/savetrip"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                android:orientation="vertical"
                android:paddingLeft="20dp"
                android:paddingRight="10dp" >

                <ImageView
                    android:id="@+id/saveimg"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="收藏"
                    android:textSize="11sp" />
            LinearLayout>

            <TextView
                android:id="@+id/orderNow"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="立即预定"
                android:textSize="14sp" />
        LinearLayout>
    LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="50dp" >

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#2ea0f9"
            android:orientation="vertical" >

            <ImageView
                android:id="@+id/top_left"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_centerVertical="true"
                android:padding="15dp" />

            <TextView
                android:id="@+id/top_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:gravity="center"
                android:textColor="@color/color_222222"
                android:textSize="18sp" />

            <ImageView
                android:id="@+id/top_right_service"
                android:layout_width="44dp"
                android:layout_height="44dp"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:padding="11dp" />

            <ImageView
                android:id="@+id/top_right_setting"
                android:layout_width="44dp"
                android:layout_height="44dp"
                android:layout_centerVertical="true"
                android:layout_toLeftOf="@+id/top_right_service"
                android:padding="11dp" />

            <TextView
                android:id="@+id/top_right_text"
                android:layout_width="44dp"
                android:layout_height="match_parent"
                android:layout_alignParentRight="true"
                android:gravity="center"
                android:text=""
                android:textColor="@color/color_222222"
                android:textSize="16sp"
                android:visibility="gone" />
        RelativeLayout>

        <View
            android:id="@+id/mytitlebarline"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_alignParentBottom="true" />
    RelativeLayout>
    
    <LinearLayout
        android:id="@+id/topindicatebar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:orientation="vertical" >
    LinearLayout>

RelativeLayout>

把控件换一下就可以了
控件最主要的功能在这里可以找到

下载地址

你可能感兴趣的:(随手记)