Commit c90b668b authored by Varun Patil's avatar Varun Patil

Prevent delayed font change map search

parent b143b11b
......@@ -200,6 +200,8 @@ public class MapFragment extends Fragment implements TextWatcher,
/* Initialize */
appDatabase = AppDatabase.getAppDatabase(getContext());
editText = (EditText)getView().findViewById(R.id.search);
setFonts();
getAPILocations();
new showLocationsFromDB().execute();
......@@ -442,15 +444,25 @@ public class MapFragment extends Fragment implements TextWatcher,
}
private void setFonts() {
if (getView() == null || getActivity() == null) return;
Typeface regular = Typeface.createFromAsset(getActivity().getAssets(), FONT_REGULAR);
placeNameTextView.setTypeface(regular, Typeface.BOLD);
placeSubHeadTextView.setTypeface(regular);
editText.setTypeface(regular);
if (placeNameTextView != null) {
placeNameTextView.setTypeface(regular, Typeface.BOLD);
}
if (placeSubHeadTextView != null) {
placeSubHeadTextView.setTypeface(regular);
}
if (editText != null) {
editText.setTypeface(regular);
}
TextView settingsTitle = (TextView) getActivity()
.findViewById(R.id.settings_title);
settingsTitle.setTypeface(regular);
if (settingsTitle != null) {
settingsTitle.setTypeface(regular);
}
}
private Runnable setAnchor() {
......
......@@ -24,7 +24,7 @@
android:layout_alignParentTop="true"
android:background="@null"
android:dropDownHeight="0dp"
android:fontFamily="sans-serif-light"
android:fontFamily="sans-serif"
android:hint="Search"
android:imeOptions="actionSearch"
android:inputType="textNoSuggestions"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment