V1.0.2(3)

This commit is contained in:
zhouzhijia 2024-07-26 19:11:12 +08:00
commit 3b5c0ace98
86 changed files with 15478 additions and 0 deletions

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
.idea/
app/release/simplewallpaper_V1.0.2(3)_07_25_17_08-release.aab

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

63
app/build.gradle.kts Normal file
View File

@ -0,0 +1,63 @@
import java.util.Date
import java.text.SimpleDateFormat
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id ("kotlin-kapt")
}
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
namespace = "com.tool.simplewallpaper"
compileSdk = 34
defaultConfig {
applicationId = "com.tool.simplewallpaper.test"
minSdk = 23
targetSdk = 34
versionCode = 3
versionName = "1.0.2"
setProperty("archivesBaseName", "simplewallpaper_V" + versionName + "(${versionCode})_$timestamp")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isShrinkResources =true
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
dependencies {
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("com.github.bumptech.glide:glide:4.16.0")
val room_version = "2.6.1"
implementation("androidx.room:room-runtime:$room_version")
annotationProcessor("androidx.room:room-compiler:$room_version")
kapt("androidx.room:room-compiler:$room_version")
implementation("androidx.room:room-ktx:$room_version")
implementation("androidx.room:room-rxjava2:$room_version")
implementation("androidx.room:room-rxjava3:$room_version")
implementation("androidx.room:room-guava:$room_version")
testImplementation("androidx.room:room-testing:$room_version")
implementation("androidx.room:room-paging:$room_version")
implementation ("io.github.youth5201314:banner:2.2.3")
implementation ("com.github.bumptech.glide:glide:4.16.0")
implementation ("com.guolindev.permissionx:permissionx:1.7.1")
}

33
app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,33 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keepclassmembers class com.tool.simplewallpaper.WallpaperSkin{
public static final java.lang.String DB_Name;
public static final int DB_Version;
}
-keepclassmembers class *{
@androidx.room.Query <methods>;
}
-keep class com.tool.simplewallpaper.data.MydataBase { *; }
-keep class com.tool.simplewallpaper.data.MyDAO { *; }
-keep class com.tool.simplewallpaper.data.Mydata { *; }
-keep class com.tool.simplewallpaper.data.Otherdata { *; }

View File

@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.tool.simplewallpaper",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 2,
"versionName": "1.0.1",
"outputFile": "simplewallpaper_V1.0.1(2)_07_25_14_25-release.apk"
}
],
"elementType": "File"
}

BIN
app/simplewallpaper.jks Normal file

Binary file not shown.

BIN
app/simplewallpapertest.jks Normal file

Binary file not shown.

View File

@ -0,0 +1,26 @@
package com.tool.simplewallpaper;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.tool.simplewallpaper", appContext.getPackageName());
}
}

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".WallpaperSkin"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/icon_logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/icon_logo"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:targetApi="31" >
<activity
android:name=".activity.SplashActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.AllActivity"
android:exported="false" />
<activity
android:name=".activity.PreViewActivity"
android:exported="false" />
<activity
android:name=".activity.MainActivity"
android:exported="true" >
</activity>
</application>
</manifest>

View File

@ -0,0 +1,95 @@
{
"ID": 24055,
"version": "3.3.4",
"name": "Abstract",
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24055_89_44_1654593252.png",
"backgrounds": [{
"ID": 24057,
"version": "3.3.4",
"skinNumber": 1101,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24057_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24057_91_44_1698326473.zip",
"inappString": "",
"videoCount": 0
}, {
"ID": 24058,
"version": "3.3.4",
"skinNumber": 1102,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24058_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24058_91_44_1654593252.zip",
"inappString": "",
"videoCount": 0
}, {
"ID": 24059,
"version": "3.3.4",
"skinNumber": 1103,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24059_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24059_91_44_1698326473.zip",
"inappString": "",
"videoCount": 0
}, {
"ID": 24060,
"version": "3.3.4",
"skinNumber": 1104,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24060_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24060_91_44_1698326473.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1104",
"videoCount": 0
}, {
"ID": 24061,
"version": "3.3.4",
"skinNumber": 1105,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24061_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24061_91_44_1698326473.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1105",
"videoCount": 0
}, {
"ID": 24062,
"version": "3.3.6",
"skinNumber": 1106,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24062_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24062_91_44_1698326473.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1106",
"videoCount": 0
}, {
"ID": 24063,
"version": "3.3.4",
"skinNumber": 1107,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24063_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24063_91_44_1698326473.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1107",
"videoCount": 0
}, {
"ID": 24064,
"version": "3.3.4",
"skinNumber": 1108,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24064_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24064_91_44_1654593252.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1108",
"videoCount": 0
}, {
"ID": 24065,
"version": "3.3.4",
"skinNumber": 1109,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24065_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24065_91_44_1698326473.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1109",
"videoCount": 2
}, {
"ID": 24066,
"version": "3.3.4",
"skinNumber": 1110,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24066_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24066_91_44_1698326473.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1110",
"videoCount": 2
}, {
"ID": 24067,
"version": "3.3.4",
"skinNumber": 1111,
"coverPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/pictures\/photo_24067_90_44_1654593252.png",
"contentPath": "https:\/\/milenica.info\/AppSetUp\/SetUp\/files\/file_24067_91_44_1698847414.zip",
"inappString": "milicapetrovic.emojikeyboard.colorkeyboard.UnlockBackground1111",
"videoCount": 2
}]
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
package com.tool.simplewallpaper;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.tool.simplewallpaper.data.Mydata;
import com.tool.simplewallpaper.data.MydataBase;
import com.tool.simplewallpaper.data.Otherdata;
import com.tool.simplewallpaper.tools.Mytools;
import java.util.ArrayList;
import java.util.List;
public class WallpaperSkin extends Application {
public static final String APP_Name = "Simplewallpaper";
public static final String DB_Name = "wallpaper_database";
public static final String Table_Name = "wallpaper_table";
public static final int DB_Version = 1;
public static WallpaperSkin app;
private static Context context;
public static List<Mydata> myDataArrayList;
private static boolean isinsert;
private static final String PREFS_NAME = "MyPrefs";
private static final String KEY_IS_INSERTED = "isinserted";
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
List<Mydata> myData = Mytools.parseJsonToList("wallpaper.json");
myDataArrayList = myData;
SharedPreferences prefs = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
isinsert = prefs.getBoolean(KEY_IS_INSERTED, false);
if (!isinsert) {
Mytools.runIO(new Runnable() {
@Override
public void run() {
MydataBase.getInstance().myDAO().insertAll(getOtherdata());
isinsert = true;
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(KEY_IS_INSERTED, isinsert);
editor.apply();
}
});
}
}
public static Context getAppContext() {
return context;
}
public static List<Mydata> getMyDataArrayList() {
return myDataArrayList;
}
private static List<Otherdata> getOtherdata() {
List<Mydata> mydata = WallpaperSkin.getMyDataArrayList();
List<Otherdata> newlist = new ArrayList<>();
for (Mydata myDataItem : mydata) {
List<Otherdata> dataList = myDataItem.getList();
for (Otherdata otherdata : dataList) {
if (otherdata.getBanner() != null && !otherdata.getBanner().isEmpty())
newlist.add(otherdata);
}
}
return newlist;
}
}

