Skip to content

Commit

Permalink
[#676] add huawei link to Support Us logic (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan authored May 8, 2022
1 parent f8e7ff7 commit 6c03844
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import com.github.submob.basemob.activity.BaseActivity
import com.oztechan.ccc.ad.AdManager
import com.oztechan.ccc.analytics.AnalyticsManager
import com.oztechan.ccc.analytics.model.UserProperty
import com.oztechan.ccc.android.util.getMarketLink
import com.oztechan.ccc.android.util.requestAppReview
import com.oztechan.ccc.android.util.showDialog
import com.oztechan.ccc.android.util.updateAppTheme
Expand Down Expand Up @@ -67,7 +68,7 @@ class MainActivity : BaseActivity() {
positiveButton = R.string.update,
cancelable = isCancelable
) {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.app_market_link))))
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getMarketLink())))
}

private fun checkDestination() = with(getNavigationController()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.github.submob.basemob.fragment.BaseVBFragment
import com.oztechan.ccc.ad.AdManager
import com.oztechan.ccc.analytics.AnalyticsManager
import com.oztechan.ccc.analytics.model.FirebaseEvent
import com.oztechan.ccc.android.util.getMarketLink
import com.oztechan.ccc.android.util.setBannerAd
import com.oztechan.ccc.android.util.showDialog
import com.oztechan.ccc.android.util.showSingleChoiceDialog
Expand Down Expand Up @@ -151,7 +152,7 @@ class SettingsFragment : BaseVBFragment<FragmentSettingsBinding>() {
startIntent(
Intent(
Intent.ACTION_VIEW,
Uri.parse(getString(R.string.app_market_link))
Uri.parse(requireContext().getMarketLink())
)
)
}
Expand Down Expand Up @@ -228,7 +229,7 @@ class SettingsFragment : BaseVBFragment<FragmentSettingsBinding>() {

private fun share() = Intent(Intent.ACTION_SEND).apply {
type = TEXT_TYPE
putExtra(Intent.EXTRA_TEXT, getString(R.string.app_market_link))
putExtra(Intent.EXTRA_TEXT, requireContext().getMarketLink())
startActivity(Intent.createChooser(this, getString(R.string.settings_item_share_title)))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import android.content.res.Configuration
import android.content.res.Resources
import android.os.Build
import androidx.appcompat.app.AppCompatDelegate
import com.oztechan.ccc.client.device
import com.oztechan.ccc.client.model.AppTheme
import com.oztechan.ccc.client.model.Device
import mustafaozhan.github.com.mycurrencies.R
import java.util.Locale

fun updateBaseContextLocale(context: Context): Context? {
Expand Down Expand Up @@ -45,3 +48,10 @@ private fun updateResourcesLocaleLegacy(context: Context, locale: Locale): Conte
resources.updateConfiguration(configuration, resources.displayMetrics)
return context
}

fun Context.getMarketLink() = getString(
when (device as Device.ANDROID) {
Device.ANDROID.GOOGLE -> R.string.app_market_link_google
Device.ANDROID.HUAWEI -> R.string.app_market_link_huawei
}
)
5 changes: 3 additions & 2 deletions resources/src/commonMain/resources/MR/base/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
<string name="copied_to_clipboard">Copied to clipboard!</string>

<!--Dialog-->
<string name="rate_and_support">Please rate us and review the app on Google Play Store :)</string>
<string name="rate_and_support">You can rate us and review our app in the market :)</string>
<string name="app_market_link_google">https://play.google.com/store/apps/details?id=mustafaozhan.github.com.mycurrencies</string>
<string name="app_market_link_huawei">https://appgallery.huawei.com/app/C104920917</string>
<string name="rate">RATE</string>
<string name="update">Update</string>
<string name="github_url">https://github.com/CurrencyConverterCalculator/CCC</string>
Expand All @@ -63,7 +65,6 @@
<string name="mail_feedback_subject">Feedback for CCC</string>
<string name="mail_extra_text">Dear Developer,</string>
<string name="mail_intent_title">Send Feedback:</string>
<string name="app_market_link">https://play.google.com/store/apps/details?id=mustafaozhan.github.com.mycurrencies</string>

<!--Intro Sliders-->
<string name="next">NEXT</string>
Expand Down

0 comments on commit 6c03844

Please sign in to comment.