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