@Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   if (getArguments() != null) {
     pageNumber = getArguments().getInt(PAGE_NUMBER);
   }
 }
  @Override
  public void onPrepareOptionsMenu(final Menu menu) {

    BlobDescriptorList list = getDescriptorList();

    miFilter = menu.findItem(R.id.action_filter);
    miFilter.setIcon(icFilter);

    View filterActionView = miFilter.getActionView();
    SearchView searchView = (SearchView) filterActionView.findViewById(R.id.fldFilter);
    searchView.setQueryHint(miFilter.getTitle());
    searchView.setQuery(list.getFilter(), true);
    searchView.setOnQueryTextListener(
        new SearchView.OnQueryTextListener() {
          @Override
          public boolean onQueryTextSubmit(String query) {
            return true;
          }

          @Override
          public boolean onQueryTextChange(String newText) {
            BlobDescriptorList list = getDescriptorList();
            if (!newText.equals(list.getFilter())) {
              getDescriptorList().setFilter(newText);
            }
            return true;
          }
        });
    setSortOrder(menu.findItem(R.id.action_sort_order), list.getSortOrder());
    setAscending(menu.findItem(R.id.action_sort_asc), list.isAscending());

    super.onPrepareOptionsMenu(menu);
  }
 @Override
 public void onPause() {
   super.onPause();
   if (deleteConfirmationDialog != null) {
     deleteConfirmationDialog.dismiss();
   }
 }
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    Map<String, String> map = mLocalMusicAdapter.getItem(position);
    // 取得铃声名
    String ringName = map.get(WeacConstants.RING_NAME);
    // 取得播放地址
    String ringUrl = map.get(WeacConstants.RING_URL);
    // 更新当前铃声选中的位置
    mLocalMusicAdapter.updateSelection(ringName);
    // 更新适配器刷新铃声列表显示
    mLocalMusicAdapter.notifyDataSetChanged();
    // 设置最后一次选中的铃声选择界面位置为本地音乐界面
    RingSelectItem.getInstance().setRingPager(1);

    // 播放音频文件
    AudioPlayer.getInstance(getActivity()).play(ringUrl, false, false);

    ViewPager pager = (ViewPager) getActivity().findViewById(R.id.fragment_ring_select_sort);
    PagerAdapter f = pager.getAdapter();
    SystemRingFragment systemRingFragment = (SystemRingFragment) f.instantiateItem(pager, 0);
    RecorderFragment recorderFragment = (RecorderFragment) f.instantiateItem(pager, 2);
    // 取消系统铃声选中标记
    if (systemRingFragment.mSystemRingAdapter != null) {
      systemRingFragment.mSystemRingAdapter.updateSelection("");
      systemRingFragment.mSystemRingAdapter.notifyDataSetChanged();
    }
    // 取消录音选中标记
    if (recorderFragment.mRecorderAdapter != null) {
      recorderFragment.mRecorderAdapter.updateSelection("");
      recorderFragment.mRecorderAdapter.notifyDataSetChanged();
    }
  }
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   // 管理cursor
   LoaderManager loaderManager = getLoaderManager();
   // 注册Loader
   loaderManager.initLoader(LOADER_ID, null, this);
 }
Exemple #6
0
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    getListView().setEmptyView(view.findViewById(android.R.id.empty));
    loadingView = view.findViewById(android.R.id.progress);

    setListVisible(false);
    // setEmptyViewVisible(false);
  }
 protected void onCreate(Bundle paramBundle) {
   super.onCreate(paramBundle, 2130903095, true);
   setRequestedOrientation(1);
   setupActionBar(
       Boolean.valueOf(true),
       Boolean.valueOf(true),
       Integer.valueOf(2131624271),
       Boolean.valueOf(true));
   Intent localIntent = getIntent();
   if (paramBundle == null) {
     ChannelsListFragment localChannelsListFragment = new ChannelsListFragment();
     long l = localIntent.getLongExtra("selected_channel", -1L);
     localIntent.putExtra("refresh", false);
     localIntent.putExtra("take_focus", true);
     localIntent.putExtra("selected_channel", l);
     localChannelsListFragment.setArguments(BaseListFragment.prepareArguments(localIntent, false));
     getSupportFragmentManager()
         .beginTransaction()
         .add(2131361953, localChannelsListFragment)
         .commit();
   }
 }
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    BlobDescriptorList descriptorList = getDescriptorList();

    SharedPreferences p = this.prefs();

    String sortOrderStr = p.getString(PREF_SORT_ORDER, BlobDescriptorList.SortOrder.TIME.name());
    BlobDescriptorList.SortOrder sortOrder = BlobDescriptorList.SortOrder.valueOf(sortOrderStr);

    boolean sortDir = p.getBoolean(PREF_SORT_DIRECTION, false);

    descriptorList.setSort(sortOrder, sortDir);

    listAdapter = new BlobDescriptorListAdapter(descriptorList);

    final FragmentActivity activity = getActivity();

    icFilter = FontIconDrawable.inflate(activity, R.xml.ic_actionbar_filter);
    icClock = FontIconDrawable.inflate(activity, R.xml.ic_actionbar_clock);
    icList = FontIconDrawable.inflate(activity, R.xml.ic_actionbar_list);
    icArrowUp = FontIconDrawable.inflate(activity, R.xml.ic_actionbar_sort_asc);
    icArrowDown = FontIconDrawable.inflate(activity, R.xml.ic_actionbar_sort_desc);

    final ListView listView = getListView();
    listView.setOnItemClickListener(
        new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Intent intent = new Intent(activity, ArticleCollectionActivity.class);
            intent.setAction(getItemClickAction());
            intent.putExtra("position", position);
            startActivity(intent);
          }
        });

    setListAdapter(listAdapter);
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
 }
 @Override
 public void onResume() {
   super.onResume();
 }
 @Override
 public void onPause() {
   super.onPause();
 }
Exemple #12
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   loadingView = null;
 }