導航:首頁 > 操作系統 > 安卓系統如何滾動播放

安卓系統如何滾動播放

發布時間:2022-06-09 09:56:29

安卓系統桌面循環滾動桌面設置的

1、手機設置」的「輔助功能」中有選擇是否「桌面循環」。
2、在原生的android源碼上添加這一功能。
思路:先把界面做出來,再將是否選擇的值存到系統的(adb shell進入)data/data/com.android.providers.settings/databases/settings.db資料庫中的system表中,
然後在Launch2的源碼中取得資料庫中是否選擇循環桌面來執行相關代碼。
先做UI:
在settings源碼中的accessibility_settings.xml文件中添加一個checkbox:
java代碼
android:key="launch_repeat"
android:title="@string/launch_repeat_title"
android:persistent="false"/>

在settings源碼的res中添加相關的代碼:
在values/string.xml中添加(英文顯示):
Launch Repeat
在values-zh-rCN/string.xml中添加(中文顯示):
"循環桌面"
在settings源碼的AccessibilitySettings.java中的OnCreate中添加:
java代碼
/*****************************************/

mLaunchRepeat=(CheckBoxPreference) findPreference(
LAUNCH_REPEAT);
int LaunchRepeat=Settings.System.getInt(this.getContentResolver(),
"launch_repeat",0);//取出是否被選擇
if(LaunchRepeat==1)//如果被選擇,那麼下次打開setting時就勾選
mLaunchRepeat.setChecked(true);
else
mLaunchRepeat.setChecked(false);//如果沒被選擇,那麼下次打開setting時就不勾選
/*****************************************/
當然還要定義幾個量:
private final String LAUNCH_REPEAT =
"launch_repeat";
private CheckBoxPreference mLaunchRepeat;

在onPreferenceTreeClick函數中添加:
java代碼
//add by xxnan

if(LAUNCH_REPEAT.equals(key))
{
Settings.System.putInt(getContentResolver(),
"launch_repeat",
((CheckBoxPreference) preference).isChecked()?
1:0);//將是否選擇存到系統的system表中
}
//add by xxnan

如果做好了之後當點擊選擇「桌面循環時」可以到(adb shell進入)data/data/com.android.providers.settings/databases下的settings.db資料庫(sqlite3 settings.db)的system
表中看到33|launch_repeat|1(select * from system;)。
到這里就完成了將數據存到系統system表中以及UI,接下來就是在Launch2源碼中去取這個值(是否循環)。
到Launcher2源碼中去找到Workspace.java文件,在裡面有相應的修改:
在onTouchEvent中,之前有修改循環,如下:
java代碼
case MotionEvent.ACTION_UP:

if (mTouchState == TOUCH_STATE_SCROLLING) {
final VelocityTracker velocityTracker = mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
final int velocityX = (int)
velocityTracker.getXVelocity(mActivePointerId);
final int screenWidth = getWidth();
final int whichScreen = (mScrollX + (screenWidth / 2)) / screenWidth;
final float scrolledPos = (float) mScrollX / screenWidth;
Log.i("velocityX","velocityX="+velocityX+"whichScreen="+whichScreen);
/***********************************************/
//modifided by xxnan
if (velocityX > SNAP_VELOCITY) {
// Fling hard enough to move left.
// Don't fling across more than one screen at a time.
Log.i("numscreen","numscreen="+mCurrentScreen);
/* final int bound = scrolledPos < whichScreen ?
( (mCurrentScreen+ getChildCount()) - 1 )% getChildCount():
mCurrentScreen;*/
final int bound =( (mCurrentScreen+ getChildCount()) - 1 )% getChildCount()
;
Log.i("numscreen","bound="+bound);
snapToScreen( bound, velocityX, true);
} else if (velocityX < -SNAP_VELOCITY ) {
// Fling hard enough to move right
// Don't fling across more than one screen at a time.
/*final int bound = scrolledPos > whichScreen ?
( mCurrentScreen + 1 )% getChildCount(): mCurrentScreen;*/
final int bound = ( mCurrentScreen + 1 )% getChildCount() ;
snapToScreen(bound, velocityX, true);
} else {
snapToScreen(whichScreen, 0, true);
}
/***********************************************/
//下面是原生代碼
/*if (velocityX > SNAP_VELOCITY && mCurrentScreen > 0) {
// Fling hard enough to move left.
// Don't fling across more than one screen at a time.
final int bound = scrolledPos < whichScreen ?
mCurrentScreen - 1 : mCurrentScreen;
snapToScreen(Math.min(whichScreen, bound), velocityX, true);
} else if (velocityX < -SNAP_VELOCITY && mCurrentScreen <
getChildCount() - 1) {
// Fling hard enough to move right
// Don't fling across more than one screen at a time.
final int bound = scrolledPos > whichScreen ?
mCurrentScreen + 1 : mCurrentScreen;
snapToScreen(Math.max(whichScreen, bound), velocityX, true);
} else {
snapToScreen(whichScreen, 0, true);
}*/
}
mTouchState = TOUCH_STATE_REST;
mActivePointerId = INVALID_POINTER;
releaseVelocityTracker();
break;

