android-slidingactivity | Android library which allows you to swipe | Android library
kandi X-RAY | android-slidingactivity Summary
kandi X-RAY | android-slidingactivity Summary
Android library which allows you to swipe down from an activity to close it.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the Activity
- Initialize the card
- This method will start the expansion
- Shows an entrace animation
- Initialize this activity
- Updates the color of the status bar
- Update the tint and drop shadow
- Adjusts the alpha of a color
- Handles a touch event
- Determines if an event should start a drag
- Updates the header size and margin
- Scroll down the view
- Initializes this instance
- Sets the image to display
- Checks if the device is available
- Initialize the sample values
- Disables the header
- Display the example
- Adds expansion arguments to the intent
- Initializes this activity
- Initialize this view
- Compute the scroll effect
- Initialize this menu
- Draws the edge effects on the canvas
android-slidingactivity Key Features
android-slidingactivity Examples and Code Snippets
Community Discussions
Trending Discussions on android-slidingactivity
QUESTION
I'm creating an app and I'm using a library called "SlidingActivity". [Github Link]
I actually have two activities. One being the main activity of the app and the other one extending SlidingActivity
. So when the SlidingActivity
is opened, it's still possible to see the main activity in the background (see the images on the Github page).
Is it possible to edit the content/layout of the main activity when the SlidingActivity
is opened?
I tried using getParent()
but it's returning null
.
Edit: As @Hamza Hathoute suggested I've tried overriding onPause()
and onDestroy()
. I've seen that onPause()
is called each time the SlidingActivity
is opened.
Thanks in advance. I'm new to StackOverflow so if there is anything I've done wrong please tell me!
...ANSWER
Answered 2018-Jul-30 at 07:10The issue you are facing is one of communication. That is, you want the SlidingActivity to tell the MainActivity that it should change its content. While there are a few approaches to this issue the simplest might be to use the LocalBroadcastManager to send a broadcast.
Edit:
An activity that is not in the foreground can be killed by the OS in low memory situations. So you should register your receiver in onCreate and unregister in onDestroy. It is therefore possible that you might miss a broadcast (if your activity was destroyed when the broadcast was sent).
If you want to cover this case then unless you want to deal with persistence (shared prefs, db) then you should probably use the startActivityForResult option mentioned in another answer. The downside of that approach is that the changes to MainActivity aren't immediate. So if the sliding activity isn't full screen then you won't see changes in the MainActivity.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install android-slidingactivity
If you'd like to check out the sample app first, you can download an APK here.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page