Skip to content

intrications/ForegroundViews

 
 

Repository files navigation

ForegroundViews

Small library that provides Foreground View functionality to most used Android Views with foreground. If you want support to new View, add an issue :-)

This library is developed based on some other good but not completed approaches of Foreground Views:

Sources

Screenshots

Usage

You just have to use whatever FView like FrameLayout; just set the android:foreground attribute as shown below:

<com.dogmalabs.foregroundviews.ForegroundView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    custom:?="?">

    ... other views ...

</com.dogmalabs.foregroundviews.FView>

where custom attributes can be:

  • foreground Defines the drawable to draw over the content. This can be used as an overlay.

    Just add: custom:fv_foreground="@drawable/your_foreground"

  • foregroundInsidePadding Defines whether the foreground drawable should be drawn inside the padding. This property is false by default except if your background is a NinePatch Drawable.

    Just add: custom:fv_foregroundInsidePadding="true"

  • backgroundAsForeground Retrieve the default background and set it as the foreground. Thanks to this, you can get the default background selector of your theme and set it as your foreground selector if you want. This property is false by default.

    Just add: custom:fv_foregroundInsidePadding="true"

Download

Step 1: Add jitpack to your build.gradle at the end of repositories:

repositories {
    // ...
    maven { url "https://jitpack.io" }
}

Step 2: Add the dependency

dependencies {
        compile 'com.github.intrications:ForegroundViews:2.0.0'
}

Developed By

Follow me on Twitter Follow me on Google Plus Follow me on Medium Follow me on Pinterest Follow me on Dribbble Add me to Linkedin

License

Copyright 2014 DogmaLabs

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.

About

Small Android Library that provides Foreground View functionality to some Android Views

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%