Skip to content

Commit

Permalink
Finish
Browse files Browse the repository at this point in the history
  • Loading branch information
abd3lraouf committed Mar 3, 2021
1 parent 657efa1 commit 7ba9c0d
Show file tree
Hide file tree
Showing 40 changed files with 2,519 additions and 215 deletions.
43 changes: 19 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
# Template repository

Template repository for the Jetpack Compose [#AndroidDevChallenge](https://developer.android.com/dev-challenge).

## Getting started
Copy this repository by pressing the "Use this template" button in Github.
Clone your repository and open it in the latest [Android Studio (Canary build)](https://developer.android.com/studio/preview).

## Submission requirements
- Follow the challenge description on the project website: [developer.android.com/dev-challenge](https://developer.android.com/dev-challenge)
- All UI should be written using Jetpack Compose
- The Github Actions workflow should complete successfully
- Include two screenshots of your submission in the [results](results) folder. The names should be
screenshot_1.png and screenshot_2.png.
- Include a screen record of your submission in the [results](results) folder. The name should be
video.mp4
- Replace the contents of [README.md](README.md) with the contents of [README-template.md](README-template.md) and fill out the template.

## Code formatting
The CI uses [Spotless](https://github.com/diffplug/spotless) to check if your code is formatted correctly and contains the right licenses.
Internally, Spotless uses [ktlint](https://github.com/pinterest/ktlint) to check the formatting of your code.
To set up ktlint correctly with Android Studio, follow one of the [listed setup options](https://github.com/pinterest/ktlint#-with-intellij-idea).

Before committing your code, run `./gradlew app:spotlessApply` to automatically format your code.
# PEts

<!--- Replace <OWNER> with your Github Username and <REPOSITORY> with the name of your repository. -->
<!--- You can find both of these in the url bar when you open your repository in github. -->
![Workflow result](https://github.com/AbdElraoufSabri/<REPOSITORY>/workflows/Check/badge.svg)


## :scroll: Description
<!--- Describe your app in one or two sentences -->


## :bulb: Motivation and Context
<!--- Optionally point readers to interesting parts of your submission. -->
<!--- What are you especially proud of? -->


## :camera_flash: Screenshots
<!-- You can add more screenshots here if you like -->
<img src="/results/screenshot_1.png" width="260">&emsp;<img src="/results/screenshot_2.png" width="260">

## License
```
Expand Down
73 changes: 46 additions & 27 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.example.androiddevchallenge.buildsrc.Libs

plugins {
id 'com.android.application'
id 'kotlin-android'
Expand All @@ -8,12 +10,13 @@ android {

defaultConfig {
applicationId "com.example.androiddevchallenge"
minSdkVersion 23
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

signingConfigs {
Expand All @@ -31,18 +34,18 @@ android {
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

kotlinOptions {
jvmTarget = "1.8"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

buildFeatures {
compose true

// Disable unused AGP features
buildConfig false
aidl false
Expand All @@ -51,31 +54,47 @@ android {
shaders false
}

composeOptions {
kotlinCompilerExtensionVersion compose_version
packagingOptions {
exclude "META-INF/licenses/**"
exclude "META-INF/AL2.0"
exclude "META-INF/LGPL2.1"
}

packagingOptions {
// Multiple dependency bring these files in. Exclude them to enable
// our test APK to build (has no effect on our AARs)
excludes += "/META-INF/AL2.0"
excludes += "/META-INF/LGPL2.1"
composeOptions {
kotlinCompilerExtensionVersion Libs.AndroidX.Compose.version
}
}

dependencies {
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation "androidx.activity:activity-compose:1.3.0-alpha03"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'

testImplementation 'junit:junit:4.13.2'

androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
implementation Libs.Kotlin.stdlib
implementation Libs.Kotlin.reflect
implementation Libs.Coroutines.android

implementation Libs.AndroidX.coreKtx
implementation Libs.AndroidX.navigation
implementation Libs.AndroidX.Activity.activityCompose
implementation Libs.AndroidX.ConstraintLayout.constraintLayoutCompose

implementation Libs.AndroidX.Compose.runtime
implementation Libs.AndroidX.Compose.foundation
implementation Libs.AndroidX.Compose.layout
implementation Libs.AndroidX.Compose.ui
implementation Libs.AndroidX.Compose.uiUtil
implementation Libs.AndroidX.Compose.material
implementation Libs.AndroidX.Compose.animation
implementation Libs.AndroidX.Compose.iconsExtended
implementation Libs.AndroidX.Compose.tooling

implementation Libs.Accompanist.coil
implementation Libs.Accompanist.gif
implementation Libs.Accompanist.insets

androidTestImplementation Libs.AndroidX.Activity.activityCompose

androidTestImplementation Libs.JUnit.junit
androidTestImplementation Libs.AndroidX.Test.core
androidTestImplementation Libs.AndroidX.Test.espressoCore
androidTestImplementation Libs.AndroidX.Test.rules
androidTestImplementation Libs.AndroidX.Test.Ext.junit
androidTestImplementation Libs.AndroidX.Compose.uiTest
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package com.example.androiddevchallenge

import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.example.androiddevchallenge.ui.MainActivity
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand Down
11 changes: 6 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androiddevchallenge">

<!--Load images from Unsplash-->
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.AndroidDevChallenge">
android:theme="@style/Theme.Pets">
<activity
android:name="com.example.androiddevchallenge.MainActivity"
android:label="@string/app_name"
android:theme="@style/Theme.AndroidDevChallenge.NoActionBar">
android:name="com.example.androiddevchallenge.ui.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
61 changes: 0 additions & 61 deletions app/src/main/java/com/example/androiddevchallenge/MainActivity.kt

This file was deleted.

Loading

0 comments on commit 7ba9c0d

Please sign in to comment.