From 180aee45c230fe8b61526ed52acbcc479e822dc5 Mon Sep 17 00:00:00 2001 From: niushuai233 Date: Thu, 27 Oct 2022 16:27:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2ui?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/nav/setup/NavSetUpFragment.java | 24 +++- .../res/layout/main_nav_fragment_set_up.xml | 124 ++++++++++++++++-- app/src/main/res/values/setup_styles.xml | 48 +++++++ app/src/main/res/values/strings.xml | 13 ++ 4 files changed, 194 insertions(+), 15 deletions(-) create mode 100644 app/src/main/res/values/setup_styles.xml diff --git a/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/setup/NavSetUpFragment.java b/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/setup/NavSetUpFragment.java index 9d499c1..74e92fe 100644 --- a/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/setup/NavSetUpFragment.java +++ b/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/setup/NavSetUpFragment.java @@ -6,13 +6,15 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; +import androidx.lifecycle.LifecycleObserver; import androidx.lifecycle.ViewModelProvider; +import cc.niushuai.project.devcontrol.base.ui.BaseFragment; import cc.niushuai.project.devcontrol.databinding.MainNavFragmentSetUpBinding; - -public class NavSetUpFragment extends Fragment { +public class NavSetUpFragment extends BaseFragment { private MainNavFragmentSetUpBinding navFragmentSetUpBinding; @@ -20,18 +22,26 @@ public class NavSetUpFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - navFragmentSetUpBinding = MainNavFragmentSetUpBinding.inflate(inflater, container, false); + navFragmentSetUpBinding = MainNavFragmentSetUpBinding.inflate(getLayoutInflater()); - NavSetUpViewModel navSetUpViewModel = new ViewModelProvider(this).get(NavSetUpViewModel.class); View rootView = navFragmentSetUpBinding.getRoot(); - TextView textView = navFragmentSetUpBinding.navSetupFragmentTextview; - - navSetUpViewModel.getText().observe(getViewLifecycleOwner(), textView::setText); + this.init(); + this.addListener(); + rootView.requestLayout(); return rootView; } + private void addListener() { + + } + + private void init() { + + } + + @Override public void onDestroyView() { super.onDestroyView(); diff --git a/app/src/main/res/layout/main_nav_fragment_set_up.xml b/app/src/main/res/layout/main_nav_fragment_set_up.xml index aeac68d..8f01d42 100644 --- a/app/src/main/res/layout/main_nav_fragment_set_up.xml +++ b/app/src/main/res/layout/main_nav_fragment_set_up.xml @@ -6,15 +6,123 @@ android:layout_height="match_parent" tools:context=".ui.nav.setup.NavSetUpFragment"> - + android:layout_marginTop="10dp"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/setup_styles.xml b/app/src/main/res/values/setup_styles.xml new file mode 100644 index 0000000..e30ddd9 --- /dev/null +++ b/app/src/main/res/values/setup_styles.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ccd079a..71e2bf0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -25,6 +25,19 @@ btn 2 btn 3 + + + + 通用 + 备份 + 恢复 + 日志 + 总开关 + 日志级别 + 保留天数 + + + 设备 日志