This repository was archived by the owner on Sep 13, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
java/com/example/android/sliceviewer/ui/list Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717package com.example.android.sliceviewer.ui.list
1818
19+ import android.content.Context
1920import android.net.Uri
2021import android.os.Bundle
2122import android.view.Menu
2223import android.view.MenuItem
2324import android.view.SubMenu
25+ import android.view.View
26+ import android.view.inputmethod.InputMethodManager
2427import androidx.appcompat.app.AppCompatActivity
2528import androidx.appcompat.widget.SearchView
2629import androidx.appcompat.widget.Toolbar
@@ -68,6 +71,15 @@ class SliceViewerActivity : AppCompatActivity() {
6871 return false
6972 }
7073 })
74+ setOnClickListener {
75+ searchView.isIconified = false
76+ }
77+ setOnFocusChangeListener { v: View , hasFocus: Boolean ->
78+ if (! hasFocus) {
79+ (getSystemService(Context .INPUT_METHOD_SERVICE ) as InputMethodManager )
80+ .hideSoftInputFromWindow(v.windowToken, 0 )
81+ }
82+ }
7183 queryHint = getString(string.uri_input_hint)
7284 }
7385
Original file line number Diff line number Diff line change 6161 android : id =" @+id/slice_list"
6262 android : layout_width =" match_parent"
6363 android : layout_height =" wrap_content"
64+ android : clipToPadding =" false"
6465 android : paddingBottom =" @dimen/vertical_page_margin"
6566 android : paddingEnd =" @dimen/horizontal_page_margin"
6667 android : paddingStart =" @dimen/horizontal_page_margin"
6768 android : paddingTop =" @dimen/vertical_page_margin"
68- android : clipToPadding =" false"
6969 app : layoutManager =" LinearLayoutManager" />
7070</LinearLayout >
You can’t perform that action at this time.
0 commit comments