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 @@ - - - - + + + + + + + + + - - - - - \ 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); }