Fix drive mode, share story and font moved to lib.

This commit is contained in:
h4h13 2020-02-05 10:10:47 +05:30
parent 5754141b0e
commit 9d76cb165a
36 changed files with 233 additions and 157 deletions

View file

@ -15,9 +15,10 @@
package code.name.monkey.appthemehelper.common.prefs
import android.content.Context
import android.preference.Preference
import android.util.AttributeSet
import android.view.View
import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder
import code.name.monkey.appthemehelper.R
class ATEColorPreference @JvmOverloads constructor(
@ -32,15 +33,20 @@ class ATEColorPreference @JvmOverloads constructor(
private var border: Int = 0
init {
layoutResource = R.layout.ate_preference_custom
widgetLayoutResource = R.layout.ate_preference_color
isPersistent = false
}
override fun onBindView(view: View) {
/*override fun onBindView(view: View) {
super.onBindView(view)
mView = view
invalidateColor()
}*/
override fun onBindViewHolder(holder: PreferenceViewHolder?) {
super.onBindViewHolder(holder)
mView = holder?.itemView
invalidateColor()
}
fun setColor(color: Int, border: Int) {

View file

@ -1,31 +0,0 @@
/*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
package code.name.monkey.appthemehelper.common.views
import android.content.Context
import android.util.AttributeSet
import code.name.monkey.appthemehelper.ThemeStore
import com.google.android.material.textview.MaterialTextView
class ATEPrimaryTextView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : MaterialTextView(context, attrs, defStyleAttr) {
init {
setTextColor(ThemeStore.textColorPrimary(context))
}
}

View file

@ -1,31 +0,0 @@
/*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
package code.name.monkey.appthemehelper.common.views
import android.content.Context
import android.util.AttributeSet
import code.name.monkey.appthemehelper.ThemeStore
import com.google.android.material.textview.MaterialTextView
class ATESecondaryTextView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : MaterialTextView(context, attrs, defStyleAttr) {
init {
setTextColor(ThemeStore.textColorSecondary(context))
}
}

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_toggle_switch_off" android:state_checked="false" />
<item android:drawable="@drawable/ic_toggle_switch" android:state_checked="true" />
</selector>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/md_white_1000"
android:pathData="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" />
</vector>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/md_white_1000"
android:pathData="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" />
</vector>

View file

@ -18,7 +18,9 @@
android:layout_gravity="center"
android:layout_marginStart="@dimen/ate_preference_inset"
android:layout_marginLeft="@dimen/ate_preference_inset"
tools:ignore="ContentDescription" />
tools:ignore="ContentDescription"
tools:src="@drawable/icon_checkmark_white"
tools:tint="@color/md_black_1000" />
<RelativeLayout
android:layout_width="0dp"
@ -32,7 +34,7 @@
android:layout_marginBottom="12dip"
android:layout_weight="1">
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
<com.google.android.material.textview.MaterialTextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -40,10 +42,13 @@
android:layout_alignParentLeft="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:fontFamily="@font/circular"
android:singleLine="true"
tools:text="Title" />
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="?android:attr/textColorPrimary"
tools:text="@tools:sample/lorem/random" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
<code.name.monkey.retromusic.views.BaselineGridTextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -51,18 +56,18 @@
android:layout_alignStart="@android:id/title"
android:layout_alignLeft="@android:id/title"
android:layout_marginTop="2dp"
android:fontFamily="@font/circular"
android:maxLines="4"
tools:text="Summary" />
tools:text="@tools:sample/lorem/random" />
</RelativeLayout>
<!-- Preference should place its actual preference widget here. -->
<code.name.monkey.appthemehelper.common.views.ATESwitch xmlns:android="http://schemas.android.com/apk/res/android"
<code.name.monkey.appthemehelper.common.views.ATESwitch
android:id="@+id/switchWidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:button="@drawable/ate_switch"
android:clickable="false"
android:focusable="false" />

View file

@ -19,7 +19,8 @@
android:layout_gravity="center"
android:layout_marginStart="@dimen/ate_preference_inset"
android:layout_marginLeft="@dimen/ate_preference_inset"
tools:ignore="ContentDescription" />
tools:ignore="ContentDescription"
tools:src="@drawable/icon_back_black" />
<RelativeLayout
android:layout_width="0dp"
@ -33,19 +34,22 @@
android:layout_marginBottom="12dip"
android:layout_weight="1">
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
<com.google.android.material.textview.MaterialTextView
android:id="@android:id/title"
style="@style/TextAppearance.MaterialComponents.Subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:fontFamily="@font/circular"
android:singleLine="true"
tools:text="Title" />
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="?android:attr/textColorPrimary"
tools:text="@tools:sample/lorem/random" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
<com.google.android.material.textview.MaterialTextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -53,7 +57,9 @@
android:layout_alignStart="@android:id/title"
android:layout_alignLeft="@android:id/title"
android:layout_marginTop="2dp"
android:fontFamily="@font/circular"
android:maxLines="4"
android:textColor="?android:attr/textColorSecondary"
tools:text="I have one solution for you.you can change font size for specific preference by managing layout file." />
</RelativeLayout>