use of com.zhan_dui.model.Animation in project AnimeTaste by daimajia.
the class MissionListenerForNotification method onSuccess.
//todo:修复
@Override
public void onSuccess(M3U8Mission mission) {
Intent intent = new Intent(context, PlayActivity.class);
Animation animation = (Animation) mission.getExtraInformation(mission.getUri());
intent.putExtra("Animation", animation);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, Intent.FLAG_ACTIVITY_NEW_TASK);
notifyBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_action_emo_wink).setContentTitle(mission.getShowName()).setContentText(context.getString(R.string.download_success)).setProgress(100, mission.getPercentage(), false).setContentIntent(pendingIntent).setOngoing(false);
notificationManager.notify(mission.getMissionID(), notifyBuilder.build());
MobclickAgent.onEvent(context, "download_success");
}
use of com.zhan_dui.model.Animation in project AnimeTaste by daimajia.
the class AnimationListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView titleTextView;
TextView contentTextView;
ImageView thumbImageView;
ViewHolder holder;
if (convertView == null) {
convertView = mLayoutInflater.inflate(R.layout.video_item, parent, false);
titleTextView = (TextView) convertView.findViewById(R.id.title);
contentTextView = (TextView) convertView.findViewById(R.id.content);
thumbImageView = (ImageView) convertView.findViewById(R.id.thumb);
titleTextView.setTypeface(mRobotoTitle);
holder = new ViewHolder(titleTextView, contentTextView, thumbImageView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
titleTextView = holder.titleText;
contentTextView = holder.contentText;
thumbImageView = holder.thumbImageView;
}
Animation animation = (Animation) getItem(position);
Picasso.with(mContext).load(animation.HomePic).placeholder(R.drawable.placeholder_thumb).error(R.drawable.placeholder_fail).into(thumbImageView);
titleTextView.setText(animation.Name);
contentTextView.setText(animation.Brief);
convertView.setOnClickListener(new AnimationItemOnClickListener(animation));
convertView.setOnLongClickListener(new OnLongClickListener() {
// 保证长按事件传递
@Override
public boolean onLongClick(View v) {
return false;
}
});
titleTextView.setTextColor(animation.isWatched() ? mWatchedTitleColor : mUnWatchedTitleColor);
return convertView;
}
use of com.zhan_dui.model.Animation in project AnimeTaste by daimajia.
the class BrowserPlayerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_browserplayer);
String url = "http://animetaste.net";
String title = "AnimeTaste";
if (getIntent().getParcelableExtra("animation") != null) {
Animation animation = getIntent().getParcelableExtra("animation");
url = animation.Youku;
title = animation.Name;
}
getSupportActionBar().setTitle(title);
webView = (WebView) findViewById(R.id.browser);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new BrowserClient());
webView.loadUrl(url);
}
use of com.zhan_dui.model.Animation in project AnimeTaste by daimajia.
the class DownloadActivity method onItemClick.
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
DownloadAdapter.ViewHolder holder = (DownloadAdapter.ViewHolder) view.getTag();
Animation animation = holder.animation;
Intent intent = new Intent(this, PlayActivity.class);
intent.putExtra("Animation", animation);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
}
use of com.zhan_dui.model.Animation in project AnimeTaste by daimajia.
the class FavoriteActivity method onItemLongClick.
@Override
public boolean onItemLongClick(AdapterView<?> parent, View item, int position, long id) {
final Animation animation = (Animation) mFavListAdapter.getItem(position);
AlertDialog.Builder builder = new AlertDialog.Builder(mContext).setTitle(R.string.delete_title).setMessage(R.string.delete_body).setNegativeButton(R.string.delete_cancel, null).setPositiveButton(R.string.delete_ok, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
animation.removeFromFavorite(new Animation.UpdateFinishCallback() {
@Override
public void onUpdateFinished(Animation.Method method, Message msg) {
new LoadAsyncTask().execute();
}
});
Toast.makeText(mContext, R.string.delete_success, Toast.LENGTH_SHORT).show();
}
});
builder.create().show();
return false;
}
Aggregations