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

    mListView = (ListView) mView.findViewById(R.id.lv);
    mListView.setOnScrollListener(
        new AbsListView.OnScrollListener() {
          @Override
          public void onScrollStateChanged(AbsListView view, int scrollState) {
            if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
              PullRightLayout.collapseAll();
            }
          }

          @Override
          public void onScroll(
              AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {}
        });

    mStartScanView = (TextView) mView.findViewById(R.id.tv_start_scan);
    mStartScanView.setBackgroundColor(ThemeManager.with(getActivity()).getCurrentColor());
    mStartScanView.setOnClickListener(this);

    mPullLayout = (PullLayout) mView.findViewById(R.id.pull_layout);
    mPullLayout.addOnPullListener(this);
    if (mListener != null) {
      mPullLayout.addOnPullListener(mListener);
      mListener = null;
    }

    mIvScan = (ImageView) mView.findViewById(R.id.iv_scan);

    IntentFilter filter = new IntentFilter(ScanService.ACTION_SCAN_FINISH);
    LocalBroadcastManager.getInstance(getActivity()).registerReceiver(receiver, filter);
  }
Exemplo n.º 2
0
 @Override
 public void onDestroyView() {
   super.onDestroyView();
   getActivity().unbindService(playConn);
 }
Exemplo n.º 3
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(receiver);
 }