Skip to content

Commit 041c621

Browse files
tumuyanBambooin
authored andcommitted
chore: click item in about activity to copy build info
1 parent 6db78b1 commit 041c621

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,18 @@ If applicable, add screenshots to help explain your problem.
2929
**Smartphone (please complete the following information):**
3030
- Device: [e.g. Xiaomi Mix 4]
3131
- OS: [e.g. Android 11]
32-
- Version: [e.g. 3.2.1]
3332
- Theme: [e.g. Tongwenfeng]
34-
33+
- Version: [e.g. 3.2.1]
34+
- Build info:
35+
```
36+
You could find build info in About Activity and click it to copy.
37+
e.g.
38+
Build: Commit CI
39+
Date: 2022-06-12 10:09 UTC
40+
Commit: v3.2.6-58-gd9b4c1f, 2022-06-12 17:58:14 +0800
41+
Branch: develop
42+
Repository: https://github.com/osfans/trime
43+
```
3544
**Additional context**
3645
Add any other context about the problem here.
3746

app/src/main/java/com/osfans/trime/settings/AboutActivity.kt

+10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package com.osfans.trime.settings
22

3+
import android.content.ClipboardManager
4+
import android.content.Context
35
import android.os.Bundle
46
import android.view.MenuItem
57
import android.webkit.WebView
8+
import android.widget.Toast
69
import androidx.appcompat.app.AlertDialog
710
import androidx.appcompat.app.AppCompatActivity
811
import androidx.appcompat.widget.Toolbar
@@ -109,6 +112,13 @@ class AboutActivity : AppCompatActivity() {
109112
.show()
110113
true
111114
}
115+
116+
"about__buildinfo" -> {
117+
val cbm = context?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
118+
cbm.text = BuildConfig.BUILD_INFO
119+
Toast.makeText(context, R.string.copy_done, Toast.LENGTH_LONG).show()
120+
true
121+
}
112122
else -> super.onPreferenceTreeClick(preference)
113123
}
114124
}

app/src/main/res/values-zh-rCN/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
<string name="keyboard__use_mini_keyboard_title">连接实体键盘时,显示迷你软键盘</string>
205205
<string name="pref_keyboard__candidate">候选栏</string>
206206
<string name="keyboard__candidate_page_size">每页显示候选词数量</string>
207+
<string name="copy_done">已复制</string>
207208
<string-array name="keyboard__candidate_page_size_entries" >
208209
<item name="10000">不超出候选栏</item>
209210
<item name="10001">接近于候选栏</item>

app/src/main/res/values-zh-rTW/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
<string name="keyboard__use_mini_keyboard_title">連接實體鍵盤時,顯示迷你軟鍵盤</string>
206206
<string name="pref_keyboard__candidate">候選欄</string>
207207
<string name="keyboard__candidate_page_size">每頁顯示候選詞數量</string>
208+
<string name="copy_done">已複製</string>
208209
<string-array name="keyboard__candidate_page_size_entries" >
209210
<item name="10000">不超出候選欄</item>
210211
<item name="10001">接近於候選欄</item>

app/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
<string name="keyboard__use_mini_keyboard_title">Show mini keyboard when real keyboard linked</string>
208208
<string name="pref_keyboard__candidate">Candidate</string>
209209
<string name="keyboard__candidate_page_size">Candidate item count for each page</string>
210+
<string name="copy_done">copy done!</string>
210211
<string-array name="keyboard__candidate_page_size_entries" >
211212
<item name="10000">Less than candidate</item>
212213
<item name="10001">close to candidate</item>

0 commit comments

Comments
 (0)