`
isiqi
  • 浏览: 16049789 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

Android 字体+Hashmap声音 运用

 
阅读更多

public void aa1(View v) {
mSoundPool.play(soundHashMap.get(1), 1, 1, 0, 0, 1);

}

public void aa2(View view) {
mSoundPool.play(soundHashMap.get(2), 1, 1, 0, 0, 1);

}

public void aa3(View view) {
mSoundPool.play(soundHashMap.get(3), 1, 1, 0, 0, 1);

}

public void aa4(View view) {
mSoundPool.play(soundHashMap.get(4), 1, 1, 0, 0, 1);

}

public void aa5(View view) {
mSoundPool.play(soundHashMap.get(5), 1, 1, 0, 0, 1);

}

public void aa6(View view) {
mSoundPool.play(soundHashMap.get(6), 1, 1, 0, 0, 1);

}

public void aa7(View view) {
mSoundPool.play(soundHashMap.get(7), 1, 1, 0, 0, 1);

}

public void aa8(View view) {
mSoundPool.play(soundHashMap.get(8), 1, 1, 0, 0, 1);

}

public void aa9(View view) {
mSoundPool.play(soundHashMap.get(9), 1, 1, 0, 0, 1);

}

public void aa10(View view) {
mSoundPool.play(soundHashMap.get(10), 1, 1, 0, 0, 1);

}

public void aa11(View view) {
mSoundPool.play(soundHashMap.get(11), 1, 1, 0, 0, 1);

}

public void aa12(View view) {
mSoundPool.play(soundHashMap.get(12), 1, 1, 0, 0, 1);

}

public void aa13(View view) {
mSoundPool.play(soundHashMap.get(13), 1, 1, 0, 0, 1);

}

public void aa14(View view) {
mSoundPool.play(soundHashMap.get(14), 1, 1, 0, 0, 1);

}

public void aa15(View view) {
mSoundPool.play(soundHashMap.get(15), 1, 1, 0, 0, 1);

}

public void aa16(View view) {
mSoundPool.play(soundHashMap.get(16), 1, 1, 0, 0, 1);

}

public void aa17(View view) {
mSoundPool.play(soundHashMap.get(17), 1, 1, 0, 0, 1);

}

public void aa18(View view) {
mSoundPool.play(soundHashMap.get(18), 1, 1, 0, 0, 1);

}

public void aa19(View view) {
mSoundPool.play(soundHashMap.get(19), 1, 1, 0, 0, 1);

}

public void aa20(View view) {
mSoundPool.play(soundHashMap.get(20), 1, 1, 0, 0, 1);

}

public void aa21(View view) {
mSoundPool.play(soundHashMap.get(21), 1, 1, 0, 0, 1);

}

public void aa22(View view) {
mSoundPool.play(soundHashMap.get(22), 1, 1, 0, 0, 1);

}

public void aa23(View view) {
mSoundPool.play(soundHashMap.get(23), 1, 1, 0, 0, 1);

}

public void aa24(View view) {
mSoundPool.play(soundHashMap.get(24), 1, 1, 0, 0, 1);

}

public void b9(View view) {
mSoundPool.play(soundHashMap.get(41), 1, 1, 0, 0, 1);

}

public void b8(View view) {
mSoundPool.play(soundHashMap.get(42), 1, 1, 0, 0, 1);

}

public void b7(View view) {
mSoundPool.play(soundHashMap.get(43), 1, 1, 0, 0, 1);

}

public void b6(View view) {
mSoundPool.play(soundHashMap.get(44), 1, 1, 0, 0, 1);

}

public void b5(View view) {
mSoundPool.play(soundHashMap.get(45), 1, 1, 0, 0, 1);

}

public void b4(View view) {
mSoundPool.play(soundHashMap.get(46), 1, 1, 0, 0, 1);

}

public void b3(View view) {
mSoundPool.play(soundHashMap.get(47), 1, 1, 0, 0, 1);

}

public void b2(View view) {
mSoundPool.play(soundHashMap.get(48), 1, 1, 0, 0, 1);

}

public void b10(View view) {
mSoundPool.play(soundHashMap.get(49), 1, 1, 0, 0, 1);

}

--------------------------
String s1 = "2012-6-10 12:00:00";
SimpleDateFormat sDateFormat = new SimpleDateFormat(
"yyyy-MM-dd hh:mm:ss");
String date = sDateFormat.format(new java.util.Date());

DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar c1 = Calendar.getInstance();
Calendar str = Calendar.getInstance();
try {
c1.setTime(df.parse(s1));
str.setTime(df.parse(date));

} catch (Exception e) {
// TODO: handle exception
}

int result = c1.compareTo(str);
// if (result == 0)
// System.out.println("当前时间等于系统时间");
if (result < 0) {
System.out.println("当前时间小于系统时间");

mImageViewr2.setVisibility(View.VISIBLE);
mTextView111.setVisibility(View.VISIBLE);

} else {
System.out.println("当前时间大于系统时间");

mImageViewr2.setVisibility(View.INVISIBLE);
mTextView111.setVisibility(View.INVISIBLE);

}

---------------------
soundHashMap.put(1, mSoundPool.load(this, R.raw.a1, 1));
soundHashMap.put(2, mSoundPool.load(this, R.raw.a2, 1));
soundHashMap.put(3, mSoundPool.load(this, R.raw.a3, 1));
soundHashMap.put(4, mSoundPool.load(this, R.raw.a4, 1));

soundHashMap.put(6, mSoundPool.load(this, R.raw.a6, 1));
soundHashMap.put(7, mSoundPool.load(this, R.raw.a7, 1));
soundHashMap.put(8, mSoundPool.load(this, R.raw.a8, 1));
soundHashMap.put(9, mSoundPool.load(this, R.raw.a9, 1));
soundHashMap.put(10, mSoundPool.load(this, R.raw.a10, 1));
soundHashMap.put(11, mSoundPool.load(this, R.raw.a11, 1));
soundHashMap.put(12, mSoundPool.load(this, R.raw.a12, 1));
soundHashMap.put(13, mSoundPool.load(this, R.raw.a13, 1));
soundHashMap.put(14, mSoundPool.load(this, R.raw.a14, 1));
soundHashMap.put(15, mSoundPool.load(this, R.raw.a15, 1));
soundHashMap.put(16, mSoundPool.load(this, R.raw.a16, 1));
soundHashMap.put(17, mSoundPool.load(this, R.raw.a17, 1));
soundHashMap.put(18, mSoundPool.load(this, R.raw.a18, 1));

soundHashMap.put(20, mSoundPool.load(this, R.raw.a20, 1));

soundHashMap.put(22, mSoundPool.load(this, R.raw.a22, 1));
soundHashMap.put(23, mSoundPool.load(this, R.raw.a23, 1));

soundHashMap.put(41, mSoundPool.load(this, R.raw.a41, 1));
soundHashMap.put(42, mSoundPool.load(this, R.raw.a42, 1));
soundHashMap.put(43, mSoundPool.load(this, R.raw.a43, 1));
soundHashMap.put(44, mSoundPool.load(this, R.raw.a44, 1));
soundHashMap.put(45, mSoundPool.load(this, R.raw.a45, 1));
soundHashMap.put(46, mSoundPool.load(this, R.raw.a46, 1));
soundHashMap.put(47, mSoundPool.load(this, R.raw.a47, 1));
soundHashMap.put(48, mSoundPool.load(this, R.raw.a48, 1));
soundHashMap.put(49, mSoundPool.load(this, R.raw.a49, 1));


--------------
mediaPlayer = MediaPlayer.create(YoulingActivity.this, R.raw.back);
mediaPlayer.start();

scrollview = (ScrollView) findViewById(R.id.scrollview);
final TextView mTextView111 = (TextView) findViewById(R.id.textView11);
final TextView mTextView0 = (TextView) findViewById(R.id.t1);
final TextView mTextView1 = (TextView) findViewById(R.id.t2);
final TextView mTextView2 = (TextView) findViewById(R.id.t3);
final TextView mTextView3 = (TextView) findViewById(R.id.t4);
final TextView mTextView4 = (TextView) findViewById(R.id.t5);
final TextView mTextView5 = (TextView) findViewById(R.id.t6);
final TextView mTextView6 = (TextView) findViewById(R.id.t7);
final TextView mTextView7 = (TextView) findViewById(R.id.t8);
final TextView mTextView8 = (TextView) findViewById(R.id.t9);
final TextView mTextView9 = (TextView) findViewById(R.id.t10);
final TextView mTextView10 = (TextView) findViewById(R.id.t11);
final TextView mTextView11 = (TextView) findViewById(R.id.t12);
final TextView mTextView12 = (TextView) findViewById(R.id.t13);
final TextView mTextView13 = (TextView) findViewById(R.id.t14);
final TextView mTextView14 = (TextView) findViewById(R.id.t15);
final TextView mTextView15 = (TextView) findViewById(R.id.t16);
final TextView mTextView16 = (TextView) findViewById(R.id.t17);
final TextView mTextView17 = (TextView) findViewById(R.id.t18);
final TextView mTextView18 = (TextView) findViewById(R.id.t19);
final TextView mTextView19 = (TextView) findViewById(R.id.t20);
final TextView mTextView20 = (TextView) findViewById(R.id.t21);
final TextView mTextView21 = (TextView) findViewById(R.id.t22);
final TextView mTextView22 = (TextView) findViewById(R.id.t23);
final TextView mTextView23 = (TextView) findViewById(R.id.t24);
final TextView mTextView24 = (TextView) findViewById(R.id.t25);
final ImageView mImageViewr2 = (ImageView) findViewById(R.id.r2);
mImageViewr2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
MiidiCredit.showAppOffers();

}
});

Typeface typeFace = Typeface.createFromAsset(getAssets(),
"fonts/mini.ttf");
mTextView0.setTypeface(typeFace);
mTextView1.setTypeface(typeFace);
mTextView2.setTypeface(typeFace);
mTextView3.setTypeface(typeFace);
mTextView4.setTypeface(typeFace);
mTextView5.setTypeface(typeFace);
mTextView6.setTypeface(typeFace);
mTextView7.setTypeface(typeFace);
mTextView8.setTypeface(typeFace);
mTextView9.setTypeface(typeFace);
mTextView10.setTypeface(typeFace);
mTextView11.setTypeface(typeFace);
mTextView12.setTypeface(typeFace);
mTextView13.setTypeface(typeFace);
mTextView14.setTypeface(typeFace);
mTextView15.setTypeface(typeFace);
mTextView16.setTypeface(typeFace);
mTextView17.setTypeface(typeFace);
mTextView18.setTypeface(typeFace);
mTextView19.setTypeface(typeFace);
mTextView20.setTypeface(typeFace);
mTextView21.setTypeface(typeFace);
mTextView22.setTypeface(typeFace);
mTextView23.setTypeface(typeFace);
mTextView24.setTypeface(typeFace);
mSoundPool = new SoundPool(60, AudioManager.STREAM_SYSTEM, 5);

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics