97 lines
3.1 KiB
Java
97 lines
3.1 KiB
Java
package com.twitter.sdk.android.tweetui;
|
|
|
|
import android.R;
|
|
import android.app.Activity;
|
|
import android.os.Bundle;
|
|
import com.twitter.sdk.android.core.internal.scribe.ScribeItem;
|
|
import com.twitter.sdk.android.tweetui.internal.SwipeToDismissTouchListener;
|
|
import java.io.Serializable;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class PlayerActivity extends Activity {
|
|
static final VideoScribeClient b = new VideoScribeClientImpl(TweetUi.s());
|
|
PlayerController a;
|
|
|
|
private void a(ScribeItem scribeItem) {
|
|
b.a(scribeItem);
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onBackPressed() {
|
|
super.onBackPressed();
|
|
overridePendingTransition(0, R$anim.tw__slide_out);
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
setContentView(R$layout.tw__player_activity);
|
|
PlayerItem playerItem = (PlayerItem) getIntent().getSerializableExtra("PLAYER_ITEM");
|
|
this.a = new PlayerController(findViewById(R.id.content), new SwipeToDismissTouchListener.Callback() { // from class: com.twitter.sdk.android.tweetui.PlayerActivity.1
|
|
@Override // com.twitter.sdk.android.tweetui.internal.SwipeToDismissTouchListener.Callback
|
|
public void a(float f) {
|
|
}
|
|
|
|
@Override // com.twitter.sdk.android.tweetui.internal.SwipeToDismissTouchListener.Callback
|
|
public void onDismiss() {
|
|
PlayerActivity.this.finish();
|
|
PlayerActivity.this.overridePendingTransition(0, R$anim.tw__slide_out);
|
|
}
|
|
});
|
|
this.a.a(playerItem);
|
|
a((ScribeItem) getIntent().getSerializableExtra("SCRIBE_ITEM"));
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onDestroy() {
|
|
this.a.a();
|
|
super.onDestroy();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
protected void onPause() {
|
|
this.a.b();
|
|
super.onPause();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
protected void onResume() {
|
|
super.onResume();
|
|
this.a.c();
|
|
}
|
|
|
|
public static class PlayerItem implements Serializable {
|
|
public final String callToActionText;
|
|
public final String callToActionUrl;
|
|
public final boolean looping;
|
|
public final boolean showVideoControls;
|
|
public final String url;
|
|
|
|
@Deprecated
|
|
public PlayerItem(String str, boolean z) {
|
|
this.url = str;
|
|
this.looping = z;
|
|
this.showVideoControls = false;
|
|
this.callToActionUrl = null;
|
|
this.callToActionText = null;
|
|
}
|
|
|
|
@Deprecated
|
|
public PlayerItem(String str, boolean z, String str2, String str3) {
|
|
this.url = str;
|
|
this.looping = z;
|
|
this.showVideoControls = false;
|
|
this.callToActionText = str2;
|
|
this.callToActionUrl = str3;
|
|
}
|
|
|
|
public PlayerItem(String str, boolean z, boolean z2, String str2, String str3) {
|
|
this.url = str;
|
|
this.looping = z;
|
|
this.showVideoControls = z2;
|
|
this.callToActionText = str2;
|
|
this.callToActionUrl = str3;
|
|
}
|
|
}
|
|
}
|