moving tabs at the bottom
This commit is contained in:
parent
6bc0624b88
commit
8a522323f4
|
@ -62,7 +62,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:0ee0850e6f'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:4b8a3568df'
|
||||||
implementation 'org.greenrobot:eventbus:3.3.1'
|
implementation 'org.greenrobot:eventbus:3.3.1'
|
||||||
implementation 'com.github.Armen101:AudioRecordView:1.0.4'
|
implementation 'com.github.Armen101:AudioRecordView:1.0.4'
|
||||||
implementation 'androidx.documentfile:documentfile:1.0.1'
|
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||||
|
|
|
@ -103,6 +103,11 @@ class MainActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
view_pager.currentItem = config.lastUsedViewPagerPage
|
view_pager.currentItem = config.lastUsedViewPagerPage
|
||||||
|
|
||||||
|
main_tabs_holder.setTabTextColors(
|
||||||
|
getProperTextColor(),
|
||||||
|
getProperPrimaryColor()
|
||||||
|
)
|
||||||
|
|
||||||
main_tabs_holder.onTabSelectionChanged(
|
main_tabs_holder.onTabSelectionChanged(
|
||||||
tabUnselectedAction = {
|
tabUnselectedAction = {
|
||||||
it.icon?.applyColorFilter(getProperTextColor())
|
it.icon?.applyColorFilter(getProperTextColor())
|
||||||
|
@ -119,7 +124,6 @@ class MainActivity : SimpleActivity() {
|
||||||
private fun setupTabColors() {
|
private fun setupTabColors() {
|
||||||
main_tabs_holder.apply {
|
main_tabs_holder.apply {
|
||||||
background = ColorDrawable(getProperBackgroundColor())
|
background = ColorDrawable(getProperBackgroundColor())
|
||||||
setSelectedTabIndicatorColor(getProperPrimaryColor())
|
|
||||||
getTabAt(view_pager.currentItem)?.icon?.applyColorFilter(getProperPrimaryColor())
|
getTabAt(view_pager.currentItem)?.icon?.applyColorFilter(getProperPrimaryColor())
|
||||||
getTabAt(getInactiveTabIndex())?.icon?.applyColorFilter(getProperTextColor())
|
getTabAt(getInactiveTabIndex())?.icon?.applyColorFilter(getProperTextColor())
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,34 +5,38 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyViewPager
|
||||||
|
android:id="@+id/view_pager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/main_tabs_holder" />
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/main_tabs_holder"
|
android:id="@+id/main_tabs_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="wrap_content"
|
||||||
app:elevation="6dp"
|
android:layout_alignParentBottom="true"
|
||||||
app:tabIndicatorColor="@android:color/white"
|
android:elevation="8dp"
|
||||||
app:tabIndicatorHeight="2dp"
|
app:tabIndicator="@null"
|
||||||
app:tabMinWidth="150dp"
|
app:tabMinWidth="150dp"
|
||||||
app:tabSelectedTextColor="@android:color/white">
|
app:tabRippleColor="@null"
|
||||||
|
app:tabTextAppearance="@style/TabLayoutStyle">
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabItem
|
<com.google.android.material.tabs.TabItem
|
||||||
android:id="@+id/tab_recorder"
|
android:id="@+id/tab_recorder"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:icon="@drawable/ic_microphone_vector" />
|
android:contentDescription="@string/recorder"
|
||||||
|
android:icon="@drawable/ic_microphone_vector"
|
||||||
|
android:text="@string/recorder" />
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabItem
|
<com.google.android.material.tabs.TabItem
|
||||||
android:id="@+id/tab_player"
|
android:id="@+id/tab_player"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:icon="@drawable/ic_headset_vector" />
|
android:contentDescription="@string/player"
|
||||||
|
android:icon="@drawable/ic_headset_vector"
|
||||||
|
android:text="@string/player" />
|
||||||
|
|
||||||
</com.google.android.material.tabs.TabLayout>
|
</com.google.android.material.tabs.TabLayout>
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyViewPager
|
|
||||||
android:id="@+id/view_pager"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_below="@+id/main_tabs_holder" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
|
@ -11,4 +11,7 @@
|
||||||
<item name="android:windowNoDisplay">true</item>
|
<item name="android:windowNoDisplay">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TabLayoutStyle" parent="Base.Widget.Design.TabLayout">
|
||||||
|
<item name="android:textSize">@dimen/smaller_text_size</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue