Palulmu

Additional

Language
Kotlin
Version
0.9.1 (Mar 18, 2018)
Created
Mar 18, 2018
Updated
Jun 27, 2018
Owner
Wu Yu Hao (Ivan) (ivanisidrowu)
Contributor
Wu Yu Hao (Ivan) (ivanisidrowu)
1
Activity
Badge
Generate
Download
Source code
APK file

Promotion

Palumu

A floating view helper lib to let you create floating view above other views!

  • Floating view can follow specified view
  • Scalable view supported
  • Fullscreen supported

Components

FloatingViewHelper

Here is an example of how to create a floating view above a RecyclerView

val floatingViewHelper = FloatingViewHelper()
floatingViewHelper.floatingView = floatingPlayer
floatingViewHelper.recyclerView = recyclerView
floatingViewHelper.listener = listener

The listener is needed for helper to get the view followed by floating view. Please make sure you override getTargetView() in FloatingViewListener.

Then, you attach the view and start the helper.

floatingViewHelper.attachFloatingView()
floatingViewHelper.start()

Fullscreen is supported.

// Enter fullscreen (use it in activity onConfigurationChanged)
floatingViewHelper.enterFullScreen()

// Leave fullscreen (use it in activity onConfigurationChanged)
floatingViewHelper.leaveFullScreen()

Other details could be found in . You can also refer to .

ScalablePageFrame

This class provides youtubish style view. It can be scaled and swipe-to-close. You can set head view as the upper part of the UI and body view as lower part of the UI. In general, you can set any views to head and body. But SurfaceView now is not supported.

Add the frame into the specified view.

val videoPageFrame = ScalablePageFrame(context)
videoPageFrame.init(headView, bodyView, root)

It also supports fullscreen, just add few lines of code into onConfigurationChanged.

// Enter fullscreen (use it in activity onConfigurationChanged)
videoPageFrame?.enterFullScreen()
// Leave fullscreen (use it in activity onConfigurationChanged)
videoPageFrame?.leaveFullScreen()

Other details could be found in . You can also refer to .

Download

Add this repo to the root build.gradle file.

allprojects {
  repositories {
  ...
  maven { url 'https://jitpack.io' }
  }
}

Then add this dependency to app's build.gradle file.

dependencies {
  compile 'com.github.ivanisidrowu:palumu:0.9.1'
}

Contribution

Contributions are always welcome. If you have any ideas or suggestions, you can contact me or create a github issue.

TODOs

  • Allow sharing floating views across activities.
  • ScalablePageFrame supports taking fragments as the content of upper and lower view.
  • To implement new floating UI style like current Youtube APP (2018/05/27)

Sample videos and images

I do not own the videos and images. I use these videos and images from http://www.sample-videos.com/