Skip to content

Commit

Permalink
disable irrelevant menu items when article is open
Browse files Browse the repository at this point in the history
fix link color in dark theme webview
  • Loading branch information
Andrew Dolgov committed Nov 25, 2011
1 parent 6488994 commit 86b967f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 0 additions & 12 deletions res/layout/login.xml

This file was deleted.

7 changes: 4 additions & 3 deletions src/org/fox/ttrss/ArticleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,19 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
// TODO white on black style for dark theme
String content;
try {
String backgroundOverride = "";
String cssOverride = "";

if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) {
backgroundOverride = "body { background : black; color : #f0f0f0}\n";
cssOverride = "body { background : black; color : #f0f0f0}\na { color : #303060; }\n";
}

content = URLEncoder.encode("<html>" +
"<head>" +
"<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" + // wtf, google?
"<style type=\"text/css\">" +
backgroundOverride +
cssOverride +
"img { max-width : 90%; }" +
"body { text-align : justify; }" +
"</style>" +
"</head>" +
"<body>" + m_article.content + "</body></html>", "utf-8").replace('+', ' ');
Expand Down
27 changes: 19 additions & 8 deletions src/org/fox/ttrss/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,18 @@ private void initMainMenu() {

m_menu.findItem(R.id.logout).setVisible(true);

m_menu.findItem(R.id.update_feeds).setEnabled(true);
m_menu.findItem(R.id.show_feeds).setEnabled(true);

if (m_selectedArticle != null) {
m_menu.findItem(R.id.close_article).setVisible(true);
m_menu.findItem(R.id.share_article).setVisible(true);

m_menu.findItem(R.id.update_feeds).setEnabled(false);
m_menu.findItem(R.id.show_feeds).setEnabled(false);
} else {
m_menu.findItem(R.id.close_article).setVisible(false);
m_menu.findItem(R.id.share_article).setVisible(false);

m_menu.findItem(R.id.update_feeds).setEnabled(true);
m_menu.findItem(R.id.show_feeds).setEnabled(true);
}

} else {
Expand Down Expand Up @@ -410,11 +413,6 @@ public Feed getActiveFeed() {
}

public void logout() {
findViewById(R.id.loading_container).setVisibility(View.VISIBLE);
findViewById(R.id.main).setVisibility(View.INVISIBLE);

initMainMenu();

if (m_refreshTask != null) {
m_refreshTask.cancel();
m_refreshTask = null;
Expand All @@ -426,6 +424,19 @@ public void logout() {
}

m_sessionId = null;

findViewById(R.id.loading_container).setVisibility(View.VISIBLE);
findViewById(R.id.main).setVisibility(View.INVISIBLE);

TextView tv = (TextView)findViewById(R.id.loading_message);

if (tv != null) {
tv.setText(R.string.login_ready);
}

findViewById(R.id.loading_progress).setVisibility(View.GONE);

initMainMenu();
}

public void login() {
Expand Down

0 comments on commit 86b967f

Please sign in to comment.