Last active
January 6, 2018 23:37
Revisions
-
keyboardr revised this gist
Mar 28, 2013 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,10 +18,10 @@ public void onLoadFinished(Loader<List<Content>> loader, List<Content> content){ @Override public Loader<List<Content>> onCreateLoader(int arg0, Bundle arg1) { return new ContentLoader(getActivity()); } @Override public void onLoaderReset(Loader<List<Episode>> arg0) { } } -
keyboardr created this gist
Mar 28, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ public class ContentListFragment extends ListFragment implements LoaderCallbacks<List<Content>>{ @Override public void onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ return inflater.inflate(R.layout.layout, container, false); } @Override public void onViewCreated(View view, Bundle savedInstanceState){ super.onViewCreated(view, savedInstanceState); getLoaderManager().initLoader(0, null, this); } @Override public void onLoadFinished(Loader<List<Content>> loader, List<Content> content){ setListAdapter(new ContentListAdapter(content); ((ViewSwitcher) getView().findViewById(R.id.empty)).setDisplayedChild(1); } @Override public Loader<List<Content>> onCreateLoader(int arg0, Bundle arg1) { return new ContentLoader(getActivity()); } @Override public void onLoaderReset(Loader<List<Episode>> arg0) { } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content"> </ListView> <ViewSwitcher android:id="@android:id/empty" android:layout_width="match_parent" android:layout_height="match_parent" > <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/content_empty" /> </ViewSwitcher> </FrameLayout>