File tree Expand file tree Collapse file tree
java/com/sparkleseditor/fragments Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,20 +159,6 @@ private void setupFileTree() {
159159 }
160160
161161 private void slideXDrawer () {
162- /*int statusBarHeight =
163- getResources()
164- .getDimensionPixelSize(
165- getResources().getIdentifier("status_bar_height", "dimen", "android"));*/
166- int navigationBarHeight =
167- getResources ()
168- .getDimensionPixelSize (
169- getResources ().getIdentifier ("navigation_bar_height" , "dimen" , "android" ));
170- ViewGroup .LayoutParams layoutParams = binding .leftDrawerMenu .getLayoutParams ();
171- if (layoutParams instanceof ViewGroup .MarginLayoutParams ) {
172- ViewGroup .MarginLayoutParams marginLayoutParams = (ViewGroup .MarginLayoutParams ) layoutParams ;
173- binding .leftDrawerMenu .setLayoutParams (marginLayoutParams );
174- }
175-
176162 binding .drawer .setScrimColor (Color .TRANSPARENT );
177163 binding .drawer .setDrawerElevation (0f );
178164 binding .drawer .addDrawerListener (new DrawerLayout .SimpleDrawerListener () {
@@ -243,6 +229,16 @@ private void setupToolbox() {
243229 frgSettings
244230 );
245231 });
232+ binding .term .setOnClickListener (
233+ v ->{
234+ Fragment frgTerm = new TerminalFragment ();
235+ Navigator .pushTo (
236+ getParentFragmentManager (),
237+ R .id .nav_host ,
238+ frgTerm
239+ );
240+ }
241+ );
246242 }
247243
248244 @ SuppressLint ("NonConstantResourceId" )
Original file line number Diff line number Diff line change 66import android .view .ViewGroup ;
77
88import androidx .annotation .NonNull ;
9- import androidx .fragment .app .Fragment ;
10- import androidx .navigation .fragment .NavHostFragment ;
119
12- import com .sparkleseditor .R ;
13- import com .sparkleseditor .databinding .FragmentSecondBinding ;
10+ import com .sparkleseditor .databinding .FragmentTemplateBinding ;
1411
15- public class SecondFragment extends BaseFragment {
12+ public class TemplateFragment extends BaseFragment {
1613
17- private FragmentSecondBinding binding ;
14+ private FragmentTemplateBinding binding ;
1815
1916 @ Override
2017 public View onCreateView (
2118 @ NonNull LayoutInflater inflater , ViewGroup container ,
2219 Bundle savedInstanceState
2320 ) {
2421
25- binding = FragmentSecondBinding .inflate (inflater , container , false );
22+ binding = FragmentTemplateBinding .inflate (inflater , container , false );
2623 return binding .getRoot ();
2724
2825 }
Original file line number Diff line number Diff line change 1+ package com .sparkleseditor .fragments ;
2+
3+ import android .os .Bundle ;
4+ import android .view .LayoutInflater ;
5+ import android .view .View ;
6+ import android .view .ViewGroup ;
7+
8+ import androidx .annotation .NonNull ;
9+
10+ import com .sparkleseditor .databinding .FragmentTemplateBinding ;
11+
12+ public class TerminalFragment extends BaseFragment {
13+
14+ private FragmentTemplateBinding binding ;
15+
16+ @ Override
17+ public View onCreateView (
18+ @ NonNull LayoutInflater inflater , ViewGroup container ,
19+ Bundle savedInstanceState
20+ ) {
21+
22+ binding = FragmentTemplateBinding .inflate (inflater , container , false );
23+ return binding .getRoot ();
24+
25+ }
26+
27+ public void onViewCreated (@ NonNull View view , Bundle savedInstanceState ) {
28+ super .onViewCreated (view , savedInstanceState );
29+
30+ }
31+
32+ @ Override
33+ public void onDestroyView () {
34+ super .onDestroyView ();
35+ binding = null ;
36+ }
37+
38+ }
Original file line number Diff line number Diff line change 44 xmlns : tools =" http://schemas.android.com/tools"
55 android : layout_width =" match_parent"
66 android : layout_height =" match_parent"
7- tools : context =" .fragments.SecondFragment " >
7+ tools : context =" .fragments.TemplateFragment " >
88
99 <androidx .constraintlayout.widget.ConstraintLayout
1010 android : layout_width =" match_parent"
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <androidx .coordinatorlayout.widget.CoordinatorLayout
3+ xmlns : tools =" http://schemas.android.com/tools"
4+ xmlns : app =" http://schemas.android.com/apk/res-auto"
5+ xmlns : android =" http://schemas.android.com/apk/res/android"
6+ android : layout_height =" match_parent"
7+ android : layout_width =" match_parent" >
8+
9+
10+
11+ <TextView
12+ android : layout_width =" wrap_content"
13+ android : layout_height =" wrap_content"
14+ android : text =" Terminal WIP"
15+ android : layout_gravity =" center"
16+ android : textSize =" 32sp" />
17+
18+ </androidx .coordinatorlayout.widget.CoordinatorLayout>
You can’t perform that action at this time.
0 commit comments