Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/25 custom headers #35

Merged
merged 62 commits into from
Nov 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e1d18fc
wip
GrakovNe Nov 1, 2024
b906cb4
wip
GrakovNe Nov 1, 2024
9bae398
wip
GrakovNe Nov 1, 2024
85ecea6
wip
GrakovNe Nov 1, 2024
f0895ac
wip
GrakovNe Nov 1, 2024
773c512
Merge branch 'refs/heads/main' into feature/25-custom-headers
GrakovNe Nov 5, 2024
ae077f0
Merge branch 'refs/heads/main' into feature/25-custom-headers
GrakovNe Nov 5, 2024
af02219
wip
GrakovNe Nov 5, 2024
3b7a457
wip
GrakovNe Nov 5, 2024
98e3401
wip
GrakovNe Nov 5, 2024
9183cf4
wip
GrakovNe Nov 5, 2024
7772ef5
wip
GrakovNe Nov 5, 2024
182ecee
wip
GrakovNe Nov 5, 2024
f691bad
wip
GrakovNe Nov 5, 2024
6b4fe6e
wip
GrakovNe Nov 5, 2024
700dc7a
wip
GrakovNe Nov 5, 2024
e85706b
wip
GrakovNe Nov 5, 2024
84ea9ee
wip
GrakovNe Nov 5, 2024
1ff8547
wip
GrakovNe Nov 5, 2024
859b956
wip
GrakovNe Nov 5, 2024
2899588
wip
GrakovNe Nov 5, 2024
0a7487d
wip
GrakovNe Nov 5, 2024
7d4e080
wip
GrakovNe Nov 5, 2024
4e2db2e
wip
GrakovNe Nov 5, 2024
83ae350
wip
GrakovNe Nov 5, 2024
3a590ca
wip
GrakovNe Nov 5, 2024
5eda8c7
wip
GrakovNe Nov 5, 2024
032ecd2
wip
GrakovNe Nov 5, 2024
48aa54c
wip
GrakovNe Nov 5, 2024
33c75b1
wip
GrakovNe Nov 5, 2024
45901ed
wip
GrakovNe Nov 5, 2024
de3b849
wip
GrakovNe Nov 5, 2024
2545302
wip
GrakovNe Nov 5, 2024
31c6648
wip
GrakovNe Nov 5, 2024
4176b91
wip
GrakovNe Nov 5, 2024
c446d5b
wip
GrakovNe Nov 5, 2024
ad107f0
wip
GrakovNe Nov 6, 2024
2e566dc
wip
GrakovNe Nov 6, 2024
d8d0ac6
wip
GrakovNe Nov 6, 2024
86b94af
wip
GrakovNe Nov 6, 2024
1b53503
wip
GrakovNe Nov 6, 2024
bc1b130
wip
GrakovNe Nov 6, 2024
3fce882
wip
GrakovNe Nov 6, 2024
57f75b4
wip
GrakovNe Nov 6, 2024
18cd438
wip
GrakovNe Nov 6, 2024
9b42dd4
wip
GrakovNe Nov 6, 2024
44b369e
wip
GrakovNe Nov 6, 2024
18c959c
wip
GrakovNe Nov 6, 2024
8343e2e
wip
GrakovNe Nov 6, 2024
39699b5
wip
GrakovNe Nov 6, 2024
9903c22
wip
GrakovNe Nov 6, 2024
b594436
wip
GrakovNe Nov 6, 2024
77cb9a0
wip
GrakovNe Nov 6, 2024
4469e2c
Merge branch 'main' into feature/25-custom-headers
GrakovNe Nov 7, 2024
6aa29ae
version set
GrakovNe Nov 7, 2024
19c2aec
wip
GrakovNe Nov 7, 2024
5c079e5
wip
GrakovNe Nov 7, 2024
3b068be
wip
GrakovNe Nov 7, 2024
b7b3201
wip
GrakovNe Nov 7, 2024
fe9e5c6
wip
GrakovNe Nov 7, 2024
73318ad
wip
GrakovNe Nov 7, 2024
7015187
version set
GrakovNe Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
GrakovNe committed Nov 6, 2024
commit ad107f00ad30847037d986ebbbcf5a0adeaa1d15
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
package org.grakovne.lissen.ui.screens.settings.advanced

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.DeleteOutline
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MaterialTheme.colorScheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import org.grakovne.lissen.R
@@ -29,48 +38,53 @@ fun CustomHeaderComposable(
onChanged: (ServerCustomHeader) -> Unit,
onDelete: (ServerCustomHeader) -> Unit
) {
Row(

Card(
shape = RoundedCornerShape(12.dp),
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
verticalAlignment = Alignment.CenterVertically
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)
) {
Column(
modifier = Modifier.weight(1f)
Row(
modifier = Modifier
.fillMaxWidth()
.background(colorScheme.surfaceContainer)
.padding(start = 16.dp, end = 0.dp, top = 16.dp, bottom = 16.dp),
verticalAlignment = Alignment.CenterVertically
) {
OutlinedTextField(
value = header.name,
onValueChange = { onChanged(header.copy(name = it, value = header.value)) },
label = { Text(stringResource(R.string.custom_header_hint_name)) },
singleLine = true,
shape = RoundedCornerShape(16.dp),
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp)
)

OutlinedTextField(
value = header.value,
onValueChange = { onChanged(header.copy(name = header.name, value = it)) },
label = { Text(stringResource(R.string.custom_header_hint_value)) },
singleLine = true,
shape = RoundedCornerShape(16.dp),
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp)
)
}
Column(
modifier = Modifier.weight(1f)
) {
OutlinedTextField(
value = header.name,
onValueChange = { onChanged(header.copy(name = it, value = header.value)) },
label = { Text(stringResource(R.string.custom_header_hint_name)) },
singleLine = true,
shape = RoundedCornerShape(16.dp),
modifier = Modifier.fillMaxWidth()
)

Spacer(modifier = Modifier.width(16.dp))
OutlinedTextField(
value = header.value,
onValueChange = { onChanged(header.copy(name = header.name, value = it)) },
label = { Text(stringResource(R.string.custom_header_hint_value)) },
singleLine = true,
shape = RoundedCornerShape(16.dp),
modifier = Modifier.fillMaxWidth()
)
}

IconButton(
onClick = { onDelete(header) }
) {
Icon(
imageVector = Icons.Default.DeleteOutline,
contentDescription = null,
modifier = Modifier.size(36.dp)
)
IconButton(
onClick = { onDelete(header) }
) {
Icon(
imageVector = Icons.Default.DeleteOutline,
contentDescription = null,
tint = colorScheme.error,
modifier = Modifier.size(24.dp)
)
}
}
}

Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.outlined.Add
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FabPosition
import androidx.compose.material3.FloatingActionButton
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@
<string name="library_search_hint">Поиск по автору или названию</string>
<string name="player_screen_title">Сейчас играет</string>
<string name="settings_screen_custom_headers_title">Прокси-заголовки</string>
<string name="settings_screen_custom_header_hint">Заголовки для подключения к серверу</string>
<string name="settings_screen_custom_header_hint">Заголовки</string>
<string name="custom_header_hint_name">Ключ</string>
<string name="custom_header_hint_value">Значение</string>
<string name="custom_headers_title">Прокси-заголовки</string>