Compare commits
No commits in common. "master" and "feature/my-resumes-teal" have entirely different histories.
master
...
feature/my
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,7 +1,12 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
|
||||
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
||||
resBuilder
|
||||
6
.idea/AndroidProjectSystem.xml
generated
Normal file
6
.idea/AndroidProjectSystem.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/compiler.xml
generated
Normal file
6
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
||||
18
.idea/deploymentTargetSelector.xml
generated
Normal file
18
.idea/deploymentTargetSelector.xml
generated
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-07-30T23:29:27.007440701Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=5C051JEA313902" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
13
.idea/deviceManager.xml
generated
Normal file
13
.idea/deviceManager.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DeviceTable">
|
||||
<option name="columnSorters">
|
||||
<list>
|
||||
<ColumnSorterState>
|
||||
<option name="column" value="Name" />
|
||||
<option name="order" value="ASCENDING" />
|
||||
</ColumnSorterState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
18
.idea/gradle.xml
generated
Normal file
18
.idea/gradle.xml
generated
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/misc.xml
generated
Normal file
10
.idea/misc.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="temurin-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/runConfigurations.xml
generated
Normal file
17
.idea/runConfigurations.xml
generated
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -18,25 +18,15 @@ android {
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
buildConfigField("String", "API_BASE", "\"https://resume.aridgwayweb.com\"")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
optimization {
|
||||
enable = false
|
||||
}
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro",
|
||||
)
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
@ -46,9 +36,6 @@ android {
|
||||
dependencies {
|
||||
implementation(libs.androidx.appcompat)
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.lifecycle.viewmodel.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||
implementation(libs.androidx.fragment.ktx)
|
||||
implementation(libs.material)
|
||||
implementation(libs.okhttp)
|
||||
implementation(libs.gson)
|
||||
|
||||
11
app/proguard-rules.pro
vendored
11
app/proguard-rules.pro
vendored
@ -1,11 +0,0 @@
|
||||
# R8/ProGuard rules for resbuilder_app.
|
||||
|
||||
# Gson reflects over the API data models. Keep their fields intact.
|
||||
-keep class com.example.resbuilder.data.model.** { <fields>; }
|
||||
|
||||
# Keep the OkHttp client class and its members (OkHttp ships its own consumer rules,
|
||||
# but ApiClient is referenced reflectively nowhere; keep it to be safe).
|
||||
-keep class com.example.resbuilder.data.remote.ApiClient { *; }
|
||||
|
||||
# Credential Manager / Google Identity libs register via reflection.
|
||||
-keep class com.google.android.libraries.identity.googleid.** { *; }
|
||||
@ -11,7 +11,6 @@
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.ResBuilder"
|
||||
@ -34,16 +33,6 @@
|
||||
android:name=".ui.AdminActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
object ApiClient {
|
||||
|
||||
internal const val API_BASE = com.example.resbuilder.BuildConfig.API_BASE
|
||||
internal const val API_BASE = "https://resume.aridgwayweb.com"
|
||||
|
||||
private val gson = Gson()
|
||||
private val cookieStore = mutableListOf<Cookie>()
|
||||
@ -313,21 +313,4 @@ object ApiClient {
|
||||
|
||||
fun getExportPdfUrl(jobId: String): String = "$API_BASE/export/$jobId/pdf"
|
||||
fun getExportDocxUrl(jobId: String): String = "$API_BASE/export/$jobId/docx"
|
||||
|
||||
@Throws(IOException::class)
|
||||
fun downloadExport(url: String): ByteArray {
|
||||
val req = Request.Builder()
|
||||
.url(url)
|
||||
.build()
|
||||
client.newCall(req).execute().use { res ->
|
||||
if (!res.isSuccessful) {
|
||||
val errBody = res.body?.string()
|
||||
val detail = try {
|
||||
gson.fromJson(errBody, Map::class.java)["detail"] as? String
|
||||
} catch (_: Exception) { null }
|
||||
throw IOException(detail ?: "Export failed")
|
||||
}
|
||||
return res.body?.bytes() ?: throw IOException("Empty response")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -147,7 +147,7 @@ class JobFormFragment : Fragment() {
|
||||
private fun scrapeUrl() {
|
||||
val url = seekUrlInput.text?.toString()?.trim() ?: ""
|
||||
if (url.isEmpty()) {
|
||||
seekUrlInput.error = getString(R.string.enter_url)
|
||||
seekUrlInput.error = "Enter a URL"
|
||||
return
|
||||
}
|
||||
showLoading(true)
|
||||
|
||||
@ -14,25 +14,27 @@ import androidx.credentials.CustomCredential
|
||||
import androidx.credentials.GetCredentialRequest
|
||||
import androidx.credentials.GetCredentialResponse
|
||||
import androidx.credentials.exceptions.GetCredentialException
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.activity.viewModels
|
||||
import com.example.resbuilder.R
|
||||
import com.example.resbuilder.data.remote.ApiClient
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignIn
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
|
||||
import com.google.android.gms.common.api.ApiException
|
||||
import com.google.android.gms.tasks.Task
|
||||
import com.google.android.libraries.identity.googleid.GetGoogleIdOption
|
||||
import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential
|
||||
import com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.security.SecureRandom
|
||||
import java.util.Base64
|
||||
|
||||
class LoginActivity : AppCompatActivity() {
|
||||
|
||||
private val viewModel: LoginViewModel by viewModels()
|
||||
|
||||
private lateinit var googleSignInButton: MaterialButton
|
||||
private lateinit var progress: CircularProgressIndicator
|
||||
private lateinit var credentialManager: CredentialManager
|
||||
@ -43,6 +45,10 @@ class LoginActivity : AppCompatActivity() {
|
||||
private val webClientId = "416332591622-godddvcplbobkhv6uvabg94pvtukp61u.apps.googleusercontent.com"
|
||||
private val androidClientId = "416332591622-41ioels091g0am6v5m1catf0tt69ohk4.apps.googleusercontent.com"
|
||||
|
||||
companion object {
|
||||
private const val TAG = "LoginActivity"
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_login)
|
||||
@ -56,36 +62,25 @@ class LoginActivity : AppCompatActivity() {
|
||||
googleSignInLauncher = registerForActivityResult(
|
||||
ActivityResultContracts.StartIntentSenderForResult()
|
||||
) { result ->
|
||||
Log.w(TAG, "Unexpected activity result: ${result.resultCode}")
|
||||
showLoading(false)
|
||||
Toast.makeText(this, R.string.sign_in_interrupted, Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(this, "Sign-in interrupted", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
observeAuthState()
|
||||
|
||||
showLoading(true)
|
||||
viewModel.checkExistingAuth()
|
||||
checkExistingAuth()
|
||||
}
|
||||
|
||||
private fun observeAuthState() {
|
||||
private fun checkExistingAuth() {
|
||||
lifecycleScope.launch {
|
||||
lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
viewModel.state.collect { state ->
|
||||
showLoading(state.loading)
|
||||
state.error?.let {
|
||||
Toast.makeText(this@LoginActivity, it, Toast.LENGTH_LONG).show()
|
||||
viewModel.setLoading(false)
|
||||
}
|
||||
state.user?.let { user ->
|
||||
if (state.authenticated) {
|
||||
Toast.makeText(
|
||||
this@LoginActivity,
|
||||
getString(R.string.welcome_user, user.name ?: user.email),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
try {
|
||||
val user = withContext(Dispatchers.IO) { ApiClient.getMe() }
|
||||
showLoading(false)
|
||||
if (user.authenticated) {
|
||||
launchMain()
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
showLoading(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -95,8 +90,14 @@ class LoginActivity : AppCompatActivity() {
|
||||
googleSignInButton.isEnabled = !loading
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun launchGoogleSignIn() {
|
||||
showLoading(true)
|
||||
lifecycleScope.launch {
|
||||
Log.d(TAG, "Starting Credential Manager flow")
|
||||
Log.d(TAG, "Web client ID: $webClientId")
|
||||
Log.d(TAG, "Android client ID: $androidClientId")
|
||||
val googleIdOption = GetGoogleIdOption.Builder()
|
||||
.setFilterByAuthorizedAccounts(false)
|
||||
.setServerClientId(webClientId)
|
||||
@ -108,19 +109,23 @@ class LoginActivity : AppCompatActivity() {
|
||||
.addCredentialOption(googleIdOption)
|
||||
.build()
|
||||
|
||||
viewModel.viewModelScope.launch {
|
||||
try {
|
||||
Log.d(TAG, "Calling getCredential...")
|
||||
val result = credentialManager.getCredential(
|
||||
request = request,
|
||||
context = this@LoginActivity
|
||||
)
|
||||
Log.d(TAG, "Credential retrieved successfully")
|
||||
handleCredentialResponse(result)
|
||||
} catch (e: GetCredentialException) {
|
||||
Log.e(TAG, "Credential Manager failed: ${e.javaClass.simpleName}", e)
|
||||
Log.e(TAG, "Error message: ${e.message}")
|
||||
Log.e(TAG, "Error code: ${e.cause}")
|
||||
showLoading(false)
|
||||
val errorMsg = when (e) {
|
||||
is androidx.credentials.exceptions.NoCredentialException -> getString(R.string.no_google_accounts)
|
||||
is androidx.credentials.exceptions.GetCredentialCancellationException -> getString(R.string.sign_in_cancelled)
|
||||
else -> getString(R.string.sign_in_failed, e.message)
|
||||
is androidx.credentials.exceptions.NoCredentialException -> "No Google accounts found on device"
|
||||
is androidx.credentials.exceptions.GetCredentialCancellationException -> "Sign-in cancelled"
|
||||
else -> "Sign-in failed: ${e.message}"
|
||||
}
|
||||
Toast.makeText(this@LoginActivity, errorMsg, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
@ -136,18 +141,56 @@ class LoginActivity : AppCompatActivity() {
|
||||
val idToken = googleIdTokenCredential.idToken
|
||||
if (idToken.isNullOrEmpty()) {
|
||||
showLoading(false)
|
||||
Toast.makeText(this, R.string.no_id_token, Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(this, "No ID token from Google", Toast.LENGTH_LONG).show()
|
||||
return
|
||||
}
|
||||
viewModel.exchangeToken(idToken)
|
||||
exchangeToken(idToken)
|
||||
} catch (e: GoogleIdTokenParsingException) {
|
||||
showLoading(false)
|
||||
Toast.makeText(this, getString(R.string.invalid_google_id_token, e.message), Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(this, "Invalid Google ID token: ${e.message}", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
showLoading(false)
|
||||
Toast.makeText(this, R.string.unexpected_credential_type, Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(this, "Unexpected credential type", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleSignInError(message: String) {
|
||||
showLoading(false)
|
||||
Toast.makeText(this, message, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
private fun exchangeToken(idToken: String) {
|
||||
lifecycleScope.launch {
|
||||
try {
|
||||
val token = withContext(Dispatchers.IO) { ApiClient.exchangeGoogleToken(idToken) }
|
||||
ApiClient.setToken(token)
|
||||
val user = withContext(Dispatchers.IO) { ApiClient.getMe() }
|
||||
showLoading(false)
|
||||
if (user.authenticated) {
|
||||
Toast.makeText(
|
||||
this@LoginActivity,
|
||||
"Welcome ${user.name ?: user.email}",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
launchMain()
|
||||
} else {
|
||||
Toast.makeText(
|
||||
this@LoginActivity,
|
||||
"Server rejected the token",
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
showLoading(false)
|
||||
Log.e(TAG, "Token exchange failed", e)
|
||||
Toast.makeText(
|
||||
this@LoginActivity,
|
||||
e.message ?: "Token exchange failed",
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -157,6 +200,10 @@ class LoginActivity : AppCompatActivity() {
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun generateNonce(): String {
|
||||
val secureRandom = SecureRandom()
|
||||
val bytes = ByteArray(32)
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
package com.example.resbuilder.ui
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.example.resbuilder.data.model.User
|
||||
import com.example.resbuilder.data.remote.ApiClient
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
data class LoginUiState(
|
||||
val loading: Boolean = false,
|
||||
val authenticated: Boolean = false,
|
||||
val user: User? = null,
|
||||
val error: String? = null
|
||||
)
|
||||
|
||||
class LoginViewModel : ViewModel() {
|
||||
|
||||
private val _state = MutableStateFlow(LoginUiState())
|
||||
val state: StateFlow<LoginUiState> = _state.asStateFlow()
|
||||
|
||||
fun checkExistingAuth() {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val user = withContext(Dispatchers.IO) { ApiClient.getMe() }
|
||||
_state.value = LoginUiState(loading = false, authenticated = user.authenticated, user = user)
|
||||
} catch (_: Exception) {
|
||||
_state.value = LoginUiState(loading = false, error = "check auth failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun exchangeToken(idToken: String) {
|
||||
viewModelScope.launch {
|
||||
_state.value = _state.value.copy(loading = true, error = null)
|
||||
try {
|
||||
val token = withContext(Dispatchers.IO) { ApiClient.exchangeGoogleToken(idToken) }
|
||||
ApiClient.setToken(token)
|
||||
val user = withContext(Dispatchers.IO) { ApiClient.getMe() }
|
||||
_state.value = LoginUiState(
|
||||
loading = false,
|
||||
authenticated = user.authenticated,
|
||||
user = user
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
_state.value = LoginUiState(loading = false, error = e.message ?: "Token exchange failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setLoading(loading: Boolean) {
|
||||
_state.value = _state.value.copy(loading = loading)
|
||||
}
|
||||
|
||||
fun consumeAuth() {
|
||||
_state.value = _state.value.copy(authenticated = false)
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import android.graphics.PorterDuff
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
@ -12,21 +13,18 @@ import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.drawerlayout.widget.DrawerLayout
|
||||
import com.example.resbuilder.R
|
||||
import com.example.resbuilder.data.model.User
|
||||
import com.example.resbuilder.data.remote.ApiClient
|
||||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import com.google.android.material.navigation.NavigationView
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
|
||||
class MainActivity : AppCompatActivity(), JobFormFragment.JobFormListener, ResultFragment.OnNewListener {
|
||||
|
||||
private lateinit var drawerLayout: DrawerLayout
|
||||
private lateinit var toolbar: MaterialToolbar
|
||||
private lateinit var navView: NavigationView
|
||||
private lateinit var tabLayout: TabLayout
|
||||
private lateinit var healthIndicator: ImageView
|
||||
private lateinit var userName: TextView
|
||||
private lateinit var userEmail: TextView
|
||||
private lateinit var usageBanner: TextView
|
||||
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
@ -34,65 +32,43 @@ class MainActivity : AppCompatActivity(), JobFormFragment.JobFormListener, Resul
|
||||
private var healthRunnable: Runnable? = null
|
||||
|
||||
companion object {
|
||||
private const val NAV_BUILD_RESUME = 0
|
||||
private const val NAV_BUILD_COVER_LETTER = 1
|
||||
private const val TAB_RESUME = 0
|
||||
private const val TAB_COVER = 1
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
drawerLayout = findViewById(R.id.drawerLayout)
|
||||
toolbar = findViewById(R.id.toolbar)
|
||||
navView = findViewById(R.id.navView)
|
||||
tabLayout = findViewById(R.id.tabLayout)
|
||||
healthIndicator = findViewById(R.id.healthIndicator)
|
||||
userName = findViewById(R.id.userName)
|
||||
usageBanner = findViewById(R.id.usageBanner)
|
||||
|
||||
val header = navView.getHeaderView(0)
|
||||
healthIndicator = header.findViewById(R.id.healthIndicator)
|
||||
userName = header.findViewById(R.id.userName)
|
||||
userEmail = header.findViewById(R.id.userEmail)
|
||||
|
||||
setSupportActionBar(toolbar)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_menu_hamburger)
|
||||
|
||||
navView.setNavigationItemSelectedListener { item ->
|
||||
drawerLayout.closeDrawers()
|
||||
handleNavItem(item.itemId)
|
||||
true
|
||||
tabLayout.addTab(tabLayout.newTab().setText(R.string.tab_build_resume))
|
||||
tabLayout.addTab(tabLayout.newTab().setText(R.string.tab_build_cover_letter))
|
||||
|
||||
tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
|
||||
override fun onTabSelected(tab: TabLayout.Tab?) {
|
||||
switchFormTab(tab?.position ?: TAB_RESUME)
|
||||
}
|
||||
|
||||
override fun onTabUnselected(tab: TabLayout.Tab?) {}
|
||||
override fun onTabReselected(tab: TabLayout.Tab?) {
|
||||
switchFormTab(tab?.position ?: TAB_RESUME)
|
||||
}
|
||||
})
|
||||
|
||||
loadUser()
|
||||
startHealthPolling()
|
||||
if (savedInstanceState == null) {
|
||||
showBuildForm(NAV_BUILD_RESUME)
|
||||
switchFormTab(TAB_RESUME)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleNavItem(itemId: Int) {
|
||||
when (itemId) {
|
||||
R.id.navBuildResume -> showBuildForm(NAV_BUILD_RESUME)
|
||||
R.id.navBuildCoverLetter -> showBuildForm(NAV_BUILD_COVER_LETTER)
|
||||
R.id.navMyResumes -> showMyResumes()
|
||||
R.id.navAdmin -> startActivity(Intent(this, AdminActivity::class.java))
|
||||
R.id.navSignOut -> signOut()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showBuildForm(position: Int) {
|
||||
val type = if (position == NAV_BUILD_COVER_LETTER) JobFormFragment.TYPE_COVER_LETTER else JobFormFragment.TYPE_RESUME
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fragmentContainer, JobFormFragment.newInstance(type))
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
private fun showMyResumes() {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fragmentContainer, MyResumesFragment())
|
||||
.addToBackStack(null)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
private fun loadUser() {
|
||||
Thread {
|
||||
try {
|
||||
@ -110,13 +86,20 @@ class MainActivity : AppCompatActivity(), JobFormFragment.JobFormListener, Resul
|
||||
|
||||
private fun updateUserUI() {
|
||||
userName.text = user.name ?: user.email ?: getString(R.string.unknown_user)
|
||||
userEmail.text = user.email ?: getString(R.string.unknown_email)
|
||||
usageBanner.visibility = if (!user.authenticated || (!user.is_admin && !user.can_submit)) {
|
||||
View.VISIBLE
|
||||
if (!user.authenticated || (!user.is_admin && !user.can_submit)) {
|
||||
usageBanner.visibility = View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
usageBanner.visibility = View.GONE
|
||||
}
|
||||
navView.menu.findItem(R.id.navAdmin)?.isVisible = user.is_admin
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
|
||||
private fun switchFormTab(position: Int) {
|
||||
val type = if (position == TAB_COVER) JobFormFragment.TYPE_COVER_LETTER else JobFormFragment.TYPE_RESUME
|
||||
val fragment = JobFormFragment.newInstance(type)
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fragmentContainer, fragment)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
private fun startHealthPolling() {
|
||||
@ -147,12 +130,34 @@ class MainActivity : AppCompatActivity(), JobFormFragment.JobFormListener, Resul
|
||||
}.start()
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_main, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onPrepareOptionsMenu(menu: Menu?): Boolean {
|
||||
menu?.findItem(R.id.menuAdminPanel)?.isVisible = user.is_admin
|
||||
return super.onPrepareOptionsMenu(menu)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
return if (item.itemId == android.R.id.home) {
|
||||
drawerLayout.openDrawer(navView)
|
||||
return when (item.itemId) {
|
||||
R.id.menuMyResumes -> {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fragmentContainer, MyResumesFragment())
|
||||
.addToBackStack(null)
|
||||
.commitAllowingStateLoss()
|
||||
true
|
||||
} else {
|
||||
super.onOptionsItemSelected(item)
|
||||
}
|
||||
R.id.menuSignOut -> {
|
||||
signOut()
|
||||
true
|
||||
}
|
||||
R.id.menuAdminPanel -> {
|
||||
startActivity(Intent(this, AdminActivity::class.java))
|
||||
true
|
||||
}
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,8 +183,8 @@ class MainActivity : AppCompatActivity(), JobFormFragment.JobFormListener, Resul
|
||||
|
||||
fun onResultNewJob() {
|
||||
supportFragmentManager.popBackStackImmediate()
|
||||
navView.menu.getItem(NAV_BUILD_RESUME)?.isChecked = true
|
||||
showBuildForm(NAV_BUILD_RESUME)
|
||||
tabLayout.getTabAt(TAB_RESUME)?.select()
|
||||
switchFormTab(TAB_RESUME)
|
||||
}
|
||||
|
||||
override fun onNewJob() {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.example.resbuilder.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@ -9,18 +11,15 @@ import android.widget.ListView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import com.example.resbuilder.R
|
||||
import com.example.resbuilder.data.model.Job
|
||||
import com.example.resbuilder.data.model.JobSummary
|
||||
import com.example.resbuilder.data.remote.ApiClient
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class MyResumesFragment : Fragment() {
|
||||
|
||||
private val viewModel: MyResumesViewModel by viewModels()
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
|
||||
private lateinit var emptyView: TextView
|
||||
private lateinit var progress: LinearProgressIndicator
|
||||
@ -38,54 +37,71 @@ class MyResumesFragment : Fragment() {
|
||||
|
||||
listView.setOnItemClickListener { _, _, position, _ ->
|
||||
val item = listView.adapter.getItem(position) as JobSummary
|
||||
viewModel.openJob(item.job_id)
|
||||
openJob(item.job_id)
|
||||
}
|
||||
|
||||
observeState()
|
||||
viewModel.loadJobs()
|
||||
loadJobs()
|
||||
}
|
||||
|
||||
private fun observeState() {
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
viewLifecycleOwner.lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
viewModel.state.collect { state ->
|
||||
progress.visibility = if (state.loading) View.VISIBLE else View.GONE
|
||||
|
||||
state.error?.let {
|
||||
private fun loadJobs() {
|
||||
showLoading(true)
|
||||
Thread {
|
||||
try {
|
||||
val resp = ApiClient.getMyJobs()
|
||||
handler.post {
|
||||
showLoading(false)
|
||||
bindJobs(resp.jobs)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
handler.post {
|
||||
showLoading(false)
|
||||
emptyView.text = getString(R.string.my_resumes_error)
|
||||
emptyView.visibility = View.VISIBLE
|
||||
Toast.makeText(requireContext(), it, Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(requireContext(), e.message ?: getString(R.string.my_resumes_error), Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
if (!state.loading && state.jobs.isNotEmpty()) {
|
||||
emptyView.visibility = View.GONE
|
||||
listView.visibility = View.VISIBLE
|
||||
listView.adapter = JobListAdapter(requireContext(), state.jobs)
|
||||
} else if (!state.loading && state.error == null) {
|
||||
private fun bindJobs(jobs: List<JobSummary>) {
|
||||
if (jobs.isEmpty()) {
|
||||
emptyView.text = getString(R.string.my_resumes_empty)
|
||||
emptyView.visibility = View.VISIBLE
|
||||
listView.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
listView.visibility = View.VISIBLE
|
||||
listView.adapter = JobListAdapter(requireContext(), jobs)
|
||||
}
|
||||
|
||||
state.openedJob?.let { job ->
|
||||
viewModel.consumeOpenedJob()
|
||||
openJobResult(job)
|
||||
private fun openJob(jobId: String) {
|
||||
showLoading(true)
|
||||
Thread {
|
||||
try {
|
||||
val job = ApiClient.getJob(jobId)
|
||||
handler.post {
|
||||
showLoading(false)
|
||||
if (job == null) {
|
||||
Toast.makeText(requireContext(), R.string.my_resumes_error, Toast.LENGTH_LONG).show()
|
||||
return@post
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun openJobResult(job: com.example.resbuilder.data.model.Job) {
|
||||
when (job.status.uppercase()) {
|
||||
"COMPLETED" -> {
|
||||
val type = job.type ?: JobFormFragment.TYPE_RESUME
|
||||
replaceWith(ResultFragment.newInstance(job, type))
|
||||
}
|
||||
"FAILED" -> Toast.makeText(requireContext(), job.error ?: getString(R.string.status_failed), Toast.LENGTH_LONG).show()
|
||||
else -> replaceWith(JobStatusFragment.newInstance(job.job_id ?: "", job.type ?: JobFormFragment.TYPE_RESUME))
|
||||
else -> replaceWith(JobStatusFragment.newInstance(jobId, job.type ?: JobFormFragment.TYPE_RESUME))
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
handler.post {
|
||||
showLoading(false)
|
||||
Toast.makeText(requireContext(), e.message ?: getString(R.string.my_resumes_error), Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
private fun replaceWith(fragment: Fragment) {
|
||||
requireActivity().supportFragmentManager.beginTransaction()
|
||||
@ -94,6 +110,15 @@ class MyResumesFragment : Fragment() {
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
private fun showLoading(loading: Boolean) {
|
||||
progress.visibility = if (loading) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
handler.removeCallbacksAndMessages(null)
|
||||
}
|
||||
|
||||
private class JobListAdapter(
|
||||
context: android.content.Context,
|
||||
private val jobs: List<JobSummary>
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
package com.example.resbuilder.ui
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.example.resbuilder.data.model.Job
|
||||
import com.example.resbuilder.data.model.JobSummary
|
||||
import com.example.resbuilder.data.remote.ApiClient
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
data class MyResumesUiState(
|
||||
val loading: Boolean = false,
|
||||
val jobs: List<JobSummary> = emptyList(),
|
||||
val error: String? = null,
|
||||
val openedJob: Job? = null
|
||||
)
|
||||
|
||||
class MyResumesViewModel : ViewModel() {
|
||||
|
||||
private val _state = MutableStateFlow(MyResumesUiState())
|
||||
val state: StateFlow<MyResumesUiState> = _state.asStateFlow()
|
||||
|
||||
fun loadJobs() {
|
||||
_state.value = _state.value.copy(loading = true, error = null)
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val jobs = withContext(Dispatchers.IO) { ApiClient.getMyJobs().jobs }
|
||||
_state.value = _state.value.copy(loading = false, jobs = jobs)
|
||||
} catch (e: Exception) {
|
||||
_state.value = _state.value.copy(loading = false, error = e.message ?: "load failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun openJob(jobId: String) {
|
||||
viewModelScope.launch {
|
||||
_state.value = _state.value.copy(loading = true, error = null)
|
||||
try {
|
||||
val job = withContext(Dispatchers.IO) { ApiClient.getJob(jobId) }
|
||||
_state.value = _state.value.copy(loading = false, openedJob = job)
|
||||
} catch (e: Exception) {
|
||||
_state.value = _state.value.copy(loading = false, error = e.message ?: "open failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun consumeOpenedJob() {
|
||||
_state.value = _state.value.copy(openedJob = null)
|
||||
}
|
||||
}
|
||||
@ -13,14 +13,11 @@ import android.webkit.WebView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.example.resbuilder.R
|
||||
import com.example.resbuilder.data.model.Job
|
||||
import com.example.resbuilder.data.remote.ApiClient
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
|
||||
class ResultFragment : Fragment() {
|
||||
|
||||
@ -89,58 +86,14 @@ class ResultFragment : Fragment() {
|
||||
newButton.setOnClickListener { listener?.onNewJob() }
|
||||
|
||||
jobId?.let { id ->
|
||||
pdfButton.setOnClickListener { downloadAndOpen(id, "pdf") }
|
||||
docxButton.setOnClickListener { downloadAndOpen(id, "docx") }
|
||||
pdfButton.setOnClickListener { openUrl(ApiClient.getExportPdfUrl(id)) }
|
||||
docxButton.setOnClickListener { openUrl(ApiClient.getExportDocxUrl(id)) }
|
||||
} ?: run {
|
||||
pdfButton.isEnabled = false
|
||||
docxButton.isEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun downloadAndOpen(jobId: String, format: String) {
|
||||
val url = if (format == "pdf") ApiClient.getExportPdfUrl(jobId) else ApiClient.getExportDocxUrl(jobId)
|
||||
val dir = File(requireContext().cacheDir, "exports")
|
||||
if (!dir.exists()) dir.mkdirs()
|
||||
val safeId = jobId.replace("/", "_").replace("..", "_").take(8)
|
||||
val file = File(dir, "$safeId.$format")
|
||||
|
||||
pdfButton.isEnabled = false
|
||||
docxButton.isEnabled = false
|
||||
Toast.makeText(context, R.string.exporting, Toast.LENGTH_SHORT).show()
|
||||
|
||||
Thread {
|
||||
try {
|
||||
val bytes = ApiClient.downloadExport(url)
|
||||
FileOutputStream(file).use { it.write(bytes) }
|
||||
requireActivity().runOnUiThread {
|
||||
pdfButton.isEnabled = true
|
||||
docxButton.isEnabled = true
|
||||
openFile(file)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
requireActivity().runOnUiThread {
|
||||
pdfButton.isEnabled = true
|
||||
docxButton.isEnabled = true
|
||||
Toast.makeText(context, e.message ?: getString(R.string.export_failed), Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
private fun openFile(file: File) {
|
||||
val uri = FileProvider.getUriForFile(requireContext(), "${requireContext().packageName}.fileprovider", file)
|
||||
val mime = if (file.extension == "pdf") "application/pdf" else "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
val intent = Intent(Intent.ACTION_VIEW).apply {
|
||||
setDataAndType(uri, mime)
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
}
|
||||
try {
|
||||
startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context, R.string.export_no_viewer, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyText() {
|
||||
val raw = rawContent
|
||||
if (raw.isNullOrEmpty()) {
|
||||
@ -152,6 +105,11 @@ class ResultFragment : Fragment() {
|
||||
Toast.makeText(context, R.string.copied_to_clipboard, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
private fun openUrl(url: String) {
|
||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
fun setOnNewListener(l: OnNewListener) {
|
||||
listener = l
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<shape xmlns:android="http://schemas.android.com/apk"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="?attr/colorWarningContainer" />
|
||||
<corners android:radius="12dp" />
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:angle="270"
|
||||
android:startColor="?attr/colorPrimary"
|
||||
android:centerColor="?attr/colorPrimaryInverse"
|
||||
android:endColor="?attr/colorPrimaryContainer"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:startColor="?attr/colorPrimary"
|
||||
android:centerColor="?attr/colorPrimaryInverse"
|
||||
android:endColor="?attr/colorPrimaryContainer"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<shape xmlns:android="http://schemas.android.com/apk/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="?attr/colorSurfaceContainerHighest" />
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/colorOnSurfaceVariant"
|
||||
android:pathData="M14,2H6C4.9,2 4,2.9 4,4V20C4,21.1 4.9,22 6,22H18C19.1,22 20,21.1 20,20V8L14,2M13,9V3.5L18.5,9H13Z" />
|
||||
</vector>
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorOnSurface">
|
||||
<path
|
||||
android:fillColor="?attr/colorOnSurface"
|
||||
android:pathData="M3,6h18v2H3V6zM3,11h18v2H3v-2zM3,16h18v2H3v-2z" />
|
||||
</vector>
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/colorOnPrimary"
|
||||
android:pathData="M12,2L13.5,9.5L21,12L13.5,14.5L12,22L10.5,14.5L3,12L10.5,9.5L12,2Z" />
|
||||
</vector>
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
android:background="?attr/colorSurface"
|
||||
tools:context=".ui.LoginActivity">
|
||||
|
||||
<!-- Decorative gradient background behind card -->
|
||||
<!-- Decorative background element -->
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
@ -17,32 +17,21 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginEnd="@dimen/space_lg"
|
||||
android:layout_marginBottom="@dimen/space_lg"
|
||||
android:alpha="0.15"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_sparkle"
|
||||
app:layout_constraintBottom_toTopOf="@id/guidelineTop"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guidelineTop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
app:layout_constraintGuide_percent="0.35" />
|
||||
|
||||
<!-- Main content card -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/loginCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/space_lg"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="@dimen/card_radius_large"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainer"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@ -57,22 +46,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/space_xl">
|
||||
android:padding="32dp">
|
||||
|
||||
<!-- App icon with tonal surface -->
|
||||
<!-- App icon with elevation -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/space_xxl"
|
||||
android:layout_height="@dimen/space_xxl"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="88dp"
|
||||
app:cardBackgroundColor="?attr/colorPrimaryContainer"
|
||||
app:cardCornerRadius="@dimen/card_radius_large"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeWidth="0dp">
|
||||
app:cardCornerRadius="22dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/cd_app_logo"
|
||||
android:padding="@dimen/space_md"
|
||||
android:padding="20dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_launcher_foreground"
|
||||
app:tint="?attr/colorOnPrimaryContainer" />
|
||||
@ -83,7 +71,7 @@
|
||||
android:id="@+id/loginTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_lg"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/app_title"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?attr/textAppearanceHeadlineMedium"
|
||||
@ -95,7 +83,7 @@
|
||||
android:id="@+id/loginSubtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_sm"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/welcome_subtitle"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?attr/textAppearanceBodyLarge"
|
||||
@ -105,17 +93,16 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="@dimen/space_lg"
|
||||
android:layout_marginVertical="24dp"
|
||||
android:background="?attr/colorOutlineVariant" />
|
||||
|
||||
<!-- Sign in button -->
|
||||
<!-- Sign in button container -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/googleSignInButton"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:minHeight="@dimen/button_height"
|
||||
android:text="@string/sign_in_with_google"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
@ -123,7 +110,7 @@
|
||||
app:cornerRadius="14dp"
|
||||
app:icon="@drawable/ic_google"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="@dimen/space_md"
|
||||
app:iconPadding="12dp"
|
||||
app:iconSize="24dp"
|
||||
app:iconTint="@null"
|
||||
app:strokeColor="?attr/colorOutline"
|
||||
@ -133,7 +120,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/sign_in_terms"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
@ -149,7 +136,7 @@
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:indicatorColor="?attr/colorOnPrimary"
|
||||
app:indicatorSize="@dimen/space_xxl"
|
||||
app:indicatorSize="48dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/loginCard"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@ -1,82 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ui.MainActivity">
|
||||
|
||||
<!-- Main content -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Modern colored app bar with gradient surface and centered title -->
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:background="?attr/colorSurface"
|
||||
android:fitsSystemWindows="true"
|
||||
app:elevation="0dp">
|
||||
app:elevation="0dp"
|
||||
app:liftOnScroll="false">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@drawable/bg_gradient_primary_bottom"
|
||||
android:elevation="0dp"
|
||||
app:navigationIcon="@drawable/ic_menu_hamburger"
|
||||
app:navigationIconTint="?attr/colorOnPrimary"
|
||||
android:background="?attr/colorSurface"
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_scrollFlags="scroll|enterAlways|snap"
|
||||
app:title="@string/app_title"
|
||||
app:titleCentered="true"
|
||||
app:titleTextAppearance="?attr/textAppearanceTitleLarge"
|
||||
app:titleTextColor="?attr/colorOnPrimary" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
app:titleTextColor="?attr/colorOnSurface">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/healthContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="?attr/colorSurfaceContainer"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="32dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="12dp"
|
||||
android:paddingVertical="4dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/healthIndicator"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:contentDescription="@string/cd_health_indicator"
|
||||
android:src="@drawable/ic_circle_status" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/unknown_user"
|
||||
android:textAppearance="?attr/textAppearanceLabelMedium"
|
||||
android:textColor="?attr/colorOnSurface" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/usageBanner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/space_md"
|
||||
android:layout_marginTop="@dimen/space_sm"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:background="@drawable/bg_banner_warning"
|
||||
android:drawableStart="@drawable/ic_circle_status"
|
||||
android:drawableTint="?attr/colorWarning"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/touch_target_min"
|
||||
android:padding="@dimen/space_sm"
|
||||
android:minHeight="48dp"
|
||||
android:padding="12dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/usage_limit_banner"
|
||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorSurface"
|
||||
android:contentDescription="@string/app_title"
|
||||
app:tabBackground="?attr/colorSurface"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="?attr/colorPrimary"
|
||||
app:tabMode="fixed"
|
||||
app:tabTextAppearance="?attr/textAppearanceLabelLarge"
|
||||
app:tabTextColor="?attr/colorOnSurfaceVariant"
|
||||
app:tabSelectedTextColor="?attr/colorOnSurface" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface" />
|
||||
</LinearLayout>
|
||||
android:background="?attr/colorSurface"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<!-- Navigation drawer with richer surface and modern item styling -->
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:id="@+id/navView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="?attr/colorSurfaceContainerLowest"
|
||||
app:headerLayout="@layout/nav_header"
|
||||
app:itemHorizontalPadding="@dimen/space_md"
|
||||
app:itemIconPadding="@dimen/space_md"
|
||||
app:itemIconTint="?attr/colorOnSurfaceVariant"
|
||||
app:itemRippleColor="?attr/colorPrimaryContainer"
|
||||
app:itemTextAppearance="?attr/textAppearanceBodyLarge"
|
||||
app:itemTextColor="?attr/colorOnSurface"
|
||||
app:itemVerticalPadding="@dimen/space_md"
|
||||
app:menu="@menu/menu_nav_drawer" />
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@ -6,67 +6,18 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/space_md"
|
||||
tools:context=".ui.JobFormFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Hero header with gradient surface and section title -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_gradient_primary"
|
||||
android:minHeight="@dimen/hero_header_min_height"
|
||||
android:padding="@dimen/space_lg">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="top|end"
|
||||
android:alpha="0.25"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_sparkle" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|start"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_title"
|
||||
android:textAppearance="?attr/textAppearanceLabelMedium"
|
||||
android:textColor="?attr/colorOnPrimary"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_xs"
|
||||
android:text="@string/hint_job_title"
|
||||
android:textAppearance="?attr/textAppearanceHeadlineMedium"
|
||||
android:textColor="?attr/colorOnPrimary" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/space_md">
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Job details card -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="@dimen/card_radius"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="1dp">
|
||||
@ -75,7 +26,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/space_md">
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -87,26 +38,24 @@
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_sm"
|
||||
android:layout_marginTop="12dp"
|
||||
android:hint="@string/hint_job_title"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox"
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainerHighest"
|
||||
app:boxStrokeColor="?attr/colorPrimary"
|
||||
app:cursorColor="?attr/colorPrimary"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant">
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainer"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/jobTitleInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:minHeight="@dimen/touch_target_min" />
|
||||
android:minHeight="48dp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_sm"
|
||||
android:layout_marginTop="12dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@ -115,26 +64,24 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/hint_seek_url"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox"
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainerHighest"
|
||||
app:boxStrokeColor="?attr/colorPrimary"
|
||||
app:cursorColor="?attr/colorPrimary"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant">
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainer"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/seekUrlInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textUri"
|
||||
android:minHeight="@dimen/touch_target_min" />
|
||||
android:minHeight="48dp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/scrapeButton"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_marginStart="@dimen/space_sm"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="@string/cd_scrape_job"
|
||||
android:minWidth="64dp"
|
||||
android:text="@string/button_scrape" />
|
||||
@ -143,13 +90,11 @@
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:layout_marginTop="16dp"
|
||||
android:hint="@string/hint_job_description"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox"
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainerHighest"
|
||||
app:boxStrokeColor="?attr/colorPrimary"
|
||||
app:cursorColor="?attr/colorPrimary"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant">
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainer"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/jobDescriptionInput"
|
||||
@ -157,19 +102,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top"
|
||||
android:inputType="textMultiLine"
|
||||
android:minLines="4"
|
||||
android:minHeight="@dimen/touch_target_min" />
|
||||
android:minLines="4" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Resume / cover letter input card -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="@dimen/card_radius"
|
||||
android:layout_marginTop="12dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="1dp">
|
||||
@ -178,7 +120,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/space_md">
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -199,7 +141,7 @@
|
||||
android:id="@+id/uploadButton"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_height="48dp"
|
||||
android:contentDescription="@string/cd_upload_document"
|
||||
android:text="@string/button_upload" />
|
||||
</LinearLayout>
|
||||
@ -208,13 +150,11 @@
|
||||
android:id="@+id/docInputLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_sm"
|
||||
android:layout_marginTop="12dp"
|
||||
android:hint="@string/hint_your_resume"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox"
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainerHighest"
|
||||
app:boxStrokeColor="?attr/colorPrimary"
|
||||
app:cursorColor="?attr/colorPrimary"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant">
|
||||
app:boxBackgroundColor="?attr/colorSurfaceContainer"
|
||||
app:hintTextColor="?attr/colorOnSurfaceVariant"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/docInput"
|
||||
@ -222,8 +162,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top"
|
||||
android:inputType="textMultiLine"
|
||||
android:minLines="6"
|
||||
android:minHeight="@dimen/touch_target_min" />
|
||||
android:minLines="6" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@ -231,19 +170,18 @@
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submitButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/generate_resume" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="@dimen/space_xxl"
|
||||
android:layout_height="@dimen/space_xxl"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:layout_marginTop="16dp"
|
||||
android:contentDescription="@string/cd_loading"
|
||||
android:indeterminateTint="?attr/colorPrimary"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
@ -7,15 +7,14 @@
|
||||
android:background="?attr/colorSurface"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/space_md">
|
||||
android:padding="16dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/space_md"
|
||||
android:layout_marginVertical="@dimen/space_sm"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="@dimen/card_radius_large"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="1dp">
|
||||
@ -25,36 +24,27 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/space_lg">
|
||||
|
||||
<!-- Status badge: now a tonal chip-style pill -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="?attr/colorPrimaryContainer"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeWidth="0dp">
|
||||
android:padding="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/statusBadge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_status_badge"
|
||||
android:contentDescription="@string/status_queued"
|
||||
android:gravity="center"
|
||||
android:minHeight="32dp"
|
||||
android:paddingHorizontal="@dimen/space_md"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="@string/status_queued"
|
||||
android:textAppearance="?attr/textAppearanceLabelLarge"
|
||||
android:textColor="?attr/colorOnPrimaryContainer" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
android:textColor="?attr/colorOnPrimary" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/statusProgress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_lg"
|
||||
android:layout_marginTop="24dp"
|
||||
android:contentDescription="@string/content_generation_running"
|
||||
android:indeterminate="true"
|
||||
app:indicatorColor="?attr/colorPrimary"
|
||||
@ -64,7 +54,7 @@
|
||||
android:id="@+id/statusMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/job_wait_message"
|
||||
android:textAppearance="?attr/textAppearanceBodyLarge"
|
||||
@ -74,7 +64,7 @@
|
||||
android:id="@+id/statusDetail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_sm"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
android:textColor="?attr/colorOnSurfaceVariant"
|
||||
@ -84,8 +74,8 @@
|
||||
android:id="@+id/tryAgainButton"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_marginTop="@dimen/space_lg"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:minWidth="120dp"
|
||||
android:text="@string/try_again"
|
||||
android:visibility="gone" />
|
||||
|
||||
@ -5,55 +5,24 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Hero header for list screen -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_gradient_primary"
|
||||
android:minHeight="@dimen/hero_header_min_height"
|
||||
android:padding="@dimen/space_lg">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="top|end"
|
||||
android:alpha="0.25"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_sparkle" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|start"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_title"
|
||||
android:textAppearance="?attr/textAppearanceLabelMedium"
|
||||
android:textColor="?attr/colorOnPrimary"
|
||||
android:textStyle="bold" />
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/myResumesTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_xs"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/my_resumes_title"
|
||||
android:textAppearance="?attr/textAppearanceHeadlineMedium"
|
||||
android:textColor="?attr/colorOnPrimary" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
android:textAppearance="?attr/textAppearanceHeadlineSmall"
|
||||
android:textColor="?attr/colorOnSurface" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/myResumesEmpty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/space_md"
|
||||
android:layout_marginTop="@dimen/space_xl"
|
||||
android:layout_marginTop="32dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/my_resumes_empty"
|
||||
android:textAppearance="?attr/textAppearanceBodyLarge"
|
||||
@ -65,7 +34,7 @@
|
||||
android:id="@+id/myResumesProgress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:layout_marginTop="16dp"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:indicatorColor="?attr/colorPrimary"
|
||||
@ -76,12 +45,9 @@
|
||||
android:id="@+id/myResumesList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="@dimen/space_md"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:clipToPadding="false"
|
||||
android:layout_marginTop="8dp"
|
||||
android:divider="@null"
|
||||
android:listSelector="@android:color/transparent"
|
||||
android:paddingBottom="@dimen/space_md"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@ -8,15 +8,13 @@
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.ResultFragment">
|
||||
|
||||
<!-- Top action bar card with tonal surface -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/space_md"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:layout_marginBottom="@dimen/space_sm"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="@dimen/card_radius"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="1dp">
|
||||
@ -25,31 +23,23 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/touch_target_min"
|
||||
android:minHeight="48dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/space_sm">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="?attr/colorSuccessContainer"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeWidth="0dp">
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/resultBadge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_status_badge"
|
||||
android:contentDescription="@string/status_completed"
|
||||
android:gravity="center"
|
||||
android:minHeight="32dp"
|
||||
android:paddingHorizontal="@dimen/space_md"
|
||||
android:paddingHorizontal="12dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="@string/status_completed"
|
||||
android:textAppearance="?attr/textAppearanceLabelLarge"
|
||||
android:textColor="?attr/colorOnSuccessContainer" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
android:textColor="?attr/colorOnPrimary" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
@ -60,7 +50,7 @@
|
||||
android:id="@+id/copyButton"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_height="48dp"
|
||||
android:contentDescription="@string/cd_copy_result"
|
||||
android:minWidth="64dp"
|
||||
android:text="@string/copy_text" />
|
||||
@ -69,8 +59,8 @@
|
||||
android:id="@+id/newButton"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_marginStart="@dimen/space_xs"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:contentDescription="@string/cd_new_job"
|
||||
android:minWidth="64dp"
|
||||
android:text="@string/new_job" />
|
||||
@ -81,19 +71,17 @@
|
||||
android:id="@+id/resultWebView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="@dimen/space_md"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/result_preview" />
|
||||
|
||||
<!-- Export action bar with tonal surface -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/space_md"
|
||||
android:layout_marginTop="@dimen/space_sm"
|
||||
android:layout_marginBottom="@dimen/space_md"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="@dimen/card_radius"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="1dp">
|
||||
@ -102,14 +90,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/space_sm">
|
||||
android:padding="12dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/pdfButton"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_marginEnd="@dimen/space_sm"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/cd_export_pdf"
|
||||
android:text="@string/export_pdf" />
|
||||
@ -118,8 +106,8 @@
|
||||
android:id="@+id/docxButton"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_marginStart="@dimen/space_sm"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/cd_export_docx"
|
||||
android:text="@string/export_docx" />
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@ -4,45 +4,17 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="@dimen/space_sm"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="@dimen/card_radius"
|
||||
android:layout_marginVertical="6dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:rippleColor="?attr/colorPrimaryContainer"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/touch_target_min"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/space_md">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="@dimen/space_xxl"
|
||||
android:layout_height="@dimen/space_xxl"
|
||||
app:cardBackgroundColor="?attr/colorPrimaryContainer"
|
||||
app:cardCornerRadius="@dimen/card_radius"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/result_preview"
|
||||
android:src="@drawable/ic_document"
|
||||
app:tint="?attr/colorOnPrimaryContainer" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/space_md"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemTitle"
|
||||
@ -58,19 +30,10 @@
|
||||
android:id="@+id/itemSubtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_xs"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
android:textColor="?attr/colorOnSurfaceVariant"
|
||||
tools:text="Resume · 12 Aug 2026" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="@dimen/space_sm"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_circle_status"
|
||||
app:tint="?attr/colorOnSurfaceVariant" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_gradient_primary"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/space_lg">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLowest"
|
||||
app:cardCornerRadius="@dimen/card_radius"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/healthIndicator"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_margin="@dimen/space_xs"
|
||||
android:contentDescription="@string/cd_health_indicator"
|
||||
android:src="@drawable/ic_circle_status" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_md"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/unknown_user"
|
||||
android:textAppearance="?attr/textAppearanceTitleMedium"
|
||||
android:textColor="?attr/colorOnPrimary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userEmail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/space_xs"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
android:textColor="?attr/colorOnPrimary" />
|
||||
|
||||
</LinearLayout>
|
||||
13
app/src/main/res/menu/menu_main.xml
Normal file
13
app/src/main/res/menu/menu_main.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/menuMyResumes"
|
||||
android:title="@string/menu_my_resumes" />
|
||||
<item
|
||||
android:id="@+id/menuAdminPanel"
|
||||
android:title="@string/menu_admin_panel"
|
||||
android:visible="false" />
|
||||
<item
|
||||
android:id="@+id/menuSignOut"
|
||||
android:title="@string/menu_sign_out" />
|
||||
</menu>
|
||||
@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<group
|
||||
android:id="@+id/navGroupActions"
|
||||
android:checkableBehavior="single">
|
||||
<item
|
||||
android:id="@+id/navBuildResume"
|
||||
android:icon="@drawable/ic_sparkle"
|
||||
android:title="@string/tab_build_resume" />
|
||||
<item
|
||||
android:id="@+id/navBuildCoverLetter"
|
||||
android:icon="@drawable/ic_sparkle"
|
||||
android:title="@string/tab_build_cover_letter" />
|
||||
|
||||
<item
|
||||
android:id="@+id/navMyResumes"
|
||||
android:icon="@drawable/ic_circle_status"
|
||||
android:title="@string/menu_my_resumes" />
|
||||
</group>
|
||||
|
||||
<group
|
||||
android:id="@+id/navGroupAdmin"
|
||||
android:checkableBehavior="none">
|
||||
<item
|
||||
android:id="@+id/navAdmin"
|
||||
android:title="@string/menu_admin_panel"
|
||||
android:visible="false" />
|
||||
</group>
|
||||
|
||||
<group
|
||||
android:id="@+id/navGroupAccount"
|
||||
android:checkableBehavior="none">
|
||||
<item
|
||||
android:id="@+id/navSignOut"
|
||||
android:title="@string/menu_sign_out" />
|
||||
</group>
|
||||
|
||||
</menu>
|
||||
@ -1,43 +1,41 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<style name="Theme.ResBuilder" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Primary color roles (dark): bright teal on deep surfaces -->
|
||||
<item name="colorPrimary">#80DADC</item>
|
||||
<!-- Primary color roles (dark) -->
|
||||
<item name="colorPrimary">#4DD9DB</item>
|
||||
<item name="colorOnPrimary">#003738</item>
|
||||
<item name="colorPrimaryContainer">#005A5C</item>
|
||||
<item name="colorOnPrimaryContainer">#B5F2F3</item>
|
||||
<item name="colorPrimaryInverse">#004F4F</item>
|
||||
<item name="colorPrimaryFixed">#80DADC</item>
|
||||
<item name="colorOnPrimaryFixed">#002020</item>
|
||||
<item name="colorPrimaryContainer">#004F51</item>
|
||||
<item name="colorOnPrimaryContainer">#6FF6F8</item>
|
||||
<item name="colorPrimaryInverse">#006A6C</item>
|
||||
|
||||
<!-- Secondary color roles (dark) -->
|
||||
<item name="colorSecondary">#9CBEBD</item>
|
||||
<item name="colorOnSecondary">#1B3534</item>
|
||||
<item name="colorSecondaryContainer">#2F4A49</item>
|
||||
<item name="colorOnSecondaryContainer">#BDD6D5</item>
|
||||
<item name="colorSecondary">#B0CCCB</item>
|
||||
<item name="colorOnSecondary">#1B3535</item>
|
||||
<item name="colorSecondaryContainer">#324C4B</item>
|
||||
<item name="colorOnSecondaryContainer">#CCE8E7</item>
|
||||
|
||||
<!-- Tertiary color roles (dark) -->
|
||||
<item name="colorTertiary">#A4C9E8</item>
|
||||
<item name="colorOnTertiary">#0B2D45</item>
|
||||
<item name="colorTertiaryContainer">#27475F</item>
|
||||
<item name="colorOnTertiaryContainer">#BFE0FF</item>
|
||||
<item name="colorTertiary">#B1C8E8</item>
|
||||
<item name="colorOnTertiary">#19324C</item>
|
||||
<item name="colorTertiaryContainer">#324963</item>
|
||||
<item name="colorOnTertiaryContainer">#D2E4FF</item>
|
||||
|
||||
<!-- Surface color roles (dark): deep charcoal-teal -->
|
||||
<item name="android:colorBackground">#0C1414</item>
|
||||
<item name="colorSurface">#0C1414</item>
|
||||
<item name="colorOnSurface">#E0ECEC</item>
|
||||
<item name="colorSurfaceVariant">#3F4A4A</item>
|
||||
<item name="colorOnSurfaceVariant">#BEC9C9</item>
|
||||
<item name="colorSurfaceContainerLowest">#070E0E</item>
|
||||
<item name="colorSurfaceContainerLow">#121B1B</item>
|
||||
<item name="colorSurfaceContainer">#182222</item>
|
||||
<item name="colorSurfaceContainerHigh">#242D2D</item>
|
||||
<item name="colorSurfaceContainerHighest">#303939</item>
|
||||
<item name="colorSurfaceInverse">#E0ECEC</item>
|
||||
<item name="colorOnSurfaceInverse">#0C1414</item>
|
||||
<!-- Surface color roles (dark) -->
|
||||
<item name="android:colorBackground">#0E1515</item>
|
||||
<item name="colorSurface">#0E1515</item>
|
||||
<item name="colorOnSurface">#DDE4E4</item>
|
||||
<item name="colorSurfaceVariant">#3F4949</item>
|
||||
<item name="colorOnSurfaceVariant">#BEC9C8</item>
|
||||
<item name="colorSurfaceContainerLowest">#090F0F</item>
|
||||
<item name="colorSurfaceContainerLow">#161D1D</item>
|
||||
<item name="colorSurfaceContainer">#1A2121</item>
|
||||
<item name="colorSurfaceContainerHigh">#242B2B</item>
|
||||
<item name="colorSurfaceContainerHighest">#2F3636</item>
|
||||
<item name="colorSurfaceInverse">#DDE4E4</item>
|
||||
<item name="colorOnSurfaceInverse">#2D3131</item>
|
||||
|
||||
<!-- Outline -->
|
||||
<item name="colorOutline">#899999</item>
|
||||
<item name="colorOutlineVariant">#3F4A4A</item>
|
||||
<item name="colorOutline">#889393</item>
|
||||
<item name="colorOutlineVariant">#3F4949</item>
|
||||
|
||||
<!-- Error (dark) -->
|
||||
<item name="colorError">#F2B8B5</item>
|
||||
@ -61,12 +59,12 @@
|
||||
<item name="colorInfoContainer">#0B4576</item>
|
||||
<item name="colorOnInfoContainer">#D4EAFB</item>
|
||||
|
||||
<!-- System bars -->
|
||||
<!-- System bars - edge-to-edge ready (dark) -->
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
|
||||
<!-- Typography -->
|
||||
<!-- M3 Typography and shape defaults inherited from Material3 parent -->
|
||||
<item name="textAppearanceDisplayLarge">@style/TextAppearance.Material3.DisplayLarge</item>
|
||||
<item name="textAppearanceDisplayMedium">@style/TextAppearance.Material3.DisplayMedium</item>
|
||||
<item name="textAppearanceDisplaySmall">@style/TextAppearance.Material3.DisplaySmall</item>
|
||||
@ -83,7 +81,7 @@
|
||||
<item name="textAppearanceLabelMedium">@style/TextAppearance.Material3.LabelMedium</item>
|
||||
<item name="textAppearanceLabelSmall">@style/TextAppearance.Material3.LabelSmall</item>
|
||||
|
||||
<!-- Component defaults -->
|
||||
<!-- Default M3 component styles inherited from Material3 parent; explicit overrides kept to a minimum -->
|
||||
<item name="materialButtonStyle">@style/Widget.Material3.Button</item>
|
||||
<item name="materialButtonOutlinedStyle">@style/Widget.Material3.Button.OutlinedButton</item>
|
||||
|
||||
|
||||
@ -2,58 +2,56 @@
|
||||
<resources>
|
||||
<!-- Material Design 3 semantic color tokens -->
|
||||
|
||||
<!-- Primary palette: rich teal with stronger contrast -->
|
||||
<color name="primary">#004F4F</color>
|
||||
<!-- Primary palette -->
|
||||
<color name="primary">#006A6C</color>
|
||||
<color name="on_primary">#FFFFFF</color>
|
||||
<color name="primary_container">#B5F2F3</color>
|
||||
<color name="on_primary_container">#002020</color>
|
||||
<color name="primary_fixed">#B5F2F3</color>
|
||||
<color name="on_primary_fixed">#002020</color>
|
||||
<color name="primary_container">#6FF6F8</color>
|
||||
<color name="on_primary_container">#002021</color>
|
||||
|
||||
<!-- Secondary palette: cool slate with more depth -->
|
||||
<color name="secondary">#3D5252</color>
|
||||
<!-- Secondary palette -->
|
||||
<color name="secondary">#4A6363</color>
|
||||
<color name="on_secondary">#FFFFFF</color>
|
||||
<color name="secondary_container">#BDD6D5</color>
|
||||
<color name="on_secondary_container">#041E1E</color>
|
||||
<color name="secondary_container">#CCE8E7</color>
|
||||
<color name="on_secondary_container">#051F1F</color>
|
||||
|
||||
<!-- Tertiary palette: deep blue-grey accent -->
|
||||
<color name="tertiary">#365064</color>
|
||||
<!-- Tertiary palette -->
|
||||
<color name="tertiary">#4B617C</color>
|
||||
<color name="on_tertiary">#FFFFFF</color>
|
||||
<color name="tertiary_container">#BFE0FF</color>
|
||||
<color name="on_tertiary_container">#001D31</color>
|
||||
<color name="tertiary_container">#D2E4FF</color>
|
||||
<color name="on_tertiary_container">#051E35</color>
|
||||
|
||||
<!-- Surface colors: warmer off-white base with visible tonal elevation -->
|
||||
<color name="surface">#FAFDFD</color>
|
||||
<color name="on_surface">#0A1414</color>
|
||||
<color name="surface_variant">#D8E5E5</color>
|
||||
<color name="on_surface_variant">#3F4A4A</color>
|
||||
<!-- Surface colors -->
|
||||
<color name="surface">#F4FBFB</color>
|
||||
<color name="on_surface">#161D1D</color>
|
||||
<color name="surface_variant">#DAE5E4</color>
|
||||
<color name="on_surface_variant">#3F4949</color>
|
||||
<color name="surface_container_lowest">#FFFFFF</color>
|
||||
<color name="surface_container_low">#F0F6F6</color>
|
||||
<color name="surface_container">#E8F1F1</color>
|
||||
<color name="surface_container_high">#DFEAEA</color>
|
||||
<color name="surface_container_highest">#D6E4E4</color>
|
||||
<color name="surface_container_low">#EEF6F6</color>
|
||||
<color name="surface_container">#E8F0F0</color>
|
||||
<color name="surface_container_high">#E2EAEA</color>
|
||||
<color name="surface_container_highest">#DDE5E5</color>
|
||||
|
||||
<!-- Outline -->
|
||||
<color name="outline">#6F7E7E</color>
|
||||
<color name="outline_variant">#BEC9C9</color>
|
||||
<color name="outline">#6F7979</color>
|
||||
<color name="outline_variant">#BEC9C8</color>
|
||||
|
||||
<!-- Status / Semantic colors: richer and more saturated -->
|
||||
<color name="success">#2E7D32</color>
|
||||
<!-- Status / Semantic colors -->
|
||||
<color name="success">#4CAF50</color>
|
||||
<color name="on_success">#FFFFFF</color>
|
||||
<color name="success_container">#D9F6DA</color>
|
||||
<color name="on_success_container">#1F5E22</color>
|
||||
|
||||
<color name="warning">#E65100</color>
|
||||
<color name="warning">#FF9800</color>
|
||||
<color name="on_warning">#FFFFFF</color>
|
||||
<color name="warning_container">#FFE3B6</color>
|
||||
<color name="on_warning_container">#693B00</color>
|
||||
|
||||
<color name="error">#C62828</color>
|
||||
<color name="error">#F44336</color>
|
||||
<color name="on_error">#FFFFFF</color>
|
||||
<color name="error_container">#F9DEDC</color>
|
||||
<color name="on_error_container">#410E0B</color>
|
||||
|
||||
<color name="info">#1565C0</color>
|
||||
<color name="info">#2196F3</color>
|
||||
<color name="on_info">#FFFFFF</color>
|
||||
<color name="info_container">#D4EAFB</color>
|
||||
<color name="on_info_container">#0B4576</color>
|
||||
@ -61,19 +59,20 @@
|
||||
<!-- Inverse surface -->
|
||||
<color name="inverse_surface">#2D3131</color>
|
||||
<color name="inverse_on_surface">#DFE4E4</color>
|
||||
<color name="inverse_primary">#80DADC</color>
|
||||
<color name="inverse_primary">#4DD9DB</color>
|
||||
|
||||
<!-- Status indicator palettes -->
|
||||
<!-- Status indicator palettes (kept for programmatic tint compatibility) -->
|
||||
<color name="status_healthy">@color/success</color>
|
||||
<color name="status_degraded">@color/warning</color>
|
||||
<color name="status_unhealthy">@color/error</color>
|
||||
|
||||
<!-- Legacy aliases -->
|
||||
<!-- Legacy aliases to avoid breaking any remaining references during migration -->
|
||||
<color name="purple_200">@color/primary_container</color>
|
||||
<color name="purple_500">@color/primary</color>
|
||||
<color name="purple_700">@color/on_primary_container</color>
|
||||
<color name="teal_200">@color/primary_container</color>
|
||||
<color name="teal_700">@color/primary</color>
|
||||
<!-- Legacy neutral aliases kept for programmatic compatibility in unchanged Kotlin code -->
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Spacing system: multiples of 4dp -->
|
||||
<dimen name="space_xs">4dp</dimen>
|
||||
<dimen name="space_sm">8dp</dimen>
|
||||
<dimen name="space_md">16dp</dimen>
|
||||
<dimen name="space_lg">24dp</dimen>
|
||||
<dimen name="space_xl">32dp</dimen>
|
||||
<dimen name="space_xxl">48dp</dimen>
|
||||
|
||||
<!-- Component dimensions -->
|
||||
<dimen name="card_radius">12dp</dimen>
|
||||
<dimen name="card_radius_large">16dp</dimen>
|
||||
<dimen name="button_height">48dp</dimen>
|
||||
<dimen name="touch_target_min">48dp</dimen>
|
||||
<dimen name="hero_header_min_height">160dp</dimen>
|
||||
<dimen name="app_logo_size">64dp</dimen>
|
||||
</resources>
|
||||
@ -6,14 +6,6 @@
|
||||
<string name="checking_auth">Checking authentication…</string>
|
||||
<string name="welcome_subtitle">AI-powered resume and cover letter builder</string>
|
||||
<string name="sign_in_terms">By signing in, you agree to our Terms of Service and Privacy Policy</string>
|
||||
<string name="sign_in_interrupted">Sign-in interrupted</string>
|
||||
<string name="no_id_token">No ID token from Google</string>
|
||||
<string name="invalid_google_id_token">Invalid Google ID token: %1$s</string>
|
||||
<string name="unexpected_credential_type">Unexpected credential type</string>
|
||||
<string name="no_google_accounts">No Google accounts found on device</string>
|
||||
<string name="sign_in_cancelled">Sign-in cancelled</string>
|
||||
<string name="sign_in_failed">Sign-in failed: %1$s</string>
|
||||
<string name="welcome_user">Welcome %1$s</string>
|
||||
|
||||
<!-- Main -->
|
||||
<string name="app_title">resBuilder</string>
|
||||
@ -23,7 +15,6 @@
|
||||
<string name="menu_admin_panel">Admin Panel</string>
|
||||
<string name="usage_limit_banner">You have reached your free limit. Please contact support to upgrade.</string>
|
||||
<string name="unknown_user">Unknown user</string>
|
||||
<string name="unknown_email">Not signed in</string>
|
||||
|
||||
<!-- Job form -->
|
||||
<string name="hint_job_title">Job Title</string>
|
||||
@ -37,7 +28,6 @@
|
||||
<string name="generate_cover_letter">Generate Cover Letter</string>
|
||||
<string name="please_log_in">Please log in to continue</string>
|
||||
<string name="fields_required">Please fill in all fields</string>
|
||||
<string name="enter_url">Enter a URL</string>
|
||||
|
||||
<!-- Status -->
|
||||
<string name="status_queued">Queued</string>
|
||||
@ -56,9 +46,6 @@
|
||||
<string name="export_docx">DOCX</string>
|
||||
<string name="copied_to_clipboard">Copied to clipboard</string>
|
||||
<string name="nothing_to_copy">Nothing to copy</string>
|
||||
<string name="exporting">Exporting…</string>
|
||||
<string name="export_failed">Export failed</string>
|
||||
<string name="export_no_viewer">No app found to open this file</string>
|
||||
|
||||
<!-- Accessibility labels -->
|
||||
<string name="cd_app_logo">resBuilder app logo</string>
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
<item name="colorPrimaryContainer">@color/primary_container</item>
|
||||
<item name="colorOnPrimaryContainer">@color/on_primary_container</item>
|
||||
<item name="colorPrimaryInverse">@color/inverse_primary</item>
|
||||
<item name="colorPrimaryFixed">@color/primary_fixed</item>
|
||||
<item name="colorOnPrimaryFixed">@color/on_primary_fixed</item>
|
||||
|
||||
<!-- Secondary color roles -->
|
||||
<item name="colorSecondary">@color/secondary</item>
|
||||
@ -66,7 +64,7 @@
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
|
||||
<!-- M3 Typography -->
|
||||
<!-- M3 Typography and shape defaults inherited from Material3 parent -->
|
||||
<item name="textAppearanceDisplayLarge">@style/TextAppearance.Material3.DisplayLarge</item>
|
||||
<item name="textAppearanceDisplayMedium">@style/TextAppearance.Material3.DisplayMedium</item>
|
||||
<item name="textAppearanceDisplaySmall">@style/TextAppearance.Material3.DisplaySmall</item>
|
||||
@ -83,10 +81,11 @@
|
||||
<item name="textAppearanceLabelMedium">@style/TextAppearance.Material3.LabelMedium</item>
|
||||
<item name="textAppearanceLabelSmall">@style/TextAppearance.Material3.LabelSmall</item>
|
||||
|
||||
<!-- Default M3 component styles -->
|
||||
<!-- Default M3 component styles inherited from Material3 parent; explicit overrides kept to a minimum -->
|
||||
<item name="materialButtonStyle">@style/Widget.Material3.Button</item>
|
||||
<item name="materialButtonOutlinedStyle">@style/Widget.Material3.Button.OutlinedButton</item>
|
||||
|
||||
<!-- Window background uses surface so app surfaces are always theme-aware -->
|
||||
<item name="android:windowBackground">?attr/colorSurface</item>
|
||||
</style>
|
||||
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<cache-path
|
||||
name="exports"
|
||||
path="exports/" />
|
||||
</paths>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<!-- Enforce HTTPS for the backend API domain. Cleartext is disallowed. -->
|
||||
<domain-config cleartextTrafficPermitted="false">
|
||||
<domain includeSubdomains="false">resume.aridgwayweb.com</domain>
|
||||
</domain-config>
|
||||
<base-config cleartextTrafficPermitted="false" />
|
||||
</network-security-config>
|
||||
@ -1,81 +0,0 @@
|
||||
package com.example.resbuilder
|
||||
|
||||
import com.example.resbuilder.data.model.JobListResponse
|
||||
import com.example.resbuilder.data.model.JobSummary
|
||||
import com.google.gson.Gson
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Tests for the API response models introduced with the "My Resumes" feature.
|
||||
*
|
||||
* These verify the exact wire format expected from `GET /jobs` so that a backend
|
||||
* contract change fails loudly here rather than silently breaking the UI.
|
||||
*/
|
||||
class JobListModelsTest {
|
||||
|
||||
private val gson = Gson()
|
||||
|
||||
@Test
|
||||
fun `parses a completed resume job from the backend shape`() {
|
||||
val json = """
|
||||
{
|
||||
"jobs": [
|
||||
{
|
||||
"job_id": "abc-123",
|
||||
"type": "resume",
|
||||
"status": "completed",
|
||||
"title": "Senior Android Engineer",
|
||||
"created_at": "2026-08-04T12:00:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
""".trimIndent()
|
||||
|
||||
val parsed = gson.fromJson(json, JobListResponse::class.java)
|
||||
|
||||
assertEquals(1, parsed.jobs.size)
|
||||
val job = parsed.jobs[0]
|
||||
assertEquals("abc-123", job.job_id)
|
||||
assertEquals("resume", job.type)
|
||||
assertEquals("completed", job.status)
|
||||
assertEquals("Senior Android Engineer", job.title)
|
||||
assertEquals("2026-08-04T12:00:00Z", job.created_at)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `title is null when backend omits it`() {
|
||||
val json = """
|
||||
{"jobs": [{"job_id": "x", "type": "cover_letter", "status": "queued"}]}
|
||||
""".trimIndent()
|
||||
|
||||
val parsed = gson.fromJson(json, JobListResponse::class.java)
|
||||
val job = parsed.jobs[0]
|
||||
|
||||
assertNull(job.title)
|
||||
assertNull(job.created_at)
|
||||
assertEquals("cover_letter", job.type)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `empty jobs list parses to empty collection`() {
|
||||
val json = """{"jobs": []}"""
|
||||
|
||||
val parsed = gson.fromJson(json, JobListResponse::class.java)
|
||||
|
||||
assertTrue(parsed.jobs.isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `JobSummary fields are immutable`() {
|
||||
val job = JobSummary(job_id = "id", type = "resume", status = "completed")
|
||||
|
||||
// Reflectively assert all fields are val (final). This guards against
|
||||
// regressions that would make the model mutable and thread-unsafe.
|
||||
for (field in JobSummary::class.java.declaredFields) {
|
||||
assertEquals("Field ${field.name} must be final", java.lang.reflect.Modifier.FINAL, field.modifiers and java.lang.reflect.Modifier.FINAL)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -13,15 +13,9 @@ googlePlayServicesAuth = "20.7.0"
|
||||
credentialManager = "1.5.0-beta01"
|
||||
googleid = "1.1.1"
|
||||
kotlinxCoroutines = "1.9.0"
|
||||
lifecycleViewmodel = "2.8.7"
|
||||
lifecycleRuntime = "2.8.7"
|
||||
fragmentKtx = "1.8.5"
|
||||
|
||||
[libraries]
|
||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodel" }
|
||||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntime" }
|
||||
androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragmentKtx" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user