This commit is contained in:
litingting 2024-07-25 15:55:21 +08:00
commit dd13ebfabf
95 changed files with 21238 additions and 0 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
*.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

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

BIN
app/VariousWallpapers.jks Normal file

Binary file not shown.

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

@ -0,0 +1,54 @@
import java.util.Date
import java.text.SimpleDateFormat
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("io.objectbox")
}
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
namespace = "com.nature.free.test"
compileSdk = 34
defaultConfig {
//com.nature.free.variouswallpaper
applicationId = "com.nature.free.variouswallpaper.test"
minSdk = 23
targetSdk = 34
versionCode = 2
versionName = "1.0.1"
setProperty("archivesBaseName", "Various Wallpapers_V" + versionName + "(${versionCode})_$timestamp")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures{
viewBinding = true
}
}
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")
annotationProcessor ("com.github.bumptech.glide:compiler:4.16.0")
}

3
app/keyinfo Normal file
View File

@ -0,0 +1,3 @@
签名文件VariousWallpapers.jks
pwd:VariousWallpapers
alias:VariousWallpaperskey0

View File

@ -0,0 +1,114 @@
{
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
"entities": [
{
"id": "1:1627422590734095773",
"lastPropertyId": "12:3070704555035974675",
"name": "Wallpaper",
"properties": [
{
"id": "1:7511145228095496614",
"name": "id",
"type": 6,
"flags": 1
},
{
"id": "2:3667761380977347882",
"name": "width",
"type": 5
},
{
"id": "3:869121167522503573",
"name": "height",
"type": 5
},
{
"id": "4:36521837047111499",
"name": "sourceWidth",
"type": 5
},
{
"id": "5:2901498186104857190",
"name": "sourceHeight",
"type": 5
},
{
"id": "6:8934645237219230772",
"name": "preview",
"type": 9
},
{
"id": "7:1332387602715302426",
"name": "banner",
"type": 9
},
{
"id": "8:2474967957307949151",
"name": "source",
"type": 9
},
{
"id": "9:8665536133221564863",
"name": "portrait",
"type": 9
},
{
"id": "10:407342973478518292",
"name": "love",
"type": 1
},
{
"id": "11:2047626252877853785",
"name": "categoryId",
"indexId": "1:1121852081873219770",
"type": 11,
"flags": 520,
"relationTarget": "ClassData"
},
{
"id": "12:3070704555035974675",
"name": "porWidthHeight",
"type": 9
}
],
"relations": []
},
{
"id": "2:7218981079515217927",
"lastPropertyId": "3:4807624650221376978",
"name": "ClassData",
"properties": [
{
"id": "1:4411928252157168289",
"name": "id",
"type": 6,
"flags": 1
},
{
"id": "2:4064785904158849196",
"name": "covert",
"type": 9
},
{
"id": "3:4807624650221376978",
"name": "title",
"type": 9
}
],
"relations": []
}
],
"lastEntityId": "2:7218981079515217927",
"lastIndexId": "1:1121852081873219770",
"lastRelationId": "0:0",
"lastSequenceId": "0:0",
"modelVersion": 5,
"modelVersionParserMinimum": 5,
"retiredEntityUids": [],
"retiredIndexUids": [],
"retiredPropertyUids": [],
"retiredRelationUids": [],
"version": 1
}

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

@ -0,0 +1,47 @@
# 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
# 保留Processor类这些类用于在编译时生成ObjectBox需要的代码
-keep @io.objectbox.annotation.processor.Processor class * {
*;
}
# 保留ObjectBox的关键方法和构造函数
-keepclassmembers class * extends io.objectbox.Box {
<init>(...);
<methods>;
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}

View File

@ -0,0 +1,26 @@
package com.nature.free.test;
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.nature.free.test", appContext.getPackageName());
}
}

View File

@ -0,0 +1,45 @@
<?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.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".MyWallpaper"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/icon"
android:supportsRtl="true"
android:theme="@style/Theme.MyWallpaper"
tools:targetApi="31">
<activity
android:name=".WelActivity"
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=".InfoActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".WallPaperActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".MainActivity"
android:exported="false">
</activity>
</application>
</manifest>

17801
app/src/main/assets/info.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
package com.nature.free.test;
import android.os.Bundle;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.nature.free.test.base.BaseFragment;
import com.nature.free.test.data.ClassData;
import com.nature.free.test.data.ClassData_;
import com.nature.free.test.data.Wallpaper;
import com.nature.free.test.databinding.FragmentCategoryBinding;
import com.nature.free.test.databinding.FragmentMainBinding;
import com.nature.free.test.objectbox.ObjectBox;
import com.nature.free.test.other.CategoryAdapter;
import com.nature.free.test.other.MyAdapter;
import com.nature.free.test.other.MyItemSpace;
import java.util.ArrayList;
import java.util.List;
import io.objectbox.query.Query;
public class CategoryFragment extends BaseFragment<FragmentCategoryBinding> {
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private String mParam1;
private String mParam2;
public CategoryFragment() {
// Required empty public constructor
}
public static CategoryFragment newInstance() {
CategoryFragment fragment = new CategoryFragment();
Bundle args = new Bundle();
// args.putString(ARG_PARAM1, param1);
// args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
protected FragmentCategoryBinding getFragmentVb() {
return FragmentCategoryBinding.inflate(getLayoutInflater());
}
@Override
protected void initView() {
List<ClassData> classData = new ArrayList<>();
List<ClassData> all = ObjectBox.getBoxBeanCategory().getAll();
for(ClassData data :all){
if(!data.getTitle().equals("Newest")){
classData.add(data);
}
}
CategoryAdapter myAdapter = new CategoryAdapter(requireContext(), classData);
fragmentVb.recyclerClass.setLayoutManager(new LinearLayoutManager(requireContext()));
fragmentVb.recyclerClass.setAdapter(myAdapter);
// fragmentVb.recycler.addItemDecoration(new MyItemSpace(Utils.INSTANCE.dpToPx(5),Utils.INSTANCE.dpToPx(5),0));
}
}

View File

@ -0,0 +1,80 @@
package com.nature.free.test;
import android.os.Bundle;
import android.view.View;
import androidx.recyclerview.widget.GridLayoutManager;
import com.nature.free.test.base.BaseActivity;
import com.nature.free.test.data.ClassData;
import com.nature.free.test.data.ClassData_;
import com.nature.free.test.data.Wallpaper;
import com.nature.free.test.databinding.ActivityInfoBinding;
import com.nature.free.test.objectbox.ObjectBox;
import com.nature.free.test.other.MyAdapter;
import com.nature.free.test.other.MyItemSpace;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import io.objectbox.query.Query;
public class InfoActivity extends BaseActivity<ActivityInfoBinding> {
private MyAdapter myAdapter;
private long classID;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
init();
mainBinding.back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
@Override
protected ActivityInfoBinding getMainBinding() {
return ActivityInfoBinding.inflate(getLayoutInflater());
}
private void init() {
classID = getIntent().getLongExtra(MyWallpaper.KEY_CATGORY_DATA, 0l);
ClassData classData = getData();
if (classData != null) {
mainBinding.tvName.setText(classData.getTitle());
myAdapter = new MyAdapter(this,false);
myAdapter.refresh(classData.info);
mainBinding.recycler.setLayoutManager(new GridLayoutManager(this, 2));
mainBinding.recycler.setAdapter(myAdapter);
mainBinding.recycler.addItemDecoration(new MyItemSpace(Utils.INSTANCE.dpToPx(5), Utils.INSTANCE.dpToPx(5), 0));
}
}
@Override
protected void onResume() {
super.onResume();
if (myAdapter != null) {
myAdapter.refresh(getData().info);
}
}
private ClassData getData() {
Query<ClassData> build = ObjectBox.getBoxBeanCategory().query(ClassData_.id.equal(classID)).build();
ClassData data = build.findFirst();
build.close();
return data;
}
}

View File

@ -0,0 +1,118 @@
package com.nature.free.test;
import android.Manifest;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.nature.free.test.base.BaseActivity;
import com.nature.free.test.databinding.ActivityMainBinding;
import com.nature.free.test.objectbox.ObjectBox;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends BaseActivity<ActivityMainBinding> {
private List<Fragment> list;
@Override
protected ActivityMainBinding getMainBinding() {
return ActivityMainBinding.inflate(getLayoutInflater());
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initUi();
bindVpTab();
}
private void initUi() {
list = new ArrayList<>();
list.add(MainFragment.newInstance(false));
list.add(CategoryFragment.newInstance());
list.add(MainFragment.newInstance(true));
for (int j = 0; j < list.size(); j++) {
TabLayout.Tab tab = mainBinding.tab.newTab();
View inflate = LayoutInflater.from(this).inflate(R.layout.tab_item_view, null);
ImageView imageViewTab = inflate.findViewById(R.id.tabIm);
if (j == 0) {
imageViewTab.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.selector_ichome));
} else if (j == 1) {
imageViewTab.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.selector_iccategory));
} else if (j == 2) {
imageViewTab.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.selector_iclove));
}
tab.setCustomView(inflate);
mainBinding.tab.addTab(tab);
}
mainBinding.viewP2.setAdapter(new FragmentStateAdapter(this) {
@NonNull
@Override
public Fragment createFragment(int position) {
return list.get(position);
}
@Override
public int getItemCount() {
return list.size();
}
});
}
private void bindVpTab() {
mainBinding.viewP2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override
public void onPageSelected(int position) {
super.onPageSelected(position);
mainBinding.tab.getTabAt(position).select();
}
});
mainBinding.tab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
View customView = tab.getCustomView();
ImageView imageViewTab = customView.findViewById(R.id.tabIm);
imageViewTab.setSelected(true);
int position = tab.getPosition();
mainBinding.viewP2.setCurrentItem(position);
if (position == 2 || position == 0) {
MainFragment fragment = (MainFragment) list.get(position);
fragment.refresh();
}
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
View customView = tab.getCustomView();
ImageView imageViewTab = customView.findViewById(R.id.tabIm);
imageViewTab.setSelected(false);
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
}

