Android Open Source - JiangHomeStyle_Android_Phone Widget Cache






From Project

Back to project page JiangHomeStyle_Android_Phone.

License

The source code is released under:

Apache License

If you think the Android project JiangHomeStyle_Android_Phone listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.cidesign.jianghomestylephone.tools;
//w ww  .ja  v  a  2 s  . c  om
import java.util.HashMap;

import com.cidesign.jianghomestylephone.R;
import com.cidesign.jianghomestylephone.widget.CommunityRelativeLayout;
import com.cidesign.jianghomestylephone.widget.CustomScrollView;
import com.cidesign.jianghomestylephone.widget.HumanityRelativeLayout;
import com.cidesign.jianghomestylephone.widget.LandscapeRelativeLayout;
import com.cidesign.jianghomestylephone.widget.StoryRelativeLayout;

import android.app.Activity;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.VideoView;

public class WidgetCache
{
  private static HashMap<Integer, View> viewCache = new HashMap<Integer, View>();

  private static WidgetCache widgetCacheInstance = new WidgetCache();

  private WidgetCache()
  {

  }

  public static WidgetCache getInstance()
  {
    return widgetCacheInstance;
  }

  public HashMap<Integer, View> getViewCache()
  {
    return viewCache;
  }

  public void init(Activity activity)
  {
    viewCache.put(R.id.loadingProgressBar, (ProgressBar) activity.findViewById(R.id.loadingProgressBar));
    // ????????????
    CustomScrollView scrollView = (CustomScrollView) activity.findViewById(R.id.mainScrollView);
    viewCache.put(R.id.mainScrollView, scrollView);

    viewCache.put(R.id.recommandLayout, (LinearLayout) activity.findViewById(R.id.recommandLayout));
    viewCache.put(R.id.homeBigBg, (ImageView) activity.findViewById(R.id.homeBigBg));
    viewCache.put(R.id.homeArticleTitle, (TextView) activity.findViewById(R.id.homeArticleTitle));
    viewCache.put(R.id.homeArticleTime, (TextView) activity.findViewById(R.id.homeArticleTime));
    viewCache.put(R.id.homeLinearLayout, (LinearLayout) activity.findViewById(R.id.homeLinearLayout));
    viewCache.put(R.id.recommandLayout, (LinearLayout) activity.findViewById(R.id.recommandLayout));
    viewCache.put(R.id.videoView, (VideoView) activity.findViewById(R.id.videoView));

    // ???????????
    viewCache.put(R.id.landscapeBgImg, (ImageView) activity.findViewById(R.id.landscapeBgImg));
    RelativeLayout landscapeAnimPanel = (RelativeLayout) activity.findViewById(R.id.landscapeAnimPanel);
    viewCache.put(R.id.landscapeAnimPanel, landscapeAnimPanel);
    viewCache.put(R.id.landscapeViewPager, (ViewPager) activity.findViewById(R.id.landscapeViewPager));
    viewCache.put(R.id.landscapePreClick, (ImageButton) activity.findViewById(R.id.landscapePreClick));
    viewCache.put(R.id.landscapeNextClick, (ImageButton) activity.findViewById(R.id.landscapeNextClick));
    viewCache.put(R.id.landscapeRelativeLayout,(LandscapeRelativeLayout)activity.findViewById(R.id.landscapeRelativeLayout));
    
    // ????????????
    viewCache.put(R.id.humanityBgImg, (ImageView) activity.findViewById(R.id.humanityBgImg));
    RelativeLayout humanityAnimPanel = (RelativeLayout) activity.findViewById(R.id.humanityAnimPanel);
    viewCache.put(R.id.humanityAnimPanel, humanityAnimPanel);
    viewCache.put(R.id.humanityViewPager, (ViewPager) activity.findViewById(R.id.humanityViewPager));
    viewCache.put(R.id.humanityPreClick, (ImageButton) activity.findViewById(R.id.humanityPreClick));
    viewCache.put(R.id.humanityNextClick, (ImageButton) activity.findViewById(R.id.humanityNextClick));
    viewCache.put(R.id.humanityRelativeLayout,(HumanityRelativeLayout)activity.findViewById(R.id.humanityRelativeLayout));
    
    // ????????????
    viewCache.put(R.id.storyBgImg, (ImageView) activity.findViewById(R.id.storyBgImg));
    RelativeLayout storyAnimPanel = (RelativeLayout) activity.findViewById(R.id.storyAnimPanel);
    viewCache.put(R.id.storyAnimPanel, storyAnimPanel);
    viewCache.put(R.id.storyViewPager, (ViewPager) activity.findViewById(R.id.storyViewPager));
    viewCache.put(R.id.storyPreClick, (ImageButton) activity.findViewById(R.id.storyPreClick));
    viewCache.put(R.id.storyNextClick, (ImageButton) activity.findViewById(R.id.storyNextClick));
    viewCache.put(R.id.storyRelativeLayout,(StoryRelativeLayout)activity.findViewById(R.id.storyRelativeLayout));
    
    // ???????????
    viewCache.put(R.id.communityBgImg, (ImageView) activity.findViewById(R.id.communityBgImg));
    RelativeLayout communityAnimPanel = (RelativeLayout) activity.findViewById(R.id.communityAnimPanel);
    viewCache.put(R.id.communityAnimPanel, (RelativeLayout) activity.findViewById(R.id.communityAnimPanel));
    viewCache.put(R.id.communityViewPager, (ViewPager) activity.findViewById(R.id.communityViewPager));
    viewCache.put(R.id.communityPreClick, (ImageButton) activity.findViewById(R.id.communityPreClick));
    viewCache.put(R.id.communityNextClick, (ImageButton) activity.findViewById(R.id.communityNextClick));
    viewCache.put(R.id.communityRelativeLayout,(CommunityRelativeLayout)activity.findViewById(R.id.communityRelativeLayout));
    
    scrollView.setLandscapeAnimPanel(landscapeAnimPanel);
    scrollView.setHumanityAnimPanel(humanityAnimPanel);
    scrollView.setStoryAnimPanel(storyAnimPanel);
    scrollView.setCommunityAnimPanel(communityAnimPanel);
  }
}




