@Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    if (savedInstanceState != null && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) {
      setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION));
    }
  }
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    // Restore the previously serialized activated item position.
    if (savedInstanceState != null && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) {
      setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION));
    }
  }
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    mValues = getResources().getStringArray(R.array.countries);

    ArrayAdapter<String> adapter =
        new ArrayAdapter<String>(getActivity(), R.layout.list_item, R.id.item_tv, mValues);

    mListView.setAdapter(adapter);

    // Set up the QuickReturn scroll listener
    int headerHeight = getActivity().getResources().getDimensionPixelSize(R.dimen.header_height2);
    QuickReturnListViewOnScrollListener scrollListener =
        new QuickReturnListViewOnScrollListener(
            QuickReturnType.HEADER, mQuickReturnTextView, -headerHeight, null, 0);
    // Setting to true will slide the header and/or footer into view or slide out of view based
    // on what is visible in the idle scroll state
    scrollListener.setCanSlideInIdleScrollState(true);
    mListView.setOnScrollListener(scrollListener);
  }
Esempio n. 4
0
  @Override
  public void onViewCreated(final View view, final Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    final ListView listView = getListView();
    listView.setDividerHeight(0);

    final SwipeDismissListViewTouchListener swipeDismissListener;
    swipeDismissListener = createSwipeDismissListener(listView);
    listView.setOnTouchListener(swipeDismissListener);
    listView.setOnScrollListener(swipeDismissListener.makeScrollListener());

    if (!listAdapter.onRestoreInstanceState(savedInstanceState)) {
      listAdapter.loadContents(activity);
    }

    if (savedInstanceState != null) {
      final int firstPosition = savedInstanceState.getInt(KEY_STATE_FIRST_POS, 0);
      final int top = savedInstanceState.getInt(KEY_STATE_TOP, 0);
      listView.setSelectionFromTop(firstPosition, top);
    }
  }
Esempio n. 5
0
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
 }
Esempio n. 6
0
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    getLoaderManager().initLoader(0, null, this);
  }
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   viewCreated.set(true);
   setSelection(messageAdapter.getCount() - 1);
 }
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   getListView().setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
 }
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   registerForContextMenu(this.getListView());
 }
Esempio n. 10
0
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    final MainActivity mainActivity = ((MainActivity) this.getActivity());
    super.onViewCreated(view, savedInstanceState);
    if (this.isHidden()) return;

    DrawerAdapter drawerAdapter =
        ((DrawerAdapter) ((ListView) mainActivity.findViewById(R.id.drawer_list)).getAdapter());
    if (drawerAdapter.getSelectedItem() != 1) {
      drawerAdapter.setSelectedItem(1);
      drawerAdapter.notifyDataSetChanged();
    }

    megaListView.setOnGroupClickListener(
        new ExpandableListView.OnGroupClickListener() {

          @Override
          public boolean onGroupClick(
              ExpandableListView parent, View v, int groupPosition, long id) {
            final ImageView indicator = (ImageView) v.findViewById(R.id.group_indicator);
            RotateAnimation anim;
            if (megaListView.isGroupExpanded(groupPosition)) {
              megaListView.collapseGroupWithAnimation(groupPosition);
              if (indicator != null) {
                anim =
                    new RotateAnimation(
                        180f, 360f, indicator.getWidth() / 2, indicator.getHeight() / 2);
                anim.setInterpolator(new DecelerateInterpolator(3));
                anim.setDuration(500);
                anim.setFillAfter(true);
                indicator.startAnimation(anim);
              }
            } else {
              megaListView.expandGroupWithAnimation(groupPosition);
              if (indicator != null) {
                anim =
                    new RotateAnimation(
                        0f, 180f, indicator.getWidth() / 2, indicator.getHeight() / 2);
                anim.setInterpolator(new DecelerateInterpolator(2));
                anim.setDuration(500);
                anim.setFillAfter(true);
                indicator.startAnimation(anim);
              }
            }
            return true;
          }
        });

    megaListView.setOnChildClickListener(
        new ExpandableListView.OnChildClickListener() {
          @Override
          public boolean onChildClick(
              ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
            if (mSwiping) {
              mSwiping = false;
              return false;
            }
            final MainActivity mainActivity = (MainActivity) getActivity();
            megaListView.setOnChildClickListener(null); // prevents bug on double tap
            mainActivity.updateLyricsFragment(
                R.animator.slide_out_start,
                R.animator.slide_in_start,
                true,
                lyricsArray.get(groupPosition).get(childPosition));
            return true;
          }
        });

    this.isActiveFragment = true;
    new DBContentLister(this).execute();
  }
Esempio n. 11
0
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   RoboGuice.getInjector(getActivity()).injectViewMembers(this);
 }
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   getListView().setSelector(new ColorDrawable(Color.TRANSPARENT));
 }