All Projects → skydoves → Submarine

skydoves / Submarine

Licence: apache-2.0
🚤 Floating navigation view for displaying a list of items dynamically on Android.

Programming Languages

kotlin
9241 projects
dsl
153 projects

Projects that are alternatives of or similar to Submarine

Django Sitetree
Reusable application for Django introducing site tree, menu and breadcrumbs navigation elements.
Stars: ✭ 330 (-17.29%)
Mutual labels:  navigation
React Native Dating App
Dating app - Exponent and React Native
Stars: ✭ 352 (-11.78%)
Mutual labels:  navigation
Mvvmsmart
基于谷歌最新AAC架构,MVVM设计模式的一套快速开发库,整合ViewModel+Lifecycles+Navigation+DataBinding+LiveData+Okhttp+Retrofit+RxJava+Glide等主流模块,满足日常开发需求。使用该框架可以快速开发高质量、易维护的Android应用。 项目组会持续维护,请放心使用.欢迎Start并Fork交流.
Stars: ✭ 382 (-4.26%)
Mutual labels:  navigation
Baisibudejie
百思不得姐4.5.6版本高仿
Stars: ✭ 339 (-15.04%)
Mutual labels:  navigation
Byr Navi
A Light-Weight and Configurable Navigation Website Framework (for BYR)
Stars: ✭ 349 (-12.53%)
Mutual labels:  navigation
Route Composer
Protocol oriented, Cocoa UI abstractions based library that helps to handle view controllers composition, navigation and deep linking tasks in the iOS application. Can be used as the universal replacement for the Coordinator pattern.
Stars: ✭ 362 (-9.27%)
Mutual labels:  navigation
Navigasmic
Navigasmic: Semantic navigation for Rails using simple view level or configuration definitions.
Stars: ✭ 327 (-18.05%)
Mutual labels:  navigation
Easynavigation
一款超级简单的导航条管理工具。完全自定义导航条。没有UINavigationBar 和 UINavigationItem 这两个类。完全是对UIView的操作。
Stars: ✭ 393 (-1.5%)
Mutual labels:  navigation
Handycontrols
Contains some simple and commonly used WPF controls based on HandyControl
Stars: ✭ 347 (-13.03%)
Mutual labels:  navigation
React Navigation
Routing and navigation for your React Native apps
Stars: ✭ 20,650 (+5075.44%)
Mutual labels:  navigation
Android Jetpack Demo
🔥 快速入门Android Jetpack以及相关Kotlin、RxJava、MVVM等主流技术,独立构架App的基础技能
Stars: ✭ 335 (-16.04%)
Mutual labels:  navigation
Fmap
宇行地图:高仿高德地图Android客户端(持续更新中...)
Stars: ✭ 347 (-13.03%)
Mutual labels:  navigation
Nested Navigation Demo Flutter
Nested navigation with BottomNavigationBar
Stars: ✭ 367 (-8.02%)
Mutual labels:  navigation
Portal Lite
Multi-platform Personalized Portal: Web, Browser Extension. All components are web apps--users can compose their own Portal freely, and developers can contribute to the Privoce Web App library to easily incorporate their web app to our Portal.
Stars: ✭ 335 (-16.04%)
Mutual labels:  navigation
Hamburger React
Animated hamburger menu icons for React (1.5 KB) 🍔
Stars: ✭ 391 (-2.01%)
Mutual labels:  navigation
Jetpack From Java To Kotlin
本项目专注于提供 Jetpack 核心组件 Java vs Kotlin 1:1 对照示例 —— This project focuses on providing comparative examples of the core components of Jetpack from Java to Kotlin.
Stars: ✭ 330 (-17.29%)
Mutual labels:  navigation
Multi sensor fusion
Multi-Sensor Fusion (GNSS, IMU, Camera) 多源多传感器融合定位 GPS/INS组合导航 PPP/INS紧组合
Stars: ✭ 357 (-10.53%)
Mutual labels:  navigation
Medusa
Android fragment stack controller
Stars: ✭ 395 (-1%)
Mutual labels:  navigation
Tlyshynavbar
Unlike all those arrogant UINavigationBar, this one is shy and humble! Easily create auto-scrolling navigation bars!
Stars: ✭ 3,780 (+847.37%)
Mutual labels:  navigation
Navit
The open source (GPL v2) turn-by-turn navigation software for many OS
Stars: ✭ 368 (-7.77%)
Mutual labels:  navigation

Submarine

License API Build Status Android Weekly Javadoc

Fully customizable floating navigation view for listing items dynamically on Android.

Including in your project

Maven Central Jtpack

Gradle

Add below codes to your root build.gradle file (not your module build.gradle file).

allprojects {
    repositories {
        mavenCentral()
    }
}

And add a dependency code to your module's build.gradle file.

dependencies {
    implementation "com.github.skydoves:submarine:1.0.5"
}

Usage

Add following XML namespace inside your XML layout file.

xmlns:app="http://schemas.android.com/apk/res-auto"

SubmarineView

Here is how to implement like previews using SubmarineView.

