diff options
author | Andrew Dolgov <[email protected]> | 2015-06-04 00:30:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-06-04 00:30:35 +0300 |
commit | c54d13e072968fe74f0e3c43ec664a12b115bdfa (patch) | |
tree | 9e151bd9be7102854c1d6dd825172e56cf47d0a1 /org.fox.ttrss/src/main/java | |
parent | 6b6107b2764003af19162e85d16a49a4bd42f930 (diff) |
move to v7 toolbar widget instead of old-style actionbar
Diffstat (limited to 'org.fox.ttrss/src/main/java')
12 files changed, 186 insertions, 86 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java index 7598cef7..cf532b81 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java @@ -14,6 +14,7 @@ import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.ContextMenu; import android.view.GestureDetector; @@ -261,6 +262,9 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur setContentView(R.layout.article_images_pager); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + m_progress = (ProgressBar) findViewById(R.id.article_images_progress); getSupportActionBar().setDisplayHomeAsUpEnabled(true); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java index 67a06d74..83f0ec25 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java @@ -222,13 +222,8 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe m_list = (ListView)view.findViewById(R.id.feeds); m_adapter = new FeedCategoryListAdapter(getActivity(), R.layout.feeds_row, (ArrayList<FeedCategory>)m_cats); - if (m_activity.isSmallScreen()) { - View layout = inflater.inflate(R.layout.headlines_heading_spacer, m_list, false); - m_list.addHeaderView(layout); - } - // TODO: better check - if (m_activity.findViewById(R.id.headlines_drawer) != null) { + if (true /*m_activity.findViewById(R.id.headlines_drawer) != null*/) { try { View layout = inflater.inflate(R.layout.drawer_header, m_list, false); m_list.addHeaderView(layout, null, false); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java index a10c6045..5ad9b476 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java @@ -13,6 +13,7 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Gravity; import android.view.MenuItem; @@ -57,6 +58,9 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + GlobalState.getInstance().load(savedInstanceState); m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer); @@ -208,7 +212,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe Fragment cf = getSupportFragmentManager().findFragmentByTag(FRAG_CATS); HeadlinesFragment hf = (HeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); - if (m_drawerLayout != null) { + /* if (m_drawerLayout != null) { boolean isDrawerOpen = m_drawerLayout.isDrawerOpen(Gravity.START); m_menu.setGroupVisible(R.id.menu_group_feeds, isDrawerOpen); @@ -218,8 +222,11 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe m_menu.setGroupVisible(R.id.menu_group_headlines, hf != null && hf.isAdded()); m_menu.findItem(R.id.update_headlines).setVisible(false); - } - + } */ + + m_menu.setGroupVisible(R.id.menu_group_feeds, (ff != null && ff.isAdded()) || (cf != null && cf.isAdded())); + m_menu.setGroupVisible(R.id.menu_group_headlines, hf != null && hf.isAdded()); + //m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false); MenuItem item = m_menu.findItem(R.id.show_feeds); @@ -375,10 +382,10 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe invalidateOptionsMenu(); refresh(); return true; - case R.id.update_feeds: + /*case R.id.update_feeds: //m_pullToRefreshAttacher.setRefreshing(true); refresh(); - return true; + return true;*/ default: Log.d(TAG, "onOptionsItemSelected, unhandled id=" + item.getItemId()); return super.onOptionsItemSelected(item); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java index 42e32f20..ce25cdf5 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java @@ -6,9 +6,11 @@ import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.graphics.Typeface; +import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.Fragment; @@ -27,7 +29,6 @@ import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -287,48 +288,58 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh m_list = (ListView)view.findViewById(R.id.feeds); - if (m_activity.isSmallScreen()) { - View layout = inflater.inflate(R.layout.headlines_heading_spacer, m_list, false); - m_list.addHeaderView(layout); - } + // TODO: better check + if (true /*m_activity.findViewById(R.id.headlines_drawer) != null*/) { + try { + View layout = inflater.inflate(R.layout.drawer_header, m_list, false); + m_list.addHeaderView(layout, null, false); - if (m_enableParentBtn) { - View layout = inflater.inflate(R.layout.feeds_goback, m_list, false); + TextView login = (TextView) view.findViewById(R.id.drawer_header_login); + TextView server = (TextView) view.findViewById(R.id.drawer_header_server); - layout.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - m_activity.getSupportFragmentManager().popBackStack(); - } - }); - - m_list.addHeaderView(layout, null, false); - } else { - // TODO: better check - if (m_activity.findViewById(R.id.headlines_drawer) != null) { - try { - View layout = inflater.inflate(R.layout.drawer_header, m_list, false); - m_list.addHeaderView(layout, null, false); - - TextView login = (TextView) view.findViewById(R.id.drawer_header_login); - TextView server = (TextView) view.findViewById(R.id.drawer_header_server); - - login.setText(m_prefs.getString("login", "")); - try { - server.setText(new URL(m_prefs.getString("ttrss_url", "")).getHost()); - } catch (MalformedURLException e) { - server.setText(""); - } - } catch (InflateException e) { - // welp couldn't inflate header i guess - e.printStackTrace(); - } catch (java.lang.UnsupportedOperationException e) { - e.printStackTrace(); - } - } - } + login.setText(m_prefs.getString("login", "")); + try { + server.setText(new URL(m_prefs.getString("ttrss_url", "")).getHost()); + } catch (MalformedURLException e) { + server.setText(""); + } + + View account = view.findViewById(R.id.drawer_header_account); + + account.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW, + Uri.parse(m_prefs.getString("ttrss_url", ""))); + startActivity(intent); + } catch (Exception e) { + + } + } + }); + } catch (InflateException e) { + // welp couldn't inflate header i guess + e.printStackTrace(); + } catch (java.lang.UnsupportedOperationException e) { + e.printStackTrace(); + } + } + + if (m_enableParentBtn) { + View layout = inflater.inflate(R.layout.feeds_goback, m_list, false); + + layout.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + m_activity.getSupportFragmentManager().popBackStack(); + } + }); + + m_list.addHeaderView(layout, null, false); + } - m_adapter = new FeedListAdapter(getActivity(), R.layout.feeds_row, (ArrayList<Feed>)m_feeds); + m_adapter = new FeedListAdapter(getActivity(), R.layout.feeds_row, (ArrayList<Feed>)m_feeds); m_list.setAdapter(m_adapter); //list.setEmptyView(view.findViewById(R.id.no_feeds)); m_list.setOnItemClickListener(this); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java index 2f83245a..17915a57 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java @@ -9,11 +9,10 @@ import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; import android.support.v4.app.FragmentTransaction; -import android.support.v4.view.WindowCompat; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; -import android.view.Window; import org.fox.ttrss.types.Article; import org.fox.ttrss.types.ArticleList; @@ -38,6 +37,9 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL setContentView(R.layout.headlines_articles); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + m_forceDisableActionMode = isPortrait() || isSmallScreen(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java index 3dcb6ff9..646f5f34 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java @@ -19,6 +19,7 @@ import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v7.view.ActionMode; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.KeyEvent; import android.view.Menu; @@ -164,6 +165,9 @@ public class OnlineActivity extends CommonActivity { setContentView(R.layout.login); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + if (!ImageLoader.getInstance().isInited()) { ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()) .diskCache( @@ -1022,12 +1026,12 @@ public class OnlineActivity extends CommonActivity { } return true; - case R.id.update_headlines: + /*case R.id.update_headlines: if (hf != null) { //m_pullToRefreshAttacher.setRefreshing(true); hf.refresh(false, true); } - return true; + return true;*/ default: Log.d(TAG, "onOptionsItemSelected, unhandled id=" + item.getItemId()); return super.onOptionsItemSelected(item); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/PreferencesActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/PreferencesActivity.java index be2e35a0..525ec37a 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/PreferencesActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/PreferencesActivity.java @@ -1,21 +1,10 @@ package org.fox.ttrss; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; import android.os.Bundle; -import android.preference.PreferenceActivity; import android.preference.PreferenceManager; -import android.support.v4.app.FragmentTransaction; -import android.util.Log; +import android.support.v7.widget.Toolbar; import android.view.MenuItem; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Locale; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - public class PreferencesActivity extends CommonActivity { @Override public void onCreate(Bundle savedInstanceState) { @@ -29,6 +18,9 @@ public class PreferencesActivity extends CommonActivity { setContentView(R.layout.preferences); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java index aa61a496..1bd2342c 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java @@ -15,6 +15,7 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.BaseColumns; import android.support.v7.view.ActionMode; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.KeyEvent; import android.view.Menu; @@ -171,6 +172,9 @@ public class OfflineActivity extends CommonActivity { setContentView(R.layout.login); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + invalidateOptionsMenu(); Intent intent = getIntent(); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java index 7a0702bc..340b5997 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java @@ -2,9 +2,11 @@ package org.fox.ttrss.offline; import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.database.Cursor; +import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.BaseColumns; @@ -14,6 +16,7 @@ import android.support.v4.widget.SwipeRefreshLayout; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.InflateException; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -23,12 +26,14 @@ import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import org.fox.ttrss.R; +import java.net.MalformedURLException; +import java.net.URL; + public class OfflineFeedCategoriesFragment extends Fragment implements OnItemClickListener, OnSharedPreferenceChangeListener { private final String TAG = this.getClass().getSimpleName(); private SharedPreferences m_prefs; @@ -142,16 +147,49 @@ public class OfflineFeedCategoriesFragment extends Fragment implements OnItemCli m_list = (ListView)view.findViewById(R.id.feeds); - if (m_activity.isSmallScreen()) { - View layout = inflater.inflate(R.layout.headlines_heading_spacer, m_list, false); - m_list.addHeaderView(layout); - } - m_cursor = createCursor(); m_adapter = new FeedCategoryListAdapter(getActivity(), R.layout.feeds_row, m_cursor, new String[] { "title", "unread" }, new int[] { R.id.title, R.id.unread_counter }, 0); + // TODO: better check + if (true /*m_activity.findViewById(R.id.headlines_drawer) != null*/) { + try { + View layout = inflater.inflate(R.layout.drawer_header, m_list, false); + m_list.addHeaderView(layout, null, false); + + TextView login = (TextView) view.findViewById(R.id.drawer_header_login); + TextView server = (TextView) view.findViewById(R.id.drawer_header_server); + + login.setText(m_prefs.getString("login", "")); + try { + server.setText(new URL(m_prefs.getString("ttrss_url", "")).getHost()); + } catch (MalformedURLException e) { + server.setText(""); + } + + View account = view.findViewById(R.id.drawer_header_account); + + account.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW, + Uri.parse(m_prefs.getString("ttrss_url", ""))); + startActivity(intent); + } catch (Exception e) { + + } + } + }); + } catch (InflateException e) { + // welp couldn't inflate header i guess + e.printStackTrace(); + } catch (java.lang.UnsupportedOperationException e) { + e.printStackTrace(); + } + } + m_list.setAdapter(m_adapter); m_list.setOnItemClickListener(this); m_list.setEmptyView(view.findViewById(R.id.no_feeds)); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java index f390b890..3d6817de 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -15,6 +15,7 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Gravity; import android.view.MenuItem; @@ -46,6 +47,9 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead setContentView(R.layout.headlines); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); GlobalState.getInstance().load(savedInstanceState); @@ -204,7 +208,7 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead Fragment cf = getSupportFragmentManager().findFragmentByTag(FRAG_CATS); OfflineHeadlinesFragment hf = (OfflineHeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); - if (m_drawerLayout != null) { + /* if (m_drawerLayout != null) { boolean isDrawerOpen = m_drawerLayout.isDrawerOpen(Gravity.START); m_menu.setGroupVisible(R.id.menu_group_feeds, isDrawerOpen); @@ -212,8 +216,11 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead } else { m_menu.setGroupVisible(R.id.menu_group_feeds, (ff != null && ff.isAdded()) || (cf != null && cf.isAdded())); m_menu.setGroupVisible(R.id.menu_group_headlines, hf != null && hf.isAdded()); - } - + } */ + + m_menu.setGroupVisible(R.id.menu_group_feeds, (ff != null && ff.isAdded()) || (cf != null && cf.isAdded())); + m_menu.setGroupVisible(R.id.menu_group_headlines, hf != null && hf.isAdded()); + //m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false); MenuItem item = m_menu.findItem(R.id.show_feeds); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java index 4024219f..27f729f6 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java @@ -2,21 +2,20 @@ package org.fox.ttrss.offline; import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.database.Cursor; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; +import android.net.Uri; import android.os.Bundle; -import android.os.Environment; import android.preference.PreferenceManager; -import android.provider.BaseColumns; import android.support.v4.app.Fragment; import android.support.v4.widget.SimpleCursorAdapter; import android.support.v4.widget.SwipeRefreshLayout; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.InflateException; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -26,13 +25,13 @@ import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import org.fox.ttrss.R; -import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; public class OfflineFeedsFragment extends Fragment implements OnItemClickListener, OnSharedPreferenceChangeListener { private final String TAG = this.getClass().getSimpleName(); @@ -155,10 +154,43 @@ public class OfflineFeedsFragment extends Fragment implements OnItemClickListene m_list = (ListView)view.findViewById(R.id.feeds); - if (m_activity.isSmallScreen()) { - View layout = inflater.inflate(R.layout.headlines_heading_spacer, m_list, false); - m_list.addHeaderView(layout); - } + // TODO: better check + if (true /*m_activity.findViewById(R.id.headlines_drawer) != null*/) { + try { + View layout = inflater.inflate(R.layout.drawer_header, m_list, false); + m_list.addHeaderView(layout, null, false); + + TextView login = (TextView) view.findViewById(R.id.drawer_header_login); + TextView server = (TextView) view.findViewById(R.id.drawer_header_server); + + login.setText(m_prefs.getString("login", "")); + try { + server.setText(new URL(m_prefs.getString("ttrss_url", "")).getHost()); + } catch (MalformedURLException e) { + server.setText(""); + } + + View account = view.findViewById(R.id.drawer_header_account); + + account.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW, + Uri.parse(m_prefs.getString("ttrss_url", ""))); + startActivity(intent); + } catch (Exception e) { + + } + } + }); + } catch (InflateException e) { + // welp couldn't inflate header i guess + e.printStackTrace(); + } catch (java.lang.UnsupportedOperationException e) { + e.printStackTrace(); + } + } if (m_enableParentBtn) { View layout = inflater.inflate(R.layout.feeds_goback, container, false); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java index a52252dd..967c7f75 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java @@ -12,6 +12,7 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; @@ -39,6 +40,9 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline setContentView(R.layout.headlines_articles); + Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar_toolbar); + setSupportActionBar(toolbar); + m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer); if (m_drawerLayout != null) { |