From e5536c534934a33232bc7421eef91d5587f4805f Mon Sep 17 00:00:00 2001 From: Rahul Kumar Patel Date: Mon, 1 Mar 2021 16:31:42 +0530 Subject: [PATCH] Fix tingu tingu bugs --- .../{ViewDevInfo.kt => DevInfoLayout.kt} | 2 +- .../view/ui/details/BaseDetailsActivity.kt | 33 ++++--------------- .../main/res/layout/layout_details_dev.xml | 6 ++-- 3 files changed, 11 insertions(+), 30 deletions(-) rename app/src/main/java/com/aurora/store/view/custom/layouts/{ViewDevInfo.kt => DevInfoLayout.kt} (98%) diff --git a/app/src/main/java/com/aurora/store/view/custom/layouts/ViewDevInfo.kt b/app/src/main/java/com/aurora/store/view/custom/layouts/DevInfoLayout.kt similarity index 98% rename from app/src/main/java/com/aurora/store/view/custom/layouts/ViewDevInfo.kt rename to app/src/main/java/com/aurora/store/view/custom/layouts/DevInfoLayout.kt index abccd9ac4..2b4a24955 100644 --- a/app/src/main/java/com/aurora/store/view/custom/layouts/ViewDevInfo.kt +++ b/app/src/main/java/com/aurora/store/view/custom/layouts/DevInfoLayout.kt @@ -27,7 +27,7 @@ import androidx.annotation.RequiresApi import com.aurora.store.R import com.aurora.store.databinding.ViewDevInfoBinding -class ViewDevInfo : RelativeLayout { +class DevInfoLayout : RelativeLayout { private lateinit var B: ViewDevInfoBinding diff --git a/app/src/main/java/com/aurora/store/view/ui/details/BaseDetailsActivity.kt b/app/src/main/java/com/aurora/store/view/ui/details/BaseDetailsActivity.kt index f6f106cc7..04e5aca57 100644 --- a/app/src/main/java/com/aurora/store/view/ui/details/BaseDetailsActivity.kt +++ b/app/src/main/java/com/aurora/store/view/ui/details/BaseDetailsActivity.kt @@ -19,10 +19,7 @@ package com.aurora.store.view.ui.details -import android.content.Intent -import android.os.Build import android.text.Html -import android.text.Layout import android.view.View import android.widget.RelativeLayout import android.widget.Toast @@ -30,7 +27,6 @@ import androidx.core.content.ContextCompat import androidx.core.text.HtmlCompat import androidx.lifecycle.ViewModelProvider import com.airbnb.epoxy.EpoxyRecyclerView -import com.aurora.Constants import com.aurora.extensions.hide import com.aurora.extensions.load import com.aurora.extensions.show @@ -76,12 +72,10 @@ abstract class BaseDetailsActivity : BaseActivity() { B.txtRating.text = app.labeledRating B.txtSdk.text = ("Target SDK ${app.targetSdk}") B.txtUpdated.text = app.updatedOn - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - B.txtDescription.justificationMode = Layout.JUSTIFICATION_MODE_INTER_WORD - } - - B.txtDescription.text = Html.fromHtml(app.shortDescription) + B.txtDescription.text = HtmlCompat.fromHtml( + app.shortDescription, + HtmlCompat.FROM_HTML_OPTION_USE_CSS_COLORS + ) app.changes.apply { if (isEmpty()) { @@ -236,7 +230,7 @@ abstract class BaseDetailsActivity : BaseActivity() { } if (app.developerEmail.isNotEmpty()) { - B.devWeb.apply { + B.devMail.apply { setTxtSubtitle(app.developerEmail) visibility = View.VISIBLE } @@ -360,20 +354,7 @@ abstract class BaseDetailsActivity : BaseActivity() { } } - //Helpers - - open fun getIntentPackageName(intent: Intent): String? { - if (intent.hasExtra(Constants.STRING_EXTRA)) { - return intent.getStringExtra(Constants.STRING_EXTRA) - } else if (intent.scheme != null && (intent.scheme == "market" || intent.scheme == "http" || intent.scheme == "https") - ) { - return intent.data!!.getQueryParameter("id") - } else if (intent.extras != null) { - val bundle = intent.extras - return bundle!!.getString(Constants.STRING_EXTRA) - } - return null - } + /* App Review Helpers */ private fun addAvgReviews(number: Int, max: Long, rating: Long): RelativeLayout { return RatingView(this, number, max.toInt(), rating.toInt()) @@ -415,7 +396,7 @@ abstract class BaseDetailsActivity : BaseActivity() { return reviewsHelper.getReviews(app.packageName, Review.Filter.CRITICAL) } - /*---------------------------------- HELPERS FOR APP PRIVACY ---------------------------------*/ + /* App Privacy Helpers */ private fun parseResponse(response: String, packageName: String): List { try { diff --git a/app/src/main/res/layout/layout_details_dev.xml b/app/src/main/res/layout/layout_details_dev.xml index 11dedc1aa..aa87fac8a 100644 --- a/app/src/main/res/layout/layout_details_dev.xml +++ b/app/src/main/res/layout/layout_details_dev.xml @@ -33,7 +33,7 @@ android:layout_height="wrap_content" app:headerTitle="@string/details_dev_details" /> - - -