Optimize fold layout and ids

This commit is contained in:
2022-03-22 12:22:01 +08:00
parent 5b2b60624c
commit ef0760ef16
33 changed files with 206 additions and 110 deletions

View File

@@ -1,15 +1,17 @@
plugins { plugins {
id 'com.android.application' id 'com.android.application'
id 'kotlin-android'
} }
//插件脚本
//apply from: "https://raw.githubusercontent.com/limpoxe/Android-Plugin-Framework/master/FairyPlugin/host.gradle"
android { android {
compileSdkVersion 30 compileSdk 31
buildToolsVersion "30.0.2"
defaultConfig { defaultConfig {
applicationId "com.fatapp.oxygentoolbox" applicationId "com.fatapp.oxygentoolbox"
minSdkVersion 21 minSdk 21
targetSdkVersion 30 targetSdk 31
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
@@ -26,20 +28,36 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
buildFeatures {
viewBinding true
}
} }
dependencies { dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.core:core-splashscreen:1.0.0-beta01'
implementation 'com.google.code.gson:gson:2.8.6' implementation 'com.google.code.gson:gson:2.9.0'
// 请务必使用@aar结尾以中断依赖传递
// implementation('com.github.limpoxe:Android-Plugin-Framework:0.0.72@aar')
// 可选,用于支持插件全局函数式服务,不使用全局函数式服务不需要添加此依赖
// implementation('com.limpoxe.support:android-servicemanager:1.0.5@aar')
} }
/*
fairy {
//可选配置,用于指定插件进程名。默认插件进程为单独的进程,进程名为":plugin"
//若设置为空串或者null即是使用宿主进程作为插件进程
//pluginProcess = ""
//pluginProcess = null
//pluginProcess = ":xxx"
}*/

View File

@@ -9,9 +9,19 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.OxygenToolbox"> android:theme="@style/Theme.OxygenToolbox">
<activity android:name=".tools.TimeScreenActivity" /> <!--<activity
android:name=".SplashActivity"
android:exported="true"
android:theme="@style/Theme.OxygenToolbox.Full">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>-->
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/Theme.OxygenToolbox.NoActionBar"> android:theme="@style/Theme.OxygenToolbox.NoActionBar">
<intent-filter> <intent-filter>
@@ -19,10 +29,20 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<meta-data <meta-data
android:name="android.app.shortcuts" android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" /> android:resource="@xml/shortcuts" />
</activity> </activity>
<activity
android:name=".tools.TimeScreenActivity"
android:exported="false">
<intent-filter>
<action android:name="activity.timescreen" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application> </application>
</manifest> </manifest>

View File

@@ -21,31 +21,49 @@ import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import java.io.IOException;
import java.util.Collections; import java.util.Collections;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
private AppBarConfiguration mAppBarConfiguration; private AppBarConfiguration mAppBarConfiguration;
private Toolbar toolbar;
private FloatingActionButton fab;
private DrawerLayout drawer;
private NavigationView navigationView;
private void initView() {
toolbar = findViewById(R.id.toolbar);
fab = findViewById(R.id.fab);
drawer = findViewById(R.id.drawer_layout);
navigationView = findViewById(R.id.nav_view);
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
//init
initView();
initLayout();
shortCutCreateTest();
}
private void initLayout() {
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(view -> { fab.setOnClickListener(view -> {
/*Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) /*Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();*/ .setAction("Action", null).show();*/
}); });
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.inflateHeaderView(R.layout.nav_header_main); navigationView.inflateHeaderView(R.layout.nav_header_main);
navigationView.inflateMenu(R.menu.activity_main_drawer); navigationView.inflateMenu(R.menu.activity_main_drawer);
navigationView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { navigationView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
if (navigationView.getMenu().getItem(0).isChecked()) { if (navigationView.getMenu().getItem(0).isChecked()) {
fab.setVisibility(View.VISIBLE); fab.setVisibility(View.VISIBLE);
} else if (navigationView.getMenu().getItem(4).isChecked()) {
System.exit(0);
} else { } else {
fab.setVisibility(View.GONE); fab.setVisibility(View.GONE);
} }
@@ -53,23 +71,14 @@ public class MainActivity extends AppCompatActivity {
// Passing each menu ID as a set of Ids because each // Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations. // menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(R.id.nav_home) mAppBarConfiguration = new AppBarConfiguration.Builder(R.id.nav_home)
.setDrawerLayout(drawer) .setOpenableLayout(drawer)
.build(); .build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment); NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration); NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController); NavigationUI.setupWithNavController(navigationView, navController);
try {
ToolsList.init(getResources().getAssets().open("json/BasicTools.json"));
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(), "初始化工具集失败", Toast.LENGTH_LONG).show();
}
shortCutCreateTest();
} }
private void shortCutCreateTest() { private void shortCutCreateTest() {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N_MR1) { if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N_MR1) {
return; return;
} }
@@ -78,12 +87,12 @@ public class MainActivity extends AppCompatActivity {
intent.setClassName("com.fatapp.oxygentoolbox", intent.setClassName("com.fatapp.oxygentoolbox",
"com.fatapp.oxygentoolbox.MainActivity"); "com.fatapp.oxygentoolbox.MainActivity");
ShortcutInfo.Builder builder; ShortcutInfo.Builder builder;
builder = new ShortcutInfo.Builder(this, "dynamic shortcut") builder = new ShortcutInfo.Builder(this, "Time Screen")
.setIntent(new Intent() .setIntent(new Intent()
.setAction("android.intent.action.VIEW") .setAction("activity.timescreen")
.setClassName("com.fatapp.oxygentoolbox", "com.fatapp.oxygentoolbox.MainActivity")) .setClassName("com.fatapp.oxygentoolbox", "com.fatapp.oxygentoolbox.tools.TimeScreenActivity"))
.setShortLabel("This is a dynamic shortcut") .setShortLabel("Time Screen")
.setLongLabel("This is a dynamic shortcut with long label") .setLongLabel("Time Screen")
.setIcon(Icon.createWithResource(this, R.drawable.ic_menu_home)); .setIcon(Icon.createWithResource(this, R.drawable.ic_menu_home));
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class); ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);
shortcutManager.addDynamicShortcuts(Collections.singletonList(builder.build())); shortcutManager.addDynamicShortcuts(Collections.singletonList(builder.build()));

