Skip to content

Commit

Permalink
Merge "Several minor improvements"
Browse files Browse the repository at this point in the history
  • Loading branch information
yaraki authored and Gerrit Code Review committed May 22, 2019
2 parents 6bf1cb1 + 8a44543 commit 1e5a675
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 10 deletions.
1 change: 1 addition & 0 deletions android/app-start/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ android {
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
buildConfigField 'String', 'API_BASE_URL', "\"${getProperty('host')}/auth\""
resValue 'string', 'host', getProperty('host')
resValue 'string', 'asset_statements', """
[{
"include": "${getProperty('host')}/.well-known/assetlinks.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ package com.example.android.fido2

import android.util.Base64

private const val BASE64_FLAG = Base64.NO_PADDING or Base64.NO_WRAP or Base64.URL_SAFE

fun ByteArray.toBase64(): String {
return Base64.encodeToString(this, 11)
return Base64.encodeToString(this, BASE64_FLAG)
}

fun String.decodeBase64(): ByteArray {
return Base64.decode(this, 11)
return Base64.decode(this, BASE64_FLAG)
}
5 changes: 3 additions & 2 deletions android/app-start/src/main/res/layout/home_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingTop="@dimen/spacing_medium"
android:paddingBottom="@dimen/spacing_medium"
android:paddingBottom="@dimen/dodge_app_bar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/credentials_caption" />
app:layout_constraintTop_toBottomOf="@id/credentials_caption"
tools:listitem="@layout/credential_item" />

<TextView
android:id="@+id/empty_credentials"
Expand Down
15 changes: 14 additions & 1 deletion android/app-start/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
tools:targetApi="21" />
tools:targetApi="21">

<TextView
android:id="@+id/host"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:gravity="center_vertical"
android:padding="@dimen/spacing_medium"
android:text="@string/host"
android:textAppearance="?attr/textAppearanceSubtitle2"
android:textColor="@android:color/white" />

</androidx.appcompat.widget.Toolbar>

<FrameLayout
android:id="@+id/container"
Expand Down
1 change: 1 addition & 0 deletions android/app-start/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
<dimen name="spacing_medium">16dp</dimen>
<dimen name="spacing_medium_large">24dp</dimen>
<dimen name="spacing_large">32dp</dimen>
<dimen name="dodge_app_bar">64dp</dimen>
</resources>
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ android {
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
buildConfigField 'String', 'API_BASE_URL', "\"${getProperty('host')}/auth\""
resValue 'string', 'host', getProperty('host')
resValue 'string', 'asset_statements', """
[{
"include": "${getProperty('host')}/.well-known/assetlinks.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ package com.example.android.fido2

import android.util.Base64

private const val BASE64_FLAG = Base64.NO_PADDING or Base64.NO_WRAP or Base64.URL_SAFE

fun ByteArray.toBase64(): String {
return Base64.encodeToString(this, 11)
return Base64.encodeToString(this, BASE64_FLAG)
}

fun String.decodeBase64(): ByteArray {
return Base64.decode(this, 11)
return Base64.decode(this, BASE64_FLAG)
}
5 changes: 3 additions & 2 deletions android/app/src/main/res/layout/home_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingTop="@dimen/spacing_medium"
android:paddingBottom="@dimen/spacing_medium"
android:paddingBottom="@dimen/dodge_app_bar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/credentials_caption" />
app:layout_constraintTop_toBottomOf="@id/credentials_caption"
tools:listitem="@layout/credential_item" />

<TextView
android:id="@+id/empty_credentials"
Expand Down
15 changes: 14 additions & 1 deletion android/app/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
tools:targetApi="21" />
tools:targetApi="21">

<TextView
android:id="@+id/host"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:gravity="center_vertical"
android:padding="@dimen/spacing_medium"
android:text="@string/host"
android:textAppearance="?attr/textAppearanceSubtitle2"
android:textColor="@android:color/white" />

</androidx.appcompat.widget.Toolbar>

<FrameLayout
android:id="@+id/container"
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
<dimen name="spacing_medium">16dp</dimen>
<dimen name="spacing_medium_large">24dp</dimen>
<dimen name="spacing_large">32dp</dimen>
<dimen name="dodge_app_bar">64dp</dimen>
</resources>

0 comments on commit 1e5a675

Please sign in to comment.