BlockButton

Additional

Language
Java
Version
N/A
Created
Jul 11, 2017
Updated
Aug 30, 2018 (Retired)
Owner
John Lee (BROUDING)
Contributor
John Lee (BROUDING)
1
Activity
Badge
Generate
Download
Source code

Advertisement

BlockButton

Android Block style Button by BROUDING

  • BlockButton is an extension of LinearLayout (thinking of extending RelativeLayout too..) hence, orientation should be set.
  • layout_height should be fixed.

Sample .apk

You can download the latest sample APK from this repo here: https://github.com/brouding/BlockButton/blob/master/sample/BlockButtonSample.apk


Gradle Dependency

Repository

The Gradle dependency is available via jCenter. jCenter is the default Maven repository used by Android Studio.

The minimum API level supported by this library is API 14, Android 4.0 (ICE_CREAM_SANDWICH)

Import to your project

add below code in build.gradle (Module: app)

dependencies {
 // ... other dependencies here
    compile 'com.brouding:android-block-button:0.1.3.2.2'
}

How to use

<com.brouding.blockbutton.BlockButton
    app:pushDepthDp="2"
    app:buttonColor="#58ad26"
    app:buttonGapColor="@color/blockButtonGapColor"
    app:buttonDisabledColor="#999999"
    app:buttonDisabledGapColor="@color/blockButtonDisabledGapColor"
  app:buttonStrokeWidth="1"
  app:buttonStokeColor="@color/blockButtonColor"
    android:id="@+id/btn_reset_guide"
    android:layout_width="wrap_content"
    android:layout_height="50dp"
    android:gravity="center"
    android:orientation="vertical">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:paddingLeft="12dp"
        android:paddingRight="12dp"
        android:textStyle="bold"
        android:textColor="#ffffff"
        android:textSize="17dp"
        android:text="RESET" />

</com.brouding.blockbutton.BlockButton>

Parameters

  • pushDepthDp : Integer value in dp, default is 4 (I don't recommend integer over 6..)
  • buttonColor, buttonGapColor, buttonDisabledColor, buttonDisabledGapColor : Color values, it can be #------ or @color/---

In class

private BlockButton btnResetGuidePref = (BlockButton) layoutMain.findViewById(R.id.btn_reset_guide);
btnResetGuidePref.setEnabled(false);

License

Copyright 2017 BlockButton authors.

- Jeongwon Lee (ssyjk2@gmail.com)

All rights reserved.

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.