Exemplo n.º 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN
                | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
            WindowManager.LayoutParams.FLAG_FULLSCREEN
                | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);

    setContentView(R.layout.activity_third_game_detail);
    ScaleViewUtils.init(this);
    ScaleViewUtils.scaleView(getWindow().getDecorView());

    setBlackTitle(false);

    icon = (ImageView) findViewById(R.id.iv_icon);
    gameSize = (TextView) findViewById(R.id.tv_game_size);
    handleType = (TextView) findViewById(R.id.tv_game_handle);
    gameName = (TextView) findViewById(R.id.tv_game_name);

    gameDesc = (TextView) findViewById(R.id.tv_game_desc);

    gameDesc.setMovementMethod(ScrollingMovementMethod.getInstance());
    gameDesc.setOnFocusChangeListener(onFocusChangeListener);

    mRecyclerView = (RecyclerView) findViewById(R.id.rv_game_source);

    LayoutManager layoutManager =
        new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
    mRecyclerView.setLayoutManager(layoutManager);

    mAdapter = new GameSourceAdapter(this, mRecyclerView, mImageFetcher);
    mRecyclerView.setAdapter(mAdapter);

    // gameSourceLayout = (LinearLayout)findViewById(R.id.ll_game_source);

    contentView = (RelativeLayout) findViewById(R.id.rl_desc);
    loadingView = (LoadingView) findViewById(R.id.contentLoading);
    loadingView.setDataView(contentView);

    if (getIntent() != null) {
      mGameId = getIntent().getStringExtra(GAMEID);
    }
    if (mGameId != null && mGameId != "") {
      Log.i("life", "mGameId:" + mGameId);
      getData(mGameId);
    }
    registReceiver();
  }
 public GameHolder(View itemView) {
   super(itemView);
   ScaleViewUtils.scaleView(itemView);
   border = (ImageView) itemView.findViewById(R.id.iv_border);
   cover = (ImageView) itemView.findViewById(R.id.iv_game_cover);
   name = (TextView) itemView.findViewById(R.id.tv_game_name);
   itemView.setOnFocusChangeListener(this);
   itemView.setOnClickListener(this);
   itemView.setOnKeyListener(this);
 }