Beispiel #1
0
  private void startGroupActivity(View view, int position) {

    RadioImageView imageView = (RadioImageView) view.findViewById(R.id.iv_main_item);
    Bitmap bitmap = null;
    BitmapDrawable bd = (BitmapDrawable) imageView.getDrawable();
    if (bd != null) {
      bitmap = bd.getBitmap();
    }
    Intent intent1 = new Intent(getActivity(), GroupActivity.class);
    intent1.putExtra("color", Utils.getPaletteColor(bitmap));
    intent1.putExtra("index", position);
    intent1.putExtra("groupid", Utils.url2groupid(mAdapter.get(position).getUrl()));
    ActivityOptionsCompat options =
        ActivityOptionsCompat.makeSceneTransitionAnimation(
            getActivity(), view, mAdapter.get(position).getUrl());
    getActivity().startActivity(intent1, options.toBundle());
  }
Beispiel #2
0
        @Override
        public void onReceive(Context context, Intent intent) {
          if (intent.getAction().equals(type)) {
            boolean isRefreshe, isLoadmore, isFirstload;
            List<MainBean> latest = MainBean.all(realm, type);
            hasload = false;

            isRefreshe = intent.getBooleanExtra("isRefreshe", false);
            isLoadmore = intent.getBooleanExtra("isLoadmore", false);
            isFirstload = intent.getBooleanExtra("isFirstload", false);

            if (isFirstload || isRefreshe) {
              mAdapter.replaceWith(latest);
            }
            if (isLoadmore) {
              mAdapter.addAll(latest.subList(latest.size() - 24, latest.size()));
            }
            mRefresher.setRefreshing(false);
          }
        }