Commit 6d79e26b authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

proper textinpulayout styling

parent d1d9a545
......@@ -10,7 +10,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.Launch">
<activity android:name=".base.RoomParkMainActivity">
<activity android:name=".base.RoomParkMainActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
......@@ -11,3 +11,5 @@ interface FeedsScreen : BigantoBaseContract<FeedsScreenViewState> {
fun feedsTabSelected(): Observable<Int>
}
data class EstateTabModel(val title:String, val building:Int)
\ No newline at end of file
package com.biganto.visual.roompark.presentation.screen.to_flat
import android.view.View
import android.widget.TextView
import butterknife.BindView
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.presentation.screen.feeds.EstateTabModel
import com.google.android.material.tabs.TabLayout
import timber.log.Timber
import javax.inject.Inject
......@@ -22,12 +26,32 @@ class FindFlatScreenController :
getComponent()
}
@BindView(R.id.flat_estate_tabs)
lateinit var feedsTabs: TabLayout
@Inject
override lateinit var injectedPresenter: FindFlatScreenPresenter
val estateTabs = arrayListOf(
EstateTabModel("Д1",1),
EstateTabModel("Д2",2),
EstateTabModel("Д3",3)
)
override fun onViewBound(v: View) {
estateTabs.forEach {estate ->
val tab = feedsTabs.newTab()
.setCustomView(R.layout.to_flat_tab_view)
tab.customView
?.let {
it.findViewById<TextView>(R.id.tab_title)?.text = estate.title
it.findViewById<TextView>(R.id.tab_divider)?.visibility =
if (estateTabs.indexOf(estate) == estateTabs.size - 1) View.GONE
else View.VISIBLE
}
feedsTabs.addTab(tab)
}
}
override fun render(viewState: FindFlatScreenViewState) {
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
<com.google.android.material.tabs.TabLayout
android:id="@+id/flat_estate_tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal">
<include
layout="@layout/simple_text_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:background="#00000000"
app:tabIndicatorColor="@color/colorAccent"
app:tabMaxWidth="@dimen/feeds_tab_max_width"
app:tabMode="scrollable" />
<com.google.android.material.textfield.TextInputLayout
style="@style/SelectFlatInputLayout"
android:colorControlActivated="@color/colorAccent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp">
<com.google.android.material.textfield.TextInputEditText
style="@style/SelectFlatInputLayout.EditText"
style="@style/ToFlat.EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp" />
android:cursorVisible="true"
android:includeFontPadding="false"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
style="@style/AuthButton"
style="@style/AuthButton.Enable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="СМОТРЕТЬ"/>
android:text="СМОТРЕТЬ" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tab_title"
style="@style/Default_TextView.Accent_Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tab_divider"
style="@style/Header_TextView.Accent_Header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/tab_title"
android:layout_marginStart="16dp"
android:text="@string/feeds_tab_divider"
android:textColor="@color/colorAccentSecondary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tab_title"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -12,6 +12,13 @@
<item name="materialCardViewStyle">@style/Widget.Biganto.MaterialCardView</item>
<item name="switchStyle">@style/Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle</item>
<item name="colorControlActivated">@color/colorAccent</item>
<item name="colorControlHighlight">@color/colorAccent</item>
<item name="colorControlNormal">@color/colorAccent</item>
</style>
<style name="Widget.MainTextInputStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<item name="android:theme">@style/AppTheme.Theme2</item>
</style>
<style name="AppTheme.Launch">
......@@ -44,7 +51,8 @@
<item name="colorControlActivated">@color/colorAccentSecondary</item>
</style>
<style name="AuthTextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.Dense">
<style name="AuthTextInputLayout" parent="Widget.MainTextInputStyle">
<item name="colorControlNormal">@color/colorCommonBackground</item>
<item name="colorControlActivated">@color/colorCommonBackground</item>
<item name="boxStrokeColor">@color/colorAccent</item>
......@@ -65,25 +73,36 @@
<item name="android:hint">"ПАРОЛЬ"</item>
</style>
<style name="SelectFlatInputLayout" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.Dense">
<item name="colorControlNormal">@color/colorCommonBackground</item>
<item name="colorControlActivated">@color/colorCommonBackground</item>
<item name="boxBackgroundColor">@color/colorCommonBackground</item>
<style name="AppTheme.Theme2">
<item name="colorPrimary">@color/colorAttention</item>
</style>
<style name="SelectFlatInputLayout" parent="Widget.MainTextInputStyle">
<item name="colorControlNormal">@color/colorAccent</item>
<item name="colorControlActivated">@color/colorAccentSecondary</item>
<item name="colorControlHighlight">@color/colorAccentSecondary</item>
<item name="android:textColorHint">@color/colorNoticeText</item>
<item name="android:textColor">@color/colorCommonText</item>
<item name="errorTextAppearance">@style/Auth.EditText</item>
<item name="hintTextColor">@color/colorNoticeText</item>
<item name="android:editTextStyle">@style/SelectFlatInputLayout.EditText</item>
<item name="android:hint">"Кв.№"</item>
<item name="android:includeFontPadding">false</item>
<item name="android:baselineAlignBottom">true</item>
<item name="android:textSize">@dimen/super_size</item>
</style>
<style name="SelectFlatInputLayout.EditText" parent="Widget.AppCompat.EditText">
<style name="ToFlat.EditText" parent="SelectFlatInputLayout">
<!-- <item name="android:theme">@style/AppTheme</item>-->
<!-- Inactive underline color-->
<item name="colorControlNormal">@color/colorAccent</item>
<item name="android:textSize">@dimen/super_size</item>
<item name="android:hint">"Кв.№"</item>
<item name="android:baselineAlignBottom">true</item>
<item name="android:includeFontPadding">false</item>
<!-- Cursor and Active underline color, uses colorAccent by default if not defined-->
<item name="colorControlActivated">@color/colorAccentSecondary</item>
</style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment