|
7 | 7 | import android.content.Context;
|
8 | 8 | import android.content.Intent;
|
9 | 9 | import android.content.IntentFilter;
|
10 |
| -import android.content.SharedPreferences; |
11 | 10 | import android.content.SharedPreferences.Editor;
|
12 | 11 | import android.database.Cursor;
|
13 | 12 | import android.database.sqlite.SQLiteDatabase;
|
@@ -282,24 +281,22 @@ public void onClick(View v)
|
282 | 281 |
|
283 | 282 | private void switchMode()
|
284 | 283 | {
|
285 |
| - SharedPreferences prefs = AppContext.getPrefrences(this); |
286 | 284 | Editor editor = AppContext.getPrefrences(this).edit();
|
287 | 285 | //切回日间模式
|
288 | 286 | if(isNight)
|
289 | 287 | {
|
290 | 288 | isNight = false;
|
291 | 289 | bgLayout.setBackgroundResource(R.drawable.home_bg_default);
|
292 | 290 | switchModeBtn.setImageResource(R.drawable.composer_sun);
|
293 |
| - Toast.makeText(Main.this, "已切回日间模式", Toast.LENGTH_SHORT).show(); |
| 291 | + Toast.makeText(Main.this, R.string.switch2Day, Toast.LENGTH_SHORT).show(); |
294 | 292 | }
|
295 | 293 | else
|
296 | 294 | {
|
297 | 295 | //切回夜间模式
|
298 | 296 | isNight = true;
|
299 |
| - bgLayout.setBackgroundResource( |
300 |
| - prefs.getInt("home_bg_id", R.drawable.home_bg_night)); |
| 297 | + bgLayout.setBackgroundResource(R.drawable.home_bg_night); |
301 | 298 | switchModeBtn.setImageResource(R.drawable.composer_moon);
|
302 |
| - Toast.makeText(Main.this, "夜间模式已启用", Toast.LENGTH_SHORT).show(); |
| 299 | + Toast.makeText(Main.this, R.string.switch2Day, Toast.LENGTH_SHORT).show(); |
303 | 300 | }
|
304 | 301 | editor.putBoolean("day_night_mode", isNight);
|
305 | 302 | editor.commit();
|
@@ -334,7 +331,7 @@ private void login()
|
334 | 331 | {
|
335 | 332 | if(UMInfoAgent.isLogin(this))
|
336 | 333 | {
|
337 |
| - Toast.makeText(this, "你已登陆!", Toast.LENGTH_SHORT).show(); |
| 334 | + Toast.makeText(this, R.string.loggedon, Toast.LENGTH_SHORT).show(); |
338 | 335 | return;
|
339 | 336 | }
|
340 | 337 | new LoginDialog().show(getSupportFragmentManager(), tag);
|
@@ -479,7 +476,7 @@ private void inSectionEdit()
|
479 | 476 | {
|
480 | 477 | gridAdapters.get(i).changeDelBtnState(isVisble);
|
481 | 478 | }
|
482 |
| - Toast.makeText(this, "按下返回键退出编辑模式", Toast.LENGTH_SHORT).show(); |
| 479 | + Toast.makeText(this, R.string.exitEdit, Toast.LENGTH_SHORT).show(); |
483 | 480 | }
|
484 | 481 |
|
485 | 482 | //退出编辑模式
|
@@ -621,7 +618,7 @@ protected void onPostExecute(ItemListEntity result)
|
621 | 618 | }
|
622 | 619 | else
|
623 | 620 | {
|
624 |
| - Toast.makeText(Main.this, "网络异常!", Toast.LENGTH_SHORT).show(); |
| 621 | + Toast.makeText(Main.this, R.string.networkexception, Toast.LENGTH_SHORT).show(); |
625 | 622 | }
|
626 | 623 | }
|
627 | 624 |
|
@@ -661,7 +658,7 @@ public boolean onKeyDown(int keyCode, KeyEvent event)
|
661 | 658 | finish();
|
662 | 659 | return true;
|
663 | 660 | }
|
664 |
| - Toast.makeText(this, "再按下退出程序", Toast.LENGTH_SHORT).show(); |
| 661 | + Toast.makeText(this, R.string.twice2Exit, Toast.LENGTH_SHORT).show(); |
665 | 662 | exit = true;
|
666 | 663 | Log.d(tag, "after toast");
|
667 | 664 | }
|
|
0 commit comments