Skip to content

Commit

Permalink
Added the NavigationRailView (#122)
Browse files Browse the repository at this point in the history
Added NavigationRailView
  • Loading branch information
soalb-m authored Sep 27, 2022
1 parent c1baaf1 commit 55e3bb4
Show file tree
Hide file tree
Showing 39 changed files with 1,415 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_bottomnavigation_ado.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: publish-recyclerview-ado
name: publish-bottomnavigation-ado
# This workflow builds and publishes in ADO the BottomNavigation artifact.

on:
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/publish_navigationrail_ado.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: publish-navigationrail-ado
# This workflow builds and publishes in ADO the NavigationRail artifact.

on:
push:
tags:
- 'navigationrail*'

workflow_dispatch:
inputs:
name:
description: 'Triggers publication to ADO - NavigationRail'
home:
description: 'location'
required: false

jobs:
publish-NavigationRail-ADO:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}
run: |
git fetch --unshallow
sudo bash -c "echo '$SIGNING_SECRET_KEY' | base64 -d > '$SIGNING_SECRET_FILE'"
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: clean
run: ./gradlew :navigationrail:navigationrail:clean

# Builds the release artifacts of the library
- name: Release build
run: ./gradlew :navigationrail:navigationrail:assembleRelease

# Generates other artifacts
- name: Source jar
run: ./gradlew :navigationrail:navigationrail:androidSourcesJar

# Generates docs artifact
- name: Docs jar
run: ./gradlew :navigationrail:navigationrail:dokkaHtmlJar

# Runs upload to ADO
- name: Publish to ADO
run: ./gradlew :navigationrail:navigationrail:publishSurfaceDuoSDKPublicationToADORepository --max-workers 1
env:
ADO_URL: ${{ secrets.ADO_URL }}
ADO_USER: ${{ secrets.ADO_USER }}
ADO_PASSWD: ${{ secrets.ADO_PASSWD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}
74 changes: 74 additions & 0 deletions .github/workflows/publish_navigationrail_mavencentral.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: publish-navigationrail-mavencentral
# This workflow builds and publishes in Maven Central the NavigationRail artifact.
# Although the final publishing step has to be done manually in Sonatype site.

on:
push:
tags:
- 'navigationrail*'

workflow_dispatch:
inputs:
name:
description: 'Triggers publication to MavenCentral - NavigationRail'
home:
description: 'location'
required: false

jobs:
publish-NavigationRail-MavenCentral:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}
run: |
git fetch --unshallow
sudo bash -c "echo '$SIGNING_SECRET_KEY' | base64 -d > '$SIGNING_SECRET_FILE'"
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: clean
run: ./gradlew :navigationrail:navigationrail:clean

# Builds the release artifacts of the library
- name: Release build
run: ./gradlew :navigationrail:navigationrail:assembleRelease

# Generates other artifacts
- name: Source jar
run: ./gradlew :navigationrail:navigationrail:androidSourcesJar

# Generates docs artifact
- name: Docs jar
run: ./gradlew :navigationrail:navigationrail:dokkaHtmlJar

# Runs upload to MavenCentral (final release step will be manually done in Sonatype site)
- name: Publish to MavenCentral
run: ./gradlew :navigationrail:navigationrail:publishSurfaceDuoSDKPublicationToMavencentralRepository --max-workers 1
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}

11 changes: 8 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ ext {
tabsVersionCode = 4
recyclerviewVersionCode = 6
inkSDKVersionCode = 7
wmUtilsVersionCode = 4
wmUtilsVersionCode = 5
navigationVersionCode = 2
testingVersionCode = 4
snackbarVersionCode = 2
navigationRailVersionCode = 1

// SurfaceDuo SDK libraries version name:
// If you want to publish a new version, bump the specific line(s)
Expand All @@ -42,10 +43,11 @@ ext {
tabsVersionName = '1.0.0-beta5'
recyclerviewVersionName = '1.0.0-beta6'
inkSDKVersionName = "1.0.0-alpha5"
wmUtilsVersionName = "1.0.0-beta4"
wmUtilsVersionName = "1.0.0-beta5"
navigationVersionName = "1.0.0-alpha3"
testingVersionName = "1.0.0-alpha4"
snackbarVersionName = "1.0.0-alpha2"
navigationRailVersionName = '1.0.0-alpha1'
// ----------------------------------

// Config Android sdk, plugins and libraries version
Expand Down Expand Up @@ -108,8 +110,11 @@ ext {

//Material Design
materialVersion = "1.3.0"
// Can not migrate all libraries to 1.6.0 yet. This version will be used only by the NavigationRailView
materialVersion160 = "1.6.0"
materialDependencies = [
material: "com.google.android.material:material:$materialVersion"
material : "com.google.android.material:material:$materialVersion",
material160: "com.google.android.material:material:$materialVersion160"
]

googleTruthVersion = "1.1.2"
Expand Down
1 change: 1 addition & 0 deletions navigationrail/navigationrail/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
64 changes: 64 additions & 0 deletions navigationrail/navigationrail/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/

plugins {
id 'com.android.library'
id 'kotlin-android'
}

ext {
PUBLISH_GROUP_ID = 'com.microsoft.device.dualscreen'
PUBLISH_ARTIFACT_ID = 'navigationrail'
LIBRARY_DESCRIPTION = 'Library that implements the NavigationRail specifications and adapts automatically to the different foldable configurations'
LIBRARY_VERSION = rootProject.ext.navigationRailVersionName
}
apply from: "${rootProject.projectDir}/publishing.gradle"

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion

versionCode rootProject.ext.navigationRailVersionCode
versionName rootProject.ext.navigationRailVersionName

testInstrumentationRunner rootProject.ext.config.testInstrumentationRunner
}

buildTypes {
release {
minifyEnabled false
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
api project(':utils:wm-utils')

implementation kotlinDependencies.kotlinStdlib
implementation androidxDependencies.lifecycleRuntimeKtx
api materialDependencies.material
api androidxDependencies.windowManager

api materialDependencies.material160

testImplementation testDependencies.junit

androidTestImplementation project(':utils:test-utils')
androidTestImplementation commonDependencies.mockitoDexMaker
androidTestImplementation commonDependencies.mockitoCore
androidTestImplementation instrumentationTestDependencies.junit
androidTestImplementation instrumentationTestDependencies.testRules
androidTestImplementation instrumentationTestDependencies.espressoCore
androidTestImplementation instrumentationTestDependencies.uiAutomator
}
7 changes: 7 additions & 0 deletions navigationrail/navigationrail/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) Microsoft Corporation. All rights reserved.
~ Licensed under the MIT License.
~
-->
<manifest package="com.microsoft.device.dualscreen.navigationrail">
</manifest>
Loading

0 comments on commit 55e3bb4

Please sign in to comment.