Skip to content

Commit

Permalink
4.0.5
Browse files Browse the repository at this point in the history
[+] Добавил кодогенерацию значений из local.properties.
[+] Добавил конфиг для рекламы.
  • Loading branch information
plumsoftware committed Jan 18, 2025
1 parent 5df5fff commit c272fb7
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 16 deletions.
40 changes: 40 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 29 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,43 @@ plugins {
android {
compileSdk 35

def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")

if (localPropertiesFile.exists()) {
localProperties.load(new FileInputStream(localPropertiesFile))
}

def mainBannerAdsId = localProperties.getProperty("mainScreenBannerId")
def eventScreenBannerId = localProperties.getProperty("eventScreenBannerId")
def openAdsId = localProperties.getProperty("openAdsId")
def interstitialAdsId = localProperties.getProperty("interstitialAdsId")

defaultConfig {
applicationId "com.plumsoftware.rucalendar"
minSdk 21
targetSdk 35
versionCode 50
versionName "4.0.4"
versionCode 51
versionName "4.0.5"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

buildConfigField "String", "mainScreenBannerId", "\"${mainBannerAdsId}\""
buildConfigField "String", "openAdsId", "\"${openAdsId}\""
buildConfigField "String", "interstitialAdsId", "\"${interstitialAdsId}\""
buildConfigField "String", "eventScreenBannerId", "\"${eventScreenBannerId}\""
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

buildConfigField "String", "mainScreenBannerId", "\"${mainBannerAdsId}\""
buildConfigField "String", "openAdsId", "\"${openAdsId}\""
buildConfigField "String", "interstitialAdsId", "\"${interstitialAdsId}\""
buildConfigField "String", "eventScreenBannerId", "\"${eventScreenBannerId}\""
}
}
compileOptions {
Expand Down Expand Up @@ -105,6 +127,9 @@ android {
checkDependencies false
disable 'MobileAdsSdkOutdatedVersion'
}
buildFeatures {
buildConfig true
}
}
}

Expand All @@ -114,6 +139,7 @@ dependencies {
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-messaging:23.1.2'
implementation 'androidx.core:core-ktx:1.15.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand All @@ -126,7 +152,7 @@ dependencies {


//noinspection MobileAdsSdkVersion
implementation 'com.yandex.android:mobileads:7.8.0'
implementation 'com.yandex.android:mobileads:7.9.0'

//Animations
implementation 'io.noties:tumbleweed-android:2.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.widget.TextView;
import android.widget.Toast;

import com.plumsoftware.rucalendar.config.AdsConfig;
import com.plumsoftware.rucalendar.events.CelebrationItem;
import com.plumsoftware.rucalendar.dialog.ProgressDialog;
import com.plumsoftware.rucalendar.R;
Expand Down Expand Up @@ -65,7 +66,7 @@ protected void onCreate(Bundle savedInstanceState) {
androidx.appcompat.widget.Toolbar toolbar = findViewById(R.id.toolbar2);
mBannerAdView = (BannerAdView) findViewById(R.id.adView);

mBannerAdView.setAdUnitId("R-M-2215793-1"); //RuStore
mBannerAdView.setAdUnitId(AdsConfig.BANNER_EVENT_SCREEN_AD);
mBannerAdView.setAdSize(BannerAdSize.inlineSize(EventActivity.this, screenWidth, 50));

// Создание объекта таргетирования рекламы.
Expand Down Expand Up @@ -176,7 +177,7 @@ public void onBackPressed() {
progressDialog.showDialog(EventActivity.this);
if (mInterstitialAdLoader != null) {
final AdRequestConfiguration adRequestConfiguration =
new AdRequestConfiguration.Builder("R-M-2215793-2").build(); //RuStore
new AdRequestConfiguration.Builder(AdsConfig.INTERSTITIAL_AD).build(); //RuStore
mInterstitialAdLoader.loadAd(adRequestConfiguration);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.airbnb.lottie.LottieAnimationView;
import com.google.android.material.appbar.AppBarLayout;
import com.plumsoftware.rucalendar.adapters.CelebrationAdapter;
import com.plumsoftware.rucalendar.config.AdsConfig;
import com.plumsoftware.rucalendar.dialog.ProgressDialog;
import com.plumsoftware.rucalendar.events.CelebrationItem;
import com.plumsoftware.rucalendar.events.Celebrations;
Expand Down Expand Up @@ -137,7 +138,6 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.menu_layout);

MobileAds.initialize(this, () -> {

});

Context context = MainActivity.this;
Expand All @@ -147,7 +147,7 @@ protected void onCreate(Bundle savedInstanceState) {
// region::App open Ads
progressDialog.showDialog(context);
final AppOpenAdLoader appOpenAdLoader = new AppOpenAdLoader(context);
final String AD_UNIT_ID = "R-M-2215793-4"; //RuStore
final String AD_UNIT_ID = AdsConfig.OPEN_MAIN_SCREEN_AD;
final AdRequestConfiguration adRequestConfiguration = new AdRequestConfiguration.Builder(AD_UNIT_ID).build();

AppOpenAdEventListener appOpenAdEventListener = new AppOpenAdEventListener() {
Expand Down Expand Up @@ -183,9 +183,7 @@ public void onAdImpression(@Nullable final ImpressionData impressionData) {
@Override
public void onAdLoaded(@NonNull final AppOpenAd appOpenAd) {
mAppOpenAd = appOpenAd;
if (mAppOpenAd != null) {
mAppOpenAd.setAdEventListener(appOpenAdEventListener);
}
mAppOpenAd.setAdEventListener(appOpenAdEventListener);
progressDialog.dismiss();
showAppOpenAd();
}
Expand Down Expand Up @@ -248,7 +246,7 @@ public void onAdFailedToLoad(@NonNull final AdRequestError adRequestError) {
bannerHeight = (int) (screenHeight * 0.036);
}
BannerAdView mBannerAdView = (BannerAdView) findViewById(R.id.adView);
mBannerAdView.setAdUnitId("R-M-2215793-1");
mBannerAdView.setAdUnitId(AdsConfig.BANNER_MAIN_SCREEN_AD);
mBannerAdView.setAdSize(BannerAdSize.inlineSize(context, screenWidth, bannerHeight));

final AdRequest adRequest = new AdRequest.Builder().build();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.plumsoftware.rucalendar.config;

import com.plumsoftware.rucalendar.BuildConfig;

public final class AdsConfig {
public static String BANNER_MAIN_SCREEN_AD = BuildConfig.mainScreenBannerId;
public static String BANNER_EVENT_SCREEN_AD = BuildConfig.eventScreenBannerId;
public static String OPEN_MAIN_SCREEN_AD = BuildConfig.openAdsId;
public static String INTERSTITIAL_AD = BuildConfig.interstitialAdsId;
}
11 changes: 9 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
buildscript {
ext {
kotlin_version = '1.9.24'
}
dependencies {
classpath 'com.google.gms:google-services:4.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
repositories {
mavenCentral()
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.6.1' apply false
id 'com.android.library' version '8.6.1' apply false
id 'com.android.application' version '8.7.3' apply false
id 'com.android.library' version '8.7.3' apply false
}

tasks.register('clean', Delete) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Oct 20 20:41:15 GMT+06:00 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit c272fb7

Please sign in to comment.