Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dfd5e6d authored by Amit Kohli's avatar Amit Kohli Committed by Josh Guilfoyle
Browse files

themed toast animation

parent 20f00357
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.INotificationManager;
import android.app.ITransientNotification;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PixelFormat;
import android.os.RemoteException;
import android.os.Handler;
@@ -308,6 +309,13 @@ public class Toast {
                    | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
            mParams.format = PixelFormat.TRANSLUCENT;
            mParams.windowAnimations = com.android.internal.R.style.Animation_Toast;
            //TODO: this should work once themes are applied at the phonewindow level.
            Log.d("~~~TOAST~~~", "windowAnimations:" + mParams.windowAnimations);
            TypedArray a = context.obtainStyledAttributes(null, com.android.internal.R.styleable.ToastStyle);
            mParams.windowAnimations = a.getResourceId(com.android.internal.R.styleable.ToastStyle_toastAnimation, com.android.internal.R.style.Animation_Toast);
            Log.d("~~~TOAST~~~", "a count:" + a.getIndexCount());
            Log.d("~~~TOAST~~~", "windowAnimations:" + mParams.windowAnimations);
            a.recycle();
            mParams.type = WindowManager.LayoutParams.TYPE_TOAST;
            mParams.setTitle("Toast");
        }
+2 −2
Original line number Diff line number Diff line
package com.tmobile.widget;

import com.android.internal.R;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
@@ -9,6 +7,8 @@ import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.internal.R;

public class ListItemLabelText extends LinearLayout {

	private TextView mItemLabel;
+10 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
<resources>
    <!-- These are the standard attributes that make up a complete theme. -->
    <declare-styleable name="Theme">
    
        <!-- ============== -->
        <!-- Generic styles -->
        <!-- ============== -->
@@ -1555,6 +1556,14 @@
        <attr name="gravity" />
    </declare-styleable>

    <!-- ============== -->
    <!-- Toast styles -->
    <!-- ============== -->
    <eat-comment /> 
    <declare-styleable name="ToastStyle">
         <attr name="toastAnimation" format="reference" />
    </declare-styleable>  
    
    <declare-styleable name="ImageSwitcher">
    </declare-styleable>
    <declare-styleable name="ImageView">
+4 −0
Original line number Diff line number Diff line
@@ -212,6 +212,10 @@
        <item name="editTextPreferenceStyle">@android:style/Preference.DialogPreference.EditTextPreference</item>
        <item name="ringtonePreferenceStyle">@android:style/Preference.RingtonePreference</item>
        <item name="preferenceLayoutChild">@android:layout/preference_child</item>
        
        <!-- Toast styles -->
        <item name="toastAnimation">@android:style/Animation.Toast</item>
        
    </style>
    
    <!-- Variant of the default (dark) theme with no title bar -->