View File

@ -0,0 +1,89 @@
package com.tool.simplewallpaper.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.tool.simplewallpaper.R;
import com.tool.simplewallpaper.adapter.MainRvListAdapter;
import com.tool.simplewallpaper.data.MydataBase;
import com.tool.simplewallpaper.data.Otherdata;
import com.tool.simplewallpaper.tools.Mytools;
import com.tool.simplewallpaper.tools.SpaceItem;
import com.tool.simplewallpaper.tools.StaticValue;
import java.util.ArrayList;
import java.util.List;
public class AllActivity extends AppCompatActivity {
private TextView title;
private ImageView back;
private String name;
private RecyclerView allrv;
private MainRvListAdapter mainRvListAdapter;
private List<Otherdata> otherdata = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_all);
initView();
initEvent();
Intent intent = getIntent();
name = intent.getStringExtra(StaticValue.KEY_name);
title.setText(name);
initData();
}
private void initEvent() {
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void initData() {
Mytools.runIO(new Runnable() {
@Override
public void run() {
List<Otherdata> existingData = MydataBase.getInstance().myDAO().getallwp(name);
if (!existingData.isEmpty()){
otherdata = existingData;
runOnUiThread(new Runnable() {
@Override
public void run() {
mainRvListAdapter = new MainRvListAdapter(AllActivity.this);
mainRvListAdapter.setData(otherdata);
allrv.setLayoutManager(new GridLayoutManager(AllActivity.this, 3));
SpaceItem spaceItem =new SpaceItem(16,10,16);
allrv.addItemDecoration(spaceItem);
allrv.setAdapter(mainRvListAdapter);
}
});
}
}
});
}
private void initView() {
title = findViewById(R.id.all_text);
back = findViewById(R.id.all_back);
allrv = findViewById(R.id.all_rv);
}
}

View File

