This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor common theme adapter logic into :core module
- Loading branch information
Nick Rout
committed
Nov 10, 2022
1 parent
b56f30b
commit 23a59b4
Showing
17 changed files
with
276 additions
and
598 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
public final class com/google/android/material/composethemeadapter/core/FontFamilyWithWeight { | ||
public static final field $stable I | ||
public fun <init> (Landroidx/compose/ui/text/font/FontFamily;Landroidx/compose/ui/text/font/FontWeight;)V | ||
public synthetic fun <init> (Landroidx/compose/ui/text/font/FontFamily;Landroidx/compose/ui/text/font/FontWeight;ILkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public final fun component1 ()Landroidx/compose/ui/text/font/FontFamily; | ||
public final fun component2 ()Landroidx/compose/ui/text/font/FontWeight; | ||
public final fun copy (Landroidx/compose/ui/text/font/FontFamily;Landroidx/compose/ui/text/font/FontWeight;)Lcom/google/android/material/composethemeadapter/core/FontFamilyWithWeight; | ||
public static synthetic fun copy$default (Lcom/google/android/material/composethemeadapter/core/FontFamilyWithWeight;Landroidx/compose/ui/text/font/FontFamily;Landroidx/compose/ui/text/font/FontWeight;ILjava/lang/Object;)Lcom/google/android/material/composethemeadapter/core/FontFamilyWithWeight; | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getFontFamily ()Landroidx/compose/ui/text/font/FontFamily; | ||
public final fun getWeight ()Landroidx/compose/ui/text/font/FontWeight; | ||
public fun hashCode ()I | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
||
public final class com/google/android/material/composethemeadapter/core/ResourceUtilsKt { | ||
public static final fun getComposeColor-mxwnekA (Landroid/content/res/TypedArray;IJ)J | ||
public static synthetic fun getComposeColor-mxwnekA$default (Landroid/content/res/TypedArray;IJILjava/lang/Object;)J | ||
public static final fun getCornerSizeOrNull (Landroid/content/res/TypedArray;I)Landroidx/compose/foundation/shape/CornerSize; | ||
public static final fun getFontFamilyOrNull (Landroid/content/res/TypedArray;I)Lcom/google/android/material/composethemeadapter/core/FontFamilyWithWeight; | ||
public static final fun getTextUnit-lGoEivg (Landroid/content/res/TypedArray;ILandroidx/compose/ui/unit/Density;J)J | ||
public static synthetic fun getTextUnit-lGoEivg$default (Landroid/content/res/TypedArray;ILandroidx/compose/ui/unit/Density;JILjava/lang/Object;)J | ||
public static final fun getTextUnitOrNull (Landroid/content/res/TypedArray;ILandroidx/compose/ui/unit/Density;)Landroidx/compose/ui/unit/TextUnit; | ||
public static final fun parseShapeAppearance (Landroid/content/Context;ILandroidx/compose/foundation/shape/CornerBasedShape;Landroidx/compose/ui/unit/LayoutDirection;)Landroidx/compose/foundation/shape/CornerBasedShape; | ||
public static final fun textStyleFromTextAppearance (Landroid/content/Context;Landroidx/compose/ui/unit/Density;IZLandroidx/compose/ui/text/font/FontFamily;)Landroidx/compose/ui/text/TextStyle; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2020 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import com.google.android.material.composethemeadapter.Libs | ||
|
||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
id 'org.jetbrains.dokka' | ||
} | ||
|
||
android { | ||
compileSdkVersion 33 | ||
|
||
defaultConfig { | ||
minSdkVersion 21 | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
buildFeatures { | ||
compose true | ||
buildConfig false | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion Libs.AndroidX.Compose.compilerVersion | ||
} | ||
} | ||
|
||
dependencies { | ||
api Libs.Kotlin.stdlib | ||
api Libs.AndroidX.coreKtx | ||
api Libs.AndroidX.appcompat | ||
api Libs.mdc | ||
api Libs.AndroidX.Compose.runtime | ||
api Libs.AndroidX.Compose.foundation | ||
|
||
androidTestImplementation Libs.junit | ||
androidTestImplementation Libs.AndroidX.Compose.test | ||
androidTestImplementation Libs.AndroidX.Test.rules | ||
androidTestImplementation Libs.AndroidX.Test.runner | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- | ||
~ Copyright 2020 The Android Open Source Project | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ https://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<manifest package="com.google.android.material.composethemeadapter.core"> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ Copyright 2020 The Android Open Source Project | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<resources> | ||
|
||
<declare-styleable name="ComposeThemeAdapterTextAppearance"> | ||
<attr name="android:textColor" /> | ||
<attr name="android:textSize" /> | ||
<attr name="android:textStyle" /> | ||
<attr name="android:textFontWeight" /> | ||
<attr name="android:typeface" /> | ||
<attr name="android:shadowColor" /> | ||
<attr name="android:shadowDx" /> | ||
<attr name="android:shadowDy" /> | ||
<attr name="android:shadowRadius" /> | ||
<attr name="lineHeight" /> | ||
<attr name="android:lineHeight" /> | ||
<attr name="android:letterSpacing" /> | ||
<attr name="android:fontFeatureSettings" /> | ||
<attr name="android:fontFamily" /> | ||
<attr name="fontFamily" /> | ||
<!-- TODOs below --> | ||
<attr name="android:fontVariationSettings" /> | ||
</declare-styleable> | ||
|
||
<declare-styleable name="ComposeThemeAdapterShapeAppearance"> | ||
<attr name="cornerSize" /> | ||
<attr name="cornerSizeTopLeft" /> | ||
<attr name="cornerSizeTopRight" /> | ||
<attr name="cornerSizeBottomRight" /> | ||
<attr name="cornerSizeBottomLeft" /> | ||
<attr name="cornerFamily" /> | ||
</declare-styleable> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.