From 80c4e619d23d4cbb528a1b43a5b44ea354ddcc46 Mon Sep 17 00:00:00 2001 From: PranshulGG Date: Tue, 30 Jul 2024 17:18:41 +0530 Subject: [PATCH] 1.3.4 updated --- app/build.gradle | 2 +- app/release/output-metadata.json | 2 +- app/src/main/AndroidManifest.xml | 6 + app/src/main/assets/app/app.js | 22 +- app/src/main/assets/app/renderForecastPage.js | 444 ++++++++++++++++++ app/src/main/assets/index.html | 6 +- app/src/main/assets/pages/AboutPage.html | 2 +- app/src/main/assets/pages/forecastPage.html | 119 +++++ app/src/main/assets/pages/forecastPageUi.css | 158 +++++++ app/src/main/assets/ui-files/ui.css | 6 +- app/src/main/assets/ui-files/variables.css | 1 + .../example/weathermaster/ForecastPage.java | 212 +++++++++ .../example/weathermaster/MainActivity.java | 9 +- 13 files changed, 971 insertions(+), 18 deletions(-) create mode 100644 app/src/main/assets/app/renderForecastPage.js create mode 100644 app/src/main/assets/pages/forecastPage.html create mode 100644 app/src/main/assets/pages/forecastPageUi.css create mode 100644 app/src/main/java/com/example/weathermaster/ForecastPage.java diff --git a/app/build.gradle b/app/build.gradle index 5d1f23e4d..e780f6c12 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { minSdk 22 targetSdk 33 versionCode 2 - versionName "1.3.3 (W)" + versionName "1.3.4 (W)" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index c4baef66c..0496e1e81 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -12,7 +12,7 @@ "filters": [], "attributes": [], "versionCode": 2, - "versionName": "1.3.2 (W)", + "versionName": "1.3.3 (W)", "outputFile": "app-release.apk" } ], diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ff5328537..dfc804000 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -48,6 +48,12 @@ android:exported="true" android:theme="@style/ScreensAll" /> + ${date}

