├── .idea ├── .name ├── .gitignore ├── compiler.xml ├── kotlinc.xml ├── vcs.xml ├── migrations.xml ├── misc.xml ├── deploymentTargetSelector.xml ├── gradle.xml └── appInsightsSettings.xml ├── app ├── .gitignore ├── google-services.json ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── heart.png │ │ │ │ ├── logo.jpeg │ │ │ │ ├── splash.png │ │ │ │ ├── ellipse1.png │ │ │ │ ├── ellipse2.png │ │ │ │ ├── settings.png │ │ │ │ ├── shareimg.png │ │ │ │ ├── collaborate.png │ │ │ │ ├── button_background_outline.xml │ │ │ │ ├── rectangular_edit_text.xml │ │ │ │ ├── broken_image.xml │ │ │ │ ├── rounded_edittext.xml │ │ │ │ ├── ic_dark_mood.xml │ │ │ │ ├── ic_search.xml │ │ │ │ ├── ic_calender.xml │ │ │ │ ├── ic_share.xml │ │ │ │ ├── background_night.xml │ │ │ │ ├── brush_background.xml │ │ │ │ ├── background_light.xml │ │ │ │ ├── ic_light_mood.xml │ │ │ │ ├── ic_launcher_foreground.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── anim │ │ │ │ ├── fade_in.xml │ │ │ │ ├── slide_in_left.xml │ │ │ │ ├── enter_from_right.xml │ │ │ │ ├── exit_to_left.xml │ │ │ │ ├── top_animation.xml │ │ │ │ ├── bottom_animation.xml │ │ │ │ ├── exit_animation.xml │ │ │ │ └── img_enter_animation.xml │ │ │ ├── values │ │ │ │ ├── preloaded_fonts.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── themes.xml │ │ │ │ ├── font_certs.xml │ │ │ │ └── strings.xml │ │ │ ├── font │ │ │ │ ├── abeezee.xml │ │ │ │ ├── poppins.xml │ │ │ │ ├── poppins_bold.xml │ │ │ │ └── poppins_thin.xml │ │ │ ├── xml │ │ │ │ ├── backup_rules.xml │ │ │ │ └── data_extraction_rules.xml │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ ├── layout │ │ │ │ ├── slide3.xml │ │ │ │ ├── fragment_no_news.xml │ │ │ │ ├── slide2.xml │ │ │ │ ├── slide1.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_splash.xml │ │ │ │ ├── activity_sign_in.xml │ │ │ │ ├── artical_list_item.xml │ │ │ │ ├── activity_slider.xml │ │ │ │ ├── activity_signup.xml │ │ │ │ ├── activity_settings.xml │ │ │ │ ├── activity_setting_api.xml │ │ │ │ └── fragment_search.xml │ │ │ └── values-ar │ │ │ │ └── strings.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── whatnow │ │ │ │ ├── core │ │ │ │ ├── data │ │ │ │ │ ├── SortBy.kt │ │ │ │ │ ├── Categories.kt │ │ │ │ │ ├── Languages.kt │ │ │ │ │ └── Countries.kt │ │ │ │ ├── api │ │ │ │ │ ├── RetrofitFactory.kt │ │ │ │ │ ├── DefaultRetrofitFactory.kt │ │ │ │ │ └── APIBuilder.kt │ │ │ │ └── ui │ │ │ │ │ ├── SplashActivity.kt │ │ │ │ │ ├── onboarding.kt │ │ │ │ │ └── MainActivity.kt │ │ │ │ ├── news │ │ │ │ ├── data │ │ │ │ │ ├── NewsCallable.kt │ │ │ │ │ ├── News.kt │ │ │ │ │ ├── NewsRepository.kt │ │ │ │ │ └── NewsManager.kt │ │ │ │ └── ui │ │ │ │ │ ├── NoNewsFragment.kt │ │ │ │ │ ├── NewsAdapter.kt │ │ │ │ │ └── SearchFragment.kt │ │ │ │ ├── auth │ │ │ │ ├── AuthViewModelFactory.kt │ │ │ │ ├── UserRepository.kt │ │ │ │ ├── AuthViewModel.kt │ │ │ │ ├── SignupActivity.kt │ │ │ │ └── SignInActivity.kt │ │ │ │ └── setteings │ │ │ │ ├── data │ │ │ │ └── SettingAPI.kt │ │ │ │ └── ui │ │ │ │ └── SettingsActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── whatnow │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── whatnow │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle.kts ├── screenshots ├── login.png ├── settingAPI.png └── searchforNews.png ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── libs.versions.toml ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /.idea/.name: -------------------------------------------------------------------------------- 1 | What Now! -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | google-services.json -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | replace this file with your own file from firebase.google.com 2 | -------------------------------------------------------------------------------- /screenshots/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/screenshots/login.png -------------------------------------------------------------------------------- /screenshots/settingAPI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/screenshots/settingAPI.png -------------------------------------------------------------------------------- /screenshots/searchforNews.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/screenshots/searchforNews.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/heart.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/logo.jpeg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/splash.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ellipse1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/ellipse1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ellipse2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/ellipse2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/shareimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/shareimg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/collaborate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xSA7/What-Now-NewsApp/HEAD/app/src/main/res/drawable/collaborate.png -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/core/data/SortBy.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.core.data 2 | 3 | enum class SortBy(val value: String) { 4 | RELEVANCY("relevancy"), 5 | POPULARITY("popularity"), 6 | PUBLISHED_AT("publishedAt"), 7 | None(""); 8 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/core/api/RetrofitFactory.kt: -------------------------------------------------------------------------------- 1 | // File: app/src/main/java/com/example/whatnow/api/RetrofitFactory.kt 2 | package com.example.whatnow.core.api 3 | 4 | import retrofit2.Retrofit 5 | 6 | interface RetrofitFactory { 7 | fun createRetrofit(): Retrofit 8 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/enter_from_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/exit_to_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 28 22:50:28 EEST 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/news/data/NewsCallable.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.news.data 2 | 3 | import retrofit2.Call 4 | import retrofit2.http.GET 5 | import retrofit2.http.Url 6 | 7 | interface NewsCallable { 8 | @GET 9 | fun getNews(@Url url: String): Call 10 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .idea 15 | .cxx 16 | local.properties 17 | -------------------------------------------------------------------------------- /.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/news/data/News.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.news.data 2 | 3 | 4 | data class News( 5 | val articles: ArrayList, 6 | val totalResults: Int = articles.size 7 | ) 8 | 9 | data class Articles( 10 | val title: String, 11 | val url: String, 12 | val urlToImage: String 13 | 14 | ) 15 | -------------------------------------------------------------------------------- /app/src/main/res/values/preloaded_fonts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @font/abeezee 5 | @font/poppins 6 | @font/poppins_bold 7 | @font/poppins_thin 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_background_outline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/font/abeezee.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/poppins.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/top_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/font/poppins_bold.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/poppins_thin.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/bottom_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/whatnow/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/exit_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/anim/img_enter_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rectangular_edit_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/broken_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_edittext.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/news/data/NewsRepository.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.news.data 2 | 3 | import com.example.whatnow.core.api.RetrofitFactory 4 | 5 | class NewsRepository(private val retrofitFactory: RetrofitFactory) { 6 | 7 | private val newsCallable: NewsCallable 8 | 9 | init { 10 | val retrofit = retrofitFactory.createRetrofit() 11 | newsCallable = retrofit.create(NewsCallable::class.java) 12 | } 13 | 14 | fun getNews(queryUrl: String) = newsCallable.getNews(queryUrl) 15 | } -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dark_mood.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF000000 4 | #808080 5 | #FFFFFFFF 6 | #87CEEB 7 | #ADD8E6 8 | 9 | 10 | //onboarding colors 11 | #F0F4F3 12 | #50C2C9 13 | 14 | //indicator color 15 | #C4C4C4 16 | #50C2C9 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_calender.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/core/api/DefaultRetrofitFactory.kt: -------------------------------------------------------------------------------- 1 | // File: app/src/main/java/com/example/whatnow/api/DefaultRetrofitFactory.kt 2 | package com.example.whatnow.core.api 3 | 4 | import com.example.whatnow.BuildConfig 5 | import retrofit2.Retrofit 6 | import retrofit2.converter.gson.GsonConverterFactory 7 | 8 | class DefaultRetrofitFactory : RetrofitFactory { 9 | override fun createRetrofit(): Retrofit { 10 | return Retrofit.Builder() 11 | .baseUrl(BuildConfig.API_baseUrl) 12 | .addConverterFactory(GsonConverterFactory.create()) 13 | .build() 14 | } 15 | } -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google { 4 | content { 5 | includeGroupByRegex("com\\.android.*") 6 | includeGroupByRegex("com\\.google.*") 7 | includeGroupByRegex("androidx.*") 8 | } 9 | } 10 | mavenCentral() 11 | gradlePluginPortal() 12 | } 13 | } 14 | dependencyResolutionManagement { 15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | rootProject.name = "What Now!" 23 | include(":app") 24 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/auth/AuthViewModelFactory.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.auth 2 | 3 | import androidx.lifecycle.ViewModel 4 | import androidx.lifecycle.ViewModelProvider 5 | import com.example.whatnow.auth.UserRepository 6 | 7 | // Factory class for creating AuthViewModel instances 8 | class AuthViewModelFactory(private val repository: UserRepository) : ViewModelProvider.Factory { 9 | @Suppress("UNCHECKED_CAST") 10 | override fun create(modelClass: Class): T { 11 | if (modelClass.isAssignableFrom(AuthViewModel::class.java)) { 12 | return AuthViewModel(repository) as T 13 | } 14 | throw IllegalArgumentException("Unknown ViewModel class") 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.idea/deploymentTargetSelector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/core/data/Categories.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.core.data 2 | 3 | enum class Categories(val code: String) { 4 | BUSINESS("business"), 5 | ENTERTAINMENT("entertainment"), 6 | GENERAL("general"), 7 | HEALTH("health"), 8 | SCIENCE("science"), 9 | SPORTS("sports"), 10 | TECHNOLOGY("technology"), 11 | None(""); 12 | companion object{ 13 | fun returnAsEnum(toBeReturnedAsEnum: String): Categories { 14 | for (category in entries) { 15 | if (category.toString() == toBeReturnedAsEnum) { 16 | return category 17 | 18 | } 19 | } 20 | return None 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/whatnow/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.example.whatnow", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/core/data/Languages.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.core.data 2 | 3 | 4 | enum class Languages(val code: String) { 5 | Arabic("ar"), 6 | German("de"), 7 | English("en"), 8 | Spanish("es"), 9 | French("fr"), 10 | Italian("it"), 11 | Dutch("nl"), 12 | Norwegian("no"), 13 | Portuguese("pt"), 14 | Russian("ru"), 15 | Swedish("sv"), 16 | Urdu("ud"), 17 | Chinese("zh"), 18 | None(""); 19 | 20 | companion object { 21 | fun returnAsEnum(toBeReturnedAsEnum: String): Languages { 22 | for (Language in Languages.entries) { 23 | if (Language.toString() == toBeReturnedAsEnum) { 24 | return Language 25 | 26 | } 27 | } 28 | return None 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_night.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/brush_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_light.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/core/data/Countries.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.core.data 2 | 3 | enum class Countries(val code: String) { 4 | ARGENTINA("ar"), 5 | AUSTRALIA("au"), 6 | AUSTRIA("at"), 7 | BELGIUM("be"), 8 | BRAZIL("br"), 9 | CANADA("ca"), 10 | CHINA("cn"), 11 | EGYPT("eg"), 12 | GERMANY("de"), 13 | HUNGARY("hu"), 14 | ITALY("it"), 15 | JAPAN("jp"), 16 | MALAYSIA("my"), 17 | MOROCCO("ma"), 18 | NORWAY("no"), 19 | POLAND("pl"), 20 | RUSSIA("ru"), 21 | SAUDI_ARABIA("sa"), 22 | SINGAPORE("sg"), 23 | SWITZERLAND("ch"), 24 | TURKEY("tr"), 25 | UAE("ae"), 26 | UNITED_KINGDOM("gb"), 27 | US("us"), 28 | None(""); 29 | companion object{ 30 | fun returnAsEnum(toBeReturnedAsEnum: String): Countries { 31 | for (country in entries) { 32 | if (country.toString() == toBeReturnedAsEnum) { 33 | return country 34 | 35 | } 36 | } 37 | return None 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | @color/black 17 | 18 | 19 | 23 | 24 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 17 | 18 | @color/white 19 | 20 | 24 | 25 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_light_mood.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/appInsightsSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 29 | 30 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. For more details, visit 12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /app/src/main/java/com/example/whatnow/news/ui/NoNewsFragment.kt: -------------------------------------------------------------------------------- 1 | package com.example.whatnow.news.ui 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import androidx.fragment.app.Fragment 9 | import com.example.whatnow.core.ui.MainActivity 10 | import com.example.whatnow.databinding.FragmentNoNewsBinding 11 | 12 | class NoNewsFragment : Fragment() { 13 | 14 | private var _binding: FragmentNoNewsBinding? = null 15 | private val binding get() = _binding!! 16 | 17 | override fun onCreateView( 18 | inflater: LayoutInflater, container: ViewGroup?, 19 | savedInstanceState: Bundle? 20 | ): View? { 21 | // Inflate the layout using view binding 22 | _binding = FragmentNoNewsBinding.inflate(inflater, container, false) 23 | 24 | setupUI() 25 | 26 | return binding.root 27 | } 28 | 29 | private fun setupUI() { 30 | binding.tryAgainBtn.setOnClickListener { 31 | requireActivity().supportFragmentManager.popBackStack() 32 | val intent = Intent(requireContext(), MainActivity::class.java) 33 | intent.putExtra("openSearchFragment", true) 34 | startActivity(intent) 35 | requireActivity().finish() 36 | } 37 | } 38 | 39 | override fun onDestroyView() { 40 | super.onDestroyView() 41 | _binding = null 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/slide3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 26 | 27 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_no_news.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 19 | 27 | 28 |