Skip to content

Commit 2afd7cf

Browse files
authored
Merge branch 'master' into remove_multidex
2 parents 2c868d7 + c30c2d8 commit 2afd7cf

File tree

530 files changed

+7188
-2483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

530 files changed

+7188
-2483
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ext {
2929
? project.property('mavenRepoUrl') : '/tmp/myRepo/')
3030

3131
// Current version of the library (could be in-development/unreleased).
32-
mdcLibraryVersion = '1.14.0-alpha02'
32+
mdcLibraryVersion = '1.14.0-alpha04'
3333
mdcLibraryPackage = "com.google.android.material"
3434
mdcLibraryDir = "com/google/android/material"
3535
}

catalog/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath 'org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:2.1.0'
7+
classpath 'org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:2.2.0'
88
}
99
}
1010

1111
plugins {
1212
id 'com.android.application'
1313
id 'org.jetbrains.kotlin.android' version "2.1.21"
14-
id 'org.jetbrains.kotlin.plugin.compose' version "2.1.0"
14+
id 'org.jetbrains.kotlin.plugin.compose' version "2.2.0"
1515
}
1616

1717
dependencies {
1818

1919
// Align kotlin versions
20-
implementation(platform('org.jetbrains.kotlin:kotlin-bom:2.1.0'))
20+
implementation(platform('org.jetbrains.kotlin:kotlin-bom:2.2.0'))
2121

2222
api libs.dagger
2323
annotationProcessor libs.dagger.compiler
@@ -96,6 +96,7 @@ def srcDirs = [
9696
'font',
9797
'internal',
9898
'loadingindicator',
99+
'listitem',
99100
'main',
100101
'materialswitch',
101102
'menu',
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Copyright 2025 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:width="24dp"
18+
android:height="24dp"
19+
android:viewportWidth="960"
20+
android:viewportHeight="960"
21+
android:tint="?attr/colorControlNormal">
22+
<path
23+
android:fillColor="@android:color/white"
24+
android:pathData="M320,720L480,598L640,720L580,522L740,408L544,408L480,200L416,408L220,408L380,522L320,720ZM480,880Q397,880 324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880ZM480,800Q614,800 707,707Q800,614 800,480Q800,346 707,253Q614,160 480,160Q346,160 253,253Q160,346 160,480Q160,614 253,707Q346,800 480,800ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>
25+
</vector>

catalog/java/io/material/catalog/fab/ExtendedFabDemoFragment.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
import android.widget.Button;
2626
import androidx.annotation.LayoutRes;
2727
import androidx.annotation.Nullable;
28+
import androidx.core.graphics.Insets;
29+
import androidx.core.view.ViewCompat;
30+
import androidx.core.view.WindowInsetsCompat;
2831
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
2932
import com.google.android.material.snackbar.Snackbar;
3033
import io.material.catalog.feature.DemoFragment;
@@ -45,6 +48,14 @@ public View onCreateDemoView(
4548
layoutInflater.inflate(
4649
R.layout.cat_extended_fab_fragment, viewGroup, false /* attachToRoot */);
4750

51+
ViewCompat.setOnApplyWindowInsetsListener(
52+
root,
53+
(v, insets) -> {
54+
Insets navBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars());
55+
v.setPadding(0, 0, 0, navBarInsets.bottom);
56+
return insets;
57+
});
58+
4859
ViewGroup content = root.findViewById(R.id.content);
4960
View.inflate(getContext(), getExtendedFabContent(), content);
5061

catalog/java/io/material/catalog/fab/FabMainDemoFragment.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import android.widget.Button;
2727
import androidx.annotation.LayoutRes;
2828
import androidx.annotation.Nullable;
29+
import androidx.core.graphics.Insets;
30+
import androidx.core.view.ViewCompat;
31+
import androidx.core.view.WindowInsetsCompat;
2932
import com.google.android.material.floatingactionbutton.FloatingActionButton;
3033
import com.google.android.material.snackbar.Snackbar;
3134
import io.material.catalog.feature.DemoFragment;
@@ -43,6 +46,14 @@ public View onCreateDemoView(
4346
View view =
4447
layoutInflater.inflate(R.layout.cat_fab_fragment, viewGroup, false /* attachToRoot */);
4548

49+
ViewCompat.setOnApplyWindowInsetsListener(
50+
view,
51+
(v, insets) -> {
52+
Insets navBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars());
53+
v.setPadding(0, 0, 0, navBarInsets.bottom);
54+
return insets;
55+
});
56+
4657
ViewGroup content = view.findViewById(R.id.content);
4758
View.inflate(getContext(), getFabsContent(), content);
4859
View.inflate(getContext(), getThemeFabLayoutResId(), content);

catalog/java/io/material/catalog/fab/res/layout/cat_extended_fab_fragment.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,4 @@
5454
android:layout_margin="8dp"
5555
android:text="@string/shrink_fabs_label"/>
5656
</LinearLayout>
57-
58-
<io.material.catalog.feature.BottomWindowInsetView
59-
android:layout_width="match_parent"
60-
android:layout_height="0dp" />
6157
</LinearLayout>

catalog/java/io/material/catalog/fab/res/layout/cat_fab_fragment.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,4 @@
6161
android:text="@string/rotate_fabs_label"/>
6262
</LinearLayout>
6363

64-
65-
<io.material.catalog.feature.BottomWindowInsetView
66-
android:layout_width="wrap_content"
67-
android:layout_height="0dp"
68-
/>
69-
7064
</LinearLayout>

catalog/java/io/material/catalog/feature/BottomWindowInsetView.java

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package io.material.catalog.listitem;
17+
18+
/** A sample data class used to represent List Items **/
19+
class CustomListItemData {
20+
String text;
21+
boolean checked;
22+
int indexInSection;
23+
int sectionCount;
24+
String subheading;
25+
26+
public CustomListItemData(String text, int indexInSection, int sectionCount) {
27+
this.text = text;
28+
this.indexInSection = indexInSection;
29+
this.sectionCount = sectionCount;
30+
}
31+
32+
public CustomListItemData(String subheading) {
33+
this.subheading = subheading;
34+
}
35+
}

catalog/java/io/material/catalog/lists/ListsFragment.java renamed to catalog/java/io/material/catalog/listitem/ListsFragment.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
package io.material.catalog.lists;
17+
package io.material.catalog.listitem;
1818

1919
import io.material.catalog.R;
2020

2121
import androidx.fragment.app.Fragment;
22+
import androidx.annotation.NonNull;
2223
import dagger.Provides;
2324
import dagger.android.ContributesAndroidInjector;
2425
import dagger.multibindings.IntoSet;
@@ -27,6 +28,8 @@
2728
import io.material.catalog.feature.Demo;
2829
import io.material.catalog.feature.DemoLandingFragment;
2930
import io.material.catalog.feature.FeatureDemo;
31+
import java.util.ArrayList;
32+
import java.util.List;
3033

3134
/** A landing fragment that links to List demos for the Catalog app. */
3235
public class ListsFragment extends DemoLandingFragment {
@@ -42,6 +45,7 @@ public int getDescriptionResId() {
4245
}
4346

4447
@Override
48+
@NonNull
4549
public Demo getMainDemo() {
4650
return new Demo() {
4751
@Override
@@ -51,6 +55,27 @@ public Fragment createFragment() {
5155
};
5256
}
5357

58+
@Override
59+
@NonNull
60+
public List<Demo> getAdditionalDemos() {
61+
List<Demo> additionalDemos = new ArrayList<>();
62+
additionalDemos.add(
63+
new Demo(R.string.cat_lists_segmented_demo_title) {
64+
@Override
65+
public Fragment createFragment() {
66+
return new SegmentedListDemoFragment();
67+
}
68+
});
69+
additionalDemos.add(
70+
new Demo(R.string.cat_lists_multi_section_demo_title) {
71+
@Override
72+
public Fragment createFragment() {
73+
return new MultiSectionListDemoFragment();
74+
}
75+
});
76+
return additionalDemos;
77+
}
78+
5479
/** The Dagger module for {@link ListsFragment} dependencies. */
5580
@dagger.Module
5681
public abstract static class Module {

0 commit comments

Comments
 (0)