From e1c12f7716511d15e7534b959370619ebf04af81 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 9 Nov 2017 01:54:12 -0500 Subject: Update/kau (#476) * Update all dependencies * Revert to working build * Update kau again * Update nullables * Update more nullables * Inline some things * Add images to readme * Update readme translators --- README.md | 22 +++++++++++++++++----- app/build.gradle | 4 ++++ .../pitchedapps/frost/activities/AboutActivity.kt | 6 +++--- .../pitchedapps/frost/activities/MainActivity.kt | 2 +- .../frost/activities/SettingsActivity.kt | 1 + .../frost/activities/WebOverlayActivity.kt | 6 +++--- .../com/pitchedapps/frost/facebook/FbCookie.kt | 2 +- .../com/pitchedapps/frost/fragments/WebFragment.kt | 10 +++++----- .../pitchedapps/frost/intro/IntroFragmentTheme.kt | 2 +- .../pitchedapps/frost/intro/IntroImageFragments.kt | 2 +- .../pitchedapps/frost/intro/IntroMainFragments.kt | 4 ++-- .../frost/services/FrostNotifications.kt | 4 ++-- .../com/pitchedapps/frost/utils/iab/IabBinder.kt | 4 ++-- app/src/main/res/values/strings_no_translate.xml | 1 + gradle.properties | 10 +++++----- 15 files changed, 49 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 10d25641..427c661c 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,29 @@ Note that these builds occur for every commit, including unstable ones. You can find the release numbers for the master branch under the [Travis](https://travis-ci.org/AllanWang/Frost-for-Facebook/branches). Those builds are likely more stable as they are pushed out to the alpha stream on the play store. +## Showcase + +![Transparency](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/frost/screenshots/thumbnails/frost_themes.png)  +![Transparency](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/frost/screenshots/thumbnails/frost_glass.png) + +![Transparency](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/frost/screenshots/thumbnails/frost_multi_accounts.png)  +![Transparency](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/frost/screenshots/thumbnails/frost_swipe.png) + +![Transparency](https://raw.githubusercontent.com/AllanWang/Storage-Hub/master/frost/screenshots/thumbnails/frost_quick_links.png)  + ## Translations Frost depends on translations crowdsourced by the general public. If you would like to contribute, please visit [here](https://crwd.in/frost-for-facebook) +Note that this project heavily depends on [KAU](https://github.com/AllanWang/KAU), which also needs to be translated [here](https://crwd.in/kotlin-android-utils) Special thanks to the following awesome people for translating significant portions of Frost! -* [Vincent Kulak](https://github.com/VonOx) [FR] -* [Jean-Philippe Gravel](https://crowdin.com/profile/wokija) [FR] -* [Jahir Fiquitiva](https://jahirfiquitiva.me/) [ES] -* [Nefi Salazar](https://plus.google.com/u/0/105547968033551087431) [ES] -* [Bushido1992](https://forum.xda-developers.com/member.php?u=5179246) [DE] +| Language | Contributors | +|----------|--------------| +| French | [Vincent Kulak](https://github.com/VonOx) • [Jean-Philippe Gravel](https://crowdin.com/profile/wokija) | +| German | [Bushido1992](https://forum.xda-developers.com/member.php?u=5179246) • [Marcel Soehnchen](https://crowdin.com/profile/msoehnchen) • [3LD0mi HA](https://forum.xda-developers.com/member.php?u=5860523) | +| Spanish | [Jahir Fiquitiva](https://jahirfiquitiva.me/) • [Nefi Salazar](https://plus.google.com/u/0/105547968033551087431)| + The full activity stream for the translations can be found [here](https://crowdin.com/project/frost-for-facebook/activity_stream) \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 2a474cd3..62529e10 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,6 +55,10 @@ android { 'UnusedResources', 'ContentDescription', 'RtlSymmetry' + + xmlReport false + textReport true + textOutput 'stdout' } signingConfigs { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt index 8168efca..94c43331 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt @@ -73,8 +73,8 @@ class AboutActivity : AboutActivityBase(null, { */ val frost = Library().apply { libraryName = string(R.string.frost_name) - author = "Pitched Apps" - libraryWebsite = "https://github.com/AllanWang/Frost-for-Facebook" + author = string(R.string.dev_name) + libraryWebsite = string(R.string.github_url) isOpenSource = true libraryDescription = string(R.string.frost_description) libraryVersion = BuildConfig.VERSION_NAME @@ -109,7 +109,7 @@ class AboutActivity : AboutActivityBase(null, { override fun getLayoutRes(): Int = R.layout.item_about_links - override fun bindView(holder: ViewHolder, payloads: MutableList?) { + override fun bindView(holder: ViewHolder, payloads: MutableList) { super.bindView(holder, payloads) with(holder) { bindIconColor(*images.toTypedArray()) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt index b347d6a0..2f4bd2e1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt @@ -453,7 +453,7 @@ class MainActivity : BaseActivity(), super.onBackPressed() } - val currentFragment + inline val currentFragment get() = supportFragmentManager.findFragmentByTag("android:switcher:${R.id.container}:${viewPager.currentItem}") as WebFragment inner class SectionsPagerAdapter(fm: FragmentManager, val pages: List) : FragmentPagerAdapter(fm) { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt index 0511a74f..293be694 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt @@ -105,6 +105,7 @@ class SettingsActivity : KPrefActivity(), FrostBilling by IabSettings() { plainText(R.string.get_pro) { descRes = R.string.get_pro_desc iicon = GoogleMaterial.Icon.gmd_star + visible = { !IS_FROST_PRO } onClick = { _, _, _ -> restorePurchases(); true } } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt index bca10606..c2556563 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt @@ -102,16 +102,16 @@ open class WebOverlayActivityBase(private val forceBasicAgent: Boolean) : KauBas val frostWeb: FrostWebView by bindView(R.id.overlay_frost_webview) val coordinator: CoordinatorLayout by bindView(R.id.overlay_main_content) - val urlTest: String? + inline val urlTest: String? get() = intent.extras?.getString(ARG_URL) ?: intent.dataString open val url: String get() = (intent.extras?.getString(ARG_URL) ?: intent.dataString).formattedFbUrl - val userId: Long + inline val userId: Long get() = intent.extras?.getLong(ARG_USER_ID, Prefs.userId) ?: Prefs.userId - val overlayContext: OverlayContext? + inline val overlayContext: OverlayContext? get() = intent.extras?.getSerializable(ARG_OVERLAY_CONTEXT) as OverlayContext? override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt index 4dc7b62d..6f08981c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt @@ -20,7 +20,7 @@ import io.reactivex.subjects.SingleSubject */ object FbCookie { - val webCookie: String? + inline val webCookie: String? get() = CookieManager.getInstance().getCookie(FB_URL_BASE) private fun setWebCookie(cookie: String?, callback: (() -> Unit)?) { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt index 4286be86..f1b76e57 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt @@ -42,9 +42,9 @@ class WebFragment : Fragment() { // val refresh: SwipeRefreshLayout by lazy { frostWebView.refresh } val web: FrostWebViewCore by lazy { frostWebView.web } - val url: String by lazy { arguments.getString(ARG_URL) } - val urlEnum: FbItem by lazy { arguments.getSerializable(ARG_URL_ENUM) as FbItem } - val position: Int by lazy { arguments.getInt(ARG_POSITION) } + val url: String by lazy { arguments!!.getString(ARG_URL) } + val urlEnum: FbItem by lazy { arguments!!.getSerializable(ARG_URL_ENUM) as FbItem } + val position: Int by lazy { arguments!!.getInt(ARG_POSITION) } lateinit var frostWebView: FrostWebView private var firstLoad = true private var activityDisposable: Disposable? = null @@ -60,12 +60,12 @@ class WebFragment : Fragment() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { super.onCreateView(inflater, container, savedInstanceState) - frostWebView = FrostWebView(context) + frostWebView = FrostWebView(context!!) frostWebView.setupWebview(url, urlEnum) return frostWebView } - override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) onCreateRunnable?.invoke(this) onCreateRunnable = null diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt index 2e7d3572..37f93987 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt @@ -25,7 +25,7 @@ class IntroFragmentTheme : BaseIntroFragment(R.layout.intro_theme) { override fun viewArray(): Array> = arrayOf(arrayOf(title), arrayOf(light, dark), arrayOf(amoled, glass)) - override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) light.setThemeClick(Theme.LIGHT) dark.setThemeClick(Theme.DARK) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt index d19a488d..dff7d8b8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt @@ -22,7 +22,7 @@ abstract class BaseImageIntroFragment(val titleRes: Int, val imageRes: Int, val override fun viewArray(): Array> = arrayOf(arrayOf(title), arrayOf(desc)) - override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { title.setText(titleRes) image.setImageResource(imageRes) desc.setText(descRes) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt index 552fad3b..bae8ac7a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt @@ -64,7 +64,7 @@ abstract class BaseIntroFragment(val layoutRes: Int) : Fragment() { return view } - override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) themeFragment() } @@ -126,7 +126,7 @@ class IntroFragmentEnd : BaseIntroFragment(R.layout.intro_end) { } @SuppressLint("ClickableViewAccessibility") - override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) container.setOnSingleTapListener { _, event -> (activity as IntroActivity).finish(event.x, event.y) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt index 749aec09..44b01bc3 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt @@ -45,7 +45,7 @@ fun setupNotificationChannels(c: Context) { manager.createNotificationChannel(mainChannel) } -val Context.frostNotification: NotificationCompat.Builder +inline val Context.frostNotification: NotificationCompat.Builder get() = NotificationCompat.Builder(this, BuildConfig.APPLICATION_ID).apply { setSmallIcon(R.drawable.frost_f_24) setAutoCancel(true) @@ -63,7 +63,7 @@ fun NotificationCompat.Builder.withDefaults(ringtone: String = Prefs.notificatio setDefaults(defaults) } -val NotificationCompat.Builder.withBigText: NotificationCompat.BigTextStyle +inline val NotificationCompat.Builder.withBigText: NotificationCompat.BigTextStyle get() = NotificationCompat.BigTextStyle(this) /** diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IabBinder.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IabBinder.kt index 15c0f9a8..64fc9cb8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IabBinder.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IabBinder.kt @@ -26,8 +26,8 @@ private const val FROST_PRO = "frost_pro" * Implemented pro checker with a hook for debug builds * Use this when checking if the pro feature is enabled */ -val IS_FROST_PRO: Boolean - get() = (BuildConfig.DEBUG && Prefs.debugPro) || Prefs.pro +inline val IS_FROST_PRO: Boolean + get() = Prefs.pro || (BuildConfig.DEBUG && Prefs.debugPro) interface FrostBilling : BillingProcessor.IBillingHandler { fun Activity.onCreateBilling() diff --git a/app/src/main/res/values/strings_no_translate.xml b/app/src/main/res/values/strings_no_translate.xml index 4b6c2e6e..cd8523ad 100644 --- a/app/src/main/res/values/strings_no_translate.xml +++ b/app/src/main/res/values/strings_no_translate.xml @@ -1,4 +1,5 @@ + Pitched Apps pitchedapps@gmail.com https://www.paypal.me/Allanw9 PayPal diff --git a/gradle.properties b/gradle.properties index 33d0afd6..c879b29e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ MIN_SDK=21 TARGET_SDK=26 BUILD_TOOLS=26.0.2 -KAU=a0587e8 +KAU=4e52d2d KOTLIN=1.1.51 COMMONS_TEXT=1.1 @@ -27,10 +27,10 @@ EXOMEDIA=4.0.3 IAB=1.0.44 IICON_COMMUNITY=1.9.32.2 IICON_MATERIAL=2.2.0.3 -JSOUP=1.10.3 -LEAK_CANARY=1.5.1 -MATERIAL_DRAWER_KT=1.0.6 -OKHTTP=3.8.1 +JSOUP=1.11.1 +LEAK_CANARY=1.5.4 +MATERIAL_DRAWER_KT=1.2.1 +OKHTTP=3.9.0 PAPER_PARCEL=2.0.4 ROBOELECTRIC=3.4 RX_ANDROID=2.0.1 -- cgit v1.2.3