Skip to content

Commit

Permalink
Updated examples. Fixed bug. Changed names layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathandelaSen committed Oct 10, 2020
1 parent 112c137 commit aef218a
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package devjdelasen.com.cleanui

import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Typeface
import android.graphics.drawable.Drawable
import android.util.AttributeSet
import android.util.TypedValue
Expand All @@ -11,7 +10,7 @@ import android.widget.LinearLayout
import android.widget.RelativeLayout
import androidx.core.content.ContextCompat
import androidx.core.widget.ImageViewCompat
import kotlinx.android.synthetic.main.simple_toolbar.view.*
import kotlinx.android.synthetic.main.simple_toolbar_clean_ui.view.*


class SimpleToolbar : LinearLayout {
Expand Down Expand Up @@ -80,7 +79,7 @@ class SimpleToolbar : LinearLayout {
}

private fun init() {
View.inflate(context, R.layout.simple_toolbar, this)
View.inflate(context, R.layout.simple_toolbar_clean_ui, this)
setView()
setListeners()
}
Expand Down
6 changes: 2 additions & 4 deletions CleanUI/src/main/java/devjdelasen/com/cleanui/TitleSection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package devjdelasen.com.cleanui

import android.content.Context
import android.util.AttributeSet
import android.util.TypedValue
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import kotlinx.android.synthetic.main.title_section.view.*
import kotlinx.android.synthetic.main.title_section_clean_ui.view.*


class TitleSection : LinearLayout {
Expand Down Expand Up @@ -43,7 +41,7 @@ class TitleSection : LinearLayout {
}

private fun init() {
View.inflate(context, R.layout.title_section, this)
View.inflate(context, R.layout.title_section_clean_ui, this)
setView()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.core.content.ContextCompat
import devjdelasen.com.cleanui.R
import devjdelasen.com.cleanui.TextStyle
import devjdelasen.com.cleanui.set
import kotlinx.android.synthetic.main.title_section.view.*
import kotlinx.android.synthetic.main.title_section_clean_ui.view.*


abstract class SettingsRow: LinearLayout {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import android.content.Context
import android.content.res.ColorStateList
import android.util.AttributeSet
import android.view.View
import androidx.core.content.ContextCompat
import androidx.core.widget.ImageViewCompat
import devjdelasen.com.cleanui.R
import devjdelasen.com.cleanui.TextStyle
import devjdelasen.com.cleanui.set
import kotlinx.android.synthetic.main.settings_row_action.view.*
import kotlinx.android.synthetic.main.settings_row_action_clean_ui.view.*


class SettingsRowAction: SettingsRow {
Expand Down Expand Up @@ -51,7 +48,7 @@ class SettingsRowAction: SettingsRow {


private fun setView() {
View.inflate(context, R.layout.settings_row_action, this)
View.inflate(context, R.layout.settings_row_action_clean_ui, this)
if (icTintColor != -1) ImageViewCompat.setImageTintList(clean_ui_ivIcAction, ColorStateList.valueOf(icTintColor))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import android.content.res.ColorStateList
import android.util.AttributeSet
import android.view.View
import android.widget.CompoundButton
import android.widget.RadioGroup
import androidx.core.content.ContextCompat
import androidx.core.widget.CompoundButtonCompat
import androidx.core.widget.ImageViewCompat
import devjdelasen.com.cleanui.R
import kotlinx.android.synthetic.main.settings_row_check.view.*
import kotlinx.android.synthetic.main.settings_row_check_clean_ui.view.*


class SettingsRowCheckBox: SettingsRow {
Expand Down Expand Up @@ -53,7 +51,7 @@ class SettingsRowCheckBox: SettingsRow {
}

private fun setView() {
View.inflate(context, R.layout.settings_row_check, this)
View.inflate(context, R.layout.settings_row_check_clean_ui, this)
CompoundButtonCompat.setButtonTintList(clean_ui_cb, ColorStateList.valueOf(cbTintColor));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.core.content.ContextCompat
import devjdelasen.com.cleanui.R
import devjdelasen.com.cleanui.TextStyle
import devjdelasen.com.cleanui.set
import kotlinx.android.synthetic.main.settings_row_subtext.view.*
import kotlinx.android.synthetic.main.settings_row_subtext_clean_ui.view.*


class SettingsRowSubtext: SettingsRow {
Expand Down Expand Up @@ -55,7 +55,7 @@ class SettingsRowSubtext: SettingsRow {
}

private fun setView() {
View.inflate(context, R.layout.settings_row_subtext, this)
View.inflate(context, R.layout.settings_row_subtext_clean_ui, this)
clean_ui_tvSubtext?.set(subtext, subtextColor, subtextSize, subtextTextStyle)
}

Expand Down
21 changes: 13 additions & 8 deletions app/src/main/res/layout/activity_toolbar_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@
<devjdelasen.com.cleanui.SimpleToolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:simple_toolbar_title="Left title + divider + tint icon"
app:simple_toolbar_title_to_left="true"
app:simple_toolbar_title="No tint icon"
app:simple_toolbar_title_to_left="false"
app:simple_toolbar_left_icon="@drawable/ic_back_arrow"
app:simple_toolbar_left_color="@color/clean_ui_title_default"
app:simple_toolbar_right1_icon="@drawable/ic_done"
app:simple_toolbar_right1_color="@color/clean_ui_colorPrimary"
app:simple_toolbar_right1_icon="@drawable/ic_chat_gradient"
app:simple_toolbar_hide_divider="false"
android:layout_marginBottom="20dp"
/>

<devjdelasen.com.cleanui.SimpleToolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:simple_toolbar_title="Center + no divider + no tint icon"
app:simple_toolbar_title_to_left="false"
app:simple_toolbar_hide_divider="true"
app:simple_toolbar_title="No divider and tint icon"
app:simple_toolbar_title_to_left="true"
app:simple_toolbar_left_icon="@drawable/ic_back_arrow"
app:simple_toolbar_right1_icon="@drawable/ic_chat_gradient"
app:simple_toolbar_hide_divider="false"
app:simple_toolbar_left_color="@color/clean_ui_title_default"
app:simple_toolbar_right1_icon="@drawable/ic_geo"
app:simple_toolbar_right1_color="@color/clean_ui_colorPrimary"
android:layout_marginBottom="20dp"
/>

Expand All @@ -38,6 +40,7 @@
android:layout_height="wrap_content"
app:simple_toolbar_title="Changed size, text style and color"
app:simple_toolbar_title_color="@color/clean_ui_colorPrimary"
app:simple_toolbar_right1_icon="@drawable/ic_options"
app:simple_toolbar_title_style="italic"
app:simple_toolbar_text_size="16"
android:layout_marginBottom="20dp"
Expand All @@ -47,6 +50,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:simple_toolbar_title="Changed divider color"
app:simple_toolbar_title_color="@color/clean_ui_subtitle_dark"
app:simple_toolbar_left_icon="@drawable/ic_chat_gradient"
app:simple_toolbar_divider_color="@color/clean_ui_icon_light"
android:layout_marginBottom="20dp"
/>
Expand Down

0 comments on commit aef218a

Please sign in to comment.