lawloretienne / quickreturn Goto Github PK
View Code? Open in Web Editor NEWShowcases QuickReturn UI Pattern as either a header, footer, or both header and footer
License: Apache License 2.0
Showcases QuickReturn UI Pattern as either a header, footer, or both header and footer
License: Apache License 2.0
Thank you very much for sharing
With a listview set to start at the bottom:
listView.setStackFromBottom(true);
listView.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
and with different sized listview items, when you scroll up, the header will pop down and up randomly even though you're going in the same direction. I think it's trying to calculate the position based on the size/height of the listview items (related to how the scroll bar thumb changes size when you scroll in a list w/ items of a different height).
UPDATE: looks like it's because of the bottom up listview...I can scroll all the way to the top and then scroll back down and it works as expected. Still a bug though :-P
The use case is that a chat stream is in the listview. That's why the listview starts at the bottom and goes to the bottom whenever it's updated. Another bug is that the quickreturn header disappears if you update the listview by adding/deleting an item.
I try using SwipeRefreshLayout as the parent layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/the_swiperefreshlayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/the_recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<TextView
android:id="@+id/the_textview_for_quickreturn"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_alignParentTop="true"
android:gravity="center"
android:text="Header"
android:textColor="@android:color/white"
android:textSize="22sp"/>
</RelativeLayout>
</android.support.v4.widget.SwipeRefreshLayout>
Its worked for at first load, but then when i scroll down and then scrolled it up again, ProgressBar is showed instead the Header, see image below:
So how to handle SwipeRefreshLayout with QuickReturn? thanks.
Hi,
first of all great library ;) I have a scrollview with a header. The header is pushed up when scrolling up. As I scroll down the header gets also scrolled down immediately (hence the name quick return I guess). Is there a way to show the header (or footer) with a delay or only when the scrollview can't be scrolled anymore?
best regards
dasheck
Hello, thanks for creating such a nice library.
I was running the example code and found that the first and second item from R.array.countries (United States Of America and Afghanistan) was covered by the header. I'm trying to scroll up and down, but it still cannot show the first and second item.
After checking the layout (fragment_list_quick_return_header.xml), I find that the problem is in the layout. The CustomTextView and the ListView do not have the position set between each other.
Edit: I try to change the layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.etiennelawlor.quickreturn.views.CustomFontTextView
android:id="@+id/quick_return_tv"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@color/transparent_black_ninty"
android:textSize="22sp"
android:text="@string/header"
android:textColor="@android:color/white"
android:gravity="center"
app:textFont="Roboto_Bold"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/list"
android:layout_below="@id/quick_return_tv"/>
</RelativeLayout>
After I change the layout into the code above, the first and second item is now shown but there is now a white gap on top of the list when scrolling.
Thanks for your help.
Am trying to implement the facebook layout as it has been done in the sample app.
but am failing to import the library project.
is this code also needed for that part.There is no such file like signing.properties.
// Extract signing info into a properties file
def props = new Properties()
props.load(new FileInputStream(project.file("signing.properties")))
android.signingConfigs.release.storeFile project.file(props.keyStore)
android.signingConfigs.release.storePassword props.keyStorePassword
android.signingConfigs.release.keyAlias props.keyAlias
android.signingConfigs.release.keyPassword props.keyAliasPassword
It's not fun having to search through an entire project just to see how something is fundamentally implemented. This is especially true for ones like this, where the "library" and examples are in the same project. It would be better to create two different projects, library and samples. Also, a simple example in the README would go a long way.
As it is now, it's completely unclear which dependencies are actually needed, and how to use this as an Android library project.
Gradle 'QuickReturn' project refresh failed
Error:No such property: GROUP for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
In your examples, the header is above the listview even when the listview is at the top of the list, so the first two items in the list is never visible.
I could not find a jar file for QuickReturn (really great library and with one of the best examples, neatly written). So should I just create a new module in my Android Studio project and copy the contents of /library?
Hi,
I am trying to use the example in the Readme and my list is shown empty
(i have a custom adapter)
any suggestions?
CODE:
public class FragmentNewHome extends Fragment{
//views
private ViewGroup rootView;
//private LinearLayout footer;
private Button b1, b2, b3, b4;
//private ListView list;
private ArrayList<ListItem> data;
public AdapterHomeList adapter;
@InjectView(R.id.new_home_footer) LinearLayout footer;
@InjectView(R.id.new_home_listview) ListView list;
public FragmentNewHome(){
}
public static FragmentNewHome newInstance() {
FragmentNewHome fragment = new FragmentNewHome();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement interfaces");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = (View) inflater
.inflate(R.layout.fragment_new_home_layout, container, false);
ButterKnife.inject(this, view);
return rootView;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
data = new ArrayList<ListItem>();
data.add(new ListItem("test1"));
data.add(new ListItem("test2"));
data.add(new ListItem("test3"));
adapter = new AdapterHomeList(data, getActivity());
Log.e("test", "adapter: " + (adapter == null ? "null" : "not null"));
Log.e("test", "list: " + (list == null ? "null" : "not null"));
list.setAdapter(adapter);
QuickReturnListViewOnScrollListener scrollListener = new QuickReturnListViewOnScrollListener(QuickReturnType.FOOTER,
null, 0, footer, 60);
scrollListener.setCanSlideInIdleScrollState(true);
list.setOnScrollListener(scrollListener);
}
@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.reset(this);
}
}
Hey. In the Google plus' implementation, is there a way to hide the FooterTextView while keeping the FooterImageView? You know, just like in Google plus, when there are no new posts, users can't see the "Touch to see new posts" footer view. I tried to set its visibility to GONE but as soon as I scroll, it appears again, even tho I am sure there are no new posts. It seems to me that the two footer views must appear at the same time when scrolling. Or is there another way to control this behavior? Thanks.
What is the Minimum SDK require to run smoothly ??
I required minSDK = 10 or 11, so would it run ??
nice library
please complateTodo Convert library into an Android archive (.aar)
thank you.
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:clipToPadding="false"
causes the quick return view to constantly stutter when scrolling
Change the 'Liscence' text in README.md written wrong. ;P
I'm in the implementation of this library in my app, I'm using Fragments but my app crashes because getArguments() always return NULL and cause NullPointerException in onViewCreated(..). The example Fragment that I'am using is this:
Please help me...
Should be included in gitignore instead
error: No resource identifier found for attribute 'cardCornerRadius' in package 'com.etiennelawlor.quickreturn'
Hello
Is it possible to hide/show the views on screen click. For instance, in what's app, when a user is checking a photo, if he clicks on the screen, the screen goes full screen so the user can focus on the main view.
Thank you
In the Twitter demo app, when scroll to the centre page, the tab quick disappear.
also, the bottom got some problems. When you leave the "HOME" page which show the footer, and go to the "Activity" page, the footer disappeared.
Please Fixed, Thanks in advance. I really appreciate what you did.
Hi, this is an awesome fork. Can it support gradle?
Thanks
When I scroll listview,the footer is flashing
header 覆盖住了上面的部分listview。我通过contentview getView 设置,但是无效,代码如下。
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
@OverRide
public int getItemViewType(int position) {
if (isPositionHeader(position))
return TYPE_HEADER;
return TYPE_ITEM;
}
private boolean isPositionHeader(int position) {
return position == 0;
}
@Override
public NewsDataItem getItem(int position) {
return (NewsDataItem) mItemList.get(position - 1);
}
@Override
public int getCount() {
return mItemList.size() + 1;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ItemViewHolder itemviewHolder;
if (TYPE_ITEM == getItemViewType(position))
convertView = null;
If you use nineoldandroids instead of native v11 translation and ObjectAnimator API, the library will become compatible with at least v7 Android API
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.