<com.skydoves.submarine.SubmarineView
  android:id="@+id/submarineView"
  android:layout_width="50dp" // this will not affect on real view size. We can set anything.
  android:layout_height="50dp" //  this will not affect real view size. We can set anything.
  android:layout_alignParentBottom="true"
  android:layout_margin="20dp"
  android:alpha="0.8"
  app:submarine_animation="scale" // floating, dipping animation style.
  app:submarine_borderColor="@color/colorPrimaryDark" // navigation's border color.
  app:submarine_borderSize="1dp" // navigation's border thickness.
  app:submarine_circleAnchor="right" // decides where to moves the circle icon.
  app:submarine_circleBorderColor="@color/green" // circle icon's border color.
  app:submarine_circleBorderSize="1dp" // circle icon's border thickness.
  app:submarine_circleDrawable="@drawable/picasso" // circle icon's image drawable.
  app:submarine_circlePadding="2dp" // circle icon's padding value.
  app:submarine_circleSize="22dp" // circle icon's size. It decides the height or width of navigation.
  app:submarine_color="@android:color/black" // navigation's background color.
  app:submarine_duration="350" // navigation spreading duration.
  app:submarine_orientation="horizontal" // navigation spreading orientation.
/>

Float and Dip

Shows and makes disappear using the below methods.

submarineView.floats() // shows
submarineView.dips() // makes disappear

Navigate and Retreat

We can make the SubmarineView always floating (without appear, disappear actions) and navigating when we want.

Firstly, add below attributes to SubmarineView on your xml file.

app:submarine_autoDip="false"
app:submarine_autoNavigate="false"

And call floats() method before using navigates() method.

submarineView.floats()

Unfold and fold using the below methods.

submarineView.navigates() // unfold
submarineView.retreats() // fold

SubmarineItem

SubmarineItem is a data class for composing navigation list.

val item = SubmarineItem(ContextCompat.getDrawable(this, R.drawable.ic_edit))
submarineView.addSubmarineItem(item)

We can customize the icon drawable using IconForm.Builder.

val iconForm = IconForm.Builder(context)
  .setIconSize(45)
  .setIconTint(ContextCompat.getColor(context, R.color.colorPrimary))
  .setIconScaleType(ImageView.ScaleType.CENTER)
  .build()

// kotlin dsl
val iconForm = iconForm(context) {
  iconSize = 45
  iconColor = ContextCompat.getColor(context, R.color.colorPrimary)
  iconScaleType = ImageView.ScaleType.CENTER
}

val item = SubmarineItem(ContextCompat.getDrawable(this, R.drawable.ic_edit), iconForm)
submarineView.addSubmarineItem(item)

We can add SubmarineItem list, remove and clear all items.

submarineView.addSubmarineItem(item) // adds a SubmarineItem item.
submarineView.addSubmarineItems(itemList) // adds a SubmarineItem item list.
submarineView.removeSubmarineItem(item) // removes a SubmarineItem item.
submarineView.clearAllSubmarineItems() // clears all SubmarineItem items.

SubmarineItemClickListener

Interface definition for a callback to be invoked when a item is clicked.

submarineView.submarineItemClickListener = onItemClickListener

private object onItemClickListener: SubmarineItemClickListener {
  override fun onItemClick(position: Int, submarineItem: SubmarineItem) {
    // doSomething
  }
}

Circle Icon

We can customize the circle icon on the navigation.
Submarine uses CircleImageView. So you can reference the usage of it.

submarineView.circleIcon.setImageDrawable(drawable) // gets circle icon and changes image drawable.
submarineView.circleIcon.borderColor = ContextCompat.getColor(context, R.color.colorPrimary) // gets circle icon and changes border color.
submarineView.circleIcon.borderWidth = 2 // gets circle icon and changes border width.

SubmarineCircleClickListener

Interface definition for a callback to be invoked when a circle icon is clicked.

submarineView.submarineCircleClickListener = onCircleIconClickListener

private object onCircleIconClickListener: SubmarineCircleClickListener {
  override fun onCircleClick() {
    // doSomething
  }
}

Orientation and Anchor

SubmarineOrientation and CircleAnchor decide the where to spreads and where to moves.

app:submarine_circleAnchor="right" // left, right, top, bottom
app:submarine_orientation="horizontal" // horizontal, vertical
Horizontal and Left Horizontal and Right Vertical and Top Vertical and Bottom
or00 or01 or03 or02

SubmarineAnimation

SubmarineAnimation decides the animation of float and dip methods.

app:submarine_animation="scale" // scale, fade, none
SCALE FADE
or00 or05

SubmarineView Attributes

Attributes Type Default Description
orientation SubmarineOrientation Horizontal navigation's spreading orientation.
duration Long 350L navigation's spreading duration.
color Int(Color) Color.Black navigation's background color.
animation SubmarineAnimation None floating, dipping animation style.
borderSize Dimension 0f navigation's border thickness.
borderColor Int(Color) Color.Green navigation's border color.
expandSize Dimension display width size - 20dp size navigation's width or height size after expands.
radius Dimension 15dp navigation's corder radius.
autoNavigate Boolean true executes navigate method automatically after executing float method.
autoDip Boolean true executes dip method automatically after executing retreat method.
circleAnchor CircleAnchor Left decides where to moves the circle icon.
circleSize Dimension 20dp circle icon's size. It decides the height or width of navigation.
circleDrawable Drawable null circle icon's image drawable.
circleBorderSize Dimension 0f circle icon's border thickness.
circleBorderColor Int(Color) 0f circle icon's border color.
circlePadding Dimension 0f circle icon's padding width.

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐️

License

Copyright 2019 skydoves (Jaewoong Eum)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].