diff options
Diffstat (limited to 'org.fox.ttrss/src/main')
63 files changed, 652 insertions, 398 deletions
diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index 6b1a19b1..18f56e7a 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="534" + android:versionName="1.300"> <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..d75a4e5a 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; @@ -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; 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..c29e2239 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); } @@ -367,45 +365,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 +608,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..2da97902 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; @@ -256,11 +261,20 @@ public class OnlineActivity extends CommonActivity { 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) @@ -393,13 +407,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); @@ -1043,15 +1054,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 +1081,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); } @@ -1164,24 +1169,28 @@ public class OnlineActivity extends CommonActivity { 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; + if (BuildConfig.ENABLE_TRIAL && !BuildConfig.DEBUG) { + 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; + } } + } else { + menu.findItem(R.id.donate).setVisible(false); } - + return true; } public int getApiLevel() { return Application.getInstance().m_apiLevel; } - + protected void setApiLevel(int apiLevel) { Application.getInstance().m_apiLevel = apiLevel; } @@ -1195,16 +1204,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 +1240,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 +1260,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 +1278,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 +1306,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 +1387,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 +1402,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 +1416,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 +1431,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 +1546,7 @@ public class OnlineActivity extends CommonActivity { } @SuppressWarnings("unchecked") + @SuppressLint("StaticFieldLeak") protected void onPostExecute(JsonElement result) { if (result != null) { try { @@ -1521,6 +1562,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 +1624,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 +1654,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 +1677,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..dd72e68c 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"> @@ -47,7 +48,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:textColor="@android:color/primary_text_dark" - android:text="test" + tools:text="test" android:textSize="14sp" android:textStyle="bold" @@ -60,7 +61,7 @@ android:textColor="@android:color/primary_text_dark" android:layout_marginLeft="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_row_selected.xml b/org.fox.ttrss/src/main/res/layout/feeds_row_selected.xml index 9e14e56e..a6aa2599 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" @@ -33,7 +34,7 @@ android:ellipsize="end" android:paddingLeft="35dp" android:singleLine="true" - android:text="Feed" + tools:text="Feed" android:paddingBottom="2dp" android:textColor="?feedlistSelectedTextColor" android:textSize="14sp" /> @@ -45,7 +46,7 @@ android:layout_height="wrap_content" android:layout_weight="0" android:singleLine="true" - android:text="3200" + tools:text="3200" android:layout_marginLeft="16dp" 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..32ef6756 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" @@ -31,7 +32,7 @@ android:ellipsize="end" android:paddingLeft="35dp" android:singleLine="true" - android:text="Feed" + tools:text="Feed" android:paddingBottom="2dp" android:textColor="?feedlistTextColor" android:textSize="14sp" /> 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..eb2511d9 100755 --- a/org.fox.ttrss/src/main/res/layout/fragment_article.xml +++ b/org.fox.ttrss/src/main/res/layout/fragment_article.xml @@ -46,6 +46,17 @@ android:textSize="18sp" /> <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|right" /> + + <ImageView android:id="@+id/attachments" android:background="@drawable/ripple" android:layout_width="wrap_content" 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..41f4ee81 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" @@ -86,11 +85,10 @@ android:background="@drawable/ripple" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_span="2" android:gravity="center_vertical" android:paddingBottom="8dp" android:singleLine="false" - android:text="Sample entry title" + tools:text="Sample entry title" android:textColor="?headlineExcerptTextColor" android:textSize="18sp" android:textStyle="normal" @@ -113,7 +111,7 @@ 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:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -126,7 +124,7 @@ android:fontFamily="sans-serif-light" android:gravity="right|center_vertical" android:singleLine="true" - android:text="Jan 01, 12:00, 1970" + tools:text="Jan 01, 12:00, 1970" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -165,7 +163,8 @@ android:layout_gravity="bottom|right" android:elevation="4dp" android:tint="?colorAccent" - android:layout_marginBottom="10dp" /> + android:layout_marginBottom="10dp" + tools:targetApi="lollipop" /> </FrameLayout> </TableRow> @@ -183,7 +182,7 @@ 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> @@ -217,12 +216,23 @@ android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="by Author" + tools:text="by Author" 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.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml index d44e016a..02fea821 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"> @@ -114,7 +112,7 @@ 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:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -127,7 +125,7 @@ android:fontFamily="sans-serif-light" android:gravity="right|center_vertical" android:singleLine="true" - android:text="Jan 01, 12:00, 1970" + tools:text="Jan 01, 12:00, 1970" android:textColor="?headlineSecondaryTextColor" android:textSize="12sp" /> @@ -163,8 +161,10 @@ android:paddingRight="4dp" android:src="@drawable/ic_dots_vertical_circle" android:layout_gravity="bottom|right" + android:elevation="4dp" android:tint="?colorAccent" - android:layout_marginBottom="10dp" /> + android:layout_marginBottom="10dp" + tools:targetApi="lollipop" /> </FrameLayout> </TableRow> @@ -182,7 +182,7 @@ 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> @@ -216,12 +216,23 @@ android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" - android:text="by Author" + tools:text="by Author" 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/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> |