Repository: h6ah4i/android-materialshadowninepatch
Branch: master
Commit: eb527faf693a
Files: 389
Total size: 258.6 KB
Directory structure:
gitextract_5tr75mf2/
├── .gitignore
├── LICENSE
├── NOTICE
├── README.md
├── RELEASE-NOTES.md
├── build.gradle
├── common/
│ ├── android-maven-publish.gradle
│ ├── android-set-common-properties.gradle
│ └── android-signing-utils.gradle
├── example/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── com/
│ │ └── h6ah4i/
│ │ └── android/
│ │ └── example/
│ │ └── materialshadowninepatch/
│ │ └── ApplicationTest.java
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── h6ah4i/
│ │ └── android/
│ │ └── example/
│ │ └── materialshadowninepatch/
│ │ ├── MainActivity.java
│ │ ├── ProgrammaticallyAddDemoActivity.java
│ │ ├── ProgrammaticallyAddDemoFragment.java
│ │ ├── ShadowStylesDemoActivity.java
│ │ ├── ShadowStylesDemoFragment.java
│ │ ├── XYPositionDemoActivity.java
│ │ ├── XYPositionDemoFragment.java
│ │ ├── ZPositionAnimationDemoActivity.java
│ │ ├── ZPositionAnimationDemoFragment.java
│ │ ├── ZPositionDemoActivity.java
│ │ └── ZPositionDemoFragment.java
│ └── res/
│ ├── layout/
│ │ ├── activity_demo_screen.xml
│ │ ├── activity_main.xml
│ │ ├── compat_shadow_items.xml
│ │ ├── debug_layout.xml
│ │ ├── fragment_programmatically_add_demo.xml
│ │ ├── fragment_shadow_styles_demo.xml
│ │ ├── fragment_xy_position_demo.xml
│ │ ├── fragment_z_position_animation_demo.xml
│ │ ├── fragment_z_position_demo.xml
│ │ └── native_shadow_items.xml
│ ├── values/
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ ├── styles.xml
│ │ └── values.xml
│ ├── values-v21/
│ │ └── values.xml
│ └── values-w820dp/
│ └── dimens.xml
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── library/
│ ├── .gitignore
│ ├── build.gradle
│ ├── library-data.properties
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── com/
│ │ └── h6ah4i/
│ │ └── android/
│ │ └── materialshadowninepatch/
│ │ └── ApplicationTest.java
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── h6ah4i/
│ │ └── android/
│ │ └── materialshadowninepatch/
│ │ ├── MaterialShadowContainerView.java
│ │ └── MaterialShadowContainerViewProperties.java
│ └── res/
│ ├── drawable-hdpi/
│ │ ├── ms9_ambient_shadow_z1.xml
│ │ ├── ms9_ambient_shadow_z10.xml
│ │ ├── ms9_ambient_shadow_z11.xml
│ │ ├── ms9_ambient_shadow_z12.xml
│ │ ├── ms9_ambient_shadow_z13.xml
│ │ ├── ms9_ambient_shadow_z14.xml
│ │ ├── ms9_ambient_shadow_z15.xml
│ │ ├── ms9_ambient_shadow_z16.xml
│ │ ├── ms9_ambient_shadow_z17.xml
│ │ ├── ms9_ambient_shadow_z18.xml
│ │ ├── ms9_ambient_shadow_z2.xml
│ │ ├── ms9_ambient_shadow_z3.xml
│ │ ├── ms9_ambient_shadow_z4.xml
│ │ ├── ms9_ambient_shadow_z5.xml
│ │ ├── ms9_ambient_shadow_z6.xml
│ │ ├── ms9_ambient_shadow_z7.xml
│ │ ├── ms9_ambient_shadow_z8.xml
│ │ ├── ms9_ambient_shadow_z9.xml
│ │ ├── ms9_composite_shadow_z1.xml
│ │ ├── ms9_composite_shadow_z2.xml
│ │ ├── ms9_composite_shadow_z3.xml
│ │ ├── ms9_composite_shadow_z4.xml
│ │ ├── ms9_composite_shadow_z5.xml
│ │ ├── ms9_composite_shadow_z6.xml
│ │ ├── ms9_composite_shadow_z7.xml
│ │ ├── ms9_composite_shadow_z8.xml
│ │ ├── ms9_composite_shadow_z9.xml
│ │ ├── ms9_spot_shadow_z1.xml
│ │ ├── ms9_spot_shadow_z10.xml
│ │ ├── ms9_spot_shadow_z11.xml
│ │ ├── ms9_spot_shadow_z12.xml
│ │ ├── ms9_spot_shadow_z13.xml
│ │ ├── ms9_spot_shadow_z14.xml
│ │ ├── ms9_spot_shadow_z15.xml
│ │ ├── ms9_spot_shadow_z16.xml
│ │ ├── ms9_spot_shadow_z17.xml
│ │ ├── ms9_spot_shadow_z18.xml
│ │ ├── ms9_spot_shadow_z2.xml
│ │ ├── ms9_spot_shadow_z3.xml
│ │ ├── ms9_spot_shadow_z4.xml
│ │ ├── ms9_spot_shadow_z5.xml
│ │ ├── ms9_spot_shadow_z6.xml
│ │ ├── ms9_spot_shadow_z7.xml
│ │ ├── ms9_spot_shadow_z8.xml
│ │ └── ms9_spot_shadow_z9.xml
│ ├── drawable-ldpi/
│ │ ├── ms9_ambient_shadow_z1.xml
│ │ ├── ms9_ambient_shadow_z10.xml
│ │ ├── ms9_ambient_shadow_z11.xml
│ │ ├── ms9_ambient_shadow_z12.xml
│ │ ├── ms9_ambient_shadow_z13.xml
│ │ ├── ms9_ambient_shadow_z14.xml
│ │ ├── ms9_ambient_shadow_z15.xml
│ │ ├── ms9_ambient_shadow_z16.xml
│ │ ├── ms9_ambient_shadow_z17.xml
│ │ ├── ms9_ambient_shadow_z18.xml
│ │ ├── ms9_ambient_shadow_z2.xml
│ │ ├── ms9_ambient_shadow_z3.xml
│ │ ├── ms9_ambient_shadow_z4.xml
│ │ ├── ms9_ambient_shadow_z5.xml
│ │ ├── ms9_ambient_shadow_z6.xml
│ │ ├── ms9_ambient_shadow_z7.xml
│ │ ├── ms9_ambient_shadow_z8.xml
│ │ ├── ms9_ambient_shadow_z9.xml
│ │ ├── ms9_composite_shadow_z1.xml
│ │ ├── ms9_composite_shadow_z2.xml
│ │ ├── ms9_composite_shadow_z3.xml
│ │ ├── ms9_composite_shadow_z4.xml
│ │ ├── ms9_composite_shadow_z5.xml
│ │ ├── ms9_composite_shadow_z6.xml
│ │ ├── ms9_composite_shadow_z7.xml
│ │ ├── ms9_composite_shadow_z8.xml
│ │ ├── ms9_composite_shadow_z9.xml
│ │ ├── ms9_spot_shadow_z1.xml
│ │ ├── ms9_spot_shadow_z10.xml
│ │ ├── ms9_spot_shadow_z11.xml
│ │ ├── ms9_spot_shadow_z12.xml
│ │ ├── ms9_spot_shadow_z13.xml
│ │ ├── ms9_spot_shadow_z14.xml
│ │ ├── ms9_spot_shadow_z15.xml
│ │ ├── ms9_spot_shadow_z16.xml
│ │ ├── ms9_spot_shadow_z17.xml
│ │ ├── ms9_spot_shadow_z18.xml
│ │ ├── ms9_spot_shadow_z2.xml
│ │ ├── ms9_spot_shadow_z3.xml
│ │ ├── ms9_spot_shadow_z4.xml
│ │ ├── ms9_spot_shadow_z5.xml
│ │ ├── ms9_spot_shadow_z6.xml
│ │ ├── ms9_spot_shadow_z7.xml
│ │ ├── ms9_spot_shadow_z8.xml
│ │ └── ms9_spot_shadow_z9.xml
│ ├── drawable-mdpi/
│ │ ├── ms9_ambient_shadow_z1.xml
│ │ ├── ms9_ambient_shadow_z10.xml
│ │ ├── ms9_ambient_shadow_z11.xml
│ │ ├── ms9_ambient_shadow_z12.xml
│ │ ├── ms9_ambient_shadow_z13.xml
│ │ ├── ms9_ambient_shadow_z14.xml
│ │ ├── ms9_ambient_shadow_z15.xml
│ │ ├── ms9_ambient_shadow_z16.xml
│ │ ├── ms9_ambient_shadow_z17.xml
│ │ ├── ms9_ambient_shadow_z18.xml
│ │ ├── ms9_ambient_shadow_z2.xml
│ │ ├── ms9_ambient_shadow_z3.xml
│ │ ├── ms9_ambient_shadow_z4.xml
│ │ ├── ms9_ambient_shadow_z5.xml
│ │ ├── ms9_ambient_shadow_z6.xml
│ │ ├── ms9_ambient_shadow_z7.xml
│ │ ├── ms9_ambient_shadow_z8.xml
│ │ ├── ms9_ambient_shadow_z9.xml
│ │ ├── ms9_composite_shadow_z1.xml
│ │ ├── ms9_composite_shadow_z2.xml
│ │ ├── ms9_composite_shadow_z3.xml
│ │ ├── ms9_composite_shadow_z4.xml
│ │ ├── ms9_composite_shadow_z5.xml
│ │ ├── ms9_composite_shadow_z6.xml
│ │ ├── ms9_composite_shadow_z7.xml
│ │ ├── ms9_composite_shadow_z8.xml
│ │ ├── ms9_composite_shadow_z9.xml
│ │ ├── ms9_spot_shadow_z1.xml
│ │ ├── ms9_spot_shadow_z10.xml
│ │ ├── ms9_spot_shadow_z11.xml
│ │ ├── ms9_spot_shadow_z12.xml
│ │ ├── ms9_spot_shadow_z13.xml
│ │ ├── ms9_spot_shadow_z14.xml
│ │ ├── ms9_spot_shadow_z15.xml
│ │ ├── ms9_spot_shadow_z16.xml
│ │ ├── ms9_spot_shadow_z17.xml
│ │ ├── ms9_spot_shadow_z18.xml
│ │ ├── ms9_spot_shadow_z2.xml
│ │ ├── ms9_spot_shadow_z3.xml
│ │ ├── ms9_spot_shadow_z4.xml
│ │ ├── ms9_spot_shadow_z5.xml
│ │ ├── ms9_spot_shadow_z6.xml
│ │ ├── ms9_spot_shadow_z7.xml
│ │ ├── ms9_spot_shadow_z8.xml
│ │ └── ms9_spot_shadow_z9.xml
│ ├── drawable-tvdpi/
│ │ ├── ms9_ambient_shadow_z1.xml
│ │ ├── ms9_ambient_shadow_z10.xml
│ │ ├── ms9_ambient_shadow_z11.xml
│ │ ├── ms9_ambient_shadow_z12.xml
│ │ ├── ms9_ambient_shadow_z13.xml
│ │ ├── ms9_ambient_shadow_z14.xml
│ │ ├── ms9_ambient_shadow_z15.xml
│ │ ├── ms9_ambient_shadow_z16.xml
│ │ ├── ms9_ambient_shadow_z17.xml
│ │ ├── ms9_ambient_shadow_z18.xml
│ │ ├── ms9_ambient_shadow_z2.xml
│ │ ├── ms9_ambient_shadow_z3.xml
│ │ ├── ms9_ambient_shadow_z4.xml
│ │ ├── ms9_ambient_shadow_z5.xml
│ │ ├── ms9_ambient_shadow_z6.xml
│ │ ├── ms9_ambient_shadow_z7.xml
│ │ ├── ms9_ambient_shadow_z8.xml
│ │ ├── ms9_ambient_shadow_z9.xml
│ │ ├── ms9_composite_shadow_z1.xml
│ │ ├── ms9_composite_shadow_z2.xml
│ │ ├── ms9_composite_shadow_z3.xml
│ │ ├── ms9_composite_shadow_z4.xml
│ │ ├── ms9_composite_shadow_z5.xml
│ │ ├── ms9_composite_shadow_z6.xml
│ │ ├── ms9_composite_shadow_z7.xml
│ │ ├── ms9_composite_shadow_z8.xml
│ │ ├── ms9_composite_shadow_z9.xml
│ │ ├── ms9_spot_shadow_z1.xml
│ │ ├── ms9_spot_shadow_z10.xml
│ │ ├── ms9_spot_shadow_z11.xml
│ │ ├── ms9_spot_shadow_z12.xml
│ │ ├── ms9_spot_shadow_z13.xml
│ │ ├── ms9_spot_shadow_z14.xml
│ │ ├── ms9_spot_shadow_z15.xml
│ │ ├── ms9_spot_shadow_z16.xml
│ │ ├── ms9_spot_shadow_z17.xml
│ │ ├── ms9_spot_shadow_z18.xml
│ │ ├── ms9_spot_shadow_z2.xml
│ │ ├── ms9_spot_shadow_z3.xml
│ │ ├── ms9_spot_shadow_z4.xml
│ │ ├── ms9_spot_shadow_z5.xml
│ │ ├── ms9_spot_shadow_z6.xml
│ │ ├── ms9_spot_shadow_z7.xml
│ │ ├── ms9_spot_shadow_z8.xml
│ │ └── ms9_spot_shadow_z9.xml
│ ├── drawable-xhdpi/
│ │ ├── ms9_ambient_shadow_z1.xml
│ │ ├── ms9_ambient_shadow_z10.xml
│ │ ├── ms9_ambient_shadow_z11.xml
│ │ ├── ms9_ambient_shadow_z12.xml
│ │ ├── ms9_ambient_shadow_z13.xml
│ │ ├── ms9_ambient_shadow_z14.xml
│ │ ├── ms9_ambient_shadow_z15.xml
│ │ ├── ms9_ambient_shadow_z16.xml
│ │ ├── ms9_ambient_shadow_z17.xml
│ │ ├── ms9_ambient_shadow_z18.xml
│ │ ├── ms9_ambient_shadow_z2.xml
│ │ ├── ms9_ambient_shadow_z3.xml
│ │ ├── ms9_ambient_shadow_z4.xml
│ │ ├── ms9_ambient_shadow_z5.xml
│ │ ├── ms9_ambient_shadow_z6.xml
│ │ ├── ms9_ambient_shadow_z7.xml
│ │ ├── ms9_ambient_shadow_z8.xml
│ │ ├── ms9_ambient_shadow_z9.xml
│ │ ├── ms9_composite_shadow_z1.xml
│ │ ├── ms9_composite_shadow_z2.xml
│ │ ├── ms9_composite_shadow_z3.xml
│ │ ├── ms9_composite_shadow_z4.xml
│ │ ├── ms9_composite_shadow_z5.xml
│ │ ├── ms9_composite_shadow_z6.xml
│ │ ├── ms9_composite_shadow_z7.xml
│ │ ├── ms9_composite_shadow_z8.xml
│ │ ├── ms9_composite_shadow_z9.xml
│ │ ├── ms9_spot_shadow_z1.xml
│ │ ├── ms9_spot_shadow_z10.xml
│ │ ├── ms9_spot_shadow_z11.xml
│ │ ├── ms9_spot_shadow_z12.xml
│ │ ├── ms9_spot_shadow_z13.xml
│ │ ├── ms9_spot_shadow_z14.xml
│ │ ├── ms9_spot_shadow_z15.xml
│ │ ├── ms9_spot_shadow_z16.xml
│ │ ├── ms9_spot_shadow_z17.xml
│ │ ├── ms9_spot_shadow_z18.xml
│ │ ├── ms9_spot_shadow_z2.xml
│ │ ├── ms9_spot_shadow_z3.xml
│ │ ├── ms9_spot_shadow_z4.xml
│ │ ├── ms9_spot_shadow_z5.xml
│ │ ├── ms9_spot_shadow_z6.xml
│ │ ├── ms9_spot_shadow_z7.xml
│ │ ├── ms9_spot_shadow_z8.xml
│ │ └── ms9_spot_shadow_z9.xml
│ ├── drawable-xxhdpi/
│ │ ├── ms9_ambient_shadow_z1.xml
│ │ ├── ms9_ambient_shadow_z10.xml
│ │ ├── ms9_ambient_shadow_z11.xml
│ │ ├── ms9_ambient_shadow_z12.xml
│ │ ├── ms9_ambient_shadow_z13.xml
│ │ ├── ms9_ambient_shadow_z14.xml
│ │ ├── ms9_ambient_shadow_z15.xml
│ │ ├── ms9_ambient_shadow_z16.xml
│ │ ├── ms9_ambient_shadow_z17.xml
│ │ ├── ms9_ambient_shadow_z18.xml
│ │ ├── ms9_ambient_shadow_z2.xml
│ │ ├── ms9_ambient_shadow_z3.xml
│ │ ├── ms9_ambient_shadow_z4.xml
│ │ ├── ms9_ambient_shadow_z5.xml
│ │ ├── ms9_ambient_shadow_z6.xml
│ │ ├── ms9_ambient_shadow_z7.xml
│ │ ├── ms9_ambient_shadow_z8.xml
│ │ ├── ms9_ambient_shadow_z9.xml
│ │ ├── ms9_composite_shadow_z1.xml
│ │ ├── ms9_composite_shadow_z2.xml
│ │ ├── ms9_composite_shadow_z3.xml
│ │ ├── ms9_composite_shadow_z4.xml
│ │ ├── ms9_composite_shadow_z5.xml
│ │ ├── ms9_composite_shadow_z6.xml
│ │ ├── ms9_composite_shadow_z7.xml
│ │ ├── ms9_composite_shadow_z8.xml
│ │ ├── ms9_composite_shadow_z9.xml
│ │ ├── ms9_spot_shadow_z1.xml
│ │ ├── ms9_spot_shadow_z10.xml
│ │ ├── ms9_spot_shadow_z11.xml
│ │ ├── ms9_spot_shadow_z12.xml
│ │ ├── ms9_spot_shadow_z13.xml
│ │ ├── ms9_spot_shadow_z14.xml
│ │ ├── ms9_spot_shadow_z15.xml
│ │ ├── ms9_spot_shadow_z16.xml
│ │ ├── ms9_spot_shadow_z17.xml
│ │ ├── ms9_spot_shadow_z18.xml
│ │ ├── ms9_spot_shadow_z2.xml
│ │ ├── ms9_spot_shadow_z3.xml
│ │ ├── ms9_spot_shadow_z4.xml
│ │ ├── ms9_spot_shadow_z5.xml
│ │ ├── ms9_spot_shadow_z6.xml
│ │ ├── ms9_spot_shadow_z7.xml
│ │ ├── ms9_spot_shadow_z8.xml
│ │ └── ms9_spot_shadow_z9.xml
│ ├── drawable-xxxhdpi/
│ │ ├── ms9_ambient_shadow_z1.xml
│ │ ├── ms9_ambient_shadow_z10.xml
│ │ ├── ms9_ambient_shadow_z11.xml
│ │ ├── ms9_ambient_shadow_z12.xml
│ │ ├── ms9_ambient_shadow_z13.xml
│ │ ├── ms9_ambient_shadow_z14.xml
│ │ ├── ms9_ambient_shadow_z15.xml
│ │ ├── ms9_ambient_shadow_z16.xml
│ │ ├── ms9_ambient_shadow_z17.xml
│ │ ├── ms9_ambient_shadow_z18.xml
│ │ ├── ms9_ambient_shadow_z2.xml
│ │ ├── ms9_ambient_shadow_z3.xml
│ │ ├── ms9_ambient_shadow_z4.xml
│ │ ├── ms9_ambient_shadow_z5.xml
│ │ ├── ms9_ambient_shadow_z6.xml
│ │ ├── ms9_ambient_shadow_z7.xml
│ │ ├── ms9_ambient_shadow_z8.xml
│ │ ├── ms9_ambient_shadow_z9.xml
│ │ ├── ms9_composite_shadow_z1.xml
│ │ ├── ms9_composite_shadow_z2.xml
│ │ ├── ms9_composite_shadow_z3.xml
│ │ ├── ms9_composite_shadow_z4.xml
│ │ ├── ms9_composite_shadow_z5.xml
│ │ ├── ms9_composite_shadow_z6.xml
│ │ ├── ms9_composite_shadow_z7.xml
│ │ ├── ms9_composite_shadow_z8.xml
│ │ ├── ms9_composite_shadow_z9.xml
│ │ ├── ms9_spot_shadow_z1.xml
│ │ ├── ms9_spot_shadow_z10.xml
│ │ ├── ms9_spot_shadow_z11.xml
│ │ ├── ms9_spot_shadow_z12.xml
│ │ ├── ms9_spot_shadow_z13.xml
│ │ ├── ms9_spot_shadow_z14.xml
│ │ ├── ms9_spot_shadow_z15.xml
│ │ ├── ms9_spot_shadow_z16.xml
│ │ ├── ms9_spot_shadow_z17.xml
│ │ ├── ms9_spot_shadow_z18.xml
│ │ ├── ms9_spot_shadow_z2.xml
│ │ ├── ms9_spot_shadow_z3.xml
│ │ ├── ms9_spot_shadow_z4.xml
│ │ ├── ms9_spot_shadow_z5.xml
│ │ ├── ms9_spot_shadow_z6.xml
│ │ ├── ms9_spot_shadow_z7.xml
│ │ ├── ms9_spot_shadow_z8.xml
│ │ └── ms9_spot_shadow_z9.xml
│ └── values/
│ ├── arrays.xml
│ ├── attrs.xml
│ └── styles.xml
├── resource/
│ ├── .gitignore
│ ├── README
│ ├── batch_inkscape_export.sh
│ ├── crop_ninepatch_valid_area.sh
│ ├── gen_alias_xml.py
│ ├── inkscape_export_obj.sh
│ ├── phase1_batch_inkscape_export.sh
│ ├── phase2_batch_crop_ninepatch_valid_area.sh
│ ├── phase3_batch_shrink_png_file.sh
│ ├── phase4_batch_gen_alias_xml.sh
│ ├── process_all.sh
│ └── shrink_png_file.sh
├── settings.gradle
└── signing/
├── .gitignore
├── README
├── example-signing.properties.template
└── library-maven-publish-signing.properties.template
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
/.gradle
/.idea
/build
/repository
/local.properties
*.iml
.DS_Store
*~
================================================
FILE: LICENSE
================================================
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: NOTICE
================================================
======================================================================
This library ("Material Shadow 9-Patch")
----------------------------------------------------------------------
Copyright (C) 2015 Haruki Hasegawa
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.
================================================
FILE: README.md
================================================
Material Shadow 9-Patch
===============
This library provides 9-patch based drop shadow for view elements. Works on API level 14 or later.
[](https://android-arsenal.com/details/1/1562)
[](https://maven-badges.herokuapp.com/maven-central/com.h6ah4i.android.widget.verticalseekbar/verticalseekbar)
---
---
Target platforms
---
- API level 14 or later
Latest version
---
- Version 1.0.0 (September 25, 2018)
Getting started
---
This library is published on Maven Central. Just add these lines to `build.gradle`.
```groovy
dependencies {
compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:1.0.0'
}
```
Usage
---
### Layout XML
```xml
```
### Java code
```java
MaterialShadowContainerView shadowView =
(MaterialShadowContainerView) findViewById(R.id.shadow_item_container);
float density = getResources().getDisplayMetrics().density;
shadowView.setShadowTranslationZ(density * 2.0f); // 2.0 dp
shadowView.setShadowElevation(density * 4.0f); // 4.0 dp
```
Advanced Usages
---
```xml
...
```
| Property name | Default | Description |
|----------------------------------|---------------------------------------|-------------------------------------------------------------------------|
| `ms9_shadowTranslationZ` | `0dp` | Compatibility version of `android:translationZ` |
| `ms9_shadowElevation` | `0dp` | Compatibility version of `android:elevation` |
| `ms9_forceUseCompatShadow` | `false` | Enforces to use compatibility shadow on Lollipop or later |
| `ms9_affectsDisplayedPosition` | `true` | Specify whether the shadow position is affected by the target view's position (emulates Lollipop's behavior) |
| `app:ms9_useAmbientShadow` | `true` | Specify whether to use ambient shadow |
| `app:ms9_useSpotShadow` | `true` | Specify whether to use spot shadow |
| `ms9_spotShadowDrawablesList` | `@array/ms9_spot_shadow_drawables` | Specify *Spot shadow (Key shadow)* 9-patch resources |
| `ms9_ambientShadowDrawablesList` | `@array/ms9_ambient_shadow_drawables` | Specify *Ambient shadow* 9-patch resources |
| Style name | |
|------------------------------------------------------|----------------------------------------------------------------------------|
| `ms9_DefaultShadowStyle([ Z6 or Z9 orZ18 ])` | Default style (uses spot & ambient shadow, position affects) |
| `ms9_DefaultShadowStyle([ Z6 or Z9 or Z18 ])CompatOnly` | Default style with `ms9_forceUseCompatShadow="true"` |
| `ms9_NoDisplayedPositionAffectShadowStyle([ Z6 or Z9 or Z18 ])` | No displayed position affects style |
| `ms9_NoDisplayedPositionAffectShadowStyle([ Z6 or Z9 or Z18 ])CompatOnly` | No displayed position affects style with `ms9_forceUseCompatShadow="true"` |
| `ms9_CompositeShadowStyle([ Z6 or Z9 ])` | Pre-composite shadow style (**less overdraws**) |
| `ms9_CompositeShadowStyle([ Z6 or Z9 ])CompatOnly` | Pre-composite shadow style with `ms9_forceUseCompatShadow="true"` |
*NOTE: You can specify `Z[6|9|18]` suffix for style names. This limits the deepest limit of shadow nine patch resources and it makes resource shrinking (`shrinkResources true`) work more effectively!*
License
---
This library is licensed under the [Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
See [`LICENSE`](LICENSE) for full of the license text.
Copyright (C) 2015 Haruki Hasegawa
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.
================================================
FILE: RELEASE-NOTES.md
================================================
## 1.0.0
- Migrate to AndroidX
- Change min API level to v14
## 0.6.5
- Shrunk PNG image files
- Add tools:shrinkMode="strict" to all drawable resources
## 0.6.4
- Added four-parameter constructor to MaterialShadowContainerView
- Add a new demo: "Programmatically add demo"
## 0.6.3
- Added new styles in order to make resource shrinking work more aggressively
## 0.6.2
- Added pre-composite nine patch resources
- Introduced `MaterialShadowContainerView` styles
## 0.6.1
- Fixed BadParcelableException issue (#5)
- Added `ms9_useAmbientShadow` property
- Added `ms9_useSpotShadow` property
## 0.6.0
- Added "ms9_" prefix for all attributes
- Added "ms9_forceUseCompatShadow" property
- Added `MaterialShadowContainerViewProperties` class
- Made `MaterialShadowContainerView` saves its state
- Improved demo app
## 0.5.0
- Initial release
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-rc03'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
================================================
FILE: common/android-maven-publish.gradle
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
apply plugin: 'maven'
apply plugin: 'signing'
// Declare these properties in project's extension
// - ext.mavenPublishDestDir = [path to destination directory]
// - ext.mavenPublishDataFile = [path to data properties file]
// - ext.mavenPublishSigningSetting = [path to signing info properties file] (optional)
def repoDir = project.mavenPublishDestDir
def dataProps = new Properties()
dataProps.load(project.file(project.mavenPublishDataFile).newDataInputStream())
task cleanDocsOutDir(type: Delete) {
delete project.docsDir
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
excludes += '**/BuildConfig.java'
excludes += '**/R.java'
options.encoding "utf-8"
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
afterEvaluate {
androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
}
signing {
// load 'keyId', 'password' and 'secretKeyRingFile'
def propsFile = project.file(project.mavenPublishSigningSetting)
if (propsFile.exists()) {
def props = new Properties()
props.load(propsFile.newDataInputStream())
if (props.keyId != null &&
props.password != null &&
props.secretKeyRingFile != null) {
project.ext.keyId = props.keyId
project.ext.password = props.password
project.ext.secretKeyRingFile = props.secretKeyRingFile
}
}
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "file://${repoDir}")
pom.groupId = dataProps.POM_GROUP_ID
pom.artifactId = dataProps.POM_ARTIFACT_ID
pom.version = dataProps.VERSION_NAME
pom.project {
licenses {
license {
name dataProps.POM_APACHE_V2_LICENCE_NAME
url dataProps.POM_APACHE_V2_LICENCE_URL
distribution dataProps.POM_APACHE_V2_LICENCE_DIST
}
}
scm {
url dataProps.POM_SCM_URL
connection dataProps.POM_SCM_CONNECTION
developerConnection dataProps.POM_SCM_DEVELOPER_CONNECTION
}
developers {
developer {
id dataProps.POM_DEVELOPER_ID
name dataProps.POM_DEVELOPER_NAME
}
}
}
}
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
================================================
FILE: common/android-set-common-properties.gradle
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
================================================
FILE: common/android-signing-utils.gradle
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
def loadSigningConfigFromPropertiesFile(project, signingConfig, propFileName) {
def props = new Properties()
def propFile = project.file(propFileName)
if (!propFile.exists()) {
return false
}
props.load(propFile.newDataInputStream())
if ((props.storeFile != null) &&
(props.storePassword != null) &&
(props.keyAlias != null) &&
(props.keyPassword != null)) {
signingConfig.storeFile = project.file(props.storeFile)
signingConfig.storePassword = props.storePassword
signingConfig.keyAlias = props.keyAlias
signingConfig.keyPassword = props.keyPassword
return true
} else {
return false
}
}
// Export methods by turning them into closures
ext {
loadSigningConfigFromPropertiesFile = this.&loadSigningConfigFromPropertiesFile
}
================================================
FILE: example/.gitignore
================================================
/build
================================================
FILE: example/build.gradle
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
apply plugin: 'com.android.application'
// Common configurations
apply from: '../common/android-set-common-properties.gradle'
apply from: '../common/android-signing-utils.gradle'
android {
compileSdkVersion 28
buildToolsVersion "28.0.2"
defaultConfig {
applicationId "com.h6ah4i.android.example.materialshadowninepatch"
minSdkVersion 14
targetSdkVersion 28
versionCode 7
versionName "1.0.0"
}
signingConfigs {
release
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
// load signing config from external properties file
if (loadSigningConfigFromPropertiesFile(
project, android.signingConfigs.release, '../signing/example-signing.properties')) {
android.buildTypes.release.signingConfig android.signingConfigs.release
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation project(':library')
}
================================================
FILE: example/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/hasegawa/Applications/android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
================================================
FILE: example/src/androidTest/java/com/h6ah4i/android/example/materialshadowninepatch/ApplicationTest.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* Testing Fundamentals
*/
public class ApplicationTest extends ApplicationTestCase {
public ApplicationTest() {
super(Application.class);
}
}
================================================
FILE: example/src/main/AndroidManifest.xml
================================================
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/MainActivity.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.button_z_position_demo).setOnClickListener(this);
findViewById(R.id.button_xy_position_demo).setOnClickListener(this);
findViewById(R.id.button_z_position_animation_demo).setOnClickListener(this);
findViewById(R.id.button_shadow_styles_demo).setOnClickListener(this);
findViewById(R.id.button_programmatically_add_demo).setOnClickListener(this);
/** {@link android.util.Property} is only available on API level 14 or later */
findViewById(R.id.button_z_position_animation_demo).setEnabled(
Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.button_z_position_demo:
launchActivity(ZPositionDemoActivity.class);
break;
case R.id.button_xy_position_demo:
launchActivity(XYPositionDemoActivity.class);
break;
case R.id.button_z_position_animation_demo:
launchActivity(ZPositionAnimationDemoActivity.class);
break;
case R.id.button_shadow_styles_demo:
launchActivity(ShadowStylesDemoActivity.class);
break;
case R.id.button_programmatically_add_demo:
launchActivity(ProgrammaticallyAddDemoActivity.class);
break;
default:
break;
}
}
private void launchActivity(Class extends Activity> activityClass) {
Intent intent = new Intent(this, activityClass);
startActivity(intent);
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ProgrammaticallyAddDemoActivity.java
================================================
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
/**
* Created by hasegawa on 9/13/15.
*/
public class ProgrammaticallyAddDemoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_screen);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ProgrammaticallyAddDemoFragment())
.commit();
}
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ProgrammaticallyAddDemoFragment.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.core.view.ViewCompat;
import androidx.appcompat.widget.AppCompatTextView;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView;
public class ProgrammaticallyAddDemoFragment
extends Fragment
implements View.OnClickListener,
CheckBox.OnCheckedChangeListener {
private CheckBox mCheckBoxForceUseCompatMode;
private LinearLayout mItemsContainer;
private Button mAddButton;
private Button mClearButton;
public ProgrammaticallyAddDemoFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_programmatically_add_demo, container, false);
mCheckBoxForceUseCompatMode = rootView.findViewById(R.id.checkbox_force_use_compat_mode);
mItemsContainer = rootView.findViewById(R.id.items_container);
mAddButton = rootView.findViewById(R.id.button_add);
mClearButton = rootView.findViewById(R.id.button_clear);
mCheckBoxForceUseCompatMode.setOnCheckedChangeListener(this);
mAddButton.setOnClickListener(this);
mClearButton.setOnClickListener(this);
return rootView;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.button_add:
addItem();
break;
case R.id.button_clear:
clearItems();
break;
}
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
switch (buttonView.getId()) {
case R.id.checkbox_force_use_compat_mode:
setForceCompatMode(isChecked);
break;
}
}
private void addItem() {
LinearLayout parent = mItemsContainer;
Context context = parent.getContext();
float density = context.getResources().getDisplayMetrics().density;
AppCompatTextView itemView = new AppCompatTextView(context);
// Need to specify type of the shadow. Specify one of the following to the fourth parameter.
//
// - R.style.ms9_DefaultShadowStyle[Z6|Z9|Z18]
// - R.style.ms9_DefaultShadowStyle[Z6|Z9|Z18]CompatOnly
// - R.style.ms9_NoDisplayedPositionAffectShadowStyle[Z6|Z9|Z18]
// - R.style.ms9_NoDisplayedPositionAffectShadowStyle[Z6|Z9|Z18]CompatOnly
// - R.style.ms9_CompositeShadowStyle[Z6|Z9|Z18]
// - R.style.ms9_CompositeShadowStyle[Z6|Z9|Z18]CompatOnly
MaterialShadowContainerView shadowView = new MaterialShadowContainerView(
context, null, 0, R.style.ms9_DefaultShadowStyle);
// Setup the itemView
{
MaterialShadowContainerView.LayoutParams layoutParams =
new MaterialShadowContainerView.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, (int) (density * 56));
// Need to set background color and margins
itemView.setBackgroundColor(Color.WHITE);
layoutParams.setMargins(
(int) (8 * density), (int) (8 * density),
(int) (8 * density), (int) (8 * density));
itemView.setLayoutParams(layoutParams);
itemView.setText("Item " + (parent.getChildCount() + 1));
itemView.setGravity(Gravity.CENTER);
}
// Setup the shadowView
{
LinearLayout.LayoutParams layoutParams =
new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
shadowView.setLayoutParams(layoutParams);
shadowView.setShadowElevation(density * 4);
shadowView.setForceUseCompatShadow(mCheckBoxForceUseCompatMode.isChecked());
}
// Add views
shadowView.addView(itemView);
parent.addView(shadowView);
}
private void clearItems() {
mItemsContainer.removeAllViews();
}
public void setForceCompatMode(boolean forceCompatMode) {
int n = mItemsContainer.getChildCount();
for (int i = 0; i < n; i++) {
MaterialShadowContainerView v = (MaterialShadowContainerView) mItemsContainer.getChildAt(i);
v.setForceUseCompatShadow(forceCompatMode);
}
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ShadowStylesDemoActivity.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class ShadowStylesDemoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_screen);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ShadowStylesDemoFragment())
.commit();
}
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ShadowStylesDemoFragment.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.core.view.ViewCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class ShadowStylesDemoFragment extends Fragment {
public ShadowStylesDemoFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_shadow_styles_demo, container, false);
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/XYPositionDemoActivity.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class XYPositionDemoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_screen);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new XYPositionDemoFragment())
.commit();
}
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/XYPositionDemoFragment.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.SeekBar;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView;
public class XYPositionDemoFragment
extends Fragment
implements View.OnClickListener,
CheckBox.OnCheckedChangeListener,
SeekBar.OnSeekBarChangeListener {
private static final int SEEKBAR_MAX = 1000;
private static final float MAX_Z_TRANSLATION = 9;
private static final int[] mCompatShadowItemIds = new int[]{
R.id.compat_shadow_item_top_left,
R.id.compat_shadow_item_top_center,
R.id.compat_shadow_item_top_right,
R.id.compat_shadow_item_center_left,
R.id.compat_shadow_item_center_center,
R.id.compat_shadow_item_center_right,
R.id.compat_shadow_item_bottom_left,
R.id.compat_shadow_item_bottom_center,
R.id.compat_shadow_item_bottom_right,
};
private static final int[] mCompatShadowItemContainerIds = new int[]{
R.id.compat_shadow_item_container_top_left,
R.id.compat_shadow_item_container_top_center,
R.id.compat_shadow_item_container_top_right,
R.id.compat_shadow_item_container_center_left,
R.id.compat_shadow_item_container_center_center,
R.id.compat_shadow_item_container_center_right,
R.id.compat_shadow_item_container_bottom_left,
R.id.compat_shadow_item_container_bottom_center,
R.id.compat_shadow_item_container_bottom_right,
};
private View[] mCompatShadowItems;
private MaterialShadowContainerView[] mCompatShadowItemContainers;
private SeekBar mSeekBarTranslationZ;
private CheckBox mCheckBoxForceUseCompatMode;
private CheckBox mCheckBoxEnableDisplayedPositionAffection;
private float mDisplayDensity;
public XYPositionDemoFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_xy_position_demo, container, false);
mDisplayDensity = getResources().getDisplayMetrics().density;
mSeekBarTranslationZ = rootView.findViewById(R.id.seekbar_translation_z);
mSeekBarTranslationZ.setOnSeekBarChangeListener(this);
mSeekBarTranslationZ.setMax(SEEKBAR_MAX);
mCheckBoxForceUseCompatMode = rootView.findViewById(R.id.checkbox_force_use_compat_mode);
mCheckBoxForceUseCompatMode.setOnCheckedChangeListener(this);
mCheckBoxEnableDisplayedPositionAffection = rootView.findViewById(R.id.checkbox_displayed_position_affection);
mCheckBoxEnableDisplayedPositionAffection.setOnCheckedChangeListener(this);
mCompatShadowItems = new View[mCompatShadowItemIds.length];
for (int i = 0; i < mCompatShadowItemIds.length; i++) {
mCompatShadowItems[i] = rootView.findViewById(mCompatShadowItemIds[i]);
}
mCompatShadowItemContainers = new MaterialShadowContainerView[mCompatShadowItemContainerIds.length];
for (int i = 0; i < mCompatShadowItemContainerIds.length; i++) {
mCompatShadowItemContainers[i] = rootView.findViewById(mCompatShadowItemContainerIds[i]);
}
if (savedInstanceState == null) {
mCheckBoxForceUseCompatMode.setChecked(true);
mCheckBoxEnableDisplayedPositionAffection.setChecked(true);
mSeekBarTranslationZ.setProgress(500);
setForceCompatMode(mCheckBoxForceUseCompatMode.isChecked());
setDisplayedPositionAffection(mCheckBoxEnableDisplayedPositionAffection.isChecked());
setItemsTranslationZ(progressToTranslationZAmount(mSeekBarTranslationZ.getProgress()));
}
return rootView;
}
@Override
public void onClick(View v) {
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
switch (buttonView.getId()) {
case R.id.checkbox_force_use_compat_mode:
setForceCompatMode(isChecked);
break;
case R.id.checkbox_displayed_position_affection:
setDisplayedPositionAffection(isChecked);
break;
}
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
switch (seekBar.getId()) {
case R.id.seekbar_translation_z:
if (fromUser) {
setItemsTranslationZ(progressToTranslationZAmount(progress));
}
break;
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
private float progressToTranslationZAmount(int progress) {
return MAX_Z_TRANSLATION * mDisplayDensity * progress / SEEKBAR_MAX;
}
public void setItemsTranslationZ(float amount) {
for (MaterialShadowContainerView v : mCompatShadowItemContainers) {
v.setShadowTranslationZ(amount);
}
}
public void setForceCompatMode(boolean forceCompatMode) {
for (MaterialShadowContainerView v : mCompatShadowItemContainers) {
v.setForceUseCompatShadow(forceCompatMode);
}
}
public void setDisplayedPositionAffection(boolean enabled) {
for (MaterialShadowContainerView v : mCompatShadowItemContainers) {
v.setDisplayedPositionAffectionEnabled(enabled);
}
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ZPositionAnimationDemoActivity.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class ZPositionAnimationDemoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_screen);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ZPositionAnimationDemoFragment())
.commit();
}
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ZPositionAnimationDemoFragment.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.CycleInterpolator;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerViewProperties;
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public class ZPositionAnimationDemoFragment
extends Fragment
implements View.OnClickListener,
CheckBox.OnCheckedChangeListener {
private float mDisplayDensity;
private View mCompatShadowItem;
private MaterialShadowContainerView mCompatShadowItemContainer;
private CheckBox mCheckBoxForceUseCompatMode;
public ZPositionAnimationDemoFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_z_position_animation_demo, container, false);
mDisplayDensity = getResources().getDisplayMetrics().density;
mCompatShadowItem = rootView.findViewById(R.id.compat_shadow_item);
mCompatShadowItem.setOnClickListener(this);
mCompatShadowItemContainer = rootView.findViewById(R.id.compat_shadow_item_container);
mCheckBoxForceUseCompatMode = rootView.findViewById(R.id.checkbox_force_use_compat_mode);
mCheckBoxForceUseCompatMode.setOnCheckedChangeListener(this);
return rootView;
}
@Override
public void onClick(View v) {
if (v == mCompatShadowItem) {
ObjectAnimator animator = ObjectAnimator.ofFloat(
mCompatShadowItemContainer,
MaterialShadowContainerViewProperties.SHADOW_TRANSLATION_Z,
mDisplayDensity * 0.0f, mDisplayDensity * 8.0f);
animator.setDuration(500);
animator.setInterpolator(new CycleInterpolator(0.5f));
animator.start();
}
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
switch (buttonView.getId()) {
case R.id.checkbox_force_use_compat_mode:
setForceCompatMode(isChecked);
break;
}
}
public void setForceCompatMode(boolean forceCompatMode) {
mCompatShadowItemContainer.setForceUseCompatShadow(forceCompatMode);
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ZPositionDemoActivity.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class ZPositionDemoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_screen);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ZPositionDemoFragment())
.commit();
}
}
}
================================================
FILE: example/src/main/java/com/h6ah4i/android/example/materialshadowninepatch/ZPositionDemoFragment.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.example.materialshadowninepatch;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.core.view.ViewCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.SeekBar;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView;
public class ZPositionDemoFragment
extends Fragment
implements View.OnClickListener,
CheckBox.OnCheckedChangeListener,
SeekBar.OnSeekBarChangeListener {
private static final int SEEKBAR_MAX = 1000;
private static final float MAX_TRANSLATION_Z = 9;
private static final int[] mNativeShadowItemIds = new int[]{
R.id.native_shadow_item_z0,
R.id.native_shadow_item_z1,
R.id.native_shadow_item_z2,
R.id.native_shadow_item_z3,
R.id.native_shadow_item_z4,
R.id.native_shadow_item_z5,
R.id.native_shadow_item_z6,
R.id.native_shadow_item_z7,
R.id.native_shadow_item_z8,
R.id.native_shadow_item_z9,
};
private static final int[] mCompatShadowItemIds = new int[]{
R.id.compat_shadow_item_z0,
R.id.compat_shadow_item_z1,
R.id.compat_shadow_item_z2,
R.id.compat_shadow_item_z3,
R.id.compat_shadow_item_z4,
R.id.compat_shadow_item_z5,
R.id.compat_shadow_item_z6,
R.id.compat_shadow_item_z7,
R.id.compat_shadow_item_z8,
R.id.compat_shadow_item_z9,
};
private static final int[] mCompatShadowItemContainerIds = new int[]{
R.id.compat_shadow_item_container_z0,
R.id.compat_shadow_item_container_z1,
R.id.compat_shadow_item_container_z2,
R.id.compat_shadow_item_container_z3,
R.id.compat_shadow_item_container_z4,
R.id.compat_shadow_item_container_z5,
R.id.compat_shadow_item_container_z6,
R.id.compat_shadow_item_container_z7,
R.id.compat_shadow_item_container_z8,
R.id.compat_shadow_item_container_z9,
};
private View[] mNativeShadowItems;
private View[] mCompatShadowItems;
private MaterialShadowContainerView[] mCompatShadowItemContainers;
private SeekBar mSeekBarElevation;
private CheckBox mCheckBoxForceUseCompatMode;
private float mDisplayDensity;
public ZPositionDemoFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_z_position_demo, container, false);
mDisplayDensity = getResources().getDisplayMetrics().density;
mSeekBarElevation = rootView.findViewById(R.id.seekbar_translation_z);
mSeekBarElevation.setOnSeekBarChangeListener(this);
mSeekBarElevation.setMax(SEEKBAR_MAX);
mCheckBoxForceUseCompatMode = rootView.findViewById(R.id.checkbox_force_use_compat_mode);
mCheckBoxForceUseCompatMode.setOnCheckedChangeListener(this);
mNativeShadowItems = new View[mNativeShadowItemIds.length];
for (int i = 0; i < mNativeShadowItemIds.length; i++) {
mNativeShadowItems[i] = rootView.findViewById(mNativeShadowItemIds[i]);
}
mCompatShadowItems = new View[mCompatShadowItemIds.length];
for (int i = 0; i < mCompatShadowItemIds.length; i++) {
mCompatShadowItems[i] = rootView.findViewById(mCompatShadowItemIds[i]);
}
mCompatShadowItemContainers = new MaterialShadowContainerView[mCompatShadowItemContainerIds.length];
for (int i = 0; i < mCompatShadowItemContainerIds.length; i++) {
mCompatShadowItemContainers[i] = rootView.findViewById(mCompatShadowItemContainerIds[i]);
}
return rootView;
}
@Override
public void onClick(View v) {
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
switch (buttonView.getId()) {
case R.id.checkbox_force_use_compat_mode:
setForceCompatMode(isChecked);
break;
}
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
switch (seekBar.getId()) {
case R.id.seekbar_translation_z:
if (fromUser) {
setItemsTranslationZ(progressToTranslationZAmount(progress));
}
break;
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
private float progressToTranslationZAmount(int progress) {
return MAX_TRANSLATION_Z * mDisplayDensity * progress / SEEKBAR_MAX;
}
public void setItemsTranslationZ(float amount) {
for (View v : mNativeShadowItems) {
ViewCompat.setTranslationZ(v, amount);
}
for (MaterialShadowContainerView v : mCompatShadowItemContainers) {
v.setShadowTranslationZ(amount);
}
}
public void setForceCompatMode(boolean forceCompatMode) {
for (MaterialShadowContainerView v : mCompatShadowItemContainers) {
v.setForceUseCompatShadow(forceCompatMode);
}
}
}
================================================
FILE: example/src/main/res/layout/activity_demo_screen.xml
================================================
================================================
FILE: example/src/main/res/layout/activity_main.xml
================================================
================================================
FILE: example/src/main/res/layout/compat_shadow_items.xml
================================================
================================================
FILE: example/src/main/res/layout/debug_layout.xml
================================================
================================================
FILE: example/src/main/res/layout/fragment_programmatically_add_demo.xml
================================================
================================================
FILE: example/src/main/res/layout/fragment_shadow_styles_demo.xml
================================================
================================================
FILE: example/src/main/res/layout/fragment_xy_position_demo.xml
================================================
================================================
FILE: example/src/main/res/layout/fragment_z_position_animation_demo.xml
================================================
================================================
FILE: example/src/main/res/layout/fragment_z_position_demo.xml
================================================
================================================
FILE: example/src/main/res/layout/native_shadow_items.xml
================================================
================================================
FILE: example/src/main/res/values/dimens.xml
================================================
16dp16dp
================================================
FILE: example/src/main/res/values/strings.xml
================================================
Material Shadow 9-PatchZ position demoXY position demoZ position animation demoShadow styles demoProgrammatically add demo
================================================
FILE: example/src/main/res/values/styles.xml
================================================
================================================
FILE: example/src/main/res/values/values.xml
================================================
false
================================================
FILE: example/src/main/res/values-v21/values.xml
================================================
true
================================================
FILE: example/src/main/res/values-w820dp/dimens.xml
================================================
64dp
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
================================================
FILE: gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: library/.gitignore
================================================
/build
================================================
FILE: library/build.gradle
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
apply plugin: 'com.android.library'
ext {
// required for 'android-maven-publish.gradle'
mavenPublishDestDir = new File(rootDir, "repository").absolutePath
mavenPublishDataFile = file('./library-data.properties').absolutePath
mavenPublishSigningSetting = file('../signing/library-maven-publish-signing.properties').absolutePath
}
// Common configurations
apply from: '../common/android-set-common-properties.gradle'
android {
resourcePrefix 'ms9_'
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
def dataProps = new Properties()
dataProps.load(project.file(project.mavenPublishDataFile).newDataInputStream())
versionCode dataProps.VERSION_CODE.toInteger()
versionName dataProps.VERSION_NAME
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
consumerProguardFiles 'proguard-rules.pro'
}
debug {
minifyEnabled false
shrinkResources false
consumerProguardFiles 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'androidx.core:core:1.0.0'
}
// NOTE: this line should be place at end of the file
apply from: '../common/android-maven-publish.gradle'
================================================
FILE: library/library-data.properties
================================================
# common
VERSION_NAME=1.0.0
VERSION_CODE=8
# for maven-publish
POM_GROUP_ID=com.h6ah4i.android.materialshadowninepatch
POM_ARTIFACT_ID=materialshadowninepatch
POM_APACHE_V2_LICENCE_NAME=The Apache Software License, Version 2.0
POM_APACHE_V2_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_APACHE_V2_LICENCE_DIST=repo
POM_DEVELOPER_ID=h6ah4i
POM_DEVELOPER_NAME=Haruki Hasegawa
POM_SCM_URL=https://github.com/h6ah4i/android-materialshadowninepatch
POM_SCM_CONNECTION=git:https://github.com/h6ah4i/android-materialshadowninepatch.git
POM_SCM_DEVELOPER_CONNECTION=git:git@github.com:h6ah4i/android-materialshadowninepatch.git
================================================
FILE: library/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/hasegawa/Applications/android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
================================================
FILE: library/src/androidTest/java/com/h6ah4i/android/materialshadowninepatch/ApplicationTest.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.materialshadowninepatch;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* Testing Fundamentals
*/
public class ApplicationTest extends ApplicationTestCase {
public ApplicationTest() {
super(Application.class);
}
}
================================================
FILE: library/src/main/AndroidManifest.xml
================================================
================================================
FILE: library/src/main/java/com/h6ah4i/android/materialshadowninepatch/MaterialShadowContainerView.java
================================================
/*
* Copyright (C) 2015 Haruki Hasegawa
*
* 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.
*/
package com.h6ah4i.android.materialshadowninepatch;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.core.view.ViewCompat;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
public class MaterialShadowContainerView extends FrameLayout {
private static final String TAG = "ShadowContainerView";
private static final float SPOT_SHADOW_X_TRANSLATION_AMOUNT_COEFFICIENT = 0.0002f;
private static final float SPOT_SHADOW_Y_TRANSLATION_AMOUNT_COEFFICIENT = 0.002f;
private static final float NON_POSITION_AWARE_SPOT_SHADOW_Y_TRANSLATION_AMOUNT_COEFFICIENT = 0.2f;
private float mDisplayDensity;
private float mInvDisplayDensity;
private int mLightPositionX;
private int mLightPositionY;
private int mSpotShadowTranslationX;
private int mSpotShadowTranslationY;
private float mShadowTranslationZ = 0;
private float mShadowElevation = 0;
private boolean mAffectsDisplayedPosition = true;
private boolean mForceUseCompatShadow = false;
private boolean mUseAmbientShadow = true;
private boolean mUseSpotShadow = true;
private int[] mSpotShadowResourcesIdList;
private int[] mAmbientShadowResourcesIdList;
private int mMaxSpotShadowLevel;
private int mMaxAmbientShadowLevel;
private int mCurrentSpotShadowDrawable1ResId;
private NinePatchDrawable mCurrentSpotShadowDrawable1;
private int mCurrentSpotShadowDrawable2ResId;
private NinePatchDrawable mCurrentSpotShadowDrawable2;
private int mCurrentAmbientShadowDrawable1ResId;
private NinePatchDrawable mCurrentAmbientShadowDrawable1;
private int mCurrentAmbientShadowDrawable2ResId;
private NinePatchDrawable mCurrentAmbientShadowDrawable2;
private Rect mTempRect = new Rect();
private int[] mTmpLocations = new int[2];
public MaterialShadowContainerView(Context context) {
this(context, null, 0);
}
public MaterialShadowContainerView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public MaterialShadowContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
public MaterialShadowContainerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr);
final TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.ms9_MaterialShadowContainerView, defStyleAttr, defStyleRes);
final float shadowTranslationZ = ta.getDimension(R.styleable.ms9_MaterialShadowContainerView_ms9_shadowTranslationZ, mShadowTranslationZ);
final float shadowElevation = ta.getDimension(R.styleable.ms9_MaterialShadowContainerView_ms9_shadowElevation, mShadowElevation);
final int spotShadowLevelListResId = ta.getResourceId(R.styleable.ms9_MaterialShadowContainerView_ms9_spotShadowDrawablesList, 0);
final int ambientShadowLevelListResId = ta.getResourceId(R.styleable.ms9_MaterialShadowContainerView_ms9_ambientShadowDrawablesList, 0);
final boolean forceUseCompatShadow = ta.getBoolean(R.styleable.ms9_MaterialShadowContainerView_ms9_forceUseCompatShadow, mForceUseCompatShadow);
final boolean affectsXYPosition = ta.getBoolean(R.styleable.ms9_MaterialShadowContainerView_ms9_affectsDisplayedPosition, mAffectsDisplayedPosition);
final boolean useAmbientShadow = ta.getBoolean(R.styleable.ms9_MaterialShadowContainerView_ms9_useAmbientShadow, mUseAmbientShadow);
final boolean useSpotShadow = ta.getBoolean(R.styleable.ms9_MaterialShadowContainerView_ms9_useSpotShadow, mUseSpotShadow);
ta.recycle();
mSpotShadowResourcesIdList = getResourceIdArray(getResources(), spotShadowLevelListResId);
mAmbientShadowResourcesIdList = getResourceIdArray(getResources(), ambientShadowLevelListResId);
mMaxSpotShadowLevel = getMaxShadowLevel(mSpotShadowResourcesIdList);
mMaxAmbientShadowLevel = getMaxShadowLevel(mAmbientShadowResourcesIdList);
mDisplayDensity = getResources().getDisplayMetrics().density;
mInvDisplayDensity = 1.0f / mDisplayDensity;
mShadowTranslationZ = shadowTranslationZ;
mShadowElevation = shadowElevation;
mForceUseCompatShadow = forceUseCompatShadow;
mAffectsDisplayedPosition = affectsXYPosition;
mUseAmbientShadow = useAmbientShadow;
mUseSpotShadow = useSpotShadow;
updateShadowLevel(true);
}
@Override
protected Parcelable onSaveInstanceState() {
Parcelable superState = super.onSaveInstanceState();
SavedState s = new SavedState(superState);
s.shadowElevation = mShadowElevation;
s.shadowTranslationZ = mShadowTranslationZ;
s.affectsDisplayedPosition = mAffectsDisplayedPosition;
s.forceUseCompatShadow = mForceUseCompatShadow;
s.useAmbientShadow = mUseAmbientShadow;
s.useSpotShadow = mUseSpotShadow;
return s;
}
@Override
protected void onRestoreInstanceState(Parcelable state) {
if (!(state instanceof SavedState)) {
super.onRestoreInstanceState(state);
return;
}
SavedState s = (SavedState) state;
super.onRestoreInstanceState(s.getSuperState());
mShadowElevation = s.shadowElevation;
mShadowTranslationZ = s.shadowTranslationZ;
mAffectsDisplayedPosition = s.affectsDisplayedPosition;
mForceUseCompatShadow = s.forceUseCompatShadow;
mUseAmbientShadow = s.useAmbientShadow;
mUseSpotShadow = s.useSpotShadow;
updateShadowLevel(true);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if ((getChildCount() > 0) && (getChildAt(0).getVisibility() == View.VISIBLE)) {
if (mUseAmbientShadow) {
if (mCurrentAmbientShadowDrawable1 != null) {
mCurrentAmbientShadowDrawable1.draw(canvas);
}
if (mCurrentAmbientShadowDrawable2 != null) {
mCurrentAmbientShadowDrawable2.draw(canvas);
}
}
if (mUseSpotShadow && (mCurrentSpotShadowDrawable1 != null || mCurrentSpotShadowDrawable2 != null)) {
final int savedCount = canvas.save();
canvas.translate(mSpotShadowTranslationX, mSpotShadowTranslationY);
if (mCurrentSpotShadowDrawable1 != null) {
mCurrentSpotShadowDrawable1.draw(canvas);
}
if (mCurrentSpotShadowDrawable2 != null) {
mCurrentSpotShadowDrawable2.draw(canvas);
}
canvas.restoreToCount(savedCount);
}
}
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
updateShadowDrawableBounds();
updateSpotShadowPosition();
}
public void setShadowTranslationZ(float translationZ) {
if (mShadowTranslationZ == translationZ) {
return;
}
mShadowTranslationZ = translationZ;
updateShadowLevel(false);
}
public float getShadowTranslationZ() {
return mShadowTranslationZ;
}
public void setShadowElevation(float elevation) {
if (mShadowElevation == elevation) {
return;
}
mShadowElevation = elevation;
updateShadowLevel(false);
}
public float getShadowElevation() {
return mShadowElevation;
}
public void setDisplayedPositionAffectionEnabled(boolean enabled) {
if (mAffectsDisplayedPosition == enabled) {
return;
}
mAffectsDisplayedPosition = enabled;
if (useCompatShadow()) {
updateShadowLevel(true);
}
}
public boolean isDisplayedPositionAffectionEnabled() {
return mAffectsDisplayedPosition;
}
public void setForceUseCompatShadow(boolean forceUseCompatShadow) {
if (mForceUseCompatShadow == forceUseCompatShadow) {
return;
}
final boolean prevUseCompatShadow = useCompatShadow();
mForceUseCompatShadow = forceUseCompatShadow;
final boolean curUseCompatShadow = useCompatShadow();
if (prevUseCompatShadow != curUseCompatShadow) {
// disable native shadow
if (curUseCompatShadow && supportsNativeShadow()) {
updateShadowLevelNative(0.0f, 0.0f, true);
}
// apply
updateShadowLevel(true);
}
}
public boolean useCompatShadow() {
if (!supportsNativeShadow()) {
return true;
} else {
return mForceUseCompatShadow;
}
}
public boolean useAmbientShadow() {
return mUseAmbientShadow;
}
public void setUseAmbientShadow(boolean useAmbientShadow) {
if (mUseAmbientShadow == useAmbientShadow) {
return;
}
mUseAmbientShadow = useAmbientShadow;
// invalidate
if (!updateWillNotDraw()) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
public boolean useSpotShadow() {
return mUseSpotShadow;
}
public void setUseSpotShadow(boolean useSpotShadow) {
if (mUseSpotShadow == useSpotShadow) {
return;
}
mUseSpotShadow = useSpotShadow;
// invalidate
if (!updateWillNotDraw()) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
public static boolean supportsNativeShadow() {
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP);
}
private static int getMaxShadowLevel(int[] shadowDrawableResIds) {
return (shadowDrawableResIds != null) ? Math.max(0, shadowDrawableResIds.length - 1) : 0;
}
private NinePatchDrawable getNinePatchDrawableFromResource(int resId) {
final Drawable drawable = (resId != 0) ? getResources().getDrawable(resId) : null;
if (drawable instanceof NinePatchDrawable) {
return (NinePatchDrawable) drawable;
} else {
return null;
}
}
private void updateShadowLevelCompat(float translationZ, float elevation, boolean force) {
final float floatLevel = Math.max((translationZ + elevation) * mInvDisplayDensity, 0.0f);
final int intLevel = (int) floatLevel;
final int spotLevel1 = Math.min(intLevel, mMaxSpotShadowLevel);
final int spotLevel2 = Math.min(intLevel + 1, mMaxSpotShadowLevel);
final int ambientLevel1 = Math.min(intLevel, mMaxAmbientShadowLevel);
final int ambientLevel2 = Math.min(intLevel + 1, mMaxAmbientShadowLevel);
// update drawable
final int spotShadow1ResId = (mSpotShadowResourcesIdList != null) ? mSpotShadowResourcesIdList[spotLevel1] : 0;
final int spotShadow2ResId = (mSpotShadowResourcesIdList != null) ? mSpotShadowResourcesIdList[spotLevel2] : 0;
final int ambientShadow1ResId = (mAmbientShadowResourcesIdList != null) ? mAmbientShadowResourcesIdList[ambientLevel1] : 0;
final int ambientShadow2ResId = (mAmbientShadowResourcesIdList != null) ? mAmbientShadowResourcesIdList[ambientLevel2] : 0;
if (force ||
spotShadow1ResId != mCurrentSpotShadowDrawable1ResId ||
spotShadow2ResId != mCurrentSpotShadowDrawable2ResId ||
ambientShadow1ResId != mCurrentAmbientShadowDrawable1ResId ||
ambientShadow2ResId != mCurrentAmbientShadowDrawable2ResId) {
if (spotShadow1ResId != mCurrentSpotShadowDrawable1ResId) {
mCurrentSpotShadowDrawable1 = getNinePatchDrawableFromResource(spotShadow1ResId);
mCurrentSpotShadowDrawable1ResId = spotShadow1ResId;
}
if (spotShadow2ResId != mCurrentSpotShadowDrawable2ResId) {
mCurrentSpotShadowDrawable2 = (spotShadow2ResId == spotShadow1ResId) ? null : getNinePatchDrawableFromResource(spotShadow2ResId);
mCurrentSpotShadowDrawable2ResId = (spotShadow2ResId == spotShadow1ResId) ? 0 : spotShadow2ResId;
}
if (ambientShadow1ResId != mCurrentAmbientShadowDrawable1ResId) {
mCurrentAmbientShadowDrawable1 = getNinePatchDrawableFromResource(ambientShadow1ResId);
mCurrentAmbientShadowDrawable1ResId = ambientShadow1ResId;
}
if (ambientShadow2ResId != mCurrentAmbientShadowDrawable2ResId) {
mCurrentAmbientShadowDrawable2 = (ambientShadow2ResId == ambientShadow1ResId) ? null : getNinePatchDrawableFromResource(ambientShadow2ResId);
mCurrentAmbientShadowDrawable2ResId = (ambientShadow2ResId == ambientShadow1ResId) ? 0 : ambientShadow2ResId;
}
updateShadowDrawableBounds();
updateSpotShadowPosition();
updateWillNotDraw();
}
// update alpha
final int alpha1 = 255 - Math.min(Math.max((int) ((floatLevel - intLevel) * 255 + 0.5f), 0), 255);
final int alpha2 = 255 - alpha1;
if (mCurrentSpotShadowDrawable1 != null) {
if (mCurrentSpotShadowDrawable2 != null) {
mCurrentSpotShadowDrawable1.setAlpha(alpha1);
} else {
mCurrentSpotShadowDrawable1.setAlpha(255);
}
}
if (mCurrentSpotShadowDrawable2 != null) {
mCurrentSpotShadowDrawable2.setAlpha(alpha2);
}
if (mCurrentAmbientShadowDrawable1 != null) {
if (mCurrentAmbientShadowDrawable2 != null) {
mCurrentAmbientShadowDrawable1.setAlpha(alpha1);
} else {
mCurrentAmbientShadowDrawable1.setAlpha(255);
}
}
if (mCurrentAmbientShadowDrawable2 != null) {
mCurrentAmbientShadowDrawable2.setAlpha(alpha2);
}
// invalidate
if (!willNotDraw()) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
private void updateShadowLevel(boolean force) {
if (useCompatShadow()) {
updateShadowLevelCompat(mShadowTranslationZ, mShadowElevation, force);
} else {
updateShadowLevelNative(mShadowTranslationZ, mShadowElevation, force);
}
}
private void updateShadowLevelNative(float translationZ, float elevation, boolean force) {
if (force) {
mCurrentSpotShadowDrawable1 = null;
mCurrentSpotShadowDrawable1ResId = 0;
mCurrentSpotShadowDrawable2 = null;
mCurrentSpotShadowDrawable2ResId = 0;
mCurrentAmbientShadowDrawable1 = null;
mCurrentAmbientShadowDrawable1ResId = 0;
mCurrentAmbientShadowDrawable2 = null;
mCurrentAmbientShadowDrawable2ResId = 0;
updateWillNotDraw();
}
final View childView = (getChildCount() > 0) ? getChildAt(0) : null;
if (childView != null) {
ViewCompat.setTranslationZ(childView, translationZ);
ViewCompat.setElevation(childView, elevation);
}
}
private boolean updateWillNotDraw() {
boolean drawAmbientShadow = (mUseAmbientShadow && (mCurrentAmbientShadowDrawable1 != null || mCurrentAmbientShadowDrawable2 != null));
boolean drawSpotShadow = (mUseSpotShadow && (mCurrentSpotShadowDrawable1 != null || mCurrentSpotShadowDrawable2 != null));
boolean willNotDraw =
!drawAmbientShadow &&
!drawSpotShadow &&
(getBackground() == null) &&
(getForeground() == null);
setWillNotDraw(willNotDraw);
return willNotDraw;
}
private void updateShadowDrawableBounds() {
if (getChildCount() <= 0) {
return;
}
final View childView = getChildAt(0);
final int childLeft = childView.getLeft();
final int childTop = childView.getTop();
final int childRight = childView.getRight();
final int childBottom = childView.getBottom();
updateNinePatchBounds(mCurrentSpotShadowDrawable1, childLeft, childTop, childRight, childBottom);
if (mCurrentAmbientShadowDrawable1 != mCurrentSpotShadowDrawable2) {
updateNinePatchBounds(mCurrentSpotShadowDrawable2, childLeft, childTop, childRight, childBottom);
}
updateNinePatchBounds(mCurrentAmbientShadowDrawable1, childLeft, childTop, childRight, childBottom);
if (mCurrentAmbientShadowDrawable1 != mCurrentAmbientShadowDrawable2) {
updateNinePatchBounds(mCurrentAmbientShadowDrawable2, childLeft, childTop, childRight, childBottom);
}
}
private void updateNinePatchBounds(NinePatchDrawable ninePatch, int childLeft, int childTop, int childRight, int childBottom) {
if (ninePatch == null) {
return;
}
final Rect t = mTempRect;
ninePatch.getPadding(t);
ninePatch.setBounds(
childLeft - t.left, childTop - t.top,
childRight + t.right, childBottom + t.bottom);
}
private void updateSpotShadowPosition() {
if (getChildCount() < 1) {
return;
}
final View childView = getChildAt(0);
childView.getWindowVisibleDisplayFrame(mTempRect);
mLightPositionX = mTempRect.width() / 2;
mLightPositionY = 0;
childView.getLocationInWindow(mTmpLocations);
final float zPosition = (mShadowTranslationZ + mShadowElevation);
final float tx = childView.getTranslationX();
final float ty = childView.getTranslationY();
final float positionRelatedTranslationX;
final float positionRelatedTranslationY;
if (mAffectsDisplayedPosition) {
final int childWidth = childView.getWidth();
final int childHeight = childView.getHeight();
final int childCenterPosX = mTmpLocations[0] + (childWidth / 2);
final int childCenterPosY = mTmpLocations[1] + (childHeight / 2);
positionRelatedTranslationX = (float) Math.sqrt((childCenterPosX - mLightPositionX) * mInvDisplayDensity * SPOT_SHADOW_X_TRANSLATION_AMOUNT_COEFFICIENT) * zPosition;
positionRelatedTranslationY = (float) Math.sqrt((childCenterPosY - mLightPositionY) * mInvDisplayDensity * SPOT_SHADOW_Y_TRANSLATION_AMOUNT_COEFFICIENT) * zPosition;
} else {
positionRelatedTranslationX = 0;
positionRelatedTranslationY = mDisplayDensity * NON_POSITION_AWARE_SPOT_SHADOW_Y_TRANSLATION_AMOUNT_COEFFICIENT * zPosition;
}
mSpotShadowTranslationX = (int) (positionRelatedTranslationX + tx + 0.5f);
mSpotShadowTranslationY = (int) (positionRelatedTranslationY + ty + 0.5f);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
updateShadowDrawableBounds();
updateSpotShadowPosition();
if (requiresChildViewLayoutFix()) {
fixChildViewGravity();
}
if (!useCompatShadow()) {
updateShadowLevelNative(mShadowTranslationZ, mShadowElevation, true);
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (requiresChildViewLayoutFix()) {
onMeasureCompat(widthMeasureSpec, heightMeasureSpec);
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
private boolean requiresChildViewLayoutFix() {
return (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) && (!isInEditMode());
}
@SuppressLint("RtlHardcoded")
private void fixChildViewGravity() {
for (int i = 0; i < getChildCount(); i++) {
View childView = getChildAt(i);
LayoutParams params = (LayoutParams) childView.getLayoutParams();
if (params.gravity == -1) {
params.gravity = Gravity.TOP | Gravity.LEFT;
}
childView.setLayoutParams(params);
}
}
private void onMeasureCompat(int widthMeasureSpec, int heightMeasureSpec) {
int count = Math.min(1, getChildCount());
final boolean measureMatchParentChildren =
MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY ||
MeasureSpec.getMode(heightMeasureSpec) != MeasureSpec.EXACTLY;
View matchParentChildren = null;
int maxHeight = 0;
int maxWidth = 0;
int childState = 0;
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
if (child.getVisibility() != GONE) {
measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0);
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
maxWidth = Math.max(maxWidth,
child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin);
maxHeight = Math.max(maxHeight,
child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin);
childState |= child.getMeasuredState();
if (measureMatchParentChildren) {
if (lp.width == LayoutParams.MATCH_PARENT ||
lp.height == LayoutParams.MATCH_PARENT) {
matchParentChildren = child;
}
}
}
}
final int paddingH = getPaddingLeft() + getPaddingRight();
final int paddingV = getPaddingTop() + getPaddingBottom();
maxWidth += paddingH;
maxHeight += paddingV;
maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight());
maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth());
final Drawable drawable = getForeground();
if (drawable != null) {
maxHeight = Math.max(maxHeight, drawable.getMinimumHeight());
maxWidth = Math.max(maxWidth, drawable.getMinimumWidth());
}
setMeasuredDimension(
resolveSizeAndState(maxWidth, widthMeasureSpec, childState),
resolveSizeAndState(maxHeight, heightMeasureSpec,
childState << MEASURED_HEIGHT_STATE_SHIFT));
if (matchParentChildren != null) {
final View child = matchParentChildren;
final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
int childWidthMeasureSpec;
int childHeightMeasureSpec;
if (lp.width == LayoutParams.MATCH_PARENT) {
childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
getMeasuredWidth() - paddingH - lp.leftMargin - lp.rightMargin,
MeasureSpec.EXACTLY);
} else {
childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
paddingH + lp.leftMargin + lp.rightMargin,
lp.width);
}
if (lp.height == LayoutParams.MATCH_PARENT) {
childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
getMeasuredHeight() - paddingV - lp.topMargin - lp.bottomMargin,
MeasureSpec.EXACTLY);
} else {
childHeightMeasureSpec = getChildMeasureSpec(
heightMeasureSpec,
paddingV + lp.topMargin + lp.bottomMargin,
lp.height);
}
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
}
}
private int[] getResourceIdArray(Resources resources, int id) {
if (id == 0) {
return null;
}
if (isInEditMode()) {
return null;
}
TypedArray ta = resources.obtainTypedArray(id);
int[] array = new int[ta.length()];
for (int i = 0; i < array.length; i++) {
array[i] = ta.getResourceId(i, 0);
}
ta.recycle();
return array;
}
private static class SavedState extends BaseSavedState implements Parcelable {
float shadowTranslationZ;
float shadowElevation;
boolean affectsDisplayedPosition;
boolean forceUseCompatShadow;
private boolean useAmbientShadow;
private boolean useSpotShadow;
public SavedState(Parcelable superState) {
super(superState);
}
public SavedState(Parcel source) {
super(source);
shadowTranslationZ = source.readFloat();
shadowElevation = source.readFloat();
affectsDisplayedPosition = source.readByte() != 0;
forceUseCompatShadow = source.readByte() != 0;
useAmbientShadow = source.readByte() != 0;
useSpotShadow = source.readByte() != 0;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeFloat(shadowTranslationZ);
dest.writeFloat(shadowElevation);
dest.writeByte((byte) (affectsDisplayedPosition ? 1 : 0));
dest.writeByte((byte) (forceUseCompatShadow ? 1 : 0));
dest.writeByte((byte) (useAmbientShadow ? 1 : 0));
dest.writeByte((byte) (useSpotShadow ? 1 : 0));
}
@SuppressWarnings("unused")
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
@Override
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
@Override
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
}
}
================================================
FILE: library/src/main/java/com/h6ah4i/android/materialshadowninepatch/MaterialShadowContainerViewProperties.java
================================================
package com.h6ah4i.android.materialshadowninepatch;
/**
* Created by hasegawa on 5/16/15.
*/
import android.annotation.TargetApi;
import android.os.Build;
import android.util.Property;
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public class MaterialShadowContainerViewProperties {
/**
* A Property wrapper around the shadowTranslationZ functionality handled by the
* {@link MaterialShadowContainerView#setShadowTranslationZ(float)} and
* {@link MaterialShadowContainerView#getShadowTranslationZ()} methods.
*/
public static final Property SHADOW_TRANSLATION_Z = new Property(Float.class, "shadowTranslationZ") {
@Override
public void set(MaterialShadowContainerView object, Float value) {
object.setShadowTranslationZ(value);
}
@Override
public Float get(MaterialShadowContainerView object) {
return object.getShadowTranslationZ();
}
};
}
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_ambient_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_composite_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-hdpi/ms9_spot_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_ambient_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_composite_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-ldpi/ms9_spot_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_ambient_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_composite_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-mdpi/ms9_spot_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_ambient_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_composite_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-tvdpi/ms9_spot_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_ambient_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_composite_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xhdpi/ms9_spot_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_ambient_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_composite_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxhdpi/ms9_spot_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_ambient_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_composite_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z1.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z10.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z11.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z12.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z13.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z14.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z15.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z16.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z17.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z18.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z2.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z3.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z4.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z5.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z6.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z7.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z8.xml
================================================
================================================
FILE: library/src/main/res/drawable-xxxhdpi/ms9_spot_shadow_z9.xml
================================================
================================================
FILE: library/src/main/res/values/arrays.xml
================================================
@null@drawable/ms9_ambient_shadow_z1@drawable/ms9_ambient_shadow_z2@drawable/ms9_ambient_shadow_z3@drawable/ms9_ambient_shadow_z4@drawable/ms9_ambient_shadow_z5@drawable/ms9_ambient_shadow_z6@null@drawable/ms9_spot_shadow_z1@drawable/ms9_spot_shadow_z2@drawable/ms9_spot_shadow_z3@drawable/ms9_spot_shadow_z4@drawable/ms9_spot_shadow_z5@drawable/ms9_spot_shadow_z6@null@drawable/ms9_ambient_shadow_z1@drawable/ms9_ambient_shadow_z2@drawable/ms9_ambient_shadow_z3@drawable/ms9_ambient_shadow_z4@drawable/ms9_ambient_shadow_z5@drawable/ms9_ambient_shadow_z6@drawable/ms9_ambient_shadow_z7@drawable/ms9_ambient_shadow_z8@drawable/ms9_ambient_shadow_z9@null@drawable/ms9_spot_shadow_z1@drawable/ms9_spot_shadow_z2@drawable/ms9_spot_shadow_z3@drawable/ms9_spot_shadow_z4@drawable/ms9_spot_shadow_z5@drawable/ms9_spot_shadow_z6@drawable/ms9_spot_shadow_z7@drawable/ms9_spot_shadow_z8@drawable/ms9_spot_shadow_z9@null@drawable/ms9_ambient_shadow_z1@drawable/ms9_ambient_shadow_z2@drawable/ms9_ambient_shadow_z3@drawable/ms9_ambient_shadow_z4@drawable/ms9_ambient_shadow_z5@drawable/ms9_ambient_shadow_z6@drawable/ms9_ambient_shadow_z7@drawable/ms9_ambient_shadow_z8@drawable/ms9_ambient_shadow_z9@drawable/ms9_ambient_shadow_z10@drawable/ms9_ambient_shadow_z11@drawable/ms9_ambient_shadow_z12@drawable/ms9_ambient_shadow_z13@drawable/ms9_ambient_shadow_z14@drawable/ms9_ambient_shadow_z15@drawable/ms9_ambient_shadow_z16@drawable/ms9_ambient_shadow_z17@drawable/ms9_ambient_shadow_z18@null@drawable/ms9_spot_shadow_z1@drawable/ms9_spot_shadow_z2@drawable/ms9_spot_shadow_z3@drawable/ms9_spot_shadow_z4@drawable/ms9_spot_shadow_z5@drawable/ms9_spot_shadow_z6@drawable/ms9_spot_shadow_z7@drawable/ms9_spot_shadow_z8@drawable/ms9_spot_shadow_z9@drawable/ms9_spot_shadow_z10@drawable/ms9_spot_shadow_z11@drawable/ms9_spot_shadow_z12@drawable/ms9_spot_shadow_z13@drawable/ms9_spot_shadow_z14@drawable/ms9_spot_shadow_z15@drawable/ms9_spot_shadow_z16@drawable/ms9_spot_shadow_z17@drawable/ms9_spot_shadow_z18@null@drawable/ms9_composite_shadow_z1@drawable/ms9_composite_shadow_z2@drawable/ms9_composite_shadow_z3@drawable/ms9_composite_shadow_z4@drawable/ms9_composite_shadow_z5@drawable/ms9_composite_shadow_z6@null@drawable/ms9_composite_shadow_z1@drawable/ms9_composite_shadow_z2@drawable/ms9_composite_shadow_z3@drawable/ms9_composite_shadow_z4@drawable/ms9_composite_shadow_z5@drawable/ms9_composite_shadow_z6@drawable/ms9_composite_shadow_z7@drawable/ms9_composite_shadow_z8@drawable/ms9_composite_shadow_z9
================================================
FILE: library/src/main/res/values/attrs.xml
================================================
================================================
FILE: library/src/main/res/values/styles.xml
================================================
================================================
FILE: resource/.gitignore
================================================
/phase1/
/phase2/
/phase3/
/phase4/
================================================
FILE: resource/README
================================================
Usage:
To generate nine-patch files, just run the following command;
$ ./process_all.sh
Required commands:
- bash
- python
- gawk
- inkscape
- imagemagick
- pngquant
- optipng
- parallel (optional but recommended, increase processing speed significantly!)
================================================
FILE: resource/batch_inkscape_export.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
svg_file=$1
dest_dir=$2
# resolve commands
inkscape_export_obj=./inkscape_export_obj.sh
if command -v parallel >/dev/null 2>&1; then
# echo "GNU parallel is available"
iterator_cmd=parallel
iterator_cmd_opt="-a -"
else
# echo "GNU parallel is not available"
iterator_cmd=xargs
iterator_cmd_opt="-i"
fi
# create destination directory
if [ ! -d $dest_dir ]; then
mkdir $dest_dir
fi
# export
function inkscape_export_shadow_objs {
local svg_file=$1
local dest_dir=$2
local scale=$3
local target_list=$(seq 9) # 1 .. 9
echo "$target_list" | $iterator_cmd $iterator_cmd_opt $inkscape_export_obj $svg_file $dest_dir/"material_shadow_z"{}"_x"$scale "material_shadow_z"{}"_mdpi" $scale
}
inkscape_export_shadow_objs $svg_file $dest_dir 1
inkscape_export_shadow_objs $svg_file $dest_dir 2
inkscape_export_shadow_objs $svg_file $dest_dir 3
inkscape_export_shadow_objs $svg_file $dest_dir 4
================================================
FILE: resource/crop_ninepatch_valid_area.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
src_file=$1
dest_file=$2
crop_pixels=$3
src_width=$(identify -format "%[fx:w]" $src_file)
src_height=$(identify -format "%[fx:h]" $src_file)
dest_width=$(( src_width - 2 * crop_pixels ))
dest_height=$(( src_height - 2 * crop_pixels ))
convert $src_file -crop $dest_width"x"$dest_height"+"$crop_pixels"+"$crop_pixels $dest_file
================================================
FILE: resource/gen_alias_xml.py
================================================
#!/usr/bin/python
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
import sys
# check arguments
if len(sys.argv) < 4:
print 'Usage: ' + sys.argv[0] + 'res_name num scale'
exit()
def generate_xml(res_name, scale, zdepth):
xml_fname = res_name + '_z' + str(zdepth) + '.xml'
src_res_name = res_name + '_z' + str(zdepth) + '_x' + scale
f = open(xml_fname, 'w')
f.write('\n')
f.write('\n')
f.close()
# main process
res_name = sys.argv[1]
num = int(sys.argv[2])
scale = sys.argv[3]
for x in range(1, num + 1):
generate_xml(res_name, scale, x)
================================================
FILE: resource/inkscape_export_obj.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
inkscape_screen_dpi=90
svg_file=$1
png_file=$2
obj_id=$3
dpi=$((inkscape_screen_dpi * $4))
inkscape \
--without-gui \
--export-id-only \
--export-id=$obj_id \
--export-dpi $dpi \
--export-png $png_file \
$svg_file
================================================
FILE: resource/phase1_batch_inkscape_export.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
svg_file=$1
dest_dir=$2
num_amb_spot_drawables=$3
num_composite_drawables=$4
res_prefix=$5
# resolve commands
if command -v parallel >/dev/null 2>&1; then
# echo "GNU parallel is available"
iterator_cmd=parallel
iterator_cmd_opt="-a -"
else
# echo "GNU parallel is not available"
iterator_cmd=xargs
iterator_cmd_opt="-i"
fi
inkscape_export_obj=./inkscape_export_obj.sh
# create destination directory
if [ ! -d $dest_dir ]; then
mkdir $dest_dir
fi
# export
function inkscape_export_shadow_objs {
local svg_file=$1
local dest_dir=$2
local name=$3
local num=$4
local scale=$5
local out_prefix=$6
local target_list=$(seq $num) # 1 .. num
echo "$target_list" | \
$iterator_cmd $iterator_cmd_opt \
$inkscape_export_obj $svg_file $dest_dir/$out_prefix""$name"_z"{}"_x"$scale".9.png" $name"_z"{} $scale
}
inkscape_export_shadow_objs $svg_file $dest_dir "ambient_shadow" $num_amb_spot_drawables 1 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "ambient_shadow" $num_amb_spot_drawables 2 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "ambient_shadow" $num_amb_spot_drawables 3 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "ambient_shadow" $num_amb_spot_drawables 4 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "spot_shadow" $num_amb_spot_drawables 1 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "spot_shadow" $num_amb_spot_drawables 2 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "spot_shadow" $num_amb_spot_drawables 3 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "spot_shadow" $num_amb_spot_drawables 4 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "composite_shadow" $num_composite_drawables 1 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "composite_shadow" $num_composite_drawables 2 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "composite_shadow" $num_composite_drawables 3 $res_prefix
inkscape_export_shadow_objs $svg_file $dest_dir "composite_shadow" $num_composite_drawables 4 $res_prefix
================================================
FILE: resource/phase2_batch_crop_ninepatch_valid_area.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
src_dir=$1
dest_dir=$2
num_amb_spot_drawables=$3
num_composite_drawables=$4
res_prefix=$5
# resolve commands
if command -v parallel >/dev/null 2>&1; then
# echo "GNU parallel is available"
iterator_cmd=parallel
iterator_cmd_opt="-a -"
else
# echo "GNU parallel is not available"
iterator_cmd=xargs
iterator_cmd_opt="-i"
fi
crop_ninepatch_valid_area=./crop_ninepatch_valid_area.sh
# create destination directory
if [ ! -d $dest_dir ]; then
mkdir $dest_dir
fi
# crop
function batch_crop_niniepatch_valid_area {
local src_dir=$1
local dest_dir=$2
local scale=$3
local crop_pixels=$(( scale - 1 ))
local target_list=$(find $src_dir -maxdepth 1 -type f -name "*_x"$scale"*.png" | gawk -F/ '{print $NF}' | sort -n)
echo "$target_list" | \
$iterator_cmd $iterator_cmd_opt \
$crop_ninepatch_valid_area $src_dir/{} $dest_dir/{} $crop_pixels
}
batch_crop_niniepatch_valid_area $src_dir $dest_dir 1
batch_crop_niniepatch_valid_area $src_dir $dest_dir 2
batch_crop_niniepatch_valid_area $src_dir $dest_dir 3
batch_crop_niniepatch_valid_area $src_dir $dest_dir 4
================================================
FILE: resource/phase3_batch_shrink_png_file.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
src_dir=$1
dest_dir=$2
num_amb_spot_drawables=$3
num_composite_drawables=$4
res_prefix=$5
# resolve commands
if command -v parallel >/dev/null 2>&1; then
# echo "GNU parallel is available"
iterator_cmd=parallel
iterator_cmd_opt="-a -"
else
# echo "GNU parallel is not available"
iterator_cmd=xargs
iterator_cmd_opt="-i"
fi
shrink_png_file=./shrink_png_file.sh
# create destination directory
if [ ! -d $dest_dir ]; then
mkdir $dest_dir
fi
# crop
function batch_crop_niniepatch_valid_area {
local src_dir=$1
local dest_dir=$2
local target_list=$(find $src_dir -maxdepth 1 -type f -name "*.png" | gawk -F/ '{print $NF}' | sort -n)
echo "$target_list" | \
$iterator_cmd $iterator_cmd_opt \
$shrink_png_file $src_dir/{} $dest_dir/{}
}
batch_crop_niniepatch_valid_area $src_dir $dest_dir
================================================
FILE: resource/phase4_batch_gen_alias_xml.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
src_dir=$1
dest_dir=$2
num_amb_spot_drawables=$3
num_composite_drawables=$4
res_prefix=$5
# create destination directory
if [ ! -d $dest_dir ]; then
mkdir $dest_dir
fi
# copy PNG files directory to drawable-nodpi
if [ -d $dest_dir/drawable-nodpi ]; then
rm -r $dest_dir/drawable-nodpi
fi
cp -r $src_dir $dest_dir/drawable-nodpi
pushd $dest_dir
# ldpi x0.75 (NOTE: use mdpi resources)
mkdir drawable-ldpi || true
pushd drawable-ldpi
../../gen_alias_xml.py $res_prefix"ambient_shadow" $num_amb_spot_drawables 1
../../gen_alias_xml.py $res_prefix"spot_shadow" $num_amb_spot_drawables 1
../../gen_alias_xml.py $res_prefix"composite_shadow" $num_composite_drawables 1
popd
# mdpi x1.0
mkdir drawable-mdpi || true
pushd drawable-mdpi
../../gen_alias_xml.py $res_prefix"ambient_shadow" $num_amb_spot_drawables 1
../../gen_alias_xml.py $res_prefix"spot_shadow" $num_amb_spot_drawables 1
../../gen_alias_xml.py $res_prefix"composite_shadow" $num_composite_drawables 1
popd
# tvdpi x1.33 (NOTE: use mdpi resources)
mkdir drawable-tvdpi || true
pushd drawable-tvdpi
../../gen_alias_xml.py $res_prefix"ambient_shadow" $num_amb_spot_drawables 1
../../gen_alias_xml.py $res_prefix"spot_shadow" $num_amb_spot_drawables 1
../../gen_alias_xml.py $res_prefix"composite_shadow" $num_composite_drawables 1
popd
# hdpi x1.5 (NOTE: use xhdpi resources)
mkdir drawable-hdpi || true
pushd drawable-hdpi
../../gen_alias_xml.py $res_prefix"ambient_shadow" $num_amb_spot_drawables 2
../../gen_alias_xml.py $res_prefix"spot_shadow" $num_amb_spot_drawables 2
../../gen_alias_xml.py $res_prefix"composite_shadow" $num_composite_drawables 2
popd
# xhdpi x2.0
mkdir drawable-xhdpi || true
pushd drawable-xhdpi
../../gen_alias_xml.py $res_prefix"ambient_shadow" $num_amb_spot_drawables 2
../../gen_alias_xml.py $res_prefix"spot_shadow" $num_amb_spot_drawables 2
../../gen_alias_xml.py $res_prefix"composite_shadow" $num_composite_drawables 2
popd
# xxhdpi x3.0
mkdir drawable-xxhdpi || true
pushd drawable-xxhdpi
../../gen_alias_xml.py $res_prefix"ambient_shadow" $num_amb_spot_drawables 3
../../gen_alias_xml.py $res_prefix"spot_shadow" $num_amb_spot_drawables 3
../../gen_alias_xml.py $res_prefix"composite_shadow" $num_composite_drawables 3
popd
# xxxhdpi x4.0
mkdir drawable-xxxhdpi || true
pushd drawable-xxxhdpi
../../gen_alias_xml.py $res_prefix"ambient_shadow" $num_amb_spot_drawables 4
../../gen_alias_xml.py $res_prefix"spot_shadow" $num_amb_spot_drawables 4
../../gen_alias_xml.py $res_prefix"composite_shadow" $num_composite_drawables 4
popd
popd
================================================
FILE: resource/process_all.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
num_amb_spot_drawables=18
num_composite_drawables=9
res_prefix=ms9_ # material shadow ninepatch
CUR_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
# PHASE 1 : export PNG files
./phase1_batch_inkscape_export.sh $CUR_DIR/material_shadow.svg $CUR_DIR/phase1 $num_amb_spot_drawables $num_composite_drawables $res_prefix
# PHASE 2 : crop
./phase2_batch_crop_ninepatch_valid_area.sh phase1 phase2 $num_amb_spot_drawables $num_composite_drawables $res_prefix
# PHASE 3 : shrink PNG file size
./phase3_batch_shrink_png_file.sh phase2 phase3 $num_amb_spot_drawables $num_composite_drawables $res_prefix
# PHASE 4 : generate alias XML files
./phase4_batch_gen_alias_xml.sh phase3 phase4 $num_amb_spot_drawables $num_composite_drawables $res_prefix
================================================
FILE: resource/shrink_png_file.sh
================================================
#!/bin/bash -e
#
# Copyright (C) 2015 Haruki Hasegawa
#
# 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.
#
src_file=$1
dest_file=$2
pngquant --speed=1 --force --output $dest_file 32 $src_file
optipng -o7 $dest_file
================================================
FILE: settings.gradle
================================================
include ':example', ':library'
================================================
FILE: signing/.gitignore
================================================
*.properties
*.keystore
================================================
FILE: signing/README
================================================
Rename and modify these files to specify signing information.
```
cp example-signing.properties.template example-signing.properties
cp library-maven-publish-signing.properties.template library-maven-publish-signing.properties
cp library-bintray-private.properties.template library-bintray-private.properties
```
DO NOT ADD THESE FILES TO THE REPOSITORY
- 'keystore' files
- '*.properties' files which contain sensitive information
================================================
FILE: signing/example-signing.properties.template
================================================
# This is a template file of "example-signing.properties"
# These information are used to sign release APK file
storeFile=absolute_path_of_keystore_file
storePassword=password
keyAlias=key_alias_name
keyPassword=key_password
================================================
FILE: signing/library-maven-publish-signing.properties.template
================================================
# This is a template file of "library-maven-publish-signing.properties"
# These information are used to sign library JAR and POM files
keyId=ABCD1234
password=PASSWORD
secretKeyRingFile=path_to_gpg_file