那麼就要在修改的地方加一個判斷,如果system中取得的值是1,就可以循環,如果是0,就不能。
代碼修改如下:
java代碼
case MotionEvent.ACTION_UP:

if (mTouchState == TOUCH_STATE_SCROLLING) {
final VelocityTracker velocityTracker = mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
final int velocityX = (int)
velocityTracker.getXVelocity(mActivePointerId);
final int screenWidth = getWidth();
final int whichScreen = (mScrollX + (screenWidth / 2)) / screenWidth;
final float scrolledPos = (float) mScrollX / screenWidth;
Log.i("velocityX","velocityX="+velocityX+"whichScreen="+whichScreen);
/***********************************************/
//modifided by xxnan 2013-1-9
launch_repeat=Settings.System.getInt(mContext.getContentResolver(),
"launch_repeat",0);//取出system表中「launch_repeat」的值
Log.i(" launch_repeat"," launch_repeat="+ launch_repeat);
if(launch_repeat==1)//如果是1,就循環,也就是之前已經改好的
{
if (velocityX > SNAP_VELOCITY) {
// Fling hard enough to move left.
// Don't fling across more than one screen at a time.
Log.i("numscreen","numscreen="+mCurrentScreen);
/* final int bound = scrolledPos < whichScreen ?
( (mCurrentScreen+ getChildCount()) - 1 )% getChildCount():
mCurrentScreen;*/
final int bound =( (mCurrentScreen+ getChildCount()) - 1 )% getChildCount()
;
Log.i("numscreen","bound="+bound);
snapToScreen( bound, velocityX, true);
} else if (velocityX < -SNAP_VELOCITY ) {
// Fling hard enough to move right
// Don't fling across more than one screen at a time.
/*final int bound = scrolledPos > whichScreen ?
( mCurrentScreen + 1 )% getChildCount(): mCurrentScreen;*/
final int bound = ( mCurrentScreen + 1 )% getChildCount() ;
snapToScreen(bound, velocityX, true);
} else {
snapToScreen(whichScreen, 0, true);
}
}
else//如果是0,那麼就是原生代碼,不循環
{
if (velocityX > SNAP_VELOCITY && mCurrentScreen > 0) {
// Fling hard enough to move left.
// Don't fling across more than one screen at a time.
final int bound = scrolledPos < whichScreen ?
mCurrentScreen - 1 : mCurrentScreen;
snapToScreen(Math.min(whichScreen, bound), velocityX, true);
} else if (velocityX < -SNAP_VELOCITY && mCurrentScreen <
getChildCount() - 1) {
// Fling hard enough to move right
// Don't fling across more than one screen at a time.
final int bound = scrolledPos > whichScreen ?
mCurrentScreen + 1 : mCurrentScreen;
snapToScreen(Math.max(whichScreen, bound), velocityX, true);
} else {
snapToScreen(whichScreen, 0, true);
}
}
/***********************************************/
//下面是原生代碼
/*if (velocityX > SNAP_VELOCITY && mCurrentScreen > 0) {
// Fling hard enough to move left.
// Don't fling across more than one screen at a time.
final int bound = scrolledPos < whichScreen ?
mCurrentScreen - 1 : mCurrentScreen;
snapToScreen(Math.min(whichScreen, bound), velocityX, true);
} else if (velocityX < -SNAP_VELOCITY && mCurrentScreen <
getChildCount() - 1) {
// Fling hard enough to move right
// Don't fling across more than one screen at a time.
final int bound = scrolledPos > whichScreen ?
mCurrentScreen + 1 : mCurrentScreen;
snapToScreen(Math.max(whichScreen, bound), velocityX, true);
} else {
snapToScreen(whichScreen, 0, true);
}*/
}
mTouchState = TOUCH_STATE_REST;
mActivePointerId = INVALID_POINTER;
releaseVelocityTracker();
break;

當然這裡面也要定義幾個量,以及導入幾個包:
導入包:
//add by xxnan
import android.content.ContentResolver;//從system表中取數據
import android.provider.Settings;
定義變數:
private int launch_repeat;//取得是否循環的值
到這里就全部修改好了,還有就是編譯一下源碼中的package/apps的Launch2和Settings的源碼,將生成的out/target/。。。/system/app下的
Launch2.apk和Settings.apk替換手機里system/app的這兩個apk就可以了。

