Search in sources :

Example 1 with ActorIntent

use of im.actor.sdk.intents.ActorIntent in project actor-platform by actorapp.

the class ActorSDK method returnToRoot.

public static void returnToRoot(Context context) {
    Intent i;
    ActorIntent startIntent = ActorSDK.sharedActor().getDelegate().getStartIntent();
    if (startIntent != null && startIntent instanceof ActorIntentActivity) {
        i = ((ActorIntentActivity) startIntent).getIntent();
    } else {
        i = new Intent(context, RootActivity.class);
    }
    i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    context.startActivity(i);
}
Also used : RootActivity(im.actor.sdk.controllers.root.RootActivity) ActorIntentActivity(im.actor.sdk.intents.ActorIntentActivity) ActorIntent(im.actor.sdk.intents.ActorIntent) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) ActorIntent(im.actor.sdk.intents.ActorIntent)

Example 2 with ActorIntent

use of im.actor.sdk.intents.ActorIntent in project actor-platform by actorapp.

the class MyProfileActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    getSupportActionBar().setTitle(null);
    if (savedInstanceState == null) {
        BaseActorSettingsFragment fragment;
        if (ActorSDK.sharedActor().getDelegate().getSettingsIntent() != null) {
            ActorIntent settingsIntent = ActorSDK.sharedActor().getDelegate().getSettingsIntent();
            if (settingsIntent instanceof BaseActorSettingsActivity) {
                fragment = ((BaseActorSettingsActivity) settingsIntent).getSettingsFragment();
            } else {
                fragment = new ActorSettingsFragment();
            }
        } else {
            fragment = new ActorSettingsFragment();
        }
        showFragment(fragment, false);
    }
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) ActorIntent(im.actor.sdk.intents.ActorIntent)

Example 3 with ActorIntent

use of im.actor.sdk.intents.ActorIntent in project actor-platform by actorapp.

the class ChatSettingsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportActionBar().setTitle(R.string.settings_chat_title);
    ChatSettingsFragment fragment;
    ActorIntent chatSettingsIntent = ActorSDK.sharedActor().getDelegate().getChatSettingsIntent();
    if (chatSettingsIntent != null && chatSettingsIntent instanceof ActorIntentFragmentActivity) {
        fragment = (ChatSettingsFragment) ((ActorIntentFragmentActivity) chatSettingsIntent).getFragment();
    } else {
        fragment = new ChatSettingsFragment();
    }
    if (savedInstanceState == null) {
        showFragment(fragment, false);
    }
}
Also used : ActorIntentFragmentActivity(im.actor.sdk.intents.ActorIntentFragmentActivity) ActorIntent(im.actor.sdk.intents.ActorIntent)

Aggregations

ActorIntent (im.actor.sdk.intents.ActorIntent)3 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 RootActivity (im.actor.sdk.controllers.root.RootActivity)1 ActorIntentActivity (im.actor.sdk.intents.ActorIntentActivity)1 ActorIntentFragmentActivity (im.actor.sdk.intents.ActorIntentFragmentActivity)1