更换背景

Signed-off-by: Robert <3101783809@qq.com>
main
mzh 3 months ago
parent 76420e8ee1
commit a020f4c9df

@ -80,6 +80,7 @@ import java.util.HashSet;
public class NotesListActivity extends Activity implements OnClickListener, OnItemLongClickListener {
private static final int FOLDER_NOTE_LIST_QUERY_TOKEN = 0;
private int mode=-1;
private static final int FOLDER_LIST_QUERY_TOKEN = 1;
@ -139,6 +140,9 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.note_list);
getWindow().setBackgroundDrawableResource(R.drawable.cat);
getWindow().setBackgroundDrawableResource(R.drawable.cloud);
getWindow().setBackgroundDrawableResource(R.drawable.person);
initResources();
/**
@ -775,12 +779,34 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
} else {
Log.e(TAG, "Wrong state:" + mState);
}
if(mode==-1)
menu.findItem(R.id.cat).setVisible(false);
else if(mode==0)
menu.findItem(R.id.cloud).setVisible(false);
else if(mode==1)
menu.findItem(R.id.person).setVisible(false);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.cat:{
mode=-1;
getWindow().setBackgroundDrawableResource(R.drawable.cat);
break;
}
case R.id.cloud:{
mode=-1;
getWindow().setBackgroundDrawableResource(R.drawable.cloud);
break;
}
case R.id.person:{
mode=-1;
getWindow().setBackgroundDrawableResource(R.drawable.person);
break;
}
case R.id.menu_new_folder: {
showCreateOrModifyFolderDialog(true);
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

@ -18,8 +18,8 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_background">
android:layout_height="fill_parent">
<!-- android:background="@drawable/list_background">-->
<LinearLayout
android:layout_width="fill_parent"

@ -36,4 +36,17 @@
<item
android:id="@+id/menu_search"
android:title="@string/menu_search"/>
<item
android:id="@+id/cat"
android:title="@string/cat"/>
<item
android:id="@+id/cloud"
android:title="@string/cloud"/>
<item
android:id="@+id/person"
android:title="@string/person"/>
</menu>

@ -39,6 +39,9 @@
<string name="file_path">/MIUI/notes/</string>
<string name="file_name_txt_format">notes_%s.txt</string>
<!-- notes list string -->
<string name="cat">Background: cat</string>
<string name="cloud">Background: cloud</string>
<string name="person">Background: person</string>
<string name="format_folder_files_count">(%d)</string>
<string name="menu_create_folder">New Folder</string>
<string name="menu_export_text">Export text</string>

Loading…
Cancel
Save