-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable top and bottom quickreturn #12
Comments
Yeah, check the sample app here. You can call |
Thank you for your quick response. The differences to youre example are:
Do you have any ideas? |
I will check this and get back to you. If you can provide some code snippets or a test app demonstrating the bug, it would be super helpful. |
Hi Felipe, base_layout.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/base_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/base_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<ListView
android:id="@+id/base_drawer_list"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#FFFFFF"
android:choiceMode="none"
android:divider="#E6E6E6"
android:dividerHeight="1dp" />
</android.support.v4.widget.DrawerLayout> testlayout.xml <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E6E6E6" >
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#FFFFFF"
android:dividerHeight="1dp"
android:padding="0dp" >
</ListView>
<LinearLayout
android:id="@+id/topView_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white" >
<include
android:id="@+id/topView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="@layout/topView_layout />
</LinearLayout>
<LinearLayout
android:id="@+id/bottomView_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#33b5e5" >
<include
android:id="@+id/bottomView"
layout="@layout/bottomView_layout"
android:visibility="gone" />
</LinearLayout>
</FrameLayout> public class MyBaseActivity extends Activity {
@override
public onCreate(Bundle b){
super.onCreate(b);
setContentView(R.layout.my_base_layout);
IMyViewInterface viewInterface = createView();
..
this.baseContainer = (RelativeLayout)findViewById(R.id.base_view_container);
View view = ViewCreator.createView(getLayoutInflater(), this.baseContainer, this.view.getResource());
viewInterface.setView(view);
viewInterface.setup();
baseContainer.addView(view);
}
protected abstract IMyViewInterface createView();
}
public class MyTestActivity extends MyBaseActivity {
@override
protected IMyViewInterface createView() {
return new MyTestView();
}
public class MyTestView implements IMyViewInterface {
private View view;
@override
public void setView(View view) {
this.view = view;
}
@override
public void setup() {
this.bottomView = this.view.findViewById(R.id.bottomView);
this.bottomView.setVisibility(View.GONE);
this.TopView = this.view.findViewById(R.id.topView);
this.list = this.view.findViewById(R.id.list);
this.listOrders.setAdapter(new QuickReturnAdapter(this.adapter));
final QuickReturnAttacher quickReturnAttacher = QuickReturnAttacher.forView(list);
quickReturnAttacher.addTargetView(this.scanInfo, QuickReturnTargetView.POSITION_BOTTOM);
this.listOrders.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener()
{
@Override
public void onGlobalLayout()
{
//I have to do it this way because otherwise topView is never shown, because height is always 0 if called getHeight() directly in setup()
quickReturnAttacher.addTargetView(stopDescriptionContainer,
QuickReturnTargetView.POSITION_TOP, topView.getHeight())
.setAnimatedTransition(false);
}
});
} |
Hi Felipe, any progress on this issue? |
@misrakli sorry didn't have time to check yet. Will keep you posted |
Ok.. |
Hi,
is it possible to enable top and bottom quickreturnviews at same time for same listview?
Thank you.
The text was updated successfully, but these errors were encountered: