Skip to content

Commit 92d1fbd

Browse files
committed
feat : test TabLayout
1 parent b48ece4 commit 92d1fbd

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

app/src/main/java/com/sparkleseditor/fragments/MainFragment.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,16 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
5252
setupToolbar();
5353
setupToolbox();
5454
setupInputView();
55+
setupTabLayoutTemp();
5556
binding.fab.setTranslationY(-12);
5657

5758

5859
}
5960

61+
private void setupTabLayoutTemp() {
62+
binding.tabLayout.addTab(binding.tabLayout.newTab().setText("My Tab Title"));
63+
64+
}
6065

6166

6267
private void setupInputView() {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
<com.google.android.material.tabs.TabLayout
8989
android:id="@+id/tabLayout"
9090
android:layout_width="match_parent"
91-
android:layout_height="wrap_content" />
91+
android:layout_height="wrap_content"
92+
app:tabGravity="start"
93+
app:tabMode="scrollable"/>
9294

9395
<io.github.rosemoe.sora.widget.CodeEditor
9496
android:layout_width="match_parent"

0 commit comments

Comments
 (0)