Coder Social home page Coder Social logo

callslideview's Introduction

CallSlideView

滑动实现接听和挂断电话的View

效果图

1、向左滑动接听,向右滑动挂断
2、向两边滑动时,颜色渐变
3、颜色和字体可以在xml中完全自定义

image

实现方法

监听onTouhc,在运动的过程中不停的出发onDraw,画图同时颜色渐变

使用方法

CallSliderView callView = (CallSliderView) findViewById(R.id.slider_view);
        callView.setSliderEndListener(new CallSliderView.SliderListener() {
            @Override
            public void onSliderEnd() {
                Toast.makeText(CallSliderEndViewActivity.this, "挂断", Toast.LENGTH_SHORT).show();
                finish();
            }

            @Override
            public void onSliderListen() {
                Toast.makeText(CallSliderEndViewActivity.this, "接听", Toast.LENGTH_SHORT).show();
                finish();
            }
        });

在 xml中

 <com.guo.duoduo.library.CallSliderView
        android:id="@+id/slider_view"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_centerInParent="true"
        android:layout_margin="30dp"
        app:CallSliderView_backgroundColor="@color/gray"
        app:CallSliderView_progressBackgroundColor="@color/red"
        app:CallSliderView_text="滑动"
        app:CallSliderView_Left_Text="接听"
        app:CallSliderView_Right_Text="挂断"
        app:CallSliderView_textSize="20sp" />

callslideview's People

Contributors

gpfduoduo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

callslideview's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.