View File

@@ -0,0 +1,14 @@
package com.fatapp.oxygentoolbox;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
}
}

View File

@@ -28,7 +28,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
private ValueAnimator hideAnimator; private ValueAnimator hideAnimator;
private View defaultView; private View defaultView;
private OnItemClickListener mOnItemClickListener; private OnItemClickListenerInterface mOnItemClickListener;
public FoldLayout(Context context) { public FoldLayout(Context context) {
this(context, null); this(context, null);
@@ -58,7 +58,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
defaultView = LayoutInflater.from(context).inflate(layoutId, this, true); defaultView = LayoutInflater.from(context).inflate(layoutId, this, true);
defaultView.setOnClickListener(this); defaultView.setOnClickListener(this);
content = new LinearLayout(context); content = new LinearLayout(context);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, LayoutParams layoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT); ViewGroup.LayoutParams.WRAP_CONTENT);
content.setOrientation(VERTICAL); content.setOrientation(VERTICAL);
addView(content, layoutParams); addView(content, layoutParams);
@@ -96,7 +96,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
@SuppressLint("UseCompatLoadingForDrawables") @SuppressLint("UseCompatLoadingForDrawables")
public void onAnimationStart(Animator animation) { public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation); super.onAnimationStart(animation);
LinearLayout linearLayout = defaultView.findViewById(R.id.foldLayoutLinearLayout); LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout);
linearLayout.setBackground(getResources().getDrawable(R.drawable.top_radius_background)); linearLayout.setBackground(getResources().getDrawable(R.drawable.top_radius_background));
} }
}); });
@@ -113,7 +113,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation); super.onAnimationEnd(animation);
if (!isShow) { if (!isShow) {
LinearLayout linearLayout = defaultView.findViewById(R.id.foldLayoutLinearLayout); LinearLayout linearLayout = defaultView.findViewById(R.id.fold_layout_linear_layout);
linearLayout.setBackground(getResources().getDrawable(R.drawable.top_bottom_radius_background)); linearLayout.setBackground(getResources().getDrawable(R.drawable.top_bottom_radius_background));
} }
} }
@@ -143,7 +143,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
public void showItem() { public void showItem() {
isShow = true; isShow = true;
showAnimator.start(); showAnimator.start();
ImageView imageView = defaultView.findViewById(R.id.arrowIcon); ImageView imageView = defaultView.findViewById(R.id.arrow_icon);
imageView.setImageDrawable(getResources().getDrawable(R.drawable.right_to_down_arrow)); imageView.setImageDrawable(getResources().getDrawable(R.drawable.right_to_down_arrow));
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageView.getDrawable(); AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageView.getDrawable();
animatedVectorDrawable.start(); animatedVectorDrawable.start();
@@ -153,17 +153,13 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener {
public void hideItem() { public void hideItem() {
isShow = false; isShow = false;
hideAnimator.start(); hideAnimator.start();
ImageView imageView = defaultView.findViewById(R.id.arrowIcon); ImageView imageView = defaultView.findViewById(R.id.arrow_icon);
imageView.setImageDrawable(getResources().getDrawable(R.drawable.down_to_right_arrow)); imageView.setImageDrawable(getResources().getDrawable(R.drawable.down_to_right_arrow));
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageView.getDrawable(); AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) imageView.getDrawable();
animatedVectorDrawable.start(); animatedVectorDrawable.start();
} }
interface OnItemClickListener { public void setOnItemClickListener(OnItemClickListenerInterface onItemClickListener) {
void onItemClick(View view, int position);
}
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
this.mOnItemClickListener = onItemClickListener; this.mOnItemClickListener = onItemClickListener;
} }
} }

