Skip to content

Commit 9bc577b

Browse files
committed
Revised snippets.
2 parents 0ff7c31 + fbb5b21 commit 9bc577b

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

misc/src/main/java/com/example/snippets/PdfViewerKotlinSnippets.kt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class PdfViewerKotlinSnippets {
4141

4242
// [START android_pdf_viewer_extension_version_kotlin]
4343
if (SdkExtensions.getExtensionVersion(Build.VERSION_CODES.S) >= 13) {
44-
// Load the fragment and document.
44+
// Load the fragment and document.
4545
}
4646
// [END android_pdf_viewer_extension_version_kotlin]
4747

@@ -55,14 +55,14 @@ class PdfViewerKotlinSnippets {
5555

5656
val getContentButton: MaterialButton = findViewById(R.id.launch_button)
5757
val searchButton: MaterialButton = findViewById(R.id.search_button)
58-
}
58+
}
5959
}
6060
// [END android_pdf_viewer_create_compat_activity_kotlin]
6161

6262
// [START android_pdf_viewer_extend_fragment_kotlin]
6363
@RequiresExtension(extension = Build.VERSION_CODES.S, version = 13)
6464
class PdfViewerFragmentExtended : PdfViewerFragment() {
65-
private val myLogger : Logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)
65+
private val myLogger: Logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)
6666

6767
override fun onLoadDocumentSuccess() {
6868
myLogger.log(INFO, "// Log document success.")
@@ -89,9 +89,8 @@ class PdfViewerKotlinSnippets {
8989
if (pdfViewerFragment == null) {
9090
pdfViewerFragment =
9191
supportFragmentManager
92-
.findFragmentByTag(PDF_VIEWER_FRAGMENT_TAG) as PdfViewerFragment?
92+
.findFragmentByTag(PDF_VIEWER_FRAGMENT_TAG) as PdfViewerFragment?
9393
}
94-
9594
}
9695

9796
// Used to instantiate and commit the fragment.
@@ -122,7 +121,6 @@ class PdfViewerKotlinSnippets {
122121
}
123122
}
124123
// [END android_pdf_viewer_create_fragment_kotlin]
125-
126124
}
127125

128126
/** Enable nested classes. **/
@@ -145,7 +143,6 @@ class PdfViewerKotlinSnippets {
145143
}
146144
}
147145
// [END android_pdf_viewer_enable_document_search_kotlin]
148-
149146
}
150147

151148
/** Enable nested classes. **/
@@ -163,7 +160,6 @@ class PdfViewerKotlinSnippets {
163160
supportFragmentManager
164161
.findFragmentByTag(PDF_VIEWER_FRAGMENT_TAG) as PdfViewerFragment?
165162
}
166-
167163
}
168164

169165
// [START android_pdf_viewer_launch_file_picker_kotlin]
@@ -217,7 +213,6 @@ class PdfViewerKotlinSnippets {
217213
companion object {
218214
private const val PDF_VIEWER_FRAGMENT_TAG = "pdf_viewer_fragment_tag"
219215
}
220-
221216
}
222217

223218
// [START android_pdf_viewer_style_fragment_constructor_kotlin]
@@ -307,7 +302,5 @@ class PdfViewerKotlinSnippets {
307302
companion object {
308303
private const val PDF_VIEWER_FRAGMENT_TAG = "pdf_viewer_fragment_tag"
309304
}
310-
311305
}
312-
313-
}
306+
}

misc/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
android:layout_marginBottom="8dp"
4747
app:layout_constraintLeft_toLeftOf="parent"
4848
app:layout_constraintRight_toRightOf="@id/search_button"
49-
app:layout_constraintBottom_toBottomOf="parent"
50-
app:layout_constraintEnd_toTopOf="parent" />
49+
app:layout_constraintBottom_toBottomOf="parent"/>
5150

5251
<com.google.android.material.button.MaterialButton
5352
android:id="@+id/search_button"
@@ -59,7 +58,6 @@
5958
android:layout_marginBottom="8dp"
6059
app:layout_constraintLeft_toLeftOf="@id/launch_button"
6160
app:layout_constraintRight_toRightOf="parent"
62-
app:layout_constraintBottom_toBottomOf="parent"
63-
app:layout_constraintEnd_toTopOf="parent" />
61+
app:layout_constraintBottom_toBottomOf="parent"/>
6462

6563
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)