Skip to content

1 - Adding BorderRadius and BorderRadius with Stroke to the Button by… #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
Binary file not shown.
14 changes: 11 additions & 3 deletions example/src/main/java/com/wldev/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

FancyButton button1 = (FancyButton) findViewById(R.id.btn1);
FancyButton button2 = (FancyButton) findViewById(R.id.btn2);
FancyButton button3 = (FancyButton) findViewById(R.id.btn3);
FancyButton button1 = findViewById(R.id.btn1);
FancyButton button2 = findViewById(R.id.btn2);
FancyButton button3 = findViewById(R.id.btn3);
FancyButton button4 = findViewById(R.id.btn4);
FancyButton button5 = findViewById(R.id.btn5);
FancyButton button6 = findViewById(R.id.btn6);
FancyButton button7 = findViewById(R.id.btn7);

View.OnClickListener listener = new View.OnClickListener() {
@Override
Expand All @@ -36,5 +40,9 @@ public void onClick(View view) {
button1.setOnClickListener(listener);
button2.setOnClickListener(listener);
button3.setOnClickListener(listener);
button4.setOnClickListener(listener);
button5.setOnClickListener(listener);
button6.setOnClickListener(listener);
button7.setOnClickListener(listener);
}
}
5 changes: 5 additions & 0 deletions example/src/main/res/drawable/button_border.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<solid android:color="@color/colorPrimary"/>
</shape>
6 changes: 6 additions & 0 deletions example/src/main/res/drawable/button_border_stroke.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<solid android:color="@android:color/holo_blue_bright"/>
<stroke android:color="@color/colorAccent" android:width="4dp"/>
</shape>
165 changes: 115 additions & 50 deletions example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.wldev.example.MainActivity">

<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:f_btnStyle="stroke_fill"
app:f_fillColor="@android:color/holo_blue_bright"
app:f_hideFillAfterCollapse="false"
app:f_progressColor="@android:color/holo_green_light"
app:f_strokeColor="@android:color/holo_red_light"
app:f_text="Button"
app:f_textColor="#000"
app:f_textSize="22sp" />


<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
app:f_btnStyle="fill"
app:f_fillColor="@android:color/holo_green_light"
app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/holo_green_light"
app:f_text="Button"
app:f_textColor="#fff"
app:f_textSize="18sp" />


<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
app:f_btnStyle="stroke"
app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/holo_blue_light"
app:f_strokeColor="@android:color/holo_blue_light"
app:f_text="Button"
app:f_textColor="#000"
app:f_textSize="18sp" />

</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="com.wldev.example.MainActivity">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">


<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:f_btnStyle="stroke_fill"
app:f_fillColor="@android:color/holo_blue_bright"
app:f_hideFillAfterCollapse="false"
app:f_progressColor="@android:color/holo_green_light"
app:f_strokeColor="@android:color/holo_red_light"
app:f_text="Button"
app:f_textColor="#000"
app:f_textSize="22sp"/>


<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:f_btnStyle="fill"
app:f_fillColor="@android:color/holo_green_light"
app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/holo_green_light"
app:f_text="Button"
app:f_textColor="#fff"
app:f_textSize="18sp"/>


<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:f_background="@drawable/button_border"
app:f_btnStyle="fill"
app:f_fillColor="@color/colorPrimary"
app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/holo_blue_light"
app:f_text="Button"
app:f_textColor="#FFF"
app:f_textSize="18sp"/>

<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:f_btnStyle="fill"
app:f_fillColor="@color/colorPrimary"
app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/holo_green_light"
app:f_text="Button"
app:f_textColor="#fff"
app:f_textSize="18sp"/>


<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:f_background="@drawable/button_border_stroke"
app:f_btnStyle="fill"
app:f_fillColor="@android:color/holo_blue_bright"

app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/black"
app:f_text="Button"
app:f_textColor="#FFF"
app:f_textSize="18sp"/>

<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:f_background="@drawable/button_border"
app:f_btnStyle="fill"
app:f_fillColor="@color/colorPrimary"
app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/holo_blue_light"
app:f_text="New Font"
app:f_textFont="fonts/bahianita-regular.ttf"
app:f_textColor="#FFF"
app:f_textSize="18sp"/>


<com.ekalips.fancybuttonproj.FancyButton
android:id="@+id/btn7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:f_background="@drawable/button_border"
app:f_btnStyle="fill"
app:f_fillColor="@color/colorPrimary"
app:f_hideFillAfterCollapse="true"
app:f_progressColor="@android:color/holo_blue_light"
app:f_text="Text Appearance"
app:f_textAppearance="@style/TextAppearance.AppCompat.Large"/>


</LinearLayout>
</ScrollView>
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jan 30 00:24:59 EET 2019
#Wed Jul 03 15:46:00 EET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Loading