From 6eaf45940e415ba66ed28b339d63bac9d8623718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 2 Feb 2014 14:13:09 +0100 Subject: Switch from ActionBarSherlock to ActionBarCompat --- .../internal/widget/IcsToast.java | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java (limited to 'libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java') diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java deleted file mode 100644 index 042648b24..000000000 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java +++ /dev/null @@ -1,60 +0,0 @@ - -package com.actionbarsherlock.internal.widget; - -import android.content.Context; -import android.util.Log; -import android.view.Gravity; -import android.os.Build.VERSION; -import android.os.Build.VERSION_CODES; -import android.widget.TextView; -import android.widget.Toast; - -import com.actionbarsherlock.R; - -public class IcsToast extends Toast { - public static final int LENGTH_LONG = Toast.LENGTH_LONG; - public static final int LENGTH_SHORT = Toast.LENGTH_SHORT; - private static final String TAG = "Toast"; - - public static Toast makeText(Context context, CharSequence s, int duration) { - if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) { - return Toast.makeText(context, s, duration); - } - IcsToast toast = new IcsToast(context); - toast.setDuration(duration); - TextView view = new TextView(context); - view.setText(s); - // Original AOSP using reference on @android:color/bright_foreground_dark - // bright_foreground_dark - reference on @android:color/background_light - // background_light - 0xffffffff - view.setTextColor(0xffffffff); - view.setGravity(Gravity.CENTER); - view.setBackgroundResource(R.drawable.abs__toast_frame); - toast.setView(view); - return toast; - } - - public static Toast makeText(Context context, int resId, int duration) { - return makeText(context, context.getResources().getString(resId), duration); - } - - public IcsToast(Context context) { - super(context); - } - - @Override - public void setText(CharSequence s) { - if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) { - super.setText(s); - return; - } - if (getView() == null) { - return; - } - try { - ((TextView) getView()).setText(s); - } catch (ClassCastException e) { - Log.e(TAG, "This Toast was not created with IcsToast.makeText", e); - } - } -} -- cgit v1.2.3