- + ` @@ -1614,11 +1616,17 @@ function displayDailyForecast(dailyForecast) {
${description}

${date}

+ ` ; } + forecastItem.addEventListener('click', () => { + setTimeout(()=>{ + sendThemeToAndroid('Open8Forecast') + }, 250); + }); forecastContainer.appendChild(forecastItem); @@ -1981,13 +1989,6 @@ const moon_phase_img = document.getElementById('moon_phase_img'); - if(data.days[0].precipprob > 5){ - document.getElementById('rain_percentage').innerHTML = Math.round(data.days[0].precipprob) + '%'; - document.querySelector('.rain_per').hidden = false; - } else{ - document.querySelector('.rain_per').hidden = true; - - } document.getElementById('RainHours').innerHTML = Math.round(data.days[0].precipcover) + '%'; @@ -2002,13 +2003,18 @@ const moon_phase_img = document.getElementById('moon_phase_img'); const today_max_temp_celsius = data.days[0].tempmax; const today_min_temp_celsius = data.days[0].tempmin; + const dewPointTodayC = Math.round(data.days[0].dew); + const dewPointTodayF = Math.round(dewPointTodayC * 9 / 5 + 32); if(SelectedTempUnit === 'fahrenheit'){ document.getElementById('high_temp').innerHTML = celsiusToFahrenheit(today_max_temp_celsius) + '°'; document.getElementById('low_temp').innerHTML = celsiusToFahrenheit(today_min_temp_celsius) + '°'; + document.getElementById('dew_percentage').innerHTML = dewPointTodayF + '°'; } else{ document.getElementById('high_temp').innerHTML = Math.round(today_max_temp_celsius) + '°'; document.getElementById('low_temp').innerHTML = Math.round(today_min_temp_celsius) + '°'; + document.getElementById('dew_percentage').innerHTML = dewPointTodayC + '°'; + } hideLoader() diff --git a/app/src/main/assets/app/renderForecastPage.js b/app/src/main/assets/app/renderForecastPage.js new file mode 100644 index 000000000..2d243a5e3 --- /dev/null +++ b/app/src/main/assets/app/renderForecastPage.js @@ -0,0 +1,444 @@ +const SelectedTempUnit = localStorage.getItem('SelectedTempUnit'); +const SelectedWindUnit = localStorage.getItem('SelectedWindUnit'); + + + +const apiOne = 'dd1571a8ad3fd44555e8a5d66db01929'; + +function getDailyForecast(latitude, longitude) { + + + const apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&appid=${apiOne}&units=metric`; + + fetch(apiUrl) + .then(response => response.json()) + .then(data => { + const dailyForecast = data.daily; + displayDailyForecast(dailyForecast); + }) + .catch(error => console.error('Error fetching daily forecast:', error)); + +} + +function displayDailyForecast(dailyForecast) { + const forecastContainer = document.getElementById('foreCastList'); + forecastContainer.innerHTML = ''; + + const today = new Date(); + today.setHours(0, 0, 0, 0); + + dailyForecast.forEach((forecast, index) => { + + if (index === 0) return; // Skip the current day + + const timestamp = new Date(forecast.dt * 1000); + if (timestamp.getDate() === today.getDate()) return; + + const date = timestamp.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }); + + + const description = forecast.weather[0].description; + let iconCode = forecast.weather[0].icon; + const tempMax = Math.round(forecast.temp.max); + const tempMIN = Math.round(forecast.temp.min); + + const tempMaxF = Math.round(tempMax * 9 / 5 + 32); + + const rainPercentage = Math.round(forecast.pop * 100)|| '0'; + const tempMINF = Math.round(tempMIN * 9 / 5 + 32); + const rainMM = forecast.rain || '0.0'; + const pressure = forecast.pressure + const humidity = forecast.humidity + const cloudCover = forecast.clouds + const dewPoint = Math.round(forecast.dew_point) + const dewPointF = Math.round(dewPoint * 9 / 5 + 32); + const windspeedKmh = Math.round(forecast.wind_speed); + const windSpeedMph = Math.round(forecast.wind_speed * 2.23694); + + const uvIndex = Math.round(forecast.uvi) + + let UVindexText; + + if (uvIndex >= 0 && uvIndex <= 1) { + UVindexText = 'Minimal'; + } else if (uvIndex > 1 && uvIndex <= 2) { + UVindexText = 'Low'; + + } else if (uvIndex > 2 && uvIndex <= 3) { + UVindexText = 'Low'; + + } else if (uvIndex > 3 && uvIndex <= 4) { + UVindexText = 'Moderate'; + + } else if (uvIndex > 4 && uvIndex <= 5) { + UVindexText = 'Moderate'; + + } else if (uvIndex > 5 && uvIndex <= 6) { + UVindexText = 'Moderate'; + + } else if (uvIndex > 6 && uvIndex <= 7) { + UVindexText = 'High'; + + } else if (uvIndex > 7 && uvIndex <= 8) { + UVindexText = 'High'; + + } else if (uvIndex > 8 && uvIndex <= 9) { + UVindexText = 'Very high'; + + } else if (uvIndex > 9 && uvIndex <= 10) { + UVindexText = 'Very high'; + + } else if (uvIndex > 10 && uvIndex <= 11) { + UVindexText = 'Very high'; + + } else if (uvIndex > 11 && uvIndex <= 12) { + UVindexText = 'Extreme'; + + } else if (uvIndex > 12 && uvIndex <= 13) { + UVindexText = 'Extreme'; + + } else if (uvIndex > 13) { + UVindexText = 'Extreme'; + } + + iconCode = iconCode.replace('n', 'd'); + + const forecastItem = document.createElement('div'); + forecastItem.classList.add('forecast-list-item'); + + let colorStyle; + + if(iconCode === '01d'){ + colorStyle = '--weather-color: #375aa3;'; + } else if(iconCode === '02d' ){ + colorStyle = '--weather-color: #5b606b;'; + } else if(iconCode === '03d' || iconCode === '04d'){ + colorStyle = '--weather-color: #555b69;'; + } else if(iconCode === '09d' || iconCode === '10d'){ + colorStyle = '--weather-color: #33415e;'; + } else if(iconCode === '11d'){ + colorStyle = '--weather-color: #383147;' + } else if(iconCode === '13d'){ + colorStyle === '--weather-color: #41465f;' + } else if(iconCode === '50d'){ + colorStyle === '--weather-color: #352603;' + } + + + // create forecast-details + + forecastItem.style = colorStyle + + + if(SelectedTempUnit === 'fahrenheit' && SelectedWindUnit === 'kilometer'){ + + forecastItem.innerHTML = ` +
+
+

${date}

+ ${description}
+ +
+ +
+
+ +
+

${tempMaxF}° / ${tempMINF}°

+
+ +
+ +
+ +
+ Precipitation chances + +

${rainPercentage}%

+
+ +
+ Precipitation amount + +

${rainMM} mm

+
+ +
+ Wind speed + +

${windspeedKmh} km/h

+
+ +
+ Pressure + +

${pressure} hPa

+
+ +
+ Cloud cover + +

${cloudCover}%

+
+ + +
+ Humidity + +

${humidity}%

+
+ +
+ Dew point + +

${dewPointF}°

+
+ +
+ UV index + +

${uvIndex} ${UVindexText}

+
+ +
+ +
+ + ` + } else if(SelectedWindUnit === 'mile' && SelectedTempUnit === 'celsius'){ + forecastItem.innerHTML = ` +
+
+

${date}

+ ${description}
+ +
+ +
+
+ +
+

${tempMax}° / ${tempMIN}°

+
+ +
+ +
+ +
+ Precipitation chances + +

${rainPercentage}%

+
+ +
+ Precipitation amount + +

${rainMM} mm

+
+ +
+ Wind speed + +

${windSpeedMph} mph

+
+ +
+ Pressure + +

${pressure} hPa

+
+ +
+ Cloud cover + +

${cloudCover}%

+
+ + +
+ Humidity + +

${humidity}%

+
+ +
+ Dew point + +

${dewPoint}°

+
+ +
+ UV index + +

${uvIndex} ${UVindexText}

+
+ +
+ +
+ + ` + } else if(SelectedWindUnit === 'mile' && SelectedTempUnit === 'fahrenheit'){ + forecastItem.innerHTML = ` +
+
+

${date}

+ ${description}
+ +
+ +
+
+ +
+

${tempMaxF}° / ${tempMINF}°

+
+ +
+ +
+ +
+ Precipitation chances + +

${rainPercentage}%

+
+ +
+ Precipitation amount + +

${rainMM} mm

+
+ +
+ Wind speed + +

${windSpeedMph} mph

+
+ +
+ Pressure + +

${pressure} hPa

+
+ +
+ Cloud cover + +

${cloudCover}%

+
+ + +
+ Humidity + +

${humidity}%

+
+ +
+ Dew point + +

${dewPointF}°

+
+ +
+ UV index + +

${uvIndex} ${UVindexText}

+
+ +
+ +
+ + ` + } else{ + forecastItem.innerHTML = ` +
+
+

${date}

+ ${description}
+ +
+ +
+
+ +
+

${tempMax}° / ${tempMIN}°

+
+ +
+ +
+ +
+ Precipitation chances + +

${rainPercentage}%

+
+ +
+ Precipitation amount + +

${rainMM} mm

+
+ +
+ Wind speed + +

${windspeedKmh} km/h

+
+ +
+ Pressure + +

${pressure} hPa

+
+ +
+ Cloud cover + +

${cloudCover}%

+
+ + +
+ Humidity + +

${humidity}%

+
+ +
+ Dew point + +

${dewPoint}°

+
+ +
+ UV index + +

${uvIndex} ${UVindexText}

+
+ +
+ +
+ + ` + } + + forecastContainer.appendChild(forecastItem); + }); +} + + + +const latDif = localStorage.getItem('currentLat'); +const longDif = localStorage.getItem('currentLong'); + + +setTimeout(()=>{ + getDailyForecast(latDif, longDif) +}, 1500); diff --git a/app/src/main/assets/index.html b/app/src/main/assets/index.html index f4ca67138..f4934ace9 100644 --- a/app/src/main/assets/index.html +++ b/app/src/main/assets/index.html @@ -94,9 +94,9 @@ - diff --git a/app/src/main/assets/pages/AboutPage.html b/app/src/main/assets/pages/AboutPage.html index 763071354..8459bcf7d 100644 --- a/app/src/main/assets/pages/AboutPage.html +++ b/app/src/main/assets/pages/AboutPage.html @@ -61,7 +61,7 @@ info
Version
-
1.3.3 (W)
+
1.3.4 (W)
diff --git a/app/src/main/assets/pages/forecastPage.html b/app/src/main/assets/pages/forecastPage.html new file mode 100644 index 000000000..bd11192e9 --- /dev/null +++ b/app/src/main/assets/pages/forecastPage.html @@ -0,0 +1,119 @@ + + + + + + + Forecast page + + + + + + + + + + + +
+
+ +

Next 7-Days

+
+
+

Next 7-Days

+
+ +
+ +
+
+ +
+ + + +
+
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/pages/forecastPageUi.css b/app/src/main/assets/pages/forecastPageUi.css new file mode 100644 index 000000000..30d6690f6 --- /dev/null +++ b/app/src/main/assets/pages/forecastPageUi.css @@ -0,0 +1,158 @@ +* { + -webkit-tap-highlight-color: transparent; + user-select: none; + touch-action: manipulation; + -webkit-user-drag: none; + outline: none; +} + +p{ + margin: 0; +} + +body { + background-color: var(--Surface); + padding: 0; + margin: 0; + overflow: hidden; + font-family: var(--outfit); + animation: opacity 0.3s ease-out; + +} + +@keyframes opacity{ + 0%{ + opacity: 0; + } + 100%{ + opacity: 1; + } +} + + +.activity-large-content::before { + position: fixed; + bottom: 0; + content: ''; + width: 100%; + background: linear-gradient(0deg, var(--Surface) 10%, rgba(255, 0, 0, 0)); + height: 30px; + z-index: 1; +} + + + +.loader_holder{ + display: flex; + align-items: center; + justify-content: center; + margin-top: 130px; + --md-circular-progress-size: 55px; +} + + +#foreCastList .forecast-list-item{ + animation: forecast-list-item 0.3s ease-in; + padding: 15px; + /* background-color: var(--Surface-Container-Low); */ + background: linear-gradient(0deg, var(--Surface-Container-Low) 40%, var(--weather-color)); + border-radius: 5px; + margin-bottom: 5px; + +} + +#foreCastList .forecast-list-item:first-child{ + border-radius:10px 10px 5px 5px; +} + +#foreCastList .forecast-list-item:last-child{ + border-radius:5px 5px 10px 10px ; +} + +#foreCastList{ + padding: 10px; +} + +@keyframes forecast-list-item{ + 0%{ + opacity: 0; + } + 100%{ + opacity: 1; + } +} + + +#foreCastList .forecast-list-item .daily_date_time div p{ + font-size: 30px; + color: White; + padding-bottom: 3px; +} + +#foreCastList .forecast-list-item .daily_date_time div span{ + font-size: 20px; + text-transform: capitalize; +} + +#foreCastList .forecast-list-item .daily_date_time{ + display: flex; + align-items: center; + justify-content: space-between; +} + +#foreCastList .forecast-list-item .daily_date_time div img{ + width: 60px; + height: 60px; +} + +#foreCastList .forecast-list-item .temp_min_max{ + font-size: 34px; + font-family: Arial, Helvetica, sans-serif; + margin-top: 20px; + color: var(--On-Surface); + margin-bottom: 20px; +} + +#foreCastList .forecast-list-item .temp_min_max p span{ + opacity: 0.8; +} + +#foreCastList .forecast-list-item .daily_details .details_daily_items{ + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 5px; +} + +#foreCastList .forecast-list-item .daily_details .details_daily_items .daily_detail_item{ + background-color: rgba(0, 0, 0, 0.308); + padding: 10px; + border-radius: 10px; +} + +#foreCastList .forecast-list-item .daily_details .details_daily_items .daily_detail_item span{ + color: var(--On-Surface-Variant); + font-size: 15px; + margin-bottom: 10px; + border-bottom: 1px solid var(--Outline-Variant); + display: block; + padding-bottom: 4px; +} + +#foreCastList .forecast-list-item .daily_details .details_daily_items .daily_detail_item p{ + color: White; + font-size: 18px; +} + +#foreCastList .forecast-list-item .daily_details .details_daily_items .daily_detail_item i{ + display: flex; + align-items: center; + padding-bottom: 10px; + justify-content: center; + color: var(--Secondary); + font-size: 30px; + height: 40px; +} + +#foreCastList .forecast-list-item .daily_details .details_daily_items .daily_detail_item i img{ + width: 35px; +} \ No newline at end of file diff --git a/app/src/main/assets/ui-files/ui.css b/app/src/main/assets/ui-files/ui.css index ba5f7107f..b2ee7b957 100644 --- a/app/src/main/assets/ui-files/ui.css +++ b/app/src/main/assets/ui-files/ui.css @@ -229,7 +229,7 @@ touch_search{ font-weight: 500; } -.main-weat .rain_per{ +.main-weat .dew_per{ position: absolute; right: 10px; bottom: 10px; @@ -241,11 +241,11 @@ touch_search{ gap: 4px; } -.main-weat .rain_per p{ +.main-weat .dew_per p{ margin: 0; } -.main-weat .rain_per i{ +.main-weat .dew_per i{ font-size: 20px; } diff --git a/app/src/main/assets/ui-files/variables.css b/app/src/main/assets/ui-files/variables.css index c58ae48f5..3e4d05ba4 100644 --- a/app/src/main/assets/ui-files/variables.css +++ b/app/src/main/assets/ui-files/variables.css @@ -930,6 +930,7 @@ --Shadow: #000000; --caret: #aac7ff; + --Top-bar: 64, 70, 89; } diff --git a/app/src/main/java/com/example/weathermaster/ForecastPage.java b/app/src/main/java/com/example/weathermaster/ForecastPage.java new file mode 100644 index 000000000..f0c86791a --- /dev/null +++ b/app/src/main/java/com/example/weathermaster/ForecastPage.java @@ -0,0 +1,212 @@ +package com.example.weathermaster; + + +import android.animation.ArgbEvaluator; +import android.animation.ObjectAnimator; +import android.annotation.SuppressLint; +import android.content.Intent; +import android.graphics.Color; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.view.View; +import android.view.WindowManager; +import android.webkit.JavascriptInterface; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.ProgressBar; +import android.widget.Toast; + + +import androidx.annotation.RequiresApi; +import androidx.appcompat.app.AppCompatActivity; + +public class ForecastPage extends AppCompatActivity { + + private WebView webview; + + public void onBackPressed() { + super.onBackPressed(); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + + + + setContentView(R.layout.activity_main); + + + + // Webview stuff + webview = findViewById(R.id.webView); + WebSettings webSettings = webview.getSettings(); + webSettings.setJavaScriptEnabled(true); + webSettings.setDomStorageEnabled(true); + webSettings.setAllowFileAccessFromFileURLs(true); + webSettings.setAllowUniversalAccessFromFileURLs(true); + webSettings.setAllowContentAccess(true); + webview.setVerticalScrollBarEnabled(true); + webview.setHorizontalScrollBarEnabled(false); + webview.setOverScrollMode(WebView.OVER_SCROLL_NEVER); + webview.setWebViewClient(new WebViewClientDemo()); + AndroidInterface androidInterface = new AndroidInterface(this); + webview.addJavascriptInterface(androidInterface, "AndroidInterface"); + webview.setBackgroundColor(getResources().getColor(R.color.mainBG)); + + webview.loadUrl("file:///android_asset/pages/forecastPage.html"); + + } + + + + + public class AndroidInterface { + private ForecastPage aActivity; + + AndroidInterface(ForecastPage activity) { + aActivity = activity; + } + + @JavascriptInterface + public void updateStatusBarColor(final String color) { + aActivity.runOnUiThread(new Runnable() { + @SuppressLint("ResourceType") + @RequiresApi(api = Build.VERSION_CODES.O) + @Override + public void run() { + int statusBarColor; + int navigationBarColor; + int systemUiVisibilityFlags = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; + + + if(color.equals("Scrolled")){ + statusBarColor = 0xFF1e2024; + navigationBarColor = 0xFF121317; + systemUiVisibilityFlags = 0; + + } else if (color.equals("ScrollFalse")) { + statusBarColor = 0xFF121317; + navigationBarColor = 0xFF121317; + systemUiVisibilityFlags = 0; + + } else if (color.equals("GoBack")){ + back(); + return; + } else if (color.equals("OpenTermsConditions")){ + + return; + } else if (color.equals("OpenPrivacyPolicy")){ + + return; + } else if (color.equals("OpenLicenses")){ + + return; + + } else if (color.equals("bluesetDef")) { + + return; + } else if (color.equals("keepiton")) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + return; + } else if (color.equals("keepitoff")) { + getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + return; + } else if (color.equals("itsOn")) { + Toast.makeText(aActivity, "Your device will stay awake", Toast.LENGTH_SHORT).show(); + return; + } else if (color.equals("ItsOff")) { + Toast.makeText(aActivity, "Your device will go to sleep at the default time", Toast.LENGTH_SHORT).show(); + return; + + + } else { + Toast.makeText(aActivity, "not found", Toast.LENGTH_SHORT).show(); + return; + } + + + int currentStatusBarColor = aActivity.getWindow().getStatusBarColor(); + int currentNavigationBarColor = aActivity.getWindow().getNavigationBarColor(); + + ObjectAnimator statusBarAnimator = ObjectAnimator.ofObject( + aActivity.getWindow(), + "statusBarColor", + new ArgbEvaluator(), + currentStatusBarColor, + statusBarColor + ); + + statusBarAnimator.setDuration(200); + statusBarAnimator.start(); + + ObjectAnimator navBarAnimator = ObjectAnimator.ofObject( + aActivity.getWindow(), + "navigationBarColor", + new ArgbEvaluator(), + currentNavigationBarColor, + navigationBarColor + ); + + navBarAnimator.setDuration(200); + navBarAnimator.start(); + + aActivity.getWindow().setNavigationBarColor(navigationBarColor); + + View decorView = aActivity.getWindow().getDecorView(); + decorView.setSystemUiVisibility(systemUiVisibilityFlags); + + + } + }); + } + + + + } + + public void back() { + onBackPressed(); + } + + + + private static class WebViewClientDemo extends WebViewClient { + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (shouldOpenInBrowser(url)) { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + view.getContext().startActivity(intent); + return true; + + } else { + view.loadUrl(url); + return true; + + + } + + + } + + private boolean shouldOpenInBrowser(String url) { + return url.startsWith("https://fonts.google.com/specimen/Outfit?query=outfit") || + url.startsWith("https://openweathermap.org/") || + url.startsWith("https://fonts.google.com/specimen/Poppins?query=poppins") || + url.startsWith("https://github.com/material-components/material-web") || + url.startsWith("https://app-privacy-policy-generator.nisrulz.com/") || + url.startsWith("https://github.com/PranshulGG/WeatherMaster") || + url.startsWith("mailto:pranshul.devmain@gmail.com")|| + url.startsWith("https://github.com/PranshulGG/WeatherMaster/releases"); + + + } + + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/weathermaster/MainActivity.java b/app/src/main/java/com/example/weathermaster/MainActivity.java index ab3055e6a..07074c4cf 100644 --- a/app/src/main/java/com/example/weathermaster/MainActivity.java +++ b/app/src/main/java/com/example/weathermaster/MainActivity.java @@ -349,7 +349,9 @@ public class MainActivity extends AppCompatActivity { } else if (color.equals("OpenSettings")){ openSettingsActivity(); return; - + } else if (color.equals("Open8Forecast")){ + openForecastPage(); + return; } else if (color.equals("GoBack")){ back(); return; @@ -417,6 +419,11 @@ public class MainActivity extends AppCompatActivity { mActivity.startActivity(intent); } + public void openForecastPage(){ + Intent intent = new Intent(mActivity, ForecastPage.class); + mActivity.startActivity(intent); + } + } public void back() {