diff options
author | Andrew Dolgov <[email protected]> | 2011-11-24 15:08:02 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-11-24 15:08:02 +0300 |
commit | 4776a5d439731fca488ef7a06432e2b858d49e69 (patch) | |
tree | 6e3e7450f7d876a0d3bed4b31ba238def3f1c222 | |
parent | 1fe01350a51152f0f596f3e2c6eaadb36f940b57 (diff) |
implement closing of articlepanel
-rw-r--r-- | res/layout/main.xml | 18 | ||||
-rw-r--r-- | src/org/fox/ttrss/ArticleFragment.java | 16 | ||||
-rw-r--r-- | src/org/fox/ttrss/MainActivity.java | 1 |
3 files changed, 25 insertions, 10 deletions
diff --git a/res/layout/main.xml b/res/layout/main.xml index 1509b309..da5de56f 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -1,17 +1,17 @@ <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:id="@+id/sync_splash" android:layout_height="match_parent" android:layout_width="match_parent" android:layout_gravity="center_vertical"> - <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center"> - <ProgressBar android:id="@+id/loading_progress" android:layout_width="wrap_content" style="?android:attr/progressBarStyleLarge" android:layout_height="wrap_content"></ProgressBar> - <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/loading_message" android:text="@string/loading_message"></TextView> + <LinearLayout android:layout_height="fill_parent" android:orientation="horizontal" android:id="@+id/main" android:layout_width="fill_parent"> + <FrameLayout android:layout_height="match_parent" android:layout_width="300dp" android:layout_weight="0" android:id="@+id/feeds_fragment"></FrameLayout> + <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="0.5" android:id="@+id/headlines_fragment"></FrameLayout> + <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="0.5" android:id="@+id/article_fragment"></FrameLayout> + </LinearLayout> + <FrameLayout android:layout_gravity="center_vertical" android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/sync_splash"> + <LinearLayout android:layout_width="match_parent" android:gravity="center" android:layout_height="match_parent" android:id="@+id/linearLayout1"> + <ProgressBar android:layout_height="wrap_content" android:layout_width="wrap_content" style="?android:attr/progressBarStyleLarge" android:id="@+id/loading_progress"></ProgressBar> + <TextView android:id="@+id/loading_message" android:text="@string/loading_message" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_height="wrap_content" android:layout_width="wrap_content"></TextView> </LinearLayout> </FrameLayout> - <LinearLayout android:orientation="horizontal" android:id="@+id/main" android:layout_height="fill_parent" android:layout_width="fill_parent"> - <FrameLayout android:id="@+id/feeds_fragment" android:layout_weight="0" android:layout_width="300dp" android:layout_height="match_parent"></FrameLayout> - <FrameLayout android:id="@+id/headlines_fragment" android:layout_weight="0.5" android:layout_width="match_parent" android:layout_height="match_parent"></FrameLayout> - <FrameLayout android:id="@+id/article_fragment" android:layout_weight="0.5" android:layout_width="match_parent" android:layout_height="match_parent"></FrameLayout> - </LinearLayout> </ViewFlipper>
\ No newline at end of file diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index abde36a0..ed90041b 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -4,15 +4,17 @@ import java.net.URLEncoder; import android.app.Activity;
import android.app.Fragment;
+import android.app.FragmentTransaction;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
+import android.widget.Button;
import android.widget.TextView;
-public class ArticleFragment extends Fragment {
+public class ArticleFragment extends Fragment implements View.OnClickListener {
private final String TAG = this.getClass().getSimpleName();
protected SharedPreferences m_prefs;
@@ -50,6 +52,12 @@ public class ArticleFragment extends Fragment { web.loadData(content, "text/html", "utf-8");
}
+
+ Button btn = (Button)view.findViewById(R.id.close_button);
+
+ if (btn != null) {
+ btn.setOnClickListener(this);
+ }
}
return view;
@@ -79,4 +87,10 @@ public class ArticleFragment extends Fragment { }
+ @Override
+ public void onClick(View v) {
+ getActivity().findViewById(R.id.article_fragment).setVisibility(View.GONE);
+ getActivity().findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);
+ }
+
}
diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 44625ad4..fdfaadb4 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -317,6 +317,7 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect ft.addToBackStack(null); ft.commit(); + findViewById(R.id.feeds_fragment).setVisibility(View.GONE); findViewById(R.id.article_fragment).setVisibility(View.VISIBLE); } |