② 安卓系統如何設置一直自動播放幻燈片

一:1、打開相冊。
2、選中一張圖片。
3、點擊右上角三個點的圖標。
4、點擊幻燈片播放即可。
二:幻燈片播放是一款圖片瀏覽軟體,PicaSlide Lite可以以幻燈片的形式來播放所存的照片,包括牆紙、緩存、幻燈片相冊。同時提供變焦和橫向模式的移動,播放前可以設置幻燈片的播放間隔時間段,能讓用戶很便利的瀏覽你手機上所存的照片。

③ 安卓版office能設置文字滾動播放嗎

我版本能設置文字那個滾動播放嗎?經常安卓版本是可以直接設計沒文字播放的那個滾動設置的,而且的話設置還是比較安全,比較放心的可以直接點擊進去。

④ 手機怎麼滾屏

滾屏截屏也叫「長截屏」,用於對范圍超過屏幕顯示區域的長圖進行截圖。
方法很多,各種型號手機有所不同,比如華為新型號那種用指關節敲擊屏幕畫S符號的方法就很炫酷。
其實只要會基本截圖就會滾屏截圖,方法如下:
同時按住【電源鍵】+【音量下鍵】,這就是傳統截圖方法,要點在後面。截圖完成後,所截取的畫面會停留2、3秒鍾,此刻注意觀察屏幕右下角,有個「滾動截屏」的提示,馬上點擊它,就可以自動滾屏,然後自動完成長截圖。
截圖長度你認為夠了,隨時可以終止滾屏,有提示的,注意看。

⑤ 怎麼能讓手機視頻無限循環播放

1、首先打開手機圖庫,進入裡面打開視頻,如下圖所示。

⑥ 安卓手機把屏幕當做類似於LED顯示屏那樣,可以滾動播放文字的軟體是哪個。

LED Scroller

⑦ 在電視機如何實現滾動循環播放視頻和圖片廣告需要什麼特殊設備和條件嗎

在電視上要播放優盤里的視頻或圖片,優盤不能超過32G,並選擇FAT32格式化,然後把你要播放的廣告視頻直接復制到格式化後的優盤,並給視頻按照你要求的播放順序重新命名排序,比如有六個視頻要循環播放就給這六個視頻重新命名1.2.3.4.5.6,然後在電視上下載一個暴風影音播放器,打開第一個視頻選擇播放順序為順序播放就可以循環播放了,

⑧ 安卓手機應用里有沒在網頁瀏覽時自動往下慢慢滾動的手機軟體

你說這個應該是在手機瀏覽器裡面,我用的哪個瀏覽器忘了,裡面設置好像有這一項,可以自動往下滾動的。你在瀏覽器設置裡面看一下

⑨ 安卓系統如何能實現IPONG4的橫屏滾動

按桌面 推薦 go桌面 ,按完 後 安 home鍵 然後選擇 go桌面 。還有 很多桌面都可以。

⑩ 2021款朗逸plus如何讓安卓手機音樂滾動歌詞在屏幕上出現

具:小米8 1、在qq音樂界面的右上角找到菜單欄選項,點擊打開。 2、在菜單欄界面的左下方找到「設置」選項,點擊進入。 3、在設置界面中找到「桌面歌詞」選項,並打開開關。 4、設置完成後,播放音樂時即可在手機屏幕上看見歌詞。

閱讀全文

與安卓系統如何滾動播放相關的資料

熱點內容
北京文件夾加密多少錢 瀏覽:669
什麼是車鑒定app 瀏覽:64
戰地一私人伺服器怎麼買 瀏覽:497
陳天程序員 瀏覽:831
編譯原理如何運用到編程中 瀏覽:17
linux選擇資料庫 瀏覽:376
php兩個數組差集 瀏覽:978
迷你pdf閱讀器下載 瀏覽:433
做一個python小程序 瀏覽:655
pythonossystem和 瀏覽:645
win2008如何搭建ftp伺服器 瀏覽:53
安卓手機為什麼不翻牌 瀏覽:546
刪除pkpm及相關文件夾 瀏覽:481
房貸解壓銀行內部流程 瀏覽:734
安卓手機如何更改語音 瀏覽:601
android紅包實現 瀏覽:734
蘋果的nvme為什麼安卓不用 瀏覽:32
python輸入單詞統計個數 瀏覽:998
腳本軟體提取源碼 瀏覽:281
程序員能給自己的微信錢包刷錢么 瀏覽:73