Repository: vivian8725118/CardView
Branch: master
Commit: cdb7681d5745
Files: 50
Total size: 81.0 KB
Directory structure:
gitextract_zrmng5pq/
├── .gitignore
├── .idea/
│ ├── compiler.xml
│ ├── copyright/
│ │ └── profiles_settings.xml
│ ├── dictionaries/
│ │ └── vivian.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── inspectionProfiles/
│ │ ├── Project_Default.xml
│ │ └── profiles_settings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ └── vcs.xml
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── com/
│ │ └── vivian/
│ │ └── shadedemo/
│ │ └── ExampleInstrumentedTest.java
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── vivian/
│ │ │ └── shadedemo/
│ │ │ ├── MainActivity.java
│ │ │ ├── adapter/
│ │ │ │ └── CardViewAdapter.java
│ │ │ ├── anim/
│ │ │ │ └── RecyclerViewItemAnimator.java
│ │ │ ├── drawable/
│ │ │ │ ├── BottomDrawable.java
│ │ │ │ ├── CenterDrawable.java
│ │ │ │ ├── CircleShadowDrawable.java
│ │ │ │ └── TopDrawable.java
│ │ │ ├── entity/
│ │ │ │ └── Card.java
│ │ │ ├── util/
│ │ │ │ ├── CardThemeUtil.java
│ │ │ │ ├── ScreenShotUtil.java
│ │ │ │ └── ScreenSizeUtil.java
│ │ │ ├── view/
│ │ │ │ ├── ShadowView.java
│ │ │ │ └── TopShadowView.java
│ │ │ └── widget/
│ │ │ └── CardView.java
│ │ └── res/
│ │ ├── drawable/
│ │ │ ├── circle.xml
│ │ │ └── circle_retangle.xml
│ │ ├── layout/
│ │ │ ├── activity_main_recyclerview.xml
│ │ │ ├── card.xml
│ │ │ └── icons.xml
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── values-w820dp/
│ │ └── dimens.xml
│ └── test/
│ └── java/
│ └── com/
│ └── vivian/
│ └── shadedemo/
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
================================================
FILE: .idea/compiler.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
================================================
FILE: .idea/copyright/profiles_settings.xml
================================================
<component name="CopyrightManager">
<settings default="" />
</component>
================================================
FILE: .idea/dictionaries/vivian.xml
================================================
<component name="ProjectDictionaryState">
<dictionary name="vivian" />
</component>
================================================
FILE: .idea/encodings.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
================================================
FILE: .idea/gradle.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
================================================
FILE: .idea/inspectionProfiles/Project_Default.xml
================================================
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="AndroidLintAaptCrash" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAccidentalOctal" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAdapterViewChildren" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAddJavascriptInterface" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAllowBackup" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAlwaysShowAction" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAppCompatMethod" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAppCompatResource" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintAssert" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintButtonCase" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintButtonOrder" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintButtonStyle" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintByteOrderMark" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintCommitPrefEdits" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintCommitTransaction" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintContentDescription" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintCustomViewStyleable" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintCutPasteId" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDeprecated" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDeviceAdmin" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDisableBaselineAlignment" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDrawAllocation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDuplicateActivity" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDuplicateDefinition" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDuplicateIds" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDuplicateIncludedIds" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintDuplicateUsesFeature" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintEnforceUTF8" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintExportedContentProvider" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintExportedPreferenceActivity" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintExportedReceiver" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintExportedService" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintExtraText" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintExtraTranslation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGetInstance" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGifUsage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleCompatible" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleCompatiblePlugin" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleDependency" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleDeprecated" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleDynamicVersion" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleGetter" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleIdeError" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradleOverrides" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGradlePath" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGrantAllUris" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintGridLayout" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintHandlerLeak" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintHardcodedDebugMode" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintHardcodedText" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconColors" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconDensities" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconDipSize" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconDuplicates" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconDuplicatesConfig" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconExtension" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconLauncherShape" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconLocation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconMissingDensityFolder" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconMixedNinePatch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconNoDpi" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIconXmlAndPng" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIllegalResourceRef" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintImpliedQuantity" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInOrMmUsage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintIncludeLayoutParam" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInconsistentArrays" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInconsistentLayout" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInefficientWeight" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInflateParams" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInlinedApi" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInnerclassSeparator" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInvalidId" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintInvalidResourceFolder" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintJavascriptInterface" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintLabelFor" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintLibraryCustomView" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintLocalSuppress" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintLocaleFolder" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintLogTagMismatch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintLongLogTag" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMangledCRLF" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintManifestOrder" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMenuTitle" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMergeRootFrame" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMipmapIcons" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingApplicationIcon" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingId" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingPrefix" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingQuantity" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingSuperCall" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingTranslation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMissingVersion" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMockLocation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintMultipleUsesSdk" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintNestedScrolling" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintNestedWeights" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintNewApi" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintNfcTechWhitespace" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintNotSibling" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintObsoleteLayoutParam" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintOldTargetApi" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintOrientation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintOverdraw" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintOverride" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintOverrideAbstract" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintPackageManagerGetSignatures" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintPackagedPrivateKey" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintParcelCreator" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintPluralsCandidate" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintProguard" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintProguardSplit" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintPropertyEscape" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintProtectedPermissions" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintPxUsage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRecycle" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintReferenceType" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRegistered" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRelativeOverlap" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRequiredSize" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintResAuto" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintResourceAsColor" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintResourceCycle" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintResourceName" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRtlCompat" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRtlEnabled" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRtlHardcoded" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRtlSymmetry" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintScrollViewCount" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintScrollViewSize" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSdCardPath" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintServiceCast" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSetJavaScriptEnabled" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintShowToast" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSignatureOrSystemPermissions" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSimpleDateFormat" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSmallSp" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSpUsage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintStateListReachable" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintStringFormatCount" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintStringFormatInvalid" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintStringFormatMatches" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintStringShouldBeInt" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSuspicious0dp" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintSuspiciousImport" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTextFields" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTextViewEdits" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTooDeepLayout" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTooManyViews" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTypographyDashes" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTypographyEllipsis" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTypographyFractions" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTypographyOther" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintTypos" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUniquePermission" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUnknownId" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUnknownIdInLayout" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUnlocalizedSms" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUnusedAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUnusedQuantity" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUnusedResources" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUseAlpha2" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUseCheckPermission" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUseCompoundDrawables" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUseSparseArrays" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUseValueOf" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUselessLeaf" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUselessParent" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUsesMinSdkAttributes" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUsingHttp" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintValidFragment" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintViewConstructor" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintViewHolder" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWebViewLayout" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWorldReadableFiles" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWorldWriteableFiles" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWrongCall" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWrongCase" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWrongFolder" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWrongRegion" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintWrongViewCast" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
</profile>
</component>
================================================
FILE: .idea/inspectionProfiles/profiles_settings.xml
================================================
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>
================================================
FILE: .idea/misc.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Abstraction issuesJava</id>
</State>
<State>
<id>Android</id>
</State>
<State>
<id>Android Lint</id>
</State>
<State>
<id>Class metricsJava</id>
</State>
<State>
<id>Code style issuesJava</id>
</State>
<State>
<id>Declaration redundancyJava</id>
</State>
<State>
<id>Error handlingJava</id>
</State>
<State>
<id>Groovy</id>
</State>
<State>
<id>Java</id>
</State>
<State>
<id>Method MetricsGroovy</id>
</State>
<State>
<id>Method metricsJava</id>
</State>
<State>
<id>Naming ConventionsGroovy</id>
</State>
<State>
<id>Naming conventionsJava</id>
</State>
<State>
<id>Security issuesJava</id>
</State>
</expanded-state>
</profile-state>
</entry>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="Copyright.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ScopeChooserConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
================================================
FILE: .idea/modules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/ShadeDemo.iml" filepath="$PROJECT_DIR$/ShadeDemo.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
================================================
FILE: .idea/runConfigurations.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
================================================
FILE: README.md
================================================
# CardView
类似小票效果的卡片列表,并且可以修改阴影颜色
# Usage
可以直接引用CardView
```
CardView cardView=new CardView(context);
//修改CardView的主题颜色
cardView.changeTheme(0xff01a3a1);
```
# 原理
用paint.setShadowLayer来设置阴影颜色和尺寸,进行阴影绘制,用path来画出drawable的形状。
封装了changeTheme的方法,可以直接设置主题的颜色。
本示例中为了更好地实现效果,用了```TopDrawable、CenterDrawable、BottomDrawable```三部分拼接而成,也可以用来实现打印小票的视觉效果。另外添加了一个类似<b>FloatingButton</b>效果的```CircleShadowDrawable```。
# 效果图
<div>
<img hspace="20" src="https://github.com/vivian8725118/ShadeDemo/blob/master/art/S61201-155859.jpg" width="40%"/>
<img src="https://github.com/vivian8725118/ShadeDemo/blob/master/art/S61201-163058.jpg" width="40%"/>
</div>
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.vivian.shadedemo"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:25.0.0'
}
================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/vivian/Documents/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: app/src/androidTest/java/com/vivian/shadedemo/ExampleInstrumentedTest.java
================================================
package com.vivian.shadedemo;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.vivian.shadedemo", appContext.getPackageName());
}
}
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vivian.shadedemo">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
================================================
FILE: app/src/main/java/com/vivian/shadedemo/MainActivity.java
================================================
package com.vivian.shadedemo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import com.vivian.shadedemo.adapter.CardViewAdapter;
import com.vivian.shadedemo.entity.Card;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
RecyclerView mRecyclerView;
LinearLayoutManager mLayoutManager;
CardViewAdapter mAdapter;
List<Card> mList = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initViewRecyclerView();
}
public void initViewRecyclerView() {
LinearLayout view = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.activity_main_recyclerview, null);
setContentView(view);
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRecyclerView.setLayoutManager(mLayoutManager);
mAdapter = new CardViewAdapter(this);
mRecyclerView.setAdapter(mAdapter);
//模拟数据
for (int i = 0; i < 10; i++) {
Card card = new Card();
String content = "刘雯、何穗、奚梦瑶、雎晓雯......在公开的 52 位模特名单里,一下子出现了四位中国模特。要知道,一年一度的顶级维密大秀可是为“国际超模”四个字加持的大秀啊。接下来,时间将印证这四位模特的未来身价和职业生涯。";
card.setContent(content);
mList.add(card);
}
mAdapter.setData(mList);
mAdapter.notifyDataSetChanged();
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/adapter/CardViewAdapter.java
================================================
package com.vivian.shadedemo.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.vivian.shadedemo.R;
import com.vivian.shadedemo.entity.Card;
import com.vivian.shadedemo.widget.CardView;
import java.util.List;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/12/1.
*/
public class CardViewAdapter extends RecyclerView.Adapter<CardViewAdapter.ViewHolder> {
List<Card> mData;
Context mContext;
int[] colors = {0xff01a3a1, 0xff91bbeb, 0xff01b1bf, 0xffff9d62, 0xff2d3867, 0xffee697e};//颜色组
public void setData(List<Card> list) {
this.mData = list;
}
public CardViewAdapter(Context context) {
mContext = context;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = new CardView(mContext);
ViewHolder holder = new ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.content.setText(mData.get(position).getContent());
holder.comment.setText(mData.get(position).getComment());
holder.comment.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
mData.get(holder.getAdapterPosition()).setComment(charSequence.toString());
}
@Override
public void afterTextChanged(Editable editable) {
}
});
//设置颜色变化
((CardView) holder.itemView).changeTheme(colors[position % 6]);
}
@Override
public int getItemCount() {
return mData.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout top;
ImageView center;
EditText comment;
TextView content;
ViewHolder(View view) {
super(view);
top = (RelativeLayout) view.findViewById(R.id.top);
center = (ImageView) view.findViewById(R.id.center);
comment = (EditText) view.findViewById(R.id.comment);
content = (TextView) view.findViewById(R.id.content);
}
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/anim/RecyclerViewItemAnimator.java
================================================
package com.vivian.shadedemo.anim;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/12/1.
*/
public class RecyclerViewItemAnimator extends RecyclerView.ItemAnimator{
@Override
public boolean animateDisappearance(@NonNull RecyclerView.ViewHolder viewHolder, @NonNull ItemHolderInfo preLayoutInfo, @Nullable ItemHolderInfo postLayoutInfo) {
return false;
}
@Override
public boolean animateAppearance(@NonNull RecyclerView.ViewHolder viewHolder, @Nullable ItemHolderInfo preLayoutInfo, @NonNull ItemHolderInfo postLayoutInfo) {
return false;
}
@Override
public boolean animatePersistence(@NonNull RecyclerView.ViewHolder viewHolder, @NonNull ItemHolderInfo preLayoutInfo, @NonNull ItemHolderInfo postLayoutInfo) {
return false;
}
@Override
public boolean animateChange(@NonNull RecyclerView.ViewHolder oldHolder, @NonNull RecyclerView.ViewHolder newHolder, @NonNull ItemHolderInfo preLayoutInfo, @NonNull ItemHolderInfo postLayoutInfo) {
return false;
}
@Override
public void runPendingAnimations() {
}
@Override
public void endAnimation(RecyclerView.ViewHolder item) {
}
@Override
public void endAnimations() {
}
@Override
public boolean isRunning() {
return false;
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/drawable/BottomDrawable.java
================================================
package com.vivian.shadedemo.drawable;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/11/30.
*/
public class BottomDrawable extends Drawable {
Paint paint;
Paint paintShadow;
Path path;
RectF rectF;
int x = 20;
int y = 0;
int color = 0x2601a3a1;
public BottomDrawable() {
paint = new Paint();
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
paintShadow = new Paint();
paintShadow.setColor(Color.WHITE);
paintShadow.setAntiAlias(true);
path = new Path();
}
public void setColor(int color) {
this.color = color;
// 设定阴影(柔边, X 轴位移, Y 轴位移, 阴影颜色)
paintShadow.setShadowLayer(21, 0, 10, color & 0x26ffffff);
invalidateSelf();
}
@Override
public void draw(Canvas canvas) {
canvas.drawPath(path, paintShadow);
canvas.drawRect(x, y, getBounds().width() - x, y + 21, paint);
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
path.reset();
rectF = new RectF(x, y, bounds.width() - x, y + bounds.height() - 21);
path.addRoundRect(rectF, new float[]{0, 0, 0, 0, 10, 10, 10, 10}, Path.Direction.CW);
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/drawable/CenterDrawable.java
================================================
package com.vivian.shadedemo.drawable;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathEffect;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/11/30.
*/
public class CenterDrawable extends Drawable {
Paint paint;
Paint paintShadow;
Paint paintLine;
Path path;
Bitmap bitmap;
int color=0x2601a3a1;
PathEffect effects = new DashPathEffect(new float[]{ 6, 8}, 1);
public CenterDrawable(Bitmap bitmap) {
this.bitmap=bitmap;
paint = new Paint();
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
paintShadow = new Paint();
paintShadow.setColor(Color.WHITE);
paintShadow.setAntiAlias(true);
path = new Path();
paintLine = new Paint();
paintLine.setColor(Color.GRAY);
paintLine.setAntiAlias(true);
paintLine.setPathEffect(effects);
paintLine.setStyle(Paint.Style.FILL);
paintLine.setStrokeWidth(1);
}
public void setColor(int color){
this.color=color;
// 设定阴影(柔边, X 轴位移, Y 轴位移, 阴影颜色)
paintShadow.setShadowLayer(21, 0, 10, color&0x26ffffff);
invalidateSelf();
}
@Override
public void onBoundsChange(Rect bounds){
int x = bounds.left + 20;
int y = bounds.top;
path.reset();
path.moveTo(x, y);
path.lineTo(bounds.right - x, y);
path.quadTo(bounds.right - x - bounds.bottom * 0.8f, bounds.bottom / 2, bounds.right - x, bounds.bottom);
path.lineTo(x, bounds.bottom);
path.quadTo(x + bounds.bottom * 0.8f, bounds.bottom / 2, x, y);
path.close();
}
@Override
public void draw(Canvas canvas) {
int x = getBounds().left + 20;
int y = getBounds().top;
//画背景
canvas.drawPath(path, paintShadow);
//画一半虚线
canvas.drawLine(x+getBounds().bottom*0.8f, getBounds().bottom/2, (getBounds().right - x - getBounds().bottom * 0.8f)/2-bitmap.getWidth(), getBounds().bottom/2, paintLine);
//画引号
canvas.drawBitmap(bitmap,getBounds().right/2-bitmap.getWidth(),y,new Paint());
//画另一半虚线
canvas.drawLine((getBounds().right - x - getBounds().bottom * 0.8f)/2+bitmap.getWidth()*3/2, getBounds().bottom/2, getBounds().right - x - getBounds().bottom * 0.8f, getBounds().bottom/2, paintLine);
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/drawable/CircleShadowDrawable.java
================================================
package com.vivian.shadedemo.drawable;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import com.vivian.shadedemo.R;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/11/30.
*/
public class CircleShadowDrawable extends Drawable {
private Bitmap bitmap = null;
Context mContext;
// 建立Paint 物件
Paint paint3 = new Paint();
public CircleShadowDrawable(Context context){
mContext=context;
// bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.top_selector);
}
@Override
public void draw(Canvas canvas) {
paint3.setColor(Color.RED);
// 设定阴影(柔边, X 轴位移, Y 轴位移, 阴影颜色)
paint3.setShadowLayer(300, 0, 0, Color.RED);
// 实心矩形& 其阴影
canvas.drawCircle(400, 500, 300, paint3);
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
@Override
public int getOpacity() {
return 0;
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/drawable/TopDrawable.java
================================================
package com.vivian.shadedemo.drawable;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/11/30.
*/
public class TopDrawable extends Drawable {
Paint paint;
Paint paintShadow;
Path path;
RectF rectF;
int x = 20;
int y = 20;
int color = 0x2601a3a1;
public TopDrawable() {
paint = new Paint();
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
paintShadow = new Paint();
paintShadow.setColor(Color.WHITE);
paintShadow.setAntiAlias(true);
path = new Path();
}
public void setColor(int color) {
this.color = color;
// 设定阴影(柔边, X 轴位移, Y 轴位移, 阴影颜色)
paintShadow.setShadowLayer(21, 0, 10, color & 0x26ffffff);//0x2600A4A0
invalidateSelf();
}
@Override
public void draw(Canvas canvas) {
canvas.drawPath(path, paintShadow);
canvas.drawRect(x, getBounds().height(), getBounds().width() - x, getBounds().height() + 21, paint);
}
@Override
public void onBoundsChange(Rect bounds) {
path.reset();
rectF = new RectF(x, y, bounds.width() - x, bounds.height());
path.addRoundRect(rectF, new float[]{6, 6, 6, 6, 0, 0, 0, 0}, Path.Direction.CW);
}
@Override
public void setAlpha(int i) {
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/entity/Card.java
================================================
package com.vivian.shadedemo.entity;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/12/1.
*/
public class Card {
private String content;
private String comment = "";
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/util/CardThemeUtil.java
================================================
package com.vivian.shadedemo.util;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.util.Log;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/12/1.
*/
public class CardThemeUtil {
public Drawable colorMatrixFilter(Context context,int res, int color) {
int r = Color.red(color);
int g = Color.green(color);
int b = Color.blue(color);
//定义RGBA的矩阵
float[] src = new float[]{
0, 0, 0, 0, r,
0, 0, 0, 0, g,
0, 0, 0, 0, b,
0, 0, 0, 1, 0};
ColorMatrix matrix = new ColorMatrix(src);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
Drawable drawable = ContextCompat.getDrawable(context,res);
drawable.setColorFilter(filter);
return drawable;
}
/**
* Usage:很耗性能
* topLayout.setBackground(colorFilter(R.drawable.top));
* centerLayout.setBackground(colorFilter(R.drawable.center));
* bottomLayout.setBackground(colorFilter(R.drawable.bottom));
*
* @param res
* @return
*/
public Drawable colorFilter(Context context,int res) {
Drawable drawable = context.getDrawable(res);
Bitmap bitmap = drawableToBitmap(drawable);
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] pixels = new int[width * height];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int color = bitmap.getPixel(x, y);
if (color != 0xffffffff) {
Log.e("color:", "alpha:" + Color.alpha(color));
Log.e("color:", "red:" + Color.red(color));
Log.e("color:", "green:" + Color.green(color));
Log.e("color:", "blue:" + Color.blue(color) + "\n");
int alpha = Color.alpha(color);
int color2 = Color.argb(alpha, 249, 39, 54);
pixels[y * width + x] = color2;
} else {
pixels[y * width + x] = 0xffffffff;
}
}
}
bitmap = Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_4444);
Drawable d = new BitmapDrawable(context.getResources(), bitmap);
return d;
}
public static Bitmap drawableToBitmap(Drawable drawable) {
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/util/ScreenShotUtil.java
================================================
package com.vivian.shadedemo.util;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.View;
import android.view.ViewGroup;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/12/1.
*/
public class ScreenShotUtil {
/**
* 截图
*
* @param view
* @return
*/
public static Bitmap convertViewToBitmap(View view) {
view.setDrawingCacheEnabled(true);
view.buildDrawingCache(); //启用DrawingCache并创建位图
Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache()); //创建一个DrawingCache的拷贝,因为DrawingCache得到的位图在禁用后会被回收
view.setDrawingCacheEnabled(false); //禁用DrawingCahce否则会影响性能
view.destroyDrawingCache();
return bitmap;
}
/**
* 截取长图
*
* @param view
* @return
*/
public static Bitmap getScrollViewBitmap(ViewGroup view) {
int h = 0;
for (int i = 0; i < view.getChildCount(); i++) {
h += view.getChildAt(i).getHeight();
}
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), h, Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
return bitmap;
}
/**
* 保存到本地图库
*
* @param context
* @param bitmap
*/
public static void saveImageToGallery(Context context, Bitmap bitmap) {
// Create screenshot directory if it doesn't exist
String dirName = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) + File.separator + "TMT";
File fileDir = new File(dirName);
if (!fileDir.exists()) {
fileDir.mkdir();
}
long mImageTime = System.currentTimeMillis();//取当前系统时间
// media provider uses seconds for DATE_MODIFIED and DATE_ADDED, but milliseconds
// for DATE_TAKEN
long dateSeconds = mImageTime / 1000;
String mImageFileName = dateSeconds + ".png"; //以保存时间命名
String mImageFilePath = dirName + File.separator + mImageFileName; //注意这里的mImageFilePath是: 目录名称+文件名
int mImageWidth = bitmap.getWidth();
int mImageHeight = bitmap.getHeight();
// Save the screenshot to the MediaStore
ContentValues values = new ContentValues();
ContentResolver resolver = context.getContentResolver();
values.put(MediaStore.Images.ImageColumns.DATA, mImageFilePath);
values.put(MediaStore.Images.ImageColumns.TITLE, mImageFileName);
values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, mImageFileName);
values.put(MediaStore.Images.ImageColumns.DATE_TAKEN, mImageTime);
values.put(MediaStore.Images.ImageColumns.DATE_ADDED, dateSeconds);
values.put(MediaStore.Images.ImageColumns.DATE_MODIFIED, dateSeconds);
values.put(MediaStore.Images.ImageColumns.MIME_TYPE, "image/png");
values.put(MediaStore.Images.ImageColumns.WIDTH, mImageWidth);
values.put(MediaStore.Images.ImageColumns.HEIGHT, mImageHeight);
Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
try {
OutputStream out = resolver.openOutputStream(uri);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
out.flush();
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// update file size in the database
values.clear();
values.put(MediaStore.Images.ImageColumns.SIZE, new File(mImageFilePath).length());
resolver.update(uri, values, null, null);
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/util/ScreenSizeUtil.java
================================================
package com.vivian.shadedemo.util;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.util.TypedValue;
public class ScreenSizeUtil {
private static DisplayMetrics metrics;
/**
* 根据绝对尺寸得到相对尺寸,在不同的分辨率设备上有一致的显示效果, dip->pix
*
* @param context
* @param givenAbsSize
* 绝对尺寸
* @return
*/
public static int getSizeByGivenAbsSize(Context context, int givenAbsSize) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, givenAbsSize, context.getResources().getDisplayMetrics());
}
private static DisplayMetrics getDisplayMetrics(Context context) {
if (metrics != null) {
return metrics;
}
metrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
return metrics;
}
public static int getScreenWidth(Context context) {
return getDisplayMetrics(context).widthPixels; // 屏幕宽度(像素)
}
public static int getScreenHeight(Context context) {
return getDisplayMetrics(context).heightPixels;// 屏幕高度(像素)
}
public static float getScreenDensity(Context context) {
return getDisplayMetrics(context).density; // 屏幕密度(0.75 / 1.0 / 1.5)
}
public static int getScreenDensityDpi(Context context) {
return getDisplayMetrics(context).densityDpi;// 屏幕密度DPI(120 / 160 / 240)
}
public static int Dp2Px(Context context, float dp) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f);
}
public static int Px2Dp(Context context, float px) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (px / scale + 0.5f);
}
/**
* 将px值转换为sp值,保证文字大小不变
*
* @param pxValue
* @return
*/
public static int px2sp(float pxValue, Context context) {
return (int) (pxValue / context.getResources().getDisplayMetrics().scaledDensity + 0.5f);
}
/**
* 将sp值转换为px值,保证文字大小不变
*
* @param spValue
* @return
*/
public static int sp2px(float spValue, Context context) {
return (int) (spValue * context.getResources().getDisplayMetrics().scaledDensity + 0.5f);
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/view/ShadowView.java
================================================
package com.vivian.shadedemo.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/11/30.
*/
public class ShadowView extends View {
// private Bitmap bitmap = null;
public ShadowView(Context context) {
super(context);
// bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.top);
setLayerType(View.LAYER_TYPE_SOFTWARE, null);//没有这句不显示
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// 建立Paint 物件
Paint paint3 = new Paint();
paint3.setColor(Color.WHITE);
paint3.setAntiAlias(true);
// 设定阴影(柔边, X 轴位移, Y 轴位移, 阴影颜色)
paint3.setShadowLayer(21, 0, 10, 0x2600A4A0);
// 实心矩形& 其阴影
canvas.drawCircle(400, 500, 96, paint3);
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/view/TopShadowView.java
================================================
package com.vivian.shadedemo.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/11/30.
*/
public class TopShadowView extends View {
int width = 400;
int height = 400;
int x=50;
int y=50;
public TopShadowView(Context context) {
super(context);
init(context);
}
public TopShadowView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public TopShadowView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
public TopShadowView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context);
}
public void init(Context context) {
setLayerType(View.LAYER_TYPE_SOFTWARE, null);//没有这句不显示
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
width=getWidth()-x*2;
height=getHeight()-y*2;
Paint paint = new Paint();
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
// 建立Paint 物件
Paint paint3 = new Paint();
paint3.setColor(Color.WHITE);
paint3.setAntiAlias(true);
// 设定阴影(柔边, X 轴位移, Y 轴位移, 阴影颜色)
paint3.setShadowLayer(21, 0, 10, 0x2600A4A0);
// 实心矩形& 其阴影
RectF rectF = new RectF(100, 100, width, height);
Path path=new Path();
path.addRoundRect(x,y,width,height,new float[]{10,10,10,10,0,0,0,0}, Path.Direction.CW);
canvas.drawPath(path, paint3);
canvas.drawRect(x,height,width,height+21,paint);
}
}
================================================
FILE: app/src/main/java/com/vivian/shadedemo/widget/CardView.java
================================================
package com.vivian.shadedemo.widget;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.vivian.shadedemo.R;
import com.vivian.shadedemo.drawable.BottomDrawable;
import com.vivian.shadedemo.drawable.CenterDrawable;
import com.vivian.shadedemo.drawable.TopDrawable;
import com.vivian.shadedemo.util.ScreenSizeUtil;
/**
* * _ _
* * __ _(_)_ _(_) __ _ _ __
* * \ \ / / \ \ / / |/ _` | '_ \
* * \ V /| |\ V /| | (_| | | | |
* * \_/ |_| \_/ |_|\__,_|_| |_|
* <p>
* Created by vivian on 2016/12/1.
*/
public class CardView extends LinearLayout {
RelativeLayout topLayout;
ImageView centerLayout;
TextView content;
EditText comment;
TopDrawable topDrawable;
CenterDrawable centerDrawable;
BottomDrawable bottomDrawable;
GradientDrawable myGrad;
public CardView(Context context) {
super(context);
init(context);
}
public CardView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public CardView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
public CardView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context);
}
public void init(final Context context) {
LinearLayout layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.card, null);
layout.setLayoutParams(new LinearLayout.LayoutParams(ScreenSizeUtil.Dp2Px(getContext(), 285), LayoutParams.WRAP_CONTENT));
layout.setLayerType(View.LAYER_TYPE_SOFTWARE, null);//没有这句不显示
topLayout = (RelativeLayout) layout.findViewById(R.id.top);
centerLayout = (ImageView) layout.findViewById(R.id.center);
content = (TextView) layout.findViewById(R.id.content);
comment = (EditText) layout.findViewById(R.id.comment);
myGrad = (GradientDrawable) content.getBackground();
topDrawable = new TopDrawable();
topLayout.setBackground(topDrawable);
centerDrawable = new CenterDrawable(BitmapFactory.decodeResource(getResources(), R.drawable.quote));
centerLayout.setBackground(centerDrawable);
bottomDrawable = new BottomDrawable();
comment.setBackground(bottomDrawable);
addView(layout);
}
public void changeTheme(final int color) {
//文字背景颜色
myGrad.setColor(color);
//顶部阴影颜色
topDrawable.setColor(color);
// 中部阴影颜色
centerDrawable.setColor(color);
// //底部阴影颜色
bottomDrawable.setColor(color);
}
@Override
public boolean hasOverlappingRendering() {
return false;
}
}
================================================
FILE: app/src/main/res/drawable/circle.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#3EA2A0"/>
<corners android:radius="200dp"/>
<padding android:bottom="15dp"/>
<padding android:top="15dp"/>
<padding android:left="15dp"/>
<padding android:right="15dp"/>
</shape>
</item>
</selector>
================================================
FILE: app/src/main/res/drawable/circle_retangle.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="3px"/>
<solid android:color="#3EA2A0"/>
</shape>
================================================
FILE: app/src/main/res/layout/activity_main_recyclerview.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/card.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="285dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="20dp">
<RelativeLayout
android:id="@+id/top"
android:layout_width="285dp"
android:layout_height="286dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp">
<TextView
android:id="@+id/content"
android:layout_width="271dp"
android:layout_height="246dp"
android:layout_marginLeft="17dp"
android:layout_marginRight="17dp"
android:layout_marginTop="17dp"
android:background="@drawable/circle_retangle"
android:gravity="center"
android:padding="20dp"
android:text="B站发展至今,已经不只是一个亚文化兴趣社群,已已经成为了一个为有创造力的年轻人提供创作环境和连接已经成为了一个为有创造力的年轻人提供创作环境和连接经成为了一个为有创造力的年轻人提供创作环境和连接功能的服务平台。如果想要了解现在的年轻人,去 B 站补番刷梗,可能会是最快的办法。如果想要成为一个有创造力的公司。"
android:textColor="@android:color/white"/>
</RelativeLayout>
<ImageView
android:id="@+id/center"
android:layout_width="285dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_height="10dp"
android:scaleType="matrix"
android:layout_gravity="center_horizontal"></ImageView>
<EditText
android:id="@+id/comment"
android:layout_width="285dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:gravity="left"
android:hint="请输入评论"
android:maxLines="5"
android:minLines="2"
android:padding="20dp"
android:textSize="12sp"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/icons.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.vivian.shadedemo.MainActivity">
<ImageView
android:id="@+id/like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/like"
android:background="@drawable/circle"
android:tint="@color/colorAccent"
android:backgroundTint="@android:color/white"
android:tintMode="src_in"
android:elevation="5dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/share"
android:layout_toEndOf="@+id/share"
android:layout_marginLeft="53dp"
android:layout_marginStart="53dp"/>
<ImageView
android:id="@+id/share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/share"
android:backgroundTint="@color/colorAccent"
android:background="@drawable/circle"
android:tint="@color/colorAccent"
android:elevation="5dp"
android:tintMode="add"
android:layout_below="@+id/share2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="27dp"/>
<ImageView
android:id="@+id/share2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/share_shade"
android:tint="@color/colorAccent"
android:tintMode="multiply"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
<ImageView
android:id="@+id/share3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/share"
android:scaleType="center"
android:padding="15dp"
android:background="@drawable/oval"
android:backgroundTint="@color/colorAccent"
android:tint="@color/colorAccent"
android:tintMode="add"
android:layout_alignTop="@+id/share"
android:layout_alignLeft="@+id/like"
android:layout_alignStart="@+id/like"/>
<!--<ScrollView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content">-->
<!--<LinearLayout-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="horizontal">-->
<!--<ImageView-->
<!--android:id="@+id/imageView"-->
<!--android:layout_width="100dp"-->
<!--android:layout_height="200dp"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentStart="true"-->
<!--android:layout_alignParentTop="true"-->
<!--android:src="@drawable/img_8658"-->
<!--android:tint="@color/colorAccent"-->
<!--android:tintMode="screen"/>-->
<!--<ImageView-->
<!--android:id="@+id/imageView"-->
<!--android:layout_width="100dp"-->
<!--android:layout_height="200dp"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentStart="true"-->
<!--android:layout_alignParentTop="true"-->
<!--android:src="@drawable/img_8658"-->
<!--android:tint="@color/colorAccent"-->
<!--android:tintMode="add"/>-->
<!--<ImageView-->
<!--android:id="@+id/imageView"-->
<!--android:layout_width="100dp"-->
<!--android:layout_height="200dp"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentStart="true"-->
<!--android:layout_alignParentTop="true"-->
<!--android:src="@drawable/img_8658"-->
<!--android:tint="@color/colorAccent"-->
<!--android:tintMode="multiply"/>-->
<!--<ImageView-->
<!--android:id="@+id/imageView"-->
<!--android:layout_width="100dp"-->
<!--android:layout_height="200dp"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentStart="true"-->
<!--android:layout_alignParentTop="true"-->
<!--android:src="@drawable/img_8658"-->
<!--android:tint="@color/colorAccent"-->
<!--android:tintMode="src_atop"/>-->
<!--</LinearLayout>-->
<!--</ScrollView>-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentStart="true"-->
<!--android:layout_centerVertical="true"-->
<!--android:layout_marginLeft="16dp"-->
<!--android:layout_marginStart="16dp"-->
<!--android:src="@mipmap/ic_launcher"-->
<!--android:tint="@color/colorPrimary"-->
<!--android:visibility="gone"-->
<!--/>-->
</RelativeLayout>
================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
<string name="app_name">ShadeDemo</string>
</resources>
================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
================================================
FILE: app/src/main/res/values-w820dp/dimens.xml
================================================
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available right. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
================================================
FILE: app/src/test/java/com/vivian/shadedemo/ExampleUnitTest.java
================================================
package com.vivian.shadedemo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-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.
org.gradle.jvmargs=-Xmx1536m
# 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
================================================
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
# 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\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
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"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# 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: settings.gradle
================================================
include ':app'
gitextract_zrmng5pq/ ├── .gitignore ├── .idea/ │ ├── compiler.xml │ ├── copyright/ │ │ └── profiles_settings.xml │ ├── dictionaries/ │ │ └── vivian.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── inspectionProfiles/ │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── com/ │ │ └── vivian/ │ │ └── shadedemo/ │ │ └── ExampleInstrumentedTest.java │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── vivian/ │ │ │ └── shadedemo/ │ │ │ ├── MainActivity.java │ │ │ ├── adapter/ │ │ │ │ └── CardViewAdapter.java │ │ │ ├── anim/ │ │ │ │ └── RecyclerViewItemAnimator.java │ │ │ ├── drawable/ │ │ │ │ ├── BottomDrawable.java │ │ │ │ ├── CenterDrawable.java │ │ │ │ ├── CircleShadowDrawable.java │ │ │ │ └── TopDrawable.java │ │ │ ├── entity/ │ │ │ │ └── Card.java │ │ │ ├── util/ │ │ │ │ ├── CardThemeUtil.java │ │ │ │ ├── ScreenShotUtil.java │ │ │ │ └── ScreenSizeUtil.java │ │ │ ├── view/ │ │ │ │ ├── ShadowView.java │ │ │ │ └── TopShadowView.java │ │ │ └── widget/ │ │ │ └── CardView.java │ │ └── res/ │ │ ├── drawable/ │ │ │ ├── circle.xml │ │ │ └── circle_retangle.xml │ │ ├── layout/ │ │ │ ├── activity_main_recyclerview.xml │ │ │ ├── card.xml │ │ │ └── icons.xml │ │ ├── values/ │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── values-w820dp/ │ │ └── dimens.xml │ └── test/ │ └── java/ │ └── com/ │ └── vivian/ │ └── shadedemo/ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle
SYMBOL INDEX (96 symbols across 16 files)
FILE: app/src/androidTest/java/com/vivian/shadedemo/ExampleInstrumentedTest.java
class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
method useAppContext (line 19) | @Test
FILE: app/src/main/java/com/vivian/shadedemo/MainActivity.java
class MainActivity (line 16) | public class MainActivity extends AppCompatActivity {
method onCreate (line 22) | @Override
method initViewRecyclerView (line 28) | public void initViewRecyclerView() {
FILE: app/src/main/java/com/vivian/shadedemo/adapter/CardViewAdapter.java
class CardViewAdapter (line 30) | public class CardViewAdapter extends RecyclerView.Adapter<CardViewAdapte...
method setData (line 35) | public void setData(List<Card> list) {
method CardViewAdapter (line 39) | public CardViewAdapter(Context context) {
method onCreateViewHolder (line 43) | @Override
method onBindViewHolder (line 50) | @Override
method getItemCount (line 74) | @Override
class ViewHolder (line 80) | static class ViewHolder extends RecyclerView.ViewHolder {
method ViewHolder (line 86) | ViewHolder(View view) {
FILE: app/src/main/java/com/vivian/shadedemo/anim/RecyclerViewItemAnimator.java
class RecyclerViewItemAnimator (line 17) | public class RecyclerViewItemAnimator extends RecyclerView.ItemAnimator{
method animateDisappearance (line 18) | @Override
method animateAppearance (line 23) | @Override
method animatePersistence (line 28) | @Override
method animateChange (line 33) | @Override
method runPendingAnimations (line 38) | @Override
method endAnimation (line 43) | @Override
method endAnimations (line 48) | @Override
method isRunning (line 53) | @Override
FILE: app/src/main/java/com/vivian/shadedemo/drawable/BottomDrawable.java
class BottomDrawable (line 23) | public class BottomDrawable extends Drawable {
method BottomDrawable (line 32) | public BottomDrawable() {
method setColor (line 44) | public void setColor(int color) {
method draw (line 51) | @Override
method onBoundsChange (line 57) | @Override
method setAlpha (line 65) | @Override
method setColorFilter (line 70) | @Override
method getOpacity (line 74) | @Override
FILE: app/src/main/java/com/vivian/shadedemo/drawable/CenterDrawable.java
class CenterDrawable (line 25) | public class CenterDrawable extends Drawable {
method CenterDrawable (line 36) | public CenterDrawable(Bitmap bitmap) {
method setColor (line 58) | public void setColor(int color){
method onBoundsChange (line 65) | @Override
method draw (line 79) | @Override
method setAlpha (line 97) | @Override
method setColorFilter (line 102) | @Override
method getOpacity (line 106) | @Override
FILE: app/src/main/java/com/vivian/shadedemo/drawable/CircleShadowDrawable.java
class CircleShadowDrawable (line 24) | public class CircleShadowDrawable extends Drawable {
method CircleShadowDrawable (line 30) | public CircleShadowDrawable(Context context){
method draw (line 34) | @Override
method setAlpha (line 43) | @Override
method setColorFilter (line 48) | @Override
method getOpacity (line 53) | @Override
FILE: app/src/main/java/com/vivian/shadedemo/drawable/TopDrawable.java
class TopDrawable (line 23) | public class TopDrawable extends Drawable {
method TopDrawable (line 32) | public TopDrawable() {
method setColor (line 44) | public void setColor(int color) {
method draw (line 51) | @Override
method onBoundsChange (line 57) | @Override
method setAlpha (line 64) | @Override
method setColorFilter (line 69) | @Override
method getOpacity (line 73) | @Override
FILE: app/src/main/java/com/vivian/shadedemo/entity/Card.java
class Card (line 13) | public class Card {
method getComment (line 17) | public String getComment() {
method setComment (line 21) | public void setComment(String comment) {
method getContent (line 25) | public String getContent() {
method setContent (line 29) | public void setContent(String content) {
FILE: app/src/main/java/com/vivian/shadedemo/util/CardThemeUtil.java
class CardThemeUtil (line 24) | public class CardThemeUtil {
method colorMatrixFilter (line 26) | public Drawable colorMatrixFilter(Context context,int res, int color) {
method colorFilter (line 53) | public Drawable colorFilter(Context context,int res) {
method drawableToBitmap (line 82) | public static Bitmap drawableToBitmap(Drawable drawable) {
FILE: app/src/main/java/com/vivian/shadedemo/util/ScreenShotUtil.java
class ScreenShotUtil (line 29) | public class ScreenShotUtil {
method convertViewToBitmap (line 36) | public static Bitmap convertViewToBitmap(View view) {
method getScrollViewBitmap (line 50) | public static Bitmap getScrollViewBitmap(ViewGroup view) {
method saveImageToGallery (line 67) | public static void saveImageToGallery(Context context, Bitmap bitmap) {
FILE: app/src/main/java/com/vivian/shadedemo/util/ScreenSizeUtil.java
class ScreenSizeUtil (line 8) | public class ScreenSizeUtil {
method getSizeByGivenAbsSize (line 20) | public static int getSizeByGivenAbsSize(Context context, int givenAbsS...
method getDisplayMetrics (line 24) | private static DisplayMetrics getDisplayMetrics(Context context) {
method getScreenWidth (line 33) | public static int getScreenWidth(Context context) {
method getScreenHeight (line 37) | public static int getScreenHeight(Context context) {
method getScreenDensity (line 41) | public static float getScreenDensity(Context context) {
method getScreenDensityDpi (line 45) | public static int getScreenDensityDpi(Context context) {
method Dp2Px (line 49) | public static int Dp2Px(Context context, float dp) {
method Px2Dp (line 54) | public static int Px2Dp(Context context, float px) {
method px2sp (line 65) | public static int px2sp(float pxValue, Context context) {
method sp2px (line 75) | public static int sp2px(float spValue, Context context) {
FILE: app/src/main/java/com/vivian/shadedemo/view/ShadowView.java
class ShadowView (line 19) | public class ShadowView extends View {
method ShadowView (line 22) | public ShadowView(Context context) {
method onDraw (line 28) | @Override
FILE: app/src/main/java/com/vivian/shadedemo/view/TopShadowView.java
class TopShadowView (line 22) | public class TopShadowView extends View {
method TopShadowView (line 29) | public TopShadowView(Context context) {
method TopShadowView (line 34) | public TopShadowView(Context context, AttributeSet attrs) {
method TopShadowView (line 39) | public TopShadowView(Context context, AttributeSet attrs, int defStyle...
method TopShadowView (line 44) | public TopShadowView(Context context, AttributeSet attrs, int defStyle...
method init (line 49) | public void init(Context context) {
method onDraw (line 53) | @Override
FILE: app/src/main/java/com/vivian/shadedemo/widget/CardView.java
class CardView (line 31) | public class CardView extends LinearLayout {
method CardView (line 42) | public CardView(Context context) {
method CardView (line 47) | public CardView(Context context, AttributeSet attrs) {
method CardView (line 52) | public CardView(Context context, AttributeSet attrs, int defStyleAttr) {
method CardView (line 57) | public CardView(Context context, AttributeSet attrs, int defStyleAttr,...
method init (line 62) | public void init(final Context context) {
method changeTheme (line 85) | public void changeTheme(final int color) {
method hasOverlappingRendering (line 96) | @Override
FILE: app/src/test/java/com/vivian/shadedemo/ExampleUnitTest.java
class ExampleUnitTest (line 12) | public class ExampleUnitTest {
method addition_isCorrect (line 13) | @Test
Condensed preview — 50 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (93K chars).
[
{
"path": ".gitignore",
"chars": 118,
"preview": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
},
{
"path": ".idea/compiler.xml",
"chars": 709,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"CompilerConfiguration\">\n <option name"
},
{
"path": ".idea/copyright/profiles_settings.xml",
"chars": 74,
"preview": "<component name=\"CopyrightManager\">\n <settings default=\"\" />\n</component>"
},
{
"path": ".idea/dictionaries/vivian.xml",
"chars": 85,
"preview": "<component name=\"ProjectDictionaryState\">\n <dictionary name=\"vivian\" />\n</component>"
},
{
"path": ".idea/encodings.xml",
"chars": 159,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"Encoding\">\n <file url=\"PROJECT\" chars"
},
{
"path": ".idea/gradle.xml",
"chars": 626,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"GradleSettings\">\n <option name=\"linke"
},
{
"path": ".idea/inspectionProfiles/Project_Default.xml",
"chars": 21786,
"preview": "<component name=\"InspectionProjectProfileManager\">\n <profile version=\"1.0\">\n <option name=\"myName\" value=\"Project De"
},
{
"path": ".idea/inspectionProfiles/profiles_settings.xml",
"chars": 235,
"preview": "<component name=\"InspectionProjectProfileManager\">\n <settings>\n <option name=\"PROJECT_PROFILE\" value=\"Project Defaul"
},
{
"path": ".idea/misc.xml",
"chars": 4809,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"EntryPointsManager\">\n <entry_points v"
},
{
"path": ".idea/modules.xml",
"chars": 355,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectModuleManager\">\n <modules>\n "
},
{
"path": ".idea/runConfigurations.xml",
"chars": 564,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"RunConfigurationProducerService\">\n <o"
},
{
"path": ".idea/vcs.xml",
"chars": 180,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"VcsDirectoryMappings\">\n <mapping dire"
},
{
"path": "README.md",
"chars": 640,
"preview": "# CardView\n类似小票效果的卡片列表,并且可以修改阴影颜色\n\n# Usage\n可以直接引用CardView\n```\nCardView cardView=new CardView(context);\n//修改CardView的主题颜色"
},
{
"path": "app/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "app/build.gradle",
"chars": 925,
"preview": "apply plugin: 'com.android.application'\n\nandroid {\n compileSdkVersion 25\n buildToolsVersion \"24.0.3\"\n defaultCo"
},
{
"path": "app/proguard-rules.pro",
"chars": 666,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
},
{
"path": "app/src/androidTest/java/com/vivian/shadedemo/ExampleInstrumentedTest.java",
"chars": 744,
"preview": "package com.vivian.shadedemo;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimpo"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 664,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n pa"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/MainActivity.java",
"chars": 1674,
"preview": "package com.vivian.shadedemo;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/adapter/CardViewAdapter.java",
"chars": 2770,
"preview": "package com.vivian.shadedemo.adapter;\n\nimport android.content.Context;\nimport android.support.v7.widget.RecyclerView;\nim"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/anim/RecyclerViewItemAnimator.java",
"chars": 1612,
"preview": "package com.vivian.shadedemo.anim;\n\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullabl"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/drawable/BottomDrawable.java",
"chars": 1937,
"preview": "package com.vivian.shadedemo.drawable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.gr"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/drawable/CenterDrawable.java",
"chars": 3055,
"preview": "package com.vivian.shadedemo.drawable;\n\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.g"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/drawable/CircleShadowDrawable.java",
"chars": 1376,
"preview": "package com.vivian.shadedemo.drawable;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.g"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/drawable/TopDrawable.java",
"chars": 1928,
"preview": "package com.vivian.shadedemo.drawable;\n\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.gr"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/entity/Card.java",
"chars": 637,
"preview": "package com.vivian.shadedemo.entity;\n\n/**\n * * _ _\n * * __ _(_)_ _(_) __ _ _ __\n * * \\ \\ / / \\ \\ "
},
{
"path": "app/src/main/java/com/vivian/shadedemo/util/CardThemeUtil.java",
"chars": 3286,
"preview": "package com.vivian.shadedemo.util;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graph"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/util/ScreenShotUtil.java",
"chars": 4113,
"preview": "package com.vivian.shadedemo.util;\n\nimport android.content.ContentResolver;\nimport android.content.ContentValues;\nimport"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/util/ScreenSizeUtil.java",
"chars": 2133,
"preview": "package com.vivian.shadedemo.util;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.util.Dis"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/view/ShadowView.java",
"chars": 1093,
"preview": "package com.vivian.shadedemo.view;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graph"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/view/TopShadowView.java",
"chars": 2091,
"preview": "package com.vivian.shadedemo.view;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graph"
},
{
"path": "app/src/main/java/com/vivian/shadedemo/widget/CardView.java",
"chars": 3129,
"preview": "package com.vivian.shadedemo.widget;\n\nimport android.content.Context;\nimport android.graphics.BitmapFactory;\nimport andr"
},
{
"path": "app/src/main/res/drawable/circle.xml",
"chars": 442,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item>"
},
{
"path": "app/src/main/res/drawable/circle_retangle.xml",
"chars": 188,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <corners a"
},
{
"path": "app/src/main/res/layout/activity_main_recyclerview.xml",
"chars": 450,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "app/src/main/res/layout/card.xml",
"chars": 2080,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "app/src/main/res/layout/icons.xml",
"chars": 5210,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 208,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"colorPrimary\">#3F51B5</color>\n <color name=\"color"
},
{
"path": "app/src/main/res/values/dimens.xml",
"chars": 211,
"preview": "<resources>\n <!-- Default screen margins, per the Android Design guidelines. -->\n <dimen name=\"activity_horizontal"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 72,
"preview": "<resources>\n <string name=\"app_name\">ShadeDemo</string>\n</resources>\n"
},
{
"path": "app/src/main/res/values/styles.xml",
"chars": 383,
"preview": "<resources>\n\n <!-- Base application theme. -->\n <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
},
{
"path": "app/src/main/res/values-w820dp/dimens.xml",
"chars": 358,
"preview": "<resources>\n <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n (such as s"
},
{
"path": "app/src/test/java/com/vivian/shadedemo/ExampleUnitTest.java",
"chars": 398,
"preview": "package com.vivian.shadedemo;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test"
},
{
"path": "build.gradle",
"chars": 498,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n r"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 233,
"preview": "#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "gradle.properties",
"chars": 730,
"preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
},
{
"path": "gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "settings.gradle",
"chars": 15,
"preview": "include ':app'\n"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the vivian8725118/CardView GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 50 files (81.0 KB), approximately 22.5k tokens, and a symbol index with 96 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.