Optimized language, attr, themes, colors.

Change the way to launch tool activity.
This commit is contained in:
2022-04-01 14:24:45 +08:00
parent ef235a86aa
commit 6c662f8389
47 changed files with 208 additions and 260 deletions

View File

@@ -22,7 +22,7 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.OxygenToolbox">
android:theme="@style/Theme.OxygenToolbox.Default">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -38,7 +38,7 @@
<activity
android:name=".tools.TimeScreenActivity"
android:exported="false"
android:theme="@style/Theme.OxygenToolbox">
android:theme="@style/Theme.OxygenToolbox.Default">
<intent-filter>
<action android:name="activity.timescreen" />

View File

@@ -21,14 +21,14 @@
"cn": "\u65f6\u95f4\u5c4f\u5e55",
"en": "Time Screen"
},
"activity": 0
"activity": "com.fatapp.oxygentoolbox.tools.TimeScreenActivity"
},
{
"text": {
"cn": "\u7ffb\u8bd1",
"en": "Translation"
},
"activity": 1
"activity": ""
}
]
}

View File

@@ -1,13 +1,10 @@
package com.fatapp.oxygentoolbox;
import android.content.Intent;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.graphics.drawable.Icon;
import android.os.Bundle;
import android.view.View;
import android.view.Menu;
import com.fatapp.oxygentoolbox.util.ResourceUtil;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.navigation.NavigationView;
@@ -20,7 +17,6 @@ import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import java.util.Collections;
import java.util.Objects;
public class MainActivity extends AppCompatActivity {
@@ -39,6 +35,7 @@ public class MainActivity extends AppCompatActivity {
drawer = findViewById(R.id.drawer_layout);
navigationView = findViewById(R.id.nav_view);
mainActivity = this;
ResourceUtil.init(getApplication());
}
@Override

View File

@@ -97,7 +97,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout);
linearLayout.setBackground(getResources().getDrawable(R.drawable.top_radius_background));
linearLayout.setBackground(getContext().getDrawable(R.drawable.top_radius_background));
}
});
@@ -114,7 +114,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
super.onAnimationEnd(animation);
if (!isShow) {
LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout);
linearLayout.setBackground(getResources().getDrawable(R.drawable.top_bottom_radius_background));
linearLayout.setBackground(getContext().getDrawable(R.drawable.top_bottom_radius_background));
}
}
});
@@ -144,7 +144,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
isShow = true;
showAnimator.start();
ImageView imageView = defaultView.findViewById(R.id.arrow_icon);
imageView.setImageDrawable(getResources().getDrawable(R.drawable.right_to_down_arrow));
imageView.setImageDrawable(getContext().getDrawable(R.drawable.right_to_down_arrow));
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageView.getDrawable();
animatedVectorDrawable.start();
}
@@ -154,7 +154,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
isShow = false;
hideAnimator.start();
ImageView imageView = defaultView.findViewById(R.id.arrow_icon);
imageView.setImageDrawable(getResources().getDrawable(R.drawable.down_to_right_arrow));
imageView.setImageDrawable(getContext().getDrawable(R.drawable.down_to_right_arrow));
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageView.getDrawable();
animatedVectorDrawable.start();
}

View File

