Skip to content

Commit 2a9187d

Browse files
Merge pull request #16 from D4rK7355608/tmp
Update 3.0_r1
2 parents db8391d + 62b17df commit 2a9187d

39 files changed

+65
-109
lines changed

.idea/.name

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Version 3.0_r2:
2+
- Made minor under-the-hood improvements for a better overall app experience.
3+
14
# Version 3.0_r1:
25
- Added a new startup screen for new users.
36
- Added a new GDPR message to comply with Google Play policy.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
## The perfect QR code scanner for anyone who wants a fast and versatile app. 📷
1919

20-
[![YouTube Trailer](https://yt-embed.herokuapp.com/embed?v=CgX31Oy2etM)](https://youtu.be/CgX31Oy2etM)
21-
2220
Scan and Generate QR/Bar Codes with Ease! 🌐
2321

2422
Introducing D4rK QR & Bar Code Scanner Plus, the reliable and user-friendly app that streamlines QR code scanning and generation on Android devices. Powered by the trusted ZXing scanning library, our app offers a secure and seamless experience. 🔐
@@ -29,6 +27,8 @@ Embrace QR and bar codes with QR & Bar Code Scanner Plus. The ultimate free scan
2927

3028
Furthermore, D4rK QR & Bar Code Scanner Plus supports a wide range of barcode formats, including QR, Data Matrix, Aztec, UPC, EAN, and more. Discover hidden details, such as Wi-Fi connections, geolocations, calendar events, and product information, with just a scan. 🛡️
3129

30+
[<img src="https://img.youtube.com/vi/CgX31Oy2etM/maxresdefault.jpg" alt="Watch the trailer">](https://youtu.be/CgX31Oy2etM)
31+
3232
## ⚠ Opening Issues!
3333
Bugs can be reported [here](https://github.com/D4rK7355608/com.d4rk.netprobe/issues).
3434

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,8 @@
6060
<activity
6161
android:name=".ui.settings.help.HelpActivity"
6262
android:label="@string/help"
63-
android:exported="false">
64-
<meta-data
65-
android:name="android.support.PARENT_ACTIVITY"
66-
android:value=".ui.settings.help.HelpActivity"/>
67-
</activity>
63+
android:exported="false"
64+
android:parentActivityName=".ui.settings.help.HelpActivity"/>
6865
<activity
6966
android:name=".ui.settings.SettingsActivity"
7067
android:exported="false"

app/src/main/kotlin/com/d4rk/qrcodescanner/plus/ads/managers/AppOpenAdManager.kt

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.lifecycle.Lifecycle
88
import androidx.lifecycle.LifecycleObserver
99
import androidx.lifecycle.OnLifecycleEvent
1010
import androidx.lifecycle.ProcessLifecycleOwner
11+
import androidx.multidex.MultiDexApplication
1112
import com.google.android.gms.ads.AdError
1213
import com.google.android.gms.ads.AdRequest
1314
import com.google.android.gms.ads.FullScreenContentCallback
@@ -16,13 +17,13 @@ import com.google.android.gms.ads.MobileAds
1617
import com.google.android.gms.ads.appopen.AppOpenAd
1718
import java.util.Date
1819
private const val AD_UNIT_ID = "ca-app-pub-5294151573817700/8044468099"
19-
class AppOpenAdManager : Application(), Application.ActivityLifecycleCallbacks, LifecycleObserver {
20+
class AppOpenAdManager : MultiDexApplication(), Application.ActivityLifecycleCallbacks, LifecycleObserver {
2021
private lateinit var appOpenAdManager: AppOpenAdManager
2122
private var currentActivity: Activity? = null
2223
override fun onCreate() {
2324
super.onCreate()
2425
registerActivityLifecycleCallbacks(this)
25-
MobileAds.initialize(this)
26+
MobileAds.initialize(this)
2627
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
2728
appOpenAdManager = AppOpenAdManager()
2829
}
@@ -41,10 +42,6 @@ class AppOpenAdManager : Application(), Application.ActivityLifecycleCallbacks,
4142
override fun onActivityStopped(activity: Activity) {}
4243
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
4344
override fun onActivityDestroyed(activity: Activity) {}
44-
@Suppress("unused")
45-
fun showAdIfAvailable(activity: Activity, onShowAdCompleteListener: OnShowAdCompleteListener) {
46-
appOpenAdManager.showAdIfAvailable(activity, onShowAdCompleteListener)
47-
}
4845
interface OnShowAdCompleteListener {
4946
fun onShowAdComplete()
5047
}
@@ -59,39 +56,32 @@ class AppOpenAdManager : Application(), Application.ActivityLifecycleCallbacks,
5956
}
6057
isLoadingAd = true
6158
val request = AdRequest.Builder().build()
62-
AppOpenAd.load(
63-
context,
64-
AD_UNIT_ID,
65-
request,
66-
AppOpenAd.APP_OPEN_AD_ORIENTATION_PORTRAIT,
67-
object : AppOpenAd.AppOpenAdLoadCallback() {
68-
override fun onAdLoaded(ad: AppOpenAd) {
69-
appOpenAd = ad
70-
isLoadingAd = false
71-
loadTime = Date().time
72-
}
73-
74-
override fun onAdFailedToLoad(loadAdError: LoadAdError) {
75-
isLoadingAd = false
76-
}
77-
}
78-
)
59+
AppOpenAd.load(context, AD_UNIT_ID, request, AppOpenAd.APP_OPEN_AD_ORIENTATION_PORTRAIT, object : AppOpenAd.AppOpenAdLoadCallback() {
60+
override fun onAdLoaded(ad: AppOpenAd) {
61+
appOpenAd = ad
62+
isLoadingAd = false
63+
loadTime = Date().time
64+
}
65+
override fun onAdFailedToLoad(loadAdError: LoadAdError) {
66+
isLoadingAd = false
67+
}
68+
})
7969
}
80-
private fun wasLoadTimeLessThanNHoursAgo(@Suppress("SameParameterValue") numHours: Long): Boolean {
70+
@Suppress("SameParameterValue")
71+
private fun wasLoadTimeLessThanNHoursAgo(numHours: Long): Boolean {
8172
val dateDifference: Long = Date().time - loadTime
8273
val numMilliSecondsPerHour: Long = 3600000
8374
return dateDifference < numMilliSecondsPerHour * numHours
8475
}
76+
@Suppress("BooleanMethodIsAlwaysInverted")
8577
private fun isAdAvailable(): Boolean {
8678
return appOpenAd != null && wasLoadTimeLessThanNHoursAgo(4)
8779
}
8880
fun showAdIfAvailable(activity: Activity) {
89-
showAdIfAvailable(
90-
activity,
91-
object : OnShowAdCompleteListener {
92-
override fun onShowAdComplete() {
93-
}
81+
showAdIfAvailable(activity, object: OnShowAdCompleteListener {
82+
override fun onShowAdComplete() {
9483
}
84+
}
9585
)
9686
}
9787
fun showAdIfAvailable(activity: Activity, onShowAdCompleteListener: OnShowAdCompleteListener) {
@@ -105,16 +95,16 @@ class AppOpenAdManager : Application(), Application.ActivityLifecycleCallbacks,
10595
}
10696
appOpenAd!!.fullScreenContentCallback = object : FullScreenContentCallback() {
10797
override fun onAdDismissedFullScreenContent() {
108-
appOpenAd = null
109-
isShowingAd = false
110-
onShowAdCompleteListener.onShowAdComplete()
111-
loadAd(activity)
98+
appOpenAd = null
99+
isShowingAd = false
100+
onShowAdCompleteListener.onShowAdComplete()
101+
loadAd(activity)
112102
}
113103
override fun onAdFailedToShowFullScreenContent(adError: AdError) {
114-
appOpenAd = null
115-
isShowingAd = false
116-
onShowAdCompleteListener.onShowAdComplete()
117-
loadAd(activity)
104+
appOpenAd = null
105+
isShowingAd = false
106+
onShowAdCompleteListener.onShowAdComplete()
107+
loadAd(activity)
118108
}
119109
override fun onAdShowedFullScreenContent() {
120110
}

app/src/main/kotlin/com/d4rk/qrcodescanner/plus/ui/settings/SettingsActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class SettingsActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferen
144144
putExtra(Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID)
145145
putExtra(Intent.EXTRA_SUBJECT, R.string.share_subject)
146146
}
147-
startActivity(Intent.createChooser(sharingIntent, getString(R.string.share)))
147+
startActivity(Intent.createChooser(sharingIntent, getString(R.string.share_using)))
148148
true
149149
}
150150
val ossPreference = findPreference<Preference>(getString(R.string.key_open_source_licenses))
81.6 KB
Loading
559 KB
Loading

app/src/main/play/listings/en-US/graphics/phone-screenshots/1-screenshot_scan.png

Whitespace-only changes.
580 KB
Loading

0 commit comments

Comments
 (0)