Comments (6)
Thanks for your awesome app :)
I had same problem and based on what #rendecano said, I fixed the issue.
For those who don't know how to get view add following line after the place you linked slider to your activity (or FragmentActivity):
mPanelLayout.setDragView(this.findViewById(R.id.NAME_OF_VIEW));
complete code in activity:
SlidingUpPanelLayout mPanelLayout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout);
mPanelLayout.setShadowDrawable(getResources().getDrawable(R.drawable.above_shadow));
mPanelLayout.setAnchorPoint(0.4f);
mPanelLayout.setDragView(this.findViewById(R.id.ivPullUp));
...
If you want to use two fragment (one as main and another one inside slide) this is my sample code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AroundMeActivity">
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/frame_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_pull_up"
android:scaleType="fitCenter"
android:id="@+id/ivPullUp"
android:background="@color/map_slider_header"
android:contentDescription="@string/content_description"/>
<FrameLayout
android:id="@+id/frame_slider"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</RelativeLayout>
Then you can add your fragments from your FragmentActivity:
// add map fragment to activity
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.frame_main, new AroundSpotsMapFragment(), FRAG_AROUND_SPOTS_MAP)
.commit();
// add list fragment to activity
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.frame_slider, new AroundSpotsListFragment(), FRAG_AROUND_SPOTS_LIST)
.commit();
Following image shows final result:
from androidslidinguppanel.
Hello,
mPanelLayout.setDragView(this.findViewById(R.id.ivPullUp));
This method is not working for me. I have tried to set my whole view as dragview still it's not working. Please update for same.
from androidslidinguppanel.
Have a look at the setDragView method. If you want to have clickable
objects, you need to have a separate drag view.
On Tue, Jun 11, 2013 at 7:22 PM, rendecano [email protected] wrote:
Hi,
First of all, thanks for this one. =)
I just wanna ask, I tried running the Demo app included in the project and
then added some buttons inside the sliding panel but I can't click on the
buttons, but instead the panel keeps on hiding.Am I missing something here?
Thanks and regards!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2
.
Anton Lopyrev
Co-Founder & CTO • SoThree, Inc.
(415) 735-0354
http://umanoapp.com
from androidslidinguppanel.
Hi,
Thanks for the quick reply. It's now working great! =)
Just a suggestion, maybe we can update the "Usage" part of the documentation? ;)
Thanks and regards!
from androidslidinguppanel.
Will do!
On Tue, Jun 11, 2013 at 8:18 PM, rendecano [email protected] wrote:
Hi,
Thanks for the quick reply. It's now working great! =)
Just a suggestion, maybe we can update the "Usage" part of the
documentation? ;)Thanks and regards!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-19304787
.
from androidslidinguppanel.
Yes. That's correct. Make sure that the drag view is the child in the
sliding panel's layout.
On Sun, Sep 8, 2013 at 6:56 AM, linusmotu [email protected] wrote:
Hi,
I just started using this library (thanks for this), but i am having the
same problems with the items inside the panel. How exactly do I use
setDragView?For example, I have a button or textview inside the panel, I am doing this
but it is not working, it still wont let me click the button.
t = (TextView) findViewById(R.id.DisplaySettings);
layout.setDragView(t);Am I correct in thinking that when I use this, i should be able to drag
the text view, and only that, while everything else in the panel is
clickable?Thank you!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-24021244
.
from androidslidinguppanel.
Related Issues (20)
- Cause: org/gradle/api/tasks/testing/AbstractTestTask
- java.lang.IllegalArgumentException happened occasionally
- Very Good HOT 1
- Scroll RecyclerView when panel is at Anchored Point HOT 2
- Slideable view - margin left and right
- Question: Is there an easy way to dismiss panel when user taps on main content? HOT 1
- DrawerLayout with SlidingUpPanel doesn't fit system windows HOT 1
- Ridiculous bug. Panel refuses to expand!
- default grey line on top of sliding panel which needs to expand or collapsed HOT 1
- 🔴🔴🔴 IMP Repo seems dead, New commits at https://github.com/hannesa2/AndroidSlidingUpPanel/
- Black space between main and draggable content on new Samsung devices
- mLastMotionY 数组越界问题
- Change position of a specific view in SlidingUpPanel Layout. HOT 1
- Rounded Corners at the top
- SlidingUpPanel with BottomNavigation Help ....
- never recalculate the layout height after replace it programmatically
- com.sothree.slidinguppanel.SlidingUpPanelLayout.onMeasure (SlidingUpPanelLayout.java:803)
- Build Analyzer found problems for update to AndroidX (Jetifier)
- Avoid panel collapsewhen click in screen. HOT 2
- Drawable drawable/above_shadow has unresolved theme attributes! Consider using Resources.getDrawable(int, Theme) or Context.getDrawable(int). 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 androidslidinguppanel.