Java Source Code List

com.cidesign.jianghomestylephone.DetailActivity.java
com.cidesign.jianghomestylephone.JiangActivity.java
com.cidesign.jianghomestylephone.MainActivity.java
com.cidesign.jianghomestylephone.SplashActivity.java
com.cidesign.jianghomestylephone.adapter.CommunityViewpagerAdapter.java
com.cidesign.jianghomestylephone.adapter.HumanityViewpagerAdapter.java
com.cidesign.jianghomestylephone.adapter.LandscapeViewpagerAdapter.java
com.cidesign.jianghomestylephone.adapter.LayoutCaculateAdapter.java
com.cidesign.jianghomestylephone.adapter.StoryViewpagerAdapter.java
com.cidesign.jianghomestylephone.async.AsyncDownTask.java
com.cidesign.jianghomestylephone.async.AsyncInitCommunityData.java
com.cidesign.jianghomestylephone.async.AsyncInitData.java
com.cidesign.jianghomestylephone.async.AsyncInitHomeData.java
com.cidesign.jianghomestylephone.async.AsyncInitHumanityData.java
com.cidesign.jianghomestylephone.async.AsyncInitLandscapeData.java
com.cidesign.jianghomestylephone.async.AsyncInitStoryData.java
com.cidesign.jianghomestylephone.db.DatabaseConfigUtil.java
com.cidesign.jianghomestylephone.db.DatabaseHelper.java
com.cidesign.jianghomestylephone.entity.ArticleEntity.java
com.cidesign.jianghomestylephone.entity.FileListEntity.java
com.cidesign.jianghomestylephone.entity.LayoutEntity.java
com.cidesign.jianghomestylephone.entity.RelativeLayoutRulesEntity.java
com.cidesign.jianghomestylephone.http.ArticalOperation.java
com.cidesign.jianghomestylephone.http.DownLoadThread.java
com.cidesign.jianghomestylephone.service.DownloadService.java
com.cidesign.jianghomestylephone.tools.CategoryDataLoadingLogic.java
com.cidesign.jianghomestylephone.tools.FileOperationTools.java
com.cidesign.jianghomestylephone.tools.JiangCategory.java
com.cidesign.jianghomestylephone.tools.LayoutMarginSetting.java
com.cidesign.jianghomestylephone.tools.LoadingDataFromDB.java
com.cidesign.jianghomestylephone.tools.LoadingImageTools.java
com.cidesign.jianghomestylephone.tools.MD5Tools.java
com.cidesign.jianghomestylephone.tools.StorageUtils.java
com.cidesign.jianghomestylephone.tools.TimeTools.java
com.cidesign.jianghomestylephone.tools.WidgetCache.java
com.cidesign.jianghomestylephone.tools.XmlParseTools.java
com.cidesign.jianghomestylephone.version.NetworkTool.java
com.cidesign.jianghomestylephone.version.VersionConfig.java
com.cidesign.jianghomestylephone.version.VersionUpdate.java
com.cidesign.jianghomestylephone.widget.CommunityRelativeLayout.java
com.cidesign.jianghomestylephone.widget.CustomScrollView.java
com.cidesign.jianghomestylephone.widget.HScrollViewTouchLogic.java
com.cidesign.jianghomestylephone.widget.HumanityRelativeLayout.java
com.cidesign.jianghomestylephone.widget.LandscapeRelativeLayout.java
com.cidesign.jianghomestylephone.widget.PopMenu.java
com.cidesign.jianghomestylephone.widget.StoryRelativeLayout.java
org.apache.tools.zip.AbstractUnicodeExtraField.java
org.apache.tools.zip.AsiExtraField.java
org.apache.tools.zip.CentralDirectoryParsingZipExtraField.java
org.apache.tools.zip.ExtraFieldUtils.java
org.apache.tools.zip.FallbackZipEncoding.java
org.apache.tools.zip.GeneralPurposeBit.java
org.apache.tools.zip.JarMarker.java
org.apache.tools.zip.NioZipEncoding.java
org.apache.tools.zip.Simple8BitZipEncoding.java
org.apache.tools.zip.UnicodeCommentExtraField.java
org.apache.tools.zip.UnicodePathExtraField.java
org.apache.tools.zip.UnixStat.java
org.apache.tools.zip.UnparseableExtraFieldData.java
org.apache.tools.zip.UnrecognizedExtraField.java
org.apache.tools.zip.UnsupportedZipFeatureException.java
org.apache.tools.zip.Zip64ExtendedInformationExtraField.java
org.apache.tools.zip.Zip64Mode.java
org.apache.tools.zip.Zip64RequiredException.java
org.apache.tools.zip.ZipConstants.java
org.apache.tools.zip.ZipEightByteInteger.java
org.apache.tools.zip.ZipEncodingHelper.java
org.apache.tools.zip.ZipEncoding.java
org.apache.tools.zip.ZipEntry.java
org.apache.tools.zip.ZipExtraField.java
org.apache.tools.zip.ZipFile.java
org.apache.tools.zip.ZipLong.java
org.apache.tools.zip.ZipOutputStream.java
org.apache.tools.zip.ZipShort.java
org.apache.tools.zip.ZipUtil.java