dlukashev / androidslidinguppanel-foursquare-map-demo Goto Github PK
View Code? Open in Web Editor NEWFoursquare like map demo with using modified AndroidSlidingUpPanel
License: Apache License 2.0
Foursquare like map demo with using modified AndroidSlidingUpPanel
License: Apache License 2.0
My issue is I want google map in my 3/4 of screen and below map a listview and an EditText with Button.when we write into EditText and press button then message will appear into listview. and if we want see all listview then we want to slide map up show all listview. I am using map and listview as shown in AndroidSlidingUpPanel-foursquare-map-demo but i am not able to attach edit text and button.
I've been searching for a way to collapse the pane when the SlidingLayout is created. I've tried to call the collapsePane method, but that isn't working. I've searched through the source and haven't found anything that will work for this situation.
Someone created this stackoverflow thread last year and fixed the issue. Too bad he didn't post the solution :/ https://stackoverflow.com/questions/31354102/how-to-set-slidingpanel-default-state-collapse-and-collapse-panel-min-height
Perhaps someone could help me out?
Hey, while using this style,
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen"
The ListView has a black section while sliding it up. Any helpful hint on how to solve this?
Would be nice to be able to add this using Maven dependancy.
If there are no items in the listview or the number is very less, the list layout show blank and it even scrolls which should not be there.
As ListView is imho outdated here's my RecyclerView approach for everyone who's interested:
In your Layout, wrap slidingPanelLayout into a Framelayout or whatever.
Put Mapview or whatever View as first child of SlidingPanel
Put simple Recyclerview as second child of SlidingPanel
add a interface to your wrapping frameLayout that exposes OnInterceptTouch as a Listener
@OverRide
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (onInterceptTouchListener != null){
onInterceptTouchListener.onInterceptTouch(ev);
}
return super.onInterceptTouchEvent(ev);
}
private OnInterceptTouchListener onInterceptTouchListener;
public void setOnInterceptTouchListener(OnInterceptTouchListener onInterceptTouchListener) {
this.onInterceptTouchListener = onInterceptTouchListener;
}
public interface OnInterceptTouchListener{
void onInterceptTouch(MotionEvent ev);
}
here's the (very simple) magic:
In your Fragment or whatever mainView add the listener:
frameLayout.setOnInterceptTouchListener(new FrameLayoutInterceptableInterface.OnInterceptTouchListener() {
float actionDownY = 0;
SlidingUpPanelLayout.PanelState actionDownState = SlidingUpPanelLayout.PanelState.COLLAPSED;
@Override
public void onInterceptTouch(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
actionDownY = ev.getRawY();
actionDownState = sliding_layout.getPanelState();
}
if (ev.getAction() == MotionEvent.ACTION_MOVE){
if (actionDownState == SlidingUpPanelLayout.PanelState.EXPANDED && ev.getRawY() < actionDownY){
sliding_layout.requestDisallowInterceptTouchEvent(true);
} else if (actionDownState == SlidingUpPanelLayout.PanelState.EXPANDED && ultimate_recycler_view.mRecyclerView.computeVerticalScrollOffset() != 0){
sliding_layout.requestDisallowInterceptTouchEvent(true);
}
}
}
});
Please advise me if you find any bugs or if this could be improved.
Thanks an have fun using.
I made sliding panel using this repository https://github.com/dlukashev/AndroidSlidingUpPanel-foursquare-map-demo
However, it contains one certain bug which is not covered anywhere so I decided to ask community here as you may have some experience with that.
While scrolling, there is on point (top of listview) where my listview appears to hide beneath the map. If I scroll up again it gets back to work but it might be very confusing for users. Here is the screenshot:
http://i.stack.imgur.com/BMTxR.jpg
I heard that this is a common issue using this library, but unfortunately haven't found any solution. It certainly lays somewhere deep inside the class implementation, so I ask for some links or advices what should I do to get rid off this tedious issue.
Thanks in advance!
When I want to see the visual layout for activity_main.xml
in Android Studio 0.8.12 the following rendering error occurs:
java.lang.NullPointerException
at com.sothree.slidinguppanel.SlidingUpPanelLayout.computeScroll(SlidingUpPanelLayout.java:1000)
at android.view.View.draw(View.java:14587)
at android.view.ViewGroup.drawChild(ViewGroup.java:3234)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3037)
at android.view.View.draw(View.java:14739)
at android.view.ViewGroup.drawChild(ViewGroup.java:3234)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3037)
at android.view.View.draw(View.java:14739)
at android.view.ViewGroup.drawChild(ViewGroup.java:3234)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3037)
at android.view.View.draw(View.java:14842)
at com.android.internal.widget.ActionBarOverlayLayout.draw(ActionBarOverlayLayout.java:501)
at android.view.View.draw(View.java:14741)
at android.view.ViewGroup.drawChild(ViewGroup.java:3234)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3037)
at android.view.View.draw(View.java:14739)
at android.view.ViewGroup.drawChild(ViewGroup.java:3234)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3037)
at android.view.View.draw(View.java:14842)
at android.view.View.draw(View.java:14741)
at android.view.ViewGroup.drawChild(ViewGroup.java:3234)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3037)
at android.view.View.draw(View.java:14842)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:587)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:331)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:333)
at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:674)
at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:663)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:663)
at com.android.tools.idea.rendering.RenderService.render(RenderService.java:790)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:611)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1900(AndroidLayoutPreviewToolWindowManager.java:81)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:553)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:548)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:327)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Do you have a clue why this is happening?
I have a problem to adjust my fragment part to the List. I working with that for a couple of dayse and still have no idea how to fix it.
My XML part:
```
<com.example.MapHidder.SlidingUpPanelLayout
android:id="@+id/slidingLayout"
app:shadowHeight="0dp"
app:paralaxOffset="@dimen/paralax_offset"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom">
<fragment xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/map"
tools:context="com.example.MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<RelativeLayout
android:id="@+id/slidingContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/transparentView"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="@dimen/map_height"
android:layout_alignParentTop="true" />
<View
android:id="@+id/whiteSpaceView"
android:visibility="gone"
android:background="@android:color/darker_gray"
android:layout_marginTop="@dimen/map_height"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.example.MapHidder.LockableListView
android:id="@+id/museumList"
android:cacheColorHint="@android:color/white"
android:drawSelectorOnTop="true"
android:dividerHeight="@dimen/divider_height"
android:divider="@android:color/darker_gray"
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:smoothScrollbar="false" />
</RelativeLayout>
</com.example.MapHidder.SlidingUpPanelLayout>
There should be setting for initial state of the listview/recyclerview as collapse or expand.
When Initial State of mSlideState = SlideState.COLLAPSE in setScrollableView it bugged out not showing proper map (the map disappear).
Tried to implement swipe to refresh alone with AndroidSlidingUpPanel but it didnt work... Tried all the hacks possible.
It is working if I disable the scrolling.
In my case there is a fragment in AndroidSlidingUpPanel and list in it. Trying to refresh the list.
is this tutorial fully functional using fragments?
Im trying to set it up but the list its behaving strange!!
and im using mapview is there a problem whith that?
Just thought I'd let you know this drawable is missing from the project...
The map does not resize to the set map dimension on collapsing.
No code was editing from checking out the repository apart from below in which the problem can be recreated:
for (int i = 0; i < 2; i++) {
testData.add("Item " + i);
}
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.