Skip to content

Commit 2a2e93b

Browse files
authored
Modularization Base Structure (microsoft#41)
* Modularization Base Strcuture This commit creates following modules 1) fluentui_core 2) fluentui_listitem 3) fluentui_drawer 4) fluentui_tablayout 5) fluentui_others 6) FluentUI In addition, contains a build pipeline to create universal package of the Fluent UI library * Fix formatting issues * Remove defaultTheme from Demo Activities * Few Corrections Around ContextWrapper * Formatting Corrections * Remove unwanted imports * Remove .gitignore from every submodule * Address review comments 1) Remove project.afterEvaluate 2) Add RestrictTo to MSRecyclerView 3) Add documentation on config.gradle * Keep Drawer Module Consistent with Modular Branch * Small Correction to move an integer value Moved one persistent bottom sheet value for landscape from fluentui_others to fluentui_drawer * Correcting Formatting Issues * Add Internal Maven Repo to Publish * Add todo item for package name * Minor corrections in fluentui_others module * Bump to version 0.0.12 * Remove hardcoding of version ids in gradle file * Update README.md with Modularization Details Co-authored-by: Mayuresh Gharpure <[email protected]>
1 parent 6a95cd7 commit 2a2e93b

File tree

359 files changed

+2058
-755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+2058
-755
lines changed

.gitignore

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ captures/
3434

3535
# IntelliJ
3636
*.iml
37-
.idea/*
37+
.idea/
3838

3939
.DS_Store
4040

@@ -55,8 +55,8 @@ freeline/
5555
freeline_project_description.json
5656

5757
# fastlane
58-
fastlane/report.xml
59-
fastlane/Preview.html
60-
fastlane/screenshots
61-
fastlane/test_output
62-
fastlane/readme.md
58+
*/fastlane/report.xml
59+
*/fastlane/Preview.html
60+
*/fastlane/screenshots
61+
*/fastlane/test_output
62+
*/fastlane/readme.md

FluentUI.Demo/.gitignore

-1
This file was deleted.

