Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Fix several project lint report warnings #498

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}
lintOptions {
disable 'GoogleAppIndexingWarning'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't prefer to ignore GoogleAppIndexingWarning, the purpose of sunflower project is a demo for different Android features of jetpack or androidX, the GoogleAppIndexingWarning can be one part of them.

Let the warning there is OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intension was to force warnings as errors by warningsAsErrors attribute, with that all changes has verify by CI on PR forcing to failure if was introduces new lint warnings (forcing contributors to check them). That was the only reason for why I added the disable 'GoogleAppIndexWarning'.

If you consider that isn't necessary I remove that also. Please confirm me, for make these changes on PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @tiembo

disable 'IconLauncherShape'
warningsAsErrors true
}
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,25 @@ class PlantDetailFragment : Fragment() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.action_share -> {
val shareIntent = ShareCompat.IntentBuilder.from(activity)
.setText(shareText)
.setType("text/plain")
.createChooserIntent()
.apply {
// https://android-developers.googleblog.com/2012/02/share-with-intents.html
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// If we're on Lollipop, we can open the intent as a document
addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT or Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
} else {
// Else, we will use the old CLEAR_WHEN_TASK_RESET flag
addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
}
}
startActivity(shareIntent)
return true
activity?.let {
vmadalin marked this conversation as resolved.
Show resolved Hide resolved
val shareIntent = ShareCompat.IntentBuilder.from(it)
.setText(shareText)
.setType("text/plain")
.createChooserIntent()
.apply {
// https://android-developers.googleblog.com/2012/02/share-with-intents.html
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// If we're on Lollipop, we can open the intent as a document
addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT or Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
} else {
// Else, we will use the old CLEAR_WHEN_TASK_RESET flag
addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
}
}
startActivity(shareIntent)
return true
}
return false
}
else -> super.onOptionsItemSelected(item)
}
Expand Down
129 changes: 0 additions & 129 deletions app/src/main/res/drawable/ic_launcher_background.xml

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/main/res/layout/nav_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/navigation_drawer_header_height"
android:background="?attr/colorPrimaryDark"
android:gravity="bottom"
android:orientation="vertical"
android:padding="@dimen/navigation_drawer_header_padding"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
style="@style/NavigationHeaderAppearance">

<!-- TODO: add actual logo once available -->
<ImageView
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
-->

<resources>
<string name="app_name">Sunflower</string>
<string name="menu_filter_by_grow_zone">Filtra per zona di crescita</string>
<string name="plant_detail_image_content_description">Immagine della pianta</string>
<string name="my_garden_title">Il mio giardino</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.MaterialComponents.Light"/>

<style name="NavigationHeaderAppearance" parent="ThemeOverlay.AppCompat.Dark">
<item name="android:background">@color/colorPrimaryDark</item>
</style>

</resources>
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ buildscript {
targetSdkVersion = 28

// App dependencies
appCompatVersion = '1.1.0-beta01'
constraintLayoutVersion = '2.0.0-beta1'
appCompatVersion = '1.1.0-rc01'
constraintLayoutVersion = '2.0.0-beta2'
coreTestingVersion = '2.0.0'
coroutinesVersion = "1.3.0-M2"
espressoVersion = '3.1.1'
fragmentVersion = '1.1.0-alpha09'
fragmentVersion = '1.2.0-alpha02'
glideVersion = '4.9.0'
gradleVersion = '3.4.1'
gsonVersion = '2.8.2'
junitVersion = '4.12'
kotlinVersion = '1.3.41'
ktlintVersion = '0.30.0'
ktxVersion = '1.0.2'
lifecycleVersion = '2.2.0-alpha01'
ktxVersion = '1.2.0-alpha03'
lifecycleVersion = '2.2.0-alpha03'
materialVersion = '1.0.0'
navigationVersion = '2.0.0'
recyclerViewVersion = '1.1.0-alpha05'
recyclerViewVersion = '1.1.0-beta03'
roomVersion = '2.1.0'
runnerVersion = '1.0.1'
truthVersion = '0.42'
testExtJunit = '1.1.0'
uiAutomatorVersion = '2.2.0'
workVersion = '2.1.0'
workVersion = '2.2.0'
}

repositories {
Expand Down