This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun setTextWatcher(editText: EditText?) { | |
| editText?.addTextChangedListener(object : TextWatcher { | |
| override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} | |
| override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { | |
| if (s.toString() != "") { | |
| mTextMap[editText.id] = TextMapModel(s.toString(), editText) | |
| val indexOfNext = mTextIdArray.indexOf(editText.id) + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private val mTextMap: HashMap<Int, TextMapModel> = HashMap() | |
| private val mTextIdArray: ArrayList<Int> = ArrayList() | |
| private fun createInputFieldsInInputBox(actualText: String) { | |
| val textLength = actualText.length | |
| val flexboxLayout = mBinding.flexboxLayoutInput | |
| flexboxLayout.flexDirection = FlexDirection.ROW | |
| val filterArray = arrayOfNulls<InputFilter>(1) | |
| filterArray[0] = InputFilter.LengthFilter(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class InstagramLiveAgoraSocket extends AppCompatActivity { | |
| private static final int PERMISSION_REQ_ID = 22; | |
| // Permission WRITE_EXTERNAL_STORAGE is not mandatory | |
| // for Agora RTC SDK, just in case if you wanna save | |
| // logs to external sdcard. | |
| private static final String[] REQUESTED_PERMISSIONS = { | |
| Manifest.permission.RECORD_AUDIO, | |
| Manifest.permission.CAMERA, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dialog addCardDialog; | |
| private void onAddCardButtonClicked() { | |
| /* | |
| below is kind of custom dialog | |
| i.e. stripe widget is inside a card view and custom buttons | |
| but the basic idea remains same | |
| */ | |
| addCardDialog = new Dialog(context, R.style.AppTheme_NoTitleBar_Main); | |
| addCardDialog.setContentView(R.layout.dialog_add_card); | |
| TextView addCard = addCardDialog.findViewById(R.id.addCard); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun onAddCardButtonClicked() { | |
| mBinding.buttonAddCard.setOnClickListener { | |
| val view = layoutInflater.inflate(R.layout.dialog_add_card, null) | |
| val cardInputWidget: CardInputWidget = view.findViewById(R.id.widget_add_card) | |
| AlertDialog.Builder(requireContext()) | |
| .setTitle(getString(R.string.add_card)) | |
| .setView(view) | |
| .setPositiveButton(getString(R.string.yes)) { dialog, _ -> | |
| try { | |
| val paymentMethodCreateParams = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { View, Text, TouchableOpacity } from 'react-native' | |
| import stripe from 'tipsi-stripe' | |
| const YourCard = () => { | |
| // initialize stripe | |
| stripe.setOptions({ | |
| publishableKey: 'pk_test_publishableUniqueKey' | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BaseApplication: DaggerApplication() { | |
| @Inject | |
| lateinit var mSharedPrefs: SharedPreferences | |
| override fun applicationInjector(): AndroidInjector<out DaggerApplication> { | |
| return DaggerAppComponent.factory().create(this) | |
| } | |
| override fun onCreate() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MessagingServices extends FirebaseMessagingService { | |
| public MessagingServices() { | |
| FirebaseInstallations.getInstance().getId().addOnCompleteListener( | |
| task -> { | |
| if (task.isSuccessful()) { | |
| String token = task.getResult(); | |
| Log.i("token ---->>", token); | |
| // store the token in shared preferences |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HyperLog.initialize(this) | |
| HyperLog.setLogLevel(Log.VERBOSE) | |
| HyperLog.d("Test logs","Debug Log") | |
| HyperLog.setURL("https://xxxxxxx0xxxxx.x.pipedream.net/") | |
| HyperLog.pushLogs(this, false, object: HLCallback() { | |
| override fun onSuccess(response: Any) { | |
| //Handle success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private val urlPattern: Pattern = Pattern.compile( | |
| "(?:^|[\\W])((ht|f)tp(s?):\\/\\/|www\\.)" | |
| + "(([\\w\\-]+\\.){1,}?([\\w\\-.~]+\\/?)*" | |
| + "[\\p{Alnum}.,%_=?&#\\-+()\\[\\]\\*$~@!:/{};']*)", | |
| Pattern.CASE_INSENSITIVE or Pattern.MULTILINE or Pattern.DOTALL | |
| ) | |
| private fun clickableLink{ | |
| try { | |
| val str = SpannableString(longText) |
NewerOlder