Skip to content

Commit

Permalink
Merge branch 'issue-7'
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketbhoite committed May 19, 2018
2 parents 8277d10 + 3556bb4 commit d4fdd82
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 332 deletions.
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

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

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

238 changes: 0 additions & 238 deletions .idea/misc.xml

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

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


[![API](https://img.shields.io/badge/API-15%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=15)
[![GitHub license](https://img.shields.io/github/license/aniketbhoite/MutativeFab.svg)](https://github.com/aniketbhoite/MutativeFab/blob/master/LICENSE)


![Mutative button demo gif](https://user-images.githubusercontent.com/13782400/34786063-02843f1a-f659-11e7-89d4-8507a89facbb.gif)
Expand All @@ -26,7 +27,7 @@ allprojects {

```
dependencies {
compile 'com.github.aniketbhoite:MutativeFab:1.0.7'
compile 'com.github.aniketbhoite:MutativeFab:1.0.8'
}
```

Expand Down Expand Up @@ -57,14 +58,18 @@ Add floating text button to your layout file like this:
mFab.setFabTextVisibility(View.VISIBLE);//or View.GONE only
//to get TextView visibility
mFab.getFabTextVisibility();//returns Int
mFab.setFabTypeface(typeface);//to change text font

//in kotlin use can directly access fabText visibility by
mFab.fabTextVisibility = View.VISIBLE
```
If your project do not have kotlin support follow these steps

**Step 1:** Add [Jitpack](https://jitpack.io/v/aniketbhoite/MutativeFab) kotlin gradle plugin in your root build.gradle file (not your module build.gradle file):
```
buildscript {
//this
ext.kotlin_version = '1.2.10'
ext.kotlin_version = '1.2.41'
repositories {
google()
jcenter()
Expand Down
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation project(':mutativefab')
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.example.aniket.floatingtextbutton

import android.content.Context
import android.os.Bundle
import android.support.constraint.ConstraintLayout
import android.support.constraint.ConstraintSet
import android.support.design.widget.CoordinatorLayout
import android.support.design.widget.Snackbar
import android.support.v4.content.ContextCompat
Expand All @@ -12,20 +9,15 @@ import android.view.View
import android.widget.Button
import android.widget.Toast
import com.aniket.mutativefloatingactionbutton.MutativeFab
import kotlinx.android.synthetic.main.activity_main.*


class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val constraintLayout: ConstraintLayout = findViewById(R.id.constraintLayout)
val button = findViewById<Button>(R.id.button)

val constraintSet1 = ConstraintSet()
constraintSet1.clone(constraintLayout)
val constraintSet2 = ConstraintSet()
constraintSet2.clone(this, R.layout.activity_main_alt)
val coordinator = findViewById<CoordinatorLayout>(R.id.coordinator)

val showSnackbar = findViewById<Button>(R.id.showSnackbar)
Expand Down
Binary file added app/src/main/res/font/aldrich.ttf
Binary file not shown.
7 changes: 7 additions & 0 deletions app/src/main/res/font/custom_font.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/aldrich"/>

</font-family>
Loading

0 comments on commit d4fdd82

Please sign in to comment.