View File

@@ -0,0 +1,7 @@
package com.fatapp.oxygentoolbox.layout;
import android.view.View;
interface OnItemClickListenerInterface {
void onItemClick(View view, int position);
}

View File

@@ -11,7 +11,6 @@ import androidx.fragment.app.Fragment;
public class ExitFragment extends Fragment { public class ExitFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
System.exit(0);
return null; return null;
} }
} }

View File

@@ -1,16 +1,14 @@
package com.fatapp.oxygentoolbox.ui.home; package com.fatapp.oxygentoolbox.ui.home;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
@@ -21,12 +19,14 @@ import com.fatapp.oxygentoolbox.layout.FoldLayout;
import com.fatapp.oxygentoolbox.util.BasicToolsLauncher; import com.fatapp.oxygentoolbox.util.BasicToolsLauncher;
import com.fatapp.oxygentoolbox.util.ToolsList; import com.fatapp.oxygentoolbox.util.ToolsList;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
public class HomeFragment extends Fragment { public class HomeFragment extends Fragment {
View root; private View root;
private HomeViewModel homeViewModel; private HomeViewModel homeViewModel;
@@ -36,37 +36,60 @@ public class HomeFragment extends Fragment {
homeViewModel = homeViewModel =
new ViewModelProvider(this).get(HomeViewModel.class); new ViewModelProvider(this).get(HomeViewModel.class);
root = inflater.inflate(R.layout.fragment_home, container, false); root = inflater.inflate(R.layout.fragment_home, container, false);
//init
initView(); initView();
initLayout();
return root; return root;
} }
private void initView() { private void initView() {
for (ToolsList.Tool tool : ToolsList.getToolList()) { foldLayoutsLinearLayout = root.findViewById(R.id.fold_layouts_linear_layout);
}
View foldLayoutBody = getLayoutInflater().inflate(R.layout.fold_layout_body, null); private void initLayout() {
ViewGroup layout_item_AutoLinefeedLayout = foldLayoutBody.findViewById(R.id.layout_item_AutoLinefeedLayout); initFoldLayout();
}
private void initFoldLayout() {
try {
ToolsList.init(getResources().getAssets().open("json/BasicTools.json"));
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(getContext(), "初始化工具集失败", Toast.LENGTH_LONG).show();
return;
}
for (ToolsList.Tool tool : ToolsList.getToolList()) {
View foldLayoutBodyLayout = getLayoutInflater().inflate(R.layout.fold_layout_body, null);
ViewGroup autoLinefeedLayout = foldLayoutBodyLayout.findViewById(R.id.auto_linefeed_layout);
for (ToolsList.Button button : tool.getButtonList()) { for (ToolsList.Button button : tool.getButtonList()) {
View toolButton = getLayoutInflater().inflate(R.layout.tool_button, null); View toolButtonLayout = getLayoutInflater().inflate(R.layout.tool_button, null);
((Button) toolButton.findViewById(R.id.toolButton)).setText(button.getText());
toolButton.findViewById(R.id.toolButton).setOnClickListener(v -> { Button toolButton = toolButtonLayout.findViewById(R.id.tool_button);
toolButton.setText(button.getText());
toolButton.setOnClickListener(v -> {
BasicToolsLauncher.launch(button.getActivity(), getContext()); BasicToolsLauncher.launch(button.getActivity(), getContext());
}); });
layout_item_AutoLinefeedLayout.addView(toolButton); autoLinefeedLayout.addView(toolButtonLayout);
} }
List<View> viewList = new ArrayList<>(); List<View> viewList = new ArrayList<>();
viewList.add(foldLayoutBody); viewList.add(foldLayoutBodyLayout);
View foldLayoutHead = getLayoutInflater().inflate(R.layout.fold_layout, null); View foldLayoutHead = getLayoutInflater().inflate(R.layout.fold_layout, null);
FoldLayout foldLayout = foldLayoutHead.findViewById(R.id.foldLayout); FoldLayout foldLayout = foldLayoutHead.findViewById(R.id.fold_layout);
((TextView) foldLayout.findViewById(R.id.foldLayoutTextView)).setText(tool.getFoldLayoutTitle()); ((TextView) foldLayout.findViewById(R.id.fold_layout_text_view)).setText(tool.getFoldLayoutTitle());
((TextView) foldLayout.findViewById(R.id.foldLayoutIcon)).setTypeface(Typeface.createFromAsset(getContext().getAssets(), tool.getFont()));
((TextView) foldLayout.findViewById(R.id.foldLayoutIcon)).setText(tool.getIcon()); TextView foldLayoutIcon = foldLayout.findViewById(R.id.fold_layout_icon);
foldLayoutIcon.setTypeface(Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), tool.getFont()));
foldLayoutIcon.setText(tool.getIcon());
foldLayout.addItemView(viewList); foldLayout.addItemView(viewList);
foldLayoutsLinearLayout = root.findViewById(R.id.foldLayoutsLinearLayout); foldLayoutsLinearLayout.removeAllViews();
foldLayoutsLinearLayout.addView(foldLayoutHead); foldLayoutsLinearLayout.addView(foldLayoutHead);
} }
@@ -93,4 +116,6 @@ public class HomeFragment extends Fragment {
foldLayoutsLinearLayout.addView(foldLayoutHead); foldLayoutsLinearLayout.addView(foldLayoutHead);
}*/ }*/
} }
} }

