Skip to content

Commit

Permalink
Main branch material 3 migration (#61)
Browse files Browse the repository at this point in the history
* Main branch material 3 migration

* Refactor code. Upgrade versions.

* Correct naming and M3 coding

* Implement adaptive icons

---------

Co-authored-by: schordas <[email protected]>
Co-authored-by: John Shea <[email protected]>
  • Loading branch information
3 people authored May 18, 2023
1 parent 014915f commit 1259533
Show file tree
Hide file tree
Showing 46 changed files with 296 additions and 286 deletions.
41 changes: 16 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

*/.gitignore
.gradle
.DS_Store

# built application files
*.apk
*.ap_

# Mac files
.DS_Store

# files for the dex VM
*.dex

Expand All @@ -15,31 +13,24 @@

# generated files
bin/
out/
gen/

# Libraries used by the app
# Can explicitly add if we want, but shouldn't do so blindly. Licenses, bloat, etc.
/libs

# Ignore gradle files
.gradle/
build/

# Build stuff (auto-generated by android update project ...)
build.xml
ant.properties
# Local configuration file (sdk path, etc)
local.properties
project.properties

# Eclipse project files
.classpath
# Proguard folder generated by Eclipse
proguard/
proguard-project.txt

# Eclipse files
.project
.classpath
.settings/

# idea project files
.idea/
.idea/.name
# Android Studio/IDEA
*.iml
*.ipr
*.iws

##Gradle-based build
.gradle
build/
.idea
63 changes: 28 additions & 35 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
# How to become a contributor and submit your own code

## Contributor License Agreements

We'd love to accept your sample apps and patches! Before we can take them, we
have to jump a couple of legal hurdles.

Please fill out either the individual or corporate Contributor License Agreement
(CLA).

* If you are an individual writing original source code and you're sure you
own the intellectual property, then you'll need to sign an [individual CLA]
(https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work,
then you'll need to sign a [corporate CLA]
(https://developers.google.com/open-source/cla/corporate).

Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it. Once we receive it, we'll be able to
accept your pull requests.

## Contributing A Patch

1. Submit an issue describing your proposed change to the repo in question.
1. The repo owner will respond to your issue promptly.
1. If your proposed change is accepted, and you haven't already done so, sign a
Contributor License Agreement (see details above).
1. Fork the desired repo, develop and test your code changes.
1. Ensure that your code adheres to the existing style in the sample to which
you are contributing. Refer to the
[Google Cloud Platform Samples Style Guide]
(https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the
recommended coding standards for this organization.
1. Ensure that your code has an appropriate set of unit tests which all pass.
1. Submit a pull request.
# How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement (CLA). You (or your employer) retain the copyright to your
contribution; this simply gives us permission to use and redistribute your
contributions as part of the project. Head over to
<https://cla.developers.google.com/> to see your current agreements on file or
to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Community Guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Apache License

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Affirmations App - Solution Code
================================

Solution code for the Android Basics in Compose: Affirmations app.
Solution code for the Android Basics with Compose: Affirmations app.


Introduction
Expand All @@ -11,8 +11,8 @@ The Affirmations app contains a scrollable list of 10 cards.

Pre-requisites
--------------
* Familiarity with Lists in Kotlin
* Experience building layouts with Jetpack Compose
* Familiarity with Lists in Kotlin
* Experience building layouts with Jetpack Compose
* Experience running apps on a device or emulator


Expand All @@ -23,4 +23,4 @@ Getting Started
3. Import the sample into Android Studio.
4. Build and run the sample.

All photos by Romain Guy. All photos are licensed under CC0 https://creativecommons.org/share-your-work/public-domain/cc0/
All photos by Romain Guy. All photos are licensed under CC0 https://creativecommons.org/share-your-work/public-domain/cc0/
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
45 changes: 29 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
/*
* Copyright (C) 2023 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.
*/
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'com.example.affirmations'
compileSdk 33

defaultConfig {
applicationId "com.example.affirmations"
minSdk 21
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -36,7 +52,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerExtensionVersion '1.4.7'
}
packagingOptions {
resources {
Expand All @@ -46,18 +62,15 @@ android {
}

dependencies {
implementation platform('androidx.compose:compose-bom:2023.05.00')
implementation 'androidx.activity:activity-compose:1.7.1'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'

implementation platform('androidx.compose:compose-bom:2023.01.00')
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.material:material"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4"
debugImplementation "androidx.compose.ui:ui-tooling"
}
debugImplementation 'androidx.compose.ui:ui-test-manifest'
debugImplementation 'androidx.compose.ui:ui-tooling'
}
35 changes: 18 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
~ Copyright (C) 2023 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 xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.affirmations">
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Affirmations">
android:theme="@style/Theme.Affirmations"
tools:targetApi="33">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Affirmations">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
</manifest>
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1259533

Please sign in to comment.