renamed tab1 to tabs
This commit is contained in:
@@ -35,7 +35,7 @@ public class MakeAutoActivity2 extends AppCompatActivity {
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainer, new Tab1())
|
||||
.replace(R.id.fragmentContainer, new Tabs())
|
||||
.commit();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class MakeAutoActivity2 extends AppCompatActivity {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
// Pass tab position dynamically
|
||||
Fragment targetFragment = Tab1.newInstance(tab.getPosition());
|
||||
Fragment targetFragment = Tabs.newInstance(tab.getPosition());
|
||||
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainer, targetFragment)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.example.generator;
|
||||
|
||||
import android.media.metrics.Event;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
@@ -17,16 +16,16 @@ import androidx.fragment.app.Fragment;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Tab1 extends Fragment {
|
||||
public class Tabs extends Fragment {
|
||||
|
||||
private static final String ARG_POSITION = "tab_position";
|
||||
|
||||
public Tab1() {
|
||||
public Tabs() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static Tab1 newInstance(int position) {
|
||||
Tab1 fragment = new Tab1();
|
||||
public static Tabs newInstance(int position) {
|
||||
Tabs fragment = new Tabs();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(ARG_POSITION, position);
|
||||
fragment.setArguments(args);
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
tools:context=".Tab1">
|
||||
tools:context=".Tabs">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user