properly report when feeds/cats list is empty, bump version

This commit is contained in:
Andrew Dolgov 2013-02-27 10:39:23 +04:00
parent d381abd82a
commit 72975a9a03
5 changed files with 91 additions and 27 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="138"
android:versionName="1.16" >
android:versionCode="139"
android:versionName="1.17" >
<uses-sdk
android:minSdkVersion="8"

View File

@ -1,12 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cats_fragment.xml"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<LinearLayout android:id="@+id/loading_container" android:gravity="center" android:layout_height="match_parent" android:layout_width="match_parent">
<TextView android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/loading_message" android:layout_height="wrap_content" ></TextView>
</LinearLayout>
<ListView android:id="@+id/feeds" android:layout_height="match_parent" android:layout_width="match_parent"></ListView>
<LinearLayout
android:id="@+id/loading_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
</FrameLayout>
<TextView
android:id="@+id/loading_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" >
</TextView>
</LinearLayout>
<ListView
android:id="@+id/feeds"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
<TextView
android:id="@+id/no_feeds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/no_feeds"
android:textAppearance="?android:attr/textAppearanceLarge"
android:visibility="invisible" >
</TextView>
</FrameLayout>

View File

@ -1,16 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/feeds_fragment"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
android:layout_height="fill_parent" android:layout_width="match_parent" android:id="@+id/feeds_fragment">
<LinearLayout android:id="@+id/loading_container" android:gravity="center" android:layout_height="match_parent" android:layout_width="match_parent">
<TextView android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/loading_message" android:layout_height="wrap_content" ></TextView>
<LinearLayout
android:id="@+id/loading_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<TextView
android:id="@+id/loading_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" >
</TextView>
</LinearLayout>
<ListView android:id="@+id/feeds" android:layout_height="match_parent" android:layout_width="match_parent"></ListView>
<TextView android:id="@+id/no_feeds"
android:visibility="invisible"
android:layout_gravity="center" android:color="#909090"
android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_feeds"></TextView>
<ListView
android:id="@+id/feeds"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</FrameLayout>
<TextView
android:id="@+id/no_feeds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/no_feeds"
android:textAppearance="?android:attr/textAppearanceLarge"
android:visibility="invisible" >
</TextView>
</FrameLayout>

View File

@ -258,6 +258,14 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
m_activity.setProgressBarVisibility(false);
if (getView() != null) {
ListView list = (ListView)getView().findViewById(R.id.feeds);
if (list != null) {
list.setEmptyView(getView().findViewById(R.id.no_feeds));
}
}
if (result != null) {
try {
JsonArray content = result.getAsJsonArray();
@ -285,6 +293,7 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
setLoadingStatus(R.string.no_feeds_to_display, false);
else */
m_adapter.notifyDataSetInvalidated();
m_activity.setLoadingStatus(R.string.blank, false);
return;

View File

@ -392,6 +392,14 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
protected void onPostExecute(JsonElement result) {
if (isDetached()) return;
if (getView() != null) {
ListView list = (ListView)getView().findViewById(R.id.feeds);
if (list != null) {
list.setEmptyView(getView().findViewById(R.id.no_feeds));
}
}
m_activity.setProgressBarVisibility(false);
if (result != null) {
@ -415,6 +423,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
else */
m_activity.setLoadingStatus(R.string.blank, false);
m_adapter.notifyDataSetInvalidated();
if (m_enableFeedIcons && !m_feedIconsChecked &&
Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()))