Search in sources :

Example 6 with Activity

use of org.holoeverywhere.app.Activity in project mobile-android by photo.

the class GoogleLoginFragment method processLoginCredentials.

@Override
public void processLoginCredentials(com.trovebox.android.common.model.Credentials credentials) {
    Activity activity = getSupportActivity();
    CredentialsUtils.saveCredentials(activity, credentials);
    LoginUtils.onLoggedIn(activity, true);
}
Also used : Activity(org.holoeverywhere.app.Activity)

Example 7 with Activity

use of org.holoeverywhere.app.Activity in project mobile-android by photo.

the class PhotoDetailsFragment method adjustDetailsVisibility.

void adjustDetailsVisibility(final boolean visible) {
    detailsVisible = visible;
    if (getActivity() == null) {
        return;
    }
    Animation animation = AnimationUtils.loadAnimation(getActivity(), visible ? android.R.anim.fade_in : android.R.anim.fade_out);
    long animationDuration = 500;
    animation.setDuration(animationDuration);
    thumbnailsList.startAnimation(animation);
    detailsView.startAnimation(animation);
    thumbnailsList.postDelayed(new Runnable() {

        @Override
        public void run() {
            detailsVisible = visible;
            thumbnailsList.setVisibility(detailsVisible ? View.VISIBLE : View.GONE);
            detailsView.setVisibility(detailsVisible ? View.VISIBLE : View.GONE);
            if (detailsVisible && nextPageLoaded.getAndSet(false)) {
                ensureThumbVisible(getActivePhoto());
            }
        }
    }, animationDuration);
    ActionBar actionBar = ((Activity) getSupportActivity()).getSupportActionBar();
    if (visible) {
        actionBar.show();
    } else {
        actionBar.hide();
    }
}
Also used : Animation(android.view.animation.Animation) Activity(org.holoeverywhere.app.Activity) ActionBar(com.actionbarsherlock.app.ActionBar)

Example 8 with Activity

use of org.holoeverywhere.app.Activity in project little-bear-dictionary by daimajia.

the class PreferenceScreen method getThemeResId.

protected int getThemeResId(Context context) {
    try {
        if (context instanceof Activity) {
            int t = ((Activity) context).getLastThemeResourceId();
            if (t > 0) {
                return t;
            }
        }
        Class<?> clazz = context.getClass();
        while (clazz != Context.class) {
            clazz = clazz.getSuperclass();
        }
        Method method = clazz.getDeclaredMethod("getThemeResId");
        method.setAccessible(true);
        return (Integer) method.invoke(context);
    } catch (Exception e) {
        Log.e(TAG, "Failed getting context theme", e);
        return R.style.Holo_Theme_NoActionBar;
    }
}
Also used : Activity(org.holoeverywhere.app.Activity) Method(java.lang.reflect.Method) SuppressLint(android.annotation.SuppressLint)

Aggregations

Activity (org.holoeverywhere.app.Activity)8 SuppressLint (android.annotation.SuppressLint)3 ActionBar (com.actionbarsherlock.app.ActionBar)2 Method (java.lang.reflect.Method)2 ActivityNotFoundException (android.content.ActivityNotFoundException)1 TypedArray (android.content.res.TypedArray)1 ActionBarActivity (android.support.v7.app.ActionBarActivity)1 MockApplication (android.test.mock.MockApplication)1 View (android.view.View)1 Animation (android.view.animation.Animation)1 Button (android.widget.Button)1 SuperStartActivity (org.holoeverywhere.ThemeManager.SuperStartActivity)1 IAddonActivity (org.holoeverywhere.addon.IAddonActivity)1 Application (org.holoeverywhere.app.Application)1 TextView (org.holoeverywhere.widget.TextView)1