mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
#1392 Collapsing toolbar sticky feed header
This commit is contained in:
parent
44963672c0
commit
fc443a4e52
4 changed files with 167 additions and 181 deletions
|
@ -1,5 +1,5 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.4.20'
|
ext.kotlin_version = '1.4.21'
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven {
|
maven {
|
||||||
|
|
|
@ -1,199 +1,197 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" >
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<!-- The two views in this top FrameLayout are swapped when HTML5 webview custom content wants to be displayed -->
|
<!-- The two views in this top FrameLayout are swapped when HTML5 webview custom content wants to be displayed -->
|
||||||
|
|
||||||
<com.newsblur.view.ReadingScrollView
|
<RelativeLayout
|
||||||
android:id="@+id/reading_scrollview"
|
android:id="@+id/reading_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
style="?readingBackground"
|
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
<FrameLayout
|
||||||
|
android:id="@+id/row_item_feed_header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:minHeight="6dp"
|
||||||
android:focusable="true"
|
android:paddingTop="4dp"
|
||||||
android:focusableInTouchMode="true"
|
android:paddingBottom="4dp">
|
||||||
>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<ImageView
|
||||||
|
android:id="@+id/reading_feed_icon"
|
||||||
|
android:layout_width="17dp"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:contentDescription="@string/description_row_folder_icon" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reading_feed_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="8dp"
|
android:layout_gravity="center_vertical"
|
||||||
style="?rowItemHeaderBackground">
|
android:layout_marginStart="40dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:lines="1"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/item_feed_border"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/row_item_feed_header"
|
||||||
|
android:background="@color/gray55" />
|
||||||
|
|
||||||
|
<com.newsblur.view.ReadingScrollView
|
||||||
|
android:id="@+id/reading_scrollview"
|
||||||
|
style="?readingBackground"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@+id/item_feed_border">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/row_item_feed_header"
|
style="?rowItemHeaderBackground"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:minHeight="6dp"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="4dp"
|
android:paddingBottom="8dp">
|
||||||
android:paddingBottom="4dp" >
|
|
||||||
|
|
||||||
<ImageView
|
<ImageButton
|
||||||
android:id="@+id/reading_feed_icon"
|
android:id="@+id/story_context_menu_button"
|
||||||
android:layout_width="17dp"
|
style="?android:attr/actionOverflowButtonStyle"
|
||||||
android:layout_height="17dp"
|
android:layout_width="34dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_height="34dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_margin="5dp"
|
||||||
android:contentDescription="@string/description_row_folder_icon" />
|
android:contentDescription="@string/description_menu" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/reading_feed_title"
|
android:id="@+id/reading_item_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toRightOf="@id/reading_feed_icon"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_marginTop="10dp"
|
||||||
android:ellipsize="end"
|
android:layout_marginRight="16dp"
|
||||||
android:lines="1"
|
android:layout_toLeftOf="@id/story_context_menu_button"
|
||||||
|
android:textSize="17sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reading_item_date"
|
||||||
|
style="?readingItemMetadata"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/reading_item_title"
|
||||||
|
android:layout_alignLeft="@id/reading_item_title"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginRight="12dp"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reading_item_authors"
|
||||||
|
style="?readingItemMetadata"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@id/reading_item_date"
|
||||||
|
android:layout_toRightOf="@id/reading_item_date"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:minWidth="80dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/reading_story_changes"
|
||||||
|
style="?readingItemMetadata"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/reading_item_date"
|
||||||
|
android:layout_alignLeft="@id/reading_item_title"
|
||||||
|
android:drawableStart="@drawable/ic_file_edit"
|
||||||
|
android:drawablePadding="6dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:text="@string/story_show_changes"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<com.newsblur.view.FlowLayout
|
||||||
|
android:id="@+id/reading_item_tags"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="17dp"
|
||||||
|
android:layout_below="@id/reading_story_changes"
|
||||||
|
android:layout_alignLeft="@id/reading_item_title"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/item_feed_border"
|
style="?itemHeaderDivider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_below="@id/row_item_feed_header"
|
android:layout_gravity="bottom" />
|
||||||
android:background="@color/gray55"/>
|
|
||||||
|
|
||||||
<ImageButton
|
<include layout="@layout/include_reading_share_bar" />
|
||||||
android:id="@+id/story_context_menu_button"
|
|
||||||
android:layout_width="34dp"
|
|
||||||
android:layout_height="34dp"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
style="?android:attr/actionOverflowButtonStyle"
|
|
||||||
android:contentDescription="@string/description_menu"
|
|
||||||
android:layout_below="@id/item_feed_border"
|
|
||||||
android:layout_alignParentRight="true" />
|
|
||||||
|
|
||||||
<TextView
|
<View
|
||||||
android:id="@+id/reading_item_title"
|
android:id="@+id/share_bar_underline"
|
||||||
|
style="?android:divider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="3dp"
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_below="@id/item_feed_border"
|
|
||||||
android:layout_toLeftOf="@id/story_context_menu_button"
|
|
||||||
android:textSize="17sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/reading_item_date"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/reading_item_title"
|
|
||||||
android:layout_alignLeft="@id/reading_item_title"
|
|
||||||
android:layout_marginRight="12dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
style="?readingItemMetadata"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/reading_item_authors"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignTop="@id/reading_item_date"
|
|
||||||
android:layout_toRightOf="@id/reading_item_date"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:minWidth="80dp"
|
|
||||||
style="?readingItemMetadata"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/reading_story_changes"
|
|
||||||
style="?readingItemMetadata"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/reading_item_date"
|
|
||||||
android:layout_alignLeft="@id/reading_item_title"
|
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:paddingBottom="4dp"
|
|
||||||
android:drawablePadding="6dp"
|
|
||||||
android:drawableStart="@drawable/ic_file_edit"
|
|
||||||
android:text="@string/story_show_changes"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.newsblur.view.FlowLayout
|
<TextView
|
||||||
android:id="@+id/reading_item_tags"
|
android:id="@+id/reading_textloading"
|
||||||
|
style="?readingBackground"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="17dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignLeft="@id/reading_item_title"
|
android:gravity="center_horizontal"
|
||||||
android:layout_below="@id/reading_story_changes"
|
android:paddingTop="5dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:paddingBottom="5dp"
|
||||||
android:layout_marginTop="8dp" />
|
android:text="@string/orig_text_loading"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="italic"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
</RelativeLayout>
|
<TextView
|
||||||
|
android:id="@+id/reading_textmodefailed"
|
||||||
|
style="?readingBackground"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:text="@string/orig_text_failed"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="italic"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<View
|
<com.newsblur.view.NewsblurWebview
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/reading_webview"
|
||||||
android:layout_height="1dp"
|
style="?readingBackground"
|
||||||
android:layout_gravity="bottom"
|
android:layout_width="match_parent"
|
||||||
style="?itemHeaderDivider" />
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
|
||||||
<include layout="@layout/include_reading_share_bar" />
|
<include layout="@layout/include_reading_item_comment" />
|
||||||
|
|
||||||
<View
|
</LinearLayout>
|
||||||
android:id="@+id/share_bar_underline"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="3dp"
|
|
||||||
style="?android:divider"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
</com.newsblur.view.ReadingScrollView>
|
||||||
android:id="@+id/reading_textloading"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="5dp"
|
|
||||||
android:paddingBottom="5dp"
|
|
||||||
style="?readingBackground"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:text="@string/orig_text_loading"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="italic"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
</RelativeLayout>
|
||||||
android:id="@+id/reading_textmodefailed"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="5dp"
|
|
||||||
android:paddingBottom="5dp"
|
|
||||||
style="?readingBackground"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:text="@string/orig_text_failed"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="italic"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<com.newsblur.view.NewsblurWebview
|
|
||||||
android:id="@+id/reading_webview"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="?readingBackground"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:scrollbars="none"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<include
|
|
||||||
layout="@layout/include_reading_item_comment" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</com.newsblur.view.ReadingScrollView>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/custom_view_container"
|
android:id="@+id/custom_view_container"
|
||||||
|
|
|
@ -28,7 +28,6 @@ import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.webkit.WebView.HitTestResult;
|
import android.webkit.WebView.HitTestResult;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.newsblur.R;
|
import com.newsblur.R;
|
||||||
|
@ -52,7 +51,6 @@ import com.newsblur.util.PrefsUtils;
|
||||||
import com.newsblur.util.StoryChangesState;
|
import com.newsblur.util.StoryChangesState;
|
||||||
import com.newsblur.util.StoryUtils;
|
import com.newsblur.util.StoryUtils;
|
||||||
import com.newsblur.util.UIUtils;
|
import com.newsblur.util.UIUtils;
|
||||||
import com.newsblur.view.ReadingScrollView;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
@ -66,12 +64,10 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
public static final String READING_FONT_CHANGED = "readingFontChanged";
|
public static final String READING_FONT_CHANGED = "readingFontChanged";
|
||||||
public Story story;
|
public Story story;
|
||||||
private FeedSet fs;
|
private FeedSet fs;
|
||||||
private LayoutInflater inflater;
|
|
||||||
private String feedColor, feedTitle, feedFade, feedBorder, feedIconUrl, faviconText;
|
private String feedColor, feedTitle, feedFade, feedBorder, feedIconUrl, faviconText;
|
||||||
private Classifier classifier;
|
private Classifier classifier;
|
||||||
private BroadcastReceiver textSizeReceiver, readingFontReceiver;
|
private BroadcastReceiver textSizeReceiver, readingFontReceiver;
|
||||||
private boolean displayFeedDetails;
|
private boolean displayFeedDetails;
|
||||||
private View view;
|
|
||||||
private UserDetails user;
|
private UserDetails user;
|
||||||
private DefaultFeedView selectedFeedView;
|
private DefaultFeedView selectedFeedView;
|
||||||
private boolean textViewUnavailable;
|
private boolean textViewUnavailable;
|
||||||
|
@ -163,7 +159,7 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
getActivity().unregisterReceiver(textSizeReceiver);
|
getActivity().unregisterReceiver(textSizeReceiver);
|
||||||
getActivity().unregisterReceiver(readingFontReceiver);
|
getActivity().unregisterReceiver(readingFontReceiver);
|
||||||
binding.readingWebview.setOnTouchListener(null);
|
binding.readingWebview.setOnTouchListener(null);
|
||||||
view.setOnTouchListener(null);
|
binding.getRoot().setOnTouchListener(null);
|
||||||
getActivity().getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(null);
|
getActivity().getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(null);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
@ -184,8 +180,7 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
}
|
}
|
||||||
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
this.inflater = inflater;
|
View view = inflater.inflate(R.layout.fragment_readingitem, container, false);
|
||||||
view = inflater.inflate(R.layout.fragment_readingitem, null);
|
|
||||||
binding = FragmentReadingitemBinding.bind(view);
|
binding = FragmentReadingitemBinding.bind(view);
|
||||||
itemCommentBinding = IncludeReadingItemCommentBinding.bind(binding.getRoot());
|
itemCommentBinding = IncludeReadingItemCommentBinding.bind(binding.getRoot());
|
||||||
|
|
||||||
|
@ -196,7 +191,7 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
|
|
||||||
registerForContextMenu(binding.readingWebview);
|
registerForContextMenu(binding.readingWebview);
|
||||||
binding.readingWebview.setCustomViewLayout(binding.customViewContainer);
|
binding.readingWebview.setCustomViewLayout(binding.customViewContainer);
|
||||||
binding.readingWebview.setWebviewWrapperLayout(binding.readingScrollview);
|
binding.readingWebview.setWebviewWrapperLayout(binding.readingContainer);
|
||||||
binding.readingWebview.setBackgroundColor(Color.TRANSPARENT);
|
binding.readingWebview.setBackgroundColor(Color.TRANSPARENT);
|
||||||
binding.readingWebview.fragment = this;
|
binding.readingWebview.fragment = this;
|
||||||
binding.readingWebview.activity = activity;
|
binding.readingWebview.activity = activity;
|
||||||
|
@ -206,8 +201,7 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
updateSaveButton();
|
updateSaveButton();
|
||||||
setupItemCommentsAndShares();
|
setupItemCommentsAndShares();
|
||||||
|
|
||||||
ReadingScrollView scrollView = (ReadingScrollView) view.findViewById(R.id.reading_scrollview);
|
binding.readingScrollview.registerScrollChangeListener(activity);
|
||||||
scrollView.registerScrollChangeListener(activity);
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
@ -417,15 +411,10 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupItemCommentsAndShares() {
|
private void setupItemCommentsAndShares() {
|
||||||
new SetupCommentSectionTask(this, view, inflater, story).execute();
|
new SetupCommentSectionTask(this, binding.getRoot(), getLayoutInflater(), story).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupItemMetadata() {
|
private void setupItemMetadata() {
|
||||||
View feedHeader = view.findViewById(R.id.row_item_feed_header);
|
|
||||||
View feedHeaderBorder = view.findViewById(R.id.item_feed_border);
|
|
||||||
TextView itemDate = (TextView) view.findViewById(R.id.reading_item_date);
|
|
||||||
ImageView feedIcon = (ImageView) view.findViewById(R.id.reading_feed_icon);
|
|
||||||
|
|
||||||
if ((feedColor == null) ||
|
if ((feedColor == null) ||
|
||||||
(feedFade == null) ||
|
(feedFade == null) ||
|
||||||
TextUtils.equals(feedColor, "null") ||
|
TextUtils.equals(feedColor, "null") ||
|
||||||
|
@ -440,8 +429,8 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
Color.parseColor("#" + feedFade),
|
Color.parseColor("#" + feedFade),
|
||||||
};
|
};
|
||||||
GradientDrawable gradient = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, colors);
|
GradientDrawable gradient = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, colors);
|
||||||
UIUtils.setViewBackground(feedHeader, gradient);
|
UIUtils.setViewBackground(binding.rowItemFeedHeader, gradient);
|
||||||
feedHeaderBorder.setBackgroundColor(Color.parseColor("#" + feedBorder));
|
binding.itemFeedBorder.setBackgroundColor(Color.parseColor("#" + feedBorder));
|
||||||
|
|
||||||
if (TextUtils.equals(faviconText, "black")) {
|
if (TextUtils.equals(faviconText, "black")) {
|
||||||
binding.readingFeedTitle.setTextColor(UIUtils.getColor(getActivity(), R.color.text));
|
binding.readingFeedTitle.setTextColor(UIUtils.getColor(getActivity(), R.color.text));
|
||||||
|
@ -453,13 +442,13 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
|
|
||||||
if (!displayFeedDetails) {
|
if (!displayFeedDetails) {
|
||||||
binding.readingFeedTitle.setVisibility(View.GONE);
|
binding.readingFeedTitle.setVisibility(View.GONE);
|
||||||
feedIcon.setVisibility(View.GONE);
|
binding.readingFeedIcon.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
FeedUtils.iconLoader.displayImage(feedIconUrl, feedIcon, 0, false);
|
FeedUtils.iconLoader.displayImage(feedIconUrl, binding.readingFeedIcon, 0, false);
|
||||||
binding.readingFeedTitle.setText(feedTitle);
|
binding.readingFeedTitle.setText(feedTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
itemDate.setText(StoryUtils.formatLongDate(getActivity(), story.timestamp));
|
binding.readingItemDate.setText(StoryUtils.formatLongDate(getActivity(), story.timestamp));
|
||||||
|
|
||||||
if (story.tags.length <= 0) {
|
if (story.tags.length <= 0) {
|
||||||
binding.readingItemTags.setVisibility(View.GONE);
|
binding.readingItemTags.setVisibility(View.GONE);
|
||||||
|
@ -510,7 +499,7 @@ public class ReadingItemFragment extends NbFragment implements PopupMenu.OnMenuI
|
||||||
// TODO: these textviews with compound images are buggy, but stubbed in to let colourblind users
|
// TODO: these textviews with compound images are buggy, but stubbed in to let colourblind users
|
||||||
// see what is going on. these should be replaced with proper Chips when the v28 Chip lib
|
// see what is going on. these should be replaced with proper Chips when the v28 Chip lib
|
||||||
// is in full release.
|
// is in full release.
|
||||||
View v = inflater.inflate(R.layout.tag_view, null);
|
View v = getLayoutInflater().inflate(R.layout.tag_view, null);
|
||||||
|
|
||||||
TextView tagText = (TextView) v.findViewById(R.id.tag_text);
|
TextView tagText = (TextView) v.findViewById(R.id.tag_text);
|
||||||
tagText.setText(tag);
|
tagText.setText(tag);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.io.File;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static android.graphics.Bitmap.Config.ARGB_8888;
|
import static android.graphics.Bitmap.Config.ARGB_8888;
|
||||||
import static com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS;
|
|
||||||
import static com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL;
|
import static com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL;
|
||||||
import static com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP;
|
import static com.google.android.material.appbar.AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP;
|
||||||
|
|
||||||
|
@ -218,7 +217,7 @@ public class UIUtils {
|
||||||
// enabled scrolling app bar only for reading
|
// enabled scrolling app bar only for reading
|
||||||
if (activity instanceof Reading) {
|
if (activity instanceof Reading) {
|
||||||
AppBarLayout.LayoutParams p = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
|
AppBarLayout.LayoutParams p = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
|
||||||
p.setScrollFlags(SCROLL_FLAG_SCROLL | SCROLL_FLAG_ENTER_ALWAYS | SCROLL_FLAG_SNAP);
|
p.setScrollFlags(SCROLL_FLAG_SCROLL | SCROLL_FLAG_SNAP);
|
||||||
toolbar.setLayoutParams(p);
|
toolbar.setLayoutParams(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue