diff --git a/README.md b/README.md new file mode 100644 index 0000000..cddaf23 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# Gamastik-Android + + + +## Structure + +* `build.gradle` - root gradle config file +* `settings.gradle` - root gradle settings file +* `app` - our only project in this repo +* `app/build.gradle` - project gradle config file +* `app/src` - main project source directory +* `app/src/main` - main project flavour +* `app/src/main/AndroidManifest.xml` - manifest file +* `app/src/main/java` - java source directory +* `app/src/main/res` - resources directory + +## Building + +It is recommended that you run Gradle with the `--daemon` option, as starting +up the tool from scratch often takes at least a few seconds. You can kill the +java process that it leaves running once you are done running your commands. + +Tasks work much like Make targets, so you may concatenate them. Tasks are not +re-done if multiple targets in a single command require them. For example, +running `assemble install` will not compile the apk twice even though +`install` depends on `assemble`. + +#### Clean + + gradle clean + +#### Debug + +This compiles a debugging apk in `build/outputs/apk/` signed with a debug key, +ready to be installed for testing purposes. + + gradle assembleDebug + +You can also install it on your attached device: + + gradle installDebug + +#### Release + +This compiles an unsigned release (non-debugging) apk in `build/outputs/apk/`. +It's not signed, you must sign it before it can be installed by any users. + + gradle assembleRelease + +#### Test + +Were you to add automated java tests, you could configure them in your +`build.gradle` file and run them within gradle as well. + + gradle test + +#### Lint + +This analyses the code and produces reports containing warnings about your +application in `build/outputs/lint/`. + + gradle lint diff --git a/app/build.gradle b/app/build.gradle index 94c7729..38b7663 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,13 +27,17 @@ android { versionCode 1 versionName "1.0.0-alpha" buildConfigField "String", "DEBUG_URL", "\"https://capstone-b21-cap026.herokuapp.com/api/\"" - buildConfigField "String", "BASE_URL", "\"http://35.187.255.90/api/\"" + buildConfigField "String", "BASE_URL", "\"https://batik-api-qs6wradroq-et.a.run.app/api/\"" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { - minifyEnabled false + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + debug { + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -103,7 +107,7 @@ dependencies { implementation "androidx.camera:camera-lifecycle:$camerax_version" implementation "androidx.camera:camera-view:1.0.0-alpha24" - testImplementation 'junit:junit:4.+' + testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' } \ No newline at end of file diff --git a/app/debug/app-debug.apk b/app/debug/gamastik-debug.apk similarity index 73% rename from app/debug/app-debug.apk rename to app/debug/gamastik-debug.apk index 6eff2b3..0ebca59 100644 Binary files a/app/debug/app-debug.apk and b/app/debug/gamastik-debug.apk differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb43..2789b34 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,77 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +##---------------Begin: proguard configuration for Gson ---------- +# Gson uses generic type information stored in a class file when working with fields. Proguard +# removes such information by default, so configure it to keep all of it. +-keepattributes Signature + +# For using GSON @Expose annotation +-keepattributes *Annotation* + +# Gson specific classes +-dontwarn sun.misc.** +#-keep class com.google.gson.stream.** { *; } + +# Application classes that will be serialized/deserialized over Gson +-keep class com.google.gson.examples.android.model.** { ; } + +# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * extends com.google.gson.TypeAdapter +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer + +# Prevent R8 from leaving Data object members always null +-keepclassmembers,allowobfuscation class * { + @com.google.gson.annotations.SerializedName ; +} + +##---------------Begin: proguard configuration for Retrofit ---------- +# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and +# EnclosingMethod is required to use InnerClasses. +-keepattributes Signature, InnerClasses, EnclosingMethod + +# Retrofit does reflection on method and parameter annotations. +-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations + +# Retain service method parameters when optimizing. +-keepclassmembers,allowshrinking,allowobfuscation interface * { + @retrofit2.http.* ; +} + +# Ignore annotation used for build tooling. +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement + +# Ignore JSR 305 annotations for embedding nullability information. +-dontwarn javax.annotation.** + +# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath. +-dontwarn kotlin.Unit + +# Top-level functions that can only be used by Kotlin. +-dontwarn retrofit2.KotlinExtensions +-dontwarn retrofit2.KotlinExtensions$* + +# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy +# and replaces all potential values with null. Explicitly keeping the interfaces prevents this. +-if interface * { @retrofit2.http.* ; } +-keep,allowobfuscation interface <1> + +-dontwarn kotlinx.** + +##---------------Begin: proguard configuration for Glide ---------- +-keep public class * implements com.bumptech.glide.module.GlideModule +-keep class * extends com.bumptech.glide.module.AppGlideModule { + (...); +} +-keep public enum com.bumptech.glide.load.ImageHeaderParser$** { + **[] $VALUES; + public *; +} +-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder { + *** rewind(); +} diff --git a/app/release/app-release.apk b/app/release/app-release.apk deleted file mode 100644 index 361a63a..0000000 Binary files a/app/release/app-release.apk and /dev/null differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8ce3108..97d0829 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -16,8 +17,10 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Gamastik" - android:usesCleartextTraffic="true"> - + android:usesCleartextTraffic="true" + android:fullBackupContent="@xml/backup_descriptor" + tools:ignore="UnusedAttribute"> + diff --git a/app/src/main/java/com/bangkit/gamastik/data/local/PrefererencesHelper.kt b/app/src/main/java/com/bangkit/gamastik/data/local/PrefererencesHelper.kt index 8822d49..2c96bbe 100755 --- a/app/src/main/java/com/bangkit/gamastik/data/local/PrefererencesHelper.kt +++ b/app/src/main/java/com/bangkit/gamastik/data/local/PrefererencesHelper.kt @@ -36,7 +36,7 @@ constructor(@ApplicationContext context: Context) { } fun getUserName(): String? { - return preferences.getString(NAME, "") + return preferences.getString(NAME, null) } diff --git a/app/src/main/java/com/bangkit/gamastik/data/model/batik/byregion/BatikByRegionResponse.kt b/app/src/main/java/com/bangkit/gamastik/data/model/batik/byregion/BatikByRegionResponse.kt index 2806a7b..6aa8e08 100644 --- a/app/src/main/java/com/bangkit/gamastik/data/model/batik/byregion/BatikByRegionResponse.kt +++ b/app/src/main/java/com/bangkit/gamastik/data/model/batik/byregion/BatikByRegionResponse.kt @@ -1,4 +1,4 @@ -package com.bangkit.gamastik.data.model.batik +package com.bangkit.gamastik.data.model.batik.byregion import android.os.Parcelable import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/com/bangkit/gamastik/data/remote/AppService.kt b/app/src/main/java/com/bangkit/gamastik/data/remote/AppService.kt index d70f066..f60b9ba 100644 --- a/app/src/main/java/com/bangkit/gamastik/data/remote/AppService.kt +++ b/app/src/main/java/com/bangkit/gamastik/data/remote/AppService.kt @@ -8,7 +8,7 @@ import com.bangkit.gamastik.data.model.auth.logout.LogoutResponse import com.bangkit.gamastik.data.model.auth.profile.ProfileResponse import com.bangkit.gamastik.data.model.auth.register.RegisterRequest import com.bangkit.gamastik.data.model.auth.register.RegisterResponse -import com.bangkit.gamastik.data.model.batik.BatikByRegionResponse +import com.bangkit.gamastik.data.model.batik.byregion.BatikByRegionResponse import com.bangkit.gamastik.data.model.batik.byregion.BatikByRegionRequest import com.bangkit.gamastik.data.model.batik.detail.BatikDetailResponse import com.bangkit.gamastik.data.model.batik.discovery.BatikDiscoveryResponseItem diff --git a/app/src/main/java/com/bangkit/gamastik/di/AppModule.kt b/app/src/main/java/com/bangkit/gamastik/di/AppModule.kt index fc9e402..774ffd8 100644 --- a/app/src/main/java/com/bangkit/gamastik/di/AppModule.kt +++ b/app/src/main/java/com/bangkit/gamastik/di/AppModule.kt @@ -2,7 +2,6 @@ package com.bangkit.gamastik.di import android.content.Context import com.bangkit.gamastik.BuildConfig.BASE_URL -import com.bangkit.gamastik.BuildConfig.DEBUG_URL import com.bangkit.gamastik.data.local.PreferencesHelper import com.bangkit.gamastik.data.remote.AppService import com.bangkit.gamastik.data.remote.RemoteDataSource @@ -32,7 +31,7 @@ object AppModule { @Singleton @Provides fun provideRetrofit(gson: Gson, client: OkHttpClient): Retrofit = Retrofit.Builder() - .baseUrl(DEBUG_URL) + .baseUrl(BASE_URL) .client(client) .addConverterFactory(GsonConverterFactory.create(gson)) .build() diff --git a/app/src/main/java/com/bangkit/gamastik/ui/base/BaseActivity.kt b/app/src/main/java/com/bangkit/gamastik/ui/base/BaseActivity.kt index 5f8d0f8..8cdb4bb 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/base/BaseActivity.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/base/BaseActivity.kt @@ -20,6 +20,4 @@ open class BaseActivity : AppCompatActivity() { fun getToken() = preferencesHelper.getUserToken() - fun getUserName() = preferencesHelper.getUserName() - } \ No newline at end of file diff --git a/app/src/main/java/com/bangkit/gamastik/ui/base/BaseFragment.kt b/app/src/main/java/com/bangkit/gamastik/ui/base/BaseFragment.kt index 3729dc9..b9fa7c3 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/base/BaseFragment.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/base/BaseFragment.kt @@ -1,6 +1,5 @@ package com.bangkit.gamastik.ui.base -import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import com.bangkit.gamastik.data.local.PreferencesHelper import dagger.hilt.android.AndroidEntryPoint @@ -11,7 +10,7 @@ open class BaseFragment : Fragment() { @Inject lateinit var preferencesHelper: PreferencesHelper - fun setToken(token: String?){ + fun setToken(token: String?) { preferencesHelper.setUserToken(token) } @@ -19,8 +18,6 @@ open class BaseFragment : Fragment() { preferencesHelper.setUserName(name) } - fun getToken() = preferencesHelper.getUserToken() - - fun getUserName() = preferencesHelper.getUserName() + fun getUsername() = preferencesHelper.getUserName() } \ No newline at end of file diff --git a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionActivity.kt b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionActivity.kt index 93a82e2..9217993 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionActivity.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionActivity.kt @@ -7,7 +7,7 @@ import android.widget.Toast import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.GridLayoutManager -import com.bangkit.gamastik.data.model.batik.BatikByRegion +import com.bangkit.gamastik.data.model.batik.byregion.BatikByRegion import com.bangkit.gamastik.data.model.batik.byregion.BatikByRegionRequest import com.bangkit.gamastik.databinding.ActivityBatikByRegionBinding import com.bangkit.gamastik.ui.feature.discovery.batikdetail.BatikDetailActivity diff --git a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionAdapter.kt b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionAdapter.kt index ca18aa9..6e04642 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionAdapter.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionAdapter.kt @@ -5,7 +5,7 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.bangkit.gamastik.R -import com.bangkit.gamastik.data.model.batik.BatikByRegion +import com.bangkit.gamastik.data.model.batik.byregion.BatikByRegion import com.bangkit.gamastik.databinding.ItemListBatikBinding import com.bumptech.glide.Glide diff --git a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionViewModel.kt b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionViewModel.kt index b53d21d..a17a05b 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionViewModel.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/byregion/BatikByRegionViewModel.kt @@ -2,11 +2,8 @@ package com.bangkit.gamastik.ui.feature.discovery.byregion import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel -import com.bangkit.gamastik.data.model.batik.BatikByRegionResponse +import com.bangkit.gamastik.data.model.batik.byregion.BatikByRegionResponse import com.bangkit.gamastik.data.model.batik.byregion.BatikByRegionRequest -import com.bangkit.gamastik.data.model.batik.detail.BatikDetailResponse -import com.bangkit.gamastik.data.model.batik.search.BatikSearchRequest -import com.bangkit.gamastik.data.model.batik.search.BatikSearchResponseItem import com.bangkit.gamastik.data.repository.AppRepository import com.bangkit.gamastik.utils.Resource import dagger.hilt.android.lifecycle.HiltViewModel diff --git a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultActivity.kt b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultActivity.kt index 5046d83..d15ea8c 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultActivity.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultActivity.kt @@ -63,7 +63,7 @@ class SearchResultActivity : BaseActivity(), SearchResultAdapter.ResultItemListe binding.progressBar.visibility = View.GONE val data = it.data if (data != null) { - it.data.let { it -> adapter.setItems(ArrayList(it)) } + it.data.let { it1 -> adapter.setItems(ArrayList(it1)) } } } Resource.Status.ERROR -> { diff --git a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultViewModel.kt b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultViewModel.kt index 03c020d..4f000b9 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultViewModel.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/feature/discovery/searchresult/SearchResultViewModel.kt @@ -2,7 +2,6 @@ package com.bangkit.gamastik.ui.feature.discovery.searchresult import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel -import com.bangkit.gamastik.data.model.batik.detail.BatikDetailResponse import com.bangkit.gamastik.data.model.batik.search.BatikSearchRequest import com.bangkit.gamastik.data.model.batik.search.BatikSearchResponseItem import com.bangkit.gamastik.data.repository.AppRepository diff --git a/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestActivity.kt b/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestActivity.kt index 27d8dfe..05f2c68 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestActivity.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestActivity.kt @@ -3,7 +3,6 @@ package com.bangkit.gamastik.ui.feature.quiz.quiztest import android.content.Intent import android.graphics.Typeface import android.os.Bundle -import android.util.Log import android.view.View import android.widget.TextView import android.widget.Toast diff --git a/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestViewModel.kt b/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestViewModel.kt index 3a8d707..4644dfd 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestViewModel.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/feature/quiz/quiztest/QuizTestViewModel.kt @@ -7,7 +7,7 @@ import javax.inject.Inject @HiltViewModel class QuizTestViewModel @Inject constructor( - private val repository: AppRepository + repository: AppRepository ): ViewModel() { val quizQuestion = repository.getQuizQuestion() diff --git a/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeFragment.kt b/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeFragment.kt index 665bee4..39a5373 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeFragment.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeFragment.kt @@ -24,7 +24,8 @@ import com.bangkit.gamastik.utils.Resource import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint -class HomeFragment : BaseFragment(), HomeAdapter.DiscoveryItemListener, RegionAdapter.RegionItemListener { +class HomeFragment : BaseFragment(), HomeAdapter.DiscoveryItemListener, + RegionAdapter.RegionItemListener { private val homeViewModel: HomeViewModel by viewModels() lateinit var binding: FragmentHomeBinding @@ -43,11 +44,15 @@ class HomeFragment : BaseFragment(), HomeAdapter.DiscoveryItemListener, RegionAd override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) (activity as AppCompatActivity?)?.supportActionBar?.hide() - getUserId() setRecyclerView() getRegionList() getDiscoveryBatik() + if (getUsername().isNullOrBlank()) { + getUserId() + } else { + binding.tvUserName.text = StringBuilder("Hello, ${getUsername()}") + } binding.ivLogout.setOnClickListener { logout() } @@ -73,7 +78,8 @@ class HomeFragment : BaseFragment(), HomeAdapter.DiscoveryItemListener, RegionAd binding.rvBatik.adapter = adapter regionAdapter = RegionAdapter(this) - binding.rvRegion.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) + binding.rvRegion.layoutManager = + LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) binding.rvRegion.setHasFixedSize(true) binding.rvRegion.adapter = regionAdapter } @@ -104,6 +110,7 @@ class HomeFragment : BaseFragment(), HomeAdapter.DiscoveryItemListener, RegionAd binding.progressBar.visibility = View.GONE val data = it.data if (data != null) { + setUserName(data.data?.name) binding.tvUserName.text = StringBuilder("Hello, ${data.data?.name}") } } @@ -124,7 +131,7 @@ class HomeFragment : BaseFragment(), HomeAdapter.DiscoveryItemListener, RegionAd binding.progressBar.visibility = View.GONE val data = it.data if (data != null) { - it.data.let { it -> adapter.setItems(ArrayList(it)) } + it.data.let { it1 -> adapter.setItems(ArrayList(it1)) } } } Resource.Status.ERROR -> { @@ -182,7 +189,7 @@ class HomeFragment : BaseFragment(), HomeAdapter.DiscoveryItemListener, RegionAd override fun onClicked(item: String?) { val intent = Intent(requireContext(), BatikByRegionActivity::class.java) - intent.putExtra(BatikDetailActivity.EXTRA_DATA, item) + intent.putExtra(BatikByRegionActivity.EXTRA_DATA, item) startActivity(intent) } } \ No newline at end of file diff --git a/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeViewModel.kt b/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeViewModel.kt index 4f7f9be..3612f80 100644 --- a/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeViewModel.kt +++ b/app/src/main/java/com/bangkit/gamastik/ui/main/home/HomeViewModel.kt @@ -3,8 +3,6 @@ package com.bangkit.gamastik.ui.main.home import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel import com.bangkit.gamastik.data.model.auth.profile.ProfileResponse -import com.bangkit.gamastik.data.model.batik.search.BatikSearchRequest -import com.bangkit.gamastik.data.model.batik.search.BatikSearchResponseItem import com.bangkit.gamastik.data.repository.AppRepository import com.bangkit.gamastik.utils.Resource import dagger.hilt.android.lifecycle.HiltViewModel diff --git a/app/src/main/java/com/bangkit/gamastik/utils/Constants.kt b/app/src/main/java/com/bangkit/gamastik/utils/Constants.kt deleted file mode 100644 index bec53b5..0000000 --- a/app/src/main/java/com/bangkit/gamastik/utils/Constants.kt +++ /dev/null @@ -1,109 +0,0 @@ -package com.bangkit.gamastik.utils - -import com.bangkit.gamastik.data.model.quiz.Question - -object Constants { - fun getQuestions(): ArrayList { - val questionsList = ArrayList() - - val question1 = Question( - 1, - "Which internet company began life as an online bookstore called 'Cadabra' ?", - "ebay", - "Shopify", - "Amazon", - "Overstock", - "A", - "", - "", - 1 - ) - questionsList.add(question1) - - val question2 = Question( - 1, - "Which of the following languages is used as a scripting language in the Unity 3D game engine?", - "Java", - "C#", - "C++", - "Objective-C", - "B", - "", - "", - 1 - ) - questionsList.add(question2) - - val question3 = Question( - 1, - "Which of these people was NOT a founder of Apple Inc?", - "Jonathan Ive", - "Steve Jobs", - "Ronald Wayne", - "Steve Wozniak", - "A", - "", - "", - 1 - ) - questionsList.add(question3) - - val question4 = Question( - 1, - "What does the term GPU stand for?", - "Graphite Producing Unit", - "Gaming Processor Unit", - "Graphical Proprietary Unit", - "Graphics Processing Unit", - "D", - "", - "", - 1 - ) - questionsList.add(question4) - - val question5 = Question( - 1, - "Moore's law originally stated that the number of transistors on a microprocessor chip would double every...", - "Year", - "Four Years", - "Two Years", - "Eight Years", - "A", - "", - "", - 1 - ) - questionsList.add(question5) - - val question6 = Question( - 1, - "What five letter word is the motto of the IBM Computer company?", - "Click", - "Logic", - "Pixel", - "Think", - "D", - "", - "", - 1 - ) - questionsList.add(question6) - - val question7 = Question( - 1, - "In programming, the ternary operator is mostly defined with what symbol(s)?", - "??", - "if then", - "?:", - "?", - "C", - "", - "", - 1 - ) - questionsList.add(question7) - - return questionsList - } -} \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 2b068d1..0000000 --- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml b/app/src/main/res/drawable/ic_dashboard_black_24dp.xml deleted file mode 100644 index 46fc8de..0000000 --- a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_game.xml b/app/src/main/res/drawable/ic_game.xml index ea77b6c..a11fd3d 100644 --- a/app/src/main/res/drawable/ic_game.xml +++ b/app/src/main/res/drawable/ic_game.xml @@ -1,4 +1,5 @@ + android:fillType="evenOdd" + tools:ignore="VectorPath" /> diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_home_black_24dp.xml deleted file mode 100644 index f8bb0b5..0000000 --- a/app/src/main/res/drawable/ic_home_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml deleted file mode 100644 index 78b75c3..0000000 --- a/app/src/main/res/drawable/ic_notifications_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_scan.xml b/app/src/main/res/drawable/ic_scan.xml index 3ddf86d..c9059c5 100644 --- a/app/src/main/res/drawable/ic_scan.xml +++ b/app/src/main/res/drawable/ic_scan.xml @@ -1,4 +1,5 @@ + android:fillType="evenOdd" + tools:ignore="VectorPath" /> diff --git a/app/src/main/res/drawable/ic_search.xml b/app/src/main/res/drawable/ic_search.xml deleted file mode 100644 index 5ab0121..0000000 --- a/app/src/main/res/drawable/ic_search.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - diff --git a/app/src/main/res/layout/activity_batik_detail.xml b/app/src/main/res/layout/activity_batik_detail.xml index 280e0ff..b47e409 100644 --- a/app/src/main/res/layout/activity_batik_detail.xml +++ b/app/src/main/res/layout/activity_batik_detail.xml @@ -48,7 +48,8 @@ android:layout_width="match_parent" android:layout_height="300dp" android:scaleType="fitXY" - tools:src="@drawable/img_sample_batik" /> + tools:src="@drawable/img_sample_batik" + android:contentDescription="@string/image_batik" /> diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index 8643aa2..a1f1520 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="#E5E5E5" + android:background="@color/grey" tools:context=".ui.feature.auth.login.LoginActivity"> + android:textSize="@dimen/large_text" + android:importantForAutofill="no" /> + android:textSize="@dimen/large_text" + android:importantForAutofill="no" /> diff --git a/app/src/main/res/layout/activity_register.xml b/app/src/main/res/layout/activity_register.xml index 3fff70c..b8458c8 100644 --- a/app/src/main/res/layout/activity_register.xml +++ b/app/src/main/res/layout/activity_register.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="#E5E5E5" + android:background="@color/grey" tools:context=".ui.feature.auth.register.RegisterActivity"> + android:textSize="@dimen/large_text" + android:importantForAutofill="no" /> + android:textSize="@dimen/large_text" + android:importantForAutofill="no" /> + android:textSize="@dimen/large_text" + android:importantForAutofill="no" /> @@ -241,7 +244,8 @@ android:hint="@string/insert_your_new_password_again" android:inputType="textPassword" android:textColor="@color/black" - android:textSize="@dimen/large_text" /> + android:textSize="@dimen/large_text" + android:importantForAutofill="no" /> + tools:src="@drawable/img_sample_batik" + android:contentDescription="@string/image_batik" /> + app:layout_constraintTop_toTopOf="parent" + android:contentDescription="@string/icon_user" /> + app:layout_constraintTop_toTopOf="parent" + android:contentDescription="@string/icon_logout" /> + android:background="@color/grey"> + app:layout_constraintTop_toTopOf="parent" + android:contentDescription="@string/image_batik" /> - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_list_region.xml b/app/src/main/res/layout/item_list_region.xml index 8d3a22f..3fcf582 100644 --- a/app/src/main/res/layout/item_list_region.xml +++ b/app/src/main/res/layout/item_list_region.xml @@ -25,7 +25,7 @@ android:text="@string/text_sample_regio" android:fontFamily="@font/montserrat_medium" android:textColor="@color/black" - android:textSize="10sp" + android:textSize="@dimen/normal_text" android:layout_margin="@dimen/large_dimen" android:layout_marginStart="4dp" app:layout_constraintStart_toEndOf="@+id/tv_friend_name" diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index c918b57..627fc1f 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -6,9 +6,7 @@ android:icon="@drawable/ic_home" android:title="@string/title_home" /> - + #FF000000 #FFFFFFFF - #FFECB3 - #FFE082 - #FFD54F - #FFCA28 - #FFF8E1 - #FFC107 - #FFB300 - #FFA000 - #FF8F00 - #FF6F00 - #FFE57F - #FFD740 - #FFC400 - #FFAB00 - #BBDEFB - #90CAF9 - #64B5F6 - #42A5F5 - #E3F2FD - #2196F3 - #1E88E5 - #1976D2 - #1565C0 - #0D47A1 - #82B1FF - #448AFF - #2979FF - #2962FF - #CFD8DC - #B0BEC5 - #90A4AE - #78909C - #ECEFF1 - #607D8B - #546E7A - #455A64 - #D7CCC8 - #BCAAA4 - #A1887F - #8D6E63 - #EFEBE9 - #795548 - #6D4C41 - #5D4037 - #4E342E - #3E2723 - #B2EBF2 #80DEEA - #4DD0E1 - #26C6DA - #E0F7FA - #00BCD4 - #00ACC1 #0097A7 - #00838F - #006064 - #84FFFF - #18FFFF - #00E5FF - #00B8D4 - #FFCCBC - #FFAB91 - #FF8A65 - #FF7043 - #FBE9E7 - #FF5722 - #F4511E - #E64A19 - #D84315 - #BF360C - #FF9E80 - #FF6E40 - #FF3D00 - #DD2C00 - #D1C4E9 - #B39DDB - #9575CD - #7E57C2 - #EDE7F6 - #673AB7 - #5E35B1 - #512DA8 - #4527A0 - #311B92 - #B388FF - #7C4DFF - #651FFF - #6200EA - #C8E6C9 - #A5D6A7 #81C784 - #66BB6A - #E8F5E9 - #4CAF50 - #43A047 - #388E3C - #2E7D32 - #1B5E20 - #B9F6CA - #69F0AE - #00E676 - #00C853 - #EEEEEE - #BDBDBD - #9E9E9E - #C5CAE9 - #9FA8DA - #7986CB - #5C6BC0 - #E8EAF6 - #3F51B5 - #3949AB - #303F9F - #283593 - #1A237E - #8C9EFF - #536DFE - #3D5AFE - #304FFE - #000000 - #B3E5FC - #81D4FA - #4FC3F7 - #29B6F6 - #E1F5FE - #03A9F4 - #039BE5 - #0288D1 - #0277BD - #01579B - #80D8FF - #40C4FF - #00B0FF - #0091EA - #DCEDC8 - #C5E1A5 - #AED581 - #9CCC65 - #F1F8E9 - #8BC34A - #7CB342 - #689F38 - #558B2F - #33691E - #CCFF90 - #B2FF59 - #76FF03 - #64DD17 - #FFFFFF - #F0F4C3 - #E6EE9C - #DCE775 - #D4E157 - #F9FBE7 - #CDDC39 - #C0CA33 - #AFB42B - #9E9D24 - #827717 - #F4FF81 - #EEFF41 - #C6FF00 - #AEEA00 - #FFE0B2 #FFCC80 #FFB74D - #FFA726 - #FFF3E0 #FF9800 - #FB8C00 #F57C00 - #EF6C00 - #E65100 - #FFD180 - #FFAB40 - #FF9100 - #FF6D00 - #F8BBD0 - #F48FB1 - #F06292 - #EC407A - #FCE4EC - #E91E63 - #D81B60 - #C2185B - #AD1457 - #880E4F - #FF80AB - #FF4081 - #F50057 - #C51162 - #E1BEE7 - #CE93D8 - #BA68C8 - #AB47BC - #F3E5F5 - #9C27B0 - #8E24AA - #7B1FA2 - #6A1B9A - #4A148C - #EA80FC - #E040FB - #D500F9 - #AA00FF - #FFCDD2 - #EF9A9A #E57373 - #EF5350 - #FFEBEE - #F44336 - #E53935 - #D32F2F - #C62828 - #B71C1C - #FF8A80 - #FF5252 - #FF1744 - #D50000 - #B2DFDB - #80CBC4 - #4DB6AC - #26A69A - #E0F2F1 - #009688 - #00897B - #00796B - #00695C - #004D40 - #A7FFEB - #64FFDA - #1DE9B6 - #00BFA5 - #FFF9C4 - #FFF59D - #FFF176 - #FFEE58 - #FFFDE7 - #FFEB3B - #FDD835 - #FBC02D - #F9A825 - #F57F17 - #FFFF8D - #FFFF00 - #FFEA00 - #FFD600 + #E5E5E5 \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index da25834..2e89f82 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,13 +1,9 @@ - 16dp - 16dp 4dp 8dp 16dp - 18dp - 20dp 12sp 14sp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 25229a8..ae40755 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,7 +2,6 @@ Gamastik MainActivity Home - Dashboard Quiz Insert your E-mail GAMASTIK @@ -30,18 +29,17 @@ % Back Button Discover Batik Indonesia - Search batik here ... + Search batik here … By Region Jawa Barat Top Batik See product recommendations Result Submit - B - A - C - D Finish Go to Next Question splas screen + image batik + icon user + icon logout \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 2b0d63e..2a1874a 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -21,14 +21,4 @@ @null - - \ No newline at end of file diff --git a/app/src/main/res/xml/backup_descriptor.xml b/app/src/main/res/xml/backup_descriptor.xml new file mode 100644 index 0000000..6fd6103 --- /dev/null +++ b/app/src/main/res/xml/backup_descriptor.xml @@ -0,0 +1,4 @@ + + + + diff --git a/build.gradle b/build.gradle index e2e0d22..c68b6dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.5.0" + ext.kotlin_version = "1.5.10" repositories { google() - jcenter() mavenCentral() } dependencies {