diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-02-02 14:13:09 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-02-02 14:13:09 +0100 |
commit | 6eaf45940e415ba66ed28b339d63bac9d8623718 (patch) | |
tree | d21a37f42ffca30502843cf19acd0c9469304d54 /libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java | |
parent | f916c8f5af5fd46037dd7d4be28155dac67b1634 (diff) | |
download | open-keychain-6eaf45940e415ba66ed28b339d63bac9d8623718.tar.gz open-keychain-6eaf45940e415ba66ed28b339d63bac9d8623718.tar.bz2 open-keychain-6eaf45940e415ba66ed28b339d63bac9d8623718.zip |
Switch from ActionBarSherlock to ActionBarCompat
Diffstat (limited to 'libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java')
-rw-r--r-- | libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java | 60 |
1 files changed, 0 insertions, 60 deletions
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); - } - } -} |