Remove some @TargetApi
This commit is contained in:
1 parent
3f4cc46bc1
commit
a835ca9547
19 files changed
+42
-123
No files matched your search
@@ -42,12 +42,6 @@ public class ClearDownloadPathCachePreference extends MessagePreference {
|
||||
init(context);
|
||||
}
|
||||
|
||||
public ClearDownloadPathCachePreference(Context context,
|
||||
AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context);
|
||||
}
|
||||
|
||||
public void init(Context context) {
|
||||
setDialogMessage(context.getString(R.string.settings_advanced_clear_download_path_cache_message));
|
||||
}
|
||||
|
||||
@@ -47,11 +47,6 @@ public class DefaultCategoryPreference extends DialogPreference {
|
||||
init();
|
||||
}
|
||||
|
||||
public DefaultCategoryPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setDialogLayoutResource(R.layout.preference_dialog_default_categories);
|
||||
}
|
||||
|
||||
@@ -69,11 +69,6 @@ public class ExcludedTagNamespacesPreference extends DialogPreference {
|
||||
init();
|
||||
}
|
||||
|
||||
public ExcludedTagNamespacesPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setDialogLayoutResource(R.layout.preference_dialog_excluded_tag_namespaces);
|
||||
}
|
||||
|
||||
@@ -66,11 +66,6 @@ public class HatHProxyPreference extends DialogPreference implements View.OnClic
|
||||
init();
|
||||
}
|
||||
|
||||
public HatHProxyPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setDialogLayoutResource(R.layout.preference_dialog_hath_proxy);
|
||||
updateSummary(Settings.getHathProxy(), Settings.getHathIp(), Settings.getHathPort());
|
||||
|
||||
@@ -42,11 +42,6 @@ public class SignOutPreference extends MessagePreference {
|
||||
init();
|
||||
}
|
||||
|
||||
public SignOutPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setDialogMessage(getContext().getString(R.string.settings_eh_sign_out_warning));
|
||||
}
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
|
||||
package com.hippo.ehviewer.ui;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
@@ -52,7 +50,6 @@ public class DirPickerActivity extends ToolbarActivity
|
||||
@Nullable
|
||||
private View mOk;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.hippo.ehviewer.ui.fragment;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.DialogInterface;
|
||||
@@ -141,18 +140,18 @@ public class DownloadFragment extends PreferenceFragment implements
|
||||
startActivityForResult(intent, REQUEST_CODE_PICK_IMAGE_DIR);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void openDirPickerL() {
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
||||
try {
|
||||
startActivityForResult(intent, REQUEST_CODE_PICK_IMAGE_DIR_L);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getActivity(), R.string.error_cant_find_activity, Toast.LENGTH_SHORT).show();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
||||
try {
|
||||
startActivityForResult(intent, REQUEST_CODE_PICK_IMAGE_DIR_L);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getActivity(), R.string.error_cant_find_activity, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_CODE_PICK_IMAGE_DIR: {
|
||||
@@ -169,7 +168,7 @@ public class DownloadFragment extends PreferenceFragment implements
|
||||
break;
|
||||
}
|
||||
case REQUEST_CODE_PICK_IMAGE_DIR_L: {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
if (resultCode == Activity.RESULT_OK && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Uri treeUri = data.getData();
|
||||
getActivity().getContentResolver().takePersistableUriPermission(
|
||||
treeUri, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.hippo.ehviewer.ui.scene;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -1132,7 +1131,6 @@ public class DownloadsScene extends ToolbarScene
|
||||
return new DownloadHolder(mInflater.inflate(R.layout.item_download, parent, false));
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void onBindViewHolder(DownloadHolder holder, int position) {
|
||||
if (mList == null) {
|
||||
@@ -1152,7 +1150,7 @@ public class DownloadsScene extends ToolbarScene
|
||||
bindForState(holder, info);
|
||||
|
||||
// Update transition name
|
||||
if (ApiHelper.SUPPORT_TRANSITION) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
long gid = info.gid;
|
||||
holder.thumb.setTransitionName(TransitionNameFactory.getThumbTransitionName(gid));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.hippo.ehviewer.ui.scene;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.Fragment;
|
||||
@@ -27,7 +26,6 @@ import android.view.View;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.scene.TransitionHelper;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
class EnterGalleryDetailTransaction implements TransitionHelper {
|
||||
|
||||
private final View mThumb;
|
||||
@@ -43,15 +41,17 @@ class EnterGalleryDetailTransaction implements TransitionHelper {
|
||||
return false;
|
||||
}
|
||||
|
||||
exit.setSharedElementReturnTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
exit.setExitTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
enter.setSharedElementEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
enter.setEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
transaction.addSharedElement(mThumb, mThumb.getTransitionName());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
exit.setSharedElementReturnTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
exit.setExitTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
enter.setSharedElementEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
enter.setEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
transaction.addSharedElement(mThumb, mThumb.getTransitionName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.hippo.ehviewer.ui.scene;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
@@ -38,7 +37,6 @@ import com.hippo.ehviewer.client.EhCacheKeyFactory;
|
||||
import com.hippo.ehviewer.client.EhUtils;
|
||||
import com.hippo.ehviewer.client.data.GalleryInfo;
|
||||
import com.hippo.ehviewer.widget.TileThumb;
|
||||
import com.hippo.util.ApiHelper;
|
||||
import com.hippo.widget.recyclerview.AutoStaggeredGridLayoutManager;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -161,7 +159,6 @@ abstract class GalleryAdapter extends RecyclerView.Adapter<GalleryHolder> {
|
||||
public abstract GalleryInfo getDataAt(int position);
|
||||
|
||||
@Override
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public void onBindViewHolder(GalleryHolder holder, int position) {
|
||||
GalleryInfo gi = getDataAt(position);
|
||||
if (null == gi) {
|
||||
@@ -193,7 +190,7 @@ abstract class GalleryAdapter extends RecyclerView.Adapter<GalleryHolder> {
|
||||
int color = EhUtils.getCategoryColor(gi.category);
|
||||
if (!(drawable instanceof TriangleDrawable)) {
|
||||
drawable = new TriangleDrawable(color);
|
||||
category.setBackground(drawable);
|
||||
category.setBackgroundDrawable(drawable);
|
||||
} else {
|
||||
((TriangleDrawable) drawable).setColor(color);
|
||||
}
|
||||
@@ -203,7 +200,7 @@ abstract class GalleryAdapter extends RecyclerView.Adapter<GalleryHolder> {
|
||||
}
|
||||
|
||||
// Update transition name
|
||||
if (ApiHelper.SUPPORT_TRANSITION) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
long gid = gi.gid;
|
||||
holder.thumb.setTransitionName(TransitionNameFactory.getThumbTransitionName(gid));
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.hippo.ehviewer.ui.scene;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.DownloadManager;
|
||||
@@ -89,8 +88,8 @@ import com.hippo.scene.SceneFragment;
|
||||
import com.hippo.scene.TransitionHelper;
|
||||
import com.hippo.text.Html;
|
||||
import com.hippo.text.URLImageGetter;
|
||||
import com.hippo.util.AppHelper;
|
||||
import com.hippo.util.ApiHelper;
|
||||
import com.hippo.util.AppHelper;
|
||||
import com.hippo.util.DrawableManager;
|
||||
import com.hippo.util.ExceptionUtils;
|
||||
import com.hippo.util.ReadableTime;
|
||||
@@ -957,12 +956,12 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
return resources.getString(R.string.rating_text, getRatingText(rating, resources), rating, ratingCount);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void setTransitionName() {
|
||||
long gid = getGid();
|
||||
|
||||
if (gid != -1 && ApiHelper.SUPPORT_TRANSITION && mThumb != null &&
|
||||
mTitle != null && mUploader != null && mCategory != null) {
|
||||
mTitle != null && mUploader != null && mCategory != null &&
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
mThumb.setTransitionName(TransitionNameFactory.getThumbTransitionName(gid));
|
||||
mTitle.setTransitionName(TransitionNameFactory.getTitleTransitionName(gid));
|
||||
mUploader.setTransitionName(TransitionNameFactory.getUploaderTransitionName(gid));
|
||||
@@ -1455,7 +1454,6 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
}
|
||||
|
||||
@Override
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public boolean onTransition(Context context,
|
||||
FragmentTransaction transaction, Fragment exit, Fragment enter) {
|
||||
if (!(enter instanceof GalleryListScene) && !(enter instanceof DownloadsScene) &&
|
||||
@@ -1463,15 +1461,17 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
return false;
|
||||
}
|
||||
|
||||
exit.setSharedElementReturnTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
exit.setExitTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
enter.setSharedElementEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
enter.setEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
transaction.addSharedElement(mThumb, mThumb.getTransitionName());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
exit.setSharedElementReturnTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
exit.setExitTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
enter.setSharedElementEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(R.transition.trans_move));
|
||||
enter.setEnterTransition(
|
||||
TransitionInflater.from(context).inflateTransition(android.R.transition.fade));
|
||||
transaction.addSharedElement(mThumb, mThumb.getTransitionName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.hippo.ehviewer.ui.scene;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.Resources;
|
||||
@@ -342,7 +341,6 @@ public class HistoryScene extends ToolbarScene
|
||||
}
|
||||
|
||||
@Override
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public void onBindViewHolder(HistoryHolder holder, int position) {
|
||||
if (null == mLazyList) {
|
||||
return;
|
||||
@@ -363,7 +361,7 @@ public class HistoryScene extends ToolbarScene
|
||||
holder.simpleLanguage.setText(gi.simpleLanguage);
|
||||
|
||||
// Update transition name
|
||||
if (ApiHelper.SUPPORT_TRANSITION) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
long gid = gi.gid;
|
||||
holder.thumb.setTransitionName(TransitionNameFactory.getThumbTransitionName(gid));
|
||||
}
|
||||
|
||||
@@ -49,7 +49,9 @@ public class EhNavigationView extends NavigationView implements DrawerLayoutChil
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setWillNotDraw(false);
|
||||
if (DRAW_SCRIM) {
|
||||
setWillNotDraw(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,12 +16,11 @@
|
||||
|
||||
package com.hippo.ehviewer.widget;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.os.Build;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -60,15 +59,8 @@ public class GalleryGuideView extends ViewGroup implements View.OnClickListener
|
||||
init(context);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public GalleryGuideView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void init(Context context) {
|
||||
mBgColor = context.getResources().getColor(R.color.guide_bg);
|
||||
mBgColor = ContextCompat.getColor(context, R.color.guide_bg);
|
||||
mPaint = new Paint();
|
||||
mPaint.setColor(Color.WHITE);
|
||||
mPaint.setStyle(Paint.Style.STROKE);
|
||||
|
||||
@@ -16,11 +16,9 @@
|
||||
|
||||
package com.hippo.preference;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.preference.Preference;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
@@ -48,12 +46,6 @@ public class ActivityPreference extends Preference {
|
||||
init(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public ActivityPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ActivityPreference, defStyleAttr, defStyleRes);
|
||||
String clazzName = a.getString(R.styleable.ActivityPreference_activity);
|
||||
|
||||
@@ -16,14 +16,12 @@
|
||||
|
||||
package com.hippo.preference;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -79,12 +77,6 @@ public abstract class DialogPreference extends Preference implements
|
||||
init(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public DialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DialogPreference, defStyleAttr, defStyleRes);
|
||||
mDialogTitle = a.getString(R.styleable.DialogPreference_dialogTitle);
|
||||
|
||||
@@ -52,11 +52,6 @@ public class ListPreference extends DialogPreference {
|
||||
init(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
public ListPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
setNegativeButtonText(android.R.string.cancel);
|
||||
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
|
||||
package com.hippo.preference;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.AttributeSet;
|
||||
@@ -34,7 +32,6 @@ public class MessagePreference extends DialogPreference {
|
||||
private CharSequence mDialogMessage;
|
||||
private boolean mDialogMessageLinkify;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public MessagePreference(Context context) {
|
||||
super(context);
|
||||
init(context, null, 0, 0);
|
||||
@@ -50,12 +47,6 @@ public class MessagePreference extends DialogPreference {
|
||||
init(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public MessagePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
public void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MessagePreference, defStyleAttr, defStyleRes);
|
||||
String message = a.getString(R.styleable.MessagePreference_dialogMessage);
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
|
||||
package com.hippo.preference;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Build;
|
||||
import android.preference.TwoStatePreference;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
@@ -82,12 +80,6 @@ public class SwitchPreference extends TwoStatePreference {
|
||||
init(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
public void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
setWidgetLayoutResource(R.layout.preference_widget_fixed_switch);
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SwitchPreference, defStyleAttr, defStyleRes);
|
||||
|
||||
Reference in new issue
Block a user