├── shimmer.gif
├── shimmer
├── gradle.properties
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── res
│ │ └── values
│ │ │ └── attrs.xml
│ │ └── java
│ │ └── com
│ │ └── facebook
│ │ └── shimmer
│ │ ├── ShimmerFrameLayout.java
│ │ ├── ShimmerDrawable.java
│ │ └── Shimmer.java
├── build.gradle
└── BUCK
├── gradle
├── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
└── gradle-mvn-push.gradle
├── sample
├── src
│ └── main
│ │ ├── res
│ │ ├── drawable
│ │ │ ├── icon.png
│ │ │ ├── fb_logo.png
│ │ │ └── background.jpg
│ │ ├── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── layout
│ │ │ └── main.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── facebook
│ │ └── shimmer
│ │ └── sample
│ │ └── MainActivity.kt
└── build.gradle
├── .gitignore
├── settings.gradle
├── BUCK
├── gradle.properties
├── lib
└── support-annotations
│ └── BUCK
├── versions.gradle
├── LICENSE
├── README.md
├── .github
├── CONTRIBUTING.md
└── CODE_OF_CONDUCT.md
├── gradlew.bat
├── gradlew
└── .idea
└── codeStyleSettings.xml
/shimmer.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/shimmer-android/HEAD/shimmer.gif
--------------------------------------------------------------------------------
/shimmer/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Shimmer
2 | POM_ARTIFACT_ID=shimmer
3 | POM_PACKAGING=aar
4 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/shimmer-android/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/shimmer-android/HEAD/sample/src/main/res/drawable/icon.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/fb_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/shimmer-android/HEAD/sample/src/main/res/drawable/fb_logo.png
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/shimmer-android/HEAD/sample/src/main/res/drawable/background.jpg
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .idea
3 | !.idea/codeStyleSettings.xml
4 | .gradle
5 | gen
6 | local.properties
7 | buck-*
8 | .buckd
9 | out
10 | build
11 | .DS_Store
12 | _site
13 |
--------------------------------------------------------------------------------
/shimmer/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | @android:color/transparent
4 | #66000000
5 |
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Nov 03 21:30:45 KST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
7 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree.
7 | */
8 |
9 | include ':shimmer', ':sample'
10 |
--------------------------------------------------------------------------------
/BUCK:
--------------------------------------------------------------------------------
1 | load("//tools/build_defs/oss:shimmer_defs.bzl", "SHIMMER_TARGET", "fb_core_android_library")
2 |
3 | fb_core_android_library(
4 | name = "shimmer",
5 | visibility = ["PUBLIC"],
6 | deps = [
7 | SHIMMER_TARGET,
8 | ],
9 | exported_deps = [
10 | SHIMMER_TARGET,
11 | ],
12 | )
13 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Shimmer
4 | Facebook’s mission is to give people the power to build community and bring the world closer together.
5 | Presets
6 |
7 |
--------------------------------------------------------------------------------
/shimmer/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree.
7 | */
8 |
9 | apply plugin: 'com.android.library'
10 |
11 | android {
12 | compileSdkVersion versions.compileSdk
13 |
14 | defaultConfig {
15 | minSdkVersion versions.minSdk
16 | }
17 | }
18 |
19 | dependencies {
20 | implementation deps.androidXAnnotations
21 | }
22 |
23 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
24 |
--------------------------------------------------------------------------------
/shimmer/BUCK:
--------------------------------------------------------------------------------
1 | load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
2 | load("//tools/build_defs/oss:shimmer_defs.bzl", "SHIMMER_SUPPORT_ANNOTATIONS", "fb_core_android_library")
3 |
4 | fb_core_android_library(
5 | name = "shimmer",
6 | srcs = glob(["src/main/java/**/*.java"]),
7 | required_for_source_only_abi = True,
8 | visibility = ["PUBLIC"],
9 | deps = [
10 | ":res",
11 | SHIMMER_SUPPORT_ANNOTATIONS,
12 | ],
13 | )
14 |
15 | fb_native.android_resource(
16 | name = "res",
17 | package = "com.facebook.shimmer",
18 | res = "src/main/res",
19 | visibility = ["PUBLIC"],
20 | )
21 |
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | VERSION_NAME=0.6.0-SNAPSHOT
2 | GROUP=com.facebook.shimmer
3 |
4 | POM_DESCRIPTION=Shimmer effect for Android Views.
5 | POM_URL=http://facebook.github.io/shimmer-android
6 |
7 | POM_SCM_URL=https://github.com/facebook/shimmer-android.git
8 | POM_SCM_CONNECTION=scm:git@github.com:facebook/shimmer-android.git
9 | POM_SCM_DEV_CONNECTION=scm:git@github.com:facebook/shimmer-android.git
10 |
11 | POM_LICENCE_NAME=BSD 2-Clause License
12 | POM_LICENCE_URL=https://github.com/facebook/shimmer-android/blob/main/LICENSE
13 | POM_LICENCE_DIST=repo
14 |
15 | POM_DEVELOPER_ID=facebook
16 | POM_DEVELOPER_NAME=Facebook
17 |
18 | org.gradle.configureondemand=true
19 |
20 | android.useAndroidX=true
21 | android.enableJetifier=false
22 |
--------------------------------------------------------------------------------
/lib/support-annotations/BUCK:
--------------------------------------------------------------------------------
1 | load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
2 | load("//tools/build_defs/oss:shimmer_defs.bzl", "fb_core_android_library")
3 |
4 | fb_core_android_library(
5 | name = "support-annotations",
6 | visibility = ["PUBLIC"],
7 | exported_deps = [
8 | ":support-annotations-prebuilt",
9 | ],
10 | )
11 |
12 | fb_native.android_prebuilt_aar(
13 | name = "support-annotations-prebuilt",
14 | aar = ":support-annotations.aar",
15 | visibility = ["PUBLIC"],
16 | )
17 |
18 | fb_native.remote_file(
19 | name = "support-annotations.aar",
20 | sha1 = "39ded76b5e1ce1c5b2688e1d25cdc20ecee32007",
21 | url = "mvn:com.android.support:support-annotations:aar:27.1.0",
22 | )
23 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree.
7 | */
8 |
9 | plugins {
10 | id 'com.android.application'
11 | id 'kotlin-android'
12 | id 'kotlin-android-extensions'
13 | }
14 |
15 | android {
16 | compileSdkVersion versions.compileSdk
17 |
18 | defaultConfig {
19 | applicationId 'com.facebook.shimmer.sample'
20 | minSdkVersion versions.minSdk
21 | targetSdkVersion versions.targetSdk
22 | versionCode 1
23 | versionName '1.0'
24 | }
25 |
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_1_8
28 | targetCompatibility JavaVersion.VERSION_1_8
29 | }
30 |
31 | kotlinOptions {
32 | jvmTarget = '1.8'
33 | }
34 | }
35 |
36 | dependencies {
37 | implementation deps.shimmer
38 | implementation deps.kotlinStdlib
39 | implementation deps.constraintLayout
40 | }
41 |
--------------------------------------------------------------------------------
/versions.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree.
7 | */
8 |
9 | ext {
10 | versions = [
11 | targetSdk : 28,
12 | compileSdk : 28,
13 | minSdk : 14,
14 | buildTools : '28.0.3',
15 | kotlin : '1.4.10',
16 | androidGradlePlugin: '4.1.0',
17 | constraintLayout : '2.0.4',
18 | androidXAnnotations: '1.0.1',
19 | ]
20 |
21 | plugs = [
22 | "agp" : "com.android.tools.build:gradle:${versions.androidGradlePlugin}",
23 | "kotlin": "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
24 | ]
25 |
26 | deps = [
27 | shimmer : "com.facebook.shimmer:shimmer:$VERSION_NAME",
28 | kotlinStdlib : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}",
29 | constraintLayout : "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}",
30 | androidXAnnotations: "androidx.annotation:annotation:${versions.androidXAnnotations}",
31 | ]
32 | }
33 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD License
2 |
3 | For Shimmer-android software
4 |
5 | Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 |
13 | * Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | * Neither the name Meta nor the names of its contributors may be used to
18 | endorse or promote products derived from this software without specific
19 | prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/shimmer/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Shimmer for Android
4 |
5 |
6 |
7 | [Shimmer](http://facebook.github.io/shimmer-android) is an Android library that
8 | provides an easy way to add a shimmer effect to any view in your Android app.
9 |
10 | It is useful as an unobtrusive loading indicator, and was originally developed for Facebook Home.
11 |
12 | Find more examples and usage instructions over at:
13 |
14 | [facebook.github.io/shimmer-android](http://facebook.github.io/shimmer-android)
15 |
16 | ## License
17 |
18 | BSD License
19 |
20 | For Shimmer-android software
21 |
22 | Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
23 |
24 | Redistribution and use in source and binary forms, with or without modification,
25 | are permitted provided that the following conditions are met:
26 |
27 | * Redistributions of source code must retain the above copyright notice, this
28 | list of conditions and the following disclaimer.
29 |
30 | * Redistributions in binary form must reproduce the above copyright notice,
31 | this list of conditions and the following disclaimer in the documentation
32 | and/or other materials provided with the distribution.
33 |
34 | * Neither the name Meta nor the names of its contributors may be used to
35 | endorse or promote products derived from this software without specific
36 | prior written permission.
37 |
38 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
39 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
40 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
42 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
43 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
45 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
47 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to shimmer-android
2 | We want to make contributing to this project as easy and transparent as
3 | possible.
4 |
5 | ## Our Development Process
6 |
7 | Our internal repository, which is copied to GitHub, is our source of truth,
8 | and development happens both directly in GitHub and internally.
9 | Internally, we might build tools around this library that we might move
10 | into the GitHub repository in the future, but we won't fork for internal changes.
11 |
12 | This repository has two modules:
13 |
14 | * in `shimmer/` you'll find the shimmer library code that provides all the
15 | functionality that you would use in your app.
16 | * in `sample/` you'll find an example app that utilizes the library.
17 |
18 | ## Development set up
19 |
20 | It is important that you first install the snapshot version of the shimmer
21 | library before you can start developing. To do so, you can simply run
22 | `./gradlew shimmer:installArchives`. This will install the snapshot artifact to
23 | your local repository so you can work on the latest and greatest version.
24 |
25 | ## Pull Requests
26 | We actively welcome your pull requests.
27 |
28 | 1. Fork the repo and create your branch from `main`.
29 | 2. If you've added code that should be tested, add tests
30 | 3. If you've changed APIs, update the documentation.
31 | 4. Ensure the test suite passes.
32 | 5. Make sure your code lints.
33 | 6. If you haven't already, complete the Contributor License Agreement ("CLA").
34 |
35 | ## Contributor License Agreement ("CLA")
36 | In order to accept your pull request, we need you to submit a CLA. You only need
37 | to do this once to work on any of Facebook's open source projects.
38 |
39 | Complete your CLA here:
40 |
41 | ## Issues
42 | We use GitHub issues to track public bugs. Please ensure your description is
43 | clear and has sufficient instructions to be able to reproduce the issue.
44 |
45 | Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
46 | disclosure of security bugs. In those cases, please go through the process
47 | outlined on that page and do not file a public issue.
48 |
49 | ## Coding Style
50 | * We use Google's Java formatter (https://github.com/google/google-java-format)
51 | with default settings. Please use it to format your changes.
52 |
53 | ## License
54 | By contributing to shimmer-android, you agree that your contributions will be licensed
55 | under its BSD license.
56 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to make participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies within all project spaces, and it also applies when
49 | an individual is representing the project or its community in public spaces.
50 | Examples of representing a project or community include using an official
51 | project e-mail address, posting via an official social media account, or acting
52 | as an appointed representative at an online or offline event. Representation of
53 | a project may be further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at . All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
78 |
--------------------------------------------------------------------------------
/gradle/gradle-mvn-push.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | apply plugin: 'maven'
18 | apply plugin: 'signing'
19 |
20 | def isReleaseBuild() {
21 | return !VERSION_NAME.contains("SNAPSHOT")
22 | }
23 |
24 | def getRepositoryUsername() {
25 | return findProperty('repositoryUsername') ? property('repositoryUsername') : ""
26 | }
27 |
28 | def getRepositoryPassword() {
29 | return findProperty('repositoryPassword') ? property('repositoryPassword') : ""
30 | }
31 |
32 | def configurePom(pom) {
33 | pom.groupId = GROUP
34 | pom.artifactId = POM_ARTIFACT_ID
35 | pom.version = VERSION_NAME
36 |
37 | pom.project {
38 | name POM_NAME
39 | packaging POM_PACKAGING
40 | description POM_DESCRIPTION
41 | url POM_URL
42 |
43 | scm {
44 | url POM_SCM_URL
45 | connection POM_SCM_CONNECTION
46 | developerConnection POM_SCM_DEV_CONNECTION
47 | }
48 |
49 | licenses {
50 | license {
51 | name POM_LICENCE_NAME
52 | url POM_LICENCE_URL
53 | distribution POM_LICENCE_DIST
54 | }
55 | }
56 |
57 | developers {
58 | developer {
59 | id POM_DEVELOPER_ID
60 | name POM_DEVELOPER_NAME
61 | }
62 | }
63 | }
64 | }
65 |
66 | afterEvaluate { project ->
67 | uploadArchives {
68 | repositories {
69 | mavenDeployer {
70 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
71 |
72 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
73 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
74 | }
75 | snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
76 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
77 | }
78 |
79 | configurePom(pom)
80 | }
81 | }
82 | }
83 |
84 | task installArchives(type: Upload) {
85 | configuration = configurations.archives
86 | repositories {
87 | mavenDeployer {
88 | repository url: "file://${System.properties['user.home']}/.m2/repository"
89 | configurePom(pom)
90 | }
91 | }
92 | }
93 |
94 | signing {
95 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
96 | sign configurations.archives
97 | }
98 |
99 | task androidJavadocs(type: Javadoc) {
100 | source = android.sourceSets.main.java.srcDirs
101 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
102 | if (JavaVersion.current().isJava8Compatible()) {
103 | options.addStringOption('Xdoclint:none', '-quiet')
104 | }
105 | }
106 |
107 | task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
108 | classifier = 'javadoc'
109 | from androidJavadocs.destinationDir
110 | }
111 |
112 | task androidSourcesJar(type: Jar) {
113 | classifier = 'sources'
114 | from android.sourceSets.main.java.sourceFiles
115 | }
116 |
117 | artifacts {
118 | archives androidSourcesJar
119 | archives androidJavadocsJar
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
25 |
26 |
30 |
31 |
38 |
39 |
40 |
41 |
54 |
55 |
64 |
65 |
72 |
73 |
78 |
79 |
84 |
85 |
90 |
91 |
96 |
97 |
102 |
103 |
108 |
109 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/facebook/shimmer/sample/MainActivity.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree.
7 | */
8 |
9 | package com.facebook.shimmer.sample
10 |
11 | import android.animation.ValueAnimator
12 | import android.app.Activity
13 | import android.os.Bundle
14 | import android.view.View
15 | import android.widget.Button
16 | import android.widget.Toast
17 | import com.facebook.shimmer.Shimmer
18 | import com.facebook.shimmer.ShimmerFrameLayout
19 | import kotlinx.android.synthetic.main.main.*
20 |
21 | class MainActivity : Activity(), View.OnClickListener {
22 | private lateinit var shimmerViewContainer: ShimmerFrameLayout
23 | private lateinit var presetButtons: Array