Browse Source

Rename getTitleView to findTitleView

Guy Carmeli 6 years ago
parent
commit
b4527273c9

+ 7
- 6
lib/android/app/src/main/java/com/reactnativenavigation/views/titlebar/TitleBar.java View File

20
 import java.util.ArrayList;
20
 import java.util.ArrayList;
21
 import java.util.List;
21
 import java.util.List;
22
 
22
 
23
+import javax.annotation.Nullable;
24
+
23
 import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
25
 import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
24
 
26
 
25
 @SuppressLint("ViewConstructor")
27
 @SuppressLint("ViewConstructor")
66
     }
68
     }
67
 
69
 
68
     public void setTitleFontSize(float size) {
70
     public void setTitleFontSize(float size) {
69
-        TextView titleTextView = getTitleTextView();
71
+        TextView titleTextView = findTitleTextView();
70
         if (titleTextView != null) titleTextView.setTextSize(size);
72
         if (titleTextView != null) titleTextView.setTextSize(size);
71
     }
73
     }
72
 
74
 
73
     public void setTitleTypeface(Typeface typeface) {
75
     public void setTitleTypeface(Typeface typeface) {
74
-        TextView titleTextView = getTitleTextView();
75
-        if (titleTextView != null) {
76
-            titleTextView.setTypeface(typeface);
77
-        }
76
+        TextView titleTextView = findTitleTextView();
77
+        if (titleTextView != null) titleTextView.setTypeface(typeface);
78
     }
78
     }
79
 
79
 
80
-    public TextView getTitleTextView() {
80
+    @Nullable
81
+    public TextView findTitleTextView() {
81
         List<TextView> children = ViewUtils.findChildrenByClass(this, TextView.class);
82
         List<TextView> children = ViewUtils.findChildrenByClass(this, TextView.class);
82
         return children.isEmpty() ? null : children.get(0);
83
         return children.isEmpty() ? null : children.get(0);
83
     }
84
     }

+ 1
- 2
lib/android/app/src/main/java/com/reactnativenavigation/views/topbar/TopBar.java View File

21
 import com.reactnativenavigation.parse.AnimationOptions;
21
 import com.reactnativenavigation.parse.AnimationOptions;
22
 import com.reactnativenavigation.parse.params.Button;
22
 import com.reactnativenavigation.parse.params.Button;
23
 import com.reactnativenavigation.parse.params.Color;
23
 import com.reactnativenavigation.parse.params.Color;
24
-import com.reactnativenavigation.parse.params.Fraction;
25
 import com.reactnativenavigation.parse.params.Number;
24
 import com.reactnativenavigation.parse.params.Number;
26
 import com.reactnativenavigation.parse.params.Text;
25
 import com.reactnativenavigation.parse.params.Text;
27
 import com.reactnativenavigation.utils.CompatUtils;
26
 import com.reactnativenavigation.utils.CompatUtils;
226
 
225
 
227
     @RestrictTo(RestrictTo.Scope.TESTS)
226
     @RestrictTo(RestrictTo.Scope.TESTS)
228
     public TextView getTitleTextView() {
227
     public TextView getTitleTextView() {
229
-        return titleBar.getTitleTextView();
228
+        return titleBar.findTitleTextView();
230
     }
229
     }
231
 }
230
 }