View File

@ -0,0 +1,144 @@
package com.nature.free.test;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import androidx.recyclerview.widget.GridLayoutManager;
import com.nature.free.test.base.BaseFragment;
import com.nature.free.test.data.ClassData;
import com.nature.free.test.data.ClassData_;
import com.nature.free.test.data.Wallpaper;
import com.nature.free.test.data.Wallpaper_;
import com.nature.free.test.databinding.FragmentMainBinding;
import com.nature.free.test.objectbox.ObjectBox;
import com.nature.free.test.other.MyAdapter;
import com.nature.free.test.other.MyItemSpace;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import io.objectbox.query.Query;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
public class MainFragment extends BaseFragment<FragmentMainBinding> {
private static final String ARG_PARAM1 = "param1";
private boolean love;
private MyAdapter myAdapter;
public MainFragment() {
// Required empty public constructor
}
public static MainFragment newInstance(Boolean isLove) {
MainFragment fragment = new MainFragment();
Bundle args = new Bundle();
args.putBoolean(ARG_PARAM1, isLove);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
love = getArguments().getBoolean(ARG_PARAM1);
}
}
@Override
protected FragmentMainBinding getFragmentVb() {
return FragmentMainBinding.inflate(getLayoutInflater());
}
@Override
protected void initView() {
List<Wallpaper> info = new ArrayList<>();
myAdapter = new MyAdapter(requireContext(),love);
if (love) {
info.addAll(getLoves());
myAdapter.onClickAction(new Function0<Unit>() {
@Override
public Unit invoke() {
myAdapter.refresh(getLoves());
return null;
}
});
} else {
Query<ClassData> newest = ObjectBox.getBoxBeanCategory().query(ClassData_.title.equal("Newest")).build();
ClassData beans = newest.findFirst();
newest.close();
if (beans != null){
info.addAll(beans.info);
}
}
fragmentVb.recycler.setLayoutManager(new GridLayoutManager(requireContext(), 2));
myAdapter.refresh(info);
fragmentVb.recycler.setAdapter(myAdapter);
fragmentVb.recycler.addItemDecoration(new MyItemSpace(Utils.INSTANCE.dpToPx(5), Utils.INSTANCE.dpToPx(5), 0));
}
public void refresh() {
if (love & myAdapter != null) {
myAdapter.refresh(getLoves());
}
if (!love && myAdapter != null) {
myAdapter.refresh(getMain());
}
}
private List<Wallpaper> getMain() {
List<Wallpaper> data = new ArrayList<>();
Query<ClassData> newest = ObjectBox.getBoxBeanCategory().query(ClassData_.title.equal("Newest")).build();
ClassData beans = newest.findFirst();
newest.close();
if (beans != null) {
data.addAll(beans.info);
}
return data;
}
private List<Wallpaper> getLoves() {
Query<Wallpaper> build = ObjectBox.getBoxBean().query(Wallpaper_.love.equal(true)).build();
List<Wallpaper> wallpapers = build.find();
build.close();
if(wallpapers.size()>0){
setEmptyView(true);
}else {
setEmptyView(false);
}
return wallpapers;
}
private void setEmptyView(boolean hasData){
if(hasData){
fragmentVb.emptyTv.setVisibility(View.GONE);
fragmentVb.recycler.setVisibility(View.VISIBLE);
}else {
fragmentVb.emptyTv.setVisibility(View.VISIBLE);
fragmentVb.recycler.setVisibility(View.GONE);
}
}
}

View File

@ -0,0 +1,43 @@
package com.nature.free.test
import android.app.Application
import com.nature.free.test.data.ClassData
import com.nature.free.test.objectbox.ObjectBox
class MyWallpaper : Application() {
companion object {
lateinit var globalContext: MyWallpaper
lateinit var data: List<ClassData>
const val KEY_CATGORY_DATA = "category_data"
const val KEY_COLOR = "color"
const val KEY_WALLPAPER = "wallpaper"
const val TYPE_DISSMISS = 0
const val TYPE_LOCK = 1
const val TYPE_HOME = 2
const val TYPE_BOTH = 3
const val BITMAP_FILE_DIRECTORY = "MyWallpaper"
}
override fun onCreate() {
super.onCreate()
globalContext = this
ObjectBox.init(this)
if (ObjectBox.getBoxBean().all.size <= 0) {
init()
}
}
private fun init() {
val openFile = Utils.openFile(assets.open("info.json"))
data = Utils.getData(openFile)
}
}

View File

@ -0,0 +1,286 @@
package com.nature.free.test
import android.app.Activity
import android.content.ContentValues
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Bitmap
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import android.text.format.DateUtils
import android.util.Log
import android.widget.ProgressBar
import android.widget.Toast
import androidx.core.app.ActivityCompat
import androidx.core.view.isVisible
import com.nature.free.test.data.ClassData
import com.nature.free.test.data.Wallpaper
import com.nature.free.test.objectbox.ObjectBox
import org.json.JSONArray
import java.io.BufferedReader
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
import java.io.StringWriter
import java.math.BigInteger
import java.nio.charset.StandardCharsets
import java.security.MessageDigest
import java.security.NoSuchAlgorithmException
object Utils {
fun openFile(input: InputStream): String {
val stringWriter = StringWriter()
val charArray = CharArray(input.available())
var l = 0;
val bufReader = BufferedReader(InputStreamReader(input, StandardCharsets.UTF_8))
while (bufReader.read(charArray).also {
l = it
} != -1) {
stringWriter.write(charArray, 0, l)
}
return stringWriter.toString()
}
fun getData(jsonString: String): List<ClassData> {
var data = mutableListOf<ClassData>()
val array = JSONArray(jsonString)
for (i in 0 until array.length()) {
val any = array.getJSONObject(i)
val title = any.getString("title")
val covertValue = any.getString("covert")
val jsonArray = any.getJSONArray("info")
var infoModels = mutableListOf<Wallpaper>()
for (k in 0 until jsonArray.length()) {
val jsonObject = jsonArray.getJSONObject(k)
val preview = jsonObject.getString("preview")
val source = jsonObject.getString("source")
val portraitValue = jsonObject.getString("portrait")
val banneValue = jsonObject.getString("banner")
val stringWh = jsonObject.getString("porWidthHeight")
val wallpaper = Wallpaper(
porWidthHeight = stringWh,
preview = preview,
width = 0,
height = 0,
sourceWidth = 0,
sourceHeight = 0,
source = source,
banner = banneValue,
portrait = portraitValue,
love = false
)
infoModels.add(wallpaper)
ObjectBox.getBoxBean().put(wallpaper)
}
val indexOfFirst = infoModels.indexOfFirst { it.banner != "" }
var tempCovert = infoModels[indexOfFirst].banner.toString()
Log.d("-------------tt", "-----------tempCovert=$tempCovert title=$title")
val classData = ClassData(covert = covertValue, title = title)
classData.info.addAll(infoModels)
ObjectBox.getBoxBeanCategory().put(classData)
data.add(classData)
}
return data
}
fun dpToPx(dp: Int): Int {
val scale: Float = MyWallpaper.globalContext.resources.displayMetrics.density
return (dp * scale + 0.5f).toInt()
}
fun pxToDp(dp: Int): Int {
val scale: Float = MyWallpaper.globalContext.resources.displayMetrics.density
return (dp / scale + 0.5f).toInt()
}
private fun checkPermission(context: Context, permissions: Array<String>): Boolean {
var result = true
for (per in permissions) {
if (ActivityCompat.checkSelfPermission(
context,
per
) != PackageManager.PERMISSION_GRANTED
) {
result = false
}
}
return result
}
fun setWallpaperToast(context: Activity, isSuccess: Boolean, pb: ProgressBar) {
if (isSuccess) {
context.runOnUiThread {
Toast.makeText(
context,
context.getString(R.string.success),
Toast.LENGTH_SHORT
).show()
pb.isVisible = false
}
} else {
context.runOnUiThread {
Toast.makeText(
context,
context.getString(R.string.fail),
Toast.LENGTH_SHORT
).show()
pb.isVisible = false
}
}
}
fun getRealUrl(old: String?): String {
if (old == null || old == "null") {
return ""
}
val lastIndexOf = old.lastIndexOf(".")
val substring = old.substring(lastIndexOf)
val mD5Hash = getMD5Hash(old)
return if (mD5Hash != null) {
"https://resource-sg-public.lux-ad.com/wallpaper/$mD5Hash$substring"
} else {
""
}
}
fun getMD5Hash(input: String): String? {
try {
val md = MessageDigest.getInstance("MD5")
val hashBytes = md.digest(input.toByteArray())
val bigInt = BigInteger(1, hashBytes)
var md5Hash = bigInt.toString(16)
while (md5Hash.length < 32) {
md5Hash = "0$md5Hash"
}
return md5Hash
} catch (e: NoSuchAlgorithmException) {
return null
}
}
// 保存bitmap到相册并兼容AndroidQ
fun saveBitmap(
context: Context,
bitmap: Bitmap?,
fileName: String,
imageType: String
): Boolean {
if (bitmap == null) {
return false
}
val isSaveSuccess: Boolean = if (Build.VERSION.SDK_INT < 29) {
saveImageToGallery(context, bitmap, fileName + imageType)
} else {
saveImageToGalleryQ(context, bitmap, fileName)
}
return isSaveSuccess
}
private 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) {
return false
}
}
private fun saveImageToGalleryQ(
context: Context,
image: Bitmap,
mImageFileName: String
): Boolean {
val mImageTime = System.currentTimeMillis()
// val mImageFileName: String = getCharacterAndNumber() + ".png"
val values = ContentValues()
values.put(MediaStore.MediaColumns.RELATIVE_PATH, getBitmapFileDir())
values.put(MediaStore.MediaColumns.DISPLAY_NAME, mImageFileName)
values.put(MediaStore.MediaColumns.MIME_TYPE, "image/png")
values.put(MediaStore.MediaColumns.DATE_ADDED, mImageTime / 1000)
values.put(MediaStore.MediaColumns.DATE_MODIFIED, mImageTime / 1000)
values.put(
MediaStore.MediaColumns.DATE_EXPIRES,
(mImageTime + DateUtils.DAY_IN_MILLIS) / 1000
)
values.put(MediaStore.MediaColumns.IS_PENDING, 1)
val resolver = context.contentResolver
val uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values)
try {
val out = resolver.openOutputStream(uri!!)
if (!image.compress(Bitmap.CompressFormat.PNG, 100, out!!)) {
return false
}
values.clear()
values.put(MediaStore.MediaColumns.IS_PENDING, 0)
values.putNull(MediaStore.MediaColumns.DATE_EXPIRES)
resolver.update(uri, values, null, null)
return true
} catch (e: java.lang.Exception) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
resolver.delete(uri!!, null)
}
return false
}
}
private fun getBitmapFileDir(): String {
return if (Build.VERSION.SDK_INT < 29) {
Environment.getExternalStorageDirectory().absolutePath + File.separator + MyWallpaper.BITMAP_FILE_DIRECTORY
} else {
Environment.DIRECTORY_PICTURES + File.separator + MyWallpaper.BITMAP_FILE_DIRECTORY
}
}
}