@@ -16,7 +16,7 @@ import androidx.lifecycle.ViewModelProvider;
import com.fatapp.oxygentoolbox.R;
import com.fatapp.oxygentoolbox.layout.FoldLayout;
import com.fatapp.oxygentoolbox.util.BasicToolsLauncher;
import com.fatapp.oxygentoolbox.util.ToolsLauncher;
import com.fatapp.oxygentoolbox.util.ToolsList;
import java.io.IOException;
@@ -66,10 +66,9 @@ public class HomeFragment extends Fragment {
for (ToolsList.Button button : tool.getButtonList()) {
View toolButtonLayout = getLayoutInflater().inflate(R.layout.tool_button, null);
Button toolButton = toolButtonLayout.findViewById(R.id.tool_button);
toolButton.setText(button.getText());
toolButton.setOnClickListener(v -> BasicToolsLauncher.launch(button.getActivity(), getContext()));
toolButton.setOnClickListener(v -> ToolsLauncher.launch(getContext(), button.getActivity()));
autoLinefeedLayout.addView(toolButtonLayout);
}
@@ -90,28 +89,29 @@ public class HomeFragment extends Fragment {
foldLayoutsLinearLayout.addView(foldLayoutHead);
}
/*for (int i = 0; i < 10; i++) {
/*
for (int i = 0; i < 10; i++) {
View toolButton = getLayoutInflater().inflate(R.layout.tool_button, null);
((Button) toolButton.findViewById(R.id.toolButton)).setText("Button");
toolButton.findViewById(R.id.toolButton).setOnClickListener(v -> {
((Button) toolButton.findViewById(R.id.tool_button)).setText("Button");
toolButton.findViewById(R.id.tool_button).setOnClickListener(v -> {
BasicToolsLauncher.launch(0, getContext());
});
View foldLayoutBody = getLayoutInflater().inflate(R.layout.fold_layout_body, null);
ViewGroup layout_item_AutoLinefeedLayout = foldLayoutBody.findViewById(R.id.layout_item_AutoLinefeedLayout);
ViewGroup layout_item_AutoLinefeedLayout = foldLayoutBody.findViewById(R.id.auto_linefeed_layout);
layout_item_AutoLinefeedLayout.addView(toolButton);
List<View> viewList = new ArrayList<>();
viewList.add(foldLayoutBody);
View foldLayoutHead = getLayoutInflater().inflate(R.layout.fold_layout, null);
FoldLayout foldLayout = foldLayoutHead.findViewById(R.id.foldLayout);
((TextView) foldLayout.findViewById(R.id.foldLayoutTextView)).setText("FoldLayout_" + i);
FoldLayout foldLayout = foldLayoutHead.findViewById(R.id.fold_layout);
((TextView) foldLayout.findViewById(R.id.fold_layout_text_view)).setText("FoldLayout_" + i);
foldLayout.addItemView(viewList);
foldLayoutsLinearLayout = root.findViewById(R.id.foldLayoutsLinearLayout);
foldLayoutsLinearLayout.addView(foldLayoutHead);
}*/
}
*/
}

View File

@@ -1,20 +0,0 @@
package com.fatapp.oxygentoolbox.util;
import static androidx.core.content.ContextCompat.startActivity;
import android.content.Context;
import android.content.Intent;
import com.fatapp.oxygentoolbox.tools.TimeScreenActivity;
public class BasicToolsLauncher {
public static void launch(int activity, Context context) {
switch (activity) {
case 0:
startActivity(context, new Intent(context, TimeScreenActivity.class), null);
break;
case 1:
break;
}
}
}

View File

@@ -0,0 +1,31 @@
package com.fatapp.oxygentoolbox.util;
import android.app.Application;
import android.content.res.Resources;
public final class ResourceUtil {
private static Application sApp;
private static Resources sRes;
public static void init(Application app) {
sApp = app;
sRes = app.getResources();
}
public static Application getApplication() {
return sApp;
}
public static Resources getResources() {
return sRes;
}
public static String getString(int resId) {
return sRes.getString(resId);
}
public static int getColor(int resId) {
return sRes.getColor(resId);
}
}

View File

