diff options
-rw-r--r-- | res/layout-land/main.xml | 42 | ||||
-rw-r--r-- | res/layout/main.xml | 47 | ||||
-rw-r--r-- | src/org/fox/ttrss/HeadlinesFragment.java | 8 |
3 files changed, 64 insertions, 33 deletions
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 @@ +<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="fill_parent" android:id="@+id/main_flipper"> + + <FrameLayout android:layout_gravity="center_vertical" android:id="@+id/sync_splash" android:layout_width="match_parent" android:layout_height="match_parent"> + <LinearLayout android:gravity="center" android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent"> + <ProgressBar android:id="@+id/loading_progress" android:layout_height="wrap_content" android:layout_width="wrap_content" style="?android:attr/progressBarStyleLarge"></ProgressBar> + <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/loading_message" android:text="@string/loading_message"></TextView> + </LinearLayout> + </FrameLayout> + + <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:id="@+id/main"> + + <LinearLayout android:layout_weight="1.5" android:layout_height="match_parent" android:id="@+id/linearLayout4" android:layout_width="match_parent"> + + <LinearLayout android:layout_height="match_parent" android:id="@+id/feeds_container" + android:layout_weight="1" + + android:layout_width="match_parent"> + </LinearLayout> + + <ImageView + xmlns:android="http://schemas.android.com/apk/res/android" + android:background="?feedlistDivider" + android:paddingLeft="2dip" android:paddingRight="2dip" + android:layout_width="wrap_content" android:layout_height="match_parent"></ImageView> + + </LinearLayout> + <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.5" android:id="@+id/headlines_wrapper"> + <LinearLayout android:layout_width="match_parent" android:layout_weight="1" android:id="@+id/headlines_container" android:layout_height="match_parent"> + </LinearLayout> + + <ImageView android:paddingRight="2dip" android:layout_height="match_parent" android:background="?feedlistDivider" android:layout_width="wrap_content" android:paddingLeft="2dip"></ImageView> + + <LinearLayout android:layout_weight="1" android:visibility="gone" android:layout_width="match_parent" android:id="@+id/article_container" android:layout_height="match_parent"></LinearLayout> + </LinearLayout> + + + </LinearLayout> + + +</ViewFlipper>
\ 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 @@ <ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/main_flipper"> - - <FrameLayout android:layout_gravity="center_vertical" android:id="@+id/sync_splash" android:layout_width="match_parent" android:layout_height="match_parent"> - <LinearLayout android:gravity="center" android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent"> - <ProgressBar android:id="@+id/loading_progress" android:layout_height="wrap_content" android:layout_width="wrap_content" style="?android:attr/progressBarStyleLarge"></ProgressBar> - <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/loading_message" android:text="@string/loading_message"></TextView> + <FrameLayout android:id="@+id/sync_splash" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_width="match_parent"> + <LinearLayout android:gravity="center" android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="match_parent"> + <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/loading_progress" style="?android:attr/progressBarStyleLarge"></ProgressBar> + <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/loading_message" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/loading_message"></TextView> </LinearLayout> </FrameLayout> - - <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:id="@+id/main"> - - <LinearLayout android:layout_weight="1.5" android:layout_height="match_parent" android:id="@+id/linearLayout4" android:layout_width="match_parent"> - - <LinearLayout android:layout_height="match_parent" android:id="@+id/feeds_container" - android:layout_weight="1" - - android:layout_width="match_parent"> - </LinearLayout> - - <ImageView - xmlns:android="http://schemas.android.com/apk/res/android" - android:background="?feedlistDivider" - android:paddingLeft="2dip" android:paddingRight="2dip" - android:layout_width="wrap_content" android:layout_height="match_parent"></ImageView> - - </LinearLayout> - <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.5" android:id="@+id/headlines_wrapper"> - <LinearLayout android:layout_width="match_parent" android:layout_weight="1" android:id="@+id/headlines_container" android:layout_height="match_parent"> - </LinearLayout> - - <ImageView android:paddingRight="2dip" android:layout_height="match_parent" android:background="?feedlistDivider" android:layout_width="wrap_content" android:paddingLeft="2dip"></ImageView> - - <LinearLayout android:layout_weight="1" android:visibility="gone" android:layout_width="match_parent" android:id="@+id/article_container" android:layout_height="match_parent"></LinearLayout> - </LinearLayout> - - + <LinearLayout android:layout_height="fill_parent" android:id="@+id/main" android:layout_width="fill_parent" android:orientation="horizontal"> + <LinearLayout android:layout_weight="1.5" android:id="@+id/linearLayout4" android:layout_width="match_parent" android:layout_height="match_parent"> + <LinearLayout android:layout_weight="1" android:id="@+id/feeds_container" android:layout_width="match_parent" android:layout_height="match_parent"></LinearLayout> + <ImageView android:background="?feedlistDivider" android:paddingLeft="2dip" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="match_parent" android:paddingRight="2dip"></ImageView> + </LinearLayout> + <LinearLayout android:layout_weight="0.5" android:id="@+id/headlines_wrapper" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> + <LinearLayout android:layout_weight="1" android:id="@+id/headlines_container" android:layout_width="match_parent" android:layout_height="match_parent"></LinearLayout> + <!-- <ImageView android:background="?feedlistDivider" android:paddingLeft="2dip" android:layout_weight="1" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingRight="2dip"></ImageView> --> + <LinearLayout android:visibility="gone" android:layout_weight="1" android:id="@+id/article_container" android:layout_width="match_parent" android:layout_height="match_parent"></LinearLayout> + </LinearLayout> </LinearLayout> 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);
}
}
|