@ -0,0 +1,94 @@
package com.tool.simplewallpaper.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.google.android.material.tabs.TabLayout;
import com.tool.simplewallpaper.R;
import com.tool.simplewallpaper.adapter.PageAdapter;
import com.tool.simplewallpaper.fragment.LikeFragment;
public class MainActivity extends AppCompatActivity {
private TabLayout tabLayout;
private ViewPager viewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
initData();
}
private void initView() {
tabLayout = findViewById(R.id.main_tabLayout);
viewPager = findViewById(R.id.main_viewpager);
}
private void initData() {
PageAdapter adapter = new PageAdapter(getSupportFragmentManager());
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
setmainTabIcons(tabLayout);
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
setTabIcons(position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
private void setTabIcons(final int position) {
for (int i = 0; i < tabLayout.getTabCount(); i++) {
final TabLayout.Tab tab = tabLayout.getTabAt(i);
if (tab != null) {
switch (i) {
case 0:
tab.setIcon(position == 0 ? R.drawable.home_check : R.drawable.home_uncheck);
break;
case 1:
tab.setIcon(position == 0 ? R.drawable.like_uncheck : R.drawable.like_check);
break;
default:
break;
}
}
}
}
private void setmainTabIcons(TabLayout tabLayout) {
for (int i = 0; i < tabLayout.getTabCount(); i++) {
TabLayout.Tab tab = tabLayout.getTabAt(i);
if (tab != null) {
switch (i) {
case 0:
tab.setIcon(R.drawable.home_check);
break;
case 1:
tab.setIcon(R.drawable.like_uncheck);
break;
default:
break;
}
}
}
}
}

View File

@ -0,0 +1,390 @@
package com.tool.simplewallpaper.activity;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.WallpaperManager;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.request.transition.Transition;
import com.permissionx.guolindev.PermissionX;
import com.tool.simplewallpaper.R;
import com.tool.simplewallpaper.data.MydataBase;
import com.tool.simplewallpaper.data.Otherdata;
import com.tool.simplewallpaper.tools.Mytools;
import com.tool.simplewallpaper.tools.StaticValue;
import com.tool.simplewallpaper.tools.Utils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
public class PreViewActivity extends AppCompatActivity {
private static final int REQUEST_CODE_WRITE_STORAGE_PERMISSION = 100;
private ImageView back, menu, image;
private boolean ismenu = true;
private String preurl;
private String downurl;
private TextView setwallpaper;
private LinearLayout linmenu;
private String name;
private final Boolean[] islike = {false};
private ImageView download, like;
private WallpaperManager wallpaperManager;
private Bitmap setmap, downloadmap;
private ProgressBar pgsetwp, pgdown, pgpre;
private File downrs;
private Otherdata otherdata;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pre_view);
initView();
initEvent();
BroadcastReceiver wallpaperChangedReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_WALLPAPER_CHANGED.equals(intent.getAction())) {
finish();
Toast.makeText(PreViewActivity.this, getString(R.string.set_successful), Toast.LENGTH_SHORT).show();
}
}
};
IntentFilter filter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED);
registerReceiver(wallpaperChangedReceiver, filter);
Intent intent = getIntent();
preurl = intent.getStringExtra(StaticValue.KEY_original);
downurl = intent.getStringExtra(StaticValue.KEY_source);
name = intent.getStringExtra(StaticValue.KEY_name);
Mytools.runIO(new Runnable() {
@Override
public void run() {
List<Otherdata> existingData = MydataBase.getInstance().myDAO().getliketitle(downurl);
if (!existingData.isEmpty()) {
otherdata = existingData.get(0);
islike[0] = otherdata.getLike();
if (islike[0]) {
like.setBackgroundResource(R.drawable.pre_like_check);
} else {
like.setBackgroundResource(R.drawable.pre_like_uncheck);
}
}
}
});
Glide.with(this)
.asBitmap()
.load(preurl)
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
image.setImageBitmap(resource);
setmap = resource;
downloadmap = resource;
pgpre.setVisibility(View.GONE);
showmenu();
menu.setVisibility(View.VISIBLE);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}
private void initEvent() {
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
like.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checklike();
}
});
download.setOnClickListener(new View.OnClickListener() {
@SuppressLint("InlinedApi")
@Override
public void onClick(View v) {
download.setVisibility(View.GONE);
pgdown.setVisibility(View.VISIBLE);
List<String> permissions = new ArrayList<>();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
permissions.add(android.Manifest.permission.READ_MEDIA_IMAGES);
}
permissions.add(android.Manifest.permission.READ_EXTERNAL_STORAGE);
permissions.add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
permissions.add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
PermissionX.init(PreViewActivity.this)
.permissions(permissions)
.request((allGranted, grantedList, deniedList) -> {
if (!allGranted) {
download.setVisibility(View.VISIBLE);
pgdown.setVisibility(View.GONE);
Toast.makeText(PreViewActivity.this, getString(R.string.permission_tips), Toast.LENGTH_SHORT).show();
} else {
downloadwp();
}
});
}
});
setwallpaper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setwallpaper.setVisibility(View.GONE);
pgsetwp.setVisibility(View.VISIBLE);
List<String> permissions = new ArrayList<>();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
permissions.add(android.Manifest.permission.READ_MEDIA_IMAGES);
}
permissions.add(android.Manifest.permission.READ_EXTERNAL_STORAGE);
permissions.add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
permissions.add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
PermissionX.init(PreViewActivity.this)
.permissions(permissions)
.request((allGranted, grantedList, deniedList) -> {
if (!allGranted) {
setwallpaper.setVisibility(View.VISIBLE);
pgsetwp.setVisibility(View.GONE);
Toast.makeText(PreViewActivity.this, getString(R.string.permission_tips), Toast.LENGTH_SHORT).show();
} else {
setwp(setmap);
}
});
}
});
menu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (ismenu) {
menu.setBackgroundResource(R.drawable.icon_shrink);
hidemenu();
ismenu = false;
} else {
menu.setBackgroundResource(R.drawable.icon_expand);
showmenu();
ismenu = true;
}
}
});
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == REQUEST_CODE_WRITE_STORAGE_PERMISSION) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
downloadwp();
} else {
Toast.makeText(PreViewActivity.this, getString(R.string.permission_tips), Toast.LENGTH_SHORT).show();
}
}
}
@SuppressLint("CheckResult")
private void downloadwp() {
if (downloadmap != null) {
Glide.with(this)
.load(downurl)
.downloadOnly(new CustomTarget<File>() {
@Override
public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) {
downrs = resource;
saveImageToGallery(downrs);
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
Toast.makeText(PreViewActivity.this, getString(R.string.download_failed), Toast.LENGTH_SHORT).show();
download.setVisibility(View.VISIBLE);
pgdown.setVisibility(View.GONE);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}
}
private void saveImageToGallery(File imageFile) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
if (Utils.INSTANCE.saveImageToGallery(PreViewActivity.this, downloadmap, downrs.getName() + ".jpg")) {
Toast.makeText(PreViewActivity.this, getString(R.string.download_successful), Toast.LENGTH_SHORT).show();
finish();
} else {
Toast.makeText(PreViewActivity.this, getString(R.string.download_failed), Toast.LENGTH_SHORT).show();
}
} else {
ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.DISPLAY_NAME, "Image_" + System.currentTimeMillis());
values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
values.put(MediaStore.Images.Media.RELATIVE_PATH, Environment.DIRECTORY_PICTURES);
Uri externalUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
ContentResolver resolver = getContentResolver();
try {
Uri insertUri = resolver.insert(externalUri, values);
if (insertUri != null) {
OutputStream outputStream = resolver.openOutputStream(insertUri);
if (outputStream != null) {
FileInputStream inputStream = new FileInputStream(imageFile);
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
inputStream.close();
outputStream.close();
Toast.makeText(PreViewActivity.this, getString(R.string.download_successful), Toast.LENGTH_SHORT).show();
finish();
}
} else {
Toast.makeText(PreViewActivity.this, getString(R.string.download_failed), Toast.LENGTH_SHORT).show();
}
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(PreViewActivity.this, getString(R.string.download_failed), Toast.LENGTH_SHORT).show();
}
}
}
private void setwp(Bitmap bitmap) {
new Thread(new Runnable() {
@Override
public void run() {
// Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
//// intent.setData(getImageUri(PreViewActivity.this, bitmap));
// intent.setDataAndType(getImageUri(PreViewActivity.this, bitmap), "image/*");
//
// startActivity(Intent.createChooser(intent,"1111"));
try {
wallpaperManager.setBitmap(bitmap);
} catch (IOException e) {
Toast.makeText(PreViewActivity.this, getString(R.string.set_failed), Toast.LENGTH_SHORT).show();
}
}
}).start();
}
public Uri getImageUri(Context context, Bitmap bitmap) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
String path = MediaStore.Images.Media.insertImage(context.getContentResolver(), bitmap, "Title", null);
return Uri.parse(path);
}
private void checklike() {
if (!islike[0]) {
like.setBackgroundResource(R.drawable.pre_like_check);
islike[0] = true;
otherdata.setLike(true);
Mytools.runIO(new Runnable() {
@Override
public void run() {
List<Otherdata> existingData = MydataBase.getInstance().myDAO().getliketitle(preurl);
if (existingData.isEmpty()) {
MydataBase.getInstance().myDAO().update(otherdata);
}
}
});
} else {
like.setBackgroundResource(R.drawable.pre_like_uncheck);
islike[0] = false;
otherdata.setLike(false);
Mytools.runIO(new Runnable() {
@Override
public void run() {
MydataBase.getInstance().myDAO().update(otherdata);
}
});
}
}
private void hidemenu() {
linmenu.setVisibility(View.GONE);
}
private void showmenu() {
linmenu.setVisibility(View.VISIBLE);
}
private void initView() {
back = findViewById(R.id.pre_back);
menu = findViewById(R.id.img_menu);
image = findViewById(R.id.pre_image);
linmenu = findViewById(R.id.pre_menu);
download = findViewById(R.id.img_download);
setwallpaper = findViewById(R.id.img_setwallpaper);
like = findViewById(R.id.img_like);
wallpaperManager = WallpaperManager.getInstance(this);
pgsetwp = findViewById(R.id.pg_setwallpaper);
pgdown = findViewById(R.id.pg_donwnload);
pgpre = findViewById(R.id.pre_pg);
pgsetwp.setVisibility(View.GONE);
pgdown.setVisibility(View.GONE);
pgpre.setVisibility(View.VISIBLE);
hidemenu();
menu.setVisibility(View.GONE);
}
}

View File

@ -0,0 +1,47 @@
package com.tool.simplewallpaper.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import com.tool.simplewallpaper.R;
public class SplashActivity extends AppCompatActivity {
private CountDownTimer countDownTimer;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.splash_activity), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
countDownTimer = new CountDownTimer(2000, 1000) {
@Override
public void onTick(long l) {
}
@Override
public void onFinish() {
starMainactivity();
}
};
countDownTimer.start();
}
private void starMainactivity() {
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
}

View File

