mirror of
https://github.com/FatttSnake/OxygenToolbox.git
synced 2026-04-06 04:11:26 +08:00
Add ToolsButtons
This commit is contained in:
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -3,8 +3,10 @@
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable-v21/ripple_foreground.xml" value="0.15520833333333334" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.11944444444444445" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable/bottom_radius_background.xml" value="0.11944444444444445" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable/button_radius_shape.xml" value="0.15520833333333334" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable/down_to_right_arrow.xml" value="0.11944444444444445" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable/ic_launcher_background.xml" value="0.11944444444444445" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable/ic_menu_camera.xml" value="0.11944444444444445" />
|
||||
@@ -19,6 +21,7 @@
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/drawable/top_radius_background.xml" value="0.11944444444444445" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/layout/activity_main.xml" value="0.1" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/layout/app_bar_main.xml" value="0.1" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/layout/basic_tool_list.xml" value="0.1390625" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/layout/content_main.xml" value="0.14990942028985507" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/layout/fold_layout.xml" value="0.1" />
|
||||
<entry key="..\:/.workspace-android/Project-ToolBox/OxygenToolbox/app/src/main/res/layout/fragment_gallery.xml" value="0.1" />
|
||||
|
||||
@@ -30,14 +30,14 @@ android {
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
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.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
}
|
||||
@@ -1,23 +1,29 @@
|
||||
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.Menu;
|
||||
import android.view.View;
|
||||
import android.view.Menu;
|
||||
|
||||
import com.fatapp.oxygentoolbox.layout.FoldLayout;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
import com.fatapp.oxygentoolbox.layout.FoldLayout;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
@@ -32,12 +38,9 @@ public class MainActivity extends AppCompatActivity {
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
FloatingActionButton fab = findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
fab.setOnClickListener(view -> {
|
||||
/*Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();*/
|
||||
});
|
||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||
NavigationView navigationView = findViewById(R.id.nav_view);
|
||||
@@ -50,6 +53,29 @@ public class MainActivity extends AppCompatActivity {
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
||||
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
||||
NavigationUI.setupWithNavController(navigationView, navController);
|
||||
|
||||
shortCutCreateTest();
|
||||
}
|
||||
|
||||
private void shortCutCreateTest() {
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N_MR1) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.intent.action.VIEW");
|
||||
intent.setClassName("com.fatapp.oxygentoolbox",
|
||||
"com.fatapp.oxygentoolbox.MainActivity");
|
||||
ShortcutInfo.Builder builder;
|
||||
builder = new ShortcutInfo.Builder(this, "dynamic shortcut")
|
||||
.setIntent(new Intent()
|
||||
.setAction("android.intent.action.VIEW")
|
||||
.setClassName("com.fatapp.oxygentoolbox", "com.fatapp.oxygentoolbox.MainActivity"))
|
||||
.setShortLabel("This is a dynamic shortcut")
|
||||
.setLongLabel("This is a dynamic shortcut with long label")
|
||||
.setIcon(Icon.createWithResource(this, R.drawable.ic_menu_camera));
|
||||
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);
|
||||
shortcutManager.addDynamicShortcuts(Collections.singletonList(builder.build()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.fatapp.oxygentoolbox.layout;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
public class AutoLinefeedLayout extends ViewGroup {
|
||||
|
||||
public AutoLinefeedLayout(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
public AutoLinefeedLayout(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public AutoLinefeedLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
layoutHorizontal();
|
||||
}
|
||||
|
||||
private void layoutHorizontal() {
|
||||
final int count = getChildCount();
|
||||
final int lineWidth = getMeasuredWidth() - getPaddingLeft()
|
||||
- getPaddingRight();
|
||||
int paddingTop = getPaddingTop();
|
||||
int childTop = 0;
|
||||
int childLeft = getPaddingLeft();
|
||||
|
||||
int availableLineWidth = lineWidth;
|
||||
int maxLineHight = 0;
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
final View child = getChildAt(i);
|
||||
if (child == null) {
|
||||
continue;
|
||||
} else if (child.getVisibility() != GONE) {
|
||||
final int childWidth = child.getMeasuredWidth();
|
||||
final int childHeight = child.getMeasuredHeight();
|
||||
|
||||
if (availableLineWidth < childWidth) {
|
||||
availableLineWidth = lineWidth;
|
||||
paddingTop = paddingTop + maxLineHight;
|
||||
childLeft = getPaddingLeft();
|
||||
maxLineHight = 0;
|
||||
}
|
||||
childTop = paddingTop;
|
||||
setChildFrame(child, childLeft, childTop, childWidth,
|
||||
childHeight);
|
||||
childLeft += childWidth;
|
||||
availableLineWidth = availableLineWidth - childWidth;
|
||||
maxLineHight = Math.max(maxLineHight, childHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setChildFrame(View child, int left, int top, int width,
|
||||
int height) {
|
||||
child.layout(left, top, left + width, top + height);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
|
||||
int count = getChildCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
measureChild(getChildAt(i), widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
if (heightMode == MeasureSpec.AT_MOST||heightMode == MeasureSpec.UNSPECIFIED) {
|
||||
final int width = MeasureSpec.getSize(widthMeasureSpec);
|
||||
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(
|
||||
getDesiredHeight(width), MeasureSpec.EXACTLY));
|
||||
} else {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
}
|
||||
|
||||
private int getDesiredHeight(int width) {
|
||||
final int lineWidth = width - getPaddingLeft() - getPaddingRight();
|
||||
int availableLineWidth = lineWidth;
|
||||
int totalHeight = getPaddingTop() + getPaddingBottom();
|
||||
int lineHeight = 0;
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View child = getChildAt(i);
|
||||
final int childWidth = child.getMeasuredWidth();
|
||||
final int childHeight = child.getMeasuredHeight();
|
||||
if (availableLineWidth < childWidth) {
|
||||
availableLineWidth = lineWidth;
|
||||
totalHeight = totalHeight + lineHeight;
|
||||
lineHeight = 0;
|
||||
}
|
||||
availableLineWidth = availableLineWidth - childWidth;
|
||||
lineHeight = Math.max(childHeight, lineHeight);
|
||||
}
|
||||
totalHeight = totalHeight + lineHeight;
|
||||
return totalHeight;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener{
|
||||
defaultView = LayoutInflater.from(context).inflate(layoutId, this,true);
|
||||
defaultView.setOnClickListener(this);
|
||||
content = new LinearLayout(context);
|
||||
LayoutParams layoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
/*content.setShowDividers(SHOW_DIVIDER_BEGINNING|SHOW_DIVIDER_MIDDLE);
|
||||
content.setDividerDrawable(ContextCompat.getDrawable(context,R.drawable.item_divider));*/
|
||||
@@ -119,6 +119,8 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener{
|
||||
});
|
||||
init = true;
|
||||
hide();
|
||||
|
||||
showItem();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +143,7 @@ public class FoldLayout extends LinearLayout implements View.OnClickListener{
|
||||
* Auto hide
|
||||
*/
|
||||
public void hide() {
|
||||
LayoutParams layoutParams = (LayoutParams) content.getLayoutParams();
|
||||
LinearLayout.LayoutParams layoutParams = (LayoutParams) content.getLayoutParams();
|
||||
layoutParams.height = 0;
|
||||
content.setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
package com.fatapp.oxygentoolbox.ui.home;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.fatapp.oxygentoolbox.MainActivity;
|
||||
import com.fatapp.oxygentoolbox.R;
|
||||
import com.fatapp.oxygentoolbox.layout.FoldLayout;
|
||||
|
||||
@@ -22,6 +31,7 @@ public class HomeFragment extends Fragment {
|
||||
private HomeViewModel homeViewModel;
|
||||
|
||||
private FoldLayout foldLayout;
|
||||
private FoldLayout foldLayout1;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
@@ -34,11 +44,13 @@ public class HomeFragment extends Fragment {
|
||||
|
||||
private void initView() {
|
||||
foldLayout = (FoldLayout) root.findViewById(R.id.foldLayout);
|
||||
|
||||
List<View> viewList = new ArrayList<>();
|
||||
|
||||
viewList.add(getLayoutInflater().inflate(R.layout.layout_item, null));
|
||||
|
||||
foldLayout.addItemView(viewList);
|
||||
|
||||
foldLayout1 = (FoldLayout) root.findViewById(R.id.foldLayout1);
|
||||
List<View> viewList1 = new ArrayList<>();
|
||||
viewList1.add(getLayoutInflater().inflate(R.layout.layout_item, null));
|
||||
foldLayout1.addItemView(viewList1);
|
||||
}
|
||||
}
|
||||
10
app/src/main/res/drawable-v21/ripple_foreground.xml
Normal file
10
app/src/main/res/drawable-v21/ripple_foreground.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#88cccccc">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<!--<solid android:color="#FFFFFF" />-->
|
||||
<solid android:color="#88cccccc" />
|
||||
<corners android:radius="120dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 252 B |
@@ -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/design_default_color_background" />
|
||||
<solid android:color="@color/fold_layout_background" />
|
||||
<corners
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp"/>
|
||||
|
||||
5
app/src/main/res/drawable/button_radius_shape.xml
Normal file
5
app/src/main/res/drawable/button_radius_shape.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#FFF5F5F5" />
|
||||
<corners android:radius="120dp" />
|
||||
</shape>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false" android:drawable="@android:color/white"/>
|
||||
<item android:state_pressed="true" android:drawable="@android:color/darker_gray"/>
|
||||
<item android:drawable="@android:color/white"/>
|
||||
</selector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<size android:width="1dp" android:height="1dp"/>
|
||||
<solid android:color="#e1e1e1" />
|
||||
</shape>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -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/design_default_color_background" />
|
||||
<solid android:color="@color/fold_layout_background" />
|
||||
<corners
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp"
|
||||
|
||||
@@ -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/design_default_color_background" />
|
||||
<solid android:color="@color/fold_layout_background" />
|
||||
<corners
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp"/>
|
||||
|
||||
24
app/src/main/res/layout/basic_tool_list.xml
Normal file
24
app/src/main/res/layout/basic_tool_list.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/bottom_radius_background"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/basicToolsRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -8,8 +8,7 @@
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/top_bottom_radius_background"
|
||||
android:gravity="center_vertical"
|
||||
>
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="#80CCCCCC"
|
||||
android:background="@color/app_background"
|
||||
tools:context=".ui.home.HomeFragment">
|
||||
|
||||
<com.fatapp.oxygentoolbox.layout.FoldLayout
|
||||
@@ -16,5 +16,12 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layoutId="@layout/fold_layout" />
|
||||
<com.fatapp.oxygentoolbox.layout.FoldLayout
|
||||
android:id="@+id/foldLayout1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layoutId="@layout/fold_layout" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,44 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/layout_item_LinearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical"
|
||||
>
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
<com.fatapp.oxygentoolbox.layout.AutoLinefeedLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/bottom_radius_background"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/love" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_weight="6"
|
||||
android:gravity="center_vertical"
|
||||
android:text="工具"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
<Button
|
||||
style="@style/ToolsButton"
|
||||
android:text="Button1"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/arrow" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
style="@style/ToolsButton"
|
||||
android:text="Button2"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
style="@style/ToolsButton"
|
||||
android:text="Button3"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
style="@style/ToolsButton"
|
||||
android:text="Button4"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
style="@style/ToolsButton"
|
||||
android:text="Button5"/>
|
||||
</LinearLayout>
|
||||
</com.fatapp.oxygentoolbox.layout.AutoLinefeedLayout>
|
||||
<!--</LinearLayout>-->
|
||||
|
||||
</LinearLayout>
|
||||
13
app/src/main/res/values-night/colors.xml
Normal file
13
app/src/main/res/values-night/colors.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="app_background">#FF202020</color>
|
||||
<color name="fold_layout_background">#FF303030</color>
|
||||
<color name="button_text">#FFFAFAFA</color>
|
||||
</resources>
|
||||
15
app/src/main/res/values-night/styles.xml
Normal file
15
app/src/main/res/values-night/styles.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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:layout_height">35dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_marginEnd">5dp</item>
|
||||
<item name="android:layout_marginTop">5dp</item>
|
||||
<item name="android:layout_marginBottom">5dp</item>
|
||||
<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/button_text</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|
||||
@@ -7,4 +7,7 @@
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="app_background">#FFF5F5F5</color>
|
||||
<color name="fold_layout_background">#FFFFFFFF</color>
|
||||
<color name="button_text">#FF434343</color>
|
||||
</resources>
|
||||
15
app/src/main/res/values/styles.xml
Normal file
15
app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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:layout_height">35dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_marginEnd">5dp</item>
|
||||
<item name="android:layout_marginTop">5dp</item>
|
||||
<item name="android:layout_marginBottom">5dp</item>
|
||||
<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/button_text</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.OxygenToolbox" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
android:shortcutId="main"
|
||||
android:shortcutLongLabel="@string/shortcutLongLabel"
|
||||
android:shortcutShortLabel="@string/shortcutShortLabel">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetClass="com.tencent.mm.ui.LauncherUI"
|
||||
android:targetPackage="com.tencent.mm" />
|
||||
<categories android:name="android.shortcut.conversation" />
|
||||
</shortcut>
|
||||
</shortcuts>
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetClass="com.fatapp.oxygentoolbox.MainActivity"
|
||||
android:targetPackage="com.oxygenfatapp.toolbox" />
|
||||
<categories android:name="android.shortcut.conversation" />
|
||||
</shortcut>
|
||||
</shortcuts>
|
||||
Reference in New Issue
Block a user