内存条为什么疯涨最近疯涨是咋回事,是不是有点非理性了

[android]如何使背景变化颜色闪烁效果
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.
我想使背景 flash 时在我的应用程序中播放音乐,但它不按预期方式工作。
当按下某个按钮时播放音乐。背景应该是黄色音乐关闭时但黄色和紫色之间快速闪存时播放音乐。
目前是黄色时关闭,有些沉闷的灰色时变为音乐正在播放,并且不返回到黄色音乐关闭时。
public class InstaRave extends Activity {
private static final String TAG = "InstaRave";
private static int isPlaying = 0; // 0 is not playing 1 is playing
private MediaP
public static int mPurple = color.mP
public static int mYellow = color.mY
public static int currentBackground = mY
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_insta_rave);
final Button play_button = (Button)this.findViewById(R.id.raveButton);
final RelativeLayout mRelativeLayout = (RelativeLayout) this.findViewById(R.id.topLevelLayout);
mp = MediaPlayer.create(this, R.raw.rave_mk);
Log.v(TAG, "Initializing sounds...");
play_button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
switch (isPlaying){
changeBackground(mRelativeLayout);
startMusic();
isPlaying = 1;
changeBackground(mRelativeLayout);
stopMusic();
isPlaying = 0;
Log.e(TAG, "Ooops something went wrong");
private void stopMusic(){
Log.v(TAG, "Stopping sound...");
mp.stop();
//isPlaying = 0;
mp.prepareAsync();
private void startMusic(){
Log.v(TAG, "Playing sound...");
mp.start();
//isPlaying = 1;
private void rave(){
Log.v(TAG, String.valueOf(isPlaying));
if (isPlaying == 1){
Log.v(TAG, "Raving....");
new Rave().execute();
Log.v(TAG, "End the rave the po po is here...");
protected void onPause(){
super.onPause();
mp.release();
private void changeBackground(RelativeLayout mRelativeLayout){
if (currentBackground == mYellow){
currentBackground = mP
mRelativeLayout.setBackgroundColor(currentBackground);
Log.v(TAG, "Background is: " + String.valueOf(currentBackground));
currentBackground = mY
mRelativeLayout.setBackgroundColor(currentBackground);
Log.v(TAG, "Background is: " + String.valueOf(currentBackground));
private class Rave extends AsyncTask&Void, Void, Void& {
final RelativeLayout mRelativeLayout = (RelativeLayout) findViewById(R.id.topLevelLayout);
protected Void doInBackground(Void... params) {
while (isPlaying ==1){
Thread.sleep(75);
publishProgress();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
protected void onProgressUpdate(Void... progress){
changeBackground(mRelativeLayout);
public boolean onCreateOptionsMenu(Menu menu) {
// I this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.insta_rave, menu);
解决方法 1:
更改您的 changeBackground() 方法为:
private void changeBackground(RelativeLayout mRelativeLayout){
if (currentBackground == mYellow){
currentBackground = mP
mRelativeLayout.setBackgroundColor(currentBackground);
Log.v(TAG, "Background is: " + String.valueOf(currentBackground));
currentBackground = mY
mRelativeLayout.setBackgroundColor(currentBackground);
Log.v(TAG, "Background is: " + String.valueOf(currentBackground));闪烁的背景-变化的颜色摄影视频免费下载,正版视频编号5366,搜索视频就来摄图网!
闪烁的背景-变化的颜色
04:50:38发布
授权范围最广的全用途授权
更多相似视频
登录后才可以评论,请进行登录
全部评论(0)
关注免费领VIP
咨询客服QQ:
09:00~12:00(周一~周五)
13:00~18:00(周一~周五)
欢迎对摄图网提出宝贵的建议或意见该段代码编译运行后显示的是蓝色背景,白色闪烁字的效果 - 博客频道 - CSDN.NET
yu132563的专栏
int main(int argc,char **argv)
&&&&&&& printf(&\033[44;37;5m hello world\033[0m\n&);
&&&&&&& return 0;
该段代码编译运行后显示的是蓝色背景,白色闪烁字的效果。
解释下的使用及定义:
“\033”引导非常规字符序列。“m”意味着设置属性然后结束非常规字符序列
“44;37;5”为蓝色,前景白色,闪烁光标的代码。具体如下:
编码&&& 颜色/动作
0&&&&&& 重新设置属性到缺省设置
1&&&&&& 设置粗体
2&&&&&& 设置一半亮度(模拟彩色显示器的颜色)
4&&&&&& 设置下划线(模拟彩色显示器的颜色)
5&&&&&& 设置闪烁
7&&&&&& 设置反向图象
22&&&&& 设置一般密度
24&&&&& 关闭下划线
25&&&&& 关闭闪烁
27&&&&& 关闭反向图象
30&&&&& 设置黑色前景
31&&&&& 设置红色前景
32&&&&& 设置绿色前景
33&&&&& 设置棕色前景
34&&&&& 设置蓝色前景
35&&&&& 设置紫色前景
36&&&&& 设置青色前景
37&&&&& 设置白色前景
38&&&&& 在缺省的前景颜色上设置下划线
39&&&&& 在缺省的前景颜色上关闭下划线
40&&&&& 设置黑色背景
41&&&&& 设置红色背景
42&&&&& 设置绿色背景
43&&&&& 设置棕色背景
44&&&&& 设置蓝色背景
45&&&&& 设置紫色背景
46&&&&& 设置青色背景
47&&&&& 设置白色背景
49&&&&& 设置缺省黑色背景
其他有趣的代码还有:
\033[2J&&&&&&&&  清除屏幕
\033[0q&&&&&&&&  关闭所有的键盘指示灯
\033[1q&&&&&&&&  设置“滚动锁定”指示灯 (Scroll Lock)
\033[2q&&&&&&&&  设置“数值锁定”指示灯 (Num Lock)
\033[3q&&&&&&&&  设置“大写锁定”指示灯 (Caps Lock)
\033[15:40H&&&& 把关闭移动到第15行,40列
\007&&&&&&&&&&&   发蜂鸣生beep
排名:第17314名
(2)(3)(1)背景快速闪烁,可自定义颜色和闪烁速度,阿里西西网页特效收集。
欢迎光临阿里西西网页脚本特效中心,点击运行按钮演示特效: 以下是程序代码&html&
&title&阿里西西网页特效演示,背景快速闪烁&/title&
&style type="text/css"&
font-family: "宋体"; font-size: 9 margin-top: 0 margin-left: 0 margin-right: 0px}
A { COLOR: FONT-SIZE: 9 FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: FONT-SIZE: 9 FONT-WEIGHT: 400; TEXT-DECORATION: underline }
{ font: 9pt "宋体"; cursor: color: #FF0033 }
&meta http-equiv="Content-Type" content="text/ charset=gb2312"&
&SCRIPT LANGUAGE="JavaScript"&
&!-- Hide from old browsers
var Color= new Array(9);
Color[1] = "ff";
Color[2] = "ee";
Color[3] = "dd";
Color[4] = "cc";
Color[5] = "bb";
Color[6] = "aa";
Color[7] = "99";
Color[8] = "88";
Color[9] = "77";
Color[10] = "66";
Color[11] = "55";
Color[12] = "44";
Color[13] = "33";
Color[14] = "22";
Color[15] = "11";
Color[16] = "00";
/* Do not display text on a fading background. Instead, let it
fade in and out once or twice, then load a new page.
function fadeIn(where) {
if (where &= 1) {
document.bgColor="#" + Color[where] +"0000";
where -= 1;
setTimeout("fadeIn("+where+")", 15);
setTimeout('fadeOut(1)', 15);
function fadeOut(where) {
if (where &=16) {
document.bgColor="#" + Color[where] +"0000";
where += 1;
setTimeout("fadeOut("+where+")", 15)
setTimeout("fadeIn(16)", 15);
// window.location.href="/";
// Unhide --&
&body onLoad="fadeIn(16)"&
&center&&font color=red face="隶书" size=6&背景快速闪烁&/font&&/center&
&table border=5 bordercolor=blue borderlight=green&
&tr&&td align=center&&font size=4 color=red face="Arial, Helvetica, sans-serif"&&strong&看到效果显示了吧!&/strong&&/font&&/td&&/tr&
&/table&&/center&
&SCRIPT LANGUAGE="JavaScript"&
function goHist(a)
history.go(a);
&/script&&/center&
&a href="/Dev/HTML/jsrun/"&欢迎访问阿里西西网页特效集&/a&
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
( 16:34:37)
( 16:34:27)
( 12:10:00)
( 09:58:29)
相关排行总榜javascript
文字的立体效果由文字阴影叠加实现。
背景及文字颜色由数值累加再转换为16进制数形成。
&!DOCTYPE html&
&meta charset=&UTF-8&&
&title&changeColor&/title&
&style type=&text/css&&
text-align:
margin-top:15%;
font-size: 120font-family: STC
text-shadow: 0px 1px 0px #999, 0px 2px 0px #888, 0px 3px 0px #777, 0px 4px 0px #666, 0px 5px 0px #555, 0px 6px 0px #444, 0px 7px 0px #333, 0px 8px 7px #001135;
&p id=&word&&Quiet your fear&/p&
&script type=&text/javascript&&
var fade = function () {
var level = 1;
var bg = document.
var ele = document.getElementById('word')
var flag =
var change = function () {
if (level &= 15 && level &= 0) {
console.log(level);
var color = level.toString(16);// &span style=&color:#009900;&&转换为16进制&/span&
// &span style=&color:#009900;&&#99FF&/span&
bg.style.backgroundColor = '#9999' + color +
ele.style.color = '#7733' + color +
if (flag) {level += 1;} else {level -= 1;}
if (level &= 15) {flag =}
if (level &= 0) {flag =}
setTimeout(change, 100);
&/html&运行效果:
【参考资料】
阴影立体效果:http://codepen.io/agustibr/pen/bljEB
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:113次
排名:千里之外

我要回帖

更多关于 内存条疯涨没人管 的文章

 

随机推荐