@ -0,0 +1,128 @@
package com.tool.simplewallpaper.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.tool.simplewallpaper.R;
import com.tool.simplewallpaper.activity.AllActivity;
import com.tool.simplewallpaper.data.Mydata;
import com.tool.simplewallpaper.data.Otherdata;
import com.tool.simplewallpaper.tools.SpaceItem;
import com.tool.simplewallpaper.tools.StaticValue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class MainRvAdapter extends RecyclerView.Adapter<MainRvAdapter.MainRvVH> {
private Context mcontext;
private List<Mydata> myDataList;
private MainRvListAdapter mainRvListAdapter;
public MainRvAdapter(Context context) {
mcontext = context;
myDataList = new ArrayList<>();
}
@SuppressLint("NotifyDataSetChanged")
public void setData(List<Mydata> myDatadataList) {
this.myDataList = myDatadataList;
}
@NonNull
@Override
public MainRvAdapter.MainRvVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mcontext).inflate(R.layout.main_rv_list, parent, false);
return new MainRvAdapter.MainRvVH(view);
}
@Override
public void onBindViewHolder(@NonNull MainRvAdapter.MainRvVH holder, int position) {
Mydata otherdata = myDataList.get(position);
String name = otherdata.getName();
holder.getName().setText(name);
List<Otherdata> otherdataList = otherdata.getList();
List<Otherdata> randomOtherdata = getRandomOtherdata(otherdataList);
mainRvListAdapter = new MainRvListAdapter(mcontext);
mainRvListAdapter.setData(randomOtherdata);
LinearLayoutManager layoutManager = new LinearLayoutManager(mcontext);
layoutManager.setOrientation(RecyclerView.HORIZONTAL);
holder.getMainlistrv().setLayoutManager(layoutManager);
holder.getMainlistrv().setAdapter(mainRvListAdapter);
holder.getViewall().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mcontext, AllActivity.class);
intent.putExtra(StaticValue.KEY_name, name);
mcontext.startActivity(intent);
}
});
}
private List<Otherdata> getRandomOtherdata(List<Otherdata> otherdataList) {
List<Otherdata> selectedOtherdata = new ArrayList<>();
// Collections.shuffle(otherdataList);
String currentName = otherdataList.get(0).getName();
int count = 0;
for (Otherdata otherdata : otherdataList) {
if (otherdata.getName().equals(currentName)) {
selectedOtherdata.add(otherdata);
count++;
}
if (count >= 6) {
break;
}
}
return selectedOtherdata;
}
@Override
public int getItemCount() {
return myDataList.size();
}
public class MainRvVH extends RecyclerView.ViewHolder {
private LinearLayout viewall;
private TextView name;
private RecyclerView mainlistrv;
public MainRvVH(@NonNull View itemView) {
super(itemView);
viewall = itemView.findViewById(R.id.view_all);
name = itemView.findViewById(R.id.main_rv_list_text);
mainlistrv = itemView.findViewById(R.id.main_list_rv);
}
public LinearLayout getViewall() {
return viewall;
}
public TextView getName() {
return name;
}
public RecyclerView getMainlistrv() {
return mainlistrv;
}
}
}

View File

@ -0,0 +1,91 @@
package com.tool.simplewallpaper.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.tool.simplewallpaper.R;
import com.tool.simplewallpaper.activity.AllActivity;
import com.tool.simplewallpaper.activity.PreViewActivity;
import com.tool.simplewallpaper.data.Mydata;
import com.tool.simplewallpaper.data.Otherdata;
import com.tool.simplewallpaper.tools.StaticValue;
import java.util.ArrayList;
import java.util.List;
public class MainRvListAdapter extends RecyclerView.Adapter<MainRvListAdapter.MainRvVH> {
private Context mcontext;
private List<Otherdata> myDataList;
public MainRvListAdapter(Context context) {
mcontext = context;
myDataList = new ArrayList<>();
}
@SuppressLint("NotifyDataSetChanged")
public void setData(List<Otherdata> myDatadataList) {
this.myDataList = myDatadataList;
}
@NonNull
@Override
public MainRvListAdapter.MainRvVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mcontext).inflate(R.layout.main_list_rv_list, parent, false);
return new MainRvListAdapter.MainRvVH(view);
}
@Override
public void onBindViewHolder(@NonNull MainRvListAdapter.MainRvVH holder, int position) {
Otherdata otherdata = myDataList.get(position);
String url = otherdata.getSource();
String pre = otherdata.getPreviewThumb();
String source = otherdata.getOriginal();
String name = otherdata.getName();
Glide.with(mcontext)
.load(pre)
.placeholder(R.color.load_bg)
.into(holder.getImage());
holder.getImage().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mcontext, PreViewActivity.class);
intent.putExtra(StaticValue.KEY_source, url);
intent.putExtra(StaticValue.KEY_previewThumb, pre);
intent.putExtra(StaticValue.KEY_original, source);
intent.putExtra(StaticValue.KEY_name, name);
mcontext.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return myDataList.size();
}
public class MainRvVH extends RecyclerView.ViewHolder {
private ImageView image;
public MainRvVH(@NonNull View itemView) {
super(itemView);
image = itemView.findViewById(R.id.main_list_rv_img);
}
public ImageView getImage() {
return image;
}
}
}

View File

@ -0,0 +1,33 @@
package com.tool.simplewallpaper.adapter;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import com.tool.simplewallpaper.fragment.LikeFragment;
import com.tool.simplewallpaper.fragment.MainFragment;
import java.util.ArrayList;
import java.util.List;
public class PageAdapter extends FragmentStatePagerAdapter {
private final List<Fragment> list = new ArrayList<>();
public PageAdapter(@NonNull FragmentManager fm) {
super(fm);
list.add(new MainFragment());
list.add(new LikeFragment());
}
@NonNull
@Override
public Fragment getItem(int position) {
return list.get(position);
}
@Override
public int getCount() {
return list.size();
}
}

View File

@ -0,0 +1,29 @@
package com.tool.simplewallpaper.data;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface MyDAO {
@Query("SELECT * FROM wallpaper_table")
List<Otherdata> getAll();
@Query("select * from wallpaper_table where source =:source ")
List<Otherdata> getliketitle(String source);
@Query("select * from wallpaper_table where name =:name ")
List<Otherdata> getallwp(String name);
@Query("SELECT * FROM wallpaper_table WHERE islike = :islike")
List<Otherdata> getlikewp(boolean islike);
@Insert
void insertAll(List<Otherdata> likeDataList);
@Update
void update(Otherdata otherdata);
}

View File

