DevStore首页 > DEV资源 > 源码下载 > 源码详情

仿饿了么+点餐动画效果

 
沉默年代 | 2015-03-04 11:30    浏览量(11746)    评论(21)    收藏(19)
功能分类:生活 支持平台:Android 运行环境:Eclipse
开发语言:Java 开发工具:Eclipse 源码大小:4.97MB
下载源码 1605 人下载

源码简介

高仿饿了么安卓客户端,有相关方面需求的同学可以参考参考,不喜勿喷。。。

源码截图

  • 运行截图
  • 运行截图
  • 运行截图
DevStore所有源码来自用户上传分享,版权问题及牵扯到商业纠纷均与DevStore无关。

源码片段

package com.example.ele_me.activity;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.widget.SlidingPaneLayout;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.example.ele_me.R;
import com.example.ele_me.adapter.RestaurantDetailAdapter;
import com.example.ele_me.util.InjectView;
import com.example.ele_me.util.Injector;
import com.example.ele_me.widget.stickylistheaders.StickyListHeadersListView;


public class RestaurantDetailActivity extends Activity implements
		AdapterView.OnItemClickListener,
		StickyListHeadersListView.OnHeaderClickListener,
		StickyListHeadersListView.OnStickyHeaderOffsetChangedListener,
		StickyListHeadersListView.OnStickyHeaderChangedListener {

	private RestaurantDetailAdapter mAdapter;
	private boolean fadeHeader = true;
	@InjectView(R.id.linear_above_toHome)
	private LinearLayout above_toHome;
	@InjectView(R.id.tv_common_above_head)
	private TextView above_tittle;
	@InjectView(R.id.iv_head_left)
	private ImageView head_left;
	@InjectView(R.id.tv_common_above_head)
	private TextView head_tittle;
	@InjectView(R.id.food_list_shipping_fee)
	private TextView order_cart;
	
	private String restaurant_name;
	

	
	

	private StickyListHeadersListView stickyList;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.restaurant_detail_main);
		Injector.get(this).inject();//init views
		Intent intent = getIntent();
		restaurant_name = intent.getStringExtra("name");
		initView();
		setListener();
		
	}

	private void initView() {
		above_tittle.setText(restaurant_name);
		head_left.setImageResource(R.drawable.abc_ic_ab_back_holo_dark);
		
	}
	
	private void setListener() {
		// TODO Auto-generated method stub
		above_toHome.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				finish();
				
			}
		});
		
		mAdapter = new RestaurantDetailAdapter(this,order_cart);

		stickyList = (StickyListHeadersListView) findViewById(R.id.list_restaurant_detail);
		stickyList.setOnItemClickListener(this);
		stickyList.setOnHeaderClickListener(this);
		stickyList.setOnStickyHeaderChangedListener(this);
		stickyList.setOnStickyHeaderOffsetChangedListener(this);
		stickyList.addHeaderView(getLayoutInflater().inflate(
				R.layout.restaurant_list_header, null));
//		stickyList.addFooterView(getLayoutInflater().inflate(
//				R.layout.restaurant_list_footer, null));
		stickyList.setDrawingListUnderStickyHeader(true);
		stickyList.setAreHeadersSticky(true);
		stickyList.setAdapter(mAdapter);

//		stickyList.setStickyHeaderTopOffset(-20);
		
	}

	public void onItemClick(AdapterView parent, View view, int position,
			long id) {
		Toast.makeText(this, "Item " + position + " clicked!",
				Toast.LENGTH_SHORT).show();
	}

	@Override
	public void onHeaderClick(StickyListHeadersListView l, View header,
			int itemPosition, long headerId, boolean currentlySticky) {
		Toast.makeText(this,
				"Header " + headerId + " currentlySticky ? " + currentlySticky,
				Toast.LENGTH_SHORT).show();
	}

	@Override
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public void onStickyHeaderOffsetChanged(StickyListHeadersListView l,
			View header, int offset) {
		if (fadeHeader
				&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
			header.setAlpha(1 - (offset / (float) header.getMeasuredHeight()));
		}
	}

	@Override
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public void onStickyHeaderChanged(StickyListHeadersListView l, View header,
			int itemPosition, long headerId) {
		header.setAlpha(1);
	}

}
  •   赞(4) 赞 +1 赞(4) 已赞
  •   收藏(19) 收藏 +1 已收藏 取消
  •   下载(1605)
评论(21)
jungle

jungle 2017-04-22 19:59:46

有一些问题的。。。。。
回复(0) 赞(0) 赞(1)
Raincent

Raincent 2016-01-12 11:45:49

做的太low了
回复(3) 赞(0) 赞(1)
 
  • lovenets:
    回复@Raincent:不知道做好了么~
    回复2016-11-17 16:45:42
  • Raincent:
    回复@小麦mai:摘取好了到时候发给你连接
    回复2016-03-24 09:39:40
  • 小麦mai:
    回复@Raincent:你别光说啊,上个好的啊
    回复2016-01-22 10:37:17
Conker

Conker 2015-12-13 18:26:07

很好的分享 谢谢
回复(0) 赞(0) 赞(1)
灵雨飘零

灵雨飘零 2015-07-21 08:35:41

值得研究研究~下载一个
回复(0) 赞(0) 赞(1)
shadow110

shadow110 2015-07-14 08:36:34

下载一个来练练手
回复(0) 赞(0) 赞(1)
  • 推荐
  • 审核
  • 收录
  • 获取活力值

源码上传作者

  • 2 能力值
  • 1 源码
  • 0 评测
  • 0 资料

热门源码