实现拾见像素可爱风界面并记录真机验收
This commit is contained in:
@@ -13,8 +13,8 @@ android {
|
||||
applicationId = "com.jieliu.app"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 46
|
||||
versionName = "0.1.45"
|
||||
versionCode = 47
|
||||
versionName = "0.1.46"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
|
||||
@@ -9,16 +9,20 @@ import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.graphics.drawable.RippleDrawable
|
||||
import android.graphics.drawable.StateListDrawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.provider.Settings
|
||||
import android.text.InputType
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowInsets
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.AdapterView
|
||||
@@ -52,6 +56,14 @@ import java.util.concurrent.FutureTask
|
||||
|
||||
class MainActivity : Activity() {
|
||||
private enum class Tab { TASK, SETTINGS, LOGS }
|
||||
private enum class ButtonStyle(val fill: Int, val text: Int) {
|
||||
PRIMARY(R.color.ui_coral, R.color.ui_paper),
|
||||
SECONDARY(R.color.ui_blue_tint, R.color.ui_blue),
|
||||
DESTRUCTIVE(R.color.ui_coral_tint, R.color.ui_coral_pressed),
|
||||
CONFIRM_DESTRUCTIVE(R.color.ui_coral_pressed, R.color.ui_paper),
|
||||
TAB(R.color.ui_nav_surface, R.color.ui_blue),
|
||||
SELECTED_TAB(R.color.ui_selected, R.color.ui_blue),
|
||||
}
|
||||
|
||||
private data class TaskView(
|
||||
val checkpoint: TaskCheckpoint?, val connected: Boolean, val step: String?, val notificationsOff: Boolean,
|
||||
@@ -110,6 +122,7 @@ class MainActivity : Activity() {
|
||||
}
|
||||
if (Build.VERSION.SDK_INT in 30..34) configureEdgeToEdge()
|
||||
setContentView(R.layout.activity_main)
|
||||
findViewById<ImageView>(R.id.brand_mascot).clipToOutline = true
|
||||
val root = findViewById<View>(R.id.root)
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
root.setOnApplyWindowInsetsListener { view, insets ->
|
||||
@@ -234,7 +247,10 @@ class MainActivity : Activity() {
|
||||
currentFocus?.let { getSystemService(InputMethodManager::class.java).hideSoftInputFromWindow(it.windowToken, 0) }
|
||||
}
|
||||
selected = tab
|
||||
tabs.forEachIndexed { index, button -> styleButton(button, index == selected.ordinal) }
|
||||
tabs.forEachIndexed { index, button ->
|
||||
button.isSelected = index == selected.ordinal
|
||||
styleButton(button, if (button.isSelected) ButtonStyle.SELECTED_TAB else ButtonStyle.TAB)
|
||||
}
|
||||
taskView = null
|
||||
logVersion = -1
|
||||
content.removeAllViews()
|
||||
@@ -294,15 +310,16 @@ class MainActivity : Activity() {
|
||||
else -> "准备运行"
|
||||
}
|
||||
return column().apply {
|
||||
addView(card(title).apply {
|
||||
addView(card(title, status = true).apply {
|
||||
val modeLabel = bilibiliScope?.label ?: if (plan.replyMode == ReplyMode.BROWSE) ReplyMode.BROWSE.label else ReplyMode.TEMPLATES.label
|
||||
addView(label("$platform · $modeLabel", 15))
|
||||
addView(label("$platform · $modeLabel", 15, bold = true))
|
||||
addView(label(view.step ?: checkpoint?.message ?: "内容类型 ${searchTypes.size} 个 · 单次 ${plan.limit} 个$contentUnit", 15))
|
||||
val limit = checkpoint?.plan?.limit ?: plan.limit
|
||||
addView(ProgressBar(this@MainActivity, null, android.R.attr.progressBarStyleHorizontal).apply {
|
||||
max = limit
|
||||
progress = completed
|
||||
progressTintList = ColorStateList.valueOf(GREEN)
|
||||
progressTintList = ColorStateList.valueOf(getColor(R.color.ui_green))
|
||||
progressBackgroundTintList = ColorStateList.valueOf(getColor(R.color.ui_grass_line))
|
||||
contentDescription = "已处理 $completed 个$contentUnit,共 $limit 个"
|
||||
}, LinearLayout.LayoutParams(-1, dp(18)))
|
||||
addView(label("已处理$contentUnit $completed / $limit · $confirmedLabel ${checkpoint?.sentCount ?: 0} 条", 14))
|
||||
@@ -360,22 +377,18 @@ class MainActivity : Activity() {
|
||||
private fun settingsPage() = column().apply {
|
||||
addView(guardedPage(::configPage))
|
||||
addView(card("本机数据").apply {
|
||||
addView(action("一键清除所有已保存数据", click = ::confirmClearSavedData).apply {
|
||||
setTextColor(ALERT)
|
||||
background = RippleDrawable(ColorStateList.valueOf(0x22863c15), rounded(0xffffeee6.toInt(), 12), null)
|
||||
})
|
||||
(layoutParams as LinearLayout.LayoutParams).topMargin = dp(12)
|
||||
addView(action("一键清除所有已保存数据", destructive = true, click = ::confirmClearSavedData))
|
||||
})
|
||||
}
|
||||
|
||||
private fun confirmClearSavedData() {
|
||||
checkSavedDataCanBeCleared()
|
||||
val dialog = AlertDialog.Builder(this)
|
||||
showDialog(AlertDialog.Builder(this)
|
||||
.setTitle("清除所有已保存数据?")
|
||||
.setMessage("将清除拾见本机保存的配置、内容库、绑定图片、任务检查点和运行日志。DeepSeek 密钥会保留。清除后恢复默认设置,此操作无法撤销。")
|
||||
.setNegativeButton("取消", null)
|
||||
.setPositiveButton("清除数据") { _, _ -> perform(::startSavedDataReset) }
|
||||
.show()
|
||||
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(ALERT)
|
||||
.setPositiveButton("清除数据") { _, _ -> perform(::startSavedDataReset) }, destructive = true)
|
||||
}
|
||||
|
||||
private fun checkSavedDataCanBeCleared() {
|
||||
@@ -719,7 +732,7 @@ class MainActivity : Activity() {
|
||||
Triple("移除图片", true, null),
|
||||
)
|
||||
photoControls.addView(buttonRow(operations.map { (title, available, movedTo) ->
|
||||
action(title) {
|
||||
action(title, destructive = movedTo == null) {
|
||||
val latest = findPhrase(target) ?: return@action
|
||||
if (latest.photos != entries || photoImport != null) return@action
|
||||
val reordered = entries.toMutableList()
|
||||
@@ -742,21 +755,38 @@ class MainActivity : Activity() {
|
||||
private fun logsPage() = column().apply {
|
||||
val lines = store.recentLog()
|
||||
addView(card("运行日志").apply {
|
||||
if (lines.isEmpty()) addView(label("启动任务后会在这里显示运行步骤。", 15))
|
||||
lines.forEach { addView(label(it, 14, color = if (" 异常 " in it) ALERT else INK)) }
|
||||
if (lines.isEmpty()) addView(label("启动任务后会在这里显示运行步骤。", 15, color = getColor(R.color.ui_muted)))
|
||||
lines.forEach { addView(logEntry(it)) }
|
||||
})
|
||||
}
|
||||
|
||||
private fun logEntry(line: String) = column().apply {
|
||||
val warning = " 异常 " in line
|
||||
val dateEnd = line.indexOf(" ")
|
||||
val fill = getColor(if (warning) R.color.ui_coral_tint else R.color.ui_grass_tint)
|
||||
val border = getColor(if (warning) R.color.ui_coral_tint else R.color.ui_grass_line)
|
||||
val text = getColor(if (warning) R.color.ui_coral_pressed else R.color.ui_ink)
|
||||
background = rounded(fill, 10, border)
|
||||
setPadding(dp(10), dp(6), dp(10), dp(6))
|
||||
layoutParams = LinearLayout.LayoutParams(-1, -2).apply { bottomMargin = dp(7) }
|
||||
if (dateEnd >= 0) {
|
||||
addView(label(line.substring(0, dateEnd), 12, color = getColor(R.color.ui_muted)).apply { setPadding(0, 0, 0, 0) })
|
||||
}
|
||||
addView(label(line.substring(if (dateEnd >= 0) dateEnd + 2 else 0), 14, color = text).apply { setPadding(0, 0, 0, 0) })
|
||||
}
|
||||
|
||||
private fun photoPreview(photo: TemplatePhoto, index: Int) = column().apply {
|
||||
addView(label("图片 ${index + 1} · ${photo.displayName}", 14))
|
||||
val bitmap = photos.thumbnail(photo)
|
||||
if (bitmap == null) {
|
||||
addView(label("图片缺失或无法预览。", 14, color = ALERT))
|
||||
addView(label("图片缺失或无法预览。", 14, color = getColor(R.color.ui_coral_pressed)))
|
||||
} else {
|
||||
addView(ImageView(this@MainActivity).apply {
|
||||
setImageBitmap(bitmap)
|
||||
adjustViewBounds = true
|
||||
scaleType = ImageView.ScaleType.FIT_CENTER
|
||||
background = rounded(getColor(R.color.ui_field), 9, getColor(R.color.ui_line))
|
||||
clipToOutline = true
|
||||
contentDescription = "第 ${index + 1} 张图片预览"
|
||||
}, LinearLayout.LayoutParams(dp(96), dp(76)))
|
||||
}
|
||||
@@ -773,7 +803,7 @@ class MainActivity : Activity() {
|
||||
photoCount > 1 -> "已在目标应用看到这条评论的文字和全部 $photoCount 张图片?"
|
||||
else -> "已在目标应用看到这条评论?"
|
||||
}
|
||||
AlertDialog.Builder(this).setMessage(prompt)
|
||||
showDialog(AlertDialog.Builder(this).setMessage(prompt)
|
||||
.setNegativeButton("返回", null)
|
||||
.setPositiveButton("确认") { _, _ -> perform {
|
||||
check(!TaskControl.inProgress) { "请先暂停任务。" }
|
||||
@@ -788,18 +818,18 @@ class MainActivity : Activity() {
|
||||
}
|
||||
store.appendLog(message)
|
||||
renderTask()
|
||||
} }.show()
|
||||
} }, destructive = outcome != Outcome.USER_CONFIRMED)
|
||||
}
|
||||
|
||||
private fun abandon() {
|
||||
AlertDialog.Builder(this).setMessage("放弃当前任务并清空这次的恢复进度?")
|
||||
showDialog(AlertDialog.Builder(this).setMessage("放弃当前任务并清空这次的恢复进度?")
|
||||
.setNegativeButton("返回", null)
|
||||
.setPositiveButton("放弃") { _, _ -> perform {
|
||||
check(!TaskControl.inProgress && store.readCheckpoint()?.pending == null) { "请先核对待确认的评论。" }
|
||||
store.clearCheckpoint()
|
||||
store.appendLog("用户放弃了当前任务")
|
||||
renderTask()
|
||||
} }.show()
|
||||
} }, destructive = true)
|
||||
}
|
||||
|
||||
private fun column() = LinearLayout(this).apply {
|
||||
@@ -807,14 +837,30 @@ class MainActivity : Activity() {
|
||||
isFocusableInTouchMode = true
|
||||
}
|
||||
|
||||
private fun card(title: String) = column().apply {
|
||||
background = rounded(Color.WHITE, 18)
|
||||
private fun card(title: String, status: Boolean = false) = column().apply {
|
||||
val fill = getColor(if (status) R.color.ui_grass_card else R.color.ui_paper)
|
||||
val border = getColor(if (status) R.color.ui_grass_line else R.color.ui_line)
|
||||
val marker = getColor(if (status) R.color.ui_marker_green else R.color.ui_marker_blue)
|
||||
background = rounded(fill, 19, border)
|
||||
elevation = dp(1).toFloat()
|
||||
setPadding(dp(16), dp(12), dp(16), dp(14))
|
||||
layoutParams = LinearLayout.LayoutParams(-1, -2).apply { bottomMargin = dp(12) }
|
||||
addView(label(title, 19, bold = true))
|
||||
addView(LinearLayout(this@MainActivity).apply {
|
||||
gravity = Gravity.CENTER_VERTICAL
|
||||
addView(View(this@MainActivity).apply {
|
||||
importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
|
||||
background = LayerDrawable(arrayOf(rounded(border, 0), rounded(marker, 0))).apply {
|
||||
setLayerInset(0, dp(3), dp(3), 0, 0)
|
||||
setLayerInset(1, 0, 0, dp(3), dp(3))
|
||||
}
|
||||
}, LinearLayout.LayoutParams(dp(10), dp(10)).apply { marginEnd = dp(9) })
|
||||
addView(label(title, 18, bold = true, color = getColor(if (status) R.color.ui_green else R.color.ui_ink)).apply {
|
||||
if (Build.VERSION.SDK_INT >= 28) isAccessibilityHeading = true
|
||||
}, LinearLayout.LayoutParams(0, -2, 1f))
|
||||
})
|
||||
}
|
||||
|
||||
private fun label(text: String, size: Int, bold: Boolean = false, color: Int = INK) = TextView(this).apply {
|
||||
private fun label(text: String, size: Int, bold: Boolean = false, color: Int = getColor(R.color.ui_ink)) = TextView(this).apply {
|
||||
this.text = text
|
||||
textSize = size.toFloat()
|
||||
setTextColor(color)
|
||||
@@ -826,10 +872,21 @@ class MainActivity : Activity() {
|
||||
adapter = choiceAdapter(values)
|
||||
setSelection(selected)
|
||||
minimumHeight = dp(48)
|
||||
setBackgroundResource(R.drawable.ui_dropdown)
|
||||
setPaddingRelative(dp(12), 0, dp(34), 0)
|
||||
setPopupBackgroundDrawable(rounded(getColor(R.color.ui_paper), 12, getColor(R.color.ui_line)))
|
||||
}
|
||||
|
||||
private fun choiceAdapter(values: List<String>) = ArrayAdapter(this, android.R.layout.simple_spinner_item, values).apply {
|
||||
setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
private fun choiceAdapter(values: List<String>) = object : ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, values) {
|
||||
init { setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) }
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View =
|
||||
(super.getView(position, convertView, parent) as TextView).apply {
|
||||
setTextColor(getColor(R.color.ui_ink))
|
||||
textSize = 15f
|
||||
ellipsize = TextUtils.TruncateAt.END
|
||||
maxLines = 1
|
||||
}
|
||||
}
|
||||
|
||||
private fun libraryChoices(entries: List<Pair<String, String>>, selectedId: String?, placeholder: String, select: (String) -> Unit): Spinner =
|
||||
@@ -851,15 +908,17 @@ class MainActivity : Activity() {
|
||||
contentDescription = "编辑$entity"
|
||||
applyEnabled(hasSelection)
|
||||
},
|
||||
action("删除", click = delete).apply {
|
||||
action("删除", destructive = true, click = delete).apply {
|
||||
contentDescription = "删除$entity"
|
||||
applyEnabled(hasSelection)
|
||||
},
|
||||
))
|
||||
|
||||
private fun buttonRow(buttons: List<Button>) = LinearLayout(this).apply {
|
||||
buttons.forEach { button ->
|
||||
addView(button, LinearLayout.LayoutParams(0, -2, 1f).apply { marginEnd = dp(4) })
|
||||
buttons.forEachIndexed { index, button ->
|
||||
addView(button, LinearLayout.LayoutParams(0, -2, 1f).apply {
|
||||
if (index < buttons.lastIndex) marginEnd = dp(5)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -869,8 +928,8 @@ class MainActivity : Activity() {
|
||||
setPadding(dp(20), dp(12), dp(20), 0)
|
||||
addView(input, LinearLayout.LayoutParams(-1, -2))
|
||||
}
|
||||
val dialog = AlertDialog.Builder(this).setTitle(title).setView(fields)
|
||||
.setNegativeButton("取消", null).setPositiveButton("完成", null).show()
|
||||
val dialog = showDialog(AlertDialog.Builder(this).setTitle(title).setView(fields)
|
||||
.setNegativeButton("取消", null).setPositiveButton("完成", null))
|
||||
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||
perform {
|
||||
val text = input.value()
|
||||
@@ -883,8 +942,23 @@ class MainActivity : Activity() {
|
||||
}
|
||||
|
||||
private fun confirmDelete(prompt: String, delete: () -> Unit) {
|
||||
AlertDialog.Builder(this).setMessage(prompt).setNegativeButton("取消", null)
|
||||
.setPositiveButton("删除") { _, _ -> perform(delete) }.show()
|
||||
showDialog(AlertDialog.Builder(this).setMessage(prompt).setNegativeButton("取消", null)
|
||||
.setPositiveButton("删除") { _, _ -> perform(delete) }, destructive = true)
|
||||
}
|
||||
|
||||
private fun showDialog(builder: AlertDialog.Builder, destructive: Boolean = false): AlertDialog = builder.show().apply {
|
||||
window?.setBackgroundDrawable(rounded(getColor(R.color.ui_paper), 23, getColor(R.color.ui_coral_tint)))
|
||||
findViewById<TextView>(android.R.id.message)?.setTextColor(getColor(R.color.ui_ink))
|
||||
getButton(AlertDialog.BUTTON_NEGATIVE)?.let { button ->
|
||||
styleButton(button, ButtonStyle.SECONDARY)
|
||||
(button.layoutParams as? ViewGroup.MarginLayoutParams)?.marginEnd = dp(8)
|
||||
}
|
||||
getButton(AlertDialog.BUTTON_POSITIVE)?.let { button ->
|
||||
styleButton(button, if (destructive) ButtonStyle.CONFIRM_DESTRUCTIVE else ButtonStyle.PRIMARY)
|
||||
(button.parent as? View)?.let { row ->
|
||||
row.setPaddingRelative(row.paddingStart, row.paddingTop, row.paddingEnd, row.paddingBottom + dp(8))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun field(value: String, hint: String, multiline: Boolean = false, number: Boolean = false) = EditText(this).apply {
|
||||
@@ -898,10 +972,15 @@ class MainActivity : Activity() {
|
||||
setText(value)
|
||||
this.hint = hint
|
||||
textSize = 15f
|
||||
setTextColor(INK)
|
||||
setTextColor(getColor(R.color.ui_ink))
|
||||
setHintTextColor(getColor(R.color.ui_muted))
|
||||
setPadding(dp(12), dp(9), dp(12), dp(9))
|
||||
minimumHeight = dp(46)
|
||||
background = rounded(SURFACE, 9)
|
||||
minimumHeight = dp(48)
|
||||
background = StateListDrawable().apply {
|
||||
val fill = getColor(R.color.ui_field)
|
||||
addState(intArrayOf(android.R.attr.state_focused), rounded(fill, 12, getColor(R.color.ui_blue)))
|
||||
addState(intArrayOf(), rounded(fill, 12, getColor(R.color.ui_line)))
|
||||
}
|
||||
}
|
||||
|
||||
private fun LinearLayout.addField(title: String, field: View): TextView {
|
||||
@@ -921,30 +1000,43 @@ class MainActivity : Activity() {
|
||||
}, LinearLayout.LayoutParams(-1, -2).apply { bottomMargin = dp(8) })
|
||||
}
|
||||
|
||||
private fun action(title: String, primary: Boolean = false, click: () -> Unit) = Button(this).apply {
|
||||
private fun action(title: String, primary: Boolean = false, destructive: Boolean = false, click: () -> Unit) = Button(this).apply {
|
||||
text = title
|
||||
layoutParams = LinearLayout.LayoutParams(-1, -2).apply { topMargin = dp(7) }
|
||||
styleButton(this, primary)
|
||||
styleButton(this, when {
|
||||
destructive -> ButtonStyle.DESTRUCTIVE
|
||||
primary -> ButtonStyle.PRIMARY
|
||||
else -> ButtonStyle.SECONDARY
|
||||
})
|
||||
setOnClickListener { perform(click) }
|
||||
}
|
||||
|
||||
private fun styleButton(button: Button, primary: Boolean) = with(button) {
|
||||
private fun styleButton(button: Button, style: ButtonStyle) = with(button) {
|
||||
isAllCaps = false
|
||||
textSize = 15f
|
||||
setTextColor(if (primary) Color.WHITE else GREEN)
|
||||
setTypeface(typeface, Typeface.BOLD)
|
||||
val disabled = intArrayOf(-android.R.attr.state_enabled)
|
||||
setTextColor(ColorStateList(arrayOf(disabled, intArrayOf()), intArrayOf(getColor(R.color.ui_muted), getColor(style.text))))
|
||||
minHeight = dp(48)
|
||||
setPaddingRelative(dp(8), dp(7), dp(8), dp(7))
|
||||
stateListAnimator = null
|
||||
background = RippleDrawable(ColorStateList.valueOf(0x220b412c), rounded(if (primary) GREEN else TINT, 12), null)
|
||||
val surface = StateListDrawable().apply {
|
||||
addState(disabled, rounded(getColor(R.color.ui_disabled), 13))
|
||||
addState(intArrayOf(), rounded(getColor(style.fill), 13))
|
||||
}
|
||||
val filledCoral = style == ButtonStyle.PRIMARY || style == ButtonStyle.CONFIRM_DESTRUCTIVE
|
||||
val ripple = if (filledCoral) 0x30ffffff else 0x2431588f
|
||||
background = RippleDrawable(ColorStateList.valueOf(ripple), surface, null)
|
||||
}
|
||||
|
||||
private fun View.applyEnabled(enabled: Boolean) {
|
||||
isEnabled = enabled
|
||||
alpha = if (enabled) 1f else .48f
|
||||
}
|
||||
|
||||
private fun rounded(color: Int, radius: Int) = GradientDrawable().apply {
|
||||
private fun rounded(color: Int, radius: Int, stroke: Int = Color.TRANSPARENT) = GradientDrawable().apply {
|
||||
setColor(color)
|
||||
cornerRadius = dp(radius).toFloat()
|
||||
if (stroke != Color.TRANSPARENT) setStroke(dp(1), stroke)
|
||||
}
|
||||
|
||||
private fun needsNotificationPermission() = Build.VERSION.SDK_INT >= 33 &&
|
||||
@@ -977,10 +1069,5 @@ class MainActivity : Activity() {
|
||||
|
||||
private companion object {
|
||||
const val PICK_TEMPLATE_PHOTO = 32
|
||||
val INK = Color.rgb(23, 42, 36)
|
||||
val GREEN = Color.rgb(7, 108, 83)
|
||||
val SURFACE = Color.rgb(243, 245, 240)
|
||||
val TINT = Color.rgb(229, 240, 232)
|
||||
val ALERT = Color.rgb(134, 60, 21)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#2231588F">
|
||||
<item>
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/ui_field" />
|
||||
<corners android:radius="12dp" />
|
||||
<stroke android:width="1dp" android:color="@color/ui_line" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:drawable="@drawable/ui_dropdown_arrow"
|
||||
android:end="13dp"
|
||||
android:gravity="end|center_vertical"
|
||||
android:height="6dp"
|
||||
android:width="10dp" />
|
||||
</layer-list>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="10dp"
|
||||
android:height="6dp"
|
||||
android:viewportWidth="10"
|
||||
android:viewportHeight="6">
|
||||
<path android:fillColor="@color/ui_blue" android:pathData="M0,1h10L5,6z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient android:angle="315" android:startColor="#FFF3F5" android:endColor="@color/ui_coral_tint" />
|
||||
<corners android:radius="20dp" />
|
||||
<stroke android:width="1dp" android:color="#F5CED7" />
|
||||
</shape>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="36dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="36"
|
||||
android:viewportHeight="28">
|
||||
<path android:fillColor="#E49AAB" android:pathData="M6,8h5v5h5v5h-5v5H6v-5H1v-5h5z" />
|
||||
<path android:fillColor="#88AEE0" android:pathData="M21,2h5v5h-5z" />
|
||||
<path android:fillColor="#A7CDA9" android:pathData="M30,22h5v5h-5z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/launcher_sky" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/ui_nav_surface" />
|
||||
<item
|
||||
android:height="1dp"
|
||||
android:gravity="top"
|
||||
android:drawable="@color/ui_line" />
|
||||
</layer-list>
|
||||
@@ -5,17 +5,50 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="22dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="22dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="#172A24"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/ui_header"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="76dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="13dp"
|
||||
android:paddingTop="11dp"
|
||||
android:paddingEnd="13dp"
|
||||
android:paddingBottom="11dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/brand_mascot"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/ui_mascot_thumbnail"
|
||||
android:contentDescription="@null"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/launcher_artwork" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/ui_ink"
|
||||
android:textSize="27sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="@null"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ui_header_pixels" />
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/page_scroll"
|
||||
@@ -24,10 +57,10 @@
|
||||
android:layout_weight="1"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingBottom="8dp">
|
||||
android:paddingStart="14dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/page_content"
|
||||
@@ -39,11 +72,12 @@
|
||||
style="?android:attr/buttonBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ui_navigation"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="18dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingEnd="18dp"
|
||||
android:paddingBottom="7dp">
|
||||
android:paddingStart="14dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingBottom="8dp">
|
||||
<Button
|
||||
android:id="@+id/tab_task"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.Shijian" parent="Theme.Shijian.Base">
|
||||
<item name="android:navigationBarColor">#F3F5F0</item>
|
||||
<item name="android:navigationBarColor">@color/ui_nav_surface</item>
|
||||
<item name="android:windowLightNavigationBar">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="launcher_sky">#7BABF8</color>
|
||||
<color name="ui_ink">#25354E</color>
|
||||
<color name="ui_muted">#50627C</color>
|
||||
<color name="ui_screen">#EDF5FF</color>
|
||||
<color name="ui_paper">#FFFFFF</color>
|
||||
<color name="ui_line">#CCDDF5</color>
|
||||
<color name="ui_blue">#31588F</color>
|
||||
<color name="ui_blue_tint">#E7F0FF</color>
|
||||
<color name="ui_field">#F3F8FF</color>
|
||||
<color name="ui_selected">#DCE9FE</color>
|
||||
<color name="ui_disabled">#E2EBF8</color>
|
||||
<color name="ui_nav_surface">#F6FAFF</color>
|
||||
<color name="ui_marker_blue">#82ADE6</color>
|
||||
<color name="ui_coral">#B64154</color>
|
||||
<color name="ui_coral_pressed">#9D354B</color>
|
||||
<color name="ui_coral_tint">#FFE8EC</color>
|
||||
<color name="ui_green">#267252</color>
|
||||
<color name="ui_grass_tint">#E9F7EB</color>
|
||||
<color name="ui_grass_line">#CDE7D3</color>
|
||||
<color name="ui_marker_green">#77AF86</color>
|
||||
<color name="ui_grass_card">#F6FCF7</color>
|
||||
</resources>
|
||||
|
||||
@@ -2,12 +2,22 @@
|
||||
<resources>
|
||||
<style name="Theme.Shijian.Base" parent="android:style/Theme.Material.Light.NoActionBar">
|
||||
<item name="android:fontFamily">sans</item>
|
||||
<item name="android:colorAccent">#076C53</item>
|
||||
<item name="android:windowBackground">#F3F5F0</item>
|
||||
<item name="android:statusBarColor">#F3F5F0</item>
|
||||
<item name="android:navigationBarColor">#172A24</item>
|
||||
<item name="android:colorAccent">@color/ui_coral</item>
|
||||
<item name="android:colorControlNormal">@color/ui_blue</item>
|
||||
<item name="android:textColorPrimary">@color/ui_ink</item>
|
||||
<item name="android:textColorSecondary">@color/ui_muted</item>
|
||||
<item name="android:windowBackground">@color/ui_screen</item>
|
||||
<item name="android:statusBarColor">@color/ui_screen</item>
|
||||
<item name="android:navigationBarColor">@color/ui_ink</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:windowActionModeOverlay">true</item>
|
||||
<item name="android:alertDialogTheme">@style/Theme.Shijian.Dialog</item>
|
||||
</style>
|
||||
<style name="Theme.Shijian" parent="Theme.Shijian.Base" />
|
||||
<style name="Theme.Shijian.Dialog" parent="android:style/Theme.Material.Light.Dialog.Alert">
|
||||
<item name="android:colorAccent">@color/ui_coral</item>
|
||||
<item name="android:colorControlNormal">@color/ui_blue</item>
|
||||
<item name="android:textColorPrimary">@color/ui_ink</item>
|
||||
<item name="android:textColorSecondary">@color/ui_muted</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user