From 9b8de7c539f17c41b5e64722e50e8f6d79ba6044 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 11 Sep 2011 13:25:28 +0400 Subject: add a vertical mainactivity layout --- res/layout-land/main.xml | 42 ++++++++++++++++++++++++++++ res/layout/main.xml | 47 ++++++++++---------------------- src/org/fox/ttrss/HeadlinesFragment.java | 8 ++++++ 3 files changed, 64 insertions(+), 33 deletions(-) create mode 100644 res/layout-land/main.xml diff --git a/res/layout-land/main.xml b/res/layout-land/main.xml new file mode 100644 index 00000000..717231cf --- /dev/null +++ b/res/layout-land/main.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/main.xml b/res/layout/main.xml index 717231cf..bed3e86b 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -1,41 +1,22 @@ - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 01483080..4c72ea8f 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -7,6 +7,7 @@ import android.content.SharedPreferences; import android.database.Cursor; import android.os.Bundle; import android.preference.PreferenceManager; +import android.provider.OpenableColumns; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -23,12 +24,14 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { protected SharedPreferences m_prefs; protected Cursor m_cursor; protected SimpleCursorAdapter m_adapter; + protected int m_articleId; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (savedInstanceState != null) { m_feedId = savedInstanceState.getInt("feedId"); + m_articleId = savedInstanceState.getInt("articleId"); } View view = inflater.inflate(R.layout.headlines_fragment, container, false); @@ -47,6 +50,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { list.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE); } + if (m_articleId != 0) viewArticle(m_articleId); + return view; } @@ -108,6 +113,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { getActivity().findViewById(R.id.article_container).setVisibility(View.VISIBLE); + m_articleId = articleId; + //m_adapter.notifyDataSetChanged(); } @@ -117,6 +124,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { super.onSaveInstanceState(out); out.putInt("feedId", m_feedId); + out.putInt("articleId", m_articleId); } } -- cgit v1.2.3-54-g00ecf