AndroidX lib refactor
This commit is contained in:
parent
b3eb12aebd
commit
08f0b5e76e
581 changed files with 5470 additions and 6070 deletions
|
@ -7,10 +7,10 @@ import android.app.Activity;
|
|||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import android.view.View;
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||
|
|
|
@ -2,8 +2,8 @@ package code.name.monkey.appthemehelper;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.StyleRes;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import androidx.annotation.StyleRes;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad), Karim Abou Zeid (kabouzeid)
|
||||
|
|
|
@ -4,14 +4,14 @@ import android.annotation.SuppressLint;
|
|||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.CheckResult;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.IntRange;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.StyleRes;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.CheckResult;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.IntRange;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StyleRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package code.name.monkey.appthemehelper;
|
||||
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.StyleRes;
|
||||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.StyleRes;
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad), Karim Abou Zeid (kabouzeid)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package code.name.monkey.appthemehelper.common;
|
||||
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package code.name.monkey.appthemehelper.common;
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATHActivity;
|
||||
|
|
|
@ -5,18 +5,18 @@ import android.content.Context;
|
|||
import android.os.Build;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
import android.support.annotation.Nullable;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ATEColorPreference extends Preference {
|
|||
|
||||
private void invalidateColor() {
|
||||
if (mView != null) {
|
||||
BorderCircleView circle = mView.findViewById(R.id.circle);
|
||||
BorderCircleView circle = (BorderCircleView) mView.findViewById(R.id.circle);
|
||||
if (this.color != 0) {
|
||||
circle.setVisibility(View.VISIBLE);
|
||||
circle.setBackgroundColor(color);
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.afollestad.materialdialogs.prefs.MaterialDialogPreference;
|
|||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -4,17 +4,29 @@ import android.annotation.TargetApi;
|
|||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceViewHolder;
|
||||
import android.preference.SwitchPreference;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Switch;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.appthemehelper.common.views.ATESwitch;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
public class ATESwitchPreference extends ATEPreference {
|
||||
public class ATESwitchPreference extends SwitchPreference {
|
||||
|
||||
static final boolean COMPAT_MODE = Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP;
|
||||
|
||||
private ATESwitch mSwitch;
|
||||
|
||||
public ATESwitchPreference(Context context) {
|
||||
super(context);
|
||||
|
@ -39,20 +51,64 @@ public class ATESwitchPreference extends ATEPreference {
|
|||
|
||||
private void init(Context context, AttributeSet attrs) {
|
||||
setLayoutResource(R.layout.ate_preference_custom);
|
||||
if (COMPAT_MODE) {
|
||||
setWidgetLayoutResource(R.layout.ate_preference_switch);
|
||||
} else {
|
||||
try {
|
||||
Field canRecycleLayoutField = Preference.class.getDeclaredField("mCanRecycleLayout");
|
||||
canRecycleLayoutField.setAccessible(true);
|
||||
canRecycleLayoutField.setBoolean(this, true);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
try {
|
||||
Field canRecycleLayoutField = Preference.class.getDeclaredField("mCanRecycleLayout");
|
||||
canRecycleLayoutField.setAccessible(true);
|
||||
canRecycleLayoutField.setBoolean(this, true);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
try {
|
||||
Field hasSpecifiedLayout = Preference.class.getDeclaredField("mHasSpecifiedLayout");
|
||||
hasSpecifiedLayout.setAccessible(true);
|
||||
hasSpecifiedLayout.setBoolean(this, true);
|
||||
} catch (Exception ignored) {
|
||||
try {
|
||||
Field hasSpecifiedLayout = Preference.class.getDeclaredField("mHasSpecifiedLayout");
|
||||
hasSpecifiedLayout.setAccessible(true);
|
||||
hasSpecifiedLayout.setBoolean(this, true);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindView(View view) {
|
||||
super.onBindView(view);
|
||||
if (COMPAT_MODE) {
|
||||
mSwitch = (ATESwitch) view.findViewById(R.id.switchWidget);
|
||||
mSwitch.setChecked(isChecked());
|
||||
} else {
|
||||
View parentSwitch = findSwitchView(view);
|
||||
if (parentSwitch != null) {
|
||||
ATH.setTint(parentSwitch, ThemeStore.accentColor(view.getContext()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private View findSwitchView(View view) {
|
||||
if (view instanceof ViewGroup) {
|
||||
for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
|
||||
View child = ((ViewGroup) view).getChildAt(i);
|
||||
if (child instanceof Switch || child instanceof SwitchCompat) {
|
||||
return child;
|
||||
} else if (child instanceof ViewGroup) {
|
||||
View potentialSwitch = findSwitchView(child);
|
||||
if (potentialSwitch != null) return potentialSwitch;
|
||||
}
|
||||
}
|
||||
} else if (view instanceof Switch || view instanceof SwitchCompat) {
|
||||
return view;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChecked(boolean checked) {
|
||||
super.setChecked(checked);
|
||||
if (COMPAT_MODE) {
|
||||
if (mSwitch != null) {
|
||||
mSwitch.setChecked(checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import android.graphics.Paint;
|
|||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
|
|
|
@ -3,11 +3,12 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
|||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
import androidx.preference.CheckBoxPreference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceViewHolder;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.preference.DialogPreference;
|
||||
import androidx.preference.DialogPreference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.preference.EditTextPreference;
|
||||
import androidx.preference.EditTextPreference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.preference.ListPreference;
|
||||
import androidx.preference.ListPreference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
|
|
@ -3,7 +3,7 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
|||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.support.v7.preference.Preference;
|
||||
import androidx.preference.Preference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
|
|
@ -3,8 +3,8 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
|||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.support.v7.preference.PreferenceCategory;
|
||||
import android.support.v7.preference.PreferenceViewHolder;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
||||
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs.ATEEditTextPreferenceDialogFragmentCompat;
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs.ATEListPreferenceDialogFragmentCompat;
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs.ATEPreferenceDialogFragment;
|
||||
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public abstract class ATEPreferenceFragmentCompat extends PreferenceFragmentCompat {
|
||||
@Override
|
||||
public void onDisplayPreferenceDialog(Preference preference) {
|
||||
if (this.getCallbackFragment() instanceof PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback) {
|
||||
((PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback) this.getCallbackFragment()).onPreferenceDisplayDialog(this, preference);
|
||||
if (this.getCallbackFragment() instanceof OnPreferenceDisplayDialogCallback) {
|
||||
((OnPreferenceDisplayDialogCallback) this.getCallbackFragment()).onPreferenceDisplayDialog(this, preference);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.getActivity() instanceof PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback) {
|
||||
((PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback) this.getActivity()).onPreferenceDisplayDialog(this, preference);
|
||||
if (this.getActivity() instanceof OnPreferenceDisplayDialogCallback) {
|
||||
((OnPreferenceDisplayDialogCallback) this.getActivity()).onPreferenceDisplayDialog(this, preference);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.preference.SeekBarPreference;
|
||||
|
||||
public class ATESeekBarPreference extends SeekBarPreference {
|
||||
public ATESeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
public ATESeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public ATESeekBarPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public ATESeekBarPreference(Context context) {
|
||||
super(context);
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init(Context context) {
|
||||
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7;
|
|||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
import androidx.preference.CheckBoxPreference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEEditTextPreference;
|
||||
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class ATEEditTextPreferenceDialogFragmentCompat extends ATEPreferenceDialogFragment implements MaterialDialog.InputCallback {
|
||||
|
||||
private CharSequence input;
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.ListPreference;
|
||||
import androidx.preference.ListPreference;
|
||||
import android.view.View;
|
||||
|
||||
import com.afollestad.materialdialogs.DialogAction;
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEListPreference;
|
||||
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class ATEListPreferenceDialogFragmentCompat extends ATEPreferenceDialogFragment implements MaterialDialog.ListCallbackSingleChoice {
|
||||
private int mClickedDialogEntryIndex;
|
||||
|
||||
|
|
|
@ -3,17 +3,19 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs;
|
|||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v7.preference.DialogPreference;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.preference.DialogPreference;
|
||||
import android.view.Window;
|
||||
|
||||
import com.afollestad.materialdialogs.DialogAction;
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class ATEPreferenceDialogFragment extends DialogFragment implements MaterialDialog.SingleButtonCallback {
|
||||
private DialogAction mWhichButtonClicked;
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package code.name.monkey.appthemehelper.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.AppCompatCheckBox;
|
||||
import androidx.appcompat.widget.AppCompatCheckBox;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package code.name.monkey.appthemehelper.common.views;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import androidx.appcompat.widget.AppCompatEditText;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.EditText;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
public class ATEEditText extends EditText {
|
||||
public class ATEEditText extends AppCompatEditText {
|
||||
|
||||
public ATEEditText(Context context) {
|
||||
super(context);
|
||||
|
@ -29,12 +28,6 @@ public class ATEEditText extends EditText {
|
|||
init(context, attrs);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public ATEEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
private void init(Context context, AttributeSet attrs) {
|
||||
ATH.setTint(this, ThemeStore.accentColor(context));
|
||||
setTextColor(ThemeStore.textColorPrimary(context));
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package code.name.monkey.appthemehelper.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
public class ATEPrimaryTextView extends android.support.v7.widget.AppCompatTextView {
|
||||
public class ATEPrimaryTextView extends AppCompatTextView {
|
||||
|
||||
public ATEPrimaryTextView(Context context) {
|
||||
super(context);
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.widget.ProgressBar;
|
|||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package code.name.monkey.appthemehelper.common.views;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
public class ATESecondaryTextView extends android.support.v7.widget.AppCompatTextView {
|
||||
public class ATESecondaryTextView extends AppCompatTextView {
|
||||
|
||||
public ATESecondaryTextView(Context context) {
|
||||
super(context);
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
package code.name.monkey.appthemehelper.common.views;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.SeekBar;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
public class ATESeekBar extends android.support.v7.widget.AppCompatSeekBar {
|
||||
public class ATESeekBar extends SeekBar {
|
||||
|
||||
public ATESeekBar(Context context) {
|
||||
super(context);
|
||||
|
@ -26,6 +30,12 @@ public class ATESeekBar extends android.support.v7.widget.AppCompatSeekBar {
|
|||
init(context, attrs);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public ATESeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
private void init(Context context, AttributeSet attrs) {
|
||||
ATH.setTint(this, ThemeStore.accentColor(context));
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.widget.Switch;
|
|||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package code.name.monkey.appthemehelper.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATH;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
|
|
@ -2,10 +2,8 @@ package code.name.monkey.appthemehelper.util;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package code.name.monkey.appthemehelper.util;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.FloatRange;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.FloatRange;
|
||||
|
||||
|
||||
public final class ColorUtil {
|
||||
|
|
|
@ -3,7 +3,7 @@ package code.name.monkey.appthemehelper.util;
|
|||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.TransitionDrawable;
|
||||
import android.support.annotation.ColorInt;
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
|
||||
public final class DrawableUtil {
|
||||
|
|
|
@ -4,13 +4,13 @@ import android.annotation.TargetApi;
|
|||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v4.widget.EdgeEffectCompat;
|
||||
import android.support.v4.widget.NestedScrollView;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.core.widget.EdgeEffectCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.EdgeEffect;
|
||||
import android.widget.ScrollView;
|
||||
|
|
|
@ -2,8 +2,8 @@ package code.name.monkey.appthemehelper.util;
|
|||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import code.name.monkey.appthemehelper.R;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package code.name.monkey.appthemehelper.util;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomNavigationView;
|
||||
import android.support.design.widget.NavigationView;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
|
|
|
@ -5,11 +5,11 @@ import android.app.Activity;
|
|||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.IntRange;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.IntRange;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package code.name.monkey.appthemehelper.util;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
|
||||
public final class TabLayoutUtil {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package code.name.monkey.appthemehelper.util;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@ import android.graphics.PorterDuff;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.RippleDrawable;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.CheckResult;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.support.v7.widget.AppCompatEditText;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import androidx.annotation.CheckResult;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.appcompat.widget.AppCompatEditText;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
|
|
|
@ -6,24 +6,24 @@ import android.graphics.PorterDuff;
|
|||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.CheckResult;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.WindowDecorActionBar;
|
||||
import android.support.v7.view.menu.ActionMenuItemView;
|
||||
import android.support.v7.view.menu.BaseMenuPresenter;
|
||||
import android.support.v7.view.menu.ListMenuItemView;
|
||||
import android.support.v7.view.menu.MenuBuilder;
|
||||
import android.support.v7.view.menu.MenuPopupHelper;
|
||||
import android.support.v7.view.menu.MenuPresenter;
|
||||
import android.support.v7.view.menu.ShowableListMenu;
|
||||
import android.support.v7.widget.ActionMenuView;
|
||||
import android.support.v7.widget.AppCompatImageView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.support.v7.widget.ToolbarWidgetWrapper;
|
||||
import androidx.annotation.CheckResult;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.WindowDecorActionBar;
|
||||
import androidx.appcompat.view.menu.ActionMenuItemView;
|
||||
import androidx.appcompat.view.menu.BaseMenuPresenter;
|
||||
import androidx.appcompat.view.menu.ListMenuItemView;
|
||||
import androidx.appcompat.view.menu.MenuBuilder;
|
||||
import androidx.appcompat.view.menu.MenuPopupHelper;
|
||||
import androidx.appcompat.view.menu.MenuPresenter;
|
||||
import androidx.appcompat.view.menu.ShowableListMenu;
|
||||
import androidx.appcompat.widget.ActionMenuView;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.appcompat.widget.ToolbarWidgetWrapper;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -384,7 +384,7 @@ public final class ToolbarContentTintHelper {
|
|||
// Search view theming
|
||||
if (item.getActionView() != null && (
|
||||
item.getActionView() instanceof android.widget.SearchView || item
|
||||
.getActionView() instanceof android.support.v7.widget.SearchView)) {
|
||||
.getActionView() instanceof androidx.appcompat.widget.SearchView)) {
|
||||
SearchViewTintUtil.setSearchViewContentColor(item.getActionView(), color);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ package code.name.monkey.appthemehelper.util;
|
|||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.support.v4.util.SimpleArrayMap;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
|
||||
/*
|
||||
Each call to Typeface.createFromAsset will load a new instance of the typeface into memory,
|
||||
|
|
|
@ -4,9 +4,9 @@ import android.graphics.drawable.ColorDrawable;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.TransitionDrawable;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue