}
dependencies {
compile 'com.android.support:appcompat-v7:25.0.0'
+ compile 'com.android.support:design:25.0.0'
// Note: you can just replace "smallicu" by compile
// and remove the "compile files" part if you do not
// care about the size of the apk
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:focusable="true"
android:focusableInTouchMode="true" />
+ <android.support.design.widget.FloatingActionButton
+ android:id="@+id/floatSwapButton"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_swap_horiz_black_24dp" />
+
<TextView
android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/noSearchResults" />
-</LinearLayout>
+</RelativeLayout>
}
Log.d(LOG, "Loading index " + indexIndex);
index = dictionary.indices.get(indexIndex);
+ getListView().setEmptyView(findViewById(android.R.id.empty));
setListAdapter(new IndexAdapter(index));
// Pre-load the collators.
onCreateSetupActionBarAndSearchView();
+ View floatSwapButton = findViewById(R.id.floatSwapButton);
+ floatSwapButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ onLanguageButtonClick();
+ }
+ });
+ floatSwapButton.setOnLongClickListener(new OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ onLanguageButtonLongClick(v.getContext());
+ return true;
+ }
+ });
+
// Set the search text from the intent, then the saved state.
String text = getIntent().getStringExtra(C.SEARCH_TOKEN);
if (savedInstanceState != null) {