Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Commit

Permalink
ui: add temp button to open UrlBarFragment
Browse files Browse the repository at this point in the history
before we have Floating button to use, make a temporary button to open
UrlBarFragment so we can still input url.

this commit should be reverted once #18 complete.
  • Loading branch information
walkingice committed Jul 24, 2017
1 parent a21b93a commit 834f873
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/java/org/mozilla/focus/home/HomeFragment.java
Expand Up @@ -47,6 +47,18 @@ public View onCreateView(@NonNull LayoutInflater inflater,
final View view = inflater.inflate(R.layout.fragment_homescreen, container, false);
this.recyclerView = (RecyclerView) view.findViewById(R.id.main_list);

view.findViewById(R.id.urlbar_search).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Activity parent = getActivity();
if ((parent instanceof FragmentListener)) {
((FragmentListener) parent).onNotified(HomeFragment.this,
FragmentListener.TYPE.SHOW_URL_INPUT,
null);
}
}
});

return view;
}

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/layout/fragment_homescreen.xml
Expand Up @@ -38,5 +38,11 @@

</android.support.v7.widget.RecyclerView>

<Button
android:id="@+id/urlbar_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search" />

</LinearLayout>
</FrameLayout>

0 comments on commit 834f873

Please sign in to comment.