Før oppdateringer av fragment.home.xml, HomeAdapter.java og HomeFragment.java
This commit is contained in:
parent
3b89af6605
commit
ca1b8a647e
2 changed files with 20 additions and 1 deletions
|
|
@ -1,9 +1,21 @@
|
||||||
|
import java.util.Properties
|
||||||
|
import java.io.FileInputStream
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
// NY LINJE: Aktiver Google Services plugin her
|
// NY LINJE: Aktiver Google Services plugin her
|
||||||
id("com.google.gms.google-services")
|
id("com.google.gms.google-services")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- NY KODE: Last inn local.properties ---
|
||||||
|
// Vi bruker "Properties()" direkte siden vi har importert den på toppen
|
||||||
|
val localProperties = Properties()
|
||||||
|
val localPropertiesFile = rootProject.file("local.properties")
|
||||||
|
if (localPropertiesFile.exists()) {
|
||||||
|
localProperties.load(FileInputStream(localPropertiesFile))
|
||||||
|
}
|
||||||
|
// ------------------------------------------
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.kbs.kbsintranett"
|
namespace = "com.kbs.kbsintranett"
|
||||||
compileSdk = 34
|
compileSdk = 34
|
||||||
|
|
@ -16,6 +28,13 @@ android {
|
||||||
versionName = "1.5.1"
|
versionName = "1.5.1"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
// Hent verdien vi lastet inn på toppen av filen
|
||||||
|
val webClientId = localProperties.getProperty("WEB_CLIENT_ID") ?: ""
|
||||||
|
|
||||||
|
// Opprett BuildConfig-feltet.
|
||||||
|
// Vi legger på ekstra hermetegn (\") for at det skal bli en String i Java-koden.
|
||||||
|
buildConfigField("String", "WEB_CLIENT_ID", "\"$webClientId\"")
|
||||||
}
|
}
|
||||||
|
|
||||||
// NYTT: Dette må til for å kunne bruke BuildConfig.DEBUG i koden
|
// NYTT: Dette må til for å kunne bruke BuildConfig.DEBUG i koden
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
public static final String GOOGLE_WEB_CLIENT_ID = "738325360287-cidl3plnqv9ei74vm9vm5muustj6eenb.apps.googleusercontent.com"; // Bytt med din egen hvis denne er feil
|
public static final String GOOGLE_WEB_CLIENT_ID = BuildConfig.WEB_CLIENT_ID;
|
||||||
|
|
||||||
private static final String TAG = "MainActivity";
|
private static final String TAG = "MainActivity";
|
||||||
private NavController navController;
|
private NavController navController;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue