mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
search UI
This commit is contained in:
parent
834bc35318
commit
853ac1eca3
|
@ -1,19 +1,16 @@
|
||||||
package one.nem.lacerta.feature.search;
|
package one.nem.lacerta.feature.search;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
|
||||||
import android.app.LauncherActivity;
|
import android.app.LauncherActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.core.view.MenuItemCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.SearchView;
|
import android.widget.SearchView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -83,9 +80,9 @@ public class SearchTopFragment extends Fragment {
|
||||||
return inflater.inflate(R.layout.fragment_search_top, container, false);
|
return inflater.inflate(R.layout.fragment_search_top, container, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(FrameLayout framelayout, MenuInflater inflater) {
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu((Menu) framelayout, inflater);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,9 +97,9 @@ public class SearchTopFragment extends Fragment {
|
||||||
|
|
||||||
this.searchView.setQuery(this.searchWord, false);
|
this.searchView.setQuery(this.searchWord, false);
|
||||||
} else {
|
} else {
|
||||||
String queryHint = self.getResources().getString(R.string.hello_blank_fragment);
|
String query = self.getResources().getString(R.string.hello_blank_fragment);
|
||||||
|
|
||||||
this.searchView.setQueryHint(queryHint);
|
this.searchView.setQueryHint(query);
|
||||||
}
|
}
|
||||||
this.searchView.setOnQueryTextListener(self.onQueryTextListener);
|
this.searchView.setOnQueryTextListener(self.onQueryTextListener);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +108,7 @@ public class SearchTopFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
|
|
||||||
return self.setSearchWord(searchWord);
|
return self.setSearchWord();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -120,7 +117,7 @@ public class SearchTopFragment extends Fragment {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private boolean setSearchWord(String query) {
|
private boolean setSearchWord() {
|
||||||
|
|
||||||
|
|
||||||
if (searchWord != null && !searchWord.equals("")) {
|
if (searchWord != null && !searchWord.equals("")) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user