<commit_before>package com.newsblur.activity

import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import com.newsblur.R
import com.newsblur.databinding.ActivityShareExternalStoryBinding
import com.newsblur.network.APIManager
import com.newsblur.util.*
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class ShareExternalStoryActivity : AppCompatActivity() {

    @Inject
    lateinit var apiManager: APIManager

    private var storyTitle: String? = null
    private var storyUrl: String? = null

    private lateinit var binding: ActivityShareExternalStoryBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        PrefsUtils.applyTranslucentThemePreference(this)
        super.onCreate(savedInstanceState)
        binding = ActivityShareExternalStoryBinding.inflate(layoutInflater)
        setContentView(binding.root)

        if (intent.action == Intent.ACTION_SEND && intent.type == "text/plain") {
            handleIntent()
        } else {
            finishWithToast("NewsBlur action unrecognized")
        }
    }

    private fun handleIntent() {
        storyTitle = intent.getStringExtra(Intent.EXTRA_SUBJECT)
        storyUrl = intent.getStringExtra(Intent.EXTRA_TEXT)

        if (!storyTitle.isNullOrEmpty() && !storyUrl.isNullOrEmpty()) {
            binding.textTitle.text = getString(R.string.share_save_newsblur, storyTitle)

            binding.textCancel.setOnClickListener { finish() }<commit_msg>#1624 Update error message for invalid intent action for external story share.<commit_after>package com.newsblur.activity

import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import com.newsblur.R
import com.newsblur.databinding.ActivityShareExternalStoryBinding
import com.newsblur.network.APIManager
import com.newsblur.util.*
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class ShareExternalStoryActivity : AppCompatActivity() {

    @Inject
    lateinit var apiManager: APIManager

    private var storyTitle: String? = null
    private var storyUrl: String? = null

    private lateinit var binding: ActivityShareExternalStoryBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        PrefsUtils.applyTranslucentThemePreference(this)
        super.onCreate(savedInstanceState)
        binding = ActivityShareExternalStoryBinding.inflate(layoutInflater)
        setContentView(binding.root)

        if (intent.action == Intent.ACTION_SEND && intent.type == "text/plain") {
            handleIntent()
        } else {
            finishWithToast("NewsBlur invalid intent action!")
        }
    }

    private fun handleIntent() {
        storyTitle = intent.getStringExtra(Intent.EXTRA_SUBJECT)
        storyUrl = intent.getStringExtra(Intent.EXTRA_TEXT)

        if (!storyTitle.isNullOrEmpty() && !storyUrl.isNullOrEmpty()) {
            binding.textTitle.text = getString(R.string.share_save_newsblur, storyTitle)

            binding.textCancel.setOnClickListener { finish() }
{'fraction_non_alphanumeric': 0.08057598039215687, 'fraction_numerical': 0.0012254901960784314, 'mean_word_length': 3.9620060790273555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '985781', 'n_tokens_mistral': 902, 'n_tokens_neox': 856, 'n_words': 176}