mirror of
https://github.com/FatttSnake/OxygenToolbox.git
synced 2026-04-06 14:01:27 +08:00
Added launch page switch, LibrariesActivity, setting fragment to about fragment action.
This commit is contained in:
10
app/src/main/res/drawable/ic_launch.xml
Normal file
10
app/src/main/res/drawable/ic_launch.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/app_text_theme"
|
||||
android:pathData="M19,19H5V5h7V3H5c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2v-7h-2v7zM14,3v2h3.59l-9.83,9.83 1.41,1.41L19,6.41V10h2V3h-7z" />
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_setting_about.xml
Normal file
10
app/src/main/res/drawable/ic_setting_about.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/app_text_theme"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z" />
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/ic_setting_language.xml
Normal file
12
app/src/main/res/drawable/ic_setting_language.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/app_text_theme"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"
|
||||
tools:ignore="VectorPath" />
|
||||
</vector>
|
||||
37
app/src/main/res/layout/activity_libraries.xml
Normal file
37
app/src/main/res/layout/activity_libraries.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/libraries_page"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.about.LibrariesActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:theme="@style/Theme.OxygenToolbox.AppBarOverlay">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/Theme.OxygenToolbox.PopupOverlay" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/libraries_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_bar_layout"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
129
app/src/main/res/layout/item_libraries.xml
Normal file
129
app/src/main/res/layout/item_libraries.xml
Normal file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/library_item_card_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/library_item_card_margin_vertical"
|
||||
android:layout_marginEnd="@dimen/library_item_card_margin_horizontal"
|
||||
android:layout_marginBottom="@dimen/library_item_card_margin_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="@dimen/library_item_card_inner_padding"
|
||||
android:paddingLeft="@dimen/library_item_card_inner_padding"
|
||||
android:paddingTop="@dimen/library_item_card_inner_padding"
|
||||
android:paddingEnd="@dimen/library_item_card_inner_padding"
|
||||
android:paddingRight="@dimen/library_item_card_inner_padding"
|
||||
android:textAppearance="?textAppearanceHeadline5"
|
||||
app:layout_constraintBottom_toTopOf="@+id/library_creator"
|
||||
app:layout_constraintEnd_toStartOf="@+id/library_version"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Library name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_creator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="@dimen/library_item_card_inner_padding"
|
||||
android:paddingLeft="@dimen/library_item_card_inner_padding"
|
||||
android:paddingEnd="@dimen/library_item_card_inner_padding"
|
||||
android:paddingRight="@dimen/library_item_card_inner_padding"
|
||||
android:textAppearance="?textAppearanceSubtitle1"
|
||||
app:layout_constraintBottom_toTopOf="@+id/library_description_divider"
|
||||
app:layout_constraintEnd_toStartOf="@+id/library_version"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/library_name"
|
||||
tools:text="Creator" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingTop="@dimen/library_item_card_inner_padding"
|
||||
android:paddingEnd="@dimen/library_item_card_inner_padding"
|
||||
android:textAppearance="?textAppearanceBody2"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toBottomOf="@id/library_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/library_name"
|
||||
app:layout_constraintTop_toTopOf="@id/library_name"
|
||||
tools:text="Version" />
|
||||
|
||||
<View
|
||||
android:id="@+id/library_description_divider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="@dimen/library_item_card_divider_padding_vertical"
|
||||
android:layout_marginHorizontal="@dimen/library_item_card_divider_padding_horizontal"
|
||||
android:background="?attr/app_background"
|
||||
app:layout_constraintBottom_toTopOf="@id/library_description"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/library_creator" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/library_item_card_inner_padding"
|
||||
android:layout_marginRight="@dimen/library_item_card_inner_padding"
|
||||
android:maxLines="20"
|
||||
android:textAppearance="?textAppearanceBody2"
|
||||
app:layout_constraintBottom_toTopOf="@id/library_bottom_divider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/library_description_divider"
|
||||
tools:text="This is library description.This is library description.This is library description.This is library description.This is library description.This is library description.This is library description.This is library description." />
|
||||
|
||||
<View
|
||||
android:id="@+id/library_bottom_divider"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="@dimen/library_item_card_divider_padding_vertical"
|
||||
android:layout_marginHorizontal="@dimen/library_item_card_divider_padding_horizontal"
|
||||
android:background="?attr/app_background"
|
||||
app:layout_constraintBottom_toTopOf="@id/library_license"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/library_description" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/library_license"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="@dimen/library_item_card_inner_padding"
|
||||
android:paddingLeft="@dimen/library_item_card_inner_padding"
|
||||
android:paddingEnd="@dimen/library_item_card_inner_padding"
|
||||
android:paddingRight="@dimen/library_item_card_inner_padding"
|
||||
android:paddingBottom="@dimen/library_item_card_inner_padding"
|
||||
android:textAppearance="?textAppearanceBody1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/library_bottom_divider"
|
||||
tools:text="License" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
10
app/src/main/res/menu/seach_view.xml
Normal file
10
app/src/main/res/menu/seach_view.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@android:drawable/ic_menu_search"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/setting_search"
|
||||
app:showAsAction="always"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView" />
|
||||
</menu>
|
||||
@@ -21,7 +21,11 @@
|
||||
android:id="@+id/nav_setting"
|
||||
android:name="com.fatapp.oxygentoolbox.ui.setting.SettingFragment"
|
||||
android:label="@string/menu_setting"
|
||||
tools:layout="@xml/fragment_setting" />
|
||||
tools:layout="@xml/fragment_setting">
|
||||
<action
|
||||
android:id="@+id/action_setting_to_about"
|
||||
app:destination="@id/nav_about" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_about"
|
||||
|
||||
1
app/src/main/res/raw/dependencies.json
Normal file
1
app/src/main/res/raw/dependencies.json
Normal file
File diff suppressed because one or more lines are too long
@@ -27,11 +27,18 @@
|
||||
|
||||
<string name="setting_base_settings">基本设置</string>
|
||||
<string name="setting_language">语言</string>
|
||||
<string name="setting_launch_page">启动页</string>
|
||||
|
||||
<string-array name="setting_language_array">
|
||||
<item>跟随系统</item>
|
||||
<item>中文</item>
|
||||
<item>English</item>
|
||||
</string-array>
|
||||
<string name="setting_launch_page">启动页</string>
|
||||
<string-array name="setting_launch_page_array">
|
||||
<item>工具</item>
|
||||
<item>收藏</item>
|
||||
</string-array>
|
||||
<string name="setting_open_source">开源许可</string>
|
||||
<string name="setting_search">查找</string>
|
||||
<string name="setting_about">关于</string>
|
||||
<string name="setting_about_oxygen_toolbox">关于 氧工具</string>
|
||||
</resources>
|
||||
@@ -27,11 +27,14 @@
|
||||
|
||||
<string name="setting_base_settings">基本设置</string>
|
||||
<string name="setting_language">语言</string>
|
||||
<string name="setting_launch_page">启动页</string>
|
||||
|
||||
<string-array name="setting_language_array">
|
||||
<item>跟随系统</item>
|
||||
<item>中文</item>
|
||||
<item>English</item>
|
||||
</string-array>
|
||||
<string name="setting_launch_page">启动页</string>
|
||||
<string name="setting_open_source">开源许可</string>
|
||||
<string name="setting_search">查找</string>
|
||||
<string name="setting_about">关于</string>
|
||||
<string name="setting_about_oxygen_toolbox">关于 氧工具</string>
|
||||
</resources>
|
||||
@@ -27,11 +27,14 @@
|
||||
|
||||
<string name="setting_base_settings">基本设置</string>
|
||||
<string name="setting_language">语言</string>
|
||||
<string name="setting_launch_page">启动页</string>
|
||||
|
||||
<string-array name="setting_language_array">
|
||||
<item>跟随系统</item>
|
||||
<item>中文</item>
|
||||
<item>English</item>
|
||||
</string-array>
|
||||
<string name="setting_launch_page">启动页</string>
|
||||
<string name="setting_open_source">开源许可</string>
|
||||
<string name="setting_search">查找</string>
|
||||
<string name="setting_about">关于</string>
|
||||
<string name="setting_about_oxygen_toolbox">关于 氧工具</string>
|
||||
</resources>
|
||||
@@ -6,4 +6,10 @@
|
||||
<dimen name="nav_header_vertical_spacing">8dp</dimen>
|
||||
<dimen name="nav_header_height">176dp</dimen>
|
||||
<dimen name="default_text_size">20sp</dimen>
|
||||
|
||||
<dimen name="library_item_card_margin_vertical">16dp</dimen>
|
||||
<dimen name="library_item_card_margin_horizontal">16dp</dimen>
|
||||
<dimen name="library_item_card_inner_padding">16dp</dimen>
|
||||
<dimen name="library_item_card_divider_padding_vertical">8dp</dimen>
|
||||
<dimen name="library_item_card_divider_padding_horizontal">16dp</dimen>
|
||||
</resources>
|
||||
@@ -45,5 +45,21 @@
|
||||
<item>zh_CN</item>
|
||||
<item>en_US</item>
|
||||
</string-array>
|
||||
<string name="setting_language_default_value" translatable="false">default</string>
|
||||
<string name="setting_launch_page">Launch Page</string>
|
||||
<string name="setting_launch_page_key" translatable="false">app_launch_page</string>
|
||||
<string-array name="setting_launch_page_array">
|
||||
<item>Tools</item>
|
||||
<item>Favourites</item>
|
||||
</string-array>
|
||||
<string-array name="setting_launch_page_values">
|
||||
<item>tools</item>
|
||||
<item>favourites</item>
|
||||
</string-array>
|
||||
<string name="setting_launch_page_default_value" translatable="false">tools</string>
|
||||
<string name="setting_open_source">OpenSource</string>
|
||||
<string name="setting_search">Search</string>
|
||||
<string name="setting_about">About</string>
|
||||
<string name="setting_about_oxygen_toolbox">About OxygenToolbox</string>
|
||||
<string name="setting_about_oxygen_toolbox_key" translatable="false">app_about</string>
|
||||
</resources>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="ToolsButton" parent="Widget.AppCompat.Button">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:minWidth">0dp</item>
|
||||
@@ -15,10 +16,12 @@
|
||||
<item name="android:stateListAnimator">@null</item>
|
||||
<item name="android:textColor">@color/default_tools_button_text</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolsLinearLayout">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeSpinner" parent="Widget.AppCompat.Light.DropDownItem.Spinner">
|
||||
<item name="android:textSize">@dimen/default_text_size</item>
|
||||
<item name="android:textColor">?attr/app_text_theme</item>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.OxygenToolbox.Default" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<style name="Theme.OxygenToolbox.Default" parent="Theme.MaterialComponents.DayNight.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/default_app_theme</item>
|
||||
<item name="colorPrimaryVariant">@color/default_app_theme</item>
|
||||
|
||||
@@ -2,20 +2,27 @@
|
||||
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<PreferenceCategory app:title="@string/setting_base_settings">
|
||||
<ListPreference
|
||||
app:defaultValue="default"
|
||||
app:defaultValue="@string/setting_language_default_value"
|
||||
app:entries="@array/setting_language_array"
|
||||
app:entryValues="@array/setting_language_values"
|
||||
app:icon="@drawable/ic_setting_language"
|
||||
app:key="@string/setting_language_key"
|
||||
app:title="@string/setting_language"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
<ListPreference
|
||||
app:defaultValue="@string/setting_launch_page_default_value"
|
||||
app:entries="@array/setting_launch_page_array"
|
||||
app:entryValues="@array/setting_launch_page_values"
|
||||
app:icon="@drawable/ic_launch"
|
||||
app:key="@string/setting_launch_page_key"
|
||||
app:title="@string/setting_launch_page"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
app:key="help_category"
|
||||
app:title="Help">
|
||||
<PreferenceCategory app:title="@string/setting_about">
|
||||
<Preference
|
||||
app:key="feedback"
|
||||
app:summary="Report technical issues or suggest new features"
|
||||
app:title="Send feedback" />
|
||||
app:icon="@drawable/ic_setting_about"
|
||||
app:key="@string/setting_about_oxygen_toolbox_key"
|
||||
app:title="@string/setting_about_oxygen_toolbox" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user