diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java index 740d43b9..40199afd 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java @@ -234,7 +234,10 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe list.setAdapter(m_adapter); list.setOnItemClickListener(this); registerForContextMenu(list); - + + View loadingBar = (View) view.findViewById(R.id.feeds_loading_bar); + loadingBar.setVisibility(View.VISIBLE); + //m_activity.m_pullToRefreshAttacher.addRefreshableView(list, this); return view; @@ -332,7 +335,13 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe if (list != null) { list.setEmptyView(getView().findViewById(R.id.no_feeds)); } - } + + View loadingBar = getView().findViewById(R.id.feeds_loading_bar); + + if (loadingBar != null) { + loadingBar.setVisibility(View.GONE); + } + } if (result != null) { try { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java index 6b51ad16..bd365248 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java @@ -296,14 +296,6 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe @Override public boolean onOptionsItemSelected(MenuItem item) { - - if (item.getItemId() == android.R.id.home && getSupportFragmentManager().getBackStackEntryCount() > 0) { - if (m_drawerLayout != null && m_drawerLayout.isDrawerOpen(Gravity.START)) { - getSupportFragmentManager().popBackStack(); - return true; - } - } - if (m_drawerToggle != null && m_drawerToggle.onOptionsItemSelected(item)) { return true; } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java index 83fbf944..f111a126 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java @@ -31,7 +31,6 @@ import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; -import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; @@ -297,7 +296,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh android.R.color.holo_orange_dark); } - Button parentBtn = (Button) view.findViewById(R.id.open_parent); + /* Button parentBtn = (Button) view.findViewById(R.id.open_parent); if (parentBtn != null) { if (m_enableParentBtn) { @@ -310,19 +309,39 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh } else { parentBtn.setVisibility(View.GONE); } + } */ + + ListView list = (ListView)view.findViewById(R.id.feeds); + + if (m_enableParentBtn) { + View layout = inflater.inflate(R.layout.feeds_goback, container, false); + + layout.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, + ListView.LayoutParams.WRAP_CONTENT)); + + layout.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + m_activity.getSupportFragmentManager().popBackStack(); + } + }); + + list.addHeaderView(layout, null, false); } - ListView list = (ListView)view.findViewById(R.id.feeds); - m_adapter = new FeedListAdapter(getActivity(), R.layout.feeds_row, (ArrayList)m_feeds); + m_adapter = new FeedListAdapter(getActivity(), R.layout.feeds_row, (ArrayList)m_feeds); list.setAdapter(m_adapter); //list.setEmptyView(view.findViewById(R.id.no_feeds)); list.setOnItemClickListener(this); - + registerForContextMenu(list); m_enableFeedIcons = m_prefs.getBoolean("download_feed_icons", false); - - //Log.d(TAG, "mpTRA=" + m_activity.m_pullToRefreshAttacher); + + View loadingBar = (View) view.findViewById(R.id.feeds_loading_bar); + loadingBar.setVisibility(View.VISIBLE); + + //Log.d(TAG, "mpTRA=" + m_activity.m_pullToRefreshAttacher); //m_activity.m_pullToRefreshAttacher.addRefreshableView(list, this); return view; @@ -517,7 +536,13 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh if (list != null) { list.setEmptyView(getView().findViewById(R.id.no_feeds)); } - } + + View loadingBar = getView().findViewById(R.id.feeds_loading_bar); + + if (loadingBar != null) { + loadingBar.setVisibility(View.GONE); + } + } if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false); @@ -569,6 +594,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh public static final int VIEW_NORMAL = 0; public static final int VIEW_SELECTED = 1; + //public static final int VIEW_GOBACK = 2; public static final int VIEW_COUNT = VIEW_SELECTED+1; @@ -584,8 +610,10 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh @Override public int getItemViewType(int position) { Feed feed = items.get(position); - - if (m_selectedFeed != null && feed.id == m_selectedFeed.id) { + + /* if (m_enableParentBtn && position == 0) { + return VIEW_GOBACK; + } else */ if (m_selectedFeed != null && feed.id == m_selectedFeed.id) { return VIEW_SELECTED; } else { return VIEW_NORMAL; @@ -602,6 +630,8 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh int layoutId = R.layout.feeds_row; switch (getItemViewType(position)) { + /* case VIEW_GOBACK: + layoutId = R.layout.feeds_goback; */ case VIEW_SELECTED: layoutId = R.layout.feeds_row_selected; break; diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java index b82f2486..89010584 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -130,9 +130,6 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead } switch (item.getItemId()) { - case android.R.id.home: - //getSupportFragmentManager().popBackStack(); - return true; case R.id.headlines_toggle_sort_order: /* SharedPreferences.Editor editor = m_prefs.edit(); editor.putBoolean("offline_oldest_first", !m_prefs.getBoolean("offline_oldest_first", false)); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java index ea6e59e3..cb456319 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java @@ -25,7 +25,6 @@ import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; -import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ListView; @@ -172,21 +171,6 @@ public class OfflineFeedsFragment extends Fragment implements OnItemClickListene android.R.color.holo_orange_dark); } - Button parentBtn = (Button) view.findViewById(R.id.open_parent); - - if (parentBtn != null) { - if (m_enableParentBtn) { - parentBtn.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - m_activity.getSupportFragmentManager().popBackStack(); - } - }); - } else { - parentBtn.setVisibility(View.GONE); - } - } - ListView list = (ListView)view.findViewById(R.id.feeds); m_cursor = createCursor(); diff --git a/org.fox.ttrss/src/main/res/layout/cats_fragment.xml b/org.fox.ttrss/src/main/res/layout/cats_fragment.xml index 1f0fc38b..87479565 100644 --- a/org.fox.ttrss/src/main/res/layout/cats_fragment.xml +++ b/org.fox.ttrss/src/main/res/layout/cats_fragment.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="fill_parent" > - @@ -29,4 +29,12 @@ android:visibility="invisible" > + + \ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout/feeds_fragment.xml b/org.fox.ttrss/src/main/res/layout/feeds_fragment.xml index 4c5ad73a..ae82bdd2 100644 --- a/org.fox.ttrss/src/main/res/layout/feeds_fragment.xml +++ b/org.fox.ttrss/src/main/res/layout/feeds_fragment.xml @@ -1,15 +1,13 @@ - + android:layout_height="match_parent"> -