17 sept 2024
Google ads integration for all modules: 1. Webseries 2. karaoke 3. audio books 4. GamesActivity 5. GamePlayerActivity 6. KaraokePlayerActivity 5. FMActivity Home2Fragment ad size update
This commit is contained in:
@@ -81,7 +81,6 @@
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode|fontScale|fontWeightAdjustment|screenLayout"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:theme="@style/FullScreenTheme" />
|
||||
<activity
|
||||
@@ -133,7 +132,6 @@
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:theme="@style/FullScreenTheme" />
|
||||
<activity
|
||||
|
||||
@@ -30,8 +30,8 @@ class WokaApp : Application() {
|
||||
var appDatabase: AppDatabase? = null
|
||||
|
||||
private const val LOCAL_DATA_SYNC_WORK = "com.woka.LOCAL_DATA_SYNC"
|
||||
private const val LOCAL_DATA_SYNC_PERIODIC_TIME_INTERVAL = 15L
|
||||
private val LOCAL_DATA_SYNC_PERIODIC_TIME_INTERVAL_UNIT = TimeUnit.MINUTES
|
||||
private const val LOCAL_DATA_SYNC_PERIODIC_TIME_INTERVAL = 1L
|
||||
private val LOCAL_DATA_SYNC_PERIODIC_TIME_INTERVAL_UNIT = TimeUnit.DAYS
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
@@ -78,7 +78,7 @@ class WokaApp : Application() {
|
||||
ExistingPeriodicWorkPolicy.KEEP,
|
||||
PeriodicWorkRequestBuilder<SyncWorker>(
|
||||
LOCAL_DATA_SYNC_PERIODIC_TIME_INTERVAL,
|
||||
LOCAL_DATA_SYNC_PERIODIC_TIME_INTERVAL_UNIT, // Every day
|
||||
LOCAL_DATA_SYNC_PERIODIC_TIME_INTERVAL_UNIT,
|
||||
)
|
||||
.setConstraints(
|
||||
Constraints.Builder()
|
||||
|
||||
@@ -49,6 +49,7 @@ import com.woka.utils.NoSignInDialog
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.isNetworkConnected
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.utils.setVisibility
|
||||
import com.woka.utils.shareWokaApp
|
||||
import com.woka.utils.show
|
||||
@@ -89,6 +90,7 @@ class AudioBooksActivity : WokaBaseActivity() {
|
||||
|
||||
window.apply {
|
||||
navigationBarColor = getColor(R.color.color_primary_dark)
|
||||
lightStatusBar()
|
||||
}
|
||||
|
||||
viewModel = ViewModelProvider(this)[AudioBookViewModel::class.java]
|
||||
|
||||
@@ -22,4 +22,8 @@ object NotificationRepository {
|
||||
}
|
||||
}
|
||||
|
||||
fun clearNotifications(){
|
||||
_notificationsLiveData.postValue(ApiResult.Loading())
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.woka.networking.ApiResult
|
||||
import com.woka.shop.views.ShopActivity
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.utils.show
|
||||
import com.woka.webseries.views.WebSeriesActivity
|
||||
import com.woka.wokagames.views.GamesActivity
|
||||
@@ -36,6 +37,8 @@ class NotificationsActivity : WokaBaseActivity() {
|
||||
insets
|
||||
}
|
||||
|
||||
window.lightStatusBar()
|
||||
|
||||
adapter = NotificationAdapter()
|
||||
|
||||
initViews()
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.woka.modules.faqs.FAQsRepository
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.utils.ProgressView
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.utils.toast
|
||||
|
||||
class FaqActivity : WokaBaseActivity() {
|
||||
@@ -37,6 +38,8 @@ class FaqActivity : WokaBaseActivity() {
|
||||
insets
|
||||
}
|
||||
|
||||
window.lightStatusBar()
|
||||
|
||||
progressView = ProgressView(this, getString(R.string.please_wait))
|
||||
|
||||
initViews()
|
||||
|
||||
@@ -140,10 +140,16 @@ class UserProfileActivity : WokaBaseActivity() {
|
||||
progressView.hide()
|
||||
toast(it.message)
|
||||
|
||||
val genderData = if (selectedGender == Gender.MALE){
|
||||
com.woka.userdata.userDataModels.Gender("Boy", 2)
|
||||
}else{
|
||||
com.woka.userdata.userDataModels.Gender("Girl", 1)
|
||||
val genderData = when (selectedGender) {
|
||||
Gender.MALE -> {
|
||||
com.woka.userdata.userDataModels.Gender("Boy", 2)
|
||||
}
|
||||
Gender.FEMALE -> {
|
||||
com.woka.userdata.userDataModels.Gender("Girl", 1)
|
||||
}
|
||||
else -> {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
val userData = userPrefs?.userData?.copy(
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.woka.utils.ProgressView
|
||||
import com.woka.userPreference.UserType
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.utils.show
|
||||
import com.woka.utils.toast
|
||||
|
||||
@@ -53,6 +54,8 @@ class SupportActivity : WokaBaseActivity() {
|
||||
insets
|
||||
}
|
||||
|
||||
window.lightStatusBar()
|
||||
|
||||
viewModel = ViewModelProvider(this)[SupportViewModel::class.java]
|
||||
progressView = ProgressView(this, getString(R.string.please_wait))
|
||||
|
||||
|
||||
@@ -37,8 +37,6 @@ class ExploreWokaActivity : WokaBaseActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
with(window){
|
||||
lightStatusBar()
|
||||
|
||||
requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS)
|
||||
enterTransition = Fade().apply { duration = 200 }
|
||||
}
|
||||
@@ -51,6 +49,8 @@ class ExploreWokaActivity : WokaBaseActivity() {
|
||||
insets
|
||||
}
|
||||
|
||||
window.lightStatusBar()
|
||||
|
||||
progressView = ProgressView(this)
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S){
|
||||
|
||||
@@ -465,7 +465,7 @@ class KaraokePlayerActivity : WokaBaseActivity() {
|
||||
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
try {
|
||||
val url = URL("https://content.jwplatform.com/videos/699dmCGz-7bKGpMKj.mp4")
|
||||
val url = URL(karaokePlayerData?.karaokeVideoUrl)
|
||||
copyStreamToFile(url.openConnection().getInputStream(), File(karaokeMusicPath))
|
||||
runOnUiThread {
|
||||
binding.recorderView.show()
|
||||
@@ -612,9 +612,9 @@ class KaraokePlayerActivity : WokaBaseActivity() {
|
||||
private fun startRecording() {
|
||||
recorder = MediaRecorder().apply {
|
||||
setAudioSource(MediaRecorder.AudioSource.MIC)
|
||||
setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP)
|
||||
setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
|
||||
setOutputFile(recordingOutputPath)
|
||||
setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB)
|
||||
setAudioEncoder(MediaRecorder.AudioEncoder.AAC)
|
||||
|
||||
try {
|
||||
prepare()
|
||||
|
||||
@@ -48,6 +48,7 @@ import com.woka.utils.NoSignInDialog
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.isNetworkConnected
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.utils.setVisibility
|
||||
import com.woka.utils.shareWokaApp
|
||||
import com.woka.utils.show
|
||||
@@ -89,6 +90,7 @@ class KaraokeActivity : WokaBaseActivity() {
|
||||
|
||||
window.apply {
|
||||
navigationBarColor = getColor(R.color.color_primary_dark)
|
||||
lightStatusBar()
|
||||
}
|
||||
|
||||
viewModel = ViewModelProvider(this)[KaraokeViewModel::class.java]
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.woka.modules.blogs.models.Blog
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.utils.show
|
||||
|
||||
class BlogsActivity : WokaBaseActivity() {
|
||||
@@ -44,6 +45,7 @@ class BlogsActivity : WokaBaseActivity() {
|
||||
}
|
||||
|
||||
window.navigationBarColor = getColor(R.color.color_primary)
|
||||
window.lightStatusBar()
|
||||
|
||||
adapter = BlogsGridAdapter(::obBlogClicked)
|
||||
|
||||
@@ -65,7 +67,7 @@ class BlogsActivity : WokaBaseActivity() {
|
||||
|
||||
private fun initViews(){
|
||||
binding.apply {
|
||||
toolbar.title.text = getString(R.string.blogs)
|
||||
toolbar.title.text = getString(R.string.blogs_all_caps)
|
||||
rvBlogs.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.woka.players.views
|
||||
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.ConnectivityManager.NetworkCallback
|
||||
import android.net.Network
|
||||
@@ -67,6 +68,9 @@ class LiveStreamPlayerActivity : WokaBaseActivity(), FullscreenHandler {
|
||||
insets
|
||||
}
|
||||
|
||||
// horizontal orientation
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
|
||||
val windowInsetsController =
|
||||
WindowCompat.getInsetsController(window, window.decorView)
|
||||
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.woka.players.views
|
||||
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.Network
|
||||
import android.net.NetworkRequest
|
||||
@@ -67,6 +68,9 @@ class PlayerActivity : WokaBaseActivity(), FullscreenHandler {
|
||||
insets
|
||||
}
|
||||
|
||||
// horizontal orientation
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
|
||||
val windowInsetsController =
|
||||
WindowCompat.getInsetsController(window, window.decorView)
|
||||
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
|
||||
@@ -184,7 +188,7 @@ class PlayerActivity : WokaBaseActivity(), FullscreenHandler {
|
||||
|
||||
config = PlayerConfig.Builder()
|
||||
.playlist(videoPlayList?.playlist)
|
||||
.advertisingConfig(imaAdvertising)
|
||||
// .advertisingConfig(imaAdvertising)
|
||||
.build()
|
||||
|
||||
// to keep up the screen om when video is being played
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.woka.database.helpers.ClicksHelper
|
||||
import com.woka.database.models.ContentType
|
||||
import com.woka.databinding.ActivityAddressBinding
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.lightStatusBar
|
||||
|
||||
class AddressActivity : WokaBaseActivity() {
|
||||
|
||||
@@ -29,6 +30,8 @@ class AddressActivity : WokaBaseActivity() {
|
||||
insets
|
||||
}
|
||||
|
||||
window.lightStatusBar()
|
||||
|
||||
initViews()
|
||||
|
||||
clickEvents()
|
||||
|
||||
@@ -5,11 +5,13 @@ import androidx.activity.enableEdgeToEdge
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.woka.R
|
||||
import com.woka.database.helpers.ClicksHelper
|
||||
import com.woka.database.models.ContentType
|
||||
import com.woka.databinding.ActivityCartBinding
|
||||
import com.woka.shop.viewmodels.CartViewModel
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.lightStatusBar
|
||||
|
||||
class CartActivity : WokaBaseActivity() {
|
||||
|
||||
@@ -31,11 +33,13 @@ class CartActivity : WokaBaseActivity() {
|
||||
insets
|
||||
}
|
||||
|
||||
window.lightStatusBar()
|
||||
|
||||
viewModel = ViewModelProvider(this)[CartViewModel::class.java]
|
||||
|
||||
clickEvents()
|
||||
initViews()
|
||||
|
||||
setObservers()
|
||||
clickEvents()
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@@ -45,6 +49,12 @@ class CartActivity : WokaBaseActivity() {
|
||||
ClicksHelper.upsertClickEvent(ContentType.OTHERS)
|
||||
}
|
||||
|
||||
private fun initViews(){
|
||||
binding.apply {
|
||||
toolbar.title.text = getString(R.string.my_cart)
|
||||
}
|
||||
}
|
||||
|
||||
private fun clickEvents() {
|
||||
binding.apply {
|
||||
toolbar.backBtn.setOnClickListener {
|
||||
@@ -53,10 +63,4 @@ class CartActivity : WokaBaseActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setObservers(){
|
||||
viewModel.onToolBarTitleChange = {
|
||||
binding.toolbar.title.text = it
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.woka.R
|
||||
import com.woka.home.models.Theme
|
||||
import com.woka.home.mylist.MyListRepository
|
||||
import com.woka.home.notifications.NotificationRepository
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.onboard.views.OnboardActivity
|
||||
import com.woka.shop.ShopRepository
|
||||
@@ -123,5 +124,6 @@ class UserPreference(val context: Context) {
|
||||
private fun clearData(){
|
||||
MyListRepository.clearData()
|
||||
ShopRepository.clearCart()
|
||||
NotificationRepository.clearNotifications()
|
||||
}
|
||||
}
|
||||
@@ -60,13 +60,12 @@ class GamePlayerActivity : WokaBaseActivity() {
|
||||
requestedOrientation = if (it.landscape){
|
||||
ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||
}else{
|
||||
loadGoogleAds()
|
||||
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
}
|
||||
initWebView(it.gameUrl)
|
||||
}
|
||||
|
||||
loadGoogleAds()
|
||||
|
||||
binding.webView.setOnTouchListener { _, event ->
|
||||
if (event.action == MotionEvent.ACTION_DOWN){
|
||||
clicksCount++
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.woka.utils.NoSignInDialog
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.isNetworkConnected
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.utils.setVisibility
|
||||
import com.woka.utils.shareWokaApp
|
||||
import com.woka.utils.show
|
||||
@@ -86,6 +87,7 @@ class GamesActivity : WokaBaseActivity() {
|
||||
|
||||
window.apply {
|
||||
navigationBarColor = getColor(R.color.color_primary_dark)
|
||||
lightStatusBar()
|
||||
}
|
||||
|
||||
viewModel = ViewModelProvider(this)[GamesViewModel::class.java]
|
||||
|
||||
@@ -96,6 +96,13 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/img_support"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -105,6 +112,8 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
/>
|
||||
|
||||
<Button
|
||||
@@ -125,22 +134,44 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:id="@+id/no_data"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
|
||||
android:text="@string/no_notifications_found"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
android:gravity="center"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/back_btn"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/img_support"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/no_notifications_found"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/back_btn"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -354,7 +354,7 @@
|
||||
android:textColorHint="@android:color/darker_gray"
|
||||
|
||||
android:autofillHints="phone"
|
||||
android:inputType="phone"
|
||||
android:inputType="number"
|
||||
android:singleLine="true"
|
||||
|
||||
android:background="@drawable/round_25_shadow"
|
||||
|
||||
@@ -7,6 +7,16 @@
|
||||
<item name="android:windowDisablePreview">true</item>
|
||||
</style>
|
||||
|
||||
<style name="JWIcon.ControlbarFullscreen">
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="JWIcon.CenterControlsFullscreen">
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
|
||||
<!-- top corner rounded bottom sheet-->
|
||||
<style name="BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
|
||||
<item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item>
|
||||
|
||||
@@ -316,4 +316,5 @@
|
||||
<string name="advertisement">Advertisement</string>
|
||||
<string name="session_expired">Session Expired</string>
|
||||
<string name="please_login_again">Please login again.</string>
|
||||
<string name="my_cart">MY CART</string>
|
||||
</resources>
|
||||
@@ -7,6 +7,17 @@
|
||||
<item name="android:windowDisablePreview">true</item>
|
||||
</style>
|
||||
|
||||
<style name="JWIcon.ControlbarFullscreen">
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="JWIcon.CenterControlsFullscreen">
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
|
||||
<!-- Set the splash screen background to black -->
|
||||
<item name="android:windowBackground">@drawable/splash_bg</item>
|
||||
|
||||
Reference in New Issue
Block a user