Skip to content

Commit

Permalink
fix(settings): add open source licenses disclosure (#16)
Browse files Browse the repository at this point in the history
* fix(settings): add open source licenses disclosure

* Smartling translations are completed for PR#16 from about-libraries (#17)

* File Pocket/src/main/res/values/strings.xml was translated to de-DE locale

* File Pocket/src/main/res/values/strings.xml was translated to zh-TW locale

* File Pocket/src/main/res/values/strings.xml was translated to ko-KR locale

* File Pocket/src/main/res/values/strings.xml was translated to pt-BR locale

* File Pocket/src/main/res/values/strings.xml was translated to es-ES locale

* File Pocket/src/main/res/values/strings.xml was translated to zh-CN locale

* File Pocket/src/main/res/values/strings.xml was translated to fr-CA locale

* File Pocket/src/main/res/values/strings.xml was translated to es-LA locale

* File Pocket/src/main/res/values/strings.xml was translated to it-IT locale

* File Pocket/src/main/res/values/strings.xml was translated to pl-PL locale

* File Pocket/src/main/res/values/strings.xml was translated to ru-RU locale

* File Pocket/src/main/res/values/strings.xml was translated to nl-NL locale

* File Pocket/src/main/res/values/strings.xml was translated to pt-PT locale

* File Pocket/src/main/res/values/strings.xml was translated to fr-FR locale

* File Pocket/src/main/res/values/strings.xml was translated to ja-JP locale

---------

Co-authored-by: smartling-github-connector[bot] <165276057+smartling-github-connector[bot]@users.noreply.github.com>

---------

Co-authored-by: smartling-github-connector[bot] <165276057+smartling-github-connector[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 5198ff1 commit e103c3c
Show file tree
Hide file tree
Showing 29 changed files with 164 additions and 281 deletions.
3 changes: 3 additions & 0 deletions Pocket/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
kotlinSerialization()
sentry()
licensee()
aboutLibraries()
}

val versionMajor = 8 // Max value of 200
Expand Down Expand Up @@ -310,6 +311,8 @@ dependencies {

implementation(Deps.JakeWharton.ThreeTenAbp.threeTen)

implementation(libs.aboutlibraries)

implementation(libs.adjust)
implementation(libs.braze)

Expand Down
7 changes: 0 additions & 7 deletions Pocket/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@
android:configChanges="keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:windowSoftInputMode="adjustResize|stateAlwaysHidden"
/>
<activity
android:name="com.pocket.sdk.util.activity.FramedWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:windowSoftInputMode="adjustResize|stateAlwaysHidden" />
<activity
android:name="com.pocket.sdk.util.activity.BasicWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" />
<activity
android:name="com.pocket.app.settings.beta.TCActivity"
android:configChanges="keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.pocket.app.settings

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.fragment.compose.content
import androidx.navigation.fragment.findNavController
import com.ideashower.readitlater.R
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
import com.pocket.sdk.util.AbsPocketFragment
import com.pocket.ui.view.AppBar
import com.pocket.ui.view.button.PocketIconButton
import com.pocket.ui.view.button.UpIcon
import com.pocket.ui.view.themed.PocketTheme

class OpenSourceLicensesFragment : AbsPocketFragment() {
override fun onCreateViewImpl(
inflater: LayoutInflater?,
container: ViewGroup?,
savedInstanceState: Bundle?,
) = content {
PocketTheme {
Column {
AppBar(
navigationIcon = {
PocketIconButton(onClick = { findNavController().navigateUp() }) {
UpIcon()
}
},
title = { Text(stringResource(R.string.setting_oss)) },
)
LibrariesContainer(
Modifier.fillMaxSize(),
showVersion = false,
)
}
}
}
}
61 changes: 29 additions & 32 deletions Pocket/src/main/java/com/pocket/app/settings/PrefsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.pocket.app.CustomTabs
import com.pocket.app.SaveExtension
import com.pocket.app.UserManager
import com.pocket.app.auth.AuthenticationActivity
import com.pocket.app.help.Help
import com.pocket.app.reader.Reader
import com.pocket.app.settings.account.AccountManagementFragment
import com.pocket.app.settings.appicon.AppIcons
Expand All @@ -40,7 +39,6 @@ import com.pocket.sdk.offline.cache.StorageLocationPickerDialog
import com.pocket.sdk.preferences.AppPrefs
import com.pocket.sdk.util.AbsPocketActivity
import com.pocket.sdk.util.DeepLinks
import com.pocket.sdk.util.activity.FramedWebViewActivity
import com.pocket.sdk.util.dialog.AlertMessaging
import com.pocket.sdk.util.dialog.ProgressDialogFragment
import com.pocket.sdk.util.file.AndroidStorageUtil
Expand Down Expand Up @@ -533,49 +531,56 @@ class PrefsFragment : AbsPrefsFragment() {
newOpenUrlPref(
R.string.setting_help,
"https://help.getpocket.com/",
false
)
)

// Legal & Privacy
prefs.add(
newOpenUrlPref(
R.string.setting_twitter_label,
"https://twitter.com/intent/user?screen_name=Pocket",
false
R.string.setting_tos,
"https://getpocket.com/en/tos/",
)
)
prefs.add(
newOpenUrlPref(
R.string.setting_facebook_label,
"https://facebook.com/readitlater",
false
R.string.setting_privacy,
"https://getpocket.com/en/privacy/",
)
)
prefs.add(PreferenceViews.newActionBuilder(this, R.string.setting_oss)
.setOnClickListener {
findNavController().navigateSafely(PrefsFragmentDirections.goToOpenSourceLicenses())
}
.build())

// Contact Us
prefs.add(
newOpenUrlPref(
R.string.setting_legal_label,
"https://getpocket.com/legal?src=android",
true
R.string.setting_contact_us,
"https://getpocket.com/contact-info/"
)
)

// Contact Us
prefs.add(
newOpenUrlPref(
R.string.setting_contact_us,
"https://getpocket.com/contact-info/",
false
R.string.setting_twitter_label,
"https://twitter.com/intent/user?screen_name=Pocket",
)
)
prefs.add(
newOpenUrlPref(
R.string.setting_facebook_label,
"https://facebook.com/readitlater",
)
)

// Version
prefs.add(PreferenceViews.newHeader(this, R.string.setting_header_version))

val versionNumber = PreferenceViews.newActionBuilder(
this,
getString(R.string.setting_version_label, BuildConfig.VERSION_NAME)
prefs.add(
PreferenceViews.newActionBuilder(this, getString(R.string.setting_version_label, BuildConfig.VERSION_NAME))
.setSummaryDefaultUnchecked(R.string.setting_thank_you)
.build()
)
.setSummaryDefaultUnchecked(R.string.setting_thank_you)
prefs.add(versionNumber.build())

if (mode.isForInternalCompanyOnly) {
prefs.add(
Expand All @@ -597,17 +602,9 @@ class PrefsFragment : AbsPrefsFragment() {
.build())
}

private fun newOpenUrlPref(label: Int, url: String, inPocket: Boolean): Preference {
private fun newOpenUrlPref(label: Int, url: String): Preference {
return PreferenceViews.newActionBuilder(this, label)
.setOnClickListener {
if (inPocket) {
val intent = Intent(activity, FramedWebViewActivity::class.java)
intent.putExtra(FramedWebViewActivity.PATH, url)
requireActivity().startActivity(intent)
} else {
App.viewUrl(activity, url)
}
}
.setOnClickListener { App.viewUrl(activity, url) }
.build()
}

Expand Down

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions Pocket/src/main/java/com/pocket/sdk2/braze/BrazeManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import com.pocket.app.add.AddActivity
import com.pocket.app.auth.AuthenticationActivity
import com.pocket.app.settings.Theme
import com.pocket.sdk.tts.ListenDeepLinkActivity
import com.pocket.sdk.util.activity.BasicWebViewActivity
import com.pocket.sdk.util.activity.FramedWebViewActivity
import com.pocket.sdk2.api.legacy.PocketCache
import com.pocket.util.android.PPActivity
import dagger.hilt.android.qualifiers.ApplicationContext
Expand All @@ -41,8 +39,6 @@ class BrazeManager @Inject constructor(
AppCacheCheckActivity::class.java,
ListenDeepLinkActivity::class.java,
PPActivity::class.java,
BasicWebViewActivity::class.java,
FramedWebViewActivity::class.java,
)
)
)
Expand Down
8 changes: 0 additions & 8 deletions Pocket/src/main/res/layout/activity_basic_webview.xml

This file was deleted.

Loading

0 comments on commit e103c3c

Please sign in to comment.