Search in sources :

Example 6 with Animation

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");
}
Also used : Animation(com.zhan_dui.model.Animation) NotificationCompat(android.support.v4.app.NotificationCompat) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) PendingIntent(android.app.PendingIntent)

Example 7 with Animation

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;
}
Also used : OnLongClickListener(android.view.View.OnLongClickListener) Animation(com.zhan_dui.model.Animation) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 8 with Animation

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);
}
Also used : Animation(com.zhan_dui.model.Animation)

Example 9 with Animation

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);
}
Also used : Animation(com.zhan_dui.model.Animation) Intent(android.content.Intent) DownloadAdapter(com.zhan_dui.adapters.DownloadAdapter)

Example 10 with Animation

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;
}
Also used : AlertDialog(android.app.AlertDialog) Message(android.os.Message) DialogInterface(android.content.DialogInterface) Animation(com.zhan_dui.model.Animation) OnClickListener(android.content.DialogInterface.OnClickListener)

Aggregations

Animation (com.zhan_dui.model.Animation)12 Intent (android.content.Intent)4 Message (android.os.Message)2 NotificationCompat (android.support.v4.app.NotificationCompat)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 AlertDialog (android.app.AlertDialog)1 PendingIntent (android.app.PendingIntent)1 DialogInterface (android.content.DialogInterface)1 OnClickListener (android.content.DialogInterface.OnClickListener)1 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 View (android.view.View)1 OnLongClickListener (android.view.View.OnLongClickListener)1 JsonHttpResponseHandler (com.loopj.android.http.JsonHttpResponseHandler)1 DownloadAdapter (com.zhan_dui.adapters.DownloadAdapter)1 RecommendAdapter (com.zhan_dui.adapters.RecommendAdapter)1 AnimeTasteDB (com.zhan_dui.data.AnimeTasteDB)1 M3U8Mission (com.zhan_dui.download.alfred.missions.M3U8Mission)1 Mission (com.zhan_dui.download.alfred.missions.Mission)1