View File

@ -0,0 +1,424 @@
package com.nature.free.test;
import android.Manifest;
import android.app.Dialog;
import android.app.WallpaperManager;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
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.nature.free.test.base.BaseActivity;
import com.nature.free.test.data.Wallpaper;
import com.nature.free.test.data.Wallpaper_;
import com.nature.free.test.databinding.ActivityWallpaperBinding;
import com.nature.free.test.objectbox.ObjectBox;
import com.nature.free.test.other.DialogSet;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import io.objectbox.query.Query;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
public class WallPaperActivity extends BaseActivity<ActivityWallpaperBinding> implements View.OnClickListener {
private Wallpaper mWallpaper;
private DialogSet dialogSet;
private String[] permission;
private Handler mHandler;
private WallpaperManager wallpaperManager;
private File mFilePro1;
private File mFileSource;
private Dialog dialogLoading;
private Bitmap mBitmapPro1;
private Bitmap mBitmapSource;
private String SuffixPortrait;
private String SuffixSource;
private long tempId;
private Bitmap curBitMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
statusbar();
int intExtra = getIntent().getIntExtra(MyWallpaper.KEY_COLOR, getColor(R.color.main_bg));
tempId = getIntent().getLongExtra(MyWallpaper.KEY_WALLPAPER, 1);
mWallpaper = getmWallpaper();
mainBinding.love.setSelected(mWallpaper.getLove());
dialogLoading = new Dialog(this);
dialogLoading.setCancelable(false);
dialogLoading.setContentView(R.layout.dialog_loading);
onUi();
onClick();
wallpaperManager = WallpaperManager.getInstance(this);
mHandler = new Handler();
int maxHeapSize = (int) (Runtime.getRuntime().maxMemory() / 1024 / 1024);
}
private Wallpaper getmWallpaper() {
Query<Wallpaper> build = ObjectBox.getBoxBean().query(Wallpaper_.id.equal(tempId)).build();
Wallpaper wallpapers = build.findFirst();
build.close();
return wallpapers;
}
private void onClick() {
mainBinding.check1.setOnClickListener(this);
mainBinding.check2.setOnClickListener(this);
mainBinding.back.setOnClickListener(this);
mainBinding.setWallpaper.setOnClickListener(this);
mainBinding.save.setOnClickListener(this);
mainBinding.love.setOnClickListener(this);
}
private void showDialog() {
if (dialogSet == null) {
dialogSet = DialogSet.newInstance();
dialogSet.onSetListener(new Function1<Integer, Unit>() {
@Override
public Unit invoke(Integer integer) {
switch (integer) {
case MyWallpaper.TYPE_DISSMISS:
break;
case MyWallpaper.TYPE_BOTH:
apply(-1);
break;
case MyWallpaper.TYPE_HOME:
apply(WallpaperManager.FLAG_SYSTEM);
break;
case MyWallpaper.TYPE_LOCK:
apply(WallpaperManager.FLAG_LOCK);
break;
}
return null;
}
});
}
dialogSet.show(getSupportFragmentManager(), "");
}
private void apply(int which) {
mainBinding.load.setVisibility(View.VISIBLE);
if (mainBinding.check1.isSelected()) {
setmWallpaper(which, mBitmapPro1);
} else if (mainBinding.check2.isSelected()) {
setmWallpaper(which, mBitmapSource);
}
}
private void setmWallpaper(int which, Bitmap bitmap) {
if (bitmap == null) {
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false,mainBinding.load);
// mainBinding.load.setVisibility(View.GONE);
return;
}
// FileInputStream fileInputStream = new FileInputStream(bitmap.getAbsolutePath());
mHandler.post(new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
try {
wallpaperManager.setBitmap(bitmap);
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, true,mainBinding.load);
// mainBinding.load.setVisibility(View.GONE);
} catch (IOException e) {
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false,mainBinding.load);
// mainBinding.load.setVisibility(View.GONE);
}
} else {
try {
if (which == -1) {
wallpaperManager.setBitmap(bitmap);
} else {
wallpaperManager.setBitmap(
bitmap,
null,
true,
which
);
}
// mainBinding.load.setVisibility(View.GONE);
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, true,mainBinding.load);
} catch (IOException e) {
// mainBinding.load.setVisibility(View.GONE);
Utils.INSTANCE.setWallpaperToast(WallPaperActivity.this, false,mainBinding.load);
}
}
}
});
}
private void onUi() {
if (!mWallpaper.getSource().equals("null")) {
String source = mWallpaper.getSource();
int index = source.lastIndexOf("-");
int indexLast = source.lastIndexOf(".");
String substring = source.substring(index + 1, indexLast);
SuffixSource = source.substring(indexLast);
Log.d("--------------tt", "-----------source SuffixSource=" + SuffixSource);
mainBinding.tvWh2.setText(substring);
}
if (!mWallpaper.getPortrait().equals("null")) {
String portrait = mWallpaper.getPortrait();
int index = portrait.lastIndexOf("-");
int indexLast = portrait.lastIndexOf(".");
String substring = portrait.substring(index + 1, indexLast);
SuffixPortrait = portrait.substring(indexLast);
Log.d("--------------tt", "-----------getPortrait SuffixPortrait=" + SuffixPortrait);
mainBinding.tvWh1.setText(mWallpaper.getPorWidthHeight());
loadIM1();
}
mainBinding.check1.setSelected(true);
}
private Boolean saveAlbum() {
String imageType = "";
Bitmap bitmap = null;
if (mainBinding.check1.isSelected()) {
imageType = SuffixPortrait;
} else if (mainBinding.check2.isSelected()) {
imageType = SuffixSource;
}
bitmap = curBitMap;
if (bitmap == null) {
return false;
}
boolean b = Utils.INSTANCE.saveBitmap(this, bitmap, String.valueOf(System.currentTimeMillis()), imageType);
Log.d("--------------tt", "--------saveBitmap=" + b);
return b;
}
@Override
protected ActivityWallpaperBinding getMainBinding() {
return ActivityWallpaperBinding.inflate(getLayoutInflater());
}
private void statusbar() {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN);
}
private void loadIM1() {
mainBinding.load.setVisibility(View.VISIBLE);
Glide.with(this)
.asBitmap()
.load(mWallpaper.getPortrait())
.thumbnail(0.1f)
.addListener(new RequestListener<Bitmap>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Bitmap> target, boolean isFirstResource) {
mainBinding.load.setVisibility(View.GONE);
Toast.makeText(
WallPaperActivity.this,
getString(R.string.load_fail),
Toast.LENGTH_SHORT
).show();
return false;
}
@Override
public boolean onResourceReady(@NonNull Bitmap resource, @NonNull Object model, Target<Bitmap> target, @NonNull DataSource dataSource, boolean isFirstResource) {
// mBitmapPro1 = Utils.INSTANCE.fileToBitMap(mFilePro1.getAbsolutePath());
if (curBitMap != null && !curBitMap.isRecycled())
curBitMap.recycle();
curBitMap = resource.copy(Bitmap.Config.ARGB_8888, true);
mBitmapPro1 = resource;
setCheckPos(0);
mainBinding.load.setVisibility(View.GONE);
mainBinding.image.setImageBitmap(mBitmapPro1);
// if (mBitmapPro1 != null) {
//
// } else {
// mainBinding.load.setVisibility(View.GONE);
// Toast.makeText(
// WallPaperActivity.this,
// getString(R.string.load_fail),
// Toast.LENGTH_SHORT
// ).show();
// }
return false;
}
}).preload();
}
// private void loadBitMap2() {
// mainBinding.load.setVisibility(View.VISIBLE);
// Glide.with(this)
// .asBitmap()
// .load(mWallpaper.getSource())
// .thumbnail(0.1f)
// .addListener(new RequestListener<Bitmap>() {
//
//
// @Override
// public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Bitmap> target, boolean isFirstResource) {
// mainBinding.load.setVisibility(View.GONE);
// Toast.makeText(
// WallPaperActivity.this,
// getString(R.string.load_fail),
// Toast.LENGTH_SHORT
// ).show();
// return false;
// }
//
// @Override
// public boolean onResourceReady(@NonNull Bitmap resource, @NonNull Object model, Target<Bitmap> target, @NonNull DataSource dataSource, boolean isFirstResource) {
//// mBitmapPro1 = Utils.INSTANCE.fileToBitMap(mFilePro1.getAbsolutePath());
// mBitmapSource = resource;
// if (curBitMap != null && !curBitMap.isRecycled())
// curBitMap.recycle();
// curBitMap = resource.copy(Bitmap.Config.ARGB_8888, true);
// setCheckPos(1);
// mainBinding.load.setVisibility(View.GONE);
// mainBinding.image.setImageBitmap(mBitmapSource);
//
//
//// if (mBitmapPro1 != null) {
////
//// } else {
//// mainBinding.load.setVisibility(View.GONE);
//// Toast.makeText(
//// WallPaperActivity.this,
//// getString(R.string.load_fail),
//// Toast.LENGTH_SHORT
//// ).show();
//// }
// return false;
// }
//
// }).preload();
//
//
// }
private void setCheckPos(int pos) {
if (pos == 0) {
mainBinding.check1.setSelected(true);
mainBinding.check2.setSelected(false);
} else {
mainBinding.check1.setSelected(false);
mainBinding.check2.setSelected(true);
}
}
@Override
public void onClick(View v) {
if (v.equals(mainBinding.back)) {
finish();
} else if (v.equals(mainBinding.check1)) {
if (mBitmapPro1 != null) {
setCheckPos(0);
mainBinding.image.setImageBitmap(mBitmapPro1);
} else {
loadIM1();
}
} else if (v.equals(mainBinding.save)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
save();
} else {
permission = new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE};
ActivityCompat.requestPermissions(this, permission, 0);
}
} else if (v.equals(mainBinding.setWallpaper)) {
showDialog();
} else if (v.equals(mainBinding.love)) {
mainBinding.love.setSelected(!mainBinding.love.isSelected());
mWallpaper.setLove(mainBinding.love.isSelected());
ObjectBox.getBoxBean().put(mWallpaper);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 0) {
boolean b = (ContextCompat.checkSelfPermission(WallPaperActivity.this, permission[0]) == PackageManager.PERMISSION_GRANTED);
if (b) {
save();
} else {
Toast.makeText(
this,
getString(R.string.save_fail),
Toast.LENGTH_SHORT
).show();
}
}
}
private void save() {
mainBinding.load.setVisibility(View.VISIBLE);
Boolean aBoolean = saveAlbum();
if (aBoolean) {
Toast.makeText(
this,
getString(R.string.save_success),
Toast.LENGTH_SHORT
).show();
} else {
Toast.makeText(
this,
getString(R.string.save_fail),
Toast.LENGTH_SHORT
).show();
}
mainBinding.load.setVisibility(View.GONE);
}
}

