aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorTakeshi Hagikura <thagikura@google.com>2017-08-09 14:46:24 +0900
committerTakeshi Hagikura <thagikura@google.com>2017-08-10 11:02:00 +0900
commitba93f0a5e4219f36cee1fa45a0c849e450038706 (patch)
tree1f51c9a41f7ba10b1fd3a803107852d3492fb1d3 /ui
parentd9083dacedf92374d23bbb041b53361cfbf29dca (diff)
downloadandroid-ba93f0a5e4219f36cee1fa45a0c849e450038706.tar.gz
Several fixes for DownloadableFonts sample.
- Lower the minSdkVersion to 14 - Remove the description about beta program for Google Play Services - Fix styling issue on a small screen that "Request" button wasn't fully displayed Test: manual Change-Id: I581837fbe3470f52f9eae2e629e01ba56801f745
Diffstat (limited to 'ui')
-rw-r--r--ui/fonts/DownloadableFonts/app/build.gradle21
-rw-r--r--ui/fonts/DownloadableFonts/app/src/main/res/layout/bottom_sheet_font_query.xml7
-rw-r--r--ui/fonts/DownloadableFonts/build.gradle10
-rw-r--r--ui/fonts/DownloadableFonts/gradle/wrapper/gradle-wrapper.properties4
-rw-r--r--ui/fonts/DownloadableFonts/kotlinApp/app/build.gradle21
-rw-r--r--ui/fonts/DownloadableFonts/kotlinApp/app/src/main/res/layout/bottom_sheet_font_query.xml7
-rw-r--r--ui/fonts/DownloadableFonts/kotlinApp/build.gradle12
-rw-r--r--ui/fonts/DownloadableFonts/template-params.xml24
8 files changed, 44 insertions, 62 deletions
diff --git a/ui/fonts/DownloadableFonts/app/build.gradle b/ui/fonts/DownloadableFonts/app/build.gradle
index 203427e2..80c6aa87 100644
--- a/ui/fonts/DownloadableFonts/app/build.gradle
+++ b/ui/fonts/DownloadableFonts/app/build.gradle
@@ -1,16 +1,17 @@
apply plugin: 'com.android.application'
+ext {
+ supportLibVersion = '26.0.1'
+}
+
android {
- compileSdkVersion 'android-O'
- buildToolsVersion "26.0.0 rc2"
+ compileSdkVersion 26
+ buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.android.downloadablefonts"
- // Once API level 26 SDK is launched, lower the minSdkVersion.
- // At this moment, an app targeting the preview version of the SDK only runs on the
- // preview device.
- minSdkVersion 'O'
- targetSdkVersion 'O'
+ minSdkVersion 14
+ targetSdkVersion 26
}
buildTypes {
@@ -21,8 +22,8 @@ android {
}
dependencies {
- compile 'com.android.support:appcompat-v7:26.0.0-beta1'
- compile 'com.android.support:design:26.0.0-beta1'
- compile 'com.android.support:cardview-v7:26.0.0-beta1'
+ compile "com.android.support:appcompat-v7:$supportLibVersion"
+ compile "com.android.support:design:$supportLibVersion"
+ compile "com.android.support:cardview-v7:$supportLibVersion"
}
}
diff --git a/ui/fonts/DownloadableFonts/app/src/main/res/layout/bottom_sheet_font_query.xml b/ui/fonts/DownloadableFonts/app/src/main/res/layout/bottom_sheet_font_query.xml
index c30193c9..2d8f2beb 100644
--- a/ui/fonts/DownloadableFonts/app/src/main/res/layout/bottom_sheet_font_query.xml
+++ b/ui/fonts/DownloadableFonts/app/src/main/res/layout/bottom_sheet_font_query.xml
@@ -47,7 +47,8 @@
<android.support.design.widget.TextInputLayout
android:id="@+id/auto_complete_family_name_input"
- android:layout_width="240dp"
+ android:layout_width="0dp"
+ android:layout_weight="4"
android:layout_height="wrap_content">
<AutoCompleteTextView
@@ -66,6 +67,7 @@
<Button
android:id="@+id/button_request"
+ android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/request" />
@@ -108,6 +110,7 @@
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_marginStart="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
android:textSize="16sp"
android:gravity="end" />
</LinearLayout>
@@ -149,6 +152,7 @@
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_marginStart="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
android:textSize="16sp"
android:gravity="end" />
</LinearLayout>
@@ -190,6 +194,7 @@
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_marginStart="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
android:textSize="16sp"
android:gravity="end" />
</LinearLayout>
diff --git a/ui/fonts/DownloadableFonts/build.gradle b/ui/fonts/DownloadableFonts/build.gradle
index 39ebd646..1144b336 100644
--- a/ui/fonts/DownloadableFonts/build.gradle
+++ b/ui/fonts/DownloadableFonts/build.gradle
@@ -2,21 +2,17 @@
buildscript {
repositories {
jcenter()
- maven {
- url 'https://maven.google.com'
- }
+ google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
+ classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
}
}
allprojects {
repositories {
jcenter()
- maven {
- url 'https://maven.google.com'
- }
+ google()
}
}
diff --git a/ui/fonts/DownloadableFonts/gradle/wrapper/gradle-wrapper.properties b/ui/fonts/DownloadableFonts/gradle/wrapper/gradle-wrapper.properties
index 9eaab7c2..fa419a38 100644
--- a/ui/fonts/DownloadableFonts/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/fonts/DownloadableFonts/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed May 10 17:45:17 JST 2017
+#Wed Aug 09 11:54:51 JST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-4.0-20170406000015+0000-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
diff --git a/ui/fonts/DownloadableFonts/kotlinApp/app/build.gradle b/ui/fonts/DownloadableFonts/kotlinApp/app/build.gradle
index 1d94fb0d..46db5c93 100644
--- a/ui/fonts/DownloadableFonts/kotlinApp/app/build.gradle
+++ b/ui/fonts/DownloadableFonts/kotlinApp/app/build.gradle
@@ -1,17 +1,18 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
+ext {
+ supportLibVersion = '26.0.1'
+}
+
android {
- compileSdkVersion 'android-O'
- buildToolsVersion "26.0.0 rc2"
+ compileSdkVersion 26
+ buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.android.downloadablefonts"
- // Once API level 26 SDK is launched, lower the minSdkVersion.
- // At this moment, an app targeting the preview version of the SDK only runs on the
- // preview device.
- minSdkVersion 'O'
- targetSdkVersion 'O'
+ minSdkVersion 14
+ targetSdkVersion 26
}
buildTypes {
@@ -22,9 +23,9 @@ android {
}
dependencies {
- compile 'com.android.support:appcompat-v7:26.0.0-beta1'
- compile 'com.android.support:design:26.0.0-beta1'
- compile 'com.android.support:cardview-v7:26.0.0-beta1'
+ compile "com.android.support:appcompat-v7:$supportLibVersion"
+ compile "com.android.support:design:$supportLibVersion"
+ compile "com.android.support:cardview-v7:$supportLibVersion"
}
}
diff --git a/ui/fonts/DownloadableFonts/kotlinApp/app/src/main/res/layout/bottom_sheet_font_query.xml b/ui/fonts/DownloadableFonts/kotlinApp/app/src/main/res/layout/bottom_sheet_font_query.xml
index c30193c9..2d8f2beb 100644
--- a/ui/fonts/DownloadableFonts/kotlinApp/app/src/main/res/layout/bottom_sheet_font_query.xml
+++ b/ui/fonts/DownloadableFonts/kotlinApp/app/src/main/res/layout/bottom_sheet_font_query.xml
@@ -47,7 +47,8 @@
<android.support.design.widget.TextInputLayout
android:id="@+id/auto_complete_family_name_input"
- android:layout_width="240dp"
+ android:layout_width="0dp"
+ android:layout_weight="4"
android:layout_height="wrap_content">
<AutoCompleteTextView
@@ -66,6 +67,7 @@
<Button
android:id="@+id/button_request"
+ android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/request" />
@@ -108,6 +110,7 @@
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_marginStart="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
android:textSize="16sp"
android:gravity="end" />
</LinearLayout>
@@ -149,6 +152,7 @@
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_marginStart="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
android:textSize="16sp"
android:gravity="end" />
</LinearLayout>
@@ -190,6 +194,7 @@
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_marginStart="@dimen/margin_small"
+ android:layout_marginLeft="@dimen/margin_small"
android:textSize="16sp"
android:gravity="end" />
</LinearLayout>
diff --git a/ui/fonts/DownloadableFonts/kotlinApp/build.gradle b/ui/fonts/DownloadableFonts/kotlinApp/build.gradle
index 0c2b9546..138d54ed 100644
--- a/ui/fonts/DownloadableFonts/kotlinApp/build.gradle
+++ b/ui/fonts/DownloadableFonts/kotlinApp/build.gradle
@@ -1,14 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.1.2-4'
+ ext.kotlin_version = '1.1.3-2'
repositories {
jcenter()
- maven {
- url 'https://maven.google.com'
- }
+ google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
+ classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -16,9 +14,7 @@ buildscript {
allprojects {
repositories {
jcenter()
- maven {
- url 'https://maven.google.com'
- }
+ google()
}
}
diff --git a/ui/fonts/DownloadableFonts/template-params.xml b/ui/fonts/DownloadableFonts/template-params.xml
index 4c5dfe63..5722d4d7 100644
--- a/ui/fonts/DownloadableFonts/template-params.xml
+++ b/ui/fonts/DownloadableFonts/template-params.xml
@@ -19,12 +19,6 @@
<group>UI</group>
<package>com.example.android.downloadablefonts</package>
- <!--
- Lower the minSdk once the API level for O is changed to 26.
- At this moment, an app targeting "O" only runs on O preview devices.
- -->
- <minSdk>"O"</minSdk>
-
<strings>
<intro>
<![CDATA[
@@ -32,14 +26,6 @@ This sample demonstrates how to use the Downloadable Fonts feature introduced in
Downloadable Fonts is a feature that allows apps to request a certain font from a provider
instead of bundling it or downloading it themselves. This means, there is no need to bundle the
font as an asset.
-
-Note that the sample uses Google Play Services as a font provider, which requires pre-released
-version of Google Play Services.
-You can sign up for the beta program so that the beta version of Google Play Services is
-downloaded to your device. https://developers.google.com/android/guides/beta-program
-If you have Google Play Services whose version number is equal or above 11.x.x, that means you
-have the compatible version installed. (You can confirm by navigating to
-Settings -> Apps -> Google Play Services)
]]>
</intro>
</strings>
@@ -48,7 +34,7 @@ Settings -> Apps -> Google Play Services)
<metadata>
<status>PUBLISHED</status>
- <categories>UI, Android O Preview</categories>
+ <categories>UI</categories>
<technologies>Android</technologies>
<languages>Java</languages>
<solutions>Mobile</solutions>
@@ -128,14 +114,6 @@ first attempt.
</application>
```
-Note that the sample uses Google Play Services as a font provider, which requires pre-released
-version of Google Play Services.
-You can sign up for the beta program so that the beta version of Google Play Services is
-downloaded to your device. https://developers.google.com/android/guides/beta-program
-If you have Google Play Services whose version number is equal or above 11.x.x, that means you
-have the compatible version installed. (You can confirm by navigating to
-Settings -> Apps -> Google Play Services)
-
[1]: https://developer.android.com/reference/android/support/v4/provider/FontRequest.html
[2]: https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.html
]]>