Add search bar to SearchActivity.

Styling doesn't look exactly right yet but there's a bar.
Creates an ItemDecoration to add a spacer above the first view.

Removes the action bar and replaces it with a SearchView
inside of a CardView.

Remaining work: pixel pushing

Bug: 37477506
Test: make RunSettingsRoboTests
Change-Id: Ibf38c3c2725551bc4cd90e98d0020ec49c2eab2b
Merged-In: I4a0f0c91c51ff5820b61a596520d80a3337c3466
This commit is contained in:
Andrew Sapperstein
2017-05-28 16:28:08 -07:00
parent 14934599dd
commit fac61b71e5
9 changed files with 225 additions and 80 deletions

View File

@@ -28,11 +28,13 @@ import org.junit.runner.RunWith;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.hasFocus;
import static android.support.test.espresso.matcher.ViewMatchers.withClassName;
import static android.support.test.espresso.matcher.ViewMatchers.withTagKey;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.core.AllOf.allOf;
import com.android.settings.R;
@RunWith(AndroidJUnit4.class)
@SmallTest
@@ -43,7 +45,7 @@ public class SearchFragmentEspressoTest {
@Test
public void test_OpenKeyboardOnSearchLaunch() {
onView(allOf(hasFocus(), withTagKey(SearchFragment.SEARCH_TAG)))
onView(allOf(hasFocus(), withId(R.id.search_view)))
.check(matches(withClassName(containsString(SearchView.class.getName()))));
}
}