View File

@ -0,0 +1,39 @@
package com.nature.free.test;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import com.nature.free.test.base.BaseActivity;
import com.nature.free.test.databinding.ActivityWelBinding;
public class WelActivity extends BaseActivity<ActivityWelBinding> {
private long time = 2000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new CountDownTimer(time,500){
@Override
public void onTick(long millisUntilFinished) {
}
@Override
public void onFinish() {
startActivity(new Intent(WelActivity.this,MainActivity.class));
finish();
}
}.start();
}
@Override
protected ActivityWelBinding getMainBinding() {
return ActivityWelBinding.inflate(getLayoutInflater());
}
}

View File

@ -0,0 +1,22 @@
package com.nature.free.test.base;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewbinding.ViewBinding;
import com.nature.free.test.R;
import com.nature.free.test.databinding.ActivityMainBinding;
public abstract class BaseActivity<T extends ViewBinding> extends AppCompatActivity {
protected T mainBinding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mainBinding = getMainBinding();
setContentView(mainBinding.getRoot());
}
protected abstract T getMainBinding();
}

View File

@ -0,0 +1,31 @@
package com.nature.free.test.base;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.viewbinding.ViewBinding;
import com.nature.free.test.R;
public abstract class BaseFragment<T extends ViewBinding> extends Fragment {
protected T fragmentVb;
public BaseFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
fragmentVb = getFragmentVb();
initView();
return fragmentVb.getRoot();
}
protected abstract T getFragmentVb();
protected abstract void initView();
}

View File

@ -0,0 +1,19 @@
package com.nature.free.test.data
import io.objectbox.annotation.Backlink
import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
import io.objectbox.relation.ToMany
@Entity
class ClassData @JvmOverloads constructor(
@Id
var id: Long = 0,
var covert: String?, var title: String,
) {
@Backlink(to="category")
lateinit var info: ToMany<Wallpaper>
}

View File

@ -0,0 +1,26 @@
package com.nature.free.test.data
import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id
import io.objectbox.relation.ToOne
import java.io.Serializable
@Entity
class Wallpaper constructor (
@Id
var id: Long = 0,
var width: Int = 0,
var height: Int = 0,
var sourceWidth: Int = 0,
var sourceHeight: Int = 0,
var porWidthHeight: String ="",
var preview: String = "",
var banner: String?= "",
var source: String= "",
var portrait: String= "",
var love: Boolean = false,
) : Serializable {
lateinit var category: ToOne<ClassData>
}

View File

@ -0,0 +1,30 @@
package com.nature.free.test.objectbox;
import android.content.Context;
import com.nature.free.test.data.ClassData;
import com.nature.free.test.data.MyObjectBox;
import com.nature.free.test.data.Wallpaper;
import io.objectbox.Box;
import io.objectbox.BoxStore;
public class ObjectBox {
private static BoxStore store;
public static void init(Context context) {
store = MyObjectBox.builder()
.androidContext(context)
.build();
}
public static Box<Wallpaper> getBoxBean(){
return store.boxFor(Wallpaper.class);
}
public static Box<ClassData> getBoxBeanCategory(){
return store.boxFor(ClassData.class);
}
}

View File

@ -0,0 +1,105 @@
package com.nature.free.test.other
import android.content.Context
import android.content.Intent
import android.graphics.drawable.Drawable
import android.util.Log
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
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.Target
import com.nature.free.test.InfoActivity
import com.nature.free.test.MyWallpaper
import com.nature.free.test.R
import com.nature.free.test.data.ClassData
import com.nature.free.test.databinding.ItemCateogryAdapterBinding
class CategoryAdapter constructor(private var context: Context, private var data: List<ClassData>) :
RecyclerView.Adapter<CategoryAdapter.MyVh>() {
private var Imheight: Int = 0
private var loveColor = intArrayOf(
R.color.main_love_bg1,
R.color.main_love_bg2,
R.color.main_love_bg3,
R.color.main_love_bg4
)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyVh {
val inflate =
ItemCateogryAdapterBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return MyVh(inflate)
}
override fun getItemCount(): Int = data.size
override fun onBindViewHolder(holder: MyVh, position: Int) {
var tempCovert = ""
data[position].run {
// if (covert == null) {
// val indexOfFirst = info.indexOfFirst { it.banner != null && it.banner != "null" }
// tempCovert = info[indexOfFirst].banner.toString()
// Log.d(
// "------------tt",
// "-------111-data[position].title =${title} indexOfFirst=$indexOfFirst"
// )
// } else {
// tempCovert = covert.toString()
// }
tempCovert = covert.toString()
holder.vb.name.text = title
holder.vb.classItem.setOnClickListener {
context.startActivity(Intent(context, InfoActivity::class.java).apply {
putExtra(MyWallpaper.KEY_CATGORY_DATA, id)
})
}
}
Glide.with(context).load(tempCovert)
.placeholder(R.mipmap.icon)
.listener(object : RequestListener<Drawable> {
override fun onLoadFailed(
e: GlideException?,
model: Any?,
target: Target<Drawable>,
isFirstResource: Boolean
): Boolean {
Log.d("------------tt", "-----onLoadFailed---covert=$tempCovert ")
return false
}
override fun onResourceReady(
resource: Drawable,
model: Any,
target: Target<Drawable>?,
dataSource: DataSource,
isFirstResource: Boolean
): Boolean {
return false
}
})
.error(R.mipmap.icon).into(holder.vb.covertIm)
}
inner class MyVh(var vb: ItemCateogryAdapterBinding) : RecyclerView.ViewHolder(vb.root) {
}
}

View File

@ -0,0 +1,89 @@
package com.nature.free.test.other
import android.content.DialogInterface
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.Window
import android.view.WindowManager
import androidx.fragment.app.DialogFragment
import com.nature.free.test.MyWallpaper
import com.nature.free.test.R
import com.nature.free.test.databinding.FragmentDialogSetBinding
class DialogSet : DialogFragment() {
private var param1: String? = null
private var param2: String? = null
private lateinit var dialogVb: FragmentDialogSetBinding
private lateinit var mylistener:(Int)->Unit
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
dialogVb = FragmentDialogSetBinding.inflate(inflater, container, false)
init()
return dialogVb.root
}
fun onSetListener(listener:(Int)->Unit){
mylistener = listener
}
private fun init() {
isCancelable = true
val window = dialog!!.window
window!!.setBackgroundDrawableResource(R.color.trans)
window.decorView.setPadding(0, 0, 0, 0)
initBar(window)
val wlp = window.attributes
wlp.gravity = Gravity.CENTER
wlp.width = WindowManager.LayoutParams.MATCH_PARENT
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT
window.attributes = wlp
dialogVb.imclose.setOnClickListener {
dismiss()
mylistener.invoke(MyWallpaper.TYPE_DISSMISS)
}
dialogVb.tvBoth.setOnClickListener {
dismiss()
mylistener.invoke(MyWallpaper.TYPE_BOTH)
}
dialogVb.tvhome.setOnClickListener {
dismiss()
mylistener.invoke(MyWallpaper.TYPE_HOME)
}
dialogVb.tvlock.setOnClickListener {
dismiss()
mylistener.invoke(MyWallpaper.TYPE_LOCK)
}
}
override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
mylistener.invoke(MyWallpaper.TYPE_DISSMISS)
}
private fun initBar(window:Window) {
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN
}
companion object {
@JvmStatic
fun newInstance() = DialogSet()
}
}

View File

