Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_11
}

kapt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class HomeTest {
Espresso.pressBack()

// Check menu panel not exist
onView(withId(R.id.menu)).check(doesNotExist())
onView(withId(R.id.container)).check(doesNotExist())

// Tap menu
AndroidTestUtils.tapHomeMenuButton()
Expand All @@ -144,10 +144,10 @@ class HomeTest {
val displayMetrics = activityRule.activity.resources.displayMetrics
val displayWidth = displayMetrics.widthPixels
val displayHeight = displayMetrics.heightPixels
onView(withId(R.id.menu)).perform(AndroidTestUtils.clickXY(displayWidth / 2, -displayHeight / 2, Tap.SINGLE))
onView(withId(R.id.container)).perform(AndroidTestUtils.clickXY(displayWidth / 2, -displayHeight / 2, Tap.SINGLE))

// Check menu panel not exist
onView(withId(R.id.menu)).check(doesNotExist())
onView(withId(R.id.container)).check(doesNotExist())
}
}

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/org/mozilla/focus/activity/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ class MainActivity :
Toast.LENGTH_LONG
).show()
}
DownloadsRepository.DownloadState.GeneralError -> {
Toast.makeText(
this@MainActivity,
"Downloading general error",
Toast.LENGTH_LONG
).show()
}
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class RocketLauncherActivity : AppCompatActivity() {
LaunchIntentDispatcher.Action.HANDLED -> finish()
LaunchIntentDispatcher.Action.NORMAL -> dispatchNormalIntent()
LaunchIntentDispatcher.Action.PRIVATE -> dispatchPrivateIntent()
null -> finish()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ class ContentTabActivity : BaseActivity(), TabsSessionProvider.SessionHost, Cont
if (!downloadState.isStartFromContextMenu) {
Toast.makeText(this, R.string.download_started, Toast.LENGTH_LONG).show()
}
DownloadsRepository.DownloadState.GeneralError ->
Toast.makeText(this, "Downloading general error", Toast.LENGTH_LONG).show()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class DownloadsRepository(
TelemetryWrapper.startDownloadFile(result.downloadId.toString(), fileSize, headerInfo.isValidSSL, headerInfo.isSupportRange)
}
}
// FIXME: find a proper way to handle this
DownloadState.FileNotSupported,
DownloadState.GeneralError,
DownloadState.StorageUnavailable -> Unit
}
}
return result
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/org/mozilla/rocket/home/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class HomeViewModel(
if (sitePage < sitePages.size && siteInPageIndex < sitePages[sitePage].sites.size) {
when (val topSite = sitePages[sitePage].sites[siteInPageIndex]) {
is Site.UrlSite -> topSite.highlight = true
// FIXME: find a proper way to handle this
Site.DummySite,
Site.EmptyHintSite -> Unit
}
}
}
Expand Down Expand Up @@ -219,6 +222,8 @@ class HomeViewModel(
openAddNewTopSitesPage()
TelemetryWrapper.addTopSite(TelemetryWrapper.Extra_Value.EMPTY_HINT)
}
// FIXME: find a proper way to handle this
Site.DummySite -> Unit
}
}

Expand All @@ -231,6 +236,9 @@ class HomeViewModel(
showTopSiteMenu.value =
ShowTopSiteMenuData(site, topSitePosition)
is Site.DummySite -> showAddTopSiteMenu.call()
// FIXME: find a proper way to handle this
Site.EmptyHintSite,
is Site.UrlSite.FixedSite -> Unit
}
true
} else {
Expand All @@ -250,6 +258,9 @@ class HomeViewModel(
val title = if (allowToLogTitle) site.title else ""
TelemetryWrapper.pinTopSite(title, position, allowToLogTitle)
}
// FIXME: find a proper way to handle this
Site.DummySite,
Site.EmptyHintSite -> Unit
}
}

Expand All @@ -262,6 +273,10 @@ class HomeViewModel(
val title = if (allowToLogTitle) site.title else ""
TelemetryWrapper.removeTopSite(site.isDefault, position, title, site.isPinned)
}
// FIXME: find a proper way to handle this
Site.DummySite,
Site.EmptyHintSite,
is Site.UrlSite.FixedSite -> Unit
}
}

Expand All @@ -274,6 +289,8 @@ class HomeViewModel(
is PinTopSiteUseCase.PinTopSiteResult.Existing -> {
addExistingTopSite.value = pinTopSiteResult.position / TOP_SITES_PER_PAGE
}
// FIXME: find a proper way to handle this
PinTopSiteUseCase.PinTopSiteResult.FullyPinned -> Unit
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class DismissLogoManNotificationUseCase(
operator fun invoke(notification: LogoManNotification.Notification) {
when (notification) {
is RemoteNotification -> logoManNotificationRepo.saveLastReadNotificationId(notification.id)
// FIXME: find a proper way to handle this
is LogoManNotification.Notification.MissionNotification -> Unit
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class AddNewTopSitesViewModel(
TelemetryWrapper.selectToAddTopSite(true, position, site.title)
}
}
// FIXME: find a proper way to handle this
Site.DummySite,
Site.EmptyHintSite -> Unit
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class RecommendedSiteViewHolder(

itemView.setOnClickListener { topSiteClickListener.onTopSiteClicked(site, adapterPosition) }
}
// FIXME: find a proper way to handle this
Site.DummySite,
Site.EmptyHintSite -> Unit
}
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object Versions {
const val guava_android = "28.2-android"
const val room = "2.4.3"
const val glide = "4.0.0"
const val kotlin = "1.6.0"
const val kotlin = "1.7.20"
const val kotlinXCoroutine = "1.6.0"
const val ktlint = "0.41.0"
const val gms = "11.8.0"
Expand Down
Loading