@@ -166,7 +166,7 @@ public class ToolsJson {
@SerializedName("text")
private Text text;
@SerializedName("activity")
private Integer activity;
private String activity;
public Text getText() {
return text;
@@ -176,11 +176,11 @@ public class ToolsJson {
this.text = text;
}
public Integer getActivity() {
public String getActivity() {
return activity;
}
public void setActivity(Integer activity) {
public void setActivity(String activity) {
this.activity = activity;
}

View File

@@ -0,0 +1,20 @@
package com.fatapp.oxygentoolbox.util;
import static androidx.core.content.ContextCompat.startActivity;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import com.fatapp.oxygentoolbox.R;
import com.fatapp.oxygentoolbox.tools.TimeScreenActivity;
public class ToolsLauncher {
public static void launch(Context context, String activity) {
try {
startActivity(context, new Intent(context, Class.forName(activity)), null);
} catch (ClassNotFoundException e) {
Toast.makeText(context, R.string.activity_class_not_found, Toast.LENGTH_LONG).show();
}
}
}

View File

@@ -46,9 +46,9 @@ public class ToolsList {
private static String getLocale(Locales strings) {
String language;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
language = MainActivity.mainActivity.getResources().getConfiguration().getLocales().get(0).getLanguage();
language = ResourceUtil.getResources().getConfiguration().getLocales().get(0).getLanguage();
} else {
language = MainActivity.mainActivity.getResources().getConfiguration().locale.getLanguage();
language = ResourceUtil.getResources().getConfiguration().locale.getLanguage();
}
if (language.equals("zh")) {
return strings.getCn();
@@ -105,7 +105,7 @@ public class ToolsList {
public static class Button {
private String text;
private Integer activity;
private String activity;
public String getText() {
return text;
@@ -115,11 +115,11 @@ public class ToolsList {
this.text = text;
}
public Integer getActivity() {
public String getActivity() {
return activity;
}
public void setActivity(Integer activity) {
public void setActivity(String activity) {
this.activity = activity;
}
}

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/tools_button_ripple">
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?attr/tools_button_ripple">
<item android:id="@android:id/mask">
<shape>
<solid android:color="@color/tools_button_ripple" />
<solid android:color="?attr/tools_button_ripple" />
<corners android:radius="120dp" />
</shape>
</item>

View File

@@ -23,7 +23,7 @@
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillColor="?attr/app_theme"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/fold_layout_background" />
<solid android:color="?attr/fold_layout_background" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"/>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/tools_button_background" />
<solid android:color="?attr/tools_button_background" />
<corners android:radius="120dp" />
</shape>

View File

@@ -11,7 +11,7 @@
<path
android:name="path"
android:pathData="M 1008.02 276.637 C 983.509 254.352 945.634 256.617 923.35 278.864 L 513.35 720.056 L 103.351 278.826 C 81.067 254.315 43.18 254.315 18.668 276.599 C -5.843 298.883 -5.843 336.758 16.441 361.269 L 468.782 849.245 C 479.918 860.393 495.52 869.264 513.35 869.264 C 528.941 869.264 546.77 862.583 557.906 849.245 L 1010.247 361.269 C 1032.531 336.758 1032.531 298.883 1008.02 276.599 Z M 1008.02 276.637"
android:fillColor="@color/tools_arrow"
android:fillColor="?attr/tools_arrow"
android:strokeWidth="1"/>
</vector>
</aapt:attr>

View File

@@ -23,7 +23,7 @@
</aapt:attr>
</path>
<path
android:fillColor="@color/app_theme"
android:fillColor="@color/default_app_theme"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"

View File

@@ -6,6 +6,6 @@
android:viewportHeight="1024">
<path
android:fillColor="@color/app_theme"
android:fillColor="?attr/app_theme"
android:pathData="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0z m62.464 774.144c0 27.648-22.528 50.176-50.176 50.176h-25.088c-27.648 0-50.176-22.528-50.176-50.176V474.624c0-27.648 22.528-50.176 50.176-50.176h25.088c27.648 0 50.176 22.528 50.176 50.176v299.52zM512 349.696c-34.304 0-62.464-28.16-62.464-62.464 0-34.304 28.16-62.464 62.464-62.464s62.464 28.16 62.464 62.464c0 34.304-28.16 62.464-62.464 62.464z" />
</vector>

View File

@@ -6,12 +6,12 @@
android:viewportHeight="1024">
<path
android:fillColor="@color/app_theme"
android:fillColor="?attr/app_theme"
android:pathData="M952.7 492.1c-1.4-1.8-3.1-3.4-4.8-4.9l-179-178.9c-12.5-12.5-32.9-12.5-45.4 0s-12.5 32.9 0 45.4l126 126H421.3h-0.1c-18.2 0-32.9 14.8-32.9 33s14.7 33 32.9 33c0.3 0.1 0.5 0 0.7 0h427.8l-126 126c-12.3 12.3-12.3 32.4 0 44.7l0.7 0.7c12.3 12.3 32.4 12.3 44.7 0l182-182c11.7-11.7 12.3-30.6 1.6-43z" />
<path
android:fillColor="@color/app_theme"
android:fillColor="?attr/app_theme"
android:pathData="M562.3 799c-18 0-32.7 14.7-32.7 32.7v63.8H129.2V128.7h400.4v63.1c0 18 14.7 32.7 32.7 32.7s32.7-14.7 32.7-32.7V96.3c0-3.5-0.6-6.8-1.6-10-4.2-13.3-16.6-23-31.2-23H96.6c-18 0-32.7 14.7-32.7 32.7v831.9c0 14.2 9.2 26.3 21.8 30.8 3.6 1.4 7.5 2.1 11.5 2.1h463.2c0.6 0 1.3 0.1 1.9 0.1 18 0 32.7-14.7 32.7-32.7v-96.5c0-18-14.7-32.7-32.7-32.7z" />
<path
android:fillColor="@color/app_theme"
android:fillColor="?attr/app_theme"
android:pathData="M256.8 512.7a32.9 33 0 1 0 65.8 0 32.9 33 0 1 0-65.8 0Z" />
</vector>

View File

@@ -6,6 +6,6 @@
android:viewportHeight="1024">
<path
android:fillColor="@color/app_theme"
android:fillColor="?attr/app_theme"
android:pathData="M1014.628571 504L543.885714 33.6a36.491429 36.491429 0 0 0-51.657143 0L21.485714 504c-13.714286 13.714286-21.485714 32.342857-21.485714 51.771429 0 40.342857 32.8 73.142857 73.142857 73.142857h49.6V964.571429c0 20.228571 16.342857 36.571429 36.571429 36.571428H444.914286V745.142857h128v256h303.885714c20.228571 0 36.571429-16.342857 36.571429-36.571428V628.914286h49.6c19.428571 0 38.057143-7.657143 51.771428-21.485715 28.457143-28.571429 28.457143-74.857143-0.114286-103.428571z" />
</vector>

View File

@@ -6,6 +6,6 @@
android:viewportHeight="1024">
<path
android:fillColor="@color/app_theme"
android:fillColor="?attr/app_theme"
android:pathData="M542.464 85.333333c23.466667-0.426667 45.696 8.106667 62.293333 24.32 16.682667 15.786667 25.6 37.546667 25.6 60.586667 0 46.933333 38.826667 84.949333 87.082667 84.949333 14.933333 0 29.866667-4.266667 43.093333-11.52 41.386667-22.272 93.013333-8.106667 116.48 31.573334l29.013334 49.92c7.253333 12.8 11.52 27.306667 11.52 42.24 0 30.293333-16.64 58.453333-43.52 73.386666-13.226667 7.253333-24.32 18.346667-32 31.146667a83.626667 83.626667 0 0 0 32 113.92 84.394667 84.394667 0 0 1 32 115.2l-29.013334 48.213333c-15.36 26.453333-43.946667 42.666667-74.666666 42.666667-15.36 0-30.72-3.84-43.52-11.52-13.653333-7.253333-28.586667-11.52-43.52-11.52-23.04 0-45.226667 8.96-61.44 25.173333-16.64 15.786667-25.6 37.546667-25.6 60.16 0 46.506667-38.826667 84.48-87.04 84.48h-58.453334c-23.04 0-44.8-9.386667-60.586666-25.173333-16.213333-16.213333-24.746667-37.546667-24.746667-59.733333 0-46.933333-38.4-84.906667-86.613333-84.906667-15.786667 0-31.146667 4.266667-44.373334 12.373333a91.733333 91.733333 0 0 1-66.133333 8.533334c-22.186667-5.973333-41.386667-20.48-52.906667-39.68l-27.306666-48.213334a83.157333 83.157333 0 0 1-10.666667-66.56c5.973333-22.613333 21.333333-41.813333 42.24-53.333333 13.226667-7.253333 24.32-17.92 32-31.146667a84.48 84.48 0 0 0-32-113.92 83.072 83.072 0 0 1-31.573333-113.92l27.306666-47.786666c11.52-20.053333 30.72-34.56 53.333334-40.533334a88.149333 88.149333 0 0 1 66.56 8.96c13.653333 7.253333 28.586667 11.093333 43.52 11.093334 23.04 0 45.226667-8.96 61.44-24.746667 16.213333-15.786667 25.173333-37.546667 25.173333-59.733333 0-46.933333 38.826667-84.906667 87.04-84.906667z m17.109333 319.189334a121.728 121.728 0 0 0-130.986666 25.173333c-34.133333 33.28-44.8 84.053333-26.026667 127.573333a119.210667 119.210667 0 0 0 110.506667 72.533334h0.426666c32 0.426667 61.866667-11.946667 84.48-34.133334 22.613333-21.76 35.413333-51.626667 35.413334-82.773333 0.426667-47.36-29.013333-90.453333-73.813334-108.373333z" />
</vector>

View File

@@ -6,6 +6,6 @@
android:viewportHeight="1024">
<path
android:fillColor="@color/app_theme"
android:fillColor="?attr/app_theme"
android:pathData="M1004.12788 321.092L762.77088 79.735a68.267 68.267 0 0 0-96.546 0l-30.293 30.294a68.284 68.284 0 0 1-48.265 20.002H436.47388a68.181 68.181 0 0 1-48.265-20.002l-30.293-30.294a68.267 68.267 0 0 0-96.546 0L19.99588 321.092a68.267 68.267 0 0 0 0 96.546l96.546 96.547a67.84 67.84 0 0 0 66.645 17.271c10.804-3.072 21.675 4.181 21.675 15.411V896c0 37.547 30.72 68.267 68.267 68.267H750.99388c37.547 0 68.267-30.72 68.267-68.267V546.867c0-11.23 10.872-18.483 21.675-15.411a67.84 67.84 0 0 0 66.645-17.271l96.546-96.547a68.267 68.267 0 0 0 0-96.546z" />
</vector>

View File

@@ -11,7 +11,7 @@
<path
android:name="path"
android:pathData="M 13.25 15.29 C -4.56 34.88 -2.78 65.15 15 83 L 367.64 410.64 L 15 738.32 C -4.56 756.14 -4.56 786.41 13.25 806 C 31.06 825.59 61.33 825.59 80.92 807.78 L 470.92 446.26 C 479.83 437.36 486.92 424.89 486.92 410.64 C 486.92 398.18 481.58 383.93 470.92 375.03 L 80.92 13.51 C 61.33 -4.3 31.06 -4.3 13.25 15.29 Z M 13.25 15.29"
android:fillColor="@color/tools_arrow"
android:fillColor="?attr/tools_arrow"
android:strokeWidth="1"/>
</vector>
</aapt:attr>

View File

@@ -4,6 +4,6 @@
android:angle="270"
android:startColor="?attr/colorPrimary"
android:centerColor="?attr/colorPrimary"
android:endColor="@color/app_background"
android:endColor="?attr/app_background"
android:type="linear" />
</shape>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/fold_layout_background" />
<solid android:color="?attr/fold_layout_background" />
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/fold_layout_background" />
<solid android:color="?attr/fold_layout_background" />
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>

View File

@@ -18,5 +18,5 @@
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:background="@color/app_background"/>
android:background="?attr/app_background"/>
</androidx.drawerlayout.widget.DrawerLayout>

View File

@@ -13,6 +13,8 @@
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:paddingHorizontal="5dp"
android:paddingBottom="2dp"
android:background="@drawable/bottom_radius_background"
android:gravity="center_vertical">
</com.fatapp.oxygentoolbox.layout.AutoLinefeedLayout>

View File

@@ -5,10 +5,10 @@
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/top_bottom_radius_background"
android:gravity="center_vertical" >
android:gravity="center_vertical">
<TextView
android:id="@+id/fold_layout_icon"
@@ -17,8 +17,8 @@
android:layout_weight="1"
android:gravity="center"
android:textAlignment="center"
android:textSize="20sp"
android:textColor="@color/app_theme" />
android:textColor="?attr/app_theme"
android:textSize="20sp" />
<TextView
android:id="@+id/fold_layout_text_view"
@@ -26,7 +26,7 @@
android:layout_height="40dp"
android:layout_weight="6"
android:gravity="center_vertical"
android:textColor="@color/app_text_theme"
android:textColor="?attr/app_text_theme"
android:textSize="18sp" />
<ImageView
@@ -34,6 +34,6 @@
android:layout_width="0dp"
android:layout_height="15dp"
android:layout_weight="1"
app:srcCompat="@drawable/right_to_down_arrow"
android:contentDescription="@string/arrow_icon" />
android:contentDescription="@string/arrow_icon"
app:srcCompat="@drawable/right_to_down_arrow" />
</LinearLayout>

View File

@@ -4,7 +4,7 @@
android:id="@+id/fragment_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_background"
android:background="?attr/app_background"
android:orientation="vertical"
tools:context=".ui.home.HomeFragment">

View File

@@ -5,5 +5,5 @@
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="ifRoom" />
app:showAsAction="never" />
</menu>

View File

@@ -8,14 +8,17 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="app_theme">#FFBB86FC</color>
<color name="app_on_theme">@color/white</color>
<color name="app_text_theme">@color/white</color>
<color name="app_background">#FF202020</color>
<color name="default_app_theme">@color/purple_200</color>
<color name="default_app_on_theme">@color/white</color>
<color name="default_app_text_theme">@color/white</color>
<color name="default_app_background">#FF202020</color>
<color name="fold_layout_background">#FF303030</color>
<color name="tools_arrow">#FF666666</color>
<color name="tools_button_background">@color/app_background</color>
<color name="tools_button_text">#FFFAFAFA</color>
<color name="tools_button_ripple">#88cccccc</color>
<color name="default_app_second_theme">@color/teal_700</color>
<color name="default_app_second_on_theme">@color/black</color>
<color name="default_fold_layout_background">#FF303030</color>
<color name="default_tools_arrow">#FF666666</color>
<color name="default_tools_button_background">@color/default_app_background</color>
<color name="default_tools_button_text">#FFFAFAFA</color>
<color name="default_tools_button_ripple">#88CCCCCC</color>
</resources>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Oxygen</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="fab">浮动按钮</string>
<string name="init_tools_failed">初始化工具集失败</string>
</resources>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Oxygen</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="fab">浮动按钮</string>
<string name="init_tools_failed">初始化工具集失败</string>
</resources>

View File

@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Oxygen</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_desc">氧工具</string>
<string name="app_name">氧工具</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="fab">浮动按钮</string>
<string name="init_tools_failed">初始化工具集失败</string>
<string name="activity_class_not_found">无法加载工具,该工具可能已损坏</string>
</resources>

View File

@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Oxygen</string>
<string name="app_name">氧工具</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="fab">浮动按钮</string>
<string name="init_tools_failed">初始化工具集失败</string>
<string name="activity_class_not_found">无法加载工具,该工具可能已损坏</string>
</resources>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Oxygen</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="fab">浮动按钮</string>
<string name="init_tools_failed">初始化工具集失败</string>
</resources>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Oxygen</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="fab">浮动按钮</string>
<string name="init_tools_failed">初始化工具集失败</string>
</resources>

View File

@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Oxygen</string>
<string name="app_name">氧工具</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="fab">浮动按钮</string>
<string name="init_tools_failed">初始化工具集失败</string>
<string name="activity_class_not_found">无法加载工具,该工具可能已损坏</string>
</resources>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">氧工具</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="nav_header_title">氧工具</string>
<string name="nav_header_subtitle">All in One</string>
<string name="nav_header_desc">氧工具</string>
<string name="action_settings">设置</string>
<string name="menu_home">主页</string>
<string name="menu_theme">主题</string>
<string name="menu_setting">设置</string>
<string name="menu_about">关于</string>
<string name="menu_exit">退出</string>
<string name="shortcutDisabledMessage">禁用</string>
<string name="shortcutShortLabel">氧工具</string>
<string name="shortcutLongLabel">氧工具</string>
<string name="init_tools_failed">初始化工具集失败</string>
<string name="fab">浮动按钮</string>
</resources>

View File

@@ -1,6 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="FoldLayout">
<attr name="layoutId" format="integer"/>
<attr name="layoutId" format="integer" />
</declare-styleable>
<attr name="app_theme" format="color" />
<attr name="app_on_theme" format="color" />
<attr name="app_text_theme" format="color" />
<attr name="app_background" format="color" />
<attr name="app_second_theme" format="color" />
<attr name="app_second_on_theme" format="color" />
<attr name="fold_layout_background" format="color" />
<attr name="tools_arrow" format="color" />
<attr name="tools_button_background" format="color" />
<attr name="tools_button_text" format="color" />
<attr name="tools_button_ripple" format="color" />
</resources>

View File

@@ -8,14 +8,17 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="app_theme">#FF6200EE</color>
<color name="app_on_theme">@color/white</color>
<color name="app_text_theme">#FF444444</color>
<color name="app_background">#FFF5F5F5</color>
<color name="default_app_theme">@color/purple_500</color>
<color name="default_app_on_theme">@color/white</color>
<color name="default_app_text_theme">#FF444444</color>
<color name="default_app_background">#FFF5F5F5</color>
<color name="fold_layout_background">#FFFFFFFF</color>
<color name="tools_arrow">#FF666666</color>
<color name="tools_button_background">@color/app_background</color>
<color name="tools_button_text">#FF434343</color>
<color name="tools_button_ripple">#88cccccc</color>
<color name="default_app_second_theme">@color/teal_200</color>
<color name="default_app_second_on_theme">@color/black</color>
<color name="default_fold_layout_background">@color/white</color>
<color name="default_tools_arrow">#FF666666</color>
<color name="default_tools_button_background">@color/default_app_background</color>
<color name="default_tools_button_text">#FF434343</color>
<color name="default_tools_button_ripple">#88CCCCCC</color>
</resources>

View File

@@ -18,7 +18,9 @@
<string name="shortcutLongLabel">Oxygen Toolbox</string>
<string name="shortcutShortLabel">Oxygen Toolbox</string>
<string name="fab">Fab</string>
<string name="arrow_icon" translatable="false"><![CDATA[>]]></string>
<string name="fab">Fab</string>
<string name="init_tools_failed">Failed to initialize tools</string>
<string name="activity_class_not_found">Can not load tool, it may be damaged</string>
</resources>

View File

@@ -13,7 +13,7 @@
<item name="android:background">@drawable/button_radius_shape</item>
<item name="android:foreground">@drawable/ripple_foreground</item>
<item name="android:stateListAnimator">@null</item>
<item name="android:textColor">@color/tools_button_text</item>
<item name="android:textColor">@color/default_tools_button_text</item>
</style>
<style name="ToolsLinearLayout">
<item name="android:layout_width">wrap_content</item>

View File

@@ -1,30 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
<style name="Theme.OxygenToolbox.Default" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/app_theme</item>
<item name="colorPrimaryVariant">@color/app_theme</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorPrimary">@color/default_app_theme</item>
<item name="colorPrimaryVariant">@color/default_app_theme</item>
<item name="colorOnPrimary">@color/default_app_on_theme</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorSecondary">@color/default_app_second_theme</item>
<item name="colorSecondaryVariant">@color/default_app_second_theme</item>
<item name="colorOnSecondary">@color/default_app_second_on_theme</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="app_theme">@color/default_app_theme</item>
<item name="app_on_theme">@color/default_app_on_theme</item>
<item name="app_text_theme">@color/default_app_text_theme</item>
<item name="app_background">@color/default_app_background</item>
<item name="app_second_theme">@color/default_app_second_theme</item>
<item name="app_second_on_theme">@color/default_app_second_on_theme</item>
<item name="fold_layout_background">@color/default_fold_layout_background</item>
<item name="tools_arrow">@color/default_tools_arrow</item>
<item name="tools_button_background">@color/default_tools_button_background</item>
<item name="tools_button_text">@color/default_tools_button_text</item>
<item name="tools_button_ripple">@color/default_tools_button_ripple</item>
</style>
<style name="Theme.OxygenToolbox.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/app_background</item>
<item name="windowSplashScreenBackground">@color/default_app_background</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher</item>
<item name="windowSplashScreenAnimationDuration">0</item>
<item name="postSplashScreenTheme">@style/Theme.OxygenToolbox</item>
<item name="postSplashScreenTheme">@style/Theme.OxygenToolbox.Default</item>
</style>
<style name="Theme.OxygenToolbox.Full" parent="Theme.OxygenToolbox">
<style name="Theme.OxygenToolbox.Full" parent="Theme.OxygenToolbox.Default">
<item name="android:windowFullscreen">true</item>
</style>