@ -0,0 +1,146 @@
package com.nature.free.test.other
import android.content.Context
import android.content.Intent
import android.graphics.drawable.Drawable
import android.util.Log
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
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.Target
import com.nature.free.test.MyWallpaper
import com.nature.free.test.R
import com.nature.free.test.Utils
import com.nature.free.test.Utils.pxToDp
import com.nature.free.test.WallPaperActivity
import com.nature.free.test.data.Wallpaper
import com.nature.free.test.databinding.ItemMyAdapterBinding
import com.nature.free.test.objectbox.ObjectBox
class MyAdapter constructor(private var context: Context, private var mLove: Boolean = false) :
RecyclerView.Adapter<MyAdapter.MyVh>() {
private var Imheight: Int = 0
private var action: (() -> Unit?)? = null
private var loveColor = intArrayOf(
R.color.main_love_bg1,
R.color.main_love_bg2,
R.color.main_love_bg3,
R.color.main_love_bg4
)
private var data: List<Wallpaper> = emptyList()
fun refresh(newData: List<Wallpaper>) {
var old: List<Wallpaper> = data
data = newData
val diffResult = DiffUtil.calculateDiff(Diff(old, data))
diffResult.dispatchUpdatesTo(this)
}
fun onClickAction(myaction: () -> Unit) {
action = myaction
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyVh {
val inflate =
ItemMyAdapterBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return MyVh(inflate)
}
override fun getItemCount(): Int = data.size
override fun onBindViewHolder(holder: MyVh, position: Int) {
val wallpaper = data[position]
if(mLove){
holder.vb.loveItem.isVisible = false
}
val mD5Hash = Utils.getMD5Hash(wallpaper.preview)
val realUrl = Utils.getRealUrl(wallpaper.preview)
var url = wallpaper.preview
Glide.with(context).load(url)
.listener(object : RequestListener<Drawable> {
override fun onLoadFailed(
e: GlideException?,
model: Any?,
target: Target<Drawable>,
isFirstResource: Boolean
): Boolean {
Log.d("------------tt", "--------onLoadFailed" + e?.message)
return false
}
override fun onResourceReady(
resource: Drawable,
model: Any,
target: Target<Drawable>?,
dataSource: DataSource,
isFirstResource: Boolean
): Boolean {
return false
}
})
.placeholder(R.mipmap.icon)
.error(R.mipmap.icon).into(holder.vb.previewIm)
holder.vb.imLove.isSelected = wallpaper.love
holder.vb.imLove.setOnClickListener {
holder.vb.imLove.isSelected = !holder.vb.imLove.isSelected
wallpaper.love = holder.vb.imLove.isSelected
val boxBean = ObjectBox.getBoxBean()
boxBean.put(wallpaper)
action?.invoke()
}
val color = context.getColor(loveColor[position % 4])
holder.vb.loveItem.setBackgroundColor(context.getColor(loveColor[position % 4]))
holder.vb.root.setOnClickListener {
context.startActivity(Intent(context, WallPaperActivity::class.java).apply {
putExtra(MyWallpaper.KEY_COLOR, color)
putExtra(MyWallpaper.KEY_WALLPAPER, wallpaper.id)
})
}
}
inner class MyVh(var vb: ItemMyAdapterBinding) : RecyclerView.ViewHolder(vb.root) {
}
inner class Diff(private var oldItems: List<Wallpaper>, private var newItems: List<Wallpaper>) :
DiffUtil.Callback() {
override fun getOldListSize(): Int = oldItems.size
override fun getNewListSize(): Int = newItems.size
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
oldItems[oldItemPosition].id == newItems[newItemPosition].id
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
oldItems[oldItemPosition].love == newItems[newItemPosition].love
}
}

View File

@ -0,0 +1,68 @@
package com.nature.free.test.other
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
class MyItemSpace (private var horizontalSpacing:Int,private var verticalSpacing:Int,private var extraSpacing:Int): RecyclerView.ItemDecoration() {
// item占满一行时该item是否需要左右间距
var needVerticalSpacingInSingleLine = true
var needHorizontalSpacingInSingleLine = true
override fun getItemOffsets(
outRect: Rect,
view: View,
parent: RecyclerView,
state: RecyclerView.State
) {
val position = parent.getChildAdapterPosition(view)
var spanCount = 1
var spanSize = 1
var spanIndex = 0
parent.layoutManager?.run {
when (this) {
// is StaggeredGridLayoutManager -> {
// spanCount = this.spanCount
// (view.layoutParams as StaggeredGridLayoutManager.LayoutParams)?.run {
// if (isFullSpan) spanSize = spanCount
// spanIndex = this.spanIndex
// }
// }
is GridLayoutManager -> {
spanCount = this.spanCount
spanSize = this.spanSizeLookup.getSpanSize(position)
spanIndex = (view.layoutParams as GridLayoutManager.LayoutParams).spanIndex
}
// is LinearLayoutManager -> {
// outRect.left = verticalSpacing
// outRect.right = verticalSpacing
// outRect.bottom = horizontalSpacing
// return
// }
else -> {}
}
}
if (spanSize == spanCount) {
outRect.left =
if (needVerticalSpacingInSingleLine) verticalSpacing + extraSpacing else 0
outRect.right =
if (needVerticalSpacingInSingleLine) verticalSpacing + extraSpacing else 0
outRect.bottom = if (needHorizontalSpacingInSingleLine) horizontalSpacing else 0
} else {
val itemAllSpacing = (verticalSpacing * (spanCount + 1) + extraSpacing * 2) / spanCount
val left = verticalSpacing * (spanIndex + 1) - itemAllSpacing * spanIndex + extraSpacing
val right = itemAllSpacing - left
outRect.left = left
outRect.right = right
outRect.bottom = horizontalSpacing
}
}
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="1400"
android:fromXDelta="100%"
android:fromYDelta="0%" />
</set>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="1400"
android:fromXDelta="0%"
android:toXDelta="-100%"/>
</set>

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,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M444.5,300.9a42.7,42.7 0,1 0,-60.4 -60.4l-241.3,241.4a42.5,42.5 0,0 0,0 60.4l241.3,241.3a42.7,42.7 0,1 0,60.4 -60.3l-211.2,-211.2 211.2,-211.2z"
android:fillColor="@color/text_color"/>
<path
android:pathData="M170.7,512a42.7,42.7 0,0 1,42.7 -42.7h640a42.7,42.7 0,1 1,0 85.3H213.3a42.7,42.7 0,0 1,-42.7 -42.7z"
android:fillColor="@color/text_color"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M515,512.6m-463.1,0a463.1,463.1 0,1 0,926.2 0,463.1 463.1,0 1,0 -926.2,0Z"
android:fillColor="@color/love_gray"/>
<path
android:pathData="M454,714.6c-22.2,0 -43.7,-9.3 -59,-25.4l-114.3,-121.1c-20.8,-22.1 -19.9,-57 2.3,-77.8 22.1,-20.8 57,-19.9 77.8,2.3L453.6,590.8l208.5,-228.9c20.5,-22.5 55.3,-24.1 77.8,-3.6 22.5,20.5 24.1,55.3 3.6,77.8l-229.6,252a81.3,81.3 0,0 1,-59.2 26.5c-0.3,0.1 -0.5,0.1 -0.7,0.1z"
android:fillColor="@color/main_bg"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M515,512.6m-463.1,0a463.1,463.1 0,1 0,926.2 0,463.1 463.1,0 1,0 -926.2,0Z"
android:fillColor="@color/im_right"/>
<path
android:pathData="M454,714.6c-22.2,0 -43.7,-9.3 -59,-25.4l-114.3,-121.1c-20.8,-22.1 -19.9,-57 2.3,-77.8 22.1,-20.8 57,-19.9 77.8,2.3L453.6,590.8l208.5,-228.9c20.5,-22.5 55.3,-24.1 77.8,-3.6 22.5,20.5 24.1,55.3 3.6,77.8l-229.6,252a81.3,81.3 0,0 1,-59.2 26.5c-0.3,0.1 -0.5,0.1 -0.7,0.1z"
android:fillColor="@color/white"/>
</vector>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp"/>
<solid android:color="@color/text_color"/>
</shape>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp"/>
<solid android:color="@color/main_bg"/>
</shape>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="@color/love_gray"
android:pathData="M512,477.9c140.8,-128 213.3,-192 213.3,-277.3C725.3,136.5 674.1,85.3 605.9,85.3c-38.4,0 -72.5,17.1 -93.9,42.7 -25.6,-29.9 -59.7,-42.7 -98.1,-42.7C349.9,85.3 298.7,136.5 298.7,200.5c0,81.1 72.5,149.3 213.3,277.3m-34.1,34.1c-128,-140.8 -192,-213.3 -277.3,-213.3C136.5,298.7 85.3,349.9 85.3,413.9c0,38.4 17.1,72.5 42.7,93.9 -29.9,25.6 -42.7,59.7 -42.7,98.1C85.3,674.1 136.5,725.3 204.8,725.3c76.8,0 145.1,-72.5 273.1,-213.3m68.3,0c128,140.8 192,213.3 277.3,213.3 64,0 115.2,-51.2 115.2,-119.5 0,-38.4 -17.1,-72.5 -42.7,-93.9 29.9,-25.6 42.7,-59.7 42.7,-98.1C938.7,349.9 887.5,298.7 819.2,298.7c-76.8,0 -145.1,72.5 -273.1,213.3m-34.1,34.1c-140.8,128 -213.3,192 -213.3,277.3C298.7,887.5 349.9,938.7 418.1,938.7c38.4,0 72.5,-17.1 93.9,-42.7 25.6,29.9 59.7,42.7 98.1,42.7 64,0 115.2,-51.2 115.2,-119.5 0,-76.8 -72.5,-145.1 -213.3,-273.1z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="@color/text_color"
android:pathData="M512,477.9c140.8,-128 213.3,-192 213.3,-277.3C725.3,136.5 674.1,85.3 605.9,85.3c-38.4,0 -72.5,17.1 -93.9,42.7 -25.6,-29.9 -59.7,-42.7 -98.1,-42.7C349.9,85.3 298.7,136.5 298.7,200.5c0,81.1 72.5,149.3 213.3,277.3m-34.1,34.1c-128,-140.8 -192,-213.3 -277.3,-213.3C136.5,298.7 85.3,349.9 85.3,413.9c0,38.4 17.1,72.5 42.7,93.9 -29.9,25.6 -42.7,59.7 -42.7,98.1C85.3,674.1 136.5,725.3 204.8,725.3c76.8,0 145.1,-72.5 273.1,-213.3m68.3,0c128,140.8 192,213.3 277.3,213.3 64,0 115.2,-51.2 115.2,-119.5 0,-38.4 -17.1,-72.5 -42.7,-93.9 29.9,-25.6 42.7,-59.7 42.7,-98.1C938.7,349.9 887.5,298.7 819.2,298.7c-76.8,0 -145.1,72.5 -273.1,213.3m-34.1,34.1c-140.8,128 -213.3,192 -213.3,277.3C298.7,887.5 349.9,938.7 418.1,938.7c38.4,0 72.5,-17.1 93.9,-42.7 25.6,29.9 59.7,42.7 98.1,42.7 64,0 115.2,-51.2 115.2,-119.5 0,-76.8 -72.5,-145.1 -213.3,-273.1z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="144dp"
android:height="144dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M441.1,354.7l20,-186.8c2.7,-25.6 24.7,-45 50.9,-45 26.2,0 48.2,19.4 50.9,45l20,186.8a61.4,61.4 0,0 0,61.1 54.9h85.4c15.6,0 28.3,13.1 28.3,29.2 0,7.5 -2.8,14.7 -7.8,20.1L542.8,682.7a41.7,41.7 0,0 1,-61.6 0L274.1,458.9a29.8,29.8 0,0 1,1 -41.2c5.3,-5.2 12.3,-8 19.6,-8h85.4a61.4,61.4 0,0 0,61.1 -54.9zM214.7,654.1l23.3,93.1a41,41 0,0 0,39.7 31H746.3a41,41 0,0 0,39.7 -31l23.3,-93.1A52.5,52.5 0,0 1,860.2 614.4a41,41 0,0 1,41 41v143.4a102.4,102.4 0,0 1,-102.4 102.4H225.3a102.4,102.4 0,0 1,-102.4 -102.4V655.4a41,41 0,0 1,41 -41c24.1,0 45.1,16.4 50.9,39.7z"
android:fillColor="#ffffff"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="35dp"
android:height="35dp"
android:viewportWidth="1064"
android:viewportHeight="1024">
<path
android:pathData="M395.4,102.4c66.1,-95.5 208,-95.5 274.1,0l78.1,112.9c8.3,11.9 20.5,20.8 34.7,24.9l132.5,38.7c111.8,32.6 156.5,167 84.7,259.4l-84.3,108.5c-8.9,11.5 -13.5,25.5 -13.1,39.8l3.8,136.8c3.3,116.7 -112.4,198.8 -221.8,160.3l-130.2,-45.9c-13.9,-4.9 -29.2,-4.9 -43.1,0l-130.2,45.9c-109.4,38.5 -225,-43.6 -221.8,-160.3l3.8,-136.8c0.4,-14.3 -4.2,-28.4 -13.1,-39.9l-84.3,-108.5c-71.8,-92.4 -27,-226.8 84.8,-259.4l132.5,-38.7c14.2,-4.1 26.4,-13 34.6,-24.9L395.4,102.4zM585.3,160.6a64.5,64.5 0,0 0,-105.7 0L401.5,273.5a166.2,166.2 0,0 1,-90.1 65l-132.5,38.7a62.4,62.4 0,0 0,-32.6 98.3l84.3,108.5c23.3,30.1 35.6,67.3 34.6,105.5l-3.8,136.8c-1.2,43.4 42.4,76 85.4,60.9l130.2,-45.9a167.3,167.3 0,0 1,111.2 0l130.2,45.9c43,15.2 86.6,-17.4 85.4,-60.9l-3.8,-136.8c-1.1,-38.1 11.2,-75.4 34.6,-105.5l84.3,-108.5a62.4,62.4 0,0 0,-32.6 -98.3l-132.5,-38.7a166.2,166.2 0,0 1,-90.1 -65L585.3,160.6z"
android:fillColor="@color/love_gray"/>
<path
android:pathData="M709.8,412.3a51.2,51.2 0,0 1,4.3 72.3l-163.8,184.3a51.2,51.2 0,0 1,-74.5 2.2l-102.4,-102.4a51.2,51.2 0,0 1,72.4 -72.4l64,64 127.8,-143.8a51.2,51.2 0,0 1,72.3 -4.2z"
android:fillColor="@color/love_gray"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="35dp"
android:height="35dp"
android:viewportWidth="1064"
android:viewportHeight="1024">
<path
android:pathData="M395.4,102.4c66.1,-95.5 208,-95.5 274.1,0l78.1,112.9c8.3,11.9 20.5,20.8 34.7,24.9l132.5,38.7c111.8,32.6 156.5,167 84.7,259.4l-84.3,108.5c-8.9,11.5 -13.5,25.5 -13.1,39.8l3.8,136.8c3.3,116.7 -112.4,198.8 -221.8,160.3l-130.2,-45.9c-13.9,-4.9 -29.2,-4.9 -43.1,0l-130.2,45.9c-109.4,38.5 -225,-43.6 -221.8,-160.3l3.8,-136.8c0.4,-14.3 -4.2,-28.4 -13.1,-39.9l-84.3,-108.5c-71.8,-92.4 -27,-226.8 84.8,-259.4l132.5,-38.7c14.2,-4.1 26.4,-13 34.6,-24.9L395.4,102.4zM585.3,160.6a64.5,64.5 0,0 0,-105.7 0L401.5,273.5a166.2,166.2 0,0 1,-90.1 65l-132.5,38.7a62.4,62.4 0,0 0,-32.6 98.3l84.3,108.5c23.3,30.1 35.6,67.3 34.6,105.5l-3.8,136.8c-1.2,43.4 42.4,76 85.4,60.9l130.2,-45.9a167.3,167.3 0,0 1,111.2 0l130.2,45.9c43,15.2 86.6,-17.4 85.4,-60.9l-3.8,-136.8c-1.1,-38.1 11.2,-75.4 34.6,-105.5l84.3,-108.5a62.4,62.4 0,0 0,-32.6 -98.3l-132.5,-38.7a166.2,166.2 0,0 1,-90.1 -65L585.3,160.6z"
android:fillColor="@color/text_color"/>
<path
android:pathData="M709.8,412.3a51.2,51.2 0,0 1,4.3 72.3l-163.8,184.3a51.2,51.2 0,0 1,-74.5 2.2l-102.4,-102.4a51.2,51.2 0,0 1,72.4 -72.4l64,64 127.8,-143.8a51.2,51.2 0,0 1,72.3 -4.2z"
android:fillColor="@color/text_color"/>
</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,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="@color/love_gray"
android:pathData="M538.5,887.9l-10.3,-30.3 -0.3,0.1 10.7,30.2zM485.5,887.9l10.7,-30.2 -0.3,-0.1 -10.3,30.3zM512,227.8l-25.7,19.1a32,32 0,0 0,51.4 0L512,227.8zM527.8,857.7a52.9,52.9 0,0 1,-15.8 2,52.9 52.9,0 0,1 -15.8,-2l-21.3,60.3c11.8,4.1 25.2,5.7 37.1,5.7s25.3,-1.5 37.1,-5.7l-21.3,-60.3zM495.9,857.6c-57.3,-19.5 -153,-71.5 -233.9,-154.5 -80.6,-82.6 -144.6,-193.7 -144.6,-332.4h-64c0,160 74.2,286.3 162.8,377.1 88.2,90.4 192.6,147.6 259.1,170.3l20.7,-60.6zM117.3,370.8c0,-114.3 92.1,-206.5 205.2,-206.5v-64c-148.8,0 -269.2,121.2 -269.2,270.5h64zM322.6,164.3c67,0 126.4,32.3 163.8,82.6l51.4,-38.1A267.3,267.3 0,0 0,322.6 100.3v64zM537.7,246.9A203.9,203.9 0,0 1,701.4 164.3v-64a267.9,267.9 0,0 0,-215.1 108.5l51.4,38.1zM701.4,164.3c113.2,0 205.2,92.2 205.2,206.5h64c0,-149.3 -120.4,-270.5 -269.2,-270.5v64zM906.7,370.8c0,138.7 -64,249.8 -144.6,332.4 -80.9,82.9 -176.6,134.9 -233.9,154.5l20.7,60.6c66.5,-22.7 170.9,-80 259.1,-170.3 88.6,-90.8 162.8,-217.1 162.8,-377.1h-64z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="@color/text_color"
android:pathData="M538.5,887.9l-10.3,-30.3 -0.3,0.1 10.7,30.2zM485.5,887.9l10.7,-30.2 -0.3,-0.1 -10.3,30.3zM512,227.8l-25.7,19.1a32,32 0,0 0,51.4 0L512,227.8zM527.8,857.7a52.9,52.9 0,0 1,-15.8 2,52.9 52.9,0 0,1 -15.8,-2l-21.3,60.3c11.8,4.1 25.2,5.7 37.1,5.7s25.3,-1.5 37.1,-5.7l-21.3,-60.3zM495.9,857.6c-57.3,-19.5 -153,-71.5 -233.9,-154.5 -80.6,-82.6 -144.6,-193.7 -144.6,-332.4h-64c0,160 74.2,286.3 162.8,377.1 88.2,90.4 192.6,147.6 259.1,170.3l20.7,-60.6zM117.3,370.8c0,-114.3 92.1,-206.5 205.2,-206.5v-64c-148.8,0 -269.2,121.2 -269.2,270.5h64zM322.6,164.3c67,0 126.4,32.3 163.8,82.6l51.4,-38.1A267.3,267.3 0,0 0,322.6 100.3v64zM537.7,246.9A203.9,203.9 0,0 1,701.4 164.3v-64a267.9,267.9 0,0 0,-215.1 108.5l51.4,38.1zM701.4,164.3c113.2,0 205.2,92.2 205.2,206.5h64c0,-149.3 -120.4,-270.5 -269.2,-270.5v64zM906.7,370.8c0,138.7 -64,249.8 -144.6,332.4 -80.9,82.9 -176.6,134.9 -233.9,154.5l20.7,60.6c66.5,-22.7 170.9,-80 259.1,-170.3 88.6,-90.8 162.8,-217.1 162.8,-377.1h-64z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64.1dp"
android:height="64dp"
android:viewportWidth="1025"
android:viewportHeight="1024">
<path
android:pathData="M512.1,64.7c-247.2,0 -447.6,200.4 -447.6,447.6s200.4,447.6 447.6,447.6c247.2,0 447.6,-200.4 447.6,-447.6C959.7,265.1 759.3,64.7 512.1,64.7zM524,665.6l-71.6,70.4 -71.6,-70.4 0,-0L213.9,501.2l71.6,-70.4 167,164.3L738.8,313.5l71.6,70.4L524,665.6 524,665.6z"
android:fillColor="#CCCCCC"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64.1dp"
android:height="64dp"
android:viewportWidth="1025"
android:viewportHeight="1024">
<path
android:pathData="M512.1,64.7c-247.2,0 -447.6,200.4 -447.6,447.6s200.4,447.6 447.6,447.6c247.2,0 447.6,-200.4 447.6,-447.6C959.7,265.1 759.3,64.7 512.1,64.7zM524,665.6l-71.6,70.4 -71.6,-70.4 0,-0L213.9,501.2l71.6,-70.4 167,164.3L738.8,313.5l71.6,70.4L524,665.6 524,665.6z"
android:fillColor="@color/im_right"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="144dp"
android:height="144dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M245.3,128C180.9,128 128,180.9 128,245.3v21.3a32,32 0,1 0,64 0v-21.3C192,215.5 215.5,192 245.3,192h21.3a32,32 0,1 0,0 -64h-21.3zM373.3,128a32,32 0,1 0,0 64h85.3a32,32 0,1 0,0 -64h-85.3zM565.3,128a32,32 0,1 0,0 64h85.3a32,32 0,1 0,0 -64h-85.3zM757.3,128a32,32 0,1 0,0 64h21.3c29.8,0 53.3,23.5 53.3,53.3v21.3a32,32 0,1 0,64 0v-21.3C896,180.9 843.1,128 778.7,128h-21.3zM650.7,277.3c-29.3,0 -55.4,12.2 -71.9,30.7C562.2,326.7 554.7,350.2 554.7,373.3c0,23.1 7.6,46.7 24.1,65.3C595.3,457.2 621.3,469.3 650.7,469.3s55.4,-12.2 71.9,-30.7C739.1,420 746.7,396.4 746.7,373.3c0,-23.1 -7.6,-46.7 -24.1,-65.3C706,289.5 680,277.3 650.7,277.3zM159.5,340.9A32,32 0,0 0,128 373.3v85.3a32,32 0,1 0,64 0v-85.3a32,32 0,0 0,-32.5 -32.4zM863.5,340.9A32,32 0,0 0,832 373.3v85.3a32,32 0,1 0,64 0v-85.3a32,32 0,0 0,-32.5 -32.4zM650.7,341.3c13.3,0 19.3,3.8 24.1,9.3 4.8,5.4 7.9,13.9 7.9,22.7 0,8.9 -3.1,17.3 -7.9,22.7 -4.8,5.4 -10.8,9.3 -24.1,9.3s-19.3,-3.8 -24.1,-9.3c-4.8,-5.4 -7.9,-13.9 -7.9,-22.7 0,-8.9 3.1,-17.3 7.9,-22.7 4.8,-5.4 10.8,-9.3 24.1,-9.3zM512,512.1a86,86 0,0 0,-60 24.1L192.9,786.9C192.4,784.2 192,781.5 192,778.7v-21.3a32,32 0,0 0,-32.5 -32.4A32,32 0,0 0,128 757.3v21.3c0,64.4 52.9,117.3 117.3,117.3h21.3a32,32 0,1 0,0 -64h-21.3c-2.2,0 -4.3,-0.4 -6.4,-0.6l257.6,-249.2a21.9,21.9 0,0 1,31.1 0L785.1,831.4c-2.1,0.2 -4.2,0.6 -6.4,0.6h-21.3a32,32 0,1 0,0 64h21.3c64.4,0 117.3,-52.9 117.3,-117.3v-21.3a32,32 0,0 0,-32.5 -32.4A32,32 0,0 0,832 757.3v21.3c0,2.8 -0.4,5.5 -0.9,8.3L572.1,536.2A86.1,86.1 0,0 0,512 512.1zM159.5,532.9A32,32 0,0 0,128 565.3v85.3a32,32 0,1 0,64 0v-85.3a32,32 0,0 0,-32.5 -32.4zM863.5,532.9A32,32 0,0 0,832 565.3v85.3a32,32 0,1 0,64 0v-85.3a32,32 0,0 0,-32.5 -32.4zM373.3,832a32,32 0,1 0,0 64h85.3a32,32 0,1 0,0 -64h-85.3zM565.3,832a32,32 0,1 0,0 64h85.3a32,32 0,1 0,0 -64h-85.3z"
android:fillColor="#ffffff"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M148.8,921h726.5c25.3,0 45.8,-20.5 45.8,-45.8L921,148.8c0,-25.3 -20.5,-45.8 -45.8,-45.8L148.8,103c-25.3,0 -45.8,20.5 -45.8,45.8v726.5c0,25.3 20.5,45.8 45.8,45.8zM157.9,171.5c0,-7.7 6.3,-13.7 13.7,-13.7h680.7c7.7,0 13.7,6.3 13.7,13.7v680.7c0,7.7 -6.3,13.7 -13.7,13.7L171.5,865.8c-7.7,0 -13.7,-6.3 -13.7,-13.7L157.9,171.5zM457.1,241.2c0,-15.1 -12.2,-27.6 -27.6,-27.6L241.2,213.6c-15.1,0 -27.6,12.2 -27.6,27.6L213.6,429.5c0,15.1 12.2,27.6 27.6,27.6 15.1,0 27.6,-12.2 27.6,-27.6L268.8,268.5L429.5,268.5c15.4,0 27.6,-12.2 27.6,-27.3zM566.9,791.9c0,15.1 12.2,27.6 27.6,27.6h188.6c15.1,0 27.6,-12.2 27.6,-27.6v-188.6c0,-15.1 -12.2,-27.6 -27.6,-27.6 -15.1,0 -27.6,12.2 -27.6,27.6v161L594.5,764.3c-15.4,0.3 -27.6,12.5 -27.6,27.6zM566.9,241.2c0,-15.1 12.2,-27.6 27.6,-27.6h188.6c15.1,0 27.6,12.2 27.6,27.6L810.7,429.5c0,15.1 -12.2,27.6 -27.6,27.6 -15.1,0 -27.6,-12.2 -27.6,-27.6L755.5,268.5L594.5,268.5c-15.4,0 -27.6,-12.2 -27.6,-27.3zM457.1,791.9c0,15.1 -12.2,27.6 -27.6,27.6L241.2,819.5c-15.1,0 -27.6,-12.2 -27.6,-27.6v-188.6c0,-15.1 12.2,-27.6 27.6,-27.6 15.1,0 27.6,12.2 27.6,27.6v161L429.5,764.3c15.4,0.3 27.6,12.5 27.6,27.6zM457.1,791.9"
android:fillColor="@color/text_color"/>
</vector>

View File

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M499.2,951.5c-234.7,0 -426.7,-192 -426.7,-426.7 0,-17.1 0,-38.4 4.3,-55.5 4.3,-12.8 12.8,-17.1 25.6,-17.1 12.8,4.3 17.1,12.8 17.1,25.6 -4.3,12.8 -4.3,29.9 -4.3,46.9 0,213.3 170.7,384 384,384s384,-170.7 384,-384 -170.7,-384 -384,-384c-25.6,0 -46.9,4.3 -72.5,8.5 -12.8,0 -21.3,-4.3 -25.6,-17.1 0,-12.8 4.3,-21.3 17.1,-25.6 25.6,-4.3 51.2,-8.5 81.1,-8.5 234.7,0 426.7,192 426.7,426.7s-192,426.7 -426.7,426.7z"
android:fillColor="@color/main_bg"/>
<path
android:pathData="M119.5,418.1h-8.5c-8.5,-4.3 -17.1,-17.1 -12.8,-29.9 42.7,-119.5 128,-213.3 238.9,-256 12.8,-4.3 21.3,0 25.6,12.8 4.3,12.8 0,21.3 -12.8,25.6C256,213.3 174.9,298.7 140.8,405.3c-4.3,8.5 -12.8,12.8 -21.3,12.8z"
android:fillColor="@color/main_bg"/>
<path
android:pathData="M392.5,657.1c-4.3,0 -12.8,0 -17.1,-4.3 -8.5,-8.5 -8.5,-21.3 0,-29.9l213.3,-213.3c8.5,-8.5 21.3,-8.5 29.9,0s8.5,21.3 0,29.9l-213.3,213.3c0,4.3 -8.5,4.3 -12.8,4.3z"
android:fillColor="@color/main_bg"/>
<path
android:pathData="M605.9,657.1c-4.3,0 -12.8,0 -17.1,-4.3l-213.3,-213.3c-8.5,-8.5 -8.5,-21.3 0,-29.9s21.3,-8.5 29.9,0l213.3,213.3c8.5,8.5 8.5,21.3 0,29.9 0,4.3 -8.5,4.3 -12.8,4.3z"
android:fillColor="@color/main_bg"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M682.7,113.8c157.1,0 284.4,127.3 284.4,284.4 0,205.3 -142,371.7 -426,499.3a71.1,71.1 0,0 1,-58.3 0C198.9,769.9 56.9,603.5 56.9,398.2 56.9,241.1 184.2,113.8 341.3,113.8c64,0 123.1,21.2 170.7,56.9A283,283 0,0 1,682.7 113.8z"
android:fillColor="@color/love_gray"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M682.7,113.8c157.1,0 284.4,127.3 284.4,284.4 0,205.3 -142,371.7 -426,499.3a71.1,71.1 0,0 1,-58.3 0C198.9,769.9 56.9,603.5 56.9,398.2 56.9,241.1 184.2,113.8 341.3,113.8c64,0 123.1,21.2 170.7,56.9A283,283 0,0 1,682.7 113.8z"
android:fillColor="@color/love_red"/>
</vector>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_cateogry_on" android:state_selected="true"/>
<item android:drawable="@drawable/ic_cateogry"/>
</selector>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_home_on" android:state_selected="true"/>
<item android:drawable="@drawable/ic_home"/>
</selector>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_love_on" android:state_selected="true"/>
<item android:drawable="@drawable/ic_love"/>
</selector>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/love_red" android:state_selected="true"/>
<item android:drawable="@drawable/love"/>
</selector>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/check_on" android:state_selected="true"/>
<item android:drawable="@drawable/check"/>
</selector>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/main_bg"
tools:context=".InfoActivity">
<ImageView
android:id="@+id/back"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_alignTop="@id/tv_name"
android:layout_alignBottom="@id/tv_name"
android:layout_marginStart="12dp"
android:src="@drawable/back" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="12dp"
android:textColor="@color/text_color"
android:textSize="17sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/tv_name" />
</RelativeLayout>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/main_bg"
tools:context=".MainActivity">
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="10dp"
android:text="@string/app_name"
android:textColor="@color/text_color"
android:textSize="17sp" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/tvTitle"
android:background="@color/main_bg"
android:layout_marginTop="10dp"
app:tabIndicatorHeight="0dp" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewP2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/tab" />
</RelativeLayout>

View File

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/main_bg"
tools:context=".InfoActivity">
<ImageView
android:id="@+id/image"
android:scaleType="centerCrop"
android:layout_above="@id/view_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/back"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_marginStart="12dp"
android:layout_marginTop="22dp"
android:src="@drawable/back" />
<RelativeLayout
android:id="@+id/view_layout"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_alignParentBottom="true">
<LinearLayout
android:id="@+id/im1"
android:layout_width="match_parent"
android:layout_height="80dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:id="@+id/check1"
android:visibility="gone"
android:layout_marginStart="22dp"
android:src="@drawable/selector_right" />
<ImageView
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="25dp"
android:src="@drawable/ic_wh" />
<TextView
android:id="@+id/tv_wh1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_marginStart="15dp"
android:textSize="15sp"
android:textColor="@color/text_color" />
</LinearLayout>
<View
android:id="@+id/line0"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@id/im1"
android:layout_marginStart="26dp"
android:layout_marginEnd="26dp"
android:background="@color/love_gray" />
<LinearLayout
android:id="@+id/im2"
android:layout_width="match_parent"
android:layout_height="80dp"
android:visibility="gone"
android:layout_below="@id/line0"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:id="@+id/check2"
android:layout_marginStart="22dp"
android:src="@drawable/selector_right" />
<ImageView
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="25dp"
android:src="@drawable/ic_wh" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:textSize="15sp"
android:id="@+id/tv_wh2"
android:textColor="@color/text_color" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/im2"
android:layout_marginTop="17dp"
android:orientation="horizontal"
android:paddingTop="15dp"
android:paddingBottom="15dp">
<ImageView
android:id="@+id/save"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_weight="1"
android:src="@drawable/ic_download" />
<View
android:id="@+id/line1"
android:layout_width="1dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/save"
android:background="@color/love_gray" />
<ImageView
android:id="@+id/set_wallpaper"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/line1"
android:layout_weight="1"
android:src="@drawable/ic_set_wallpaper" />
<View
android:id="@+id/line2"
android:layout_width="1dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/set_wallpaper"
android:background="@color/love_gray" />
<ImageView
android:id="@+id/love"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/line2"
android:layout_weight="1"
android:src="@drawable/selector_love" />
</LinearLayout>
</RelativeLayout>
<ProgressBar
android:id="@+id/load"
android:layout_width="53dp"
android:layout_height="53dp"
android:indeterminateTint="@color/white"
android:layout_centerInParent="true" />
</RelativeLayout>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/main_bg"
tools:context=".WelActivity">
<ImageView
android:id="@+id/logo"
android:layout_width="124dp"
android:layout_height="124dp"
android:src="@mipmap/icon"
android:layout_centerHorizontal="true"
android:layout_marginTop="260dp" />
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/logo"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_marginTop="22dp"
android:textSize="19sp"
android:text="@string/app_name" />
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv"
android:indeterminateTint="@color/white"
android:layout_centerHorizontal="true"
android:layout_marginTop="85dp" />
</RelativeLayout>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:textSize="18sp"
android:gravity="center"
android:textColor="@color/black"
android:text="@string/loading"/>
</RelativeLayout>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_class"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="27dp"
android:layout_marginEnd="27dp"
android:background="@drawable/dailog_btn_shape"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="15dp"
android:paddingBottom="15dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/setWa"
android:textColor="@color/black"
android:textSize="18sp" />
<ImageView
android:id="@+id/imclose"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_alignParentEnd="true"
android:padding="6dp"
android:src="@drawable/icclose" />
</RelativeLayout>
<TextView
android:id="@+id/tvBoth"
android:layout_width="220dp"
android:layout_height="50dp"
android:layout_marginTop="12dp"
android:background="@drawable/dailog_shape"
android:gravity="center"
android:text="@string/dialog_both"
android:textColor="@color/text_color"
android:textSize="16sp" />
<TextView
android:id="@+id/tvhome"
android:layout_width="220dp"
android:layout_height="50dp"
android:layout_marginTop="11dp"
android:background="@drawable/dailog_shape"
android:gravity="center"
android:text="@string/dialog_home"
android:textColor="@color/text_color"
android:textSize="16sp" />
<TextView
android:id="@+id/tvlock"
android:layout_width="220dp"
android:layout_height="50dp"
android:layout_marginTop="11dp"
android:background="@drawable/dailog_shape"
android:gravity="center"
android:text="@string/dialog_lock"
android:textColor="@color/text_color"
android:textSize="16sp" />
</LinearLayout>
</FrameLayout>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/empty_love"
android:textSize="17sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="44dp"
android:id="@+id/empty_tv"
android:visibility="gone"
android:gravity="center"
android:lineSpacingExtra="5dp"
android:layout_marginTop="180dp"
android:textColor="@color/white"/>
</FrameLayout>

View File

@ -0,0 +1,30 @@
<?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_marginTop="6dp"
android:id="@+id/class_item"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/covert_im"
android:layout_width="match_parent"
android:layout_height="200dp"
android:scaleType="fitXY"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="33dp"
android:layout_marginBottom="44dp"
android:text="@string/app_name"
android:textColor="@color/text_color"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@id/covert_im"
app:layout_constraintLeft_toLeftOf="@id/covert_im" />
</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"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/preview_im"
android:layout_width="match_parent"
android:layout_height="210dp"
android:scaleType="centerCrop"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/love_item"
app:layout_constraintBottom_toBottomOf="@id/preview_im">
<ImageView
android:layout_width="28dp"
android:layout_height="28dp"
android:id="@+id/im_love"
android:layout_centerInParent="true"
android:layout_marginEnd="30dp"
android:src="@drawable/selector_love" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:id="@+id/tabIm"
android:layout_width="26dp"
android:layout_height="26dp" />
</LinearLayout>

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: 11 KiB

View File

@ -0,0 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.MyWallpaper" 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,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="text_color">#FDfefe</color>
<color name="white">#ffffff</color>
<color name="main_bg">#282632</color>
<color name="main_love_bg1">#7898a7</color>
<color name="main_love_bg2">#88a847</color>
<color name="main_love_bg3">#808f78</color>
<color name="main_love_bg4">#808080</color>
<color name="love_red">#d81e06</color>
<color name="love_gray">#babcbd</color>
<color name="im_right">#30a92d</color>
<color name="trans">#00ffffff</color>
</resources>

View File

@ -0,0 +1,16 @@
<resources>
<string name="app_name">Various Wallpapers</string>
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="setWa">Set Wallpaper</string>
<string name="dialog_home">Home Screen</string>
<string name="dialog_lock">Lock Screen</string>
<string name="dialog_both">Both</string>
<string name="success">Set Wallpaper Success!</string>
<string name="fail">Failed to set wallpaper, please try again!</string>
<string name="empty_love">There is no data yet. Go and add your favorite wallpapers.</string>
<string name="save_success">Save album successfully!</string>
<string name="save_fail">Failed to save the album, please try again!</string>
<string name="load_fail">Loading failed, please try again!</string>
<string name="loading">Loading, please wait</string>
</resources>

View File

@ -0,0 +1,10 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.MyWallpaper" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
<item name="android:statusBarColor">@color/main_bg</item>
</style>
<style name="Theme.MyWallpaper" parent="Base.Theme.MyWallpaper" />
</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,12 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">https://img1.wallspic.com</domain>
</domain-config>
</network-security-config>

View File

@ -0,0 +1,17 @@
package com.nature.free.test;
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);
}
}

Binary file not shown.

21
build.gradle.kts Normal file
View File

@ -0,0 +1,21 @@
// 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
id("com.google.gms.google-services") version "4.3.15" apply false
id ("com.google.firebase.crashlytics") version "2.9.2" apply false
}
buildscript {
val objectboxVersion by extra("4.0.0") // For KTS build scripts
repositories {
mavenCentral()
// Note: 2.9.0 and older are available on jcenter()
}
dependencies {
classpath("io.objectbox:objectbox-gradle-plugin:$objectboxVersion")
}
}

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:15:06 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

19
settings.gradle.kts Normal file
View File

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