Skip to content

Commit 17cb2e2

Browse files
committed
remove unnecessary UI files
1 parent bdbf2e6 commit 17cb2e2

File tree

8 files changed

+10
-283
lines changed

8 files changed

+10
-283
lines changed

app/src/main/java/com/lcl/lclmeasurementtool/FirstFragment.java

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,14 @@
11
package com.lcl.lclmeasurementtool;
22

3-
import android.os.Bundle;
4-
5-
import com.google.android.material.snackbar.Snackbar;
6-
73
import androidx.appcompat.app.AppCompatActivity;
84

9-
import android.view.View;
10-
11-
import androidx.navigation.NavController;
12-
import androidx.navigation.Navigation;
13-
import androidx.navigation.ui.AppBarConfiguration;
14-
import androidx.navigation.ui.NavigationUI;
15-
16-
import com.lcl.lclmeasurementtool.databinding.ActivityMainBinding;
17-
18-
import android.view.Menu;
19-
import android.view.MenuItem;
5+
import android.os.Bundle;
206

217
public class MainActivity extends AppCompatActivity {
228

23-
private AppBarConfiguration appBarConfiguration;
24-
private ActivityMainBinding binding;
25-
269
@Override
2710
protected void onCreate(Bundle savedInstanceState) {
2811
super.onCreate(savedInstanceState);
29-
30-
binding = ActivityMainBinding.inflate(getLayoutInflater());
31-
setContentView(binding.getRoot());
32-
33-
setSupportActionBar(binding.toolbar);
34-
35-
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
36-
appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build();
37-
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
38-
39-
binding.fab.setOnClickListener(new View.OnClickListener() {
40-
@Override
41-
public void onClick(View view) {
42-
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
43-
.setAction("Action", null).show();
44-
}
45-
});
46-
}
47-
48-
@Override
49-
public boolean onCreateOptionsMenu(Menu menu) {
50-
// Inflate the menu; this adds items to the action bar if it is present.
51-
getMenuInflater().inflate(R.menu.menu_main, menu);
52-
return true;
53-
}
54-
55-
@Override
56-
public boolean onOptionsItemSelected(MenuItem item) {
57-
// Handle action bar item clicks here. The action bar will
58-
// automatically handle clicks on the Home/Up button, so long
59-
// as you specify a parent activity in AndroidManifest.xml.
60-
int id = item.getItemId();
61-
62-
//noinspection SimplifiableIfStatement
63-
if (id == R.id.action_settings) {
64-
return true;
65-
}
66-
67-
return super.onOptionsItemSelected(item);
68-
}
69-
70-
@Override
71-
public boolean onSupportNavigateUp() {
72-
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
73-
return NavigationUI.navigateUp(navController, appBarConfiguration)
74-
|| super.onSupportNavigateUp();
12+
setContentView(R.layout.activity_main);
7513
}
7614
}

app/src/main/java/com/lcl/lclmeasurementtool/SecondFragment.java

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
tools:context=".MainActivity">
88

9-
<com.google.android.material.appbar.AppBarLayout
10-
android:layout_width="match_parent"
11-
android:layout_height="wrap_content"
12-
android:theme="@style/Theme.LCLMeasurementTool.AppBarOverlay">
13-
14-
<androidx.appcompat.widget.Toolbar
15-
android:id="@+id/toolbar"
16-
android:layout_width="match_parent"
17-
android:layout_height="?attr/actionBarSize"
18-
android:background="?attr/colorPrimary"
19-
app:popupTheme="@style/Theme.LCLMeasurementTool.PopupOverlay" />
20-
21-
</com.google.android.material.appbar.AppBarLayout>
22-
23-
<include layout="@layout/content_main" />
24-
25-
<com.google.android.material.floatingactionbutton.FloatingActionButton
26-
android:id="@+id/fab"
9+
<TextView
2710
android:layout_width="wrap_content"
2811
android:layout_height="wrap_content"
29-
android:layout_gravity="bottom|end"
30-
android:layout_margin="@dimen/fab_margin"
31-
app:srcCompat="@android:drawable/ic_dialog_email" />
12+
android:text="Hello World!"
13+
app:layout_constraintBottom_toBottomOf="parent"
14+
app:layout_constraintLeft_toLeftOf="parent"
15+
app:layout_constraintRight_toRightOf="parent"
16+
app:layout_constraintTop_toTopOf="parent" />
3217

33-
</androidx.coordinatorlayout.widget.CoordinatorLayout>
18+
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/layout/content_main.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

app/src/main/res/layout/fragment_first.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

app/src/main/res/layout/fragment_second.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

app/src/main/res/navigation/nav_graph.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)