实现功能

master
ptka4xvyr 1 year ago
parent c4fe47d048
commit 2f4191b90d

@ -22,18 +22,22 @@
<uses-sdk android:minSdkVersion="14" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><!--允许应用程序写入外部存储器例如SD卡。-->
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /><!--允许应用程序在桌面上创建快捷方式。-->
<uses-permission android:name="android.permission.INTERNET" /><!--允许应用程序访问网络-->
<uses-permission android:name="android.permission.READ_CONTACTS" /><!--允许应用程序读取用户的联系人信息。-->
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /><!--允许应用程序管理账户。-->
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /><!--允许应用程序使用账户验证的方式来进行身份验证。-->
<uses-permission android:name="android.permission.GET_ACCOUNTS" /><!--允许应用程序访问设备上的账户列表。-->
<uses-permission android:name="android.permission.USE_CREDENTIALS" /><!--允许应用程序使用用户的账户凭据。-->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /><!--允许应用程序在设备启动完成后自动启动。-->
<uses-permission android:name="android.permission.SET_WALLPAPER" /><!--允许应用程序设置壁纸。-->
<!--读写内存块权限-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!--允许应用程序写入外部存储器例如SD卡。-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:icon="@drawable/icon_app"
android:label="@string/app_name" >

@ -153,7 +153,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private String mUserQuery;
private Pattern mPattern;
private Button button_xiugai;
private Spinner spinner;
@Override
@ -165,6 +164,9 @@ public class NoteEditActivity extends Activity implements OnClickListener,
return;
}
initResources();
//以下是设置修改字体的选项
String []ziti = getResources().getStringArray(R.array.spinner);
spinner = findViewById(R.id.spn_one);
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,ziti);//创建Arrayadapter适配器

@ -145,6 +145,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
private final static int REQUEST_CODE_NEW_NODE = 103;
private Button button_background;
private FrameLayout frameLayout;
@SuppressLint("MissingInflatedId")
@Override
@ -152,7 +153,6 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
super.onCreate(savedInstanceState);
setContentView(R.layout.note_list);
button_background = findViewById(R.id.button_background);
frameLayout = findViewById(R.id.frame);
button_background.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
@ -176,14 +176,12 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
}else if(requestCode == 1 && resultCode == RESULT_OK && data != null){
Uri imageUri = data.getData();
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), imageUri);
//WallpaperManager wallpaperManager = WallpaperManager.getInstance(getApplicationContext());
//wallpaperManager.setBitmap(bitmap);
BitmapDrawable bd= new BitmapDrawable(getResources(),bitmap);
getWindow().setBackgroundDrawable(bd);
//image.setImageBitmap(bitmap);
// image.setAdjustViewBounds(true);
Toast.makeText(getApplicationContext(), "壁纸设置成功!", Toast.LENGTH_SHORT).show();
//从指定的Uri对象中获取一个Bitmap对象以便在Android应用程序中处理和显示图片。
Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), imageUri);//将你点击到的手机相册图片保存到bitmap中
//将bitmap转化为Drawable
BitmapDrawable bd = new BitmapDrawable(getResources(),bitmap);//将bitmap转化为Drawable
getWindow().setBackgroundDrawable(bd);//设置背景
Toast.makeText(getApplicationContext(), "背景设置成功!", Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
}

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Before

Width:  |  Height:  |  Size: 554 KiB

After

Width:  |  Height:  |  Size: 554 KiB

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save