Example #1
0
  private void initView() {
    FocusView mFocusView = (FocusView) mView.findViewById(R.id.home_selector);
    mViewBean.setmFocusObject(mFocusView);
    weatherMainRight = (FrameLayout) mView.findViewById(R.id.weather_main_right);

    life_img01 = (ImageView) mView.findViewById(R.id.life_img01);
    life_img02 = (ImageView) mView.findViewById(R.id.life_img02);
    life_img03 = (ImageView) mView.findViewById(R.id.life_img03);
    life_img04 = (ImageView) mView.findViewById(R.id.life_img04);

    life_txt01 = (TextView) mView.findViewById(R.id.life_txt01);
    life_txt02 = (TextView) mView.findViewById(R.id.life_txt02);
    life_txt03 = (TextView) mView.findViewById(R.id.life_txt03);
    life_txt04 = (TextView) mView.findViewById(R.id.life_txt04);
  }
Example #2
0
  private void initView() {
    myOnClickListener = new MyOnClickListener();
    mBtnShopLeft.setOnClickListener(myOnClickListener);
    mBtnShopTop.setOnClickListener(myOnClickListener);
    mBtnShopBottom.setOnClickListener(myOnClickListener);

    myOnKeyListener = new MyOnKeyListener();
    mBtnShopLeft.setOnKeyListener(myOnKeyListener);
    mBtnShopTop.setOnKeyListener(myOnKeyListener);
    mBtnShopBottom.setOnKeyListener(myOnKeyListener);

    myOnFocusChangeListener = new MyOnFocusChangeListener();
    mBtnShopLeft.setOnFocusChangeListener(myOnFocusChangeListener);
    mBtnShopTop.setOnFocusChangeListener(myOnFocusChangeListener);
    mBtnShopBottom.setOnFocusChangeListener(myOnFocusChangeListener);

    mViewBean.setmFocusObject(myFocusView);
    myFocusView.setVisibility(View.INVISIBLE);

    PublicFragment pu = new PublicFragment();
    pu.addViewGlobalLayoutListener(mBtnShopLeft, mViewBean);
    pu.addViewGlobalLayoutListener(mBtnShopTop, mViewBean);
    pu.addViewGlobalLayoutListener(mBtnShopBottom, mViewBean);

    if (Utils.isNetworkState) {
      mBtnShopLeft.setBackground(
          HomeApplication.getInstance().getResources().getDrawable(R.drawable.shop_left));
      mBtnShopTop.setBackground(
          HomeApplication.getInstance().getResources().getDrawable(R.drawable.shop_right_up1));
      mBtnShopBottom.setBackground(
          HomeApplication.getInstance().getResources().getDrawable(R.drawable.shop_right_up2));
    } else {
      mBtnShopLeft.setBackground(
          HomeApplication.getInstance().getResources().getDrawable(R.drawable.shop_left));
      mBtnShopTop.setBackground(
          HomeApplication.getInstance().getResources().getDrawable(R.drawable.shop_right_up));
      mBtnShopBottom.setBackground(
          HomeApplication.getInstance().getResources().getDrawable(R.drawable.shop_right_up));
    }
    Log.d(TAG, "NewShopFragment---start end!!!");
  }