move to v7 toolbar widget instead of old-style actionbar
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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,7 +222,10 @@ 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);
|
||||
|
||||
@ -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);
|
||||
|
@ -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,25 +288,8 @@ 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);
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
// 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);
|
||||
@ -319,6 +303,21 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
||||
} 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();
|
||||
@ -326,6 +325,18 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
||||
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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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));
|
||||
|
@ -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,7 +216,10 @@ 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);
|
||||
|
||||
|
@ -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,9 +154,42 @@ 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) {
|
||||
|
@ -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) {
|
||||
|
After Width: | Height: | Size: 344 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 457 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 595 B |
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 804 B |
After Width: | Height: | Size: 900 B |
@ -1,16 +1,23 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/main"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_below="@+id/actionbar_toolbar">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/sw600dp_anchor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" >
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -39,3 +46,4 @@
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
@ -5,6 +5,8 @@
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/sw600dp_anchor"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1,9 +1,9 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/headlines"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/sw600dp_anchor"
|
||||
@ -17,7 +17,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal" >
|
||||
android:orientation="horizontal"
|
||||
android:layout_below="@+id/actionbar_toolbar">
|
||||
|
||||
<FrameLayout
|
||||
android:paddingRight="4dp"
|
||||
@ -38,4 +39,4 @@
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
12
org.fox.ttrss/src/main/res/layout/actionbar_toolbar.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/actionbar_toolbar"
|
||||
android:elevation="4dp"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary" />
|
@ -1,19 +1,17 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/article_images"
|
||||
android:layout_width="fill_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:background="?headlinesBackground"
|
||||
android:layout_height="fill_parent">
|
||||
/*
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"> */
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
|
||||
<org.fox.ttrss.ArticleImagesPager
|
||||
android:id="@+id/article_images_pager"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_below="@+id/actionbar_toolbar" />
|
||||
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
|
@ -19,8 +19,8 @@
|
||||
android:layout_height="21dp"
|
||||
android:layout_weight="0"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="invisible"
|
||||
android:src="?ic_rss_box" />
|
||||
android:tint="?colorAccent"
|
||||
android:src="?ic_keyboard_backspace" />
|
||||
|
||||
<TextView
|
||||
android:fontFamily="sans-serif-medium"
|
||||
@ -29,7 +29,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingLeft="35dp"
|
||||
android:singleLine="true"
|
||||
android:text=".."
|
||||
android:paddingBottom="2dp"
|
||||
|
@ -7,12 +7,22 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/headlines_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?headlinesBackground"></FrameLayout>
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/feeds_fragment"
|
||||
android:layout_width="240dp"
|
||||
|
@ -1,5 +1,6 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/headlines"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
@ -18,4 +19,5 @@
|
||||
android:background="?headlinesBackground">
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
</FrameLayout>
|
@ -1,15 +1,15 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loading_container"
|
||||
android:layout_width="fill_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:gravity="center"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loading_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/loading_message" />
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
@ -1,8 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/preferences_container"
|
||||
android:fitsSystemWindows="true"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/preferences_container"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="502dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_below="@+id/actionbar_toolbar">
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/actionbar_toolbar" android:id="@+id/actionbar_toolbar" />
|
||||
|
||||
</RelativeLayout>
|
@ -6,8 +6,8 @@
|
||||
<item
|
||||
android:id="@+id/subscribe_to_feed"
|
||||
android:icon="@drawable/ic_plus_circle"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/subscribe_to_feed"/>
|
||||
app:showAsAction=""
|
||||
android:title="@string/subscribe_to_feed"/> <!-- iRroom -->
|
||||
|
||||
<item
|
||||
android:id="@+id/show_feeds"
|
||||
@ -17,25 +17,27 @@
|
||||
<item
|
||||
android:id="@+id/go_offline"
|
||||
android:icon="@drawable/ic_cloud_download"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/go_offline"/>
|
||||
<item
|
||||
android:orderInCategory="800"
|
||||
app:showAsAction=""
|
||||
android:title="@string/go_offline"/> <!-- iRroom -->
|
||||
<!-- <item
|
||||
android:id="@+id/update_feeds"
|
||||
android:icon="@drawable/ic_refresh"
|
||||
app:showAsAction=""
|
||||
android:title="@string/update_feeds"/>
|
||||
android:title="@string/update_feeds"/> -->
|
||||
<item
|
||||
android:orderInCategory="900"
|
||||
android:id="@+id/logout"
|
||||
android:icon="@drawable/ic_logout"
|
||||
app:showAsAction=""
|
||||
android:title="@string/logout"/>
|
||||
</group>
|
||||
<group android:id="@+id/menu_group_headlines" >
|
||||
<item
|
||||
<!-- <item
|
||||
android:id="@+id/update_headlines"
|
||||
android:icon="@drawable/ic_refresh"
|
||||
app:showAsAction=""
|
||||
android:title="@string/update_headlines"/>
|
||||
android:title="@string/update_headlines"/> -->
|
||||
<item
|
||||
android:id="@+id/search"
|
||||
android:icon="@drawable/ic_magnify"
|
||||
@ -114,6 +116,7 @@
|
||||
</group>
|
||||
|
||||
<item
|
||||
android:orderInCategory="999"
|
||||
android:id="@+id/preferences"
|
||||
android:icon="@drawable/ic_settings"
|
||||
app:showAsAction=""
|
||||
|
@ -4,9 +4,9 @@
|
||||
<item
|
||||
android:id="@+id/go_online"
|
||||
android:icon="@drawable/ic_cloud_upload"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
app:showAsAction=""
|
||||
android:title="@string/go_online"
|
||||
android:visible="false"/>
|
||||
android:visible="false"/> <!-- ifRoom|withText -->
|
||||
<item
|
||||
android:id="@+id/show_feeds"
|
||||
android:icon="@drawable/ic_filter_remove"
|
||||
|
@ -35,4 +35,5 @@
|
||||
<attr name="ic_star" format="reference" />
|
||||
<attr name="ic_star_outline" format="reference" />
|
||||
<attr name="ic_share" format="reference" />
|
||||
<attr name="ic_keyboard_backspace" format="reference" />
|
||||
</resources>
|
@ -1,7 +1,7 @@
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<style name="LightTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<item name="windowActionBarOverlay">true</item>
|
||||
<style name="LightTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
|
||||
<item name="statusBarHintColor">?colorPrimary</item>
|
||||
<item name="ttrssHorizontalDivider">@android:drawable/divider_horizontal_bright</item>
|
||||
@ -43,10 +43,11 @@
|
||||
<item name="ic_star">@drawable/ic_star_dark</item>
|
||||
<item name="ic_star_outline">@drawable/ic_star_outline_dark</item>
|
||||
<item name="ic_share">@drawable/ic_share_dark</item>
|
||||
<item name="ic_keyboard_backspace">@drawable/ic_keyboard_backspace_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="DarkTheme" parent="Theme.AppCompat">
|
||||
<item name="windowActionBarOverlay">true</item>
|
||||
<style name="DarkTheme" parent="Theme.AppCompat.NoActionBar">
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
|
||||
<item name="statusBarHintColor">?colorPrimary</item>
|
||||
<item name="unreadCounterColor">#909090</item>
|
||||
@ -88,6 +89,7 @@
|
||||
<item name="ic_star">@drawable/ic_star</item>
|
||||
<item name="ic_star_outline">@drawable/ic_star_outline</item>
|
||||
<item name="ic_share">@drawable/ic_share</item>
|
||||
<item name="ic_keyboard_backspace">@drawable/ic_keyboard_backspace</item>
|
||||
</style>
|
||||
|
||||
<style name="DarkDialogTheme" parent="android:Theme"></style>
|
||||
|