View File

@@ -22,7 +22,8 @@ public class SettingFragment extends Fragment {
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
settingViewModel = settingViewModel =
new ViewModelProvider(this).get(SettingViewModel.class); new ViewModelProvider(this).get(SettingViewModel.class);
View root = inflater.inflate(R.layout.fragment_about, container, false); View root = inflater.inflate(R.layout.fragment_setting, container, false);
/*
final TextView textView = root.findViewById(R.id.text_setting); final TextView textView = root.findViewById(R.id.text_setting);
settingViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() { settingViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override @Override
@@ -30,6 +31,7 @@ public class SettingFragment extends Fragment {
textView.setText(s); textView.setText(s);
} }
}); });
*/
return root; return root;
} }
} }

View File

@@ -40,7 +40,7 @@ public class ToolsList {
return toolList; return toolList;
} }
public void setToolList(List<Tool> toolList) { public static void setToolList(List<Tool> toolList) {
ToolsList.toolList = toolList; ToolsList.toolList = toolList;
} }

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.drawerlayout.widget.DrawerLayout 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" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -19,5 +18,5 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="start" android:layout_gravity="start"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:background="@color/app_background" /> android:background="@color/app_background"/>
</androidx.drawerlayout.widget.DrawerLayout> </androidx.drawerlayout.widget.DrawerLayout>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SplashActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

View File

@@ -28,6 +28,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" /> app:srcCompat="@android:drawable/ic_dialog_email"
android:contentDescription="TODO" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -16,7 +16,7 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/basicToolsRecyclerView" android:id="@+id/basic_tools_recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</LinearLayout> </LinearLayout>

View File

