Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
b9915592
Commit
b9915592
authored
Sep 09, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add switch button
parent
af6e9841
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
182 additions
and
3 deletions
+182
-3
bell_switch_track.xml
app/src/main/res/drawable/bell_switch_track.xml
+58
-0
bell_switch_track_tint.xml
app/src/main/res/drawable/bell_switch_track_tint.xml
+12
-0
bell_switcher.xml
app/src/main/res/drawable/bell_switcher.xml
+40
-0
ic_bell_off.png
app/src/main/res/drawable/ic_bell_off.png
+0
-0
ic_bell_on.png
app/src/main/res/drawable/ic_bell_on.png
+0
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+12
-1
bell_switch_view.xml
app/src/main/res/layout/bell_switch_view.xml
+16
-0
ic_bell_off.png
app/src/main/res/mipmap-mdpi/ic_bell_off.png
+0
-0
ic_bell_on.png
app/src/main/res/mipmap-mdpi/ic_bell_on.png
+0
-0
ic_bell_off.png
app/src/main/res/mipmap-xxhdpi/ic_bell_off.png
+0
-0
ic_bell_on.png
app/src/main/res/mipmap-xxhdpi/ic_bell_on.png
+0
-0
colors.xml
app/src/main/res/values/colors.xml
+1
-0
styles.xml
app/src/main/res/values/styles.xml
+43
-2
No files found.
app/src/main/res/drawable/bell_switch_track.xml
0 → 100644
View file @
b9915592
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:width=
"http://schemas.android.com/apk/res-auto"
>
<item
android:state_checked=
"false"
>
<layer-list>
<item>
<shape
android:shape=
"rectangle"
android:dither=
"true"
android:useLevel=
"false"
>
<size
android:width=
"48dp"
android:height=
"24dp"
/>
<corners
android:radius=
"12dp"
/>
</shape>
</item>
<item
android:right=
"8dp"
>
<bitmap
android:width=
"14dp"
android:height=
"15dp"
android:src=
"@drawable/ic_bell_off"
android:tintMode=
"multiply"
android:gravity=
"end"
android:tint=
"@color/colorPrimaryDark"
/>
</item>
</layer-list>
</item>
<item
android:state_checked=
"true"
>
<layer-list>
<item>
<shape
android:shape=
"rectangle"
android:dither=
"true"
android:useLevel=
"false"
>
<size
android:width=
"48dp"
android:height=
"24dp"
/>
<solid
android:color=
"#FFFFFFFF"
/>
<corners
android:radius=
"12dp"
/>
</shape>
</item>
<item
android:left=
"8dp"
>
<bitmap
android:right=
"27dp"
android:top=
"5dp"
android:bottom=
"5dp"
android:src=
"@drawable/ic_bell_on"
android:mipMap=
"true"
android:gravity=
"start"
android:tintMode=
"screen"
android:tint=
"@color/colorPrimaryDark"
/>
</item>
</layer-list>
</item>
</selector>
\ No newline at end of file
app/src/main/res/drawable/bell_switch_track_tint.xml
0 → 100644
View file @
b9915592
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_enabled=
"false"
android:color=
"@color/colorAccent"
>
</item>
<item
android:state_checked=
"true"
android:color=
"@color/colorAccent"
>
</item>
<item
android:color=
"@color/colorOpacityBackgroundInv"
>
</item>
</selector>
\ No newline at end of file
app/src/main/res/drawable/bell_switcher.xml
0 → 100644
View file @
b9915592
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_enabled=
"false"
android:width=
"24dp"
android:height=
"24dp"
>
<shape
android:shape=
"oval"
>
<size
android:width=
"24dp"
android:height=
"24dp"
/>
<stroke
android:width=
"2dp"
android:color=
"#00000000"
/>
<padding
android:left=
"0dp"
android:top=
"0dp"
android:right=
"0dp"
android:bottom=
"0dp"
/>
</shape>
</item>
<item
android:state_checked=
"true"
android:width=
"24dp"
android:height=
"24dp"
>
<shape
android:shape=
"oval"
>
<size
android:width=
"24dp"
android:height=
"24dp"
/>
<stroke
android:width=
"2dp"
android:color=
"#00000000"
/>
</shape>
</item>
<item>
<shape
android:shape=
"oval"
>
<size
android:width=
"24dp"
android:height=
"24dp"
/>
<stroke
android:width=
"2dp"
android:color=
"#00000000"
/>
</shape>
</item>
</selector>
\ No newline at end of file
app/src/main/res/drawable/ic_bell_off.png
0 → 100644
View file @
b9915592
343 Bytes
app/src/main/res/drawable/ic_bell_on.png
0 → 100644
View file @
b9915592
329 Bytes
app/src/main/res/layout/activity_main.xml
View file @
b9915592
...
...
@@ -4,7 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MainActivity"
>
tools:context=
".
base.RoomPark
MainActivity"
>
<TextView
android:id=
"@+id/entryTextView"
...
...
@@ -16,4 +16,15 @@
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<include
layout=
"@layout/bell_switch_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/entryTextView"
app:layout_constraintVertical_bias=
"0.16000003"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/bell_switch_view.xml
0 → 100644
View file @
b9915592
<?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:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id=
"@+id/switch1"
android:layout_width=
"48dp"
android:layout_height=
"24dp"
android:height=
"24dp"
android:checked=
"false"
app:switchMinWidth=
"48dp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/mipmap-mdpi/ic_bell_off.png
0 → 100644
View file @
b9915592
748 Bytes
app/src/main/res/mipmap-mdpi/ic_bell_on.png
0 → 100644
View file @
b9915592
706 Bytes
app/src/main/res/mipmap-xxhdpi/ic_bell_off.png
0 → 100644
View file @
b9915592
1.11 KB
app/src/main/res/mipmap-xxhdpi/ic_bell_on.png
0 → 100644
View file @
b9915592
1.03 KB
app/src/main/res/values/colors.xml
View file @
b9915592
...
...
@@ -6,6 +6,7 @@
<color
name=
"colorAccentSecondary"
>
#093835
</color>
<color
name=
"colorGray"
>
#A1A1A1
</color>
<color
name=
"colorOpacityBackgroundInv"
>
#E3E3E3
</color>
//region background
...
...
app/src/main/res/values/styles.xml
View file @
b9915592
<resources>
<resources
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<!-- Base application theme. -->
<style
name=
"AppTheme"
parent=
"Theme.
AppCompat.Light.Dark
ActionBar"
>
<style
name=
"AppTheme"
parent=
"Theme.
MaterialComponents.Light.No
ActionBar"
>
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorSecondary"
>
@color/colorAccent
</item>
<item
name=
"colorSecondaryVariant"
>
@color/colorAccentSecondary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"materialCardViewStyle"
>
@style/Widget.Biganto.MaterialCardView
</item>
<item
name=
"switchStyle"
>
@style/Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle
</item>
<!-- <item name="android:track" >@drawable/bell_switcher</item>-->
<!-- <item name="android:trackTint" tools:targetApi="m">@color/colorAccentSecondary</item>-->
<!-- active thumb & track color (30% transparency) -->
<!-- <item name="colorControlActivated">@color/colorOpacityBackground</item>-->
<!-- <!– inactive thumb color –>-->
<!-- <item name="colorSwitchThumbNormal">@color/colorAccent</item>-->
<!-- <!– inactive track color (30% transparency) –>-->
<!-- <item name="android:colorForeground">@color/colorPrimaryDark</item>-->
</style>
<style
name=
"Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle"
>
<item
name=
"track"
>
@drawable/bell_switch_track
</item>
<item
name=
"android:thumb"
>
@drawable/bell_switcher
</item>
<item
name=
"thumbTint"
>
@color/colorPrimaryDark
</item>
<item
name=
"trackTint"
>
@drawable/bell_switch_track_tint
</item>
<!-- <item name="android:trackTint" tools:targetApi="m">@color/colorAccentSecondary</item>-->
<!-- <item name="android:thumb" >@drawable/bell_switcher</item>-->
<!-- <item name="android:thumbTint">@color/colorPrimaryDark</item>-->
</style>
<style
name=
"Widget.Biganto.MaterialCardView"
parent=
"Widget.MaterialComponents.CardView"
>
<item
name=
"cardUseCompatPadding"
>
false
</item>
<item
name=
"strokeColor"
>
#1e000000
</item>
<item
name=
"strokeWidth"
>
1dp
</item>
<item
name=
"cornerFamily"
>
cut
</item>
<item
name=
"cornerSize"
>
4dp
</item>
</style>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment