資源簡介
廣告輪播博客用到的資源。
代碼片段和文件信息
package?com.garvey.modules;
import?android.os.Bundle;
import?android.os.Handler;
import?android.support.v4.app.Fragment;
import?android.support.v4.view.PagerAdapter;
import?android.support.v4.view.ViewPager;
import?android.view.LayoutInflater;
import?android.view.View;
import?android.view.ViewGroup;
import?android.widget.ImageView;
import?android.widget.LinearLayout;
import?android.widget.LinearLayout.LayoutParams;
import?android.widget.TextView;
import?com.garvey.babyshop.R;
import?java.util.ArrayList;
import?java.util.List;
/**
?*?作者:?Garvey?on?2016/6/13.
?*?郵箱:?lianjiawei18@163.com
?*/
public?class?ShouYeFragment?extends?Fragment?{
????//?緩存Fragment?view
????private?View?rootView;
????private?static?ShouYeFragment?shouYeFragment;
????//控件的聲明
????private?ViewPager?viewPager;
????private?TextView?imageDesc;
????private?LinearLayout?dotsGroup;
????//數據聲明
????final?int[]?imageIds?=?{R.mipmap.a?R.mipmap.b
????????????R.mipmap.c?R.mipmap.d?R.mipmap.e};
????private?int?lastPoint;
????private?boolean?isFirstCreateView?=?true;
????//圖片標題集合
????private?final?String[]?imageDescriptions?=?{
????????????“鞏俐不低俗,我就不能低俗“
????????????“撲樹又回來啦!再唱經典老歌引萬人大合唱“
????????????“揭秘北京電影如何升級“
????????????“樂視網TV版大派送“
????????????“熱血屌絲的反殺“
????};
????List?imageList?=?new?ArrayList();
????List?descList?=?new?ArrayList();
????public?ShouYeFragment()?{
????}
????public?static?ShouYeFragment?getNewInstance()?{
????????if?(shouYeFragment?==?null)?{
????????????shouYeFragment?=?new?ShouYeFragment();
????????}
????????return?shouYeFragment;
????}
????@Override
????public?void?onCreate(Bundle?savedInstanceState)?{
????????super.onCreate(savedInstanceState);
????}
????@Override
????public?View?onCreateView(LayoutInflater?inflater?ViewGroup?container?Bundle?savedInstanceState)?{
????????if?(rootView?==?null)?{
????????????rootView?=?inflater.inflate(R.layout.fragment_shouye?container?false);
????????}
????????//?緩存的rootView需要判斷是否已經被加過parent,
????????//?如果有parent需要從parent刪除,要不然會發生這個rootview已經有parent的錯誤。
????????ViewGroup?parent?=?(ViewGroup)?rootView.getParent();
????????if?(parent?!=?null)?{
????????????parent.removeView(rootView);
????????}
????????initView();
????????initData();
????????initEvent();
????????return?rootView;
????}
????private?void?initView()?{
????????viewPager?=?(ViewPager)?rootView.findViewById(R.id.id_viewpager);
????????imageDesc?=?(TextView)?rootView.findViewById(R.id.id_image_desc);
????????dotsGroup?=?(LinearLayout)?rootView.findViewById(R.id.id_dots);
????????imageDesc.setText(imageDescriptions[0]);
????}
????private?void?initData()?{
????????if?(isFirstCreateView)?{
????????????for?(int?i?=?0;?i?????????????????//初始化圖片資源
????????????????ImageView?imageView?=?new?ImageView(getActivity());
????????????????imageView.setBackgroundResource(imageIds[i]);
????????????????imageList.add(im
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????104992??2014-04-03?11:16??廣告輪播用到資源\a.jpg
?????文件??????88764??2014-04-03?11:16??廣告輪播用到資源\b.jpg
?????文件?????101430??2014-04-03?11:16??廣告輪播用到資源\c.jpg
?????文件?????178830??2014-04-03?11:16??廣告輪播用到資源\d.jpg
?????文件????????216??2016-06-14?19:43??廣告輪播用到資源\dotsgroupbg.xm
?????文件?????130126??2014-04-03?11:16??廣告輪播用到資源\e.jpg
?????文件???????1499??2016-06-14?19:50??廣告輪播用到資源\fragment_shouye.xm
?????文件????????294??2016-06-14?16:15??廣告輪播用到資源\point_bg.xm
?????文件????????315??2016-06-14?19:52??廣告輪播用到資源\point_focused.xm
?????文件????????274??2016-06-14?19:36??廣告輪播用到資源\point_normal.xm
?????文件???????7304??2016-06-14?19:51??廣告輪播用到資源\ShouYeFragment.java
?????目錄??????????0??2016-06-14?20:47??廣告輪播用到資源
-----------?---------??----------?-----??----
???????????????614044????????????????????12
- 上一篇:JAVA實現ICTCLAS2015分詞
- 下一篇:wifi殺手
評論
共有 條評論