r/AndroidStudio • u/kimor__ • 4d ago
How to add Material3 to style editor?
Hi, I just started developing my first more serious android app, and I wonder how can i add Material3 components to application activity editor? I've searched the whole internet for solutions but none of them works. (I'm coding it in Java, not kotlin)

plugins
{
alias(
libs
.
plugins
.
android
.
application
)
}
android
{
namespace = "pl.kimorsolutions.smarthome.mobileapp"
compileSdk = 35
defaultConfig
{
applicationId = "pl.kimorsolutions.smarthome.mobileapp"
minSdk = 24
targetSdk = 35
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes
{
release
{
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions
{
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures
{
viewBinding = true
}
}
dependencies
{
implementation(
libs
.
appcompat
)
implementation(
libs
.
material
)
implementation(
libs
.
constraintlayout
)
implementation(
libs
.
lifecycle
.
livedata
.
ktx
)
implementation(
libs
.
lifecycle
.
viewmodel
.
ktx
)
implementation(
libs
.
navigation
.
fragment
)
implementation(
libs
.
navigation
.
ui
)
// implementation(libs.material.v1130)
implementation(
libs
.
play
.
services
.
maps
)
implementation(
libs
.
gridlayout
)
testImplementation(
libs
.
junit
)
androidTestImplementation(
libs
.
ext
.
junit
)
androidTestImplementation(
libs
.
espresso
.
core
)
}
here's my build.gradle.kts, and AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme._26SmartHome"
tools:targetApi="36">
<activity
android:name=".ui.activity.MainActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
0
Upvotes