GithubHelp home page GithubHelp logo

yamin-elmakis / customview Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 926 KB

a simple example of Android custom views

Java 100.00%
android android-ui android-development example-code example android-view android-custom-view

customview's Introduction

CustomView

a simple example of a custom view with support to XML attributes and image src

Main Screen

Examples

VolumeView

    <com.example.customview.VolumeView
        android:layout_width="200dp"
        android:layout_height="75dp"
        android:src="@android:drawable/ic_lock_silent_mode_off"
        app:volume_back_color="@color/purple"
        app:volume_normal_color="@color/orange"
        app:volume_base_percentage="0.4"
        app:volume_high_percentage="0.7"/>
    volumeView.increase();
    volumeView.decrease();

ArcView

    <com.example.customview.ArcView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:arc_low_color="@color/red"
        app:arc_mid_color="@color/orange"
        app:arc_high_color="@color/green"
        app:arc_width="10dp"
        android:textSize="20sp"
        android:textColor="@color/grey" />
	arcView.setDestAngle(160);
    arcView.setHighColor(ContextCompat.getColor(this, R.color.yellow));
    arcView.setBackColorRes(R.color.red);

CircleView

    <com.example.customview.CircleView
        android:layout_width="80dp"
        android:layout_height="80dp"
        app:circle_bottom_color="@color/red"
        app:circle_top_color="@color/purple"
        app:circle_stroke_width="10dp" />

TriangleView

    <com.example.customview.TriangleView
        android:layout_width="120dp"
        android:layout_height="80dp"
        app:triangle_color="@color/purple" />

customview's People

Contributors

yamin-elmakis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.