parent
e41f4d59af
commit
ec733beb9c
@ -0,0 +1,50 @@
|
|||||||
|
Menu_note_list.xml
|
||||||
|
<!-- 背景图功能 -->
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_a1"
|
||||||
|
android:title="@string/menu_a1"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_a2"
|
||||||
|
android:title="@string/menu_a2"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_a3"
|
||||||
|
android:title="@string/menu_a3"/>
|
||||||
|
|
||||||
|
NotelistActivity类
|
||||||
|
//背景图功能
|
||||||
|
public int mode=-1;
|
||||||
|
// 私密模式
|
||||||
|
public static int secret_mode = 0;
|
||||||
|
// 背景图功能
|
||||||
|
getWindow().setBackgroundDrawableResource(R.drawable.a3);
|
||||||
|
getWindow().setBackgroundDrawableResource(R.drawable.a2);
|
||||||
|
getWindow().setBackgroundDrawableResource(R.drawable.a1);
|
||||||
|
// 背景功能
|
||||||
|
if(mode==-1)
|
||||||
|
menu.findItem(R.id.menu_a1).setVisible(false);
|
||||||
|
else if (mode==0)
|
||||||
|
menu.findItem(R.id.menu_a2).setVisible(false);
|
||||||
|
else if (mode==1)
|
||||||
|
menu.findItem(R.id.menu_a3).setVisible(false);
|
||||||
|
|
||||||
|
// 背景功能
|
||||||
|
case R.id.menu_a1:{
|
||||||
|
mode=-1;
|
||||||
|
getWindow().setBackgroundDrawableResource(R.drawable.a1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case R.id.menu_a2:{
|
||||||
|
mode=0;
|
||||||
|
getWindow().setBackgroundDrawableResource(R.drawable.a2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case R.id.menu_a3:{
|
||||||
|
mode=1;
|
||||||
|
getWindow().setBackgroundDrawableResource(R.drawable.a3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Values_string.xml
|
||||||
|
<!-- 背景图功能 -->
|
||||||
|
<string name="menu_a2">Background: a2</string>
|
||||||
|
<string name="menu_a1">Background: a1</string>
|
||||||
|
<string name="menu_a3">Background: a3</string>
|
Loading…
Reference in new issue