ImageVerifierCode 换一换
格式:DOCX , 页数:122 ,大小:41.25KB ,
资源ID:6609786      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.docduoduo.com/d-6609786.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(艺术品授权.docx)为本站会员(kpmy5893)主动上传,道客多多仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知道客多多(发送邮件至docduoduo@163.com或直接QQ联系客服),我们立即给予删除!

艺术品授权.docx

1、艺术品授权 V1.0 源代码1import java.util.List;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.view.ViewGroup.LayoutParams;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.RelativeLay

2、out;import com.android.domain.GallPic;import com.android.download.GallPicDownloader;import com.android.kexuemeishu.R;public class GalleryAdapter extends BaseAdapter Context mContext;List mGallPic;int res = new int R.drawable.t1, R.drawable.t2,R.drawable.t3, R.drawable.t4,R.drawable.t3, R.drawable.t4

3、 ;public void setList(List queryGallPic)this.mGallPic = queryGallPic;艺术品授权 V1.0 源代码2private final GallPicDownloader imageDownloader = new GallPicDownloader();public GallPicDownloader getImageDownloader() return imageDownloader;public GalleryAdapter(Context cnt,List queryGallPic) this.mContext = cnt;

4、this.mGallPic = queryGallPic;public GalleryAdapter(Context cnt) this.mContext = cnt;Overridepublic int getCount() / TODO Auto-generated method stubif(mGallPic = null)return res.length;elsereturn mGallPic.size();艺术品授权 V1.0 源代码3Overridepublic Object getItem(int arg0) / TODO Auto-generated method stubr

5、eturn arg0;Overridepublic long getItemId(int arg0) / TODO Auto-generated method stubreturn arg0;Overridepublic View getView(int arg0, View arg1, ViewGroup arg2) / TODO Auto-generated method stubif (arg1 = null) arg1 = LayoutInflater.from(mContext).inflate(R.layout.gallery_item,null);ImageView img =

6、(ImageView) arg1.findViewById(R.id.gall_img);RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);艺术品授权 V1.0 源代码4img.setBackgroundResource(resarg0);img.setLayoutParams(lp);if(mGallPic = null)elseimageDownloader.download(mGallPic.get(arg

7、0).getPicName(), img);/ String picName = mGallPic.get(arg0).getPicName();/ img.setBackgroundResource();return arg1;package com.android.adapter;import android.content.Context;import android.util.AttributeSet;import android.view.KeyEvent;import android.view.MotionEvent;import android.widget.Gallery;pu

8、blic class GarGallery extends Gallery public GarGallery(Context context, AttributeSet attrs) 艺术品授权 V1.0 源代码5super(context, attrs);private boolean isScrollingLeft(MotionEvent e1, MotionEvent e2) return e2.getX() e1.getX();Overridepublic boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,