@ -0,0 +1,24 @@
package com.tool.simplewallpaper.data;
import java.util.ArrayList;
import java.util.List;
public class Mydata {
public String name;
private List<Otherdata> list =new ArrayList<>();
public List<Otherdata> getList() {
return list;
}
public void setList(List<Otherdata> list) {
this.list = list;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,28 @@
package com.tool.simplewallpaper.data;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.tool.simplewallpaper.WallpaperSkin;
@Database(entities = {Otherdata.class}, version = WallpaperSkin.DB_Version,exportSchema = false)
public abstract class MydataBase extends RoomDatabase {
public abstract MyDAO myDAO();
private static MydataBase INSTANCE;
public static MydataBase getInstance() {
if (INSTANCE == null) {
synchronized (MydataBase.class) {
if (INSTANCE == null) {
INSTANCE = Room.databaseBuilder(WallpaperSkin.getAppContext(), MydataBase.class, WallpaperSkin.DB_Name).build();
}
}
}
return INSTANCE;
}
}

View File

@ -0,0 +1,66 @@
package com.tool.simplewallpaper.data;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import com.tool.simplewallpaper.WallpaperSkin;
@Entity(tableName = WallpaperSkin.Table_Name)
public class Otherdata {
@PrimaryKey(autoGenerate = true)
public int id;
public String name;
public String banner;
public String original;
public String previewThumb;
public String source;
public Boolean islike;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBanner() {
return banner;
}
public void setBanner(String banner) {
this.banner = banner;
}
public String getOriginal() {
return original;
}
public void setOriginal(String original) {
this.original = original;
}
public String getPreviewThumb() {
return previewThumb;
}
public void setPreviewThumb(String previewThumb) {
this.previewThumb = previewThumb;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public Boolean getLike() {
return islike;
}
public void setLike(Boolean like) {
this.islike = like;
}
}

View File

@ -0,0 +1,77 @@
package com.tool.simplewallpaper.fragment;
import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.style.AlignmentSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.tool.simplewallpaper.R;
import com.tool.simplewallpaper.activity.AllActivity;
import com.tool.simplewallpaper.adapter.MainRvListAdapter;
import com.tool.simplewallpaper.data.MydataBase;
import com.tool.simplewallpaper.data.Otherdata;
import com.tool.simplewallpaper.tools.Mytools;
import com.tool.simplewallpaper.tools.SpaceItem;
import java.util.ArrayList;
import java.util.List;
public class LikeFragment extends Fragment {
private RecyclerView likerv;
private MainRvListAdapter mainRvListAdapter;
private TextView likehint;
private SpaceItem spaceItem = new SpaceItem(16, 10, 16);
private List<Otherdata> existingData;
@SuppressLint("MissingInflatedId")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_like, container, false);
initData();
likerv = view.findViewById(R.id.like_rv);
likehint = view.findViewById(R.id.nolike_text);
likerv.addItemDecoration(spaceItem);
return view;
}
private void initData() {
Mytools.runIO(new Runnable() {
@Override
public void run() {
existingData = MydataBase.getInstance().myDAO().getlikewp(true);
requireActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (existingData.isEmpty()) {
likehint.setVisibility(View.VISIBLE);
} else {
likehint.setVisibility(View.GONE);
}
mainRvListAdapter = new MainRvListAdapter(requireContext());
mainRvListAdapter.setData(existingData);
likerv.setLayoutManager(new GridLayoutManager(requireContext(), 3));
likerv.setAdapter(mainRvListAdapter);
}
});
}
});
}
@Override
public void onResume() {
super.onResume();
initData();
}
}

View File

@ -0,0 +1,114 @@
package com.tool.simplewallpaper.fragment;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.tool.simplewallpaper.R;
import com.tool.simplewallpaper.WallpaperSkin;
import com.tool.simplewallpaper.activity.PreViewActivity;
import com.tool.simplewallpaper.adapter.MainRvAdapter;
import com.tool.simplewallpaper.data.Mydata;
import com.tool.simplewallpaper.data.MydataBase;
import com.tool.simplewallpaper.data.Otherdata;
import com.tool.simplewallpaper.tools.SpaceItem;
import com.tool.simplewallpaper.tools.StaticValue;
import com.youth.banner.Banner;
import com.youth.banner.adapter.BannerImageAdapter;
import com.youth.banner.holder.BannerImageHolder;
import com.youth.banner.indicator.CircleIndicator;
import com.youth.banner.listener.OnBannerListener;
import com.youth.banner.transformer.AlphaPageTransformer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class MainFragment extends Fragment {
private RecyclerView mainrv;
private Banner banner;
private MainRvAdapter mainRvAdapter;
private List<Otherdata> randomOriginals = new ArrayList<>();
@SuppressLint("MissingInflatedId")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_main, container, false);
mainrv = view.findViewById(R.id.main_rv);
banner = view.findViewById(R.id.banner);
mainrv = view.findViewById(R.id.main_rv);
mainRvAdapter = new MainRvAdapter(requireContext());
mainRvAdapter.setData(WallpaperSkin.getMyDataArrayList());
mainrv.setLayoutManager(new LinearLayoutManager(requireContext()));
mainrv.setAdapter(mainRvAdapter);
List<Otherdata> otherdataList = generateRandomOtherdata();
for (Otherdata data : otherdataList) {
randomOriginals.add(data);
}
banner.setAdapter(new BannerImageAdapter<Otherdata>(randomOriginals) {
@Override
public void onBindView(BannerImageHolder holder, Otherdata data, int position, int size) {
ImageView imageView = holder.imageView;
Glide.with(requireContext())
.load(data.getPreviewThumb())
.placeholder(R.mipmap.icon_logo)
.into(imageView);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
}
});
banner.setOnBannerListener(new OnBannerListener() {
@Override
public void OnBannerClick(Object data, int position) {
Otherdata otherdata = randomOriginals.get(position);
String url = otherdata.getSource();
String pre = otherdata.getOriginal();
String name = otherdata.getName();
Intent intent = new Intent(requireContext(), PreViewActivity.class);
intent.putExtra(StaticValue.KEY_original, pre);
intent.putExtra(StaticValue.KEY_source, url);
intent.putExtra(StaticValue.KEY_name, name);
requireContext().startActivity(intent);
}
});
banner.setIndicator(new CircleIndicator(requireContext()));
banner.setIndicatorRadius(100);
return view;
}
private List<Otherdata> generateRandomOtherdata() {
List<Otherdata> allOtherdata = getOtherdata();
Collections.shuffle(allOtherdata);
return allOtherdata.subList(0, 5);
}
private static List<Otherdata> getOtherdata() {
List<Mydata> mydata = WallpaperSkin.getMyDataArrayList();
List<Otherdata> newlist = new ArrayList<>();
for (Mydata myDataItem : mydata) {
List<Otherdata> dataList = myDataItem.getList();
for (Otherdata otherdata : dataList) {
if (otherdata.getBanner() != null && !otherdata.getBanner().isEmpty())
newlist.add(otherdata);
}
}
return newlist;
}
}

View File

