RX1226 / PeriscopeLayout

A layout with animation like Periscope's

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PeriscopeLayout

This module is reference AlanCheen/PeriscopeLayout

效果圖

How to use

  1. Add the JitPack repository to your build file:
    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
  1. Add the dependency:
    dependencies {
        implementation 'com.github.RX1226:PeriscopeLayout:1.0.1'
    }

Usage

Add layout in xml

        <com.github.rx1226.periscopelayout.PeriscopeLayout
            android:id="@+id/periscope"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

Usage

Use addHeart to create fly icon

    final PeriscopeLayout periscopeLayout = findViewById(R.id.periscope);
    periscopeLayout.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            periscopeLayout.addHeart();
        }
    });

Use setDrawables to set different icons

    // Set customer icon
    periscopeLayout.setDrawables(getResources().getDrawable(R.mipmap.ic_launcher),
            getResources().getDrawable(R.mipmap.ic_launcher_round));

Use setPosition to set start position

    periscopeLayout.setPosition(Position.LEFT);

Use startAuto to auto start

    // auto play
    periscopeLayout.startAuto();

License

Copyright 2018 RX1226

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.

About

A layout with animation like Periscope's

License:Apache License 2.0


Languages

Language:Java 100.0%