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
package com.example.wififinder | |
import android.Manifest | |
import android.content.Context | |
import android.content.pm.PackageManager | |
import android.net.ConnectivityManager | |
import android.net.wifi.WifiManager | |
import android.os.Bundle | |
import android.util.Log | |
import android.view.View |
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 showRewardedAds() { | |
val adRequest = AdRequest.Builder().build() | |
RewardedAd.load(requireContext(), getString(R.string.reward_id), adRequest, object : RewardedAdLoadCallback() { | |
override fun onAdFailedToLoad(adError: LoadAdError) { | |
if (isAdded) | |
hideProgress() | |
} | |
override fun onAdLoaded(rewardedAd: RewardedAd) { |
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
val Any.TAG: String | |
get() { | |
val tag = javaClass.simpleName | |
return if (tag.length <= 23) tag else tag.substring(0, 23) | |
} |
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
/* | |
* LogHelper object | |
*/ | |
object LogHelper { | |
private const val TESTING: Boolean = false // set to "false" for release builds | |
private const val LOG_PREFIX: String = "codepudnit" | |
private const val MAX_LOG_TAG_LENGTH: Int = 64 | |
private const val LOG_PREFIX_LENGTH: Int = LOG_PREFIX.length |
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
val ssb = SpannableStringBuilder() | |
.color(getColor(R.color.color_grey)) | |
{ | |
append(getString(R.string.beta_version_stat)) | |
appendLine() | |
} | |
.color(getColor(R.color.color_grey)) { | |
append(getString(R.string.exp_issue)) | |
} | |
.color(getColor(R.color.colorPrimary)) { |
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 android.content.res.Resources | |
import android.graphics.Canvas | |
import android.graphics.Paint | |
import android.graphics.RectF | |
import android.text.style.ReplacementSpan | |
import kotlin.math.roundToInt | |
class RoundedBackgroundSpan( | |
private val textColor: Int, |
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 AdsFormActivity : AppCompatActivity() { | |
private lateinit var binding: ActivityAdsForm2Binding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = DataBindingUtil.setContentView(this, R.layout.activity_ads_form) | |
supportActionBar?.hide() | |
setClickListeners() | |
setTextWatchers() | |
} |
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 StatsOverallAdapter(val data: Data?) : RecyclerView.Adapter<StatsOverallAdapter.StatsOverallViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StatsOverallViewHolder { | |
val inflater = LayoutInflater.from(parent.context) | |
val binding = StatsOverallAdapterBinding.inflate(inflater,parent,false) | |
return StatsOverallViewHolder(binding) | |
} | |
override fun getItemCount() = 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
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<translate | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:fromXDelta="-100%p" | |
android:toXDelta="0" /> | |
</set> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<Button | |
android:id="@+id/button" | |
android:layout_width="96dp" |