Add search title

This commit is contained in:
J-Jamet
2018-07-27 10:54:58 +02:00
parent aa29aec40f
commit 0f22f8af45
3 changed files with 14 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ public class GroupActivity extends LockingActivity
private static final String NODE_TO_MOVE_KEY = "NODE_TO_MOVE_KEY";
private Toolbar toolbar;
private View searchTitleView;
private ExpandableLayout toolbarPasteExpandableLayout;
private Toolbar toolbarPaste;
private ImageView iconView;
@@ -219,6 +220,7 @@ public class GroupActivity extends LockingActivity
iconView = findViewById(R.id.icon);
addNodeButtonView = findViewById(R.id.add_node_button);
toolbar = findViewById(R.id.toolbar);
searchTitleView = findViewById(R.id.search_title);
groupNameView = findViewById(R.id.group_name);
toolbarPasteExpandableLayout = findViewById(R.id.expandable_toolbar_paste_layout);
toolbarPaste = findViewById(R.id.toolbar_paste);
@@ -408,6 +410,11 @@ public class GroupActivity extends LockingActivity
}
}
}
if (currentGroupIsASearch) {
searchTitleView.setVisibility(View.VISIBLE);
} else {
searchTitleView.setVisibility(View.GONE);
}
// Assign icon
if (currentGroupIsASearch) {

View File

@@ -59,7 +59,7 @@ public class SearchDbHelper<PwDatabaseVersion extends PwDatabase<PwGroupSearch,
public PwGroupSearch search(PwDatabaseVersion pm, String qStr, int max) {
PwGroupSearch group = pm.createGroup();
group.setName(mCtx.getString(R.string.search_results));
group.setName("\"" + qStr + "\"");
group.setEntries(new ArrayList<>());
// Search all entries

View File

@@ -64,6 +64,12 @@
android:layout_alignParentStart="true"
android:layout_below="@+id/toolbar"
android:orientation="vertical">
<TextView android:id="@+id/search_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search_results"
android:visibility="gone"
style="@style/KeepassDXStyle.TextAppearance.DefaultTextOnPrimary" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"