@ -0,0 +1,106 @@
package com.tool.simplewallpaper.tools;
import android.content.res.AssetManager;
import com.tool.simplewallpaper.WallpaperSkin;
import com.tool.simplewallpaper.data.Mydata;
import com.tool.simplewallpaper.data.Otherdata;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Mytools {
private static ExecutorService executorService;
public static void runIO(Runnable task) {
getExecutorService().execute(task);
}
private static ExecutorService getExecutorService() {
if (executorService == null) {
executorService = Executors.newSingleThreadExecutor();
}
return executorService;
}
private static JSONArray loadJSONFromAsset(String filename) {
String json;
try {
AssetManager assetManager = WallpaperSkin.getAppContext().getAssets();
InputStream inputStream = assetManager.open(filename);
int size = inputStream.available();
byte[] buffer = new byte[size];
inputStream.read(buffer);
inputStream.close();
json = new String(buffer, StandardCharsets.UTF_8);
return new JSONArray(json);
} catch (IOException | JSONException e) {
e.printStackTrace();
return null;
}
}
public static List<Mydata> getlist(String filename) {
List<Mydata> mydataList = new ArrayList<>();
JSONArray jsonArray = loadJSONFromAsset(filename);
try {
for (int i = 0; i <= jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Mydata mydata =new Mydata();
mydata.setName(jsonObject.getString("name"));
List<Otherdata> otherdata =new ArrayList<>();
}
}catch (JSONException e){
e.printStackTrace();
}
return mydataList;
}
public static List<Mydata> parseJsonToList(String filename) {
List<Mydata> dataList = new ArrayList<>();
try {
JSONArray jsonObject = loadJSONFromAsset(filename);
for (int a = 0; a < jsonObject.length(); a++) {
JSONObject list = jsonObject.getJSONObject(a);
Mydata myData = new Mydata();
List<Otherdata> otherdataList = new ArrayList<>();
myData.setName(list.getString("name"));
JSONArray classArray = list.getJSONArray("data");
for (int i = 0; i < classArray.length(); i++) {
JSONObject item = classArray.getJSONObject(i);
Otherdata otherdata = new Otherdata();
otherdata.setLike(false);
otherdata.setName(myData.getName());
boolean banner = item.has("banner");
if (banner) {
otherdata.setBanner(item.getString("banner"));
} else {
otherdata.setBanner("1");
}
otherdata.setOriginal(item.getString("original"));
otherdata.setPreviewThumb(item.getString("previewThumb"));
otherdata.setSource(item.getString("source"));
otherdataList.add(otherdata);
}
myData.setList(otherdataList);
dataList.add(myData);
}
} catch (JSONException e) {
e.printStackTrace();
}
return dataList;
}
}

View File

@ -0,0 +1,56 @@
package com.tool.simplewallpaper.tools;
import android.graphics.Rect;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
public class SpaceItem extends RecyclerView.ItemDecoration {
private int ex_space = 0;
private int v_space = 0;
private int h_space = 0;
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
int position = parent.getChildAdapterPosition(view);
int spanSize = 1;
int spanIndex = 0;
int spanCount = 1;
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
if (layoutManager instanceof GridLayoutManager) {
GridLayoutManager layoutManager1 = (GridLayoutManager) layoutManager;
GridLayoutManager.LayoutParams layoutParams = (GridLayoutManager.LayoutParams) view.getLayoutParams();
spanCount = layoutManager1.getSpanCount();
spanSize = layoutManager1.getSpanSizeLookup().getSpanSize(position);
spanIndex = layoutParams.getSpanIndex();
}
if (spanSize == spanCount) {
outRect.left = v_space + ex_space;
outRect.right = v_space + ex_space;
outRect.bottom = h_space;
} else {
int itemAllSpacing = (v_space * (spanCount + 1) + ex_space * 2) / spanCount;
int left = v_space * (spanIndex + 1) - itemAllSpacing * spanIndex + ex_space;
int right = itemAllSpacing - left;
outRect.left = left;
outRect.right = right;
outRect.bottom = h_space;
}
}
public SpaceItem(int v_space, int h_space, int ex_space) {
this.ex_space = ex_space;
this.h_space = h_space;
this.v_space = v_space;
}
}

View File

@ -0,0 +1,10 @@
package com.tool.simplewallpaper.tools;
public class StaticValue {
public static String KEY_name = "key_name";
public static String KEY_banner = "key_banner";
public static String KEY_source = "key_source";
public static String KEY_original = "KEY_original";
public static String KEY_previewThumb = "KEY_previewThumb";
}

View File

@ -0,0 +1,51 @@
package com.tool.simplewallpaper.tools
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.util.Log
import com.tool.simplewallpaper.WallpaperSkin
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
object Utils {
fun saveImageToGallery(context: Context, image: Bitmap, fileName:String): Boolean {
val storePath: String = getBitmapFileDir()
val appDir = File(storePath)
if (!appDir.exists()) {
appDir.mkdir()
}
val file = File(appDir, fileName)
try {
val fos = FileOutputStream(file)
val isSuccess = image.compress(Bitmap.CompressFormat.JPEG, 100, fos)
fos.flush()
fos.close()
val uri = Uri.fromFile(file)
context.sendBroadcast(Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri))
return isSuccess
} catch (e: IOException) {
e.printStackTrace()
return false
}
}
private fun getBitmapFileDir(): String {
return if (Build.VERSION.SDK_INT < 29) {
Environment.getExternalStorageDirectory().absolutePath + File.separator + WallpaperSkin.APP_Name
} else {
Environment.DIRECTORY_PICTURES + File.separator + WallpaperSkin.APP_Name
}
}
}

View File

@ -0,0 +1,23 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="17dp"
android:height="20dp"
android:viewportWidth="17"
android:viewportHeight="20">
<path
android:pathData="M0.851,7.45L8.5,1.5L16.149,7.45V16.799C16.149,17.25 15.97,17.682 15.652,18.001C15.333,18.32 14.901,18.499 14.45,18.499H2.551C2.1,18.499 1.668,18.32 1.349,18.001C1.03,17.682 0.851,17.25 0.851,16.799V7.45Z"
android:strokeLineJoin="round"
android:strokeWidth="1.69985"
android:fillColor="#353535"
android:strokeColor="#353535"
android:strokeLineCap="round"/>
<path
android:pathData="M5.949,18.498V11.014H11.048V18.498"
android:fillColor="#ffffff"/>
<path
android:pathData="M5.949,18.498V11.014H11.048V18.498"
android:strokeLineJoin="round"
android:strokeWidth="1.69985"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="17dp"
android:height="20dp"
android:viewportWidth="17"
android:viewportHeight="20">
<path
android:pathData="M0.851,7.45L8.5,1.5L16.149,7.45V16.799C16.149,17.25 15.97,17.682 15.652,18.001C15.333,18.32 14.9,18.499 14.45,18.499H2.551C2.1,18.499 1.667,18.32 1.349,18.001C1.03,17.682 0.851,17.25 0.851,16.799V7.45Z"
android:strokeLineJoin="round"
android:strokeWidth="1.69985"
android:fillColor="#00000000"
android:strokeColor="#353535"
android:strokeLineCap="round"/>
<path
android:pathData="M5.95,18.5V10H11.049V18.5"
android:strokeLineJoin="round"
android:strokeWidth="1.69985"
android:fillColor="#00000000"
android:strokeColor="#353535"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

View File

