add FAB to headlines list
This commit is contained in:
parent
7c068db279
commit
afccfa1003
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="351"
|
android:versionCode="352"
|
||||||
android:versionName="1.124" >
|
android:versionName="1.125" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="15"
|
android:minSdkVersion="15"
|
||||||
|
@ -55,6 +55,8 @@ import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;
|
|||||||
import com.nostra13.universalimageloader.core.imageaware.ImageAware;
|
import com.nostra13.universalimageloader.core.imageaware.ImageAware;
|
||||||
import com.nostra13.universalimageloader.core.imageaware.ImageViewAware;
|
import com.nostra13.universalimageloader.core.imageaware.ImageViewAware;
|
||||||
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
|
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
|
||||||
|
import com.shamanland.fab.FloatingActionButton;
|
||||||
|
import com.shamanland.fab.ShowHideOnScroll;
|
||||||
|
|
||||||
import org.fox.ttrss.types.Article;
|
import org.fox.ttrss.types.Article;
|
||||||
import org.fox.ttrss.types.ArticleList;
|
import org.fox.ttrss.types.ArticleList;
|
||||||
@ -361,6 +363,15 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
|
|
||||||
m_list = (ListView)view.findViewById(R.id.headlines_list);
|
m_list = (ListView)view.findViewById(R.id.headlines_list);
|
||||||
|
|
||||||
|
FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.headlines_fab);
|
||||||
|
m_list.setOnTouchListener(new ShowHideOnScroll(fab));
|
||||||
|
fab.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
refresh(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (m_prefs.getBoolean("headlines_mark_read_scroll", false)) {
|
if (m_prefs.getBoolean("headlines_mark_read_scroll", false)) {
|
||||||
WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE);
|
WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE);
|
||||||
Display display = wm.getDefaultDisplay();
|
Display display = wm.getDefaultDisplay();
|
||||||
|
@ -39,6 +39,7 @@ import com.amulyakhare.textdrawable.TextDrawable;
|
|||||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||||
import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
|
import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
|
||||||
import com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter;
|
import com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter;
|
||||||
|
import com.shamanland.fab.FloatingActionButton;
|
||||||
|
|
||||||
import org.fox.ttrss.Application;
|
import org.fox.ttrss.Application;
|
||||||
import org.fox.ttrss.CommonActivity;
|
import org.fox.ttrss.CommonActivity;
|
||||||
@ -309,6 +310,9 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
|||||||
|
|
||||||
m_list = (ListView)view.findViewById(R.id.headlines_list);
|
m_list = (ListView)view.findViewById(R.id.headlines_list);
|
||||||
|
|
||||||
|
FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.headlines_fab);
|
||||||
|
fab.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (m_activity.isSmallScreen()) {
|
if (m_activity.isSmallScreen()) {
|
||||||
View layout = inflater.inflate(R.layout.headlines_heading_spacer, m_list, false);
|
View layout = inflater.inflate(R.layout.headlines_heading_spacer, m_list, false);
|
||||||
m_list.addHeaderView(layout);
|
m_list.addHeaderView(layout);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?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"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/headlines_fragment"
|
android:id="@+id/headlines_fragment"
|
||||||
android:background="?android:colorBackground"
|
android:background="?android:colorBackground"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
@ -29,4 +30,15 @@
|
|||||||
android:visibility="invisible" >
|
android:visibility="invisible" >
|
||||||
</TextView> -->
|
</TextView> -->
|
||||||
|
|
||||||
|
<com.shamanland.fab.FloatingActionButton
|
||||||
|
android:id="@+id/headlines_fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|right"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
app:floatingActionButtonColor="?colorAccent"
|
||||||
|
android:src="@drawable/ic_refresh"
|
||||||
|
/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
Loading…
x
Reference in New Issue
Block a user