• Stars
    star
    330
  • Rank 127,603 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A raised button that lowers down to 0dp of elevation

RaiflatButton

A raised button that lowers down to 0dp of elevation. From my blog post: https://rubensousa.github.io/2016/10/raiflatbutton

It behaves like a normal button on APIs < 21

Build

dependencies {
   compile 'com.github.rubensousa:raiflatbutton:0.1'
}

How to

Just add the following xml to your layout:

<com.github.rubensousa.raiflatbutton.RaiflatButton
    android:id="@+id/normalButton"
    style="@style/Base.Widget.AppCompat.Button.Colored"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Colored" />
    
<com.github.rubensousa.raiflatbutton.RaiflatImageButton
    android:id="@+id/imageButton"
    style="@style/Base.Widget.AppCompat.Button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_android" />

If you want to resume the normal button behavior, just use:

button.setFlatEnabled(false);

Styling

Since RaiflatButton and RaiflatImageButton both extend AppCompatButton and AppCompatImageButton, you can reuse the same AppCompat styles.

Example:

<style name="RaiflatButtonPrimaryStyle" parent="Base.Widget.AppCompat.Button.Colored">
    <item name="android:colorControlNormal">?attr/colorPrimary</item>
</style>

License

Copyright 2016 Rúben Sousa

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.

More Repositories

1

GravitySnapHelper

A SnapHelper that snaps a RecyclerView to an edge.
Java
4,987
star
2

ViewPagerCards

ViewPager cards inspired by Duolingo
Java
4,065
star
3

PreviewSeekBar

A SeekBar suited for showing a preview of something. As seen in Google Play Movies.
Java
3,437
star
4

FloatingToolbar

A toolbar that morphs from a FloatingActionButton
Java
1,551
star
5

BottomSheetBuilder

A simple library that creates BottomSheets according to the Material Design specs
Java
558
star
6

Decorator

Decorator is an Android library that helps creating composable margins and dividers in RecyclerViews
Kotlin
533
star
7

RecyclerViewNestedExample

From: https://rubensousa.com/2019/08/16/nested_recyclerview_part1/ and https://rubensousa.com/2019/08/27/saving_scroll_state_of_nested_recyclerviews/
Kotlin
165
star
8

BottomSheetExample

A sample project with the new BottomSheet classes from the android support library
Java
129
star
9

Transitions

A sample that showcases some transitions
Java
118
star
10

DpadRecyclerView

A RecyclerView built for Android TV with Compose in mind and as a replacement for Leanback's BaseGridView.
Kotlin
103
star
11

SlidingTabs

Tabs created with the new android.support.design.widget.TabLayout
Java
25
star
12

StackView

A view that arranges its children in the form of a stack
Java
16
star
13

lista

Lista helps you building composable sections and nested lists in RecyclerViews.
Kotlin
14
star
14

LoadMoreAdapter

A RecyclerView adapter that offers support to loading more items
Java
9
star
15

AndroidGithubPackage

Sample Android library that's published to GitHub Packages using a GitHub Action
Java
5
star
16

FragmentContainerViewIssue

https://issuetracker.google.com/issues/146359827
Kotlin
3
star
17

TabLayoutAdapter

A helper library to easily create tabs with TabLayout
Java
3
star
18

NavigationViewExample

An example app with NavigationView of the android.support.design library
Java
3
star
19

CropView

A simple view that selects an area for cropping
Java
3
star
20

WorkManagerKitkatBug

https://issuetracker.google.com/issues/122578012
Kotlin
2
star
21

rubensousa.github.io

SCSS
2
star
22

Android_8.0_Accessibility_Crash

Kotlin
2
star
23

WorkManagerConcurrent

https://issuetracker.google.com/issues/121345393
Kotlin
1
star
24

Mieti

Aplicação para o cálculo da média do Mestrado Integrado em Engenharia de Telecomunicações e Informática da Universidade do Minho.
Java
1
star
25

adventofcode2017

Solutions for Advent of Code
Kotlin
1
star
26

StateSaverIssue

Java
1
star