@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2.899,12H20.899"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M8.899,18L2.899,12L8.899,6"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,12.004V21H21V12"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M16.5,11.5L12,16L7.5,11.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M11.996,3V16"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,62 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M8,8L3,3.05"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M8,16L3,20.95"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M16,16L20.949,20.95"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M16,8L20.95,3.05"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M20.95,7.5V3H16.45"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M3,7.5V3H7.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M3,16.45V20.95H7.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M21,16.45V20.95H16.551"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M5.862,3.529C5.602,3.789 5.602,4.211 5.862,4.472L9.391,8L5.862,11.529C5.602,11.789 5.602,12.211 5.862,12.472C6.122,12.732 6.544,12.732 6.805,12.472L10.805,8.472C11.065,8.211 11.065,7.789 10.805,7.529L6.805,3.529C6.544,3.268 6.122,3.268 5.862,3.529Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,6C3,5.448 3.448,5 4,5H20C20.552,5 21,5.448 21,6C21,6.552 20.552,7 20,7H4C3.448,7 3,6.552 3,6ZM3,12C3,11.448 3.448,11 4,11H20C20.552,11 21,11.448 21,12C21,12.552 20.552,13 20,13H4C3.448,13 3,12.552 3,12ZM4,17C3.448,17 3,17.448 3,18C3,18.552 3.448,19 4,19H20C20.552,19 21,18.552 21,18C21,17.448 20.552,17 20,17H4Z"
android:fillColor="@color/black"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M10.616,3.044L6.042,4.768C4.987,5.162 4.126,6.408 4.126,7.527V14.338C4.126,15.419 4.841,16.84 5.712,17.491L9.653,20.433C10.946,21.405 13.072,21.405 14.365,20.433L18.307,17.491C19.177,16.84 19.892,15.419 19.892,14.338V7.527C19.892,6.399 19.031,5.153 17.977,4.758L13.402,3.044C12.623,2.76 11.377,2.76 10.616,3.044Z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#bfbfbf"
android:strokeLineCap="round"/>
<path
android:pathData="M12,12.458C13.013,12.458 13.833,11.637 13.833,10.625C13.833,9.613 13.013,8.792 12,8.792C10.988,8.792 10.167,9.613 10.167,10.625C10.167,11.637 10.988,12.458 12,12.458Z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#bfbfbf"
android:strokeLineCap="round"/>
<path
android:pathData="M12,12.458V15.208"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#bfbfbf"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FF000000"
android:pathData="M356.5,649.3c-171.9,0 -311.7,-139.4 -311.7,-310.9S184.6,27.6 356.5,27.6c171.9,0 311.7,139.4 311.7,310.9S528.4,649.3 356.5,649.3zM356.5,115.1c-123.5,0 -224,100.2 -224,223.3 0,123.1 100.5,223.3 224,223.3s224,-100.2 224,-223.3c-0,-123.1 -100.5,-223.3 -224,-223.3zM968.8,973.7c-25.7,25.4 -66.4,26.1 -91,1.4l-334.1,-334.6c-24.6,-24.7 -23.8,-65.2 1.9,-90.7 25.7,-25.4 66.4,-26.1 91,-1.4l334.1,334.6c24.6,24.7 23.8,65.2 -1.9,90.7z"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M873.9,122.2L150.1,122.2C104,122.2 66.6,159.6 66.6,205.8v612.4c0,46.2 37.4,83.6 83.6,83.6h723.8c46.2,0 83.6,-37.4 83.6,-83.6L957.4,205.8c0,-46.1 -37.4,-83.6 -83.6,-83.6zM150.1,177.9h723.8a27.9,27.9 0,0 1,27.8 27.8v327.9c-44.9,-36.8 -122.6,-86.4 -216,-86.4 -86,0 -170.8,66.7 -252.9,131.1 -62.8,49.4 -127.8,100.5 -173.4,100.5 -64,0 -118.7,-47 -137.3,-65L122.2,205.8a27.9,27.9 0,0 1,27.9 -27.9zM873.9,846.1L150.1,846.1a27.9,27.9 0,0 1,-27.9 -27.8v-132.2c33.4,23.6 81.7,48.5 137.3,48.5 64.9,0 134.3,-54.6 207.9,-112.4 74.6,-58.6 151.7,-119.2 218.4,-119.2 119.7,0 214.6,105.3 215.5,106.4l0.4,-0.4v209.3a27.9,27.9 0,0 1,-27.9 27.8z"
android:fillColor="#333333"/>
<path
android:pathData="M297.5,504.1c61.9,0 112.1,-50.2 112.1,-112.1s-50.2,-112.1 -112.1,-112.1c-61.9,0 -112.1,50.2 -112.1,112.1S235.6,504.1 297.5,504.1zM298,335.9c30.8,0 55.8,25 55.8,55.8s-25,55.8 -55.8,55.8 -55.8,-25 -55.8,-55.8c0,-30.8 25,-55.8 55.8,-55.8z"
android:fillColor="#333333"/>
</vector>

View File

