Commit 671727c3 authored by Nikit Bhandari's avatar Nikit Bhandari Committed by Emily Kager
Browse files

For #4341 use camelCase for views referenced from code

parent 1cb9f887
......@@ -48,7 +48,7 @@ class CreateCollectionFragment : DialogFragment() {
}
collectionCreationComponent = CollectionCreationComponent(
view.create_collection_wrapper,
view.createCollectionWrapper,
ActionBusFactory.get(this),
FenixViewModelProvider.create(
this,
......
......@@ -38,11 +38,11 @@ class CrashReporterFragment : Fragment() {
val selectedSession = requireComponents.core.sessionManager.selectedSession
restore_tab_button.setOnClickListener {
restoreTabButton.setOnClickListener {
selectedSession?.let { session -> closeFragment(true, session, crash) }
}
close_tab_button.setOnClickListener {
closeTabButton.setOnClickListener {
selectedSession?.let { session -> closeFragment(false, session, crash) }
}
}
......@@ -67,7 +67,7 @@ class CrashReporterFragment : Fragment() {
private fun submitReportIfNecessary(crash: Crash) {
var didSubmitCrashReport = false
if (Settings.getInstance(context!!).isCrashReportingEnabled && send_crash_checkbox.isChecked) {
if (Settings.getInstance(context!!).isCrashReportingEnabled && sendCrashCheckbox.isChecked) {
requireComponents.analytics.crashReporter.submitReport(crash)
didSubmitCrashReport = true
}
......
......@@ -49,7 +49,7 @@ class ExceptionsFragment : Fragment() {
}
exceptionsInteractor =
ExceptionsInteractor(::openLearnMore, ::deleteOneItem, ::deleteAllItems)
exceptionsView = ExceptionsView(view.exceptions_layout, exceptionsInteractor)
exceptionsView = ExceptionsView(view.exceptionsLayout, exceptionsInteractor)
return view
}
......
......@@ -90,8 +90,8 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), BackHandler, Accou
::deleteMulti
)
bookmarkView = BookmarkView(view.bookmark_layout, bookmarkInteractor)
signInView = SignInView(view.bookmark_layout, bookmarkInteractor)
bookmarkView = BookmarkView(view.bookmarkLayout, bookmarkInteractor)
signInView = SignInView(view.bookmarkLayout, bookmarkInteractor)
return view
}
......
......@@ -53,8 +53,8 @@ class AddBookmarkFolderFragment : Fragment() {
sharedViewModel.selectedFolder = sharedViewModel.selectedFolder
?: requireComponents.core.bookmarksStorage.getTree(BookmarkRoot.Mobile.id)
launch(Main) {
bookmark_add_folder_parent_selector.text = sharedViewModel.selectedFolder!!.title
bookmark_add_folder_parent_selector.setOnClickListener {
bookmarkAddFolderParentSelector.text = sharedViewModel.selectedFolder!!.title
bookmarkAddFolderParentSelector.setOnClickListener {
nav(
R.id.bookmarkAddFolderFragment,
AddBookmarkFolderFragmentDirections
......@@ -77,14 +77,14 @@ class AddBookmarkFolderFragment : Fragment() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.confirm_add_folder_button -> {
if (bookmark_add_folder_title_edit.text.isNullOrBlank()) {
bookmark_add_folder_title_edit.error =
if (bookmarkAddFolderTitleEdit.text.isNullOrBlank()) {
bookmarkAddFolderTitleEdit.error =
getString(R.string.bookmark_empty_title_error)
return true
}
lifecycleScope.launch(IO) {
val newGuid = requireComponents.core.bookmarksStorage.addFolder(
sharedViewModel.selectedFolder!!.guid, bookmark_add_folder_title_edit.text.toString(), null
sharedViewModel.selectedFolder!!.guid, bookmarkAddFolderTitleEdit.text.toString(), null
)
sharedViewModel.selectedFolder = requireComponents.core.bookmarksStorage.getTree(newGuid)
requireComponents.analytics.metrics.track(Event.AddBookmarkFolder)
......
......@@ -84,8 +84,8 @@ class EditBookmarkFragment : Fragment() {
when (bookmarkNode?.type) {
BookmarkNodeType.FOLDER -> {
activity?.title = getString(R.string.edit_bookmark_folder_fragment_title)
bookmark_url_edit.visibility = View.GONE
bookmark_url_label.visibility = View.GONE
bookmarkUrlEdit.visibility = View.GONE
bookmarkUrlLabel.visibility = View.GONE
}
BookmarkNodeType.ITEM -> {
activity?.title = getString(R.string.edit_bookmark_fragment_title)
......@@ -94,8 +94,8 @@ class EditBookmarkFragment : Fragment() {
}
if (bookmarkNode != null) {
bookmark_name_edit.setText(bookmarkNode!!.title)
bookmark_url_edit.setText(bookmarkNode!!.url)
bookmarkNameEdit.setText(bookmarkNode!!.title)
bookmarkUrlEdit.setText(bookmarkNode!!.url)
if (sharedViewModel.selectedFolder != null && bookmarkNode?.title != null) {
val bookmarkPair = Pair(bookmarkNode?.title, bookmarkNode?.url)
......@@ -106,8 +106,8 @@ class EditBookmarkFragment : Fragment() {
bookmarkParent?.let { node ->
launch(Main) {
bookmark_folder_selector.text = node.title
bookmark_folder_selector.setOnClickListener {
bookmarkFolderSelector.text = node.title
bookmarkFolderSelector.setOnClickListener {
sharedViewModel.selectedFolder = null
nav(
R.id.bookmarkEditFragment,
......@@ -124,14 +124,14 @@ class EditBookmarkFragment : Fragment() {
override fun onPause() {
super.onPause()
bookmark_name_edit.hideKeyboard()
bookmark_url_edit.hideKeyboard()
bookmarkNameEdit.hideKeyboard()
bookmarkUrlEdit.hideKeyboard()
}
private fun updateBookmarkFromObservableInput() {
Observable.combineLatest(
bookmark_name_edit.textChanges().skipInitialValue(),
bookmark_url_edit.textChanges().skipInitialValue(),
bookmarkNameEdit.textChanges().skipInitialValue(),
bookmarkUrlEdit.textChanges().skipInitialValue(),
BiFunction { name: CharSequence, url: CharSequence ->
Pair(name.toString(), url.toString())
})
......@@ -208,7 +208,7 @@ class EditBookmarkFragment : Fragment() {
}
} catch (e: UrlParseFailed) {
launch(Main) {
bookmark_url_edit.error = getString(R.string.bookmark_invalid_url_error)
bookmarkUrlEdit.error = getString(R.string.bookmark_invalid_url_error)
}
}
}
......
......@@ -60,7 +60,7 @@ class SelectBookmarkFolderFragment : Fragment(), AccountObserver {
findNavController(),
sharedViewModel
)
signInView = SignInView(view.select_bookmark_layout, bookmarkInteractor)
signInView = SignInView(view.selectBookmarkLayout, bookmarkInteractor)
return view
}
......@@ -88,7 +88,7 @@ class SelectBookmarkFolderFragment : Fragment(), AccountObserver {
}
activity?.title = bookmarkNode?.title ?: getString(R.string.library_bookmarks)
val adapter = SelectBookmarkFolderAdapter(sharedViewModel)
recylerView_bookmark_folders.adapter = adapter
recylerViewBookmarkFolders.adapter = adapter
adapter.updateData(bookmarkNode)
}
}
......
......@@ -65,7 +65,7 @@ class HistoryFragment : LibraryPageFragment<HistoryItem>(), BackHandler {
::invalidateOptionsMenu,
::deleteHistoryItems
)
historyView = HistoryView(view.history_layout, historyInteractor)
historyView = HistoryView(view.historyLayout, historyInteractor)
return view
}
......
......@@ -108,7 +108,7 @@ class SearchFragment : Fragment(), BackHandler {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
search_scan_button.visibility = if (context?.hasCamera() == true) View.VISIBLE else View.GONE
searchScanButton.visibility = if (context?.hasCamera() == true) View.VISIBLE else View.GONE
layoutComponents(view.search_layout)
qrFeature.set(
......@@ -119,7 +119,7 @@ class SearchFragment : Fragment(), BackHandler {
requestPermissions(permissions, REQUEST_CODE_CAMERA_PERMISSIONS)
},
onScanResult = { result ->
search_scan_button.isChecked = false
searchScanButton.isChecked = false
activity?.let {
AlertDialog.Builder(it).apply {
val spannable = resources.getSpannable(
......@@ -153,7 +153,7 @@ class SearchFragment : Fragment(), BackHandler {
view = view
)
view.search_scan_button.setOnClickListener {
view.searchScanButton.setOnClickListener {
toolbarView.view.clearFocus()
requireComponents.analytics.metrics.track(Event.QRScannerOpened)
qrFeature.get()?.scan(R.id.container)
......@@ -161,7 +161,7 @@ class SearchFragment : Fragment(), BackHandler {
view.toolbar_wrapper.clipToOutline = false
search_shortcuts_button.setOnClickListener {
searchShortcutsButton.setOnClickListener {
val isOpen = searchStore.state.showShortcutEnginePicker
searchStore.dispatch(SearchAction.ShowSearchShortcutEnginePicker(!isOpen))
......@@ -204,7 +204,7 @@ class SearchFragment : Fragment(), BackHandler {
override fun onBackPressed(): Boolean {
return when {
qrFeature.onBackPressed() -> {
view?.search_scan_button?.isChecked = false
view?.searchScanButton?.isChecked = false
toolbarView.view.requestFocus()
true
}
......@@ -217,21 +217,21 @@ class SearchFragment : Fragment(), BackHandler {
val draw = BitmapDrawable(resources, searchIcon)
val iconSize = resources.getDimension(R.dimen.preference_icon_drawable_size).toInt()
draw.setBounds(0, 0, iconSize, iconSize)
search_engine_icon?.backgroundDrawable = draw
searchEngineIcon?.backgroundDrawable = draw
}
private fun updateSearchWithLabel(searchState: SearchState) {
search_with_shortcuts.visibility = if (searchState.showShortcutEnginePicker) View.VISIBLE else View.GONE
searchWithShortcuts.visibility = if (searchState.showShortcutEnginePicker) View.VISIBLE else View.GONE
}
private fun updateSearchShortuctsIcon(searchState: SearchState) {
with(requireContext()) {
val showShortcuts = searchState.showShortcutEnginePicker
search_shortcuts_button?.isChecked = showShortcuts
searchShortcutsButton?.isChecked = showShortcuts
val color = if (showShortcuts) R.attr.contrastText else R.attr.primaryText
search_shortcuts_button.compoundDrawables[0]?.setTint(getColorFromAttr(color))
searchShortcutsButton.compoundDrawables[0]?.setTint(getColorFromAttr(color))
}
}
......@@ -244,7 +244,7 @@ class SearchFragment : Fragment(), BackHandler {
if (context.isPermissionGranted(Manifest.permission.CAMERA)) {
permissionDidUpdate = true
} else {
view?.search_scan_button?.isChecked = false
view?.searchScanButton?.isChecked = false
}
}
}
......
......@@ -36,7 +36,7 @@ internal fun SearchFragment.setInExperimentConstraints(layout: ConstraintLayout)
toolbar_wrapper {
connect(
TOP to TOP of UNSET,
BOTTOM to TOP of pill_wrapper
BOTTOM to TOP of pillWrapper
)
}
awesomeBar {
......@@ -46,7 +46,7 @@ internal fun SearchFragment.setInExperimentConstraints(layout: ConstraintLayout)
)
}
(awesomeBar.layoutManager as? LinearLayoutManager)?.reverseLayout = true
pill_wrapper {
pillWrapper {
connect(
BOTTOM to BOTTOM of PARENT_ID
)
......@@ -63,7 +63,7 @@ internal fun SearchFragment.setOutOfExperimentConstraints(layout: ConstraintLayo
BOTTOM to TOP of UNSET
)
}
search_with_shortcuts {
searchWithShortcuts {
connect(
TOP to BOTTOM of toolbar_wrapper
)
......@@ -71,12 +71,12 @@ internal fun SearchFragment.setOutOfExperimentConstraints(layout: ConstraintLayo
awesomeBar {
connect(
TOP to TOP of UNSET,
TOP to BOTTOM of search_with_shortcuts,
BOTTOM to TOP of pill_wrapper
TOP to BOTTOM of searchWithShortcuts,
BOTTOM to TOP of pillWrapper
)
}
(awesomeBar.layoutManager as? LinearLayoutManager)?.reverseLayout = false
pill_wrapper {
pillWrapper {
connect(
BOTTOM to BOTTOM of PARENT_ID
)
......
......@@ -33,7 +33,7 @@ class PairFragment : Fragment(), BackHandler {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
pair_instructions.text = HtmlCompat.fromHtml(getString(R.string.pair_instructions),
pairInstructions.text = HtmlCompat.fromHtml(getString(R.string.pair_instructions),
HtmlCompat.FROM_HTML_MODE_LEGACY)
qrFeature.set(
......
......@@ -56,7 +56,7 @@ class SignOutFragment : BottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.sign_out_disconnect.setOnClickListener {
view.signOutDisconnect.setOnClickListener {
requireComponents.analytics.metrics.track(Event.SyncAccountSignOut)
lifecycleScope.launch {
accountManager.logoutAsync().await()
......@@ -67,7 +67,7 @@ class SignOutFragment : BottomSheetDialogFragment() {
}
}
view.sign_out_cancel.setOnClickListener {
view.signOutCancel.setOnClickListener {
dismiss()
}
}
......
......@@ -47,9 +47,9 @@ class TurnOnSyncFragment : Fragment(), AccountObserver {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_turn_on_sync, container, false)
view.sign_in_scan_button.setOnClickListener(getClickListenerForPairing())
view.sign_in_email_button.setOnClickListener(getClickListenerForSignIn())
view.sign_in_instructions.text = HtmlCompat.fromHtml(
view.signInScanButton.setOnClickListener(getClickListenerForPairing())
view.signInEmailButton.setOnClickListener(getClickListenerForSignIn())
view.signInInstructions.text = HtmlCompat.fromHtml(
getString(R.string.sign_in_instructions),
HtmlCompat.FROM_HTML_MODE_LEGACY
)
......
......@@ -54,7 +54,7 @@ class ShareFragment : AppCompatDialogFragment() {
tabs = args.tabs ?: arrayOf(ShareTab(args.url!!, args.title ?: ""))
component = ShareComponent(
view.share_wrapper,
view.shareWrapper,
ActionBusFactory.get(this),
FenixViewModelProvider.create(
this,
......
......@@ -18,10 +18,10 @@
android:textAllCaps="true"
android:textColor="?primaryText"
android:textSize="12sp"
android:labelFor="@id/bookmark_add_folder_title_edit" />
android:labelFor="@id/bookmarkAddFolderTitleEdit" />
<org.mozilla.fenix.utils.ClearableEditText
android:id="@+id/bookmark_add_folder_title_edit"
android:id="@+id/bookmarkAddFolderTitleEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
......@@ -41,7 +41,7 @@
android:textSize="12sp" />
<TextView
android:id="@+id/bookmark_add_folder_parent_selector"
android:id="@+id/bookmarkAddFolderParentSelector"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
......
......@@ -9,7 +9,7 @@
tools:context="org.mozilla.fenix.library.bookmarks.BookmarkFragment">
<LinearLayout
android:id="@+id/bookmark_layout"
android:id="@+id/bookmarkLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" />
......
......@@ -38,7 +38,7 @@
tools:text="@string/tab_crash_title_2"/>
<CheckBox
android:id="@+id/send_crash_checkbox"
android:id="@+id/sendCrashCheckbox"
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_marginBottom="20dp"
......@@ -47,13 +47,13 @@
android:text="@string/tab_crash_send_report"
android:textColor="?primaryText"
android:textSize="15sp"
app:layout_constraintBottom_toTopOf="@id/close_tab_button"
app:layout_constraintBottom_toTopOf="@id/closeTabButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.9"/>
<Button
android:id="@+id/restore_tab_button"
android:id="@+id/restoreTabButton"
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_marginStart="@dimen/crash_reporter_close_tab_button_horizontal_margin"
......@@ -72,7 +72,7 @@
app:layout_constraintWidth_percent="0.4" />
<Button
android:id="@+id/close_tab_button"
android:id="@+id/closeTabButton"
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_marginStart="@dimen/crash_reporter_close_tab_button_horizontal_margin"
......
......@@ -5,7 +5,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/create_collection_wrapper"
android:id="@+id/createCollectionWrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/scrim_background"
......
......@@ -18,10 +18,10 @@
android:textColor="?primaryText"
android:textSize="12sp"
android:textAllCaps="true"
android:labelFor="@id/bookmark_name_edit" />
android:labelFor="@id/bookmarkNameEdit" />
<org.mozilla.fenix.utils.ClearableEditText
android:id="@+id/bookmark_name_edit"
android:id="@+id/bookmarkNameEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
......@@ -35,7 +35,7 @@
tools:text="Internet for people, not profit -- Mozilla" />
<TextView
android:id="@+id/bookmark_url_label"
android:id="@+id/bookmarkUrlLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
......@@ -43,10 +43,10 @@
android:textColor="?primaryText"
android:textSize="12sp"
android:textAllCaps="true"
android:labelFor="@id/bookmark_url_edit" />
android:labelFor="@id/bookmarkUrlEdit" />
<org.mozilla.fenix.utils.ClearableEditText
android:id="@+id/bookmark_url_edit"
android:id="@+id/bookmarkUrlEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
......@@ -68,10 +68,10 @@
android:textColor="?primaryText"
android:textSize="12sp"
android:textAllCaps="true"
android:labelFor="@id/bookmark_folder_selector" />
android:labelFor="@id/bookmarkFolderSelector" />
<TextView
android:id="@+id/bookmark_folder_selector"
android:id="@+id/bookmarkFolderSelector"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
......
......@@ -4,7 +4,7 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/exceptions_layout"
android:id="@+id/exceptionsLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
......
Supports Markdown
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