Skip to content

Commit 023e072

Browse files
authored
Add Content Sizing Sample (#2787)
This is a sample add-to-app Android project based off the existing add-to-app Android sample project. This one makes minor changes to show how content-sizing can be achieved. Adding a content resizing sample for Android to support flutter/flutter#179753
1 parent c4b4adc commit 023e072

48 files changed

Lines changed: 1687 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# android_view
2+
3+
An example of an Android app that integrates a Flutter add-to-app module at a
4+
view level. For more information see [../README.md](../README.md).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
5+
6+
android {
7+
compileSdk 36
8+
9+
lint {
10+
baseline = file("lint-baseline.xml")
11+
}
12+
13+
defaultConfig {
14+
applicationId "dev.flutter.example.androidView"
15+
minSdkVersion 24
16+
targetSdk 36
17+
versionCode 1
18+
versionName "1.0"
19+
20+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21+
}
22+
23+
buildTypes {
24+
release {
25+
minifyEnabled false
26+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
27+
}
28+
}
29+
compileOptions {
30+
sourceCompatibility JavaVersion.VERSION_1_8
31+
targetCompatibility JavaVersion.VERSION_1_8
32+
}
33+
kotlinOptions {
34+
jvmTarget = '1.8'
35+
}
36+
buildFeatures {
37+
viewBinding true
38+
}
39+
namespace 'dev.flutter.example.androidView'
40+
}
41+
42+
dependencies {
43+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
44+
implementation 'androidx.core:core-ktx:1.13.1'
45+
implementation 'androidx.appcompat:appcompat:1.7.0'
46+
implementation 'com.google.android.material:material:1.12.0'
47+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
48+
implementation 'androidx.vectordrawable:vectordrawable:1.2.0'
49+
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.4'
50+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4'
51+
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
52+
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
53+
implementation "androidx.recyclerview:recyclerview:1.3.2"
54+
implementation project(path: ':flutter')
55+
testImplementation 'junit:junit:4.+'
56+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
57+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
58+
}
Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<issues format="6" by="lint 7.4.2" type="baseline" client="gradle" dependencies="false" name="AGP (7.4.2)" variant="all" version="7.4.2">
3+
4+
<issue
5+
id="RedundantLabel"
6+
message="Redundant label can be removed"
7+
errorLine1=" android:label=&quot;@string/app_name&quot;>"
8+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
9+
<location
10+
file="src/main/AndroidManifest.xml"
11+
line="14"
12+
column="13"/>
13+
</issue>
14+
15+
<issue
16+
id="GradleDependency"
17+
message="A newer version of org.jetbrains.kotlin:kotlin-stdlib than 1.8.22 is available: 1.9.20"
18+
errorLine1="}"
19+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
20+
<location
21+
file="build.gradle"
22+
line="39"
23+
column="20"/>
24+
</issue>
25+
26+
<issue
27+
id="GradleDependency"
28+
message="A newer version of androidx.core:core-ktx than 1.3.2 is available: 1.13.1"
29+
errorLine1=""
30+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
31+
<location
32+
file="build.gradle"
33+
line="40"
34+
column="20"/>
35+
</issue>
36+
37+
<issue
38+
id="GradleDependency"
39+
message="A newer version of androidx.appcompat:appcompat than 1.2.0 is available: 1.7.0"
40+
errorLine1="dependencies {"
41+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
42+
<location
43+
file="build.gradle"
44+
line="41"
45+
column="20"/>
46+
</issue>
47+
48+
<issue
49+
id="GradleDependency"
50+
message="A newer version of com.google.android.material:material than 1.2.1 is available: 1.12.0"
51+
errorLine1=" implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version&quot;"
52+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
53+
<location
54+
file="build.gradle"
55+
line="42"
56+
column="20"/>
57+
</issue>
58+
59+
<issue
60+
id="GradleDependency"
61+
message="A newer version of androidx.constraintlayout:constraintlayout than 2.0.4 is available: 2.1.4"
62+
errorLine1=" implementation &apos;androidx.core:core-ktx:1.3.2&apos;"
63+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
64+
<location
65+
file="build.gradle"
66+
line="43"
67+
column="20"/>
68+
</issue>
69+
70+
<issue
71+
id="GradleDependency"
72+
message="A newer version of androidx.vectordrawable:vectordrawable than 1.1.0 is available: 1.2.0"
73+
errorLine1=" implementation &apos;androidx.appcompat:appcompat:1.2.0&apos;"
74+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
75+
<location
76+
file="build.gradle"
77+
line="44"
78+
column="20"/>
79+
</issue>
80+
81+
<issue
82+
id="GradleDependency"
83+
message="A newer version of androidx.lifecycle:lifecycle-livedata-ktx than 2.2.0 is available: 2.8.2"
84+
errorLine1=" implementation &apos;com.google.android.material:material:1.2.1&apos;"
85+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
86+
<location
87+
file="build.gradle"
88+
line="45"
89+
column="20"/>
90+
</issue>
91+
92+
<issue
93+
id="GradleDependency"
94+
message="A newer version of androidx.lifecycle:lifecycle-viewmodel-ktx than 2.2.0 is available: 2.8.2"
95+
errorLine1=" implementation &apos;androidx.constraintlayout:constraintlayout:2.0.4&apos;"
96+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
97+
<location
98+
file="build.gradle"
99+
line="46"
100+
column="20"/>
101+
</issue>
102+
103+
<issue
104+
id="GradleDependency"
105+
message="A newer version of androidx.navigation:navigation-fragment-ktx than 2.3.2 is available: 2.7.7"
106+
errorLine1=" implementation &apos;androidx.vectordrawable:vectordrawable:1.1.0&apos;"
107+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
108+
<location
109+
file="build.gradle"
110+
line="47"
111+
column="20"/>
112+
</issue>
113+
114+
<issue
115+
id="GradleDependency"
116+
message="A newer version of androidx.navigation:navigation-ui-ktx than 2.3.2 is available: 2.7.7"
117+
errorLine1=" implementation &apos;androidx.lifecycle:lifecycle-livedata-ktx:2.2.0&apos;"
118+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
119+
<location
120+
file="build.gradle"
121+
line="48"
122+
column="20"/>
123+
</issue>
124+
125+
<issue
126+
id="GradleDependency"
127+
message="A newer version of androidx.recyclerview:recyclerview than 1.1.0 is available: 1.3.2"
128+
errorLine1=" implementation &apos;androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0&apos;"
129+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
130+
<location
131+
file="build.gradle"
132+
line="49"
133+
column="20"/>
134+
</issue>
135+
136+
<issue
137+
id="GradleDependency"
138+
message="A newer version of androidx.test.ext:junit than 1.1.2 is available: 1.1.5"
139+
errorLine1=" implementation &quot;androidx.recyclerview:recyclerview:1.1.0&quot;"
140+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
141+
<location
142+
file="build.gradle"
143+
line="52"
144+
column="31"/>
145+
</issue>
146+
147+
<issue
148+
id="GradleDependency"
149+
message="A newer version of androidx.test.espresso:espresso-core than 3.3.0 is available: 3.5.1"
150+
errorLine1=" implementation project(path: &apos;:flutter&apos;)"
151+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
152+
<location
153+
file="build.gradle"
154+
line="53"
155+
column="31"/>
156+
</issue>
157+
158+
<issue
159+
id="GradleDynamicVersion"
160+
message="Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (junit:junit:4.+)"
161+
errorLine1=" implementation &apos;androidx.navigation:navigation-ui-ktx:2.3.2&apos;"
162+
errorLine2=" ~~~~~~~~~~~~~~~~~">
163+
<location
164+
file="build.gradle"
165+
line="51"
166+
column="24"/>
167+
</issue>
168+
169+
<issue
170+
id="ExpiredTargetSdkVersion"
171+
message="Google Play requires that apps target API level 31 or higher.&#xA;"
172+
errorLine1=" defaultConfig {"
173+
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
174+
<location
175+
file="build.gradle"
176+
line="12"
177+
column="9"/>
178+
</issue>
179+
180+
<issue
181+
id="ObsoleteSdkInt"
182+
message="Unnecessary; SDK_INT is always >= 21"
183+
errorLine1=" &lt;item name=&quot;android:statusBarColor&quot; tools:targetApi=&quot;l&quot;>?attr/colorPrimaryVariant&lt;/item>"
184+
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
185+
<location
186+
file="src/main/res/values-night/themes.xml"
187+
line="13"
188+
column="45"/>
189+
</issue>
190+
191+
<issue
192+
id="ObsoleteSdkInt"
193+
message="Unnecessary; SDK_INT is always >= 21"
194+
errorLine1=" &lt;item name=&quot;android:statusBarColor&quot; tools:targetApi=&quot;l&quot;>?attr/colorPrimaryVariant&lt;/item>"
195+
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
196+
<location
197+
file="src/main/res/values/themes.xml"
198+
line="13"
199+
column="45"/>
200+
</issue>
201+
202+
<issue
203+
id="UnusedResources"
204+
message="The resource `R.dimen.activity_horizontal_margin` appears to be unused"
205+
errorLine1=" &lt;dimen name=&quot;activity_horizontal_margin&quot;>16dp&lt;/dimen>"
206+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
207+
<location
208+
file="src/main/res/values/dimens.xml"
209+
line="3"
210+
column="12"/>
211+
</issue>
212+
213+
<issue
214+
id="UnusedResources"
215+
message="The resource `R.dimen.activity_vertical_margin` appears to be unused"
216+
errorLine1=" &lt;dimen name=&quot;activity_vertical_margin&quot;>16dp&lt;/dimen>"
217+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
218+
<location
219+
file="src/main/res/values/dimens.xml"
220+
line="4"
221+
column="12"/>
222+
</issue>
223+
224+
<issue
225+
id="UnusedResources"
226+
message="The resource `R.drawable.ic_dashboard_black_24dp` appears to be unused"
227+
errorLine1="&lt;vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;"
228+
errorLine2="^">
229+
<location
230+
file="src/main/res/drawable/ic_dashboard_black_24dp.xml"
231+
line="1"
232+
column="1"/>
233+
</issue>
234+
235+
<issue
236+
id="UnusedResources"
237+
message="The resource `R.drawable.ic_home_black_24dp` appears to be unused"
238+
errorLine1="&lt;vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;"
239+
errorLine2="^">
240+
<location
241+
file="src/main/res/drawable/ic_home_black_24dp.xml"
242+
line="1"
243+
column="1"/>
244+
</issue>
245+
246+
<issue
247+
id="UnusedResources"
248+
message="The resource `R.drawable.ic_notifications_black_24dp` appears to be unused"
249+
errorLine1="&lt;vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;"
250+
errorLine2="^">
251+
<location
252+
file="src/main/res/drawable/ic_notifications_black_24dp.xml"
253+
line="1"
254+
column="1"/>
255+
</issue>
256+
257+
<issue
258+
id="MonochromeLauncherIcon"
259+
message="The application adaptive icon is missing a monochrome tag"
260+
errorLine1="&lt;adaptive-icon xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;>"
261+
errorLine2="^">
262+
<location
263+
file="src/main/res/mipmap-anydpi-v26/ic_launcher.xml"
264+
line="2"
265+
column="1"/>
266+
</issue>
267+
268+
<issue
269+
id="MonochromeLauncherIcon"
270+
message="The application adaptive roundIcon is missing a monochrome tag"
271+
errorLine1="&lt;adaptive-icon xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;>"
272+
errorLine2="^">
273+
<location
274+
file="src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml"
275+
line="2"
276+
column="1"/>
277+
</issue>
278+
279+
</issues>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)