diff --git a/app/src/main/java/fr/free/nrw/commons/AboutActivity.kt b/app/src/main/java/fr/free/nrw/commons/AboutActivity.kt index 865ad3ddb13..1aab047d9c5 100644 --- a/app/src/main/java/fr/free/nrw/commons/AboutActivity.kt +++ b/app/src/main/java/fr/free/nrw/commons/AboutActivity.kt @@ -6,202 +6,277 @@ import android.content.Intent import android.content.Intent.ACTION_VIEW import android.net.Uri import android.os.Bundle -import android.view.Menu -import android.view.MenuItem -import android.view.View -import android.widget.ArrayAdapter -import android.widget.LinearLayout -import android.widget.Spinner -import fr.free.nrw.commons.CommonsApplication.Companion.instance -import fr.free.nrw.commons.databinding.ActivityAboutBinding -import fr.free.nrw.commons.theme.BaseActivity +import androidx.activity.compose.setContent +import androidx.compose.animation.core.* +import androidx.compose.foundation.* +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight +import androidx.compose.material.icons.filled.Share +import androidx.compose.material3.* +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.alpha +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.res.colorResource +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.viewinterop.AndroidView +import androidx.core.net.toUri +import fr.free.nrw.commons.theme.* +import fr.free.nrw.commons.ui.widget.HtmlTextView import fr.free.nrw.commons.utils.ConfigUtils.getVersionNameWithSha import fr.free.nrw.commons.utils.DialogUtil.showAlertDialog -import java.util.Collections -import androidx.core.net.toUri -import fr.free.nrw.commons.utils.applyEdgeToEdgeTopInsets import fr.free.nrw.commons.utils.handleWebUrl -import fr.free.nrw.commons.utils.setUnderlinedText +import java.util.* + +// grouped the actions into a single class for the betteer scalability +data class AboutActions( + val onBackClick: () -> Unit, + val onShareClick: () -> Unit, + val onLaunchFacebook: () -> Unit, + val onLaunchGithub: () -> Unit, + val onLaunchWebsite: () -> Unit, + val onRateUs: () -> Unit, + val onUserGuide: () -> Unit, + val onPrivacyPolicy: () -> Unit, + val onTranslate: () -> Unit, + val onCredits: () -> Unit, + val onFaq: () -> Unit +) -/** - * Represents about screen of this app - */ +data class AboutLinkItem(val textRes: Int, val onClick: () -> Unit) class AboutActivity : BaseActivity() { - /* - This View Binding class is auto-generated for each xml file. The format is usually the name - of the file with PascalCasing (The underscore characters will be ignored). - More information is available at https://developer.android.com/topic/libraries/view-binding - */ - private var binding: ActivityAboutBinding? = null - - /** - * This method helps in the creation About screen - * - * @param savedInstanceState Data bundle - */ - @SuppressLint("StringFormatInvalid") //TODO: - public override fun onCreate(savedInstanceState: Bundle?) { + + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - /* - Instead of just setting the view with the xml file. We need to use View Binding class. - */ - binding = ActivityAboutBinding.inflate(layoutInflater) - val view: View = binding!!.root - applyEdgeToEdgeTopInsets(binding!!.toolbarLayout) - setContentView(view) - - setSupportActionBar(binding!!.toolbarBinding.toolbar) - supportActionBar!!.setDisplayHomeAsUpEnabled(true) - val aboutText = getString(R.string.about_license) - /* - We can then access all the views by just using the id names like this. - camelCasing is used with underscore characters being ignored. - */ - binding!!.aboutLicense.setHtmlText(aboutText) - - @SuppressLint("StringFormatMatches") // TODO: - val improveText = - String.format(getString(R.string.about_improve), Urls.NEW_ISSUE_URL) - binding!!.aboutImprove.setHtmlText(improveText) - binding!!.aboutVersion.text = applicationContext.getVersionNameWithSha() - - binding!!.aboutFaq.setUnderlinedText(R.string.about_faq) - binding!!.aboutRateUs.setUnderlinedText(R.string.about_rate_us) - binding!!.aboutUserGuide.setUnderlinedText(R.string.user_guide) - binding!!.aboutPrivacyPolicy.setUnderlinedText(R.string.about_privacy_policy) - binding!!.aboutTranslate.setUnderlinedText(R.string.about_translate) - binding!!.aboutCredits.setUnderlinedText(R.string.about_credits) - - /* - To set listeners, we can create a separate method and use lambda syntax. - */ - binding!!.facebookLaunchIcon.setOnClickListener(::launchFacebook) - binding!!.githubLaunchIcon.setOnClickListener(::launchGithub) - binding!!.websiteLaunchIcon.setOnClickListener(::launchWebsite) - binding!!.aboutRateUs.setOnClickListener(::launchRatings) - binding!!.aboutCredits.setOnClickListener(::launchCredits) - binding!!.aboutPrivacyPolicy.setOnClickListener(::launchPrivacyPolicy) - binding!!.aboutUserGuide.setOnClickListener(::launchUserGuide) - binding!!.aboutFaq.setOnClickListener(::launchFrequentlyAskedQuesions) - binding!!.aboutTranslate.setOnClickListener(::launchTranslate) + setContent { + CommonsTheme { + val actions = AboutActions( + onBackClick = { finish() }, + onShareClick = { shareApp() }, + onLaunchFacebook = { launchFacebook() }, + onLaunchGithub = { launchGithub() }, + onLaunchWebsite = { launchWebsite() }, + onRateUs = { launchRatings() }, + onUserGuide = { launchUserGuide() }, + onPrivacyPolicy = { launchPrivacyPolicy() }, + onTranslate = { launchTranslate() }, + onCredits = { launchCredits() }, + onFaq = { launchFrequentlyAskedQuestions() } + ) + + AboutScreen( + version = applicationContext.getVersionNameWithSha(), + actions = actions + ) + } + } } - override fun onSupportNavigateUp(): Boolean { - onBackPressed() - return true + // logic methods remain within the Activity to keep theUI pure + @SuppressLint("StringFormatInvalid") + internal fun shareApp() { + val shareText = String.format(getString(R.string.share_text), Urls.PLAY_STORE_URL_PREFIX + packageName) + val sendIntent = Intent(Intent.ACTION_SEND).apply { + putExtra(Intent.EXTRA_TEXT, shareText) + type = "text/plain" + } + startActivity(Intent.createChooser(sendIntent, getString(R.string.share_via))) } - fun launchFacebook(view: View?) { - val intent: Intent + internal fun launchFacebook() { try { - intent = Intent(ACTION_VIEW, Urls.FACEBOOK_APP_URL.toUri()) - intent.setPackage(Urls.FACEBOOK_PACKAGE_NAME) - startActivity(intent) + startActivity(Intent(ACTION_VIEW, Urls.FACEBOOK_APP_URL.toUri()).setPackage(Urls.FACEBOOK_PACKAGE_NAME)) } catch (e: Exception) { handleWebUrl(this, Urls.FACEBOOK_WEB_URL.toUri()) } } - fun launchGithub(view: View?) { - val intent: Intent + internal fun launchGithub() { try { - intent = Intent(ACTION_VIEW, Urls.GITHUB_REPO_URL.toUri()) - intent.setPackage(Urls.GITHUB_PACKAGE_NAME) - startActivity(intent) + startActivity(Intent(ACTION_VIEW, Urls.GITHUB_REPO_URL.toUri()).setPackage(Urls.GITHUB_PACKAGE_NAME)) } catch (e: Exception) { handleWebUrl(this, Urls.GITHUB_REPO_URL.toUri()) } } - fun launchWebsite(view: View?) { - handleWebUrl(this, Urls.WEBSITE_URL.toUri()) - } + internal fun launchWebsite() = handleWebUrl(this, Urls.WEBSITE_URL.toUri()) + internal fun launchCredits() = handleWebUrl(this, Urls.CREDITS_URL.toUri()) + internal fun launchUserGuide() = handleWebUrl(this, Urls.USER_GUIDE_URL.toUri()) + internal fun launchPrivacyPolicy() = handleWebUrl(this, BuildConfig.PRIVACY_POLICY_URL.toUri()) + internal fun launchFrequentlyAskedQuestions() = handleWebUrl(this, Urls.FAQ_URL.toUri()) - fun launchRatings(view: View?) { + internal fun launchRatings() { try { - startActivity( - Intent( - ACTION_VIEW, - (Urls.PLAY_STORE_PREFIX + packageName).toUri() - ) - ) + startActivity(Intent(ACTION_VIEW, (Urls.PLAY_STORE_PREFIX + packageName).toUri())) } catch (_: ActivityNotFoundException) { handleWebUrl(this, (Urls.PLAY_STORE_URL_PREFIX + packageName).toUri()) } } - fun launchCredits(view: View?) { - handleWebUrl(this, Urls.CREDITS_URL.toUri()) - } - - fun launchUserGuide(view: View?) { - handleWebUrl(this, Urls.USER_GUIDE_URL.toUri()) - } - - fun launchPrivacyPolicy(view: View?) { - handleWebUrl(this, BuildConfig.PRIVACY_POLICY_URL.toUri()) + internal fun launchTranslate() { + val instance = CommonsApplication.instance + val sortedNames = instance.languageLookUpTable!!.getCanonicalNames().toMutableList().apply { Collections.sort(this) } + val spinner = android.widget.Spinner(this).apply { + adapter = android.widget.ArrayAdapter(this@AboutActivity, android.R.layout.simple_spinner_dropdown_item, sortedNames) + } + showAlertDialog(this, getString(R.string.about_translate_title), getString(R.string.about_translate_message), + getString(R.string.about_translate_proceed), getString(R.string.about_translate_cancel), + { + val langCode = instance.languageLookUpTable!!.getCodes()[spinner.selectedItemPosition] + handleWebUrl(this, (Urls.TRANSLATE_WIKI_URL + langCode).toUri()) + }, {}, spinner + ) } +} - fun launchFrequentlyAskedQuesions(view: View?) { - handleWebUrl(this, Urls.FAQ_URL.toUri()) - } +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun AboutScreen(version: String, actions: AboutActions) { + val logoAlpha = remember { Animatable(Spacing.none.value) } + LaunchedEffect(Unit) { logoAlpha.animateTo(1f, animationSpec = tween(1000)) } - override fun onCreateOptionsMenu(menu: Menu): Boolean { - val inflater = menuInflater - inflater.inflate(R.menu.menu_about, menu) - return super.onCreateOptionsMenu(menu) + val aboutLinks = remember { + listOf( + AboutLinkItem(R.string.about_rate_us, actions.onRateUs), + AboutLinkItem(R.string.user_guide, actions.onUserGuide), + AboutLinkItem(R.string.about_privacy_policy, actions.onPrivacyPolicy), + AboutLinkItem(R.string.about_translate, actions.onTranslate), + AboutLinkItem(R.string.about_credits, actions.onCredits), + AboutLinkItem(R.string.about_faq, actions.onFaq) + ) } - override fun onOptionsItemSelected(item: MenuItem): Boolean { - when (item.itemId) { - R.id.share_app_icon -> { - val shareText = String.format( - getString(R.string.share_text), - Urls.PLAY_STORE_URL_PREFIX + this.packageName + Scaffold( + topBar = { + CenterAlignedTopAppBar( + title = { + CommonsText(text = stringResource(R.string.about), preset = CommonsTextPreset.Title, color = TextWhite, fontWeight = FontWeight.Bold) + }, + navigationIcon = { + IconButton(onClick = actions.onBackClick) { + Icon(Icons.AutoMirrored.Filled.ArrowBack, null, tint = TextWhite) + } + }, + actions = { + IconButton(onClick = actions.onShareClick) { + Icon(Icons.Default.Share, null, tint = TextWhite) + } + }, + colors = TopAppBarDefaults.centerAlignedTopAppBarColors(containerColor = MaterialTheme.colorScheme.primary) + ) + }, + containerColor = Transparent + ) { padding -> + LazyColumn( + modifier = Modifier.fillMaxSize().padding(padding), + horizontalAlignment = Alignment.CenterHorizontally, + contentPadding = PaddingValues(horizontal = Spacing.large, vertical = Spacing.medium) + ) { + item { + Box(modifier = Modifier.alpha(logoAlpha.value)) { + Image(painter = painterResource(R.drawable.ic_launcher), + contentDescription = stringResource(R.string.commons_logo), + modifier = Modifier.size(Dimensions.logoSize).clip(CircleShape)) + } + CommonsText(text = stringResource(R.string.app_name), + preset = CommonsTextPreset.Headline, fontWeight = FontWeight.Bold) + AssistChip( + onClick = { }, + label = { CommonsText(text = version, preset = CommonsTextPreset.Caption, + color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.6f)) }, + modifier = Modifier.padding(top = Spacing.extraSmall, bottom = Spacing.medium) ) - val sendIntent = Intent() - sendIntent.setAction(Intent.ACTION_SEND) - sendIntent.putExtra(Intent.EXTRA_TEXT, shareText) - sendIntent.setType("text/plain") - startActivity(Intent.createChooser(sendIntent, getString(R.string.share_via))) - return true + HtmlText(stringResource(R.string.about_license)) + HtmlText(String.format(stringResource(R.string.about_improve), Urls.NEW_ISSUE_URL), + Modifier.padding(top = Spacing.medium)) + Row(modifier = Modifier.padding(vertical = Spacing.extraLarge), + horizontalArrangement = Arrangement.spacedBy(Spacing.huge)) { + EnhancedSocialIcon(R.drawable.ic_action_website, actions.onLaunchWebsite) + EnhancedSocialIcon(R.drawable.ic_action_facebook, actions.onLaunchFacebook) + EnhancedSocialIcon(R.drawable.ic_action_github, actions.onLaunchGithub) + } + } + item { + Card( + modifier = Modifier.fillMaxWidth(), + shape = RoundedCornerShape(Dimensions.cardCorner), + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant), + elevation = CardDefaults.cardElevation(defaultElevation = Dimensions.cardElevation) + ) { + Column { + aboutLinks.forEachIndexed { index, item -> + EnhancedLinkRow(stringResource(item.textRes), item.onClick) + if (index < aboutLinks.size - 1) DividerRow() + } + } + } } + item { Spacer(modifier = Modifier.height(Spacing.huge)) } + } + } +} - else -> return super.onOptionsItemSelected(item) +@Composable +fun EnhancedSocialIcon(drawableId: Int, onClick: () -> Unit) { + val tint = MaterialTheme.colorScheme.primary + Surface(modifier = Modifier.size(Dimensions.socialIconBox).clickable { onClick() }, + shape = CircleShape, color = tint.copy(alpha = 0.1f)) { + Box(contentAlignment = Alignment.Center) { + Image(painter = painterResource(drawableId), contentDescription = null, + colorFilter = ColorFilter.tint(tint), modifier = Modifier.size(Dimensions.socialIcon)) } } +} + +@Composable +fun EnhancedLinkRow(text: String, onClick: () -> Unit) { + Row(modifier = Modifier.fillMaxWidth().clickable { onClick() }.padding(Spacing.medium), + verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween) { + CommonsText(text = text, preset = CommonsTextPreset.Body) + Icon(imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight, + contentDescription = null, tint = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.3f), modifier = Modifier.size(Dimensions.linkIcon)) + } +} - fun launchTranslate(view: View?) { - val sortedLocalizedNamesRef = instance.languageLookUpTable!!.getCanonicalNames() - Collections.sort(sortedLocalizedNamesRef) - val languageAdapter = ArrayAdapter( - this@AboutActivity, - android.R.layout.simple_spinner_dropdown_item, sortedLocalizedNamesRef - ) - val spinner = Spinner(this@AboutActivity) - spinner.layoutParams = - LinearLayout.LayoutParams( - LinearLayout.LayoutParams.WRAP_CONTENT, - LinearLayout.LayoutParams.WRAP_CONTENT - ) - spinner.adapter = languageAdapter - spinner.gravity = 17 - spinner.setPadding(50, 0, 0, 0) +@Composable +fun DividerRow() { + HorizontalDivider(modifier = Modifier.padding(horizontal = Spacing.medium), + thickness = Dimensions.dividerThickness, color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.1f)) +} - val positiveButtonRunnable = Runnable { - val langCode = instance.languageLookUpTable!!.getCodes()[spinner.selectedItemPosition] - handleWebUrl(this@AboutActivity, (Urls.TRANSLATE_WIKI_URL + langCode).toUri()) +@Composable +fun HtmlText(html: String, modifier: Modifier = Modifier) { + val textColor = MaterialTheme.colorScheme.onBackground + AndroidView( + modifier = modifier, + factory = { context -> HtmlTextView(context).apply { gravity = android.view.Gravity.CENTER } }, + update = { view -> + view.setTextColor(textColor.hashCode()) + view.setHtmlText(html) } - showAlertDialog( - this, - getString(R.string.about_translate_title), - getString(R.string.about_translate_message), - getString(R.string.about_translate_proceed), - getString(R.string.about_translate_cancel), - positiveButtonRunnable, - {}, - spinner + ) +} + +@Preview(showBackground = true) +@Composable +fun AboutScreenPreview() { + CommonsTheme { + AboutScreen( + version = "v6.4.0-debug-master", + actions = AboutActions({}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}) ) } -} +} \ No newline at end of file diff --git a/app/src/main/java/fr/free/nrw/commons/theme/Color.kt b/app/src/main/java/fr/free/nrw/commons/theme/Color.kt new file mode 100644 index 00000000000..a1713499f28 --- /dev/null +++ b/app/src/main/java/fr/free/nrw/commons/theme/Color.kt @@ -0,0 +1,13 @@ +package fr.free.nrw.commons.theme + +import androidx.compose.ui.graphics.Color + +val PrimaryBlue = Color(0xFF0C609C) +val PrimaryBlueNight = Color(0xFF1E8CAB) +val BackgroundLight = Color(0xFFFAFAFA) +val BackgroundDark = Color(0xFF303030) +val CardBackgroundDark = Color(0xFF1E1E1E) +val CardBackgroundLight = Color(0xFFFFFFFF) +val TextWhite = Color(0xFFFFFFFF) +val TextBlack = Color(0xFF000000) +val Transparent = Color.Transparent \ No newline at end of file diff --git a/app/src/main/java/fr/free/nrw/commons/theme/CommonsTheme.kt b/app/src/main/java/fr/free/nrw/commons/theme/CommonsTheme.kt new file mode 100644 index 00000000000..da0d8ee1e3a --- /dev/null +++ b/app/src/main/java/fr/free/nrw/commons/theme/CommonsTheme.kt @@ -0,0 +1,35 @@ +package fr.free.nrw.commons.theme + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.* +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + +@Composable +fun CommonsTheme(content: @Composable () -> Unit) { + val isDarkTheme = isSystemInDarkTheme() + val colorScheme = if (isDarkTheme) { + darkColorScheme( + primary = PrimaryBlueNight, + background = BackgroundDark, + onBackground = TextWhite, + surfaceVariant = CardBackgroundDark, + onSurface = TextWhite + ) + } else { + lightColorScheme( + primary = PrimaryBlue, + background = BackgroundLight, + onBackground = TextBlack, + surfaceVariant = CardBackgroundLight, + onSurface = TextBlack + ) + } + + MaterialTheme(colorScheme = colorScheme) { + Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { + content() + } + } +} \ No newline at end of file diff --git a/app/src/main/java/fr/free/nrw/commons/theme/Spacing.kt b/app/src/main/java/fr/free/nrw/commons/theme/Spacing.kt new file mode 100644 index 00000000000..71e6d57de93 --- /dev/null +++ b/app/src/main/java/fr/free/nrw/commons/theme/Spacing.kt @@ -0,0 +1,24 @@ +package fr.free.nrw.commons.theme + +import androidx.compose.ui.unit.dp + +object Spacing { + val none = 0.dp + val extraSmall = 4.dp + val small = 8.dp + val medium = 16.dp + val large = 20.dp + val extraLarge = 24.dp + val huge = 32.dp + val gigantic = 48.dp +} + +object Dimensions { + val logoSize = 110.dp + val socialIconBox = 52.dp + val socialIcon = 28.dp + val linkIcon = 20.dp + val cardCorner = 16.dp + val cardElevation = 2.dp + val dividerThickness = 0.5.dp +} \ No newline at end of file diff --git a/app/src/main/java/fr/free/nrw/commons/theme/Type.kt b/app/src/main/java/fr/free/nrw/commons/theme/Type.kt new file mode 100644 index 00000000000..640edd90921 --- /dev/null +++ b/app/src/main/java/fr/free/nrw/commons/theme/Type.kt @@ -0,0 +1,57 @@ +package fr.free.nrw.commons.theme + +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.AnnotatedString +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.sp + +enum class CommonsTextPreset { Headline, Title, Body, Caption } + +@Composable +fun CommonsText( + text: String, + preset: CommonsTextPreset, + modifier: Modifier = Modifier, + color: Color = Color.Unspecified, + textAlign: TextAlign? = null, + maxLines: Int = Int.MAX_VALUE, + overflow: TextOverflow = TextOverflow.Clip, + fontWeight: FontWeight? = null +) { + CommonsText(AnnotatedString(text), preset, modifier, color, textAlign, maxLines, overflow, fontWeight) +} + +@Composable +fun CommonsText( + text: AnnotatedString, + preset: CommonsTextPreset, + modifier: Modifier = Modifier, + color: Color = Color.Unspecified, + textAlign: TextAlign? = null, + maxLines: Int = Int.MAX_VALUE, + overflow: TextOverflow = TextOverflow.Clip, + fontWeight: FontWeight? = null +) { + val style = when (preset) { + CommonsTextPreset.Headline -> TextStyle(fontSize = 24.sp, fontWeight = fontWeight ?: FontWeight.Bold) + CommonsTextPreset.Title -> TextStyle(fontSize = 20.sp, fontWeight = fontWeight ?: FontWeight.Medium) + CommonsTextPreset.Body -> TextStyle(fontSize = 16.sp, fontWeight = fontWeight ?: FontWeight.Normal) + CommonsTextPreset.Caption -> TextStyle(fontSize = 14.sp, fontWeight = fontWeight ?: FontWeight.Normal) + } + Text( + text = text, + modifier = modifier, + style = style, + color = if (color == Color.Unspecified) MaterialTheme.colorScheme.onBackground else color, + textAlign = textAlign, + maxLines = maxLines, + overflow = overflow + ) +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml deleted file mode 100644 index b0f34d5a8dd..00000000000 --- a/app/src/main/res/layout/activity_about.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/test/kotlin/fr/free/nrw/commons/AboutActivityUnitTests.kt b/app/src/test/kotlin/fr/free/nrw/commons/AboutActivityUnitTests.kt index 56549fa1c73..5b6a136a7ad 100644 --- a/app/src/test/kotlin/fr/free/nrw/commons/AboutActivityUnitTests.kt +++ b/app/src/test/kotlin/fr/free/nrw/commons/AboutActivityUnitTests.kt @@ -43,7 +43,7 @@ class AboutActivityUnitTests { @Test @Throws(Exception::class) fun testLaunchFacebook() { - activity.launchFacebook(null) + activity.launchFacebook() val shadowActivity: ShadowActivity = Shadows.shadowOf(activity) val startedIntent = shadowActivity.nextStartedActivity Assert.assertEquals(startedIntent.action, "android.intent.action.VIEW") @@ -54,43 +54,43 @@ class AboutActivityUnitTests { @Test @Throws(Exception::class) fun testLaunchGithub() { - activity.launchGithub(null) + activity.launchGithub() } @Test @Throws(Exception::class) fun testLaunchWebsite() { - activity.launchWebsite(null) + activity.launchWebsite() } @Test @Throws(Exception::class) fun testLaunchRatings() { - activity.launchRatings(null) + activity.launchRatings() } @Test @Throws(Exception::class) fun testLaunchCredits() { - activity.launchCredits(null) + activity.launchCredits() } @Test @Throws(Exception::class) fun testLaunchPrivacyPolicy() { - activity.launchPrivacyPolicy(null) + activity.launchPrivacyPolicy() } @Test @Throws(Exception::class) fun testLaunchUserGuide() { - activity.launchUserGuide(null) + activity.launchUserGuide() } @Test @Throws(Exception::class) fun testLaunchFrequentlyAskedQuestions() { - activity.launchFrequentlyAskedQuesions(null) + activity.launchFrequentlyAskedQuestions() } @Test