FluentUI.Demo/build.gradle

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ android {
1515
applicationId 'com.microsoft.fluentuidemo'
1616
minSdkVersion 21
1717
targetSdkVersion 28
18-
versionCode 11
19-
versionName '0.0.11'
18+
versionCode 12
19+
versionName '0.0.12'
2020
}
2121
buildTypes {
2222
release {
@@ -55,8 +55,12 @@ dependencies {
5555
implementation 'com.android.support:recyclerview-v7:28.0.0'
5656
implementation 'com.android.support:support-v4:28.0.0'
5757
implementation 'com.android.support:cardview-v7:28.0.0'
58-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
59-
implementation project(':FluentUI')
58+
implementation 'com.android.support.constraint:constraint-layout:2.0.1'//Changing to 2.0.1 from 1.1.3
59+
implementation project(':fluentui_core')
60+
implementation project(':fluentui_listitem')
61+
implementation project(':fluentui_drawer')
62+
implementation project(':fluentui_tablayout')
63+
implementation project(':fluentui_others')
6064
implementation 'com.squareup.picasso:picasso:2.71828'
6165
implementation 'com.github.bumptech.glide:glide:4.8.0'
6266
implementation 'com.jakewharton.threetenabp:threetenabp:1.1.0'

FluentUI.Demo/src/main/java/com/microsoft/fluentuidemo/demos/ListItemViewActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class ListItemViewActivity : DemoActivity() {
332332
if (useCustomAccessoryView) {
333333
val customTextView = TextView(this)
334334
customTextView.text = getString(R.string.list_item_sub_header_custom_accessory_text)
335-
TextViewCompat.setTextAppearance(customTextView, R.style.TextAppearance_FluentUI_ListSubHeaderTitle_Tertiary)
335+
TextViewCompat.setTextAppearance(customTextView, R.style.FluentUIDemo_ListItemSubHeaderTitle)
336336
customTextView.setOnClickListener {
337337
Snackbar.make(
338338
it,

FluentUI.Demo/src/main/java/com/microsoft/fluentuidemo/demos/PersistentBottomSheetActivity.kt

+104-56
Large diffs are not rendered by default.

FluentUI.Demo/src/main/res/layout/activity_list_item_view.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
android:id="@+id/list_example"
1111
android:layout_width="match_parent"
1212
android:layout_height="match_parent"
13-
android:background="?attr/fluentuiListItemBackgroundColor"
13+
android:background="?attr/fluentuiBackgroundColor"
1414
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
1515
tools:context=".demos.ListItemViewActivity" />

FluentUI.Demo/src/main/res/layout/activity_persistent_bottom_sheet.xml

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
android:layout_marginTop="@dimen/default_layout_margin"
4141
android:text="@string/toggle_sheet_content" />
4242

43+
<Button
44+
android:id="@+id/set_one_line_content"
45+
android:layout_width="wrap_content"
46+
android:layout_height="wrap_content"
47+
android:layout_marginTop="@dimen/default_layout_margin"
48+
android:text="@string/one_line_content" />
49+
4350
</LinearLayout>
4451

4552
<com.microsoft.fluentui.persistentbottomsheet.PersistentBottomSheet

FluentUI.Demo/src/main/res/layout/activity_tab_layout.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<com.microsoft.fluentui.tablayout.TabLayout
1414
android:id="@+id/demo_tab_layout"
15-
style="@style/FluentUI.TabLayout"
15+
style="@style/FluentUIDemo.TabLayout"
1616
android:layout_width="match_parent"
1717
android:layout_height="wrap_content"
1818
app:tabType="Standard"/>

FluentUI.Demo/src/main/res/values/colors.xml

+2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@
1919

2020
<!--ActionBarLayout-->
2121
<color name="action_bar_radio_labels">@color/fluentui_black</color>
22+
<!--Botttomsheet tint-->
23+
<color name="bottomsheet_horizontal_icon_tint">@color/fluentui_gray_500</color>
2224

2325
</resources>

FluentUI.Demo/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@
245245
<string name="new_view">This is New View</string>
246246
<string name="toggle_sheet_content">Toggle Bottomsheet Content</string>
247247
<string name="switch_to_custom_content">Switch to custom Content</string>
248+
<string name="one_line_content">One Line Bottomsheet Content</string>
248249
<!--Persistent BottomSheet Items-->
249250
<string name="persistent_sheet_item_add_remove_view">Add/Remove View</string>
250251
<string name="persistent_sheet_item_change_collapsed_height"> Change Collapsed Height</string>

FluentUI.Demo/src/main/res/values/styles.xml

+11-7
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,17 @@
7979
<style name="Demo.Tooltip.Button" parent="Widget.FluentUI.Button" />
8080

8181
<!--TabLayout Demo-->
82-
<style name="FluentUI.TabLayout" parent="">
83-
<item name="containerBackgroundColor">?attr/fluentuiTabLayoutContainerBackgroundColor</item>
84-
<item name="tabsBackgroundColor">?attr/fluentuiTabLayoutBackgroundColor</item>
85-
<item name="tabSelectedBackgroundColor">?attr/fluentuiTabSelectedBackgroundColor</item>
86-
<item name="tabUnselectedBackgroundColor">?attr/fluentuiTabUnselectedBackgroundColor</item>
87-
<item name="tabSelectedTextColor">?attr/fluentuiTabSelectedTextColor</item>
88-
<item name="tabUnselectedTextColor">?attr/fluentuiTabUnselectedTextColor</item>
82+
<style name="FluentUIDemo.TabLayout" parent="">
83+
<item name="containerBackgroundColor">?attr/fluentuiBackgroundPrimaryColor</item>
84+
<item name="tabsBackgroundColor">@color/fluentui_communication_shade_10</item>
85+
<item name="tabSelectedBackgroundColor">?attr/fluentuiBackgroundColor</item>
86+
<item name="tabUnselectedBackgroundColor">@color/fluentui_communication_shade_10</item>
87+
<item name="tabSelectedTextColor">?attr/fluentuiBackgroundPrimaryColor</item>
88+
<item name="tabUnselectedTextColor">?attr/fluentuiBackgroundColor</item>
89+
</style>
90+
<!-- ListItem Demo -->
91+
<style name="FluentUIDemo.ListItemSubHeaderTitle" parent="">
92+
<item name="android:textColor">?attr/fluentuiForegroundSecondaryColor</item>
8993
</style>
9094

9195
</resources>

FluentUI/.gitignore

-1
This file was deleted.

FluentUI/build.gradle

+31-47
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,47 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License.
44
*/
5-
65
apply plugin: 'com.android.library'
7-
86
apply plugin: 'kotlin-android'
97
apply plugin: 'kotlin-android-extensions'
108

119
apply plugin: 'maven-publish'
1210
apply plugin: 'com.jfrog.bintray'
1311

12+
apply from: '../config.gradle'
13+
1414
android {
15-
compileSdkVersion 28
15+
compileSdkVersion constants.compileSdkVersion
1616
defaultConfig {
17-
minSdkVersion 21
18-
targetSdkVersion 28
19-
versionCode 11
20-
versionName '0.0.11'
17+
minSdkVersion constants.minSdkVersion
18+
targetSdkVersion constants.targetSdkVersion
19+
versionCode 12
20+
versionName project.ext.FluentUI_versionid
2121
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
22-
vectorDrawables.useSupportLibrary = true
23-
}
24-
lintOptions {
25-
abortOnError false
22+
consumerProguardFiles 'consumer-rules.pro'
2623
}
2724
buildTypes {
2825
release {
2926
minifyEnabled false
30-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
3128
}
3229
}
33-
testOptions {
34-
unitTests {
35-
includeAndroidResources = true
36-
}
37-
}
38-
productFlavors {
39-
}
40-
}
41-
42-
gradle.taskGraph.whenReady { taskGraph ->
43-
taskGraph.allTasks.forEach {
44-
if (it.name.contains("ReleaseUnitTest")) {
45-
it.enabled = false
46-
}
47-
}
48-
}
4930

50-
repositories {
51-
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
5231
}
5332

5433
dependencies {
55-
implementation fileTree(include: ['*.jar'], dir: 'libs')
56-
implementation 'com.android.support:appcompat-v7:28.0.0'
57-
implementation 'com.android.support:exifinterface:28.0.0'
58-
implementation 'com.android.support:recyclerview-v7:28.0.0'
59-
implementation 'com.android.support:cardview-v7:28.0.0'
60-
implementation 'com.android.support:design:28.0.0'
34+
implementation fileTree(dir: 'libs', include: ['*.jar'])
35+
implementation project(':fluentui_core')
36+
implementation project(':fluentui_listitem')
37+
implementation project(':fluentui_drawer')
38+
implementation project(':fluentui_tablayout')
39+
implementation project(':fluentui_others')
6140
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
62-
implementation 'com.jakewharton.threetenabp:threetenabp:1.1.0'
63-
implementation 'com.splitwise:tokenautocomplete:2.0.8'
64-
implementation "com.microsoft.device:dualscreen-layout:1.0.0-alpha01"
65-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
66-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
67-
testImplementation 'junit:junit:4.12'
68-
testImplementation 'org.robolectric:robolectric:4.0-alpha-3'
69-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
41+
implementation "com.android.support:appcompat-v7:$supportVersion"
42+
implementation "com.android.support:design:$supportVersion"
43+
testImplementation "junit:junit:$junitVersion"
44+
androidTestImplementation "com.android.support.test:runner:$testRunnerVersion"
45+
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion"
7046
}
7147

7248
task sourceJar(type: Jar) {
@@ -97,9 +73,17 @@ publishing {
9773
configurations.implementation.allDependencies.each {
9874
if (it.group != null && (it.name != null && it.name != "unspecified") && it.version != null) {
9975
def dependencyNode = dependenciesNode.appendNode('dependency')
100-
dependencyNode.appendNode('groupId', it.group)
101-
dependencyNode.appendNode('artifactId', it.name)
102-
dependencyNode.appendNode('version', it.version)
76+
if (it.group.equals('fluentui-android')) {
77+
dependencyNode.appendNode('groupId', 'com.microsoft.fluentui')
78+
dependencyNode.appendNode('artifactId', it.name)
79+
def artifactName = it.name.replaceAll('-','_')+'_versionid'
80+
dependencyNode.appendNode('version', getProperty(artifactName).toString())
81+
} else {
82+
dependencyNode.appendNode('groupId', it.group)
83+
dependencyNode.appendNode('artifactId', it.name)
84+
dependencyNode.appendNode('version', it.version)
85+
}
86+
10387
}
10488
}
10589
}

FluentUI/consumer-rules.pro

Whitespace-only changes.

FluentUI/src/main/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
~ Copyright (c) Microsoft Corporation. All rights reserved.
44
~ Licensed under the MIT License.
55
-->
6-
6+
<!-- TODO Change package name to com.microsoft.fluentui once modularization is complete -->
77
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
8-
package="com.microsoft.fluentui" />
8+
package="com.microsoft.fluentui_container" />

0 commit comments

Comments
 (0)