@@ -5,7 +5,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<com.fatapp.oxygentoolbox.layout.FoldLayout <com.fatapp.oxygentoolbox.layout.FoldLayout
android:id="@+id/foldLayout" android:id="@+id/fold_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layoutId="@layout/fold_layout_head" app:layoutId="@layout/fold_layout_head"

View File

@@ -4,11 +4,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:orientation="vertical" android:gravity="center_vertical"
android:gravity="center_vertical"> android:orientation="vertical">
<com.fatapp.oxygentoolbox.layout.AutoLinefeedLayout <com.fatapp.oxygentoolbox.layout.AutoLinefeedLayout
android:id="@+id/layout_item_AutoLinefeedLayout" android:id="@+id/auto_linefeed_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/foldLayoutLinearLayout" android:id="@+id/fold_layout_linear_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
@@ -11,7 +11,7 @@
android:gravity="center_vertical" > android:gravity="center_vertical" >
<TextView <TextView
android:id="@+id/foldLayoutIcon" android:id="@+id/fold_layout_icon"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_weight="1" android:layout_weight="1"
@@ -20,7 +20,7 @@
android:textColor="@color/app_theme" /> android:textColor="@color/app_theme" />
<TextView <TextView
android:id="@+id/foldLayoutTextView" android:id="@+id/fold_layout_text_view"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_weight="6" android:layout_weight="6"
@@ -29,7 +29,7 @@
android:textSize="18sp" /> android:textSize="18sp" />
<ImageView <ImageView
android:id="@+id/arrowIcon" android:id="@+id/arrow_icon"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="15dp" android:layout_height="15dp"
android:layout_weight="1" android:layout_weight="1"

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView 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" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_home" android:id="@+id/fragment_home"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -10,7 +9,7 @@
tools:context=".ui.home.HomeFragment"> tools:context=".ui.home.HomeFragment">
<LinearLayout <LinearLayout
android:id="@+id/foldLayoutsLinearLayout" android:id="@+id/fold_layouts_linear_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="10dp" android:paddingBottom="10dp"

View File

@@ -1,22 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView 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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.setting.SettingFragment"> tools:context=".ui.setting.SettingFragment">
<TextView <LinearLayout
android:id="@+id/text_setting"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_marginStart="8dp" </LinearLayout>
android:layout_marginTop="8dp" </ScrollView>
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -13,7 +13,7 @@
android:theme="@style/ThemeOverlay.AppCompat.Dark"> android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView <ImageView
android:id="@+id/imageView" android:id="@+id/image_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/nav_header_desc" android:contentDescription="@string/nav_header_desc"
@@ -28,7 +28,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView <TextView
android:id="@+id/textView" android:id="@+id/text_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/nav_header_subtitle" /> android:text="@string/nav_header_subtitle" />

View File

@@ -3,6 +3,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<Button <Button
android:id="@+id/toolButton" android:id="@+id/tool_button"
style="@style/ToolsButton" /> style="@style/ToolsButton" />
</LinearLayout> </LinearLayout>

View File

@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge"> <style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/app_theme</item> <item name="colorPrimary">@color/app_theme</item>
<item name="colorPrimaryVariant">@color/app_theme</item> <item name="colorPrimaryVariant">@color/app_theme</item>
<item name="colorOnPrimary">@color/black</item> <item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. --> <!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item> <item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item> <item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item> <item name="colorOnSecondary">@color/white</item>
<!-- Status bar color. --> <!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->

View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>

View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Oxygen</string> <string name="app_name">Oxygen</string>
<string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_open">Open navigation drawer</string>

View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge"> <style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
@@ -19,6 +20,10 @@
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
</style> </style>
<style name="Theme.OxygenToolbox.Full" parent="Theme.OxygenToolbox.NoActionBar">
<item name="android:windowFullscreen">true</item>
</style>
<style name="Theme.OxygenToolbox.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="Theme.OxygenToolbox.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.OxygenToolbox.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> <style name="Theme.OxygenToolbox.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

View File

@@ -1,12 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.6.10'
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
dependencies { dependencies {
classpath "com.android.tools.build:gradle:4.1.0" classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }
@@ -15,8 +17,8 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter()
mavenCentral() mavenCentral()
// maven { url 'https://jitpack.io' }
} }
} }

View File

@@ -1,6 +1,6 @@
#Mon Mar 21 14:49:53 CST 2022 #Wed Mar 17 21:51:22 CST 2021
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip