All Projects → hoanganhtuan95ptit → DraggablePanel

hoanganhtuan95ptit / DraggablePanel

Licence: Apache-2.0 License
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to DraggablePanel

Dragview
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.
Stars: ✭ 171 (+81.91%)
Mutual labels:  youtube, draggable
live-stream-recorder
Monitor and record live streams from YouTube, OPENREC, TwitCasting, etc. Made for VTuber fans. (VTuber 直播自动录像脚本)
Stars: ✭ 297 (+215.96%)
Mutual labels:  youtube
he-tree-vue
A draggable sortable vue tree component, with dragging placeholder, types definition.
Stars: ✭ 123 (+30.85%)
Mutual labels:  draggable
youtube-transcriber
Automatically transcribes YouTube videos
Stars: ✭ 71 (-24.47%)
Mutual labels:  youtube
html5-draggable
html5页面可视化构建工具
Stars: ✭ 26 (-72.34%)
Mutual labels:  draggable
alternative-front-ends
Overview of alternative open source front-ends for popular internet platforms (e.g. YouTube, Twitter, etc.)
Stars: ✭ 1,664 (+1670.21%)
Mutual labels:  youtube
react-picky-date-time
A react component for date time picker. Online demo examples
Stars: ✭ 41 (-56.38%)
Mutual labels:  draggable
ytqck.github.io
YouTube quick ⚡ Search and Download Music for Free.
Stars: ✭ 18 (-80.85%)
Mutual labels:  youtube
download audioset
📁 This repo makes it easy to download the raw audio files from AudioSet (32.45 GB, 632 classes).
Stars: ✭ 53 (-43.62%)
Mutual labels:  youtube
laravel-video-api
Laravel (Youtube/Vimeo) Video Data API
Stars: ✭ 53 (-43.62%)
Mutual labels:  youtube
BrokenDisc
A discord music bot || NO CODING NEEDED!
Stars: ✭ 52 (-44.68%)
Mutual labels:  youtube
vue-drag-resize-rotate
一个Vue组件,支持拖拽,拉伸,旋转,放缩,自动对齐;A Vue component that supports dragging, stretching, rotating, scaling, and auto-alignment;
Stars: ✭ 42 (-55.32%)
Mutual labels:  draggable
TNImageView-Android
Android Library for making scale-able and rotatable image views or giving this power to your own image view. This repo has been depreciated.
Stars: ✭ 18 (-80.85%)
Mutual labels:  draggable
vue-sortable-tree
vue tree draggable, drag item sort
Stars: ✭ 87 (-7.45%)
Mutual labels:  draggable
ytmparty
Listen to music with your friends in Youtube Music.
Stars: ✭ 27 (-71.28%)
Mutual labels:  youtube
twtree
a highly customizable tree component for vue 2
Stars: ✭ 27 (-71.28%)
Mutual labels:  draggable
vue-smart-widget
🗃️Smart widget is a flexible and extensible content container component for Vue2.x / Vue3.x in Next branch.
Stars: ✭ 110 (+17.02%)
Mutual labels:  draggable
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (-82.98%)
Mutual labels:  youtube
react-native-reseau
[WIP] An ios-like grid view based on react-native.
Stars: ✭ 13 (-86.17%)
Mutual labels:  draggable
YoutubePlayer
Play and download YouTube videos. Extract audio from video. With minimalist beautiful gui.
Stars: ✭ 19 (-79.79%)
Mutual labels:  youtube

Please switch to DragView, for the best support, thank you

DraggablePanel

Alt text Alt text Alt text
Alt text Alt text Alt text

Download

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
    
    
    	dependencies {
	        implementation 'com.github.hoanganhtuan95ptit:DraggablePanel:1.2.5'
	}

Using Detail code java

  • Xml
        <com.hoanganhtuan95ptit.draggable.DraggablePanel
                android:id="@+id/draggablePanel"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:height_when_max="300dp"
                app:height_when_min="80dp"
                app:margin_bottom_when_min="8dp"
                app:margin_edge_when_min="8dp"
                app:percent_when_middle="0.9"
                app:state="MIN" />
Alt text Alt text
  • Listener
        draggablePanel.setDraggableListener(object : DraggablePanel.DraggableListener {
            override fun onChangeState(state: DraggablePanel.State) {
            }

            override fun onChangePercent(percent: Float) {
                alpha.alpha = 1 - percent
            }

        })
  • Add frame
        supportFragmentManager.beginTransaction().add(R.id.frameFirst, TopFragment()).commit() // add frame top
        supportFragmentManager.beginTransaction().add(R.id.frameSecond, BottomFragment()).commit() // add frame bottom

Alt text

  • Action
        btnMax.setOnClickListener { draggablePanel.maximize() }// maximize
        btnMin.setOnClickListener { draggablePanel.minimize() }//minimizeo
        btnClose.setOnClickListener { draggablePanel.close() }//close

Custom Detail code java

  • Custom
        class DraggableSource @JvmOverloads constructor(
                context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
        ) : DraggablePanel(context, attrs, defStyleAttr) {
        
            var mWidthWhenMax = 0
        
            var mWidthWhenMiddle = 0
        
            var mWidthWhenMin = 0
        
            init {
                getFrameFirst().addView(inflate(R.layout.layout_top))
                getFrameSecond().addView(inflate(R.layout.layout_bottom))
            }
        
            override fun initFrame() {
                mWidthWhenMax = width
        
                mWidthWhenMiddle = (width - mPercentWhenMiddle * mMarginEdgeWhenMin).toInt()
        
                mWidthWhenMin = mHeightWhenMin * 22 / 9
        
                super.initFrame()
            }
        
            override fun refreshFrameFirst() {
                super.refreshFrameFirst()
        
                val width = if (mCurrentPercent < mPercentWhenMiddle) {
                    (mWidthWhenMax - (mWidthWhenMax - mWidthWhenMiddle) * mCurrentPercent)
                } else {
                    (mWidthWhenMiddle - (mWidthWhenMiddle - mWidthWhenMin) * (mCurrentPercent - mPercentWhenMiddle) / (1 - mPercentWhenMiddle))
                }
        
                frameTop.reWidth(width.toInt())
            }
        }
  • Xml
        <com.hoanganhtuan95ptit.example.custom.DraggableSource
                android:id="@+id/draggablePanel"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:height_when_max="300dp"
                app:height_when_min="80dp"
                app:margin_bottom_when_min="8dp"
                app:margin_edge_when_min="8dp"
                app:percent_when_middle="0.9"
                app:state="MIN" />
  • Code
        draggablePanel.setDraggableListener(object : DraggablePanel.DraggableListener {
            override fun onChangeState(state: DraggablePanel.State) {
            }

            override fun onChangePercent(percent: Float) {
                alpha.alpha = 1 - percent
                shadow.alpha = percent
            }

        })

        supportFragmentManager.beginTransaction().add(R.id.frameTop, TopFragment()).commit()
        supportFragmentManager.beginTransaction().add(R.id.frameBottom, BottomFragment()).commit()

        btnMax.setOnClickListener { draggablePanel.maximize() }
        btnMin.setOnClickListener { draggablePanel.minimize() }
        btnClose.setOnClickListener { draggablePanel.close() }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].