@@ -122,6 +122,8 @@ public class FinestWebViewActivity extends AppCompatActivity implements AppBarLa
122122
123123 protected boolean showMenuRefresh ;
124124 protected int stringResRefresh ;
125+ protected boolean showMenuFind ;
126+ protected int stringResFind ;
125127 protected boolean showMenuShareVia ;
126128 protected int stringResShareVia ;
127129 protected boolean showMenuCopyLink ;
@@ -283,6 +285,8 @@ protected void getOptions() {
283285
284286 showMenuRefresh = builder .showMenuRefresh != null ? builder .showMenuRefresh : true ;
285287 stringResRefresh = builder .stringResRefresh != null ? builder .stringResRefresh : R .string .refresh ;
288+ showMenuFind = builder .showMenuFind != null ? builder .showMenuFind : false ;
289+ stringResFind = builder .stringResFind != null ? builder .stringResFind : R .string .find ;
286290 showMenuShareVia = builder .showMenuShareVia != null ? builder .showMenuShareVia : true ;
287291 stringResShareVia = builder .stringResShareVia != null ? builder .stringResShareVia : R .string .share_via ;
288292 showMenuCopyLink = builder .showMenuCopyLink != null ? builder .showMenuCopyLink : true ;
@@ -374,6 +378,8 @@ protected void getOptions() {
374378
375379 protected LinearLayout menuRefresh ;
376380 protected TextView menuRefreshTv ;
381+ protected LinearLayout menuFind ;
382+ protected TextView menuFindTv ;
377383 protected LinearLayout menuShareVia ;
378384 protected TextView menuShareViaTv ;
379385 protected LinearLayout menuCopyLink ;
@@ -409,6 +415,8 @@ protected void bindViews() {
409415
410416 menuRefresh = (LinearLayout ) findViewById (R .id .menuRefresh );
411417 menuRefreshTv = (TextView ) findViewById (R .id .menuRefreshTv );
418+ menuFind = (LinearLayout ) findViewById (R .id .menuFind );
419+ menuFindTv = (TextView ) findViewById (R .id .menuFindTv );
412420 menuShareVia = (LinearLayout ) findViewById (R .id .menuShareVia );
413421 menuShareViaTv = (TextView ) findViewById (R .id .menuShareViaTv );
414422 menuCopyLink = (LinearLayout ) findViewById (R .id .menuCopyLink );
@@ -545,7 +553,7 @@ protected void initializeViews() {
545553 close .setVisibility (showIconClose ? View .VISIBLE : View .GONE );
546554 close .setEnabled (!disableIconClose );
547555
548- if ((showMenuRefresh || showMenuShareVia || showMenuCopyLink || showMenuOpenWith ) && showIconMenu )
556+ if ((showMenuRefresh || showMenuFind || showMenuShareVia || showMenuCopyLink || showMenuOpenWith ) && showIconMenu )
549557 more .setVisibility (View .VISIBLE );
550558 else
551559 more .setVisibility (View .GONE );
@@ -769,6 +777,15 @@ public void onRefresh() {
769777 menuRefreshTv .setTextColor (menuTextColor );
770778 menuRefreshTv .setPadding ((int ) menuTextPaddingLeft , 0 , (int ) menuTextPaddingRight , 0 );
771779
780+ menuFind .setVisibility (showMenuFind ? View .VISIBLE : View .GONE );
781+ menuFind .setBackgroundResource (menuSelector );
782+ menuFind .setGravity (menuTextGravity );
783+ menuFindTv .setText (stringResFind );
784+ menuFindTv .setTextSize (TypedValue .COMPLEX_UNIT_PX , menuTextSize );
785+ menuFindTv .setTypeface (TypefaceHelper .get (this , menuTextFont ));
786+ menuFindTv .setTextColor (menuTextColor );
787+ menuFindTv .setPadding ((int ) menuTextPaddingLeft , 0 , (int ) menuTextPaddingRight , 0 );
788+
772789 menuShareVia .setVisibility (showMenuShareVia ? View .VISIBLE : View .GONE );
773790 menuShareVia .setBackgroundResource (menuSelector );
774791 menuShareVia .setGravity (menuTextGravity );
@@ -867,6 +884,10 @@ public void onClick(View view) {
867884 } else if (viewId == R .id .menuRefresh ) {
868885 webView .reload ();
869886 hideMenu ();
887+ } else if (viewId == R .id .menuFind ) {
888+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .HONEYCOMB )
889+ webView .showFindDialog ("" , true );
890+ hideMenu ();
870891 } else if (viewId == R .id .menuShareVia ) {
871892 Intent sendIntent = new Intent ();
872893 sendIntent .setAction (Intent .ACTION_SEND );
0 commit comments