Skip to content

Commit a203854

Browse files
committed
config(.github)
1 parent 3098541 commit a203854

File tree

6 files changed

+109
-7
lines changed

6 files changed

+109
-7
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
2+
3+
## Pre-launch Checklist
4+
5+
- [ ] I read the rules PR (title, labels, commit messages...).
6+
- [ ] I definitely don't PR files with pointless edits.
7+
- [ ] I added screenshots if change UI/UX (has modified code in lib/src/ui/*).
8+
- [ ] I writen all test cases coverage and all passed.
9+
- [ ] All existing and new tests are passing.
10+
11+
## Testcases covered (check if passed)
12+
13+
- [ ] Case 1
14+
- [ ] Case 2
15+
- [ ] Case 3
16+
17+
## Screenshots (if change UI/UX)

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
enable-beta-ecosystems: true
8+
updates:
9+
- package-ecosystem: "pub"
10+
directory: "/"
11+
schedule:
12+
interval: weekly
13+
time: "07:00"
14+
timezone: Asia/Tokyo
15+
open-pull-requests-limit: 20
16+
- package-ecosystem: "gradle"
17+
directory: "/android"
18+
schedule:
19+
interval: weekly
20+
time: "07:00"
21+
timezone: Asia/Tokyo

app/src/main/java/com/chatgptlite/wanted/ui/common/AppScrollBar.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package com.chatgptlite.wanted.ui.common
33
import androidx.compose.animation.core.animateFloatAsState
44
import androidx.compose.animation.core.tween
55
import androidx.compose.foundation.lazy.LazyListState
6-
import androidx.compose.material3.ExperimentalMaterial3Api
7-
import androidx.compose.material3.MaterialTheme
86
import androidx.compose.runtime.Composable
97
import androidx.compose.runtime.getValue
108
import androidx.compose.ui.Modifier
@@ -19,7 +17,8 @@ import androidx.compose.ui.unit.dp
1917
fun Modifier.simpleVerticalScrollbar(
2018
state: LazyListState,
2119
width: Dp = 8.dp,
22-
color: Color
20+
color: Color,
21+
isReverse: Boolean = false,
2322
): Modifier {
2423
val targetAlpha = if (state.isScrollInProgress) 1f else 0f
2524
val duration = if (state.isScrollInProgress) 150 else 500
@@ -33,17 +32,22 @@ fun Modifier.simpleVerticalScrollbar(
3332
drawContent()
3433

3534
val firstVisibleElementIndex = state.layoutInfo.visibleItemsInfo.firstOrNull()?.index
35+
3636
val needDrawScrollbar = state.isScrollInProgress || alpha > 0.0f
3737

3838
// Draw scrollbar if scrolling or if the animation is still running and lazy column has content
3939
if (needDrawScrollbar && firstVisibleElementIndex != null) {
4040
val elementHeight = this.size.height / state.layoutInfo.totalItemsCount
41-
val scrollbarOffsetY = firstVisibleElementIndex * elementHeight
42-
val scrollbarHeight = state.layoutInfo.visibleItemsInfo.size * elementHeight
41+
val scrollbarOffsetY =
42+
firstVisibleElementIndex * elementHeight + state.firstVisibleItemScrollOffset / 4
43+
val scrollbarHeight = elementHeight * 4
4344

4445
drawRect(
4546
color = color,
46-
topLeft = Offset(this.size.width - width.toPx(), scrollbarOffsetY),
47+
topLeft = Offset(
48+
this.size.width - width.toPx(),
49+
this.center.y * 2 - scrollbarOffsetY
50+
),
4751
size = Size(width.toPx(), scrollbarHeight),
4852
alpha = alpha
4953
)

app/src/main/java/com/chatgptlite/wanted/ui/conversations/Conversations.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.chatgptlite.wanted.ui.conversations
22

33
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.gestures.scrollable
45
import androidx.compose.foundation.layout.*
56
import androidx.compose.foundation.lazy.LazyColumn
67
import androidx.compose.foundation.lazy.rememberLazyListState
78
import androidx.compose.foundation.rememberScrollState
89
import androidx.compose.foundation.shape.RoundedCornerShape
10+
import androidx.compose.foundation.verticalScroll
911
import androidx.compose.material3.MaterialTheme
1012
import androidx.compose.material3.Surface
1113
import androidx.compose.material3.Text
@@ -48,7 +50,7 @@ fun ColumnScope.MessageList(messages: List<MessageModel>) {
4850
.fillMaxWidth()
4951
.weight(1f, false)
5052
.simpleVerticalScrollbar(
51-
listState,
53+
state = listState,
5254
width = 4.dp,
5355
color = MaterialTheme.colorScheme.secondary,
5456
)

0 commit comments

Comments
 (0)