Skip to content

Commit

Permalink
Merge branch 'hanks-zyh-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
aistra0528 committed Mar 8, 2024
2 parents a230d55 + dc7757f commit 76b8ad1
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 20 deletions.
2 changes: 2 additions & 0 deletions app/src/main/kotlin/com/aistra/hail/app/HailData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ object HailData {
const val MODE_ISLAND_HIDE = ISLAND + HIDE
const val MODE_ISLAND_SUSPEND = ISLAND + SUSPEND
private const val TILE_ACTION = "tile_action"
private const val HOME_FONT_SIZE = "home_font_size"
const val DYNAMIC_SHORTCUT_ACTION = "dynamic_shortcut_action"
const val ACTION_NONE = "none"
const val ACTION_FREEZE_ALL = "freeze_all"
Expand Down Expand Up @@ -89,6 +90,7 @@ object HailData {
val grayscaleIcon get() = sp.getBoolean(GRAYSCALE_ICON, true)
val compactIcon get() = sp.getBoolean(COMPACT_ICON, false)
val tileAction get() = sp.getString(TILE_ACTION, ACTION_FREEZE_ALL)
val homeFontSize get() = sp.getInt(HOME_FONT_SIZE, 14)
val dynamicShortcutAction get() = sp.getString(DYNAMIC_SHORTCUT_ACTION, ACTION_NONE)!!
val synthesizeAdaptiveIcons get() = sp.getBoolean(SYNTHESIZE_ADAPTIVE_ICONS, false)
val autoFreezeAfterLock get() = sp.getBoolean(AUTO_FREEZE_AFTER_LOCK, false)
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/kotlin/com/aistra/hail/ui/home/PagerAdapter.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.aistra.hail.ui.home

import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -62,6 +63,7 @@ class PagerAdapter(private val selectedList: List<AppInfo>) :
info.state == AppInfo.STATE_UNKNOWN -> setTextColor(context.getColorStateList(R.color.color_warn))
else -> setTextAppearance(com.google.android.material.R.style.TextAppearance_Material3_BodyMedium)
}
setTextSize(TypedValue.COMPLEX_UNIT_SP, HailData.homeFontSize.toFloat())
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_baseline_text_fields.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M2.5,4v3h5v12h3V7h5V4H2.5zM21.5,9h-9v3h3v7h3v-7h3V9z"/>
</vector>
40 changes: 20 additions & 20 deletions app/src/main/res/layout/item_home.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/control_margin"
android:background="?selectableItemBackgroundBorderless"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:viewBindingIgnore="true">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/control_margin"
android:background="?selectableItemBackgroundBorderless"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:viewBindingIgnore="true">

<ImageView
android:id="@+id/app_icon"
android:layout_width="@dimen/app_icon_size"
android:layout_height="@dimen/app_icon_size"
android:contentDescription="@null"
android:padding="@dimen/control_padding" />
android:id="@+id/app_icon"
android:layout_width="@dimen/app_icon_size"
android:layout_height="@dimen/app_icon_size"
android:contentDescription="@null"
android:padding="@dimen/control_padding"/>

<com.google.android.material.textview.MaterialTextView
android:id="@+id/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_horizontal"
android:maxLines="2"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" />
android:id="@+id/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_horizontal"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"/>
</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@
<string name="command">命令</string>
<string name="tag">标签</string>
<string name="nine_key">九键搜索</string>
<string name="home_font_size">首页字体大小</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,5 @@
<string name="freeze_system_app">Freezing system applications may cause the device to bootloop. Make sure you know what you are doing and backup your data in advance or use recovery that supports file management.</string>
<string name="action_continue">Continue</string>
<string name="nine_key">T9 Search</string>
<string name="home_font_size">Home font size</string>
</resources>
9 changes: 9 additions & 0 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
app:icon="@drawable/ic_outline_layers"
app:key="synthesize_adaptive_icons"
app:title="@string/synthesize_adaptive_icons"/>
<SeekBarPreference
android:max="16"
app:defaultValue="14"
app:icon="@drawable/ic_baseline_text_fields"
app:key="home_font_size"
app:min="11"
app:showSeekBarValue="true"
app:singleLineTitle="false"
app:title="@string/home_font_size"/>
<SwitchPreferenceCompat
app:defaultValue="false"
app:icon="@drawable/ic_baseline_dialpad"
Expand Down

0 comments on commit 76b8ad1

Please sign in to comment.