diff options
Diffstat (limited to 'org.fox.ttrss/src/main')
70 files changed, 771 insertions, 594 deletions
diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index 6b1a19b1..34ba343f 100755 --- a/org.fox.ttrss/src/main/AndroidManifest.xml +++ b/org.fox.ttrss/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.fox.ttrss" - android:versionCode="530" - android:versionName="1.296"> + android:versionCode="536" + android:versionName="1.302"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/Application.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/Application.java index dd134e8c..94857855 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/Application.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/Application.java @@ -10,6 +10,9 @@ import org.fox.ttrss.types.ArticleList; import androidx.annotation.NonNull; import androidx.annotation.Nullable; + +import java.util.LinkedHashMap; + import icepick.Icepick; public class Application extends android.app.Application { @@ -21,6 +24,8 @@ public class Application extends android.app.Application { public int m_selectedArticleId; public String m_sessionId; public int m_apiLevel; + public LinkedHashMap<String, String> m_customSortModes = new LinkedHashMap<String, String>(); + public static Application getInstance(){ return m_singleton; } @@ -50,6 +55,7 @@ public class Application extends android.app.Application { out.putString("gs:sessionId", m_sessionId); out.putInt("gs:apiLevel", m_apiLevel); out.putInt("gs:selectedArticleId", m_selectedArticleId); + out.putSerializable("gs:customSortTypes", m_customSortModes); } public void load(Bundle in) { @@ -57,6 +63,12 @@ public class Application extends android.app.Application { m_sessionId = in.getString("gs:sessionId"); m_apiLevel = in.getInt("gs:apiLevel"); m_selectedArticleId = in.getInt("gs:selectedArticleId"); + + try { + m_customSortModes = (LinkedHashMap<String, String>) in.getSerializable("gs:customSortTypes"); + } catch (Exception e) { + e.printStackTrace(); + } } } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java index ed961e38..beff9a1f 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java @@ -2,7 +2,11 @@ package org.fox.ttrss; import android.annotation.SuppressLint; import android.app.Activity; +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; import android.content.SharedPreferences; +import android.content.res.Resources; import android.graphics.Color; import android.net.Uri; import android.os.Build; @@ -23,6 +27,7 @@ import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebView.HitTestResult; import android.webkit.WebViewClient; +import android.widget.EditText; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; @@ -132,9 +137,9 @@ public class ArticleFragment extends StateSavedFragment { getActivity().getMenuInflater().inflate(R.menu.content_gallery_entry, menu); /* FIXME I have no idea how to do this correctly ;( */ - + m_activity.setLastContentImageHitTestUrl(result.getExtra()); - + } else { menu.setHeaderTitle(m_article.title); getActivity().getMenuInflater().inflate(R.menu.context_article_link, menu); @@ -143,7 +148,7 @@ public class ArticleFragment extends StateSavedFragment { menu.setHeaderTitle(m_article.title); getActivity().getMenuInflater().inflate(R.menu.context_article_link, menu); } - + super.onCreateContextMenu(menu, v, menuInfo); } @@ -210,6 +215,70 @@ public class ArticleFragment extends StateSavedFragment { } + final ImageView scoreView = view.findViewById(R.id.score); + + if (scoreView != null) { + setScoreImage(scoreView, m_article.score); + + Resources.Theme theme = m_activity.getTheme(); + TypedValue tv = new TypedValue(); + theme.resolveAttribute(R.attr.headlineTitleHighScoreUnreadTextColor, tv, true); + int titleHighScoreUnreadColor = tv.data; + + if (m_article.score > Article.SCORE_HIGH) + scoreView.setColorFilter(titleHighScoreUnreadColor); + else + scoreView.setColorFilter(null); + + if (m_activity.getApiLevel() >= 16) { + scoreView.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + final EditText edit = new EditText(getActivity()); + edit.setText(String.valueOf(m_article.score)); + + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()) + .setTitle(R.string.score_for_this_article) + .setPositiveButton(R.string.set_score, + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, + int which) { + + try { + int newScore = Integer.parseInt(edit.getText().toString()); + + m_article.score = newScore; + + m_activity.saveArticleScore(m_article); + + setScoreImage(scoreView, newScore); + } catch (NumberFormatException e) { + m_activity.toast(R.string.score_invalid); + e.printStackTrace(); + } + } + }) + .setNegativeButton(getString(R.string.cancel), + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, + int which) { + + // + + } + }).setView(edit); + + Dialog dialog = builder.create(); + dialog.show(); + } + }); + } + } + ImageView attachments = view.findViewById(R.id.attachments); if (attachments != null) { @@ -360,6 +429,20 @@ public class ArticleFragment extends StateSavedFragment { return view; } + private void setScoreImage(ImageView scoreView, int score) { + TypedValue tv = new TypedValue(); + int scoreAttr = R.attr.ic_action_trending_flat; + + if (m_article.score > 0) + scoreAttr = R.attr.ic_action_trending_up; + else if (m_article.score < 0) + scoreAttr = R.attr.ic_action_trending_down; + + m_activity.getTheme().resolveAttribute(scoreAttr, tv, true); + + scoreView.setImageResource(tv.resourceId); + } + protected void renderContent(Bundle savedInstanceState) { if (!isAdded() || m_web == null) return; @@ -420,13 +503,14 @@ public class ArticleFragment extends StateSavedFragment { "<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" + "<meta name=\"viewport\" content=\"width=device-width, user-scalable=no\" />" + "<style type=\"text/css\">" + - "body { padding : 0px; margin : 0px; line-height : 130%; word-wrap: break-word; }" + + "body { padding : 0px; margin : 0px; line-height : 1.3; word-wrap: break-word; }" + + "h1, h2, h3, h4, h5, h6 { line-height: 1; text-align: initial; }" + "img, video, iframe { max-width : 100%; width : auto; height : auto; }" + " table { width : 100%; }" + cssOverride + "</style>" + "</head>" + - "<body>"); + "<body dir='auto'>"); content.append(articleContent); @@ -519,13 +603,13 @@ public class ArticleFragment extends StateSavedFragment { @Override public void onDestroy() { - super.onDestroy(); + super.onDestroy(); } - + @Override public void onAttach(Activity activity) { - super.onAttach(activity); - + super.onAttach(activity); + m_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()); m_activity = (DetailActivity)activity; diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java index e32d5ad1..86feeaed 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java @@ -304,44 +304,41 @@ public class ArticlePager extends StateSavedFragment { req.setOffset(skip); - HashMap<String,String> map = new HashMap<String,String>() { - { - put("op", "getHeadlines"); - put("sid", sessionId); - put("feed_id", String.valueOf(feed.id)); - put("show_excerpt", "true"); - put("excerpt_length", String.valueOf(CommonActivity.EXCERPT_MAX_LENGTH)); - put("show_content", "true"); - put("include_attachments", "true"); - put("limit", m_prefs.getString("headlines_request_size", "15")); - put("offset", String.valueOf(0)); - put("view_mode", m_activity.getViewMode()); - put("skip", String.valueOf(fskip)); - put("include_nested", "true"); - put("has_sandbox", "true"); - put("order_by", m_activity.getSortMode()); - - if (feed.is_cat) put("is_cat", "true"); - - if (m_searchQuery != null && m_searchQuery.length() != 0) { - put("search", m_searchQuery); - put("search_mode", ""); - put("match_on", "both"); - } + HashMap<String,String> map = new HashMap<String, String>(); + map.put("op", "getHeadlines"); + map.put("sid", sessionId); + map.put("feed_id", String.valueOf(feed.id)); + map.put("show_excerpt", "true"); + map.put("excerpt_length", String.valueOf(CommonActivity.EXCERPT_MAX_LENGTH)); + map.put("show_content", "true"); + map.put("include_attachments", "true"); + map.put("limit", m_prefs.getString("headlines_request_size", "15")); + map.put("offset", String.valueOf(0)); + map.put("view_mode", m_activity.getViewMode()); + map.put("skip", String.valueOf(fskip)); + map.put("include_nested", "true"); + map.put("has_sandbox", "true"); + map.put("order_by", m_activity.getSortMode()); + + if (feed.is_cat) map.put("is_cat", "true"); + + if (m_searchQuery != null && m_searchQuery.length() != 0) { + map.put("search", m_searchQuery); + map.put("search_mode", ""); + map.put("match_on", "both"); + } - if (m_firstId > 0) put("check_first_id", String.valueOf(m_firstId)); + if (m_firstId > 0) map.put("check_first_id", String.valueOf(m_firstId)); - if (m_activity.getApiLevel() >= 12) { - put("include_header", "true"); - } + if (m_activity.getApiLevel() >= 12) { + map.put("include_header", "true"); + } - if (m_prefs.getBoolean("enable_image_downsampling", false)) { - if (m_prefs.getBoolean("always_downsample_images", false) || !m_activity.isWifiConnected()) { - put("resize_width", String.valueOf(m_activity.getResizeWidth())); - } - } - } - }; + if (m_prefs.getBoolean("enable_image_downsampling", false)) { + if (m_prefs.getBoolean("always_downsample_images", false) || !m_activity.isWifiConnected()) { + map.put("resize_width", String.valueOf(m_activity.getResizeWidth())); + } + } Log.d(TAG, "[AP] request more headlines, firstId=" + m_firstId); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/DashClock.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/DashClock.java index e062206b..a270a9ed 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/DashClock.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/DashClock.java @@ -75,12 +75,9 @@ public class DashClock extends DashClockExtension { final String fSessionId = sessionId; - HashMap<String, String> umap = new HashMap<String, String>() { - { - put("op", "getUnread"); - put("sid", fSessionId); - } - }; + HashMap<String, String> umap = new HashMap<String, String>(); + umap.put("op", "getUnread"); + umap.put("sid", fSessionId); aru.execute(umap); } 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 a63913a2..0feda5d9 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 @@ -62,16 +62,13 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt final boolean unreadOnly = m_activity.getUnreadOnly(); @SuppressWarnings("serial") - HashMap<String, String> params = new HashMap<String, String>() { - { - put("op", "getCategories"); - put("sid", sessionId); - put("enable_nested", "true"); - if (unreadOnly) { - put("unread_only", String.valueOf(unreadOnly)); - } - } - }; + HashMap<String, String> params = new HashMap<String, String>(); + params.put("op", "getCategories"); + params.put("sid", sessionId); + params.put("enable_nested", "true"); + if (unreadOnly) { + params.put("unread_only", String.valueOf(unreadOnly)); + } return new ApiLoader(getContext(), params); } 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 d73e80d8..d6f373aa 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 @@ -77,17 +77,14 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi final String sessionId = m_activity.getSessionId(); final boolean unreadOnly = m_activity.getUnreadOnly() && (m_activeCategory == null || m_activeCategory.id != -1); - HashMap<String,String> params = new HashMap<String,String>() { - { - put("op", "getFeeds"); - put("sid", sessionId); - put("include_nested", "true"); - put("cat_id", String.valueOf(catId)); - if (unreadOnly) { - put("unread_only", String.valueOf(unreadOnly)); - } - } - }; + HashMap<String,String> params = new HashMap<String,String>(); + params.put("op", "getFeeds"); + params.put("sid", sessionId); + params.put("include_nested", "true"); + params.put("cat_id", String.valueOf(catId)); + if (unreadOnly) { + params.put("unread_only", String.valueOf(unreadOnly)); + } return new FeedsLoader(getActivity().getApplicationContext(), params, catId); } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index b92324da..fb43f7ca 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -43,6 +43,7 @@ import android.view.ViewTreeObserver; import android.view.WindowManager; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.CheckBox; +import android.widget.EditText; import android.widget.ImageView; import android.widget.ListView; import android.widget.PopupMenu; @@ -648,48 +649,45 @@ public class HeadlinesFragment extends StateSavedFragment { req.setOffset(skip); - HashMap<String,String> map = new HashMap<String,String>() { - { - put("op", "getHeadlines"); - put("sid", sessionId); - put("feed_id", String.valueOf(m_feed.id)); - put("show_excerpt", "true"); - put("excerpt_length", String.valueOf(CommonActivity.EXCERPT_MAX_LENGTH)); - put("show_content", "true"); - put("include_attachments", "true"); - put("view_mode", m_activity.getViewMode()); - put("limit", m_prefs.getString("headlines_request_size", "15")); - put("offset", String.valueOf(0)); - put("skip", String.valueOf(fskip)); - put("include_nested", "true"); - put("has_sandbox", "true"); - put("order_by", m_activity.getSortMode()); - - if (m_prefs.getBoolean("enable_image_downsampling", false)) { - if (m_prefs.getBoolean("always_downsample_images", false) || !m_activity.isWifiConnected()) { - put("resize_width", String.valueOf(m_activity.getResizeWidth())); - } - } + HashMap<String,String> map = new HashMap<String,String>(); + map.put("op", "getHeadlines"); + map.put("sid", sessionId); + map.put("feed_id", String.valueOf(m_feed.id)); + map.put("show_excerpt", "true"); + map.put("excerpt_length", String.valueOf(CommonActivity.EXCERPT_MAX_LENGTH)); + map.put("show_content", "true"); + map.put("include_attachments", "true"); + map.put("view_mode", m_activity.getViewMode()); + map.put("limit", m_prefs.getString("headlines_request_size", "15")); + map.put("offset", String.valueOf(0)); + map.put("skip", String.valueOf(fskip)); + map.put("include_nested", "true"); + map.put("has_sandbox", "true"); + map.put("order_by", m_activity.getSortMode()); + + if (m_prefs.getBoolean("enable_image_downsampling", false)) { + if (m_prefs.getBoolean("always_downsample_images", false) || !m_activity.isWifiConnected()) { + map.put("resize_width", String.valueOf(m_activity.getResizeWidth())); + } + } - if (isCat) put("is_cat", "true"); + if (isCat) map.put("is_cat", "true"); - if (allowForceUpdate) { - put("force_update", "true"); - } + if (allowForceUpdate) { + map.put("force_update", "true"); + } - if (m_searchQuery != null && m_searchQuery.length() != 0) { - put("search", m_searchQuery); - put("search_mode", ""); - put("match_on", "both"); - } + if (m_searchQuery != null && m_searchQuery.length() != 0) { + map.put("search", m_searchQuery); + map.put("search_mode", ""); + map.put("match_on", "both"); + } - if (m_firstId > 0) put("check_first_id", String.valueOf(m_firstId)); + if (m_firstId > 0) map.put("check_first_id", String.valueOf(m_firstId)); - if (m_activity.getApiLevel() >= 12) { - put("include_header", "true"); - } - } - }; + if (m_activity.getApiLevel() >= 12) { + map.put("include_header", "true"); + } Log.d(TAG, "[HP] request more headlines, firstId=" + m_firstId); @@ -704,6 +702,7 @@ public class HeadlinesFragment extends StateSavedFragment { public TextView titleView; public TextView feedTitleView; public ImageView markedView; + public ImageView scoreView; public ImageView publishedView; public TextView excerptView; public ImageView flavorImageView; @@ -747,6 +746,7 @@ public class HeadlinesFragment extends StateSavedFragment { feedTitleView = v.findViewById(R.id.feed_title); markedView = v.findViewById(R.id.marked); + scoreView = v.findViewById(R.id.score); publishedView = v.findViewById(R.id.published); excerptView = v.findViewById(R.id.excerpt); flavorImageView = v.findViewById(R.id.flavor_image); @@ -1034,6 +1034,72 @@ public class HeadlinesFragment extends StateSavedFragment { }); } + if (holder.scoreView != null) { + TypedValue tv = new TypedValue(); + int scoreAttr = R.attr.ic_action_trending_flat; + + if (article.score > 0) + scoreAttr = R.attr.ic_action_trending_up; + else if (article.score < 0) + scoreAttr = R.attr.ic_action_trending_down; + + m_activity.getTheme().resolveAttribute(scoreAttr, tv, true); + + holder.scoreView.setImageResource(tv.resourceId); + + if (article.score > Article.SCORE_HIGH) + holder.scoreView.setColorFilter(titleHighScoreUnreadColor); + else + holder.scoreView.setColorFilter(null); + + if (m_activity.getApiLevel() >= 16) { + holder.scoreView.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + final EditText edit = new EditText(getActivity()); + edit.setText(String.valueOf(article.score)); + + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()) + .setTitle(R.string.score_for_this_article) + .setPositiveButton(R.string.set_score, + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, + int which) { + + try { + int newScore = Integer.parseInt(edit.getText().toString()); + + article.score = newScore; + + m_activity.saveArticleScore(article); + + m_adapter.notifyItemChanged(m_list.getChildPosition(holder.view)); + } catch (NumberFormatException e) { + m_activity.toast(R.string.score_invalid); + e.printStackTrace(); + } + } + }) + .setNegativeButton(getString(R.string.cancel), + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, + int which) { + + // + + } + }).setView(edit); + + Dialog dialog = builder.create(); + dialog.show(); + } + }); + } + } if (holder.publishedView != null) { TypedValue tv = new TypedValue(); @@ -1662,9 +1728,9 @@ public class HeadlinesFragment extends StateSavedFragment { // store original color origTitleColors[viewType] = Integer.valueOf(tv.getCurrentTextColor()); - if (score < -500) { + if (score < Article.SCORE_LOW) { tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); - } else if (score > 500) { + } else if (score > Article.SCORE_HIGH) { tv.setTextColor(titleHighScoreUnreadColor); tv.setPaintFlags(tv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); } else { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java index 121b836c..e9404268 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java @@ -26,6 +26,7 @@ import org.fox.ttrss.types.FeedCategory; import java.util.Date; import java.util.HashMap; +import java.util.LinkedHashMap; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.widget.Toolbar; @@ -159,13 +160,10 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList } }); - HashMap<String, String> map = new HashMap<String, String>() { - { - put("op", "login"); - put("user", m_prefs.getString("login", "").trim()); - put("password", m_prefs.getString("password", "").trim()); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("op", "login"); + map.put("user", m_prefs.getString("login", "").trim()); + map.put("password", m_prefs.getString("password", "").trim()); lr.execute(map); } @@ -198,8 +196,6 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList m_feedIsSelected = true; - checkTrial(true); - } else { // savedInstanceState != null if (m_drawerLayout != null && !m_feedIsSelected) { @@ -367,45 +363,43 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList case R.id.headlines_toggle_sort_order: Dialog dialog = new Dialog(this); - String sortMode = getSortMode(); + LinkedHashMap<String, String> sortModes = getSortModes(); - int selectedIndex = 0; + CharSequence[] sortTitles = sortModes.values().toArray(new CharSequence[0]); + final CharSequence[] sortNames = sortModes.keySet().toArray(new CharSequence[0]); - if (sortMode.equals("feed_dates")) { - selectedIndex = 1; - } else if (sortMode.equals("date_reverse")) { - selectedIndex = 2; - } else if (sortMode.equals("title")) { - selectedIndex = 3; - } + String currentMode = getSortMode(); + + int i = 0; + int selectedIndex = 0; + + for (CharSequence tmp : sortNames) { + if (tmp.equals(currentMode)) { + selectedIndex = i; + break; + } + + ++i; + } AlertDialog.Builder builder = new AlertDialog.Builder(this) .setTitle(getString(R.string.headlines_sort_articles_title)) .setSingleChoiceItems( - new String[] { - getString(R.string.headlines_sort_default), - getString(R.string.headlines_sort_newest_first), - getString(R.string.headlines_sort_oldest_first), - getString(R.string.headlines_sort_title) - }, + sortTitles, selectedIndex, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - switch (which) { - case 0: - setSortMode("default"); - break; - case 1: - setSortMode("feed_dates"); - break; - case 2: - setSortMode("date_reverse"); - break; - case 3: - setSortMode("title"); - break; - } + + try { +// Log.d(TAG, "sort selected index:" + which + ": " + sortNames[which]); + + setSortMode((String)sortNames[which]); + + } catch (IndexOutOfBoundsException e) { + e.printStackTrace(); + } + dialog.cancel(); refresh(); @@ -612,13 +606,10 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList }; @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "unsubscribeFeed"); - put("feed_id", String.valueOf(feed.id)); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "unsubscribeFeed"); + map.put("feed_id", String.valueOf(feed.id)); req.execute(map); 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 e8559d3e..8e340f25 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 @@ -1,5 +1,6 @@ package org.fox.ttrss; +import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.AlertDialog; import android.app.Dialog; @@ -31,6 +32,8 @@ import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; +import com.github.javiersantos.appupdater.AppUpdater; +import com.github.javiersantos.appupdater.enums.UpdateFrom; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -48,7 +51,9 @@ import org.fox.ttrss.util.ImageCacheService; import java.lang.reflect.Type; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import androidx.appcompat.view.ActionMode; import androidx.appcompat.widget.Toolbar; @@ -56,8 +61,6 @@ import androidx.appcompat.widget.Toolbar; public class OnlineActivity extends CommonActivity { private final String TAG = this.getClass().getSimpleName(); - private final static int TRIAL_DAYS = 8; - protected SharedPreferences m_prefs; protected Menu m_menu; @@ -255,12 +258,20 @@ public class OnlineActivity extends CommonActivity { if (isOffline) { switchOfflineSuccess(); } else { - checkTrial(false); - + checkUpdates(); + m_headlinesActionModeCallback = new HeadlinesActionModeCallback(); } } + protected void checkUpdates() { + if (BuildConfig.DEBUG || BuildConfig.ENABLE_UPDATER) { + new AppUpdater(this) + .setUpdateFrom(UpdateFrom.JSON) + .setUpdateJSON(String.format("https://srv.tt-rss.org/fdroid/updates/%1$s.json", this.getPackageName())) + .start(); + } + } protected void switchOffline() { AlertDialog.Builder builder = new AlertDialog.Builder(this) @@ -352,18 +363,6 @@ public class OnlineActivity extends CommonActivity { public void login(boolean refresh, OnLoginFinishedListener listener) { - if (BuildConfig.ENABLE_TRIAL && !BuildConfig.DEBUG) { - String testLabSetting = Settings.System.getString(getContentResolver(), "firebase.test.lab"); - - if ("true".equals(testLabSetting)) { - SharedPreferences.Editor editor = m_prefs.edit(); - editor.putString("ttrss_url", "https://srv.tt-rss.org/tt-rss"); - editor.putString("login", "demo"); - editor.putString("password", "demo"); - editor.apply(); - } - } - if (m_prefs.getString("ttrss_url", "").trim().length() == 0) { setLoadingStatus(R.string.login_need_configure); @@ -393,13 +392,10 @@ public class OnlineActivity extends CommonActivity { LoginRequest ar = new LoginRequest(getApplicationContext(), refresh, listener); - HashMap<String, String> map = new HashMap<String, String>() { - { - put("op", "login"); - put("user", m_prefs.getString("login", "").trim()); - put("password", m_prefs.getString("password", "").trim()); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("op", "login"); + map.put("user", m_prefs.getString("login", "").trim()); + map.put("password", m_prefs.getString("password", "").trim()); ar.execute(map); @@ -423,85 +419,7 @@ public class OnlineActivity extends CommonActivity { finish(); } - - public void checkTrial(boolean notify) { - if (BuildConfig.ENABLE_TRIAL && !BuildConfig.DEBUG) { - - boolean isTrial = getPackageManager().checkSignatures( - getPackageName(), "org.fox.ttrss.key") != PackageManager.SIGNATURE_MATCH; - - if (isTrial) { - long firstStart = m_prefs.getLong("date_firstlaunch_trial", -1); - - if (firstStart == -1) { - firstStart = System.currentTimeMillis(); - - SharedPreferences.Editor editor = m_prefs.edit(); - editor.putLong("date_firstlaunch_trial", firstStart); - editor.apply(); - } - - if (!notify && System.currentTimeMillis() > firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000)) { - - AlertDialog.Builder builder = new AlertDialog.Builder(this) - .setTitle(R.string.trial_expired) - .setMessage(R.string.trial_expired_message) - .setCancelable(false) - .setPositiveButton(getString(R.string.trial_purchase), - new OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - - openUnlockUrl(); - finish(); - - } - }) - .setNegativeButton(getString(R.string.cancel), - new OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - - finish(); - - } - }); - - AlertDialog dialog = builder.create(); - dialog.show(); - - } else { - int daysLeft = Math.round((firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000) - System.currentTimeMillis()) / (24 * 60 * 60 * 1000)); - if (notify) { - toast(getResources().getQuantityString(R.plurals.trial_mode_prompt, daysLeft, daysLeft)); - } - } - } else if (notify) { - //toast(R.string.trial_thanks); - } - } - } - - private void openUnlockUrl() { - try { - Intent intent = new Intent(Intent.ACTION_VIEW, - Uri.parse("market://details?id=org.fox.ttrss.key")); - startActivity(intent); - } catch (ActivityNotFoundException ae) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW, - Uri.parse("https://play.google.com/store/apps/details?id=org.fox.ttrss.key")); - startActivity(intent); - } catch (Exception e) { - e.printStackTrace(); - toast(R.string.error_other_error); - } - } - } - @Override public boolean onContextItemSelected(android.view.MenuItem item) { /* AdapterContextMenuInfo info = (AdapterContextMenuInfo) item @@ -626,11 +544,6 @@ public class OnlineActivity extends CommonActivity { } } return true; */ - case R.id.donate: - if (true) { - openUnlockUrl(); - } - return true; /*case R.id.logout: logout(); return true;*/ @@ -1043,15 +956,12 @@ public class OnlineActivity extends CommonActivity { final int labelId = itemIds[which]; @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "setArticleLabel"); - put("label_id", String.valueOf(labelId)); - put("article_ids", String.valueOf(articleId)); - if (isChecked) put("assign", "true"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "setArticleLabel"); + map.put("label_id", String.valueOf(labelId)); + map.put("article_ids", String.valueOf(articleId)); + if (isChecked) map.put("assign", "true"); ApiRequest req = new ApiRequest(OnlineActivity.this); req.execute(map); @@ -1073,13 +983,10 @@ public class OnlineActivity extends CommonActivity { }; @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "getLabels"); - put("article_id", String.valueOf(articleId)); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "getLabels"); + map.put("article_id", String.valueOf(articleId)); req.execute(map); } @@ -1163,25 +1070,14 @@ public class OnlineActivity extends CommonActivity { m_menu = menu; initMenu(); - - List<PackageInfo> pkgs = getPackageManager() - .getInstalledPackages(0); - - for (PackageInfo p : pkgs) { - if ("org.fox.ttrss.key".equals(p.packageName)) { - Log.d(TAG, "license apk found"); - menu.findItem(R.id.donate).setVisible(false); - break; - } - } - + return true; } public int getApiLevel() { return Application.getInstance().m_apiLevel; } - + protected void setApiLevel(int apiLevel) { Application.getInstance().m_apiLevel = apiLevel; } @@ -1195,16 +1091,31 @@ public class OnlineActivity extends CommonActivity { } }; - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "updateArticle"); - put("article_ids", String.valueOf(article.id)); - put("mode", article.unread ? "1" : "0"); - put("field", "2"); + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", String.valueOf(article.id)); + map.put("mode", article.unread ? "1" : "0"); + map.put("field", "2"); + + req.execute(map); + } + + public void saveArticleScore(final Article article) { + ApiRequest req = new ApiRequest(getApplicationContext()) { + protected void onPostExecute(JsonElement result) { + //toast(article.marked ? R.string.notify_article_marked : R.string.notify_article_unmarked); + invalidateOptionsMenu(); } }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", String.valueOf(article.id)); + map.put("data", String.valueOf(article.score)); + map.put("field", "4"); + req.execute(map); } @@ -1216,15 +1127,12 @@ public class OnlineActivity extends CommonActivity { } }; - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "updateArticle"); - put("article_ids", String.valueOf(article.id)); - put("mode", article.marked ? "1" : "0"); - put("field", "0"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", String.valueOf(article.id)); + map.put("mode", article.marked ? "1" : "0"); + map.put("field", "0"); req.execute(map); } @@ -1239,15 +1147,12 @@ public class OnlineActivity extends CommonActivity { } }; - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "updateArticle"); - put("article_ids", String.valueOf(article.id)); - put("mode", article.published ? "1" : "0"); - put("field", "1"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", String.valueOf(article.id)); + map.put("mode", article.published ? "1" : "0"); + map.put("field", "1"); req.execute(map); } @@ -1260,16 +1165,13 @@ public class OnlineActivity extends CommonActivity { } }; - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "updateArticle"); - put("article_ids", String.valueOf(article.id)); - put("mode", "1"); - put("data", note); - put("field", "3"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", String.valueOf(article.id)); + map.put("mode", "1"); + map.put("data", note); + map.put("field", "3"); req.execute(map); } @@ -1291,8 +1193,45 @@ public class OnlineActivity extends CommonActivity { @Override public boolean onKeyDown(int keyCode, KeyEvent event) { + ArticlePager ap = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); + HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); + + switch (keyCode) { + case KeyEvent.KEYCODE_DPAD_LEFT: + if (ap != null && ap.isAdded()) { + ap.selectArticle(false); + return true; + } + break; + case KeyEvent.KEYCODE_DPAD_RIGHT: + if (ap != null && ap.isAdded()) { + ap.selectArticle(true); + return true; + } + break; + case KeyEvent.KEYCODE_ESCAPE: + moveTaskToBack(true); + return true; + case KeyEvent.KEYCODE_O: + if (ap != null && ap.getSelectedArticle() != null) { + openUri(Uri.parse(ap.getSelectedArticle().link)); + return true; + } + break; + case KeyEvent.KEYCODE_R: + refresh(); + return true; + case KeyEvent.KEYCODE_U: + if (ap != null && ap.getSelectedArticle() != null) { + Article a = ap.getSelectedArticle(); + a.unread = !a.unread; + saveArticleUnread(a); + if (hf != null) hf.notifyUpdated(); + } + return true; + } + if (m_prefs.getBoolean("use_volume_keys", false)) { - ArticlePager ap = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); if (ap != null && ap.isAdded()) { switch (keyCode) { @@ -1335,16 +1274,13 @@ public class OnlineActivity extends CommonActivity { }; @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "catchupFeed"); - put("feed_id", String.valueOf(feed.id)); - put("mode", mode); - if (feed.is_cat) - put("is_cat", "1"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "catchupFeed"); + map.put("feed_id", String.valueOf(feed.id)); + map.put("mode", mode); + if (feed.is_cat) + map.put("is_cat", "1"); req.execute(map); } @@ -1353,15 +1289,12 @@ public class OnlineActivity extends CommonActivity { ApiRequest req = new ApiRequest(getApplicationContext()); @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "updateArticle"); - put("article_ids", articlesToIdString(articles)); - put("mode", "2"); - put("field", "0"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", articlesToIdString(articles)); + map.put("mode", "2"); + map.put("field", "0"); req.execute(map); } @@ -1370,15 +1303,12 @@ public class OnlineActivity extends CommonActivity { ApiRequest req = new ApiRequest(getApplicationContext()); @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "updateArticle"); - put("article_ids", articlesToIdString(articles)); - put("mode", "2"); - put("field", "2"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", articlesToIdString(articles)); + map.put("mode", "2"); + map.put("field", "2"); req.execute(map); //refresh(); @@ -1388,15 +1318,12 @@ public class OnlineActivity extends CommonActivity { ApiRequest req = new ApiRequest(getApplicationContext()); @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "updateArticle"); - put("article_ids", articlesToIdString(articles)); - put("mode", "2"); - put("field", "1"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "updateArticle"); + map.put("article_ids", articlesToIdString(articles)); + map.put("mode", "2"); + map.put("field", "1"); req.execute(map); } @@ -1506,6 +1433,7 @@ public class OnlineActivity extends CommonActivity { } @SuppressWarnings("unchecked") + @SuppressLint("StaticFieldLeak") protected void onPostExecute(JsonElement result) { if (result != null) { try { @@ -1521,6 +1449,20 @@ public class OnlineActivity extends CommonActivity { if (apiLevel != null) { setApiLevel(apiLevel.getAsInt()); Log.d(TAG, "Received API level: " + getApiLevel()); + + // get custom sort from configuration object + if (getApiLevel() >= 17) { + + // daemon_is_running, icons_dir, etc... + JsonObject config = content.get("config").getAsJsonObject(); + + Type hashType = new TypeToken<Map<String, String>>(){}.getType(); + Map<String, String> customSortTypes = new Gson().fromJson(config.get("custom_sort_types"), hashType); + + setCustomSortModes(customSortTypes); + + Log.d(TAG, "test"); + } if (m_listener != null) { m_listener.OnLoginSuccess(); @@ -1569,12 +1511,9 @@ public class OnlineActivity extends CommonActivity { }; @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", getSessionId()); - put("op", "getApiLevel"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", getSessionId()); + map.put("op", "getApiLevel"); req.execute(map); @@ -1602,7 +1541,20 @@ public class OnlineActivity extends CommonActivity { } - public String getSortMode() { + public LinkedHashMap<String, String> getSortModes() { + LinkedHashMap<String, String> tmp = new LinkedHashMap<String, String>(); + + tmp.put("default", getString(R.string.headlines_sort_default)); + tmp.put("feed_dates", getString(R.string.headlines_sort_newest_first)); + tmp.put("date_reverse", getString(R.string.headlines_sort_oldest_first)); + tmp.put("title", getString(R.string.headlines_sort_title)); + + tmp.putAll(Application.getInstance().m_customSortModes); + + return tmp; + } + + public String getSortMode() { return m_prefs.getString("headlines_sort_mode", "default"); } @@ -1612,6 +1564,11 @@ public class OnlineActivity extends CommonActivity { editor.apply(); } + private synchronized void setCustomSortModes(Map<String, String> modes) { + Application.getInstance().m_customSortModes.clear(); + Application.getInstance().m_customSortModes.putAll(modes); + } + public void setViewMode(String viewMode) { SharedPreferences.Editor editor = m_prefs.edit(); editor.putString("view_mode", viewMode); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java index 441ec62b..a3b152a7 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -235,6 +235,11 @@ public class OfflineArticleFragment extends Fragment { } + ImageView score = view.findViewById(R.id.score); + + if (score != null) { + score.setVisibility(View.GONE); + } ImageView attachments = view.findViewById(R.id.attachments); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java index 9c8b05db..ec1c353d 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java @@ -266,22 +266,19 @@ public class OfflineDownloadService extends Service { OfflineArticlesRequest req = new OfflineArticlesRequest(this); @SuppressWarnings("serial") - HashMap<String,String> map = new HashMap<String,String>() { - { - put("op", "getHeadlines"); - put("sid", m_sessionId); - put("feed_id", "-4"); - - if (BuildConfig.DEBUG && OFFLINE_DEBUG_READ) { - put("view_mode", "all_articles"); - } else { - put("view_mode", "unread"); - } - put("show_content", "true"); - put("skip", String.valueOf(m_articleOffset)); - put("limit", String.valueOf(OFFLINE_SYNC_SEQ)); - } - }; + HashMap<String,String> map = new HashMap<String,String>(); + map.put("op", "getHeadlines"); + map.put("sid", m_sessionId); + map.put("feed_id", "-4"); + + if (BuildConfig.DEBUG && OFFLINE_DEBUG_READ) { + map.put("view_mode", "all_articles"); + } else { + map.put("view_mode", "unread"); + } + map.put("show_content", "true"); + map.put("skip", String.valueOf(m_articleOffset)); + map.put("limit", String.valueOf(OFFLINE_SYNC_SEQ)); req.execute(map); } @@ -351,17 +348,14 @@ public class OfflineDownloadService extends Service { }; @SuppressWarnings("serial") - HashMap<String,String> map = new HashMap<String,String>() { - { - put("op", "getFeeds"); - put("sid", m_sessionId); - put("cat_id", "-3"); - - if (!BuildConfig.DEBUG && OFFLINE_DEBUG_READ) { - put("unread_only", "true"); - } - } - }; + HashMap<String,String> map = new HashMap<String,String>(); + map.put("op", "getFeeds"); + map.put("sid", m_sessionId); + map.put("cat_id", "-3"); + + if (!BuildConfig.DEBUG && OFFLINE_DEBUG_READ) { + map.put("unread_only", "true"); + } req.execute(map); } @@ -422,17 +416,14 @@ public class OfflineDownloadService extends Service { }; @SuppressWarnings("serial") - HashMap<String,String> map = new HashMap<String,String>() { - { - put("op", "getCategories"); - put("sid", m_sessionId); - //put("cat_id", "-3"); - - if (!BuildConfig.DEBUG && OFFLINE_DEBUG_READ) { - put("unread_only", "true"); - } - } - }; + HashMap<String,String> map = new HashMap<String,String>(); + map.put("op", "getCategories"); + map.put("sid", m_sessionId); + //put("cat_id", "-3"); + + if (!BuildConfig.DEBUG && OFFLINE_DEBUG_READ) { + map.put("unread_only", "true"); + } req.execute(map); } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index 3d9e1229..470b0aac 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -505,6 +505,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis public View flavorImageOverflow; public View headlineHeader; public ImageView attachmentsView; + public ImageView scoreView; public ArticleViewHolder(View v) { @@ -549,6 +550,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis headlineHeader = v.findViewById(R.id.headline_header); flavorImageOverflow = v.findViewById(R.id.gallery_overflow); attachmentsView = v.findViewById(R.id.attachments); + scoreView = v.findViewById(R.id.score); } } @@ -794,6 +796,10 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis holder.attachmentsView.setVisibility(View.GONE); } + if (holder.scoreView != null) { + holder.scoreView.setVisibility(View.GONE); + } + if (holder.markedView != null) { TypedValue tv = new TypedValue(); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineMasterActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineMasterActivity.java index cdaa794e..0a3b6378 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineMasterActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineMasterActivity.java @@ -25,6 +25,8 @@ import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; +import java.util.HashMap; + public class OfflineMasterActivity extends OfflineActivity implements OfflineHeadlinesEventListener { private final String TAG = this.getClass().getSimpleName(); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineUploadService.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineUploadService.java index 8f3b11fa..fb22cafd 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineUploadService.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineUploadService.java @@ -196,36 +196,33 @@ public class OfflineUploadService extends IntentService { }; @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", m_sessionId); - put("op", "updateArticle"); - put("article_ids", android.text.TextUtils.join(",", ids)); - - switch (criteria) { - case READ: - put("mode", "0"); - put("field", "2"); - break; - case PUBLISHED: - put("mode", "1"); - put("field", "1"); - break; - case UNPUBLISHED: - put("mode", "0"); - put("field", "1"); - break; - case MARKED: - put("mode", "1"); - put("field", "0"); - break; - case UNMARKED: - put("mode", "0"); - put("field", "0"); - break; - } - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", m_sessionId); + map.put("op", "updateArticle"); + map.put("article_ids", android.text.TextUtils.join(",", ids)); + + switch (criteria) { + case READ: + map.put("mode", "0"); + map.put("field", "2"); + break; + case PUBLISHED: + map.put("mode", "1"); + map.put("field", "1"); + break; + case UNPUBLISHED: + map.put("mode", "0"); + map.put("field", "1"); + break; + case MARKED: + map.put("mode", "1"); + map.put("field", "0"); + break; + case UNMARKED: + map.put("mode", "0"); + map.put("field", "0"); + break; + } req.execute(map); } else { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/share/ShareActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/share/ShareActivity.java index 46e89b28..3b1da2c9 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/share/ShareActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/share/ShareActivity.java @@ -112,15 +112,12 @@ public class ShareActivity extends CommonShareActivity { final EditText content = (EditText) findViewById(R.id.content); if (url != null && title != null && content != null) { - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", m_sessionId); - put("op", "shareToPublished"); - put("title", title.getText().toString()); - put("url", url.getText().toString()); - put("content", content.getText().toString()); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", m_sessionId); + map.put("op", "shareToPublished"); + map.put("title", title.getText().toString()); + map.put("url", url.getText().toString()); + map.put("content", content.getText().toString()); setProgressBarIndeterminateVisibility(true); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/share/SubscribeActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/share/SubscribeActivity.java index c25784b5..1463958d 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/share/SubscribeActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/share/SubscribeActivity.java @@ -239,17 +239,14 @@ public class SubscribeActivity extends CommonShareActivity { final EditText feedUrl = (EditText) findViewById(R.id.feed_url); if (feedUrl != null ) { - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", m_sessionId); - put("op", "subscribeToFeed"); - put("feed_url", feedUrl.getText().toString()); - - if (cat != null) { - put("category_id", String.valueOf(cat.id)); - } - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", m_sessionId); + map.put("op", "subscribeToFeed"); + map.put("feed_url", feedUrl.getText().toString()); + + if (cat != null) { + map.put("category_id", String.valueOf(cat.id)); + } m_progressBar.setVisibility(View.VISIBLE); @@ -304,12 +301,9 @@ public class SubscribeActivity extends CommonShareActivity { } }; - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", m_sessionId); - put("op", "getCategories"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", m_sessionId); + map.put("op", "getCategories"); m_progressBar.setVisibility(View.VISIBLE); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/types/Article.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/types/Article.java index a11cd0ac..2daaba49 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/types/Article.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/types/Article.java @@ -21,6 +21,9 @@ public class Article implements Parcelable { public static final int FLAVOR_KIND_VIDEO = 2; public static final int FLAVOR_KIND_YOUTUBE = 3; + public static final int SCORE_LOW = -500; + public static final int SCORE_HIGH = 500; + public int id; public boolean unread; public boolean marked; diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java index f07e23c2..24a7a732 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java @@ -132,7 +132,7 @@ public class ImageCacheService extends IntentService { digest.update(s.getBytes()); byte messageDigest[] = digest.digest(); - StringBuffer hexString = new StringBuffer(); + StringBuilder hexString = new StringBuilder(); for (int i=0; i<messageDigest.length; i++) hexString.append(Integer.toHexString(0xFF & messageDigest[i])); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/util/SimpleLoginManager.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/SimpleLoginManager.java index 5f5c5230..7502a95c 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/util/SimpleLoginManager.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/SimpleLoginManager.java @@ -56,12 +56,9 @@ public abstract class SimpleLoginManager { }; @SuppressWarnings("serial") - HashMap<String, String> map = new HashMap<String, String>() { - { - put("sid", m_sessionId); - put("op", "getApiLevel"); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("sid", m_sessionId); + map.put("op", "getApiLevel"); req.execute(map); @@ -83,13 +80,10 @@ public abstract class SimpleLoginManager { public void logIn(Context context, int requestId, final String login, final String password) { LoginRequest ar = new LoginRequest(context, requestId); - HashMap<String, String> map = new HashMap<String, String>() { - { - put("op", "login"); - put("user", login.trim()); - put("password", password.trim()); - } - }; + HashMap<String, String> map = new HashMap<String, String>(); + map.put("op", "login"); + map.put("user", login.trim()); + map.put("password", password.trim()); onLoggingIn(requestId); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/WidgetUpdateService.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/WidgetUpdateService.java index 3af5b068..a38451b0 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/WidgetUpdateService.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/widget/WidgetUpdateService.java @@ -124,13 +124,10 @@ public class WidgetUpdateService extends JobIntentService { final String fSessionId = sessionId; - HashMap<String, String> umap = new HashMap<String, String>() { - { - put("op", "getUnread"); - put("feed_id", String.valueOf(feedId)); - put("sid", fSessionId); - } - }; + HashMap<String, String> umap = new HashMap<String, String>(); + umap.put("op", "getUnread"); + umap.put("feed_id", String.valueOf(feedId)); + umap.put("sid", fSessionId); aru.execute(umap); } diff --git a/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_down.png b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_down.png Binary files differnew file mode 100644 index 00000000..d84624ca --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_down.png diff --git a/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_down_dark.png b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_down_dark.png Binary files differnew file mode 100644 index 00000000..1b4e2ac6 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_down_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_flat.png b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_flat.png Binary files differnew file mode 100644 index 00000000..ec65283b --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_flat.png diff --git a/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_flat_dark.png b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_flat_dark.png Binary files differnew file mode 100644 index 00000000..d877db05 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_flat_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_up.png b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_up.png Binary files differnew file mode 100644 index 00000000..68945759 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_up.png diff --git a/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_up_dark.png b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_up_dark.png Binary files differnew file mode 100644 index 00000000..b3ecbf00 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-hdpi/ic_action_trending_up_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_down.png b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_down.png Binary files differnew file mode 100644 index 00000000..7dcdca0e --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_down.png diff --git a/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_down_dark.png b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_down_dark.png Binary files differnew file mode 100644 index 00000000..37ea9a33 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_down_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_flat.png b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_flat.png Binary files differnew file mode 100644 index 00000000..7b47abd1 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_flat.png diff --git a/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_flat_dark.png b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_flat_dark.png Binary files differnew file mode 100644 index 00000000..d9251d44 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_flat_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_up.png b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_up.png Binary files differnew file mode 100644 index 00000000..fe3218cf --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_up.png diff --git a/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_up_dark.png b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_up_dark.png Binary files differnew file mode 100644 index 00000000..5af3c92e --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-mdpi/ic_action_trending_up_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_down.png b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_down.png Binary files differnew file mode 100644 index 00000000..53ff92a2 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_down.png diff --git a/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_down_dark.png b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_down_dark.png Binary files differnew file mode 100644 index 00000000..0f15737f --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_down_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_flat.png b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_flat.png Binary files differnew file mode 100644 index 00000000..33d96f00 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_flat.png diff --git a/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_flat_dark.png b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_flat_dark.png Binary files differnew file mode 100644 index 00000000..8c1ea784 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_flat_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_up.png b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_up.png Binary files differnew file mode 100644 index 00000000..33b01737 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_up.png diff --git a/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_up_dark.png b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_up_dark.png Binary files differnew file mode 100644 index 00000000..ec479dbf --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xhdpi/ic_action_trending_up_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_down.png b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_down.png Binary files differnew file mode 100644 index 00000000..c2ec115e --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_down.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_down_dark.png b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_down_dark.png Binary files differnew file mode 100644 index 00000000..02183b60 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_down_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_flat.png b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_flat.png Binary files differnew file mode 100644 index 00000000..7b51ffcc --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_flat.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_flat_dark.png b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_flat_dark.png Binary files differnew file mode 100644 index 00000000..f55069c1 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_flat_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_up.png b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_up.png Binary files differnew file mode 100644 index 00000000..dd732d55 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_up.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_up_dark.png b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_up_dark.png Binary files differnew file mode 100644 index 00000000..f8d6b481 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxhdpi/ic_action_trending_up_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_down.png b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_down.png Binary files differnew file mode 100644 index 00000000..ef0c2a10 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_down.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_down_dark.png b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_down_dark.png Binary files differnew file mode 100644 index 00000000..7dd24dcd --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_down_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_flat.png b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_flat.png Binary files differnew file mode 100644 index 00000000..26cffdf5 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_flat.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_flat_dark.png b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_flat_dark.png Binary files differnew file mode 100644 index 00000000..bd78a122 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_flat_dark.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_up.png b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_up.png Binary files differnew file mode 100644 index 00000000..0d020b1f --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_up.png diff --git a/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_up_dark.png b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_up_dark.png Binary files differnew file mode 100644 index 00000000..7a750aa4 --- /dev/null +++ b/org.fox.ttrss/src/main/res/drawable-xxxhdpi/ic_action_trending_up_dark.png diff --git a/org.fox.ttrss/src/main/res/layout/activity_subscribe.xml b/org.fox.ttrss/src/main/res/layout/activity_subscribe.xml index 8027faf4..11a5c334 100644 --- a/org.fox.ttrss/src/main/res/layout/activity_subscribe.xml +++ b/org.fox.ttrss/src/main/res/layout/activity_subscribe.xml @@ -59,7 +59,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.5" - android:text="Update categories" /> + android:text="@string/update_categories" /> <Button style="?android:attr/buttonBarButtonStyle" diff --git a/org.fox.ttrss/src/main/res/layout/drawer_header.xml b/org.fox.ttrss/src/main/res/layout/drawer_header.xml index d39cdad0..6779a950 100755 --- a/org.fox.ttrss/src/main/res/layout/drawer_header.xml +++ b/org.fox.ttrss/src/main/res/layout/drawer_header.xml @@ -2,6 +2,7 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="120dp" + xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:weightSum="1" android:clickable="false"> @@ -24,10 +25,10 @@ android:layout_height="wrap_content" android:src="@drawable/ic_settings" android:id="@+id/drawer_settings_btn" - android:layout_gravity="bottom|right" + android:layout_gravity="bottom|end" android:clickable="true" android:layout_marginBottom="16dp" - android:layout_marginRight="12dp" + android:layout_marginEnd="12dp" android:transitionName="SETTINGS_REVEAL" android:background="@drawable/ripple" /> @@ -45,9 +46,9 @@ android:id="@+id/drawer_header_login" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="16dp" + android:layout_marginStart="16dp" android:textColor="@android:color/primary_text_dark" - android:text="test" + tools:text="test" android:textSize="14sp" android:textStyle="bold" @@ -58,9 +59,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/primary_text_dark" - android:layout_marginLeft="16dp" + android:layout_marginStart="16dp" android:layout_marginTop="5dp" - android:text="example.org" + tools:text="example.org" android:textSize="14sp" android:textStyle="normal" diff --git a/org.fox.ttrss/src/main/res/layout/feeds_goback.xml b/org.fox.ttrss/src/main/res/layout/feeds_goback.xml index c54955de..bb263237 100755 --- a/org.fox.ttrss/src/main/res/layout/feeds_goback.xml +++ b/org.fox.ttrss/src/main/res/layout/feeds_goback.xml @@ -29,7 +29,7 @@ android:gravity="center_vertical" android:layout_weight="1" android:ellipsize="end" - android:paddingLeft="35dp" + android:paddingStart="35dp" android:singleLine="true" android:text=".." android:paddingBottom="2dp" diff --git a/org.fox.ttrss/src/main/res/layout/feeds_row.xml b/org.fox.ttrss/src/main/res/layout/feeds_row.xml index 64491f2c..7a10bc23 100755 --- a/org.fox.ttrss/src/main/res/layout/feeds_row.xml +++ b/org.fox.ttrss/src/main/res/layout/feeds_row.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:id="@+id/feeds_row" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -28,10 +29,12 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:layout_weight="1" - android:ellipsize="end" - android:paddingLeft="35dp" + android:ellipsize="middle" + android:paddingStart="35dp" + android:paddingEnd="16dp" android:singleLine="true" - android:text="Feed" + tools:text="Feed title" + android:textAlignment="viewStart" android:paddingBottom="2dp" android:textColor="?feedlistTextColor" android:textSize="14sp" /> @@ -42,9 +45,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" + android:textAlignment="viewEnd" android:singleLine="true" - android:text="3200" - android:layout_marginLeft="16dp" + tools:text="3200" android:textColor="?unreadCounterColor" android:textSize="14sp" /> diff --git a/org.fox.ttrss/src/main/res/layout/feeds_row_selected.xml b/org.fox.ttrss/src/main/res/layout/feeds_row_selected.xml index 9e14e56e..d5b6cb3c 100755 --- a/org.fox.ttrss/src/main/res/layout/feeds_row_selected.xml +++ b/org.fox.ttrss/src/main/res/layout/feeds_row_selected.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:id="@+id/feeds_row" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -30,10 +31,12 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:layout_weight="1" - android:ellipsize="end" - android:paddingLeft="35dp" + android:ellipsize="middle" + android:paddingStart="35dp" + android:paddingEnd="16dp" android:singleLine="true" - android:text="Feed" + tools:text="Feed title" + android:textAlignment="viewStart" android:paddingBottom="2dp" android:textColor="?feedlistSelectedTextColor" android:textSize="14sp" /> @@ -44,9 +47,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" + android:textAlignment="viewEnd" android:singleLine="true" - android:text="3200" - android:layout_marginLeft="16dp" + tools:text="3200" android:textColor="?unreadCounterColor" android:textSize="14sp" /> diff --git a/org.fox.ttrss/src/main/res/layout/feeds_row_toggle.xml b/org.fox.ttrss/src/main/res/layout/feeds_row_toggle.xml index 86875240..f9f377f6 100755 --- a/org.fox.ttrss/src/main/res/layout/feeds_row_toggle.xml +++ b/org.fox.ttrss/src/main/res/layout/feeds_row_toggle.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:id="@+id/feeds_row" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -29,9 +30,11 @@ android:gravity="center_vertical" android:layout_weight="1" android:ellipsize="end" - android:paddingLeft="35dp" + android:paddingStart="35dp" + android:paddingEnd="16dp" android:singleLine="true" - android:text="Feed" + tools:text="Unread only" + android:textAlignment="viewStart" android:paddingBottom="2dp" android:textColor="?feedlistTextColor" android:textSize="14sp" /> @@ -40,7 +43,6 @@ android:id="@+id/row_switch" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_weight="0" - android:layout_marginLeft="16dp" /> + android:layout_weight="0"/> </LinearLayout>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout/fragment_article.xml b/org.fox.ttrss/src/main/res/layout/fragment_article.xml index 0dd14149..013b898c 100755 --- a/org.fox.ttrss/src/main/res/layout/fragment_article.xml +++ b/org.fox.ttrss/src/main/res/layout/fragment_article.xml @@ -1,5 +1,6 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:id="@+id/article_fragment" android:layout_width="fill_parent" android:layout_height="match_parent" @@ -42,8 +43,24 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" + android:layout_marginEnd="8dp" + android:textAlignment="viewStart" + tools:text="Unreasonably long article title blah blah blah blah blah blah" android:textColor="?articleHeaderTextColor" - android:textSize="18sp" /> + android:textSize="18sp" + android:layout_marginRight="8dp" + android:gravity="start" /> + + <ImageView + android:id="@+id/score" + android:layout_width="wrap_content" + android:layout_height="24dp" + android:layout_weight="0" + android:background="@drawable/ripple" + android:clickable="true" + android:layout_marginLeft="8dp" + android:src="?ic_action_trending_flat" + android:layout_gravity="center_vertical|end" /> <ImageView android:id="@+id/attachments" @@ -54,7 +71,7 @@ android:layout_marginLeft="8dp" android:clickable="true" android:src="?ic_attachment_vert" - android:layout_gravity="center_vertical|right" /> + android:layout_gravity="center_vertical|end" /> <ImageView android:id="@+id/share" @@ -62,17 +79,18 @@ android:layout_width="wrap_content" android:layout_height="24dp" android:layout_weight="0" - android:layout_marginLeft="8dp" android:clickable="true" android:src="?ic_share" - android:layout_gravity="center_vertical|right" /> + android:layout_gravity="center_vertical|end" /> </LinearLayout> <TextView android:id="@+id/comments" + tools:text="comments" android:background="@drawable/ripple" android:layout_width="match_parent" android:layout_height="wrap_content" + android:textAlignment="viewStart" android:layout_weight="1" android:fontFamily="sans-serif-light" android:paddingTop="8dp" @@ -87,10 +105,12 @@ <TextView android:id="@+id/tags" - android:layout_width="wrap_content" + tools:text="alpha, beta, gamma" + android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" + android:layout_weight="0.7" android:ellipsize="middle" + android:textAlignment="viewStart" android:singleLine="true" android:fontFamily="sans-serif-light" android:textColor="?headlineSecondaryTextColor" @@ -98,11 +118,12 @@ <TextView android:id="@+id/date" - android:layout_width="wrap_content" + tools:text="Jan 01, 1970" + android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="0" - android:gravity="right" - android:layout_marginLeft="10dp" + android:layout_weight="0.3" + android:gravity="" + android:textAlignment="viewEnd" android:fontFamily="sans-serif-light" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?headlineSecondaryTextColor" @@ -135,6 +156,7 @@ <TextView android:id="@+id/note" + tools:text="Article note (if any...)" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row.xml b/org.fox.ttrss/src/main/res/layout/headlines_row.xml index 97684a94..2e997e2c 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row.xml @@ -3,8 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/headlines_row" android:layout_width="wrap_content" - android:layout_height="wrap_content" - tools:ignore="HardcodedText"> + android:layout_height="wrap_content"> <TableLayout android:layout_width="fill_parent" @@ -83,19 +82,19 @@ <TextView android:id="@+id/title" - android:background="@drawable/ripple" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_span="2" + android:background="@drawable/ripple" + android:ellipsize="end" + android:textAlignment="viewStart" android:gravity="center_vertical" + android:maxLines="3" android:paddingBottom="8dp" android:singleLine="false" - android:text="Sample entry title" android:textColor="?headlineExcerptTextColor" android:textSize="18sp" android:textStyle="normal" - android:maxLines="3" - android:ellipsize="end" /> + tools:text="Sample entry title" /> <LinearLayout android:layout_width="match_parent" @@ -109,11 +108,12 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.5" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" + android:textAlignment="viewStart" android:singleLine="true" - android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + tools:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -124,9 +124,10 @@ android:layout_weight="0.5" android:ellipsize="none" android:fontFamily="sans-serif-light" - android:gravity="right|center_vertical" + android:gravity="center_vertical" + android:textAlignment="viewEnd" android:singleLine="true" - android:text="Jan 01, 12:00, 1970" + tools:text="Jan 01, 12:00, 1970" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -140,7 +141,7 @@ android:id="@+id/flavor_video_kind" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left|bottom" + android:layout_gravity="start|bottom" android:scaleType="fitXY" android:src="@drawable/ic_play_circle" android:visibility="visible" @@ -150,7 +151,7 @@ android:elevation="4dp" android:tint="?colorAccent" android:layout_marginBottom="8dp" - android:layout_marginLeft="8dp" /> + android:layout_marginStart="8dp" /> <ImageView android:id="@+id/gallery_overflow" @@ -162,10 +163,11 @@ android:paddingLeft="4dp" android:paddingRight="4dp" android:src="@drawable/ic_dots_vertical_circle" - android:layout_gravity="bottom|right" + android:layout_gravity="bottom|end" android:elevation="4dp" android:tint="?colorAccent" - android:layout_marginBottom="10dp" /> + android:layout_marginBottom="10dp" + tools:targetApi="lollipop" /> </FrameLayout> </TableRow> @@ -180,10 +182,11 @@ android:layout_height="match_parent" android:layout_span="2" android:ellipsize="end" + android:textAlignment="viewStart" android:lineSpacingExtra="2sp" android:maxLines="5" android:padding="16dp" - android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + tools:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineExcerptTextColor" android:textSize="13sp" /> </TableRow> @@ -213,16 +216,28 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="by Author" + tools:text="by Author" + android:textAlignment="viewStart" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" android:textStyle="italic" /> <ImageView + android:id="@+id/score" + android:layout_width="wrap_content" + android:layout_height="24dp" + android:layout_weight="0" + android:background="@drawable/ripple" + android:clickable="true" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:src="?ic_action_trending_flat" /> + + <ImageView android:id="@+id/attachments" android:layout_width="wrap_content" android:layout_height="24dp" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml index 30f86ff0..d139313e 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml @@ -13,7 +13,8 @@ android:layout_marginRight="16dp" android:layout_gravity="center_vertical|left" android:layout_width="wrap_content" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_marginEnd="16dp"> <ImageView android:clickable="true" @@ -43,9 +44,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" + android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" - android:text="Sample entry title" + tools:text="Sample entry title" android:textColor="?headlineExcerptTextColor" android:textSize="18sp" android:layout_span="2" /> @@ -53,10 +55,11 @@ <TextView android:id="@+id/excerpt" android:maxLines="2" + android:textAlignment="viewStart" android:ellipsize="end" android:layout_width="match_parent" android:layout_height="match_parent" - android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + tools:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineExcerptTextColor" android:textSize="13sp" android:layout_span="2" @@ -71,11 +74,12 @@ android:id="@+id/feed_title" android:layout_width="0dp" android:layout_height="wrap_content" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + tools:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + android:textAlignment="viewStart" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" android:layout_weight="0.5" @@ -100,7 +104,7 @@ android:singleLine="true" android:ellipsize="none" android:layout_weight="1" - android:text="Jan 01" + tools:text="Jan 01" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -110,7 +114,7 @@ android:id="@+id/marked" android:background="@drawable/ripple" android:layout_width="24dp" - android:layout_gravity="bottom|right" + android:layout_gravity="bottom|end" android:layout_height="24dp" android:layout_weight="0" android:clickable="true" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_selected_compact.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_selected_compact.xml index 0f0805aa..2e449dbb 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_selected_compact.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_selected_compact.xml @@ -12,9 +12,10 @@ <FrameLayout android:layout_marginRight="16dp" - android:layout_gravity="center_vertical|left" + android:layout_gravity="center_vertical|start" android:layout_width="wrap_content" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_marginEnd="16dp"> <ImageView android:clickable="true" @@ -44,9 +45,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" + android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" - android:text="Sample entry title" + tools:text="Sample entry title" android:textColor="?headlineSelectedTextColor" android:textSize="18sp" android:layout_span="2" /> @@ -54,10 +56,11 @@ <TextView android:id="@+id/excerpt" android:maxLines="2" + android:textAlignment="viewStart" android:ellipsize="end" android:layout_width="match_parent" android:layout_height="match_parent" - android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + tools:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineSelectedExcerptTextColor" android:textSize="13sp" android:layout_span="2" @@ -72,11 +75,12 @@ android:id="@+id/feed_title" android:layout_width="0dp" android:layout_height="wrap_content" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + tools:text="Example Feed" + android:textAlignment="viewStart" android:textColor="?headlineSelectedSecondaryTextColor" android:textSize="12sp" android:layout_weight="0.5" @@ -101,18 +105,18 @@ android:singleLine="true" android:ellipsize="none" android:layout_weight="1" - android:text="Jan 01" + tools:text="Jan 01" android:textColor="?headlineSelectedSecondaryTextColor" android:textSize="12sp" /> <ImageView + android:id="@+id/marked" android:tint="?headlineFooterColor" android:background="@drawable/ripple" - android:id="@+id/marked" android:layout_width="24dp" - android:layout_gravity="bottom|right" + android:layout_gravity="bottom|end" android:layout_height="24dp" android:layout_weight="0" android:clickable="true" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread_compact.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread_compact.xml index 070a22e0..024eb7cf 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread_compact.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread_compact.xml @@ -12,9 +12,10 @@ <FrameLayout android:layout_marginRight="8dp" - android:layout_gravity="center_vertical|left" + android:layout_gravity="center_vertical|start" android:layout_width="wrap_content" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_marginEnd="8dp"> <ImageView android:clickable="true" @@ -42,9 +43,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" + android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" - android:text="Sample entry title" + tools:text="Sample entry title" android:textColor="?headlineSelectedTextColor" android:textStyle="bold" android:textSize="18sp" @@ -53,10 +55,11 @@ <TextView android:id="@+id/excerpt" android:maxLines="2" + android:textAlignment="viewStart" android:ellipsize="end" android:layout_width="match_parent" android:layout_height="match_parent" - android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + tools:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineSelectedExcerptTextColor" android:textSize="13sp" android:layout_span="2" @@ -71,11 +74,12 @@ android:id="@+id/feed_title" android:layout_width="0dp" android:layout_height="wrap_content" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + tools:text="Example Feed" + android:textAlignment="viewStart" android:textColor="?headlineSelectedSecondaryTextColor" android:textSize="12sp" android:layout_weight="0.5" @@ -100,7 +104,7 @@ android:singleLine="true" android:ellipsize="none" android:layout_weight="1" - android:text="Jan 01" + tools:text="Jan 01" android:textColor="?headlineSelectedSecondaryTextColor" android:textSize="12sp" /> @@ -111,7 +115,7 @@ android:background="@drawable/ripple" android:tint="?headlineFooterColor" android:layout_width="24dp" - android:layout_gravity="bottom|right" + android:layout_gravity="bottom|end" android:layout_height="24dp" android:layout_weight="0" android:clickable="true" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml index d44e016a..ba70bb89 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml @@ -4,8 +4,7 @@ android:id="@+id/headlines_row" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="?headlineUnreadBackground" - tools:ignore="HardcodedText"> + android:background="?headlineUnreadBackground"> <TableLayout android:layout_width="fill_parent" @@ -14,7 +13,6 @@ android:shrinkColumns="0,1" android:stretchColumns="0,1"> - <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> @@ -84,19 +82,20 @@ <TextView android:id="@+id/title" - android:background="@drawable/ripple" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_span="2" + android:background="@drawable/ripple" + android:ellipsize="end" android:gravity="center_vertical" + android:maxLines="3" android:paddingBottom="8dp" android:singleLine="false" - android:text="Sample entry title" + android:textAlignment="viewStart" android:textColor="?headlineUnreadTextColor" android:textSize="18sp" android:textStyle="bold" - android:ellipsize="end" - android:maxLines="3" /> + tools:text="Sample entry title" /> <LinearLayout android:layout_width="match_parent" @@ -110,11 +109,12 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.5" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" + android:textAlignment="viewStart" android:singleLine="true" - android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + tools:text="Example Feed" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -125,9 +125,10 @@ android:layout_weight="0.5" android:ellipsize="none" android:fontFamily="sans-serif-light" - android:gravity="right|center_vertical" + android:gravity="center_vertical" + android:textAlignment="viewEnd" android:singleLine="true" - android:text="Jan 01, 12:00, 1970" + tools:text="Jan 01, 12:00, 1970" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -141,7 +142,7 @@ android:id="@+id/flavor_video_kind" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="bottom|left" + android:layout_gravity="bottom|start" android:scaleType="fitXY" android:src="@drawable/ic_play_circle" android:visibility="visible" @@ -149,7 +150,7 @@ android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:tint="?colorAccent" - android:layout_marginLeft="8dp" + android:layout_marginStart="8dp" android:layout_marginBottom="8dp" /> <ImageView @@ -162,9 +163,11 @@ android:paddingLeft="4dp" android:paddingRight="4dp" android:src="@drawable/ic_dots_vertical_circle" - android:layout_gravity="bottom|right" + android:layout_gravity="bottom|end" + android:elevation="4dp" android:tint="?colorAccent" - android:layout_marginBottom="10dp" /> + android:layout_marginBottom="10dp" + tools:targetApi="lollipop" /> </FrameLayout> </TableRow> @@ -179,10 +182,11 @@ android:layout_height="match_parent" android:layout_span="2" android:ellipsize="end" + android:textAlignment="viewStart" android:lineSpacingExtra="2sp" android:maxLines="5" android:padding="16dp" - android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + tools:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineExcerptTextColor" android:textSize="13sp" /> </TableRow> @@ -212,16 +216,28 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="by Author" + tools:text="by Author" + android:textAlignment="viewStart" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" android:textStyle="italic" /> <ImageView + android:id="@+id/score" + android:layout_width="wrap_content" + android:layout_height="24dp" + android:layout_weight="0" + android:background="@drawable/ripple" + android:clickable="true" + android:paddingLeft="4dp" + android:paddingRight="4dp" + android:src="?ic_action_trending_flat" /> + + <ImageView android:id="@+id/attachments" android:layout_width="wrap_content" android:layout_height="24dp" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_unread_compact.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_unread_compact.xml index 08eacd31..e440188f 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_unread_compact.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_unread_compact.xml @@ -12,9 +12,10 @@ <FrameLayout android:layout_marginRight="16dp" - android:layout_gravity="center_vertical|left" + android:layout_gravity="center_vertical|start" android:layout_width="wrap_content" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:layout_marginEnd="16dp"> <ImageView android:clickable="true" @@ -44,9 +45,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" + android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" - android:text="Sample entry title" + tools:text="Sample entry title" android:textColor="?headlineUnreadTextColor" android:textStyle="bold" android:textSize="18sp" @@ -55,10 +57,11 @@ <TextView android:id="@+id/excerpt" android:maxLines="2" + android:textAlignment="viewStart" android:ellipsize="end" android:layout_width="match_parent" android:layout_height="match_parent" - android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + tools:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:textColor="?headlineExcerptTextColor" android:textSize="13sp" android:layout_span="2" @@ -73,11 +76,12 @@ android:id="@+id/feed_title" android:layout_width="0dp" android:layout_height="wrap_content" - android:ellipsize="end" + android:ellipsize="middle" android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + tools:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" + android:textAlignment="viewStart" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" android:layout_weight="0.5" @@ -102,7 +106,7 @@ android:singleLine="true" android:ellipsize="none" android:layout_weight="1" - android:text="Jan 01" + tools:text="Jan 01" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -112,7 +116,7 @@ android:id="@+id/marked" android:background="@drawable/ripple" android:layout_width="24dp" - android:layout_gravity="bottom|right" + android:layout_gravity="bottom|end" android:layout_height="24dp" android:layout_weight="0" android:clickable="true" diff --git a/org.fox.ttrss/src/main/res/menu/activity_main.xml b/org.fox.ttrss/src/main/res/menu/activity_main.xml index 7c5c9465..df66fe75 100755 --- a/org.fox.ttrss/src/main/res/menu/activity_main.xml +++ b/org.fox.ttrss/src/main/res/menu/activity_main.xml @@ -77,12 +77,6 @@ </group> - <item - android:id="@+id/donate" - android:orderInCategory="899" - app:showAsAction="" - android:title="@string/trial_purchase"/> - <!-- <item android:orderInCategory="999" android:id="@+id/preferences" diff --git a/org.fox.ttrss/src/main/res/values-ja/strings.xml b/org.fox.ttrss/src/main/res/values-ja/strings.xml index 423ff592..ce0d508f 100755 --- a/org.fox.ttrss/src/main/res/values-ja/strings.xml +++ b/org.fox.ttrss/src/main/res/values-ja/strings.xml @@ -133,7 +133,7 @@ <string name="trial_expired_message">Tiny Tiny RSSを継続して使用する場合はTiny Tiny RSS Unlockerを購入してください。</string> <string name="theme_sepia">セピア</string> <string name="theme_amber">アンバー</string> - <string name="reading">Reading</string> + <string name="reading">読む</string> <string name="offline_articles_to_download">ダウンロードする記事数</string> <string name="offline_articles_to_download_long">オフラインモードにする際にダウンロードする記事数(新しい記事から)</string> <string name="pref_headlines_show_content_long">記事内容をヘッドライン一覧に表示する</string> @@ -202,6 +202,10 @@ <string name="headlines_sort_articles_title">記事の並び替え</string> <string name="fresh_articles">新着記事</string> <string name="feed_all_articles">全ての記事</string> + <string name="feed_starred_articles">スター付きの記事</string> + <string name="feed_published_articles">配信した記事</string> + <string name="feed_archived_articles">アーカイブした記事</string> + <string name="feed_recently_read">最近読んだ</string> <string name="prefs_enable_fab">FABを有効にする</string> <string name="prefs_enable_fab_long">フローティングアクションボタンを表示する</string> <string name="prefs_open_fresh_on_startup">起動時に新着記事を表示する</string> @@ -218,4 +222,8 @@ <string name="prefs_widget_show_fresh">新着記事数を表示</string> <string name="prefs_widget_show_fresh_summary">全未読記事数の代わりに新着記事数を表示する</string> <string name="prefs_widget">ウィジェット</string> + <string name="prefs_network_settings">その他の設定…</string> + <string name="prefs_opening_links">リンクを開く</string> + <string name="open_with">で開く…</string> + <string name="headlines">ヘッドライン</string> </resources> diff --git a/org.fox.ttrss/src/main/res/values-night/style.xml b/org.fox.ttrss/src/main/res/values-night/style.xml index e9b143df..3c15a0fd 100644 --- a/org.fox.ttrss/src/main/res/values-night/style.xml +++ b/org.fox.ttrss/src/main/res/values-night/style.xml @@ -57,6 +57,9 @@ <item name="ic_dots_vertical_circle">@drawable/ic_dots_vertical_circle</item> <item name="ic_attachment">@drawable/ic_attachment</item> <item name="ic_attachment_vert">@drawable/ic_attachment_vert</item> + <item name="ic_action_trending_up">@drawable/ic_action_trending_up</item> + <item name="ic_action_trending_flat">@drawable/ic_action_trending_flat</item> + <item name="ic_action_trending_down">@drawable/ic_action_trending_down</item> <item name="drawer_header">@drawable/drawer_header_dark</item> </style> diff --git a/org.fox.ttrss/src/main/res/values/attrs.xml b/org.fox.ttrss/src/main/res/values/attrs.xml index cc0f84b6..93892545 100755 --- a/org.fox.ttrss/src/main/res/values/attrs.xml +++ b/org.fox.ttrss/src/main/res/values/attrs.xml @@ -53,4 +53,7 @@ <attr name="drawer_header" format="reference" /> <attr name="ic_restore" format="reference" /> <attr name="ic_inbox" format="reference" /> + <attr name="ic_action_trending_up" format="reference" /> + <attr name="ic_action_trending_flat" format="reference" /> + <attr name="ic_action_trending_down" format="reference" /> </resources>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/values/strings.xml b/org.fox.ttrss/src/main/res/values/strings.xml index ef0013ea..f4d0119c 100755 --- a/org.fox.ttrss/src/main/res/values/strings.xml +++ b/org.fox.ttrss/src/main/res/values/strings.xml @@ -293,4 +293,8 @@ <string name="img_share_url">Share URL</string> <string name="img_share_image">Share image</string> <string name="img_share_failed_to_load">Failed to load image for sharing</string> + <string name="update_categories">Update categories</string> + <string name="score_for_this_article">Score for this article</string> + <string name="set_score">Set score</string> + <string name="score_invalid">Invalid score</string> </resources> diff --git a/org.fox.ttrss/src/main/res/values/style.xml b/org.fox.ttrss/src/main/res/values/style.xml index ecc13527..033a9492 100755 --- a/org.fox.ttrss/src/main/res/values/style.xml +++ b/org.fox.ttrss/src/main/res/values/style.xml @@ -63,6 +63,9 @@ <item name="ic_dots_vertical_circle">@drawable/ic_dots_vertical_circle_dark</item> <item name="ic_attachment">@drawable/ic_attachment_dark</item> <item name="ic_attachment_vert">@drawable/ic_attachment_vert_dark</item> + <item name="ic_action_trending_up">@drawable/ic_action_trending_up_dark</item> + <item name="ic_action_trending_flat">@drawable/ic_action_trending_flat_dark</item> + <item name="ic_action_trending_down">@drawable/ic_action_trending_down_dark</item> <item name="drawer_header">@drawable/drawer_header</item> </style> |