Comments (7)
Yeah, check the sample app here. You can call addTargetView
twice, one for top and one for bottom.
If you run the sample app, open the actionbar overflow menu and tap "Toggle bottom QuickReturn", then you'll have both active at the same time.
from quickreturn.
Thank you for your quick response.
I asked you because i tried this already out and didnt get it work.
The "bottom view" is placed over the "top view" but is scrolled down when the list is scrolled, so the place is wrong but the scrolling is right, both views are hidden. By the way using only topView works fine.
The differences to youre example are:
- I am adding the framelayout in onCreate to an other layout (relativelayout)
- I have separeted the Activity from the View (two different classes), the activity is acting as the presenter
- The "top" and "bottom" views are included in my activity_layout.xml per "include"
- I have to call adddTargetView in onGlobalLayout in my view, otherwise getWidth of the topView always returns 0 and topView (without bottomView) doesnt work, too
Do you have any ideas?
Thank you.
from quickreturn.
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.
Thanks!
from quickreturn.
Hi Felipe,
thank you for reopening...Here are some snippets, hope they will help you..
Can't figure out how it works in your test app.. Thank you for your help.
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);
}
});
}
from quickreturn.
Hi Felipe, any progress on this issue?
did my code snippets help you?
from quickreturn.
@misrakli sorry didn't have time to check yet. Will keep you posted
from quickreturn.
Ok..
from quickreturn.
Related Issues (20)
- Good Job HOT 1
- Combine Quick Return with Pull To Refresh HOT 3
- Quick Return target hide scroll thumb when scroll to top!!
- Quick Return broken when calling ListView.onRestoreInstanceState(state) HOT 1
- READ_PHONE_STATE permission HOT 5
- Add support for RecyclerView HOT 3
- Issue with item selection HOT 1
- TargetView show/hide option. HOT 2
- Start hidden? HOT 2
- IndexOutOfBoundsException when clicking Button as Target View HOT 1
- Couldn't click some rows HOT 1
- could not work with listview with header. HOT 1
- Remove the not used ic_launcher.png HOT 1
- CardsLib and QuickReturn
- Bug when setting listview position HOT 1
- The firstVisibleItem position is wrong when the top target view is out of screen. HOT 1
- Blank area displays under target view as you scroll up HOT 4
- Quick return target doesn't work properly when in the middle of scrolling, item's height chaged
- In ScrollView the bottom QuickReturn target doesn't disappear HOT 2
- How about scrollViews HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quickreturn.