Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
circles-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Circles
circles-android
Commits
48facd92
Commit
48facd92
authored
1 year ago
by
Taras
Browse files
Options
Downloads
Patches
Plain Diff
Create view for settings item
parent
d53960c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/org/futo/circles/view/SettingsMenuItemView.kt
+41
-0
41 additions, 0 deletions
...c/main/java/org/futo/circles/view/SettingsMenuItemView.kt
app/src/main/res/values/attrs.xml
+5
-0
5 additions, 0 deletions
app/src/main/res/values/attrs.xml
with
46 additions
and
0 deletions
app/src/main/java/org/futo/circles/view/SettingsMenuItemView.kt
0 → 100644
+
41
−
0
View file @
48facd92
package
org.futo.circles.view
import
android.content.Context
import
android.util.AttributeSet
import
android.view.LayoutInflater
import
android.widget.LinearLayout
import
org.futo.circles.R
import
org.futo.circles.core.extensions.getAttributes
import
org.futo.circles.databinding.ViewSettingsMenuItemBinding
class
SettingsMenuItemView
(
context
:
Context
,
attrs
:
AttributeSet
?
=
null
,
)
:
LinearLayout
(
context
,
attrs
)
{
init
{
orientation
=
VERTICAL
}
private
val
binding
=
ViewSettingsMenuItemBinding
.
inflate
(
LayoutInflater
.
from
(
context
),
this
)
init
{
getAttributes
(
attrs
,
R
.
styleable
.
SettingsMenuItemView
)
{
binding
.
tvOptionName
.
apply
{
text
=
getString
(
R
.
styleable
.
SettingsMenuItemView_optionName
)
?.
replace
(
' '
,
Typography
.
nbsp
)
setCompoundDrawablesWithIntrinsicBounds
(
getDrawable
(
R
.
styleable
.
SettingsMenuItemView_optionIcon
),
null
,
null
,
null
)
}
}
}
fun
setText
(
text
:
String
)
{
binding
.
tvOptionName
.
text
=
text
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/src/main/res/values/attrs.xml
+
5
−
0
View file @
48facd92
...
@@ -13,4 +13,9 @@
...
@@ -13,4 +13,9 @@
<attr
name=
"readMoreTextViewStyle"
format=
"reference"
/>
<attr
name=
"readMoreTextViewStyle"
format=
"reference"
/>
<declare-styleable
name=
"SettingsMenuItemView"
>
<attr
name=
"optionName"
format=
"string"
/>
<attr
name=
"optionIcon"
format=
"reference"
/>
</declare-styleable>
</resources>
</resources>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment