Skip to content

Commit 3be0cbe

Browse files
authored
Merge pull request #16 from pyramidzzzzz/master
truncate display name on ComposeView
2 parents ab7e4c6 + fa758dc commit 3be0cbe

2 files changed

Lines changed: 43 additions & 38 deletions

File tree

.github/workflows/android.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
name: Build Android APK
22

33
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
88

99
concurrency:
10-
group: ${{ github.workflow }}-${{ github.ref }}
11-
cancel-in-progress: true
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
1212

1313
jobs:
14-
build:
15-
name: Build APK
16-
runs-on: ubuntu-latest
17-
timeout-minutes: 30
18-
19-
steps:
20-
- name: Checkout repository
21-
uses: actions/checkout@v4
22-
23-
- name: Set up JDK
24-
uses: actions/setup-java@v4
25-
with:
26-
java-version: '17'
27-
distribution: 'temurin'
28-
cache: 'gradle'
29-
30-
- name: Grant execute permission for gradlew
31-
run: chmod +x gradlew
32-
33-
- name: Build APK
34-
run: ./gradlew assembleDebug --no-daemon
35-
36-
- name: Upload APK
37-
uses: actions/upload-artifact@v4
38-
with:
39-
name: apk
40-
path: androidApp/build/outputs/apk/debug/*.apk
14+
build:
15+
name: Build APK
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 30
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up JDK
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '17'
27+
distribution: 'temurin'
28+
cache: 'gradle'
29+
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x gradlew
32+
33+
- name: Build APK
34+
run: ./gradlew assembleDebug --no-daemon
35+
36+
- name: Upload APK
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: apk
40+
path: androidApp/build/outputs/apk/debug/*.apk

shared/src/commonMain/kotlin/site/remlit/snowdrop/view/ComposeView.kt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,32 @@ fun ComposeView() = ViewSurface {
102102
) {
103103
if (currentAccount != null) {
104104
Row(
105-
modifier = Modifier.padding(10.dp),
105+
modifier = Modifier.padding(10.dp)
106+
.fillMaxWidth(),
106107
horizontalArrangement = Arrangement.spacedBy(10.dp),
107108
verticalAlignment = Alignment.CenterVertically
108109
) {
109110
Avatar(currentAccount!!)
110111

111-
Column {
112+
Column(
113+
modifier = Modifier.weight(1f)
114+
) {
112115
Text(
113116
currentAccount!!.displayName ?: currentAccount!!.username,
114-
fontWeight = FontWeight.Medium
117+
fontWeight = FontWeight.Medium,
118+
overflow = TextOverflow.Ellipsis,
119+
maxLines = 1
115120
)
116121
Text(
117122
"@${currentAccount!!.acct}",
118123
overflow = TextOverflow.Ellipsis,
119124
color = MaterialTheme.colorScheme.onSurfaceVariant,
120-
fontSize = 13.sp
125+
fontSize = 13.sp,
126+
maxLines = 1
121127
)
122128
}
123129

124130
Row(
125-
modifier = Modifier.fillMaxWidth(),
126131
horizontalArrangement = Arrangement.End
127132
) {
128133
Row {

0 commit comments

Comments
 (0)