9、float velocityY) int keyCode;if (isScrollingLeft(e1, e2) keyCode = KeyEvent.KEYCODE_DPAD_LEFT; else keyCode = KeyEvent.KEYCODE_DPAD_RIGHT;onKeyDown(keyCode, null);艺术品授权 V1.0 源代码6return true;package com.android.adapter;import java.text.SimpleDateFormat;import java.util.HashMap;import java.util.List;i

10、mport android.content.Context;import android.view.Gravity;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.AbsListView;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.LinearLayout;import android.wi

11、dget.LinearLayout.LayoutParams;import android.widget.TextView;import com.android.assistant.BaseApp;import com.android.assistant.ShowConstant;艺术品授权 V1.0 源代码7import com.android.download.NewsPicDownloader;import com.android.kexuemeishu.R;import com.android.util.StreamUtils;public class HelperShowAdapte

12、r extends BaseAdapter Context mContext;/ List mLis;List mLis;private final NewsPicDownloader newPicDownloader = new NewsPicDownloader();public NewsPicDownloader getImageDownloader() return newPicDownloader;public HelperShowAdapter(Context context,List lis) super();this.mContext = context;this.mLis =

13、 lis;Overridepublic int getCount() / TODO Auto-generated method stubreturn mLis.size();艺术品授权 V1.0 源代码8Overridepublic Object getItem(int position) / TODO Auto-generated method stubreturn position;Overridepublic long getItemId(int position) / TODO Auto-generated method stubreturn position;Overridepubl

14、ic View getView(int position, View convertView, ViewGroup parent) ShowViewHolder viewHolder;String classname = mLis.get(position).get(“classNames“).toString().trim();if (convertView = null) viewHolder = new ShowViewHolder();if(“product“.equals(classname)convertView = LayoutInflater.from(mContext).in

15、flate(R.layout.list_child_product,null);AbsListView.LayoutParams lay = new 艺术品授权 V1.0 源代码9AbsListView.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);convertView.setLayoutParams(lay);viewHolder.newPic = (ImageView) convertView.findViewById(R.id.imageView1);LinearLayout.LayoutParams

16、 picLay = new LayoutParams(int)(ShowConstant.displayWidth*0.2f), (int)(ShowConstant.displayWidth*0.18f);picLay.gravity = Gravity.CENTER_VERTICAL;picLay.leftMargin =(int)(ShowConstant.displayWidth*0.027f);picLay.rightMargin =(int)(ShowConstant.displayWidth*0.027f);viewHolder.newPic.setLayoutParams(pi

17、cLay);elseconvertView = LayoutInflater.from(mContext).inflate(R.layout.list_child_item,null);AbsListView.LayoutParams lay = new AbsListView.LayoutParams(LayoutParams.FILL_PARENT, (int)(ShowConstant.displayWidth*0.30f);convertView.setLayoutParams(lay);viewHolder.newPic = (ImageView) convertView.findV

18、iewById(R.id.imageView1);/ RelativeLayout.LayoutParams picLay = new LayoutParams(int)(ShowConstant.displayWidth*0.2f), (int)(ShowConstant.displayWidth*0.23f);艺术品授权 V1.0 源代码10/ lay.gravity = Gravity.CENTER_VERTICAL;viewHolder.newTitle = (TextView) convertView.findViewById(R.id.textView1);/ RelativeLa

19、yout.LayoutParams titleLay = new RelativeLayout.LayoutParams(int)(ShowConstant.displayWidth*0.74f), (int)(ShowConstant.displayHeight*0.05f);/ LinearLayout.LayoutParams titleLay = new LayoutParams(int)(ShowConstant.displayWidth*0.74f), LayoutParams.WRAP_CONTENT);/ titleLay.topMargin = (int)(ShowConst

20、ant.displayWidth*0.064f);/ titleLay.bottomMargin = (int)(ShowConstant.displayHeight*0.01f);/ viewHolder.newTitle.setLayoutParams(titleLay);viewHolder.newBrief = (TextView) convertView.findViewById(R.id.textView2);/ LinearLayout.LayoutParams briefLay = new LayoutParams(int)(ShowConstant.displayWidth*

21、0.74f), (int)(ShowConstant.displayHeight*0.03f);/ briefLay.topMargin = (int)(ShowConstant.displayWidth*0.027f);/ briefLay.leftMargin =(int)(ShowConstant.displayWidth*0.027f);/ briefLay.rightMargin =(int)(ShowConstant.displayWidth*0.027f);艺术品授权 V1.0 源代码11/ briefLay.bottomMargin = (int)(ShowConstant.d

22、isplayHeight*0.0156f + 0.5f);/ viewHolder.newBrief.setPadding(0, 0, 0, 0);/ viewHolder.newBrief.setLayoutParams(briefLay);viewHolder.newUpDate = (TextView) convertView.findViewById(R.id.textView3);/ RelativeLayout.LayoutParams upDateLay = new RelativeLayout.LayoutParams(int)(ShowConstant.displayWidt

23、h*0.3f), (int)(ShowConstant.displayHeight*0.03f);/ upDateLay.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);/ upDateLay.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);/ upDateLay.bottomMargin = (int)(ShowConstant.displayHeight*0.0156f + 0.5f);/ upDateLay.rightMargin = (int)(ShowConstant.displayHeight*0.01f

24、);/ viewHolder.newUpDate.setGravity(Gravity.RIGHT);/ viewHolder.newUpDate.setPadding(0, 0, 2, 0);/ viewHolder.newUpDate.setLayoutParams(upDateLay);convertView.setTag(viewHolder); elseviewHolder = (ShowViewHolder)convertView.getTag();if(“product“.equals(classname)String newTitles = mLis.get(position)

25、.get(“name“).toString();艺术品授权 V1.0 源代码12String newBrief = mLis.get(position).get(“intro“).toString();String text = StreamUtils.replaceBlank(newBrief);viewHolder.newTitle.setText(newTitles.trim();viewHolder.newBrief.setText(text);/ viewHolder.newBrief.setText(newBrief.trim();elseString newTitles = mL

26、is.get(position).get(“name“).toString();String newBrief = mLis.get(position).get(“content“).toString();String isTimeShow = mLis.get(position).get(“isTimeShow“).toString();if(“0“.equals(isTimeShow)try String date = mLis.get(position).get(“date“).toString();SimpleDateFormat format = new SimpleDateForm

27、at(“yyyy-MM-dd“);String dateString = format.format(date);viewHolder.newUpDate.setText(dateString); catch (Exception e) / TODO: handle exceptione.printStackTrace();/ String text = newBrief.replace(“, “ “);艺术品授权 V1.0 源代码13String text = StreamUtils.replaceBlank(newBrief);viewHolder.newTitle.setText(new

28、Titles.trim();viewHolder.newBrief.setText(text);/ viewHolder.newBrief.setText(newBrief.trim();/ viewHolder.newBrief.setText(mLis.get(position).getBrief();/ viewHolder.newUpDate.setText(mLis.get(position).getUpdate_date();String url1 = BaseApp.getInstance().APP_SERVICE+mLis.get(position).get(“imageUr

29、l“);String imgUrl = mLis.get(position).get(“imageUrl“).toString();String imgName = imgUrl.replace(/, .);newPicDownloader.download(imgName,url1, viewHolder.newPic);/ newPicDownloader.download(mLis.get(position).get(“tel“)+“.jpg“,url1, viewHolder.newPic);return convertView;private final class ShowView

30、Holder public ImageView newPic;public TextView newTitle;public TextView newUpDate;public TextView newBrief;艺术品授权 V1.0 源代码14package com.android.adapter;import java.util.HashMap;import java.util.List;import android.app.Activity;import android.content.Context;import android.view.Gravity;import android.

31、view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.LinearLayout.LayoutParams;import android.widget.TextView;import com.android.assistant.ShowConstant;imp

32、ort com.android.download.NewsPicDownloader;import com.android.kexuemeishu.R;import school.adapter.ImageLoader;public class MenuGridAdapter extends BaseAdapter 艺术品授权 V1.0 源代码15private Context mContext;/ List mLis;/ List menuData;List lstImageItem;String column;private final NewsPicDownloader newPicDo

33、wnloader = new NewsPicDownloader();public NewsPicDownloader getImageDownloader() return newPicDownloader;public MenuGridAdapter() super();/ TODO Auto-generated constructor stub/* public MenuGridAdapter(Context context, List mLis) * super(); this.mContext = context; this.menuData = mLis; / TODO* Auto

34、-generated constructor stub */public MenuGridAdapter(Activity mActivity,艺术品授权 V1.0 源代码16List lstImageItem, String column) super();this.mContext = mActivity;this.lstImageItem = lstImageItem;this.column = column;/ TODO Auto-generated constructor stubOverridepublic int getCount() / TODO Auto-generated

35、method stubreturn lstImageItem.size();Overridepublic Object getItem(int position) / TODO Auto-generated method stubreturn position;Overridepublic long getItemId(int position) / TODO Auto-generated method stubreturn position;艺术品授权 V1.0 源代码17Overridepublic View getView(int position, View convertView,

36、ViewGroup parent) / TODO Auto-generated method stubMenuViewHolder viewHolder;if (convertView = null) viewHolder = new MenuViewHolder();convertView = LayoutInflater.from(mContext).inflate(R.layout.menu_gridview_item, null);/ AbsListView.LayoutParams lay = new/ AbsListView.LayoutParams(LayoutParams.FI

37、LL_PARENT,/ (int)(ShowConstant.displayHeight*0.24f+0.5f);/ lay.gravity = Gravity.CENTER_VERTICAL;/ convertView.setLayoutParams(lay);if (“3“.equals(column) viewHolder.menuPic = (ImageView) convertView.findViewById(R.id.ItemImage);LinearLayout.LayoutParams picLay = new LayoutParams(int) (ShowConstant.

38、displayWidth * 0.20f),(int) (ShowConstant.displayWidth * 0.20f);picLay.topMargin = (int) (ShowConstant.displayWidth * 0.05f);picLay.bottomMargin = (int) (ShowConstant.displayWidth * 0.05f);/ picLay.leftMargin =(int)(ShowConstant.displayWidth*0.027f);艺术品授权 V1.0 源代码18/ picLay.rightMargin =(int)(ShowCo

39、nstant.displayWidth*0.027f);picLay.gravity = Gravity.CENTER_HORIZONTAL;viewHolder.menuPic.setLayoutParams(picLay);viewHolder.menuTitle = (TextView) convertView.findViewById(R.id.ItemText);LinearLayout.LayoutParams titleLay = new LayoutParams(int) (ShowConstant.displayWidth * 0.30f),(int) (ShowConsta

40、nt.displayHeight * 0.05f);titleLay.topMargin = (int) (ShowConstant.displayWidth * 0.008f);/ titleLay.leftMargin =(int)(ShowConstant.displayWidth*0.01f);/ titleLay.rightMargin =(int)(ShowConstant.displayWidth*0.01f);/ titleLay.bottomMargin =/ (int)(ShowConstant.displayHeight*0.01f);titleLay.gravity =

41、 Gravity.CENTER_HORIZONTAL;viewHolder.menuTitle.setLayoutParams(titleLay);convertView.setTag(viewHolder); else viewHolder.menuPic = (ImageView) convertView.findViewById(R.id.ItemImage);LinearLayout.LayoutParams picLay = new LayoutParams(int) (ShowConstant.displayWidth * 0.20f),(int) (ShowConstant.di

42、splayWidth * 0.16f);艺术品授权 V1.0 源代码19picLay.topMargin = (int) (ShowConstant.displayWidth * 0.02f);/ picLay.bottomMargin = (int)(ShowConstant.displayWidth*0.05f);/ picLay.leftMargin =(int)(ShowConstant.displayWidth*0.027f);/ picLay.rightMargin =(int)(ShowConstant.displayWidth*0.027f);picLay.gravity =

43、Gravity.CENTER_HORIZONTAL;viewHolder.menuPic.setLayoutParams(picLay);viewHolder.menuTitle = (TextView) convertView.findViewById(R.id.ItemText);LinearLayout.LayoutParams titleLay = new LayoutParams(int) (ShowConstant.displayWidth * 0.30f),(int) (ShowConstant.displayHeight * 0.05f);titleLay.topMargin

44、= (int) (ShowConstant.displayWidth * 0.008f);/ titleLay.leftMargin =(int)(ShowConstant.displayWidth*0.01f);/ titleLay.rightMargin =(int)(ShowConstant.displayWidth*0.01f);/ titleLay.bottomMargin =/ (int)(ShowConstant.displayHeight*0.01f);titleLay.gravity = Gravity.CENTER_HORIZONTAL;viewHolder.menuTit

45、le.setLayoutParams(titleLay);convertView.setTag(viewHolder); else 艺术品授权 V1.0 源代码20viewHolder = (MenuViewHolder) convertView.getTag();viewHolder.menuTitle.setText(lstImageItem.get(position).get(“idname“).toString();/* viewHolder.menuPic.setBackgroundResource(R.drawable.icon_1_c);viewHolder.menuTitle.

46、setText(mLis.get(position).getTitle();String url = BaseApp.getInstance().APP_SERVICE +lstImageItem.get(position).get(“imageUrl“);newPicDownloader.download(lstImageItem.get(position).get(“id“)+“.jpg“,url, viewHolder.menuPic);String imgUrl =lstImageItem.get(position).get(“imageUrl“).toString();String

47、imgName = imgUrl.replace(/, .);String url = BaseApp.getInstance().APP_SERVICE+ lstImageItem.get(position).get(“imageUrl“).toString();newPicDownloader.download(lstImageItem.get(position).get(“imageUrl“).toString().replace(/, .), url, viewHolder.menuPic);String imageUrl = “/“+lstImageItem.get(position

48、).get(“imageUrl“).toString().substring(1);viewHolder.menuPic.setTag(imageUrl);LoadImageTask task = new LoadImageTask(viewHolder.menuPic);task.execute(imageUrl);*/艺术品授权 V1.0 源代码21ImageLoader.getInstance().loadMenuImage(“/“+lstImageItem.get(position).get(“imageUrl“).toString().substring(1), viewHolder.menuPic, R.drawable.def_icon);return convertView;private final class MenuViewHolder public ImageView menuPic;public TextView menuTitle;package com.android.adapter;import java.util.List;import android.content.Context;import android.view.

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报