@ -0,0 +1,62 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,3L8,7.95"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M3,20.95L8,16"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M21,20.95L16.051,16"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M20.95,3L16,7.95"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M16,3.5V8H20.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M8,3.5V8H3.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M8,20.5V16H3.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
<path
android:pathData="M16,20.5V16H20.449"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#333333"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="19dp"
android:height="18dp"
android:viewportWidth="19"
android:viewportHeight="18">
<path
android:pathData="M16.771,2.826C16.351,2.406 15.852,2.072 15.302,1.845C14.753,1.617 14.165,1.5 13.57,1.5C12.976,1.5 12.387,1.617 11.838,1.845C11.289,2.072 10.79,2.406 10.37,2.826L9.498,3.698L8.626,2.826C7.777,1.977 6.626,1.5 5.425,1.5C4.225,1.5 3.074,1.977 2.225,2.826C1.376,3.675 0.899,4.826 0.899,6.027C0.899,7.227 1.376,8.378 2.225,9.227L3.097,10.099L9.498,16.5L15.899,10.099L16.771,9.227C17.191,8.807 17.525,8.308 17.752,7.759C17.98,7.21 18.097,6.621 18.097,6.027C18.097,5.432 17.98,4.844 17.752,4.294C17.525,3.745 17.191,3.246 16.771,2.826Z"
android:strokeLineJoin="round"
android:strokeWidth="1.64547"
android:fillColor="#353535"
android:strokeColor="#353535"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="19dp"
android:height="18dp"
android:viewportWidth="19"
android:viewportHeight="18">
<path
android:pathData="M16.771,2.826C16.351,2.406 15.852,2.072 15.303,1.845C14.753,1.617 14.165,1.5 13.57,1.5C12.976,1.5 12.387,1.617 11.838,1.845C11.289,2.072 10.79,2.406 10.37,2.826L9.498,3.698L8.626,2.826C7.777,1.977 6.626,1.5 5.425,1.5C4.225,1.5 3.074,1.977 2.225,2.826C1.376,3.675 0.899,4.826 0.899,6.027C0.899,7.227 1.376,8.378 2.225,9.227L3.097,10.099L9.498,16.5L15.899,10.099L16.771,9.227C17.191,8.807 17.525,8.308 17.752,7.759C17.98,7.21 18.097,6.621 18.097,6.027C18.097,5.432 17.98,4.844 17.752,4.294C17.525,3.745 17.191,3.246 16.771,2.826Z"
android:strokeLineJoin="round"
android:strokeWidth="1.64547"
android:fillColor="#00000000"
android:strokeColor="#353535"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/white"/>
</shape>
</item>
<item android:right="-1dp" android:left="-1dp" android:bottom="-1dp">
<shape>
<stroke android:width="1dp" android:color="@color/gray" />
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="17dp"
android:viewportWidth="20"
android:viewportHeight="17">
<path
android:pathData="M6.25,1.333C3.719,1.333 1.667,3.385 1.667,5.917C1.667,10.5 7.083,14.667 10,15.636C12.917,14.667 18.333,10.5 18.333,5.917C18.333,3.385 16.281,1.333 13.75,1.333C12.2,1.333 10.829,2.103 10,3.281C9.171,2.103 7.8,1.333 6.25,1.333Z"
android:strokeLineJoin="round"
android:strokeWidth="1.66667"
android:fillColor="#E83636"
android:strokeColor="#E83636"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="17dp"
android:viewportWidth="20"
android:viewportHeight="17">
<path
android:pathData="M6.25,1.333C3.719,1.333 1.667,3.385 1.667,5.917C1.667,10.5 7.083,14.667 10,15.636C12.917,14.667 18.333,10.5 18.333,5.917C18.333,3.385 16.281,1.333 13.75,1.333C12.2,1.333 10.83,2.103 10,3.281C9.171,2.103 7.8,1.333 6.25,1.333Z"
android:strokeLineJoin="round"
android:strokeWidth="1.66667"
android:fillColor="#D7D7D7"
android:strokeColor="#D7D7D7"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/black"/>
<corners
android:topLeftRadius="46dp"
android:bottomLeftRadius="46dp"
android:bottomRightRadius="46dp"
android:topRightRadius="46dp" />
</shape>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners
android:topLeftRadius="46dp"
android:bottomLeftRadius="46dp"
android:bottomRightRadius="46dp"
android:topRightRadius="46dp" />
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/view_all" />
<corners android:topLeftRadius="80dp"
android:topRightRadius="80dp"
android:bottomRightRadius="80dp"
android:bottomLeftRadius="80dp"/>
</shape>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.AllActivity">
<LinearLayout
android:id="@+id/all_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/all_back"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:background="@drawable/icon_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/all_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/all_rv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="12dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/all_title" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".activity.MainActivity">
<androidx.viewpager.widget.ViewPager
android:id="@+id/main_viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/main_tabLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/main_tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/main_table"
app:layout_constraintBottom_toBottomOf="parent"
app:tabIndicatorHeight="0dp" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.PreViewActivity">
<LinearLayout
android:id="@+id/pre_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/pre_back"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:background="@drawable/icon_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/img_menu"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:background="@drawable/icon_expand"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="6dp"
android:background="@color/gray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/pre_title">
<ProgressBar
android:id="@+id/pre_pg"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center" />
<ImageView
android:id="@+id/pre_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:scaleType="centerCrop" />
<LinearLayout
android:id="@+id/pre_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_marginBottom="16dp"
android:padding="16dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/prew_menu_bg"
android:paddingStart="12dp"
android:paddingTop="4dp"
android:paddingEnd="12dp"
android:paddingBottom="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ProgressBar
android:id="@+id/pg_donwnload"
android:layout_width="30dp"
android:layout_height="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/img_download"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/icon_download"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/prew_menu_bg"
android:paddingStart="16dp"
android:paddingTop="10dp"
android:paddingEnd="16dp"
android:paddingBottom="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ProgressBar
android:id="@+id/pg_setwallpaper"
android:layout_width="30dp"
android:layout_height="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/img_setwallpaper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/setwallpaper_text"
android:textColor="@color/black"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/prew_menu_bg"
android:paddingStart="12dp"
android:paddingTop="4dp"
android:paddingEnd="12dp"
android:paddingBottom="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/img_like"
android:layout_width="30dp"
android:layout_height="26dp"
android:background="@drawable/pre_like_uncheck"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/splash_activity"
tools:context=".activity.SplashActivity">
<androidx.cardview.widget.CardView
android:id="@+id/logo"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginBottom="30dp"
app:cardCornerRadius="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/icon_logo" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="26sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/logo" />
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.LikeFragment">
<TextView
android:layout_marginTop="6dp"
android:id="@+id/like_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/like_title"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:layout_marginTop="6dp"
android:id="@+id/like_rv"
android:layout_width="match_parent"
app:layout_constraintTop_toBottomOf="@id/like_title"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_height="0dp" />
<TextView
android:id="@+id/nolike_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/nolike_tips"
android:textColor="@color/gray"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="16dp"
android:paddingEnd="16dp"
tools:context=".fragment.MainFragment">
<TextView
android:layout_marginTop="6dp"
android:id="@+id/main_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.youth.banner.Banner
android:layout_marginTop="12dp"
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="150dp"
app:layout_constraintTop_toBottomOf="@id/main_title">
</com.youth.banner.Banner>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_rv"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/banner" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/main_list_rv_img"
android:layout_width="200dp"
android:layout_height="150dp"
android:layout_marginEnd="12dp"
android:scaleType="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp">
<TextView
android:id="@+id/main_rv_list_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/view_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/view_all"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/view_all"
android:textColor="@color/black"
android:textSize="12sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="2dp"
android:background="@drawable/icon_go" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_list_rv"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_marginTop="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_all" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -0,0 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.Simplewallpaper" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="gray">#ffaaaaaa</color>
<color name="view_all">#F0F0F0</color>
<color name="load_bg">#D9D9D9</color>
</resources>

View File

@ -0,0 +1,16 @@
<resources>
<string name="app_name">Simple Wallpaper</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="privacy">Privacy Policy</string>
<string name="url_privacy">https://minallcornia.bitbucket.io/privacy.html</string>
<string name="set_successful">Wallpaper settings successful</string>
<string name="set_failed">Failed to set wallpaper</string>
<string name="view_all">View all</string>
<string name="download_successful">Wallpaper download successful</string>
<string name="download_failed">Wallpaper download failed</string>
<string name="permission_tips">Permission denied</string>
<string name="like_title">My favorite</string>
<string name="nolike_tips">At present, you don\'t have a favorite wallpaper \n Go to the homepage and take a look</string>
<string name="setwallpaper_text">Set as wallpaper</string>
</resources>

View File

@ -0,0 +1,15 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.Simplewallpaper" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>
<style name="Theme.Simplewallpaper" parent="Base.Theme.Simplewallpaper" />
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">@android:color/white</item>
<item name="colorOnPrimary">@color/white</item>
<item name="android:statusBarColor" />
</style>
</resources>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

View File

@ -0,0 +1,17 @@
package com.tool.simplewallpaper;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

5
build.gradle.kts Normal file
View File

@ -0,0 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.3" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
}

21
gradle.properties Normal file
View File

@ -0,0 +1,21 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Tue Jun 18 18:21:47 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

185
gradlew vendored Normal file
View File

@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

89
gradlew.bat vendored Normal file
View File

@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

18
settings.gradle.kts Normal file
View File

@ -0,0 +1,18 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Simplewallpaper"
include(":app")