亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? mediaplaybackactivity.java

?? Android平臺(tái)上的media player, iPhone風(fēng)格
?? JAVA
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *      http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package com.android.imusic;import android.app.Activity;import android.app.AlertDialog;import android.content.BroadcastReceiver;import android.content.ComponentName;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.content.IntentFilter;import android.content.ServiceConnection;import android.content.pm.ActivityInfo;import android.content.pm.PackageManager;import android.content.pm.PackageManager.NameNotFoundException;import android.graphics.Bitmap;import android.media.AudioManager;import android.media.MediaFile;import android.net.Uri;import android.os.Bundle;import android.os.RemoteException;import android.os.Handler;import android.os.IBinder;import android.os.Looper;import android.os.Message;import android.os.SystemClock;import android.util.Log;import android.view.ContextMenu;import android.view.KeyEvent;import android.view.Menu;import android.view.MenuItem;import android.view.MotionEvent;import android.view.SubMenu;import android.view.View;import android.view.Window;import android.view.ContextMenu.ContextMenuInfo;import android.widget.ImageButton;import android.widget.ProgressBar;import android.widget.SeekBar;import android.widget.TextView;import android.widget.Toast;import android.widget.SeekBar.OnSeekBarChangeListener;public class MediaPlaybackActivity extends Activity implements MusicUtils.Defs, View.OnTouchListener{    private static final int USE_AS_RINGTONE = CHILD_MENU_BASE;        private boolean mOneShot = false;    private boolean mSeeking = false;    private boolean mTrackball;    private long mStartSeekPos = 0;    private long mLastSeekEventTime;    private IMediaPlaybackService mService = null;    private RepeatingImageButton mPrevButton;    private ImageButton mPauseButton;    private RepeatingImageButton mNextButton;    private ImageButton mRepeatButton;    private ImageButton mShuffleButton;    private ImageButton mQueueButton;    private Worker mAlbumArtWorker;    private AlbumArtHandler mAlbumArtHandler;    private Toast mToast;    private boolean mRelaunchAfterConfigChange;    public MediaPlaybackActivity()    {    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setVolumeControlStream(AudioManager.STREAM_MUSIC);        mAlbumArtWorker = new Worker("album art worker");        mAlbumArtHandler = new AlbumArtHandler(mAlbumArtWorker.getLooper());        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.audio_player);        mCurrentTime = (TextView) findViewById(R.id.currenttime);        mTotalTime = (TextView) findViewById(R.id.totaltime);        mProgress = (ProgressBar) findViewById(android.R.id.progress);        mAlbum = (AlbumView) findViewById(R.id.album);        mArtistName = (TextView) findViewById(R.id.artistname);        mAlbumName = (TextView) findViewById(R.id.albumname);        mTrackName = (TextView) findViewById(R.id.trackname);        View v = (View)mArtistName.getParent();         v.setOnTouchListener(this);        registerForContextMenu(v);        v = (View)mAlbumName.getParent();        v.setOnTouchListener(this);        registerForContextMenu(v);        v = (View)mTrackName.getParent();        v.setOnTouchListener(this);        registerForContextMenu(v);                mPrevButton = (RepeatingImageButton) findViewById(R.id.prev);        mPrevButton.setOnClickListener(mPrevListener);        mPrevButton.setRepeatListener(mRewListener, 260);        mPauseButton = (ImageButton) findViewById(R.id.pause);        mPauseButton.requestFocus();        mPauseButton.setOnClickListener(mPauseListener);        mNextButton = (RepeatingImageButton) findViewById(R.id.next);        mNextButton.setOnClickListener(mNextListener);        mNextButton.setRepeatListener(mFfwdListener, 260);        seekmethod = 1;        mTrackball = true; /* (See bug 1044348) (getResources().getConfiguration().navigation ==             Resources.Configuration.NAVIGATION_TRACKBALL);*/                mQueueButton = (ImageButton) findViewById(R.id.curplaylist);        mQueueButton.setOnClickListener(mQueueListener);        mShuffleButton = ((ImageButton) findViewById(R.id.shuffle));        mShuffleButton.setOnClickListener(mShuffleListener);        mRepeatButton = ((ImageButton) findViewById(R.id.repeat));        mRepeatButton.setOnClickListener(mRepeatListener);                if (mProgress instanceof SeekBar) {            SeekBar seeker = (SeekBar) mProgress;            seeker.setOnSeekBarChangeListener(mSeekListener);        }        mProgress.setMax(1000);                if (icicle != null) {            mRelaunchAfterConfigChange = icicle.getBoolean("configchange");            mOneShot = icicle.getBoolean("oneshot");        } else {            mOneShot = getIntent().getBooleanExtra("oneshot", false);        }    }        public boolean onTouch(View v, MotionEvent event) {        int action = event.getAction();        if (action == MotionEvent.ACTION_DOWN) {            v.setBackgroundColor(0xff606060);        } else if (action == MotionEvent.ACTION_UP ||                action == MotionEvent.ACTION_CANCEL) {            v.setBackgroundColor(0);        }        return false;     }    @Override    public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfoIn) {        /*         * A better way to do this would be to define a new "media search" intent (which         * would behave similar to a regular search intent), and have amazon, youtube, the         * browser and other suitable apps support it. Then we could just fire off the         * intent and let the user choose from the activity picker.         */        CharSequence title = null;        String query = null;        CharSequence artist = mArtistName.getText();        CharSequence album = mAlbumName.getText();        CharSequence song = mTrackName.getText();        if (view.equals(mArtistName.getParent()) && artist.length() > 0) {            title = artist;            query = artist.toString();        } else if (view.equals(mAlbumName.getParent()) &&                artist.length() > 0 && album.length() > 0) {            title = album ;            query = artist.toString() + " " + album.toString();        } else if (view.equals(mTrackName.getParent()) &&                artist.length() > 0 && song.length() > 0) {            title = song;            query = artist.toString() + " " + song.toString();        } else {            return;        }                title = getString(R.string.mediasearch, title);        TextView tv = new TextView(this);        tv.setText(title);        tv.setTextSize(18);        tv.setPadding(8, 8, 8, 8);        menu.setHeaderView(tv);        //menu.setHeaderTitle(title);                Intent i = new Intent();        i.setAction(Intent.ACTION_SEARCH);        i.setClassName("com.amazon.mp3", "com.amazon.mp3.android.client.SearchActivity");        i.putExtra("query", query);        PackageManager pm = getPackageManager();        ActivityInfo ai = i.resolveActivityInfo(pm, 0);        if ( ai != null) {            menu.add(R.string.mediasearch_amazon).setIntent(i);        }                i = new Intent();        i.setAction(Intent.ACTION_WEB_SEARCH);        i.putExtra("query", query);        menu.add(R.string.mediasearch_google).setIntent(i);        i = new Intent();        i.setAction(Intent.ACTION_SEARCH);        i.setClassName("com.google.android.youtube", "com.google.android.youtube.QueryActivity");        i.putExtra("query", query);        menu.add(R.string.mediasearch_youtube).setIntent(i);        return;    }    private OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {        public void onStartTrackingTouch(SeekBar bar) {            mLastSeekEventTime = 0;        }        public void onProgressChanged(SeekBar bar, int progress, boolean fromtouch) {            if (mService == null) return;            if (fromtouch) {                long now = SystemClock.elapsedRealtime();                if ((now - mLastSeekEventTime) > 250) {                    mLastSeekEventTime = now;                    mPosOverride = mDuration * progress / 1000;                    try {                        mService.seek(mPosOverride);                    } catch (RemoteException ex) {                    }                }            }        }        public void onStopTrackingTouch(SeekBar bar) {            mPosOverride = -1;        }    };        private View.OnClickListener mQueueListener = new View.OnClickListener() {        public void onClick(View v) {            startActivity(                    new Intent(Intent.ACTION_EDIT)                    .setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/Track")                    .putExtra("playlist", "nowplaying")            );        }    };        private View.OnClickListener mShuffleListener = new View.OnClickListener() {        public void onClick(View v) {            toggleShuffle();        }    };    private View.OnClickListener mRepeatListener = new View.OnClickListener() {        public void onClick(View v) {            cycleRepeat();        }    };    private View.OnClickListener mPauseListener = new View.OnClickListener() {        public void onClick(View v) {            doPauseResume();        }    };    private View.OnClickListener mPrevListener = new View.OnClickListener() {        public void onClick(View v) {            if (mService == null) return;            try {                if (mService.position() < 2000) {                    mService.prev();                } else {                    mService.seek(0);                    mService.play();                }            } catch (RemoteException ex) {            }        }    };    private View.OnClickListener mNextListener = new View.OnClickListener() {        public void onClick(View v) {            if (mService == null) return;            try {                mService.next();            } catch (RemoteException ex) {            }        }    };    private RepeatingImageButton.RepeatListener mRewListener =        new RepeatingImageButton.RepeatListener() {        public void onRepeat(View v, long howlong, int repcnt) {            scanBackward(repcnt, howlong);        }    };        private RepeatingImageButton.RepeatListener mFfwdListener =        new RepeatingImageButton.RepeatListener() {        public void onRepeat(View v, long howlong, int repcnt) {            scanForward(repcnt, howlong);        }    };       @Override    public void onStop() {        paused = true;        if (mService != null && mOneShot && getChangingConfigurations() == 0) {            try {                mService.stop();            } catch (RemoteException ex) {            }        }        mHandler.removeMessages(REFRESH);        unregisterReceiver(mStatusListener);        MusicUtils.unbindFromService(this);        super.onStop();    }    @Override    public void onSaveInstanceState(Bundle outState) {        outState.putBoolean("configchange", getChangingConfigurations() != 0);        outState.putBoolean("oneshot", mOneShot);        super.onSaveInstanceState(outState);    }        @Override    public void onStart() {        super.onStart();        paused = false;        if (false == MusicUtils.bindToService(this, osc)) {            // something went wrong            mHandler.sendEmptyMessage(QUIT);        }                IntentFilter f = new IntentFilter();        f.addAction(MediaPlaybackService.PLAYSTATE_CHANGED);        f.addAction(MediaPlaybackService.META_CHANGED);        f.addAction(MediaPlaybackService.PLAYBACK_COMPLETE);        registerReceiver(mStatusListener, new IntentFilter(f));        updateTrackInfo();        long next = refreshNow();        queueNextRefresh(next);    }        @Override    public void onNewIntent(Intent intent) {        setIntent(intent);        mOneShot = intent.getBooleanExtra("oneshot", false);    }        @Override    public void onResume() {        super.onResume();        updateTrackInfo();        setPauseButtonImage();    }        @Override    public void onDestroy()    {        mAlbumArtWorker.quit();        super.onDestroy();        //System.out.println("***************** playback activity onDestroy\n");    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        super.onCreateOptionsMenu(menu);        // Don't show the menu items if we got launched by path/filedescriptor, since        // those tend to not be in the media database.        if (MusicUtils.getCurrentAudioId() >= 0) {            if (!mOneShot) {                menu.add(0, GOTO_START, 0, R.string.goto_start).setIcon(R.drawable.ic_menu_music_library);                menu.add(0, PARTY_SHUFFLE, 0, R.string.party_shuffle); // icon will be set in onPrepareOptionsMenu()            }            SubMenu sub = menu.addSubMenu(0, ADD_TO_PLAYLIST, 0,                    R.string.add_to_playlist).setIcon(R.drawable.ic_menu_add);            MusicUtils.makePlaylistMenu(this, sub);            menu.add(0, USE_AS_RINGTONE, 0, R.string.ringtone_menu_short).setIcon(R.drawable.ic_menu_set_as_ringtone);            menu.add(0, DELETE_ITEM, 0, R.string.delete_item).setIcon(R.drawable.ic_menu_delete);        }        return true;    }    @Override    public boolean onPrepareOptionsMenu(Menu menu) {        MenuItem item = menu.findItem(PARTY_SHUFFLE);        if (item != null) {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产馆精品极品| 成人免费黄色在线| 国产精品伦一区| 这里只有精品免费| 91麻豆免费观看| 国产美女主播视频一区| 亚洲一区二区在线观看视频| 国产亚洲综合av| 欧美一区二区三区免费| 91久久免费观看| 国产成人综合在线播放| 强制捆绑调教一区二区| 亚洲美女一区二区三区| 国产丝袜美腿一区二区三区| 日韩一区二区免费视频| 欧美图片一区二区三区| 国产精品1区2区| 精品一区二区三区免费毛片爱| 一区二区三区在线不卡| 国产精品美女久久福利网站| www国产成人| 日韩欧美一区二区在线视频| 欧美妇女性影城| 欧美丝袜自拍制服另类| 色婷婷激情一区二区三区| 成人黄色免费短视频| 国产精品一区二区久久精品爱涩| 欧美aaaaaa午夜精品| 亚洲不卡av一区二区三区| 一级特黄大欧美久久久| 国产精品久久久久国产精品日日 | 成人午夜电影小说| 麻豆免费精品视频| 日韩中文字幕不卡| 日本不卡1234视频| 日本欧美韩国一区三区| 日韩在线一二三区| 日韩高清不卡在线| 日本免费新一区视频| 日韩电影免费一区| 日韩国产精品久久| 日本亚洲一区二区| 麻豆精品一区二区三区| 人人精品人人爱| 开心九九激情九九欧美日韩精美视频电影| 亚洲6080在线| 日产国产欧美视频一区精品 | 亚洲国产成人高清精品| 一区二区三区视频在线看| 亚洲精品国产一区二区精华液| 亚洲同性同志一二三专区| 综合激情成人伊人| 亚洲三级小视频| 亚洲午夜私人影院| 日韩电影一区二区三区四区| 精品一区二区在线播放| 国产精品一区二区不卡| 色综合激情五月| 欧美久久一二区| 精品少妇一区二区三区视频免付费| 日韩欧美电影一区| 国产欧美日韩三级| 亚洲精品国产a久久久久久| 亚洲一级电影视频| 麻豆传媒一区二区三区| 国产精品一区免费视频| 99久久综合99久久综合网站| 色呦呦国产精品| 在线成人免费观看| 欧美国产精品久久| 亚洲自拍偷拍欧美| 久久99九九99精品| 99精品视频在线观看| 欧美挠脚心视频网站| 日韩美女天天操| 国产精品美女久久久久久久| 亚洲成人精品一区| 国产在线观看一区二区| 色婷婷av一区| 欧美成人vr18sexvr| 国产精品不卡在线| 日本亚洲视频在线| av一区二区三区| 91精品国产欧美一区二区18 | 欧亚洲嫩模精品一区三区| 制服丝袜亚洲色图| 国产精品色噜噜| 日韩在线一二三区| a级精品国产片在线观看| 在线成人免费观看| 中文字幕一区日韩精品欧美| 日本美女视频一区二区| aa级大片欧美| 日韩欧美第一区| 亚洲综合免费观看高清完整版| 国产在线日韩欧美| 欧美日韩国产一级片| 国产精品三级视频| 蜜桃精品视频在线观看| 在线免费不卡电影| 国产农村妇女精品| 日韩在线卡一卡二| 日本精品一区二区三区高清 | 亚洲va天堂va国产va久| 成人激情小说网站| 欧美zozozo| 亚洲bdsm女犯bdsm网站| 91碰在线视频| 国产女主播一区| 久久精品二区亚洲w码| 欧美午夜精品一区二区三区| 国产精品第一页第二页第三页 | 在线精品视频一区二区三四 | 一区二区三区在线免费观看| 粉嫩av一区二区三区| 精品国产乱码久久久久久影片| 亚洲一区日韩精品中文字幕| 99re这里只有精品首页| 国产清纯美女被跳蛋高潮一区二区久久w | 激情文学综合丁香| 欧美人牲a欧美精品| 亚洲欧美日韩国产手机在线| 国产成人综合精品三级| 精品日韩一区二区| 免费在线观看视频一区| 欧美亚洲动漫精品| 一区二区三区精品| 99re8在线精品视频免费播放| 国产欧美一区二区精品性色| 国模套图日韩精品一区二区| 日韩三级av在线播放| 免费观看一级欧美片| 91精品国产91久久久久久最新毛片| 亚洲制服丝袜在线| 色婷婷av一区二区| 亚洲午夜久久久| 欧美午夜片在线看| 五月天激情综合| 欧美丰满一区二区免费视频| 午夜久久久久久电影| 欧美卡1卡2卡| 日本少妇一区二区| 日韩欧美中文一区二区| 国产一区在线观看麻豆| 久久久91精品国产一区二区精品 | 欧美日韩综合色| 婷婷六月综合亚洲| 91精品国产91久久久久久一区二区| 日韩精品亚洲一区| 日韩欧美亚洲另类制服综合在线| 免费高清在线一区| 欧美精品一区二区三区很污很色的| 精品综合久久久久久8888| 精品国免费一区二区三区| 国产成人免费视频| 国产精品不卡视频| 欧美性感一区二区三区| 天堂av在线一区| www亚洲一区| 99在线热播精品免费| 亚洲午夜激情网页| 日韩视频永久免费| 国产成人免费在线观看不卡| 日韩美女久久久| 欧美精品乱码久久久久久| 九九国产精品视频| 亚洲图片欧美激情| 7777精品伊人久久久大香线蕉超级流畅 | 国产视频一区不卡| 一本久道中文字幕精品亚洲嫩| 午夜不卡av免费| 精品少妇一区二区三区 | 欧美精品日韩一本| 国产一区二区三区美女| 自拍偷自拍亚洲精品播放| 91精品国产全国免费观看| 丰满亚洲少妇av| 亚洲国产aⅴ天堂久久| 精品国产乱码久久久久久影片| 一本大道av一区二区在线播放| 青青草精品视频| 亚洲另类中文字| 欧美一级爆毛片| 色综合色综合色综合色综合色综合 | 国产精品美女久久久久久| 欧美日韩不卡一区二区| 国产酒店精品激情| 亚洲国产日韩在线一区模特| 2020国产精品自拍| 欧美日韩一区二区三区四区| 高清不卡一二三区| 日本成人中文字幕| 中文字幕一区二区三区在线不卡| 日韩欧美高清dvd碟片| 色丁香久综合在线久综合在线观看| 久久电影网站中文字幕| 一区二区三区中文字幕电影 | 狠狠色丁香婷婷综合久久片| 亚洲精品视频自拍| 亚洲国产精品国自产拍av|