Skip to content

Commit dcbe437

Browse files
committed
shorten an if
1 parent 46376ae commit dcbe437

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public void onBindViewHolder(@NonNull FeedViewHolder holder, int position) {
413413
}
414414

415415
holder.view.setOnLongClickListener(view -> {
416-
if (feed.id != Feed.TYPE_TOGGLE_UNREAD && feed.id != Feed.TYPE_DIVIDER && feed.id != Feed.TYPE_GOBACK && feed.id != Feed.ALL_ARTICLES) {
416+
if (feed.id > Feed.TYPE_SENTINEL && feed.id != Feed.ALL_ARTICLES) {
417417
m_list.showContextMenuForChild(view);
418418
}
419419
return true;
@@ -423,6 +423,9 @@ public void onBindViewHolder(@NonNull FeedViewHolder holder, int position) {
423423
holder.view.setOnClickListener(view -> {
424424
if (feed.id == Feed.TYPE_GOBACK) {
425425
m_activity.getSupportFragmentManager().popBackStack();
426+
} else if (feed.id == Feed.TYPE_SETTINGS) {
427+
Intent intent = new Intent(getActivity(), PreferencesActivity.class);
428+
startActivityForResult(intent, 0);
426429
} else if (feed.id == Feed.TYPE_TOGGLE_UNREAD || feed.id == Feed.TYPE_DIVIDER) {
427430
//
428431
} else {

org.fox.ttrss/src/main/java/org/fox/ttrss/types/Feed.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.fox.ttrss.R;
99

1010
public class Feed implements Comparable<Feed>, Parcelable {
11+
public static final int TYPE_SENTINEL = -10000;
1112
public static final int TYPE_GOBACK = -10001;
1213
public static final int TYPE_DIVIDER = -10002;
1314
public static final int TYPE_TOGGLE_UNREAD = -10003;

0 commit comments

Comments
 (0)