v1.0.0(1)

This commit is contained in:
litingting 2025-02-19 11:13:03 +08:00
commit 108faedd18
79 changed files with 24583 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/AnimalWallpapers.jks Normal file

Binary file not shown.

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

@ -0,0 +1,158 @@
import java.util.Date
import java.text.SimpleDateFormat
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("io.objectbox")
kotlin("kapt")
// id("com.google.gms.google-services")
// id("com.google.firebase.crashlytics")
}
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
namespace = "com.animal.wallpaper"
compileSdk = 34
defaultConfig {
//com.animal.wallpaper.camera
applicationId = "com.animal.wallpaper.camera"
minSdk = 23
targetSdk = 34
versionCode = 1
versionName = "1.0.0"
setProperty("archivesBaseName", "Animal Wallpapers_V" + versionName + "(${versionCode})_$timestamp")
testInstrumentationRunner = "androidx.live.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildFeatures{
viewBinding = true
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
implementation ("com.github.bumptech.glide:glide:4.16.0")
implementation ("jp.wasabeef:glide-transformations:4.3.0") // Glide Transformations
implementation("com.squareup.okhttp3:okhttp:4.12.0")
//------------------firebase
// implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
// implementation("com.google.firebase:firebase-crashlytics")
// implementation("com.google.firebase:firebase-analytics")
// implementation("com.google.firebase:firebase-config")
//-----------------------------------------------TopOn(Mintegral、Pangle、UnitAds、Digital Turbine(Fyber)、Chartboost&Helium、Ironsource、Liftoff(Vungle)、Inmobi、Start.io、Appnext、Bigo)
//Anythink (Necessary)
// implementation("com.anythink.sdk:core-tpn:6.4.07")
// implementation("com.anythink.sdk:nativead-tpn:6.4.07")
// implementation("com.anythink.sdk:banner-tpn:6.4.07")
// implementation("com.anythink.sdk:interstitial-tpn:6.4.07")
// implementation("com.anythink.sdk:rewardedvideo-tpn:6.4.07")
// implementation("com.anythink.sdk:splash-tpn:6.4.07")
//
// //Androidx (Necessary)
// implementation("androidx.appcompat:appcompat:1.1.0")
// implementation("androidx.browser:browser:1.4.0")
//
// //StartApp
// implementation("com.anythink.sdk:adapter-tpn-startapp:6.4.07")
// implementation("com.startapp:inapp-sdk:5.0.2")
//
// //Appnext
// implementation("com.anythink.sdk:adapter-tpn-appnext:6.4.07")
// implementation("com.appnext.sdk:ads:2.7.1.473")
// implementation("com.appnext.sdk:banners:2.7.1.473")
// implementation("com.appnext.sdk:native-ads2:2.7.1.473")
// implementation("com.appnext.sdk:actions:2.4.6.472")
// implementation("androidx.constraintlayout:constraintlayout:2.0.4")
//
// //Vungle
// implementation("com.anythink.sdk:adapter-tpn-vungle:6.4.07")
// implementation("com.vungle:vungle-ads:7.4.0")
// implementation("com.google.android.gms:play-services-basement:18.1.0")
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
//
// //UnityAds
// implementation("com.anythink.sdk:adapter-tpn-unityads:6.4.07")
// implementation("com.unity3d.ads:unity-ads:4.12.2")
//
// //Ironsource
// implementation("com.anythink.sdk:adapter-tpn-ironsource:6.4.07")
// implementation("com.ironsource.sdk:mediationsdk:8.2.1")
// implementation("com.google.android.gms:play-services-appset:16.0.2")
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
// implementation("com.google.android.gms:play-services-basement:18.1.0")
//
// //Bigo
// implementation("com.anythink.sdk:adapter-tpn-bigo:6.4.07")
// implementation("com.bigossp:bigo-ads:4.9.0")
//
// //Pangle
// implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.4.07")
// implementation("com.pangle.global:ads-sdk:6.1.0.9")
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
//
// //Inmobi
// implementation("com.anythink.sdk:adapter-tpn-inmobi:6.4.07")
// implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.7.5")
//
// //Mintegral
// implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.4.07")
// implementation("com.mbridge.msdk.oversea:reward:16.8.11")
// implementation("com.mbridge.msdk.oversea:newinterstitial:16.8.11")
// implementation("com.mbridge.msdk.oversea:mbnative:16.8.11")
// implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.8.11")
// implementation("com.mbridge.msdk.oversea:mbsplash:16.8.11")
// implementation("com.mbridge.msdk.oversea:mbbanner:16.8.11")
// implementation("com.mbridge.msdk.oversea:mbbid:16.8.11")
// implementation("androidx.recyclerview:recyclerview:1.1.0")
//
// //Chartboost
// implementation("com.anythink.sdk:adapter-tpn-chartboost:6.4.07")
// implementation("com.chartboost:chartboost-sdk:9.7.0")
// implementation("com.chartboost:chartboost-mediation-sdk:4.9.1")
// implementation("com.chartboost:chartboost-mediation-adapter-chartboost:4.9.7.0.0")
// implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
// implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
// implementation("com.squareup.okhttp3:okhttp:4.10.0")
// implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
// implementation("com.squareup.retrofit2:retrofit:2.9.0")
// implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
//
// //Fyber
// implementation("com.anythink.sdk:adapter-tpn-fyber:6.4.07")
// implementation("com.fyber:marketplace-sdk:8.3.0")
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
//
// // Debugger UI Tools
// implementation ("com.anythink.sdk:debugger-ui:1.0.7")
}

View File

@ -0,0 +1,92 @@
{
"_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": "3:817335537070466014",
"lastPropertyId": "13:6556733085751825575",
"name": "Data",
"properties": [
{
"id": "1:7567671966987007993",
"name": "id",
"type": 6,
"flags": 1
},
{
"id": "2:2590164264280025677",
"name": "description",
"type": 9
},
{
"id": "3:8912833100894718986",
"name": "fullUrl",
"type": 9
},
{
"id": "4:7138929457594592554",
"name": "previewUrl1080",
"type": 9
},
{
"id": "5:3957870060050722570",
"name": "previewUrl400",
"type": 9
},
{
"id": "6:2943285943884558608",
"name": "previewUrl200",
"type": 9
},
{
"id": "7:7262008615134929676",
"name": "authorName",
"type": 9
},
{
"id": "8:7105947400861196483",
"name": "authorHeader",
"type": 9
},
{
"id": "9:1954934496493857304",
"name": "authorHtml",
"type": 9
},
{
"id": "12:8582031355111471002",
"name": "imId",
"type": 9
},
{
"id": "13:6556733085751825575",
"name": "isLike",
"type": 1
}
],
"relations": []
}
],
"lastEntityId": "3:817335537070466014",
"lastIndexId": "0:0",
"lastRelationId": "0:0",
"lastSequenceId": "0:0",
"modelVersion": 5,
"modelVersionParserMinimum": 5,
"retiredEntityUids": [
8119453540460508569,
8776066878034520742
],
"retiredIndexUids": [],
"retiredPropertyUids": [
8848640050018073106,
4870222079156330783,
4966768060561274983,
8892036187720267027,
1670319685727744805,
3855211567189961055
],
"retiredRelationUids": [],
"version": 1
}

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

@ -0,0 +1,154 @@
# 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
-keep class com.animal.wallpaper.json.** { *; }
-keep class com.google.gson.** { *; }
-keepattributes Signature
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
#---------------------------------------------Topon
-keep class com.startapp.** {
*;
}
-keep class com.truenet.** {
*;
}
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile,
LineNumberTable, *Annotation*, EnclosingMethod
-dontwarn android.webkit.JavascriptInterface
-dontwarn com.startapp.**
-dontwarn org.jetbrains.annotations.**
-keep class com.appnext.** { *; }
-dontwarn com.appnext.**
# Vungle
-dontwarn com.vungle.ads.**
-keepclassmembers class com.vungle.ads.** {
*;
}
-keep class com.vungle.ads.**
# Google
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
# START OkHttp + Okio
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# END OkHttp + Okio
# START Protobuf
-dontwarn com.google.protobuf.**
-keepclassmembers class com.google.protobuf.** {
*;
}
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
# END Protobuf
-keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface {
public *;
}
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keep public class com.google.android.gms.ads.** {
public *;
}
-keep class com.ironsource.adapters.** { *;
}
-dontwarn com.ironsource.mediationsdk.**
-dontwarn com.ironsource.adapters.**
-keepattributes JavascriptInterface
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-keep class com.bytedance.sdk.** { *; }
-keep class com.inmobi.** { *; }
-keep public class com.google.android.gms.**
-dontwarn com.google.android.gms.**
-dontwarn com.squareup.picasso.**
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
public *;
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
public *;
}
# skip the Picasso library classes
-keep class com.squareup.picasso.** {*;}
-dontwarn com.squareup.okhttp.**
# skip Moat classes
-keep class com.moat.** {*;}
-dontwarn com.moat.**
# skip IAB classes
-keep class com.iab.** {*;}
-dontwarn com.iab.**
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.mbridge.** {*; }
-keep interface com.mbridge.** {*; }
-keep class android.support.v4.** { *; }
-dontwarn com.mbridge.**
-keep class **.R$* { public static final int mbridge*; }
-keep public class com.mbridge.* extends androidx.** { *; }
-keep public class androidx.viewpager.widget.PagerAdapter{ *; }
-keep public class androidx.viewpager.widget.ViewPager.OnPageChangeListener{ *; }
-keep interface androidx.annotation.IntDef{ *; }
-keep interface androidx.annotation.Nullable{ *; }
-keep interface androidx.annotation.CheckResult{ *; }
-keep interface androidx.annotation.NonNull{ *; }
-keep public class androidx.fragment.app.Fragment{ *; }
-keep public class androidx.core.content.FileProvider{ *; }
-keep public class androidx.core.app.NotificationCompat{ *; }
-keep public class androidx.appcompat.widget.AppCompatImageView { *; }
-keep public class androidx.recyclerview.*{ *; }
-keep class com.chartboost.** { *; }

View File

@ -0,0 +1,26 @@
package com.animal.wallpaper;
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 live, 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 live.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.hd.kwallpapers.wallpapers.live", appContext.getPackageName());
}
}

View File

@ -0,0 +1,42 @@
<?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"
android:maxSdkVersion="32" />
<application
android:name="com.animal.wallpaper.MyApp"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/logo"
android:supportsRtl="true"
android:theme="@style/Theme.WallpaperSelection"
tools:targetApi="31">
<activity
android:name="com.animal.wallpaper.ui.SearchActivity"
android:exported="false" />
<activity
android:name="com.animal.wallpaper.ui.WelcomeActivity"
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="com.animal.wallpaper.ui.DetailInfoActivity"
android:exported="false" />
<activity
android:name="com.animal.wallpaper.ui.MainActivity"
android:exported="false" />
</application>
</manifest>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,141 @@
package com.animal.wallpaper;
import androidx.annotation.Nullable;
import java.io.Serializable;
import io.objectbox.annotation.Entity;
import io.objectbox.annotation.Id;
@Entity
public class Data implements Serializable {
@Id
private long id;
private String imId;
private String description;
private String fullUrl;
private String previewUrl1080;
private String previewUrl400;
private String previewUrl200;
private String authorName;
private String authorHeader;
private String authorHtml;
private boolean isLike;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public boolean isLike() {
return isLike;
}
public void setLike(boolean like) {
isLike = like;
}
public String getImId() {
return imId;
}
public void setImId(String imId) {
this.imId = imId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getFullUrl() {
return fullUrl;
}
public void setFullUrl(String fullUrl) {
this.fullUrl = fullUrl;
}
public String getPreviewUrl1080() {
return previewUrl1080;
}
public void setPreviewUrl1080(String previewUrl1080) {
this.previewUrl1080 = previewUrl1080;
}
public String getPreviewUrl400() {
return previewUrl400;
}
public void setPreviewUrl400(String previewUrl400) {
this.previewUrl400 = previewUrl400;
}
public String getPreviewUrl200() {
return previewUrl200;
}
public void setPreviewUrl200(String previewUrl200) {
this.previewUrl200 = previewUrl200;
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
public String getAuthorHeader() {
return authorHeader;
}
public void setAuthorHeader(String authorHeader) {
this.authorHeader = authorHeader;
}
public String getAuthorHtml() {
return authorHtml;
}
public void setAuthorHtml(String authorHtml) {
this.authorHtml = authorHtml;
}
@Override
public boolean equals(@Nullable Object obj) {
Data obj1 = (Data) obj;
if (obj1 != null) {
if (obj1.getImId().equals(imId)) {
return true;
}
}
return false;
}
}

View File

@ -0,0 +1,87 @@
package com.animal.wallpaper;
import android.app.Application;
import android.content.Context;
//import com.google.firebase.FirebaseApp;
import com.animal.wallpaper.utils.Common;
import com.animal.wallpaper.utils.CommonKt;
import com.animal.wallpaper.utils.DbManager;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.List;
public class MyApp extends Application {
public static Context mAppContext;
private static List<Data> natureList;
private static List<Data> animalsList;
public static String TAG = "-------MyApp---------";
public static final String key_info = "key_info";
public static final String key_type = "key_source";
// private String APPId="h673ddf8ae8467";
// private String AppKey="a17cd7a62720b00498a8dc5c538c92303";
// private String debug_Key="";
@Override
public void onCreate() {
super.onCreate();
mAppContext = this;
initTop();
DbManager.init(this);
try {
// InputStream open = getAssets().open("Nature.json");
// String covertStr = Common.getCovertStr(open);
// if (!covertStr.isEmpty()) {
// natureList = CommonKt.INSTANCE.getData(this, covertStr);
// }
InputStream open1 = getAssets().open("Animals.json");
String covert = Common.getCovertStr(open1);
if (!covert.isEmpty()) {
animalsList = CommonKt.INSTANCE.getData(this, covert);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static List<Data> getAnimalsList() {
Collections.shuffle(animalsList);
return animalsList;
}
private void initTop(){
// ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {
//
// @Override
// public void onResultCallback(boolean isEU) {
// Log.e(TAG, "onResultCallback:" + isEU);
// if (isEU && ATSDK.getGDPRDataLevel( MyApp.mAppContext) == ATSDK.UNKNOWN) {
// ATSDK.showGdprAuth(MyApp.mAppContext);
// }
//
// }
//
// @Override
// public void onErrorCallback(String errorMsg) {
// Log.e(TAG, "onErrorCallback:" + errorMsg);
// }
// });
//
// ATSDK.init( this, APPId, AppKey);
// //测试工具
//// ATDebuggerUITest.showDebuggerUI(this,debug_Key);
// AdManager.loadAllAd();
}
}

View File

@ -0,0 +1,103 @@
package com.animal.wallpaper.adapter;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.MultiTransformation;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.animal.wallpaper.MyApp;
import com.animal.wallpaper.R;
import com.animal.wallpaper.listener.ItemCLickListener;
import com.animal.wallpaper.utils.Common;
import com.animal.wallpaper.utils.DbManager;
import com.animal.wallpaper.Data;
import java.util.ArrayList;
import java.util.List;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
public class AdapterLike extends RecyclerView.Adapter<BaseVh> {
private List<Data> dataInfo = new ArrayList<>();
private Context myContext;
private ItemCLickListener itemCLickListener;
public void setInfoWallpaperListener(ItemCLickListener itemCLickListener) {
this.itemCLickListener = itemCLickListener;
}
public AdapterLike(Context myCon) {
myContext = myCon;
}
public void setDataInfo(List<Data> dataInfo) {
this.dataInfo = dataInfo;
notifyDataSetChanged();
}
@NonNull
@Override
public BaseVh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(myContext).inflate(R.layout.item_wallpaper, parent, false);
return new BaseVh(itemView);
}
@Override
public void onBindViewHolder(@NonNull BaseVh holder, int position) {
Data info = dataInfo.get(position);
ImageView imageView = holder.getImageView();
ImageView imFavorite = holder.getImFavorite();
String previewUrl400 = info.getPreviewUrl400();
String imId = info.getImId();
MultiTransformation<Bitmap> multiTransformation = new MultiTransformation<>(
new CenterCrop(),
new RoundedCornersTransformation(Common.dp2Px(12), 0) // 圆角效果
);
Glide.with(myContext)
.load(previewUrl400)
.placeholder(R.drawable.place_holder)
.transform(multiTransformation)
.into(imageView);
imFavorite.setSelected(true);
imFavorite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imFavorite.setSelected(false);
DbManager.deleteLike(info);
int adapterPosition = holder.getAdapterPosition();
notifyItemRemoved(adapterPosition);
Log.d(MyApp.TAG,"----------notifyItemRemoved-adapterPosition="+adapterPosition);
}
});
holder.getItemRoot().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (itemCLickListener != null) {
itemCLickListener.onItemClickAction(info);
}
}
});
}
@Override
public int getItemCount() {
return dataInfo.size();
}
}

View File

@ -0,0 +1,105 @@
package com.animal.wallpaper.adapter;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.MultiTransformation;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.animal.wallpaper.R;
import com.animal.wallpaper.listener.ItemCLickListener;
import com.animal.wallpaper.utils.Common;
import com.animal.wallpaper.utils.DbManager;
import com.animal.wallpaper.Data;
import java.util.ArrayList;
import java.util.List;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
public class AdapterWallapper extends RecyclerView.Adapter<BaseVh> {
private List<Data> dataInfo = new ArrayList<>();
private Context myContext;
private ItemCLickListener itemCLickListener;
public void setInfoWallpaperListener(ItemCLickListener itemCLickListener) {
this.itemCLickListener = itemCLickListener;
}
public AdapterWallapper(Context myCon) {
myContext = myCon;
}
public void setDataInfo(List<Data> dataInfo) {
this.dataInfo = dataInfo;
notifyDataSetChanged();
}
@NonNull
@Override
public BaseVh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(myContext).inflate(R.layout.item_wallpaper, parent, false);
return new BaseVh(itemView);
}
@Override
public void onBindViewHolder(@NonNull BaseVh holder, int position) {
Data info = dataInfo.get(position);
ImageView imageView = holder.getImageView();
String previewUrl400 = info.getPreviewUrl400();
String imId = info.getImId();
MultiTransformation<Bitmap> multiTransformation = new MultiTransformation<>(
new CenterCrop(),
new RoundedCornersTransformation(Common.dp2Px(12), 0) // 圆角效果
);
Glide.with(myContext)
.load(previewUrl400)
.placeholder(R.drawable.place_holder)
.transform(multiTransformation)
.into(imageView);
ImageView imFavorite = holder.getImFavorite();
boolean b = DbManager.queryIsLike(imId);
imFavorite.setSelected(b);
imFavorite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean selected = imFavorite.isSelected();
imFavorite.setSelected(!selected);
if(imFavorite.isSelected()){
DbManager.addLike(info);
}else {
DbManager.deleteLike(info);
}
}
});
holder.getItemRoot().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (itemCLickListener != null) {
itemCLickListener.onItemClickAction(info);
}
}
});
}
@Override
public int getItemCount() {
return dataInfo.size();
}
}

View File

@ -0,0 +1,35 @@
package com.animal.wallpaper.adapter;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.animal.wallpaper.R;
public class BaseVh extends RecyclerView.ViewHolder{
private ImageView imageView;
private RelativeLayout itemRoot;
private ImageView imFavorite;
public BaseVh(@NonNull View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.wallpaper);
itemRoot = itemView.findViewById(R.id.item_root);
imFavorite = itemView.findViewById(R.id.image_favorite);
}
public ImageView getImFavorite() {
return imFavorite;
}
public RelativeLayout getItemRoot() {
return itemRoot;
}
public ImageView getImageView() {
return imageView;
}
}

View File

@ -0,0 +1,89 @@
package com.animal.wallpaper.dialog;
import android.app.Dialog;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import com.animal.wallpaper.databinding.DialogWallpaperBinding;
import com.animal.wallpaper.listener.OnSelectListener;
public class DialogSet extends DialogFragment {
private DialogWallpaperBinding vb;
private OnSelectListener listener;
public static final int type_home =0;
public static final int type_lock =1;
public static final int type_both =2;
public void setListener(OnSelectListener listener) {
this.listener = listener;
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
vb = DialogWallpaperBinding.inflate(getLayoutInflater());
init();
return vb.getRoot();
}
@Override
public void onStart() {
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
dialog.setCanceledOnTouchOutside(true);
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
}
}
}
private void init(){
vb.layoutHome.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(listener!= null){
listener.onSelectType(type_home);
dismiss();
}
}
});
vb.layoutLock.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(listener!= null){
listener.onSelectType(type_lock);
dismiss();
}
}
});
vb.layoutBoth.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(listener!= null){
listener.onSelectType(type_both);
dismiss();
}
}
});
}
}

View File

@ -0,0 +1,8 @@
package com.animal.wallpaper.listener;
import com.animal.wallpaper.Data;
public interface ItemCLickListener {
public void onItemClickAction(Data info);
}

View File

@ -0,0 +1,9 @@
package com.animal.wallpaper.listener;
import com.animal.wallpaper.Data;
import java.util.List;
public interface OnLikeListener {
void onLikeList(List<Data> dataList);
}

View File

@ -0,0 +1,6 @@
package com.animal.wallpaper.listener;
public interface OnSelectListener {
void onSelectType(int type);
}

View File

@ -0,0 +1,8 @@
package com.animal.wallpaper.listener;
import com.animal.wallpaper.Data;
public interface OnUpdateListener {
void onAdd(Data data);
void onRemove(Data data);
}

View File

@ -0,0 +1,354 @@
package com.animal.wallpaper.ui;
import android.app.WallpaperManager;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import com.animal.wallpaper.MyApp;
import com.animal.wallpaper.R;
import com.animal.wallpaper.listener.OnSelectListener;
import com.animal.wallpaper.databinding.ActivityInfoBinding;
import com.animal.wallpaper.utils.Common;
import com.animal.wallpaper.utils.CommonKt;
import com.animal.wallpaper.utils.DbManager;
import com.animal.wallpaper.dialog.DialogSet;
import com.animal.wallpaper.Data;
//import com.animal.wallpaper.topon.AdManager;
//import com.animal.wallpaper.topon.onActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
public class DetailInfoActivity extends AppCompatActivity implements OnSelectListener {
private Data data;
private WallpaperManager wallpaperManager;
private ActivityInfoBinding vb;
private Drawable fullDrawable;
private int permissionCode = 1;
private String mSavePath;
private String imId;
private String fullUrl;
private DialogSet dialogSet;
private File downloadFile;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
vb = ActivityInfoBinding.inflate(getLayoutInflater());
Common.initFull(this, true);
setContentView(vb.getRoot());
// AdManager.showTopOn(this, new onActionListener() {
// @Override
// public void onAction() {
//
// }
// });
// AdManager.loadAllAd();
data = (Data) getIntent().getSerializableExtra(MyApp.key_info);
if (data == null) {
return;
}
imId = data.getImId();
mSavePath = CommonKt.INSTANCE.getSaveFilePath(this, imId);
wallpaperManager = WallpaperManager.getInstance(this);
initClick();
loadDetail();
}
private void loadDetail() {
String previewUrl400 = data.getPreviewUrl400();
String authorHeader = data.getAuthorHeader();
String authorName = data.getAuthorName();
String authorHtml = data.getAuthorHtml();
fullUrl = data.getFullUrl();
int width = vb.imageviewPreview.getWidth();
int height = vb.imageviewPreview.getHeight();
// vb.imageviewPreview.setScaleType(ImageView.ScaleType.FIT_START);
Glide.with(this)
.load(fullUrl)
// .override(width, height)
.thumbnail(
Glide.with(this)
.load(previewUrl400)
.centerCrop()// 先加载缩略图
)
.transition(DrawableTransitionOptions.withCrossFade(500)) // 500ms 淡入效果
// .centerCrop()
.listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
Log.d(MyApp.TAG, "-----------onLoadFailed e" + e.getMessage());
return false;
}
@Override
public boolean onResourceReady(@NonNull Drawable resource, @NonNull Object model, Target<Drawable> target, @NonNull DataSource dataSource, boolean isFirstResource) {
fullDrawable = resource;
return false;
}
})
.into(vb.imageviewPreview);
Glide.with(this)
.load(authorHeader)
.transform(new CircleCrop())
.into(vb.imageHeader);
vb.textName.setText(authorName);
vb.textHtml.setText(authorHtml);
boolean b = DbManager.queryIsLike(imId);
vb.imageFavorite.setSelected(b);
}
private void initClick() {
vb.imageviewBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
vb.buttonSet.setOnClickListener(v -> {
if (dialogSet == null) {
dialogSet = new DialogSet();
dialogSet.setListener(DetailInfoActivity.this);
}
if(!dialogSet.isAdded()){
dialogSet.show(getSupportFragmentManager(), "");
}
});
vb.imageFavorite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean selected = vb.imageFavorite.isSelected();
vb.imageFavorite.setSelected(!selected);
boolean selectedNew = vb.imageFavorite.isSelected();
if (selectedNew) {
DbManager.addLike(data);
} else {
DbManager.deleteLike(data);
}
}
});
vb.layoutDownload.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDownloadLoading(true);
File file = new File(mSavePath);
if (file.exists()) {
Log.d(MyApp.TAG, "-----------Download 1");
startSave(file);
return;
}
if (downloadFile != null && downloadFile.exists()) {
Log.d(MyApp.TAG, "-----------Download 2");
startSave(downloadFile);
return;
}
if (fullDrawable == null) {
Log.d(MyApp.TAG, "-----------Download 3");
CommonKt.INSTANCE.downloadFile(fullUrl, mSavePath, new Function2<Boolean, InputStream, Unit>() {
@Override
public Unit invoke(Boolean aBoolean, InputStream inputStream) {
File file = new File(mSavePath);
if (aBoolean && file.exists()) {
downloadFile = file;
runOnUiThread(new Runnable() {
@Override
public void run() {
Glide.with(DetailInfoActivity.this)
.load(downloadFile)
.into(vb.imageviewPreview);
}
});
startSave(downloadFile);
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
showDownloadLoading(false);
Toast.makeText(DetailInfoActivity.this, getString(R.string.download_fail), Toast.LENGTH_SHORT).show();
}
});
}
return null;
}
});
return;
}
Log.d(MyApp.TAG, "-----------Download 4");
Common.saveDrawableToFile(fullDrawable, mSavePath);
startSave(file);
}
});
}
private void showDownloadLoading(boolean show) {
if (show) {
vb.pbDownload.setVisibility(View.VISIBLE);
vb.imageDownload.setVisibility(View.GONE);
} else {
vb.pbDownload.setVisibility(View.GONE);
vb.imageDownload.setVisibility(View.VISIBLE);
}
}
private void showSetWallpaperLoading(boolean show) {
Log.d(MyApp.TAG, "-----------showSetWallpaperLoading" + show);
if (show) {
vb.pbSet.setVisibility(View.VISIBLE);
vb.buttonSet.setVisibility(View.GONE);
} else {
vb.pbSet.setVisibility(View.GONE);
vb.buttonSet.setVisibility(View.VISIBLE);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == permissionCode && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startSave(new File(mSavePath));
}
}
private void startSave(File file) {
boolean permission = CommonKt.INSTANCE.requestPermission(DetailInfoActivity.this, permissionCode);
if (permission) {
Uri uri = CommonKt.INSTANCE.saveToGallery(DetailInfoActivity.this, file);
runOnUiThread(new Runnable() {
@Override
public void run() {
showDownloadLoading(false);
if (uri == null) {
Toast.makeText(DetailInfoActivity.this, getString(R.string.download_fail), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(DetailInfoActivity.this, getString(R.string.download_success), Toast.LENGTH_SHORT).show();
}
Log.d(MyApp.TAG, "--------path=" + file.getAbsolutePath() + "---uri=" + uri);
}
});
}
}
@Override
public void onSelectType(int type) {
showSetWallpaperLoading(true);
File file = null;
if (downloadFile != null) {
file = downloadFile;
setWallpaper(file, type);
} else if (fullDrawable != null) {
file = new File(Common.saveDrawableToFile(fullDrawable, mSavePath));
setWallpaper(file, type);
} else {
CommonKt.INSTANCE.downloadFile(fullUrl, mSavePath, new Function2<Boolean, InputStream, Unit>() {
@Override
public Unit invoke(Boolean aBoolean, InputStream inputStream) {
File file = new File(mSavePath);
if (aBoolean && file.exists()) {
downloadFile = file;
setWallpaper(downloadFile, type);
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
showSetWallpaperLoading(false);
Toast.makeText(DetailInfoActivity.this, getString(R.string.set_fail), Toast.LENGTH_SHORT).show();
}
});
}
return null;
}
});
}
}
private void setWallpaper(File file, int type) {
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
FileInputStream fileInputStream = new FileInputStream(file);
switch (type) {
case DialogSet.type_home:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
wallpaperManager.setStream(fileInputStream);
} else {
wallpaperManager.setStream(
fileInputStream,
null,
true,
WallpaperManager.FLAG_SYSTEM
);
}
break;
case DialogSet.type_lock:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
wallpaperManager.setStream(fileInputStream);
} else {
wallpaperManager.setStream(
fileInputStream,
null,
true,
WallpaperManager.FLAG_LOCK
);
}
break;
case DialogSet.type_both:
wallpaperManager.setStream(fileInputStream);
break;
}
showSetWallpaperLoading(false);
Toast.makeText(DetailInfoActivity.this, getString(R.string.set_success), Toast.LENGTH_SHORT).show();
} catch (Exception exception) {
showSetWallpaperLoading(false);
Toast.makeText(DetailInfoActivity.this, getString(R.string.set_fail), Toast.LENGTH_SHORT).show();
}
}
});
}
}

View File

@ -0,0 +1,96 @@
package com.animal.wallpaper.ui;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import com.animal.wallpaper.Data;
import com.animal.wallpaper.MyApp;
import com.animal.wallpaper.adapter.AdapterLike;
import com.animal.wallpaper.databinding.FragmentLikeBinding;
import com.animal.wallpaper.listener.ItemCLickListener;
import com.animal.wallpaper.listener.OnLikeListener;
import com.animal.wallpaper.utils.DbManager;
import com.animal.wallpaper.utils.RecyclerItemSpace;
import java.util.List;
import io.objectbox.reactive.DataSubscription;
public class LikeFragment extends Fragment implements ItemCLickListener {
private FragmentLikeBinding vb;
private DataSubscription dataSubscription;
public LikeFragment() {
}
public static LikeFragment newInstance() {
LikeFragment fragment = new LikeFragment();
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
vb = FragmentLikeBinding.inflate(getLayoutInflater());
initList();
return vb.getRoot();
}
private void initList() {
AdapterLike adapterFavorite = new AdapterLike(requireContext());
dataSubscription = DbManager.setLikeDataListener(new OnLikeListener() {
@Override
public void onLikeList(List<Data> dataList) {
Log.d(MyApp.TAG, "------size = " + dataList.size());
if(dataList.size()==0){
vb.layoutNoData.setVisibility(View.VISIBLE);
vb.listRecycler.setVisibility(View.GONE);
}else {
vb.layoutNoData.setVisibility(View.GONE);
vb.listRecycler.setVisibility(View.VISIBLE);
adapterFavorite.setDataInfo(dataList);
}
}
});
RecyclerItemSpace recyclerItemSpace = new RecyclerItemSpace(10, 10, 15);
GridLayoutManager gridLayoutManager = new GridLayoutManager(requireContext(), 2);
vb.listRecycler.setLayoutManager(gridLayoutManager);
vb.listRecycler.addItemDecoration(recyclerItemSpace);
adapterFavorite.setInfoWallpaperListener(this);
vb.listRecycler.setAdapter(adapterFavorite);
}
@Override
public void onItemClickAction(Data info) {
Intent intent = new Intent(requireContext(), DetailInfoActivity.class);
intent.putExtra(MyApp.key_info, info);
startActivity(intent);
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (dataSubscription != null) {
dataSubscription.cancel();
}
Log.d(MyApp.TAG,"------favoriteFragment-onDestroyView");
}
}

View File

@ -0,0 +1,106 @@
package com.animal.wallpaper.ui;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import com.animal.wallpaper.R;
import com.animal.wallpaper.databinding.ActivityMainBinding;
import com.animal.wallpaper.databinding.TabCustomViewBinding;
import com.animal.wallpaper.utils.Common;
import com.google.android.material.tabs.TabLayout;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding vb;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
vb = ActivityMainBinding.inflate(getLayoutInflater());
Common.initFull(this,false);
setContentView(vb.getRoot());
List<Fragment> list = new ArrayList<>();
// list.add(SearchFragment.newInstance());
list.add(MainFragment.newInstance(1));
list.add(LikeFragment.newInstance());
int[] ints = {R.drawable.tab_anmials, R.drawable.tab_favorite};
vb.viewpager2.setAdapter(new FragmentStateAdapter(this) {
@NonNull
@Override
public Fragment createFragment(int position) {
return list.get(position);
}
@Override
public int getItemCount() {
return list.size();
}
});
vb.viewpager2.setUserInputEnabled(false);
for(int i = 0;i<list.size();i++){
TabLayout.Tab tab = vb.tab.newTab();
TabCustomViewBinding tabVb = TabCustomViewBinding.inflate(getLayoutInflater());
tabVb.imageIcon.setImageDrawable(ContextCompat.getDrawable(this,ints[i]));
tab.setCustomView(tabVb.getRoot());
if(i ==0){
tabVb.imageIndicator.setVisibility(View.VISIBLE);
}else {
tabVb.imageIndicator.setVisibility(View.GONE);
}
vb.tab.addTab(tab);
}
vb.tab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
int position = tab.getPosition();
vb.viewpager2.setCurrentItem(position);
View customView = tab.getCustomView();
View imageIndicator = customView.findViewById(R.id.image_indicator);
imageIndicator.setVisibility(View.VISIBLE);
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
View customView = tab.getCustomView();
View imageIndicator = customView.findViewById(R.id.image_indicator);
imageIndicator.setVisibility(View.INVISIBLE);
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
vb.btnSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, SearchActivity.class);
startActivity(intent);
}
});
}
}

View File

@ -0,0 +1,111 @@
package com.animal.wallpaper.ui;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import com.animal.wallpaper.Data;
import com.animal.wallpaper.MyApp;
import com.animal.wallpaper.adapter.AdapterWallapper;
import com.animal.wallpaper.databinding.FragmentMainBinding;
import com.animal.wallpaper.listener.ItemCLickListener;
import com.animal.wallpaper.listener.OnUpdateListener;
import com.animal.wallpaper.utils.DbManager;
import com.animal.wallpaper.utils.RecyclerItemSpace;
import java.util.List;
public class MainFragment extends Fragment implements ItemCLickListener {
private int mWallpaperType;
private List<Data> userList;
private FragmentMainBinding vb;
public MainFragment() {
}
public static MainFragment newInstance(int type) {
Bundle bundle = new Bundle();
bundle.putInt(MyApp.key_type, type);
MainFragment fragment = new MainFragment();
fragment.setArguments(bundle);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mWallpaperType = getArguments().getInt(MyApp.key_type);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
vb = FragmentMainBinding.inflate(getLayoutInflater());
initList();
return vb.getRoot();
}
private void initList() {
RecyclerItemSpace recyclerItemSpace = new RecyclerItemSpace(10, 10, 15);
GridLayoutManager gridLayoutManager = new GridLayoutManager(requireContext(), 2);
vb.listRecycler.setLayoutManager(gridLayoutManager);
vb.listRecycler.addItemDecoration(recyclerItemSpace);
AdapterWallapper adapterWallapper = new AdapterWallapper(requireContext());
if (mWallpaperType == 0) {
userList = MyApp.getAnimalsList();
} else {
userList = MyApp.getAnimalsList();
}
adapterWallapper.setDataInfo(userList);
adapterWallapper.setInfoWallpaperListener(this);
vb.listRecycler.setAdapter(adapterWallapper);
DbManager.addOnAddOrRemoveListener(new OnUpdateListener() {
@Override
public void onAdd(Data data) {
int index = userList.indexOf(data);
Log.d(MyApp.TAG,"---mWallpaperType="+mWallpaperType+"----onAdd index="+index);
adapterWallapper.notifyItemChanged(index);
}
@Override
public void onRemove(Data data) {
int index = userList.indexOf(data);
adapterWallapper.notifyItemChanged(index);
Log.d(MyApp.TAG,"---mWallpaperType="+mWallpaperType+"----onRemove index="+index);
}
});
}
@Override
public void onItemClickAction(Data info) {
Intent intent = new Intent(requireContext(), DetailInfoActivity.class);
intent.putExtra(MyApp.key_info, info);
startActivity(intent);
}
}

View File

@ -0,0 +1,124 @@
package com.animal.wallpaper.ui;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import android.widget.Toast;
import com.animal.wallpaper.MyApp;
import com.animal.wallpaper.R;
import com.animal.wallpaper.listener.ItemCLickListener;
import com.animal.wallpaper.databinding.ActivitySearchBinding;
import com.animal.wallpaper.utils.Common;
import com.animal.wallpaper.utils.DbManager;
import com.animal.wallpaper.utils.RecyclerItemSpace;
import com.animal.wallpaper.Data;
import com.animal.wallpaper.adapter.AdapterWallapper;
import java.util.List;
public class SearchActivity extends AppCompatActivity implements ItemCLickListener {
private ActivitySearchBinding vb;
private AdapterWallapper adapterWallapper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
vb = ActivitySearchBinding.inflate(getLayoutInflater());
Common.initFull(this, false);
setContentView(vb.getRoot());
initList();
}
private void initList() {
adapterWallapper = new AdapterWallapper(this);
adapterWallapper.setInfoWallpaperListener(this);
RecyclerItemSpace recyclerItemSpace = new RecyclerItemSpace(10, 10, 15);
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 2);
vb.resultRecycler.setLayoutManager(gridLayoutManager);
vb.resultRecycler.addItemDecoration(recyclerItemSpace);
vb.resultRecycler.setAdapter(adapterWallapper);
vb.et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
startSearch();
return true;
}
return false;
}
});
vb.btnSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startSearch();
}
});
vb.back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void closeKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(vb.et.getWindowToken(), 0);
}
private void startSearch() {
closeKeyboard();
vb.searchPb.setVisibility(View.VISIBLE);
String string = vb.et.getText().toString();
if (!string.isEmpty()) {
List<Data> search = DbManager.search(string);
if (search.size() > 0) {
showEmpty(false);
adapterWallapper.setDataInfo(search);
vb.searchPb.setVisibility(View.GONE);
} else {
vb.searchPb.setVisibility(View.GONE);
showEmpty(true);
}
Log.d(MyApp.TAG, "--------------size=" + search.size());
for (Data data : search) {
Log.d(MyApp.TAG, "--------------data=" + data.getDescription());
}
} else {
vb.searchPb.setVisibility(View.GONE);
Toast.makeText(SearchActivity.this, getString(R.string.please_input_keyword), Toast.LENGTH_SHORT).show();
}
}
private void showEmpty(boolean showEmpty) {
if (showEmpty) {
vb.emptyLayout.setVisibility(View.VISIBLE);
vb.resultRecycler.setVisibility(View.GONE);
} else {
vb.emptyLayout.setVisibility(View.GONE);
vb.resultRecycler.setVisibility(View.VISIBLE);
}
}
@Override
public void onItemClickAction(Data info) {
Intent intent = new Intent(this, DetailInfoActivity.class);
intent.putExtra(MyApp.key_info, info);
startActivity(intent);
}
}

View File

@ -0,0 +1,77 @@
package com.animal.wallpaper.ui;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.animal.wallpaper.databinding.ActivityWelcomeBinding;
import com.animal.wallpaper.utils.Common;
public class WelcomeActivity extends AppCompatActivity {
private CountDownTimer countDownTimer;
private ActivityWelcomeBinding vb;
private long totalTime = 1000;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
vb = ActivityWelcomeBinding.inflate(getLayoutInflater());
Common.initFull(this,false);
setContentView(vb.getRoot());
// countDownTimer = AdManager.showWelcomeAd(this, totalTime, new CountAction() {
// @Override
// public void onCount(long millisUntilFinished) {
// int progressPercentage = (int) ((100 * millisUntilFinished) / totalTime);
//
// int countdownPercentage = 100 - progressPercentage;
//
// vb.progressbar.setProgress(countdownPercentage);
// }
// }, new GoMainAction() {
// @Override
// public void onGo() {
// vb.progressbar.setProgress(100);
// Intent intent = new Intent(WElActivity.this, HomeActivity.class);
// startActivity(intent);
// finish();
// }
// });
countDownTimer = new CountDownTimer(totalTime,100) {
@Override
public void onTick(long millisUntilFinished) {
int progressPercentage = (int) ((100 * millisUntilFinished) / totalTime);
int countdownPercentage = 100 - progressPercentage;
vb.progressbar.setProgress(countdownPercentage);
}
@Override
public void onFinish() {
vb.progressbar.setProgress(100);
Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
};
countDownTimer.start();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (countDownTimer != null) {
countDownTimer.cancel();
countDownTimer = null;
}
}
}

View File

@ -0,0 +1,112 @@
package com.animal.wallpaper.utils;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import com.animal.wallpaper.MyApp;
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.Reader;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
public class Common {
public static String getCovertStr(InputStream stream) {
String covertStr = "";
try {
StringWriter writer = new StringWriter();
char[] buffer = new char[stream.available()];
Reader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
int a = 0;
while ((a = reader.read(buffer)) != -1) {
writer.write(buffer, 0, a);
}
covertStr = writer.toString();
} catch (IOException e) {
return covertStr;
}
return covertStr;
}
public static int dp2Px(int dp) {
float scale = MyApp.mAppContext.getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f);
}
public static void initFull(Activity activity, boolean light) {
Window window = activity.getWindow();
View decorView = window.getDecorView();
View rootView = decorView.getRootView();
if (light) {
} else {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
private static Bitmap getBitmap(Drawable drawable) {
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
// 创建一个空白的 Bitmap
Bitmap bitmap = Bitmap.createBitmap(
drawable.getIntrinsicWidth(),
drawable.getIntrinsicHeight(),
Bitmap.Config.ARGB_8888);
// Canvas 上绘制 Drawable
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
}
public static String saveDrawableToFile( Drawable drawable,String saveFilePath) {
// Drawable 转换为 Bitmap
Bitmap bitmap = getBitmap(drawable);
// 创建要保存的文件
File file = new File(saveFilePath);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
// Bitmap 写入文件 (使用 PNG 格式可改为 JPEG)
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return file.getAbsolutePath();
}
}

View File

@ -0,0 +1,259 @@
package com.animal.wallpaper.utils
import android.Manifest
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.provider.MediaStore
import android.util.Log
import androidx.core.app.ActivityCompat
import com.animal.wallpaper.MyApp
import com.animal.wallpaper.Data
import okhttp3.Call
import okhttp3.Callback
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.json.JSONArray
import java.io.BufferedReader
import java.io.ByteArrayOutputStream
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
import java.io.OutputStream
import java.io.StringWriter
import java.nio.charset.StandardCharsets
object CommonKt {
fun getData(context: Context, jsonStr: String): MutableList<Data> {
val jsonArray = JSONArray(jsonStr)
var data = mutableListOf<Data>()
for (i in 0 until jsonArray.length()) {
val get = jsonArray.getJSONObject(i)
val text_description = get.getString("alt_description")
val links = get.getJSONObject("links")
val download = links.getString("download")
val downloadLocation = links.getString("download_location")
val html = links.getString("html")
val urls = get.getJSONObject("urls")
val full = urls.getString("full")
val raw = urls.getString("raw")
val regular = urls.getString("regular")
val small = urls.getString("small")
val thumb = urls.getString("thumb")
val users = get.getJSONObject("user")
val portfolio_url = users.getString("portfolio_url")
val name = users.getString("name")
val header_large = users.getString("header_large")
val header_medium = users.getString("header_medium")
val header_small = users.getString("header_small")
val user_html = users.getString("authorHtml")
val host = "https://unsplash.com/photos/"
val indexOf = download.indexOf("/download")
val substring = download.substring(host.length, indexOf)
// Log.d(MyApp.TAG, "i=$i----------substring=$substring")
val bean = Data().apply {
imId = substring
description =text_description
fullUrl = download
previewUrl1080 = regular
previewUrl400 = small
previewUrl200 = thumb
authorName = name
authorHeader = header_large
authorHtml = user_html
isLike = false
}
DbManager.insertOrUpdate(bean)
data.add(bean)
}
return data
}
fun downloadFile(
url: String,
savePath: String,
result: (Boolean, input: InputStream?) -> Unit
) {
var client = OkHttpClient()
var request = Request.Builder().url(url).build()
var call = client.newCall(request)
call.enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
result.invoke(false, null)
}
override fun onResponse(call: Call, response: Response) {
response.body?.run {
val byteStream = byteStream()
val writeFile = writeFile(byteStream, savePath)
result.invoke(writeFile, byteStream)
} ?: run {
result.invoke(false, null)
}
}
})
}
fun writeFile(input: InputStream, filePath: String): Boolean {
try {
val byte = ByteArray(4096)
val output = ByteArrayOutputStream()
var l: Int
while (input.read(byte).also { l = it } != -1) {
output.write(byte, 0, l)
}
val fileDe = File(filePath)
if (!fileDe.exists()) {
fileDe.createNewFile()
}
val fileOutputStream = FileOutputStream(filePath)
fileOutputStream.write(output.toByteArray())
output.close()
fileOutputStream.close()
return true
} catch (ex: Exception) {
Log.d("-----------", "---------ex=" + ex.message)
return false
}
}
private fun getImageContentValues(paramFile: File): ContentValues {
val time = System.currentTimeMillis()
val localContentValues = ContentValues()
localContentValues.put(MediaStore.Images.Media.TITLE, paramFile.name)
localContentValues.put(MediaStore.Images.Media.DISPLAY_NAME, paramFile.name)
localContentValues.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg")
localContentValues.put(MediaStore.Images.Media.RELATIVE_PATH, getSavePath())
// localContentValues.put(MediaStore.Images.Media.DATE_MODIFIED, time / 1000)
// localContentValues.put(MediaStore.Images.Media.DATE_ADDED, time / 1000)
return localContentValues
}
private fun getSavePath(): String {
return ""
}
private fun copyFile(oldPath: String, out: OutputStream?): Boolean {
try {
var bytesum = 0
var byteread = 0
val oldFile = File(oldPath)
if (oldFile.exists()) {
// 读入原文件
val inStream: InputStream = FileInputStream(oldPath)
val buffer = ByteArray(1444)
while (inStream.read(buffer).also { byteread = it } != -1) {
bytesum += byteread //字节数 文件大小
println(bytesum)
out!!.write(buffer, 0, byteread)
}
inStream.close()
out!!.close()
return true
} else {
}
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
return false
}
fun saveToGallery(context: Context, photoFile: File): Uri? {
val displayName = "${System.currentTimeMillis()}.jpg"
val contentValues = ContentValues().apply {
put(MediaStore.Images.Media.DISPLAY_NAME, displayName)
put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
put(MediaStore.Images.Media.IS_PENDING, 1)
}
}
val contentResolver = context.contentResolver
val collectionUri = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY)
} else {
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
}
val imageUri = contentResolver.insert(collectionUri, contentValues)
imageUri?.let { uri ->
try {
contentResolver.openOutputStream(uri)?.use { outputStream ->
val inputStream = FileInputStream(photoFile)
inputStream.copyTo(outputStream)
inputStream.close()
outputStream.close()
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
contentValues.clear()
contentValues.put(MediaStore.Images.Media.IS_PENDING, 0)
contentResolver.update(uri, contentValues, null, null)
} else {
}
return uri
} catch (e: IOException) {
Log.d(MyApp.TAG, "-----------------e=${e.printStackTrace()}")
return null
}
} ?: run {
Log.d(MyApp.TAG, "----------------false")
return null
}
}
fun requestPermission(context: Activity, requestCode: Int): Boolean {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
return true
}
return if (context.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(
context,
arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
requestCode
)
false
} else {
true
}
}
fun getSaveFilePath(context: Context,imId:String): String {
return "${context.cacheDir}/${imId}.jpg"
}
}

View File

@ -0,0 +1,158 @@
package com.animal.wallpaper.utils;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import com.animal.wallpaper.Data_;
import com.animal.wallpaper.MyApp;
import com.animal.wallpaper.MyObjectBox;
import com.animal.wallpaper.listener.OnUpdateListener;
import com.animal.wallpaper.listener.OnLikeListener;
import com.animal.wallpaper.Data;
import java.util.ArrayList;
import java.util.List;
import io.objectbox.Box;
import io.objectbox.BoxStore;
import io.objectbox.android.AndroidScheduler;
import io.objectbox.query.Query;
import io.objectbox.query.QueryBuilder;
import io.objectbox.reactive.DataObserver;
import io.objectbox.reactive.DataSubscription;
import io.objectbox.reactive.DataSubscriptionList;
public class DbManager {
private static BoxStore boxStore;
private static Box<Data> dataBox;
private static DataSubscription observer;
private static List<OnUpdateListener> list = new ArrayList<>();
public static void addOnAddOrRemoveListener(OnUpdateListener listener) {
list.add(listener);
}
public static void init(Context context) {
boxStore = MyObjectBox.builder().androidContext(context).build();
}
public static Box<Data> getObjectBox() {
if (dataBox == null) {
dataBox = boxStore.boxFor(Data.class);
}
return dataBox;
}
public static DataSubscription setLikeDataListener(OnLikeListener listener) {
Query<Data> build = getObjectBox().query()
.equal(Data_.isLike, true)
.build();
return build.subscribe(new DataSubscriptionList())
.on(AndroidScheduler.mainThread())
.observer(new DataObserver<List<Data>>() {
@Override
public void onData(@NonNull List<Data> data) {
Log.d(MyApp.TAG, "------data=" + data.size());
listener.onLikeList(data);
}
});
}
public static void insertOrUpdate(Data boxLike) {
Box<Data> objectBoxLike = getObjectBox();
String imId = boxLike.getImId();
Data first = objectBoxLike.query()
.equal(Data_.imId, imId, QueryBuilder.StringOrder.CASE_SENSITIVE)
.build()
.findFirst();
if (first == null) {
Log.d(MyApp.TAG, "-----------添加 " + imId);
objectBoxLike.put(boxLike);
for (OnUpdateListener listener : list) {
listener.onAdd(boxLike);
}
} else {
}
}
public static void addLike(Data boxLike) {
Box<Data> objectBoxLike = getObjectBox();
String imId = boxLike.getImId();
Data first = objectBoxLike.query()
.equal(Data_.imId, imId, QueryBuilder.StringOrder.CASE_SENSITIVE)
.build()
.findFirst();
if (first != null) {
first.setLike(true);
objectBoxLike.put(first);
for (OnUpdateListener listener : list) {
listener.onAdd(boxLike);
}
}
}
public static void deleteLike(Data likeData) {
Box<Data> objectBoxLike = getObjectBox();
String imId = likeData.getImId();
Data boxLike = objectBoxLike.query()
.equal(Data_.imId, imId, QueryBuilder.StringOrder.CASE_SENSITIVE)
.build()
.findFirst();
if (boxLike != null) {
boxLike.setLike(false);
objectBoxLike.put(boxLike);
for (OnUpdateListener listener : list) {
listener.onRemove(boxLike);
}
Log.d(MyApp.TAG, "--------deleteLike imId=" + imId);
}
}
public static boolean queryIsLike(String imId) {
Box<Data> objectBoxLike = getObjectBox();
Data first = objectBoxLike.query()
.equal(Data_.imId, imId, QueryBuilder.StringOrder.CASE_SENSITIVE)
.build()
.findFirst();
if (first != null) {
if (first.isLike()) {
return true;
} else {
return false;
}
} else return false;
}
public static List<Data> search(String name) {
Box<Data> objectBoxLike = getObjectBox();
List<Data> data = objectBoxLike.query()
.contains(Data_.description, name, QueryBuilder.StringOrder.CASE_SENSITIVE)
.build()
.find();
return data;
}
}

View File

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

View File

@ -0,0 +1,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,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_white_80" />
<corners android:radius="16dp"/>
</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="16dp"/>
<stroke android:width="2dp" android:color="@color/color1"/>
</shape>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/color_white_80"/>
</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">
<solid android:color="@color/color3" />
<corners android:radius="16dp"/>
</shape>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</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="M154.5,469.3H981.3a42.7,42.7 0,1 1,0 85.3H154.5l300.7,266.9a42.7,42.7 0,1 1,-57.1 63.4l-384,-341.3a42.7,42.7 0,0 1,0 -63.4l384,-341.3a42.7,42.7 0,1 1,57.1 63.4L154.5,469.3z"
android:fillColor="#2c2c2c"/>
</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="M747.2,283.2L54.5,283.2v692.7h692.7v-692.7zM656.8,373.6v512h-512v-512h512z"
android:fillColor="@color/white"/>
<path
android:pathData="M993.3,12.4v692.7h-287.2v-90.4h196.8v-512h-512v224.4h-90.4V12.4z"
android:fillColor="@color/white"/>
</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="M878.6,337.2a57.8,57.8 0,0 0,-81.7 0L574.6,559.5V173a57.8,57.8 0,0 0,-115.6 0v386.5L236.8,337.2a57.8,57.8 0,0 0,-81.7 0,57.8 57.8,0 0,0 0,81.8l318.7,318.7a57.6,57.6 0,0 0,40.9 16.9c0.7,0 1.5,-0.1 2.2,-0.1 0.7,0 1.5,0.1 2.2,0.1a57.6,57.6 0,0 0,40.9 -16.9L878.6,419a57.8,57.8 0,0 0,0 -81.8zM861,908.4H165.4a57.8,57.8 0,0 1,0 -115.6h695.6a57.8,57.8 0,0 1,0 115.6z"
android:fillColor="@color/color1"/>
</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/white"
android:pathData="M776.7,1010.1h-479.9c-28.3,0 -51.3,-23 -51.3,-51.3v-891.1c0,-28.3 23,-51.3 51.3,-51.3h479.9c28.3,0 51.3,23 51.3,51.3v891.1c0,28.3 -23,51.3 -51.3,51.3v0zM536.6,958.8c19.1,0 34.2,-15.4 34.2,-34.2s-15.4,-34.2 -34.2,-34.2 -34.2,15.4 -34.2,34.2 15.4,34.2 34.2,34.2v0zM776.7,119h-479.9v719.7h479.6v-719.7h0.3z"/>
</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/white"
android:pathData="M426.9,683l170.8,0c25.6,0 42.7,-17.1 42.7,-42.7L640.3,512.3c0,-25.6 -17.1,-42.7 -42.7,-42.7l0,-42.7c0,-47 -38.4,-85.4 -85.4,-85.4s-85.4,38.4 -85.4,85.4l0,42.7c-25.6,0 -42.7,17.1 -42.7,42.7l0,128.1C384.2,666 401.3,683 426.9,683zM461,426.9c0,-29.9 21.3,-51.2 51.2,-51.2s51.2,21.3 51.2,51.2l0,42.7 -102.5,0L461,426.9 461,426.9zM725.7,42.7 L298.8,42.7c-47,0 -85.4,38.4 -85.4,85.4l0,768.4c0,47 38.4,85.4 85.4,85.4l426.9,0c47,0 85.4,-38.4 85.4,-85.4L811.1,128.1C811.1,81.1 772.7,42.7 725.7,42.7zM725.7,811.1 L298.8,811.1 298.8,213.4l426.9,0L725.7,811.1z"/>
</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="M271.9,728.1v-412.2c0,-30.7 18.9,-53.8 39.9,-53.8h412.2c21,0 39.9,23.6 39.9,54.3v220.2c0,2 0.5,4.1 1,5.6l14.8,-5.6v-220.2c0,-38.9 -25.1,-70.1 -56.3,-70.1h-412.2c-31.2,0 -56.3,31.2 -56.3,70.1v418.3l16.9,-6.7zM271.9,728.1v-412.2c0,-30.7 18.9,-53.8 39.9,-53.8h412.2c21,0 39.9,23.6 39.9,54.3v220.2c0,2 0.5,4.1 1,5.6l14.8,-5.6v-220.2c0,-38.9 -25.1,-70.1 -56.3,-70.1h-412.2c-31.2,0 -56.3,31.2 -56.3,70.1v418.3l16.9,-6.7zM958.5,800.8c-21.5,-16.9 -45.6,-29.7 -71.7,-38.4 -4.1,-1 -8.7,1.5 -9.7,5.6 -1,4.1 1,8.2 4.6,9.7 24.1,8.2 46.6,20.5 67.1,35.8 3.6,2.6 8.7,1.5 11.3,-2 2,-3.1 1.5,-7.7 -1.5,-10.8zM517.6,817.2c-37.9,0 -75.3,10.2 -108,30.2 -45.6,-61.4 -117.2,-97.3 -194,-97.3 -54.3,0 -107.5,18.4 -150,52.2 -3.1,3.1 -3.6,8.2 -0.5,11.3 2.6,3.1 7.2,3.6 10.2,1 39.9,-31.7 89.1,-48.6 140.3,-48.6 74.8,0 143.4,36.4 185.3,96.8 2.6,3.6 7.2,4.6 11.3,2 31.2,-21 68.1,-31.7 105.5,-31.7 35.8,0 69.6,9.7 99.8,27.6 3.6,2 8.2,1 10.8,-2 13.3,-17.9 29.2,-34.3 47.1,-47.6 3.6,-3.1 4.1,-8.2 1,-11.3 -2.6,-3.1 -7.2,-3.6 -10.8,-1.5 -17.4,12.8 -32.8,28.2 -46.1,45.1 -31.7,-16.9 -66.6,-26.1 -101.9,-26.1zM855.6,846.8c-41,-27.6 -96.3,-16.9 -123.9,23.6l-3.1,4.6c-2,3.6 -1,8.7 3.1,11.3 3.6,2 8.7,1 11.3,-3.1 8.2,-14.3 21.5,-25.1 36.9,-31.2 22.5,-8.7 47.6,-5.6 67.6,7.7 3.6,2.6 8.7,1.5 11.3,-2 1.5,-3.1 0.5,-8.2 -3.1,-10.8zM185.3,248.8c2,1.5 2,4.6 0.5,6.1m-45.1,205.3l-18.9,21c-1,1 -2.6,1 -3.6,0 -1,-1 -1,-2.6 0,-3.6l18.9,-21c1,-1 2.6,-1 3.6,0 1,1 1,2.6 0,3.6zM165.4,460.3l-18.9,21c-1,1 -2.6,1 -3.6,0 -1,-1 -1,-2.6 0,-3.6l18.9,-21c1,-1 2.6,-1 3.6,0 0.5,1 1,2.6 0,3.6zM813.1,146.4l-38.4,43c-2,2.6 -6.1,2.6 -8.2,0.5 -2.6,-2 -2.6,-6.1 -0.5,-8.2l38.4,-43c2,-2.6 6.1,-2.6 8.2,-0.5 2.6,2 2.6,5.6 0.5,8.2zM863.7,146.4l-38.4,43c-2,2.6 -6.1,2.6 -8.2,0.5 -2.6,-2 -2.6,-6.1 -0.5,-8.2l38.4,-43c2,-2.6 6.1,-2.6 8.2,-0.5 2.6,2 3.1,5.6 0.5,8.2z"
android:fillColor="@color/sub_title_color"/>
<path
android:pathData="M390.1,451.6c-17.9,0.5 -32.8,-13.8 -33.3,-31.2 -0.5,-17.9 13.8,-32.8 31.2,-33.3h1.5c17.9,0.5 31.7,15.4 31.2,33.3 0.5,16.9 -13.3,30.7 -30.7,31.2zM382.5,419.3c6.1,0 10.8,-4.6 10.8,-10.8 0,-6.1 -4.6,-10.8 -10.8,-10.8 -6.1,0 -10.8,4.6 -10.8,10.8 0,6.1 4.6,10.8 10.8,10.8zM656.4,451.6c-17.9,0.5 -32.8,-13.8 -33.3,-31.2 -0.5,-17.9 13.8,-32.8 31.2,-33.3h1.5c17.9,0.5 31.7,15.4 31.2,33.3 0.5,16.9 -13.3,30.7 -30.7,31.2zM648.2,419.3c6.1,0 10.8,-4.6 10.8,-10.8 0,-6.1 -4.6,-10.8 -10.8,-10.8s-10.8,4.6 -10.8,10.8c0,6.1 5.1,10.8 10.8,10.8zM596,515.1c-2,0 -4.1,-1 -5.6,-2.6 -11.8,-12.3 -23.6,-17.9 -35.3,-17.4 -11.3,0.5 -21,7.7 -26.1,14.3 -2.6,3.6 -7.7,4.1 -11.3,1.5 -0.5,-0.5 -1,-0.5 -1,-1 -14.3,-16.4 -26.6,-15.9 -36.4,-13.8 -8.2,2 -16.4,6.7 -24.6,14.3 -3.1,3.1 -8.2,2.6 -11.3,-0.5 -3.1,-3.1 -2.6,-8.2 0.5,-11.3 10.2,-9.2 21,-15.4 31.7,-17.9 17.4,-4.6 32.8,-0.5 46.6,12.3 6.7,-6.1 17.4,-12.8 31.7,-13.8 16.4,-1 32.3,6.7 47.6,22.5 3.1,3.1 3.1,8.2 0,11.3 -2.6,1 -4.6,2 -6.7,2zM765.4,798.2c-64.5,0 -116.7,-52.2 -116.7,-116.7 0,-64.5 52.2,-116.7 116.7,-116.7 64.5,0 116.7,52.2 116.7,116.7 0,64.5 -52.2,116.7 -116.7,116.7zM707.6,666.6c-8.7,0 -16.4,7.2 -15.9,16.4 0,8.7 7.2,15.9 15.9,15.9h118.3c8.7,0 16.4,-7.2 15.9,-16.4 0,-8.7 -7.2,-15.9 -15.9,-15.9h-118.3z"
android:fillColor="@color/sub_title_color"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M222.1,580.4a356.2,356.2 0,0 0,34.1 152.9,357.6 357.6,0 0,0 477.7,-477.7A357.6,357.6 0,0 0,222.1 580.4z"
android:fillColor="@color/color2"/>
<path
android:pathData="M1009,936.6l-276.1,-276.1a409.5,409.5 0,1 0,-72.3 72.3l276.1,276.1a51.2,51.2 0,0 0,72.3 -72.3zM409.8,716.9a307.1,307.1 0,1 1,307.1 -307.1,307.1 307.1,0 0,1 -307.1,307.1z"
android:fillColor="@color/black"/>
</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="M704,128C833.6,128 938.7,234.7 938.7,384c0,298.7 -320,469.3 -426.7,533.3C405.3,853.3 85.3,682.7 85.3,384c0,-149.3 106.7,-256 234.7,-256C399.4,128 469.3,170.7 512,213.3c42.7,-42.7 112.6,-85.3 192,-85.3zM551.9,793.8a1141.4,1141.4 0,0 0,103.3 -72.6C782.3,620.1 853.3,509.6 853.3,384c0,-100.7 -65.6,-170.7 -149.3,-170.7 -45.9,0 -95.6,24.3 -131.7,60.3L512,334l-60.3,-60.3C415.6,237.7 365.9,213.3 320,213.3 237.2,213.3 170.7,284 170.7,384c0,125.6 71.1,236.1 198.2,337.2 31.8,25.3 65.7,48.9 103.3,72.5 12.8,8.1 25.4,15.8 39.9,24.4 14.5,-8.6 27.1,-16.3 39.9,-24.4z"
android:fillColor="@color/color1"/>
</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="M667.8,117.3C832.9,117.3 938.7,249.7 938.7,427.9c0,138.3 -125.1,290.5 -371.6,461.6a96.8,96.8 0,0 1,-110.2 0C210.4,718.4 85.3,566.1 85.3,427.9 85.3,249.7 191.1,117.3 356.2,117.3c59.6,0 100.1,20.8 155.8,68.1C567.7,138.2 608.2,117.3 667.8,117.3z"
android:fillColor="@color/favorite_true"/>
</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="M667.8,117.3C832.9,117.3 938.7,249.7 938.7,427.9c0,138.3 -125.1,290.5 -371.6,461.6a96.8,96.8 0,0 1,-110.2 0C210.4,718.4 85.3,566.1 85.3,427.9 85.3,249.7 191.1,117.3 356.2,117.3c59.6,0 100.1,20.8 155.8,68.1C567.7,138.2 608.2,117.3 667.8,117.3zM667.8,180.5c-41.4,0 -70.3,15.2 -117,55 -2.2,1.8 -14.4,12.4 -17.9,15.4a32.3,32.3 0,0 1,-41.8 0c-3.5,-3 -15.8,-13.5 -17.9,-15.4 -46.7,-39.9 -75.5,-55 -117,-55C230.2,180.5 149.3,281.3 149.3,426.7 149.3,537.6 262.9,675.2 493.6,834.8a32.4,32.4 0,0 0,36.7 0C761.1,675.3 874.7,537.6 874.7,426.7c0,-145.4 -80.9,-246.2 -206.9,-246.2z"
android:fillColor="@color/white"/>
</vector>

View File

@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M219.8,71c-12.3,0 -21.8,-9.6 -21.8,-21.8S208.9,27.3 219.8,27.3c12.3,0 21.8,9.6 21.8,21.8 0,12.3 -9.6,21.8 -21.8,21.8zM219.8,34.1c-8.2,0 -15,6.8 -15,15s6.8,15 15,15c8.2,0 15,-6.8 15,-15 0,-8.2 -6.8,-15 -15,-15z"
android:strokeAlpha="0.3"
android:fillColor="#666666"
android:fillAlpha="0.3"/>
<path
android:pathData="M935.3,1009L112,1009c-4.1,0 -6.8,2.7 -6.8,6.8s2.7,6.8 6.8,6.8h823.3c4.1,0 6.8,-2.7 6.8,-6.8s-2.7,-6.8 -6.8,-6.8zM84.7,1009h-54.6c-4.1,0 -6.8,2.7 -6.8,6.8s2.7,6.8 6.8,6.8h54.6c4.1,0 6.8,-2.7 6.8,-6.8s-4.1,-6.8 -6.8,-6.8zM994,1009h-27.3c-4.1,0 -6.8,2.7 -6.8,6.8s2.7,6.8 6.8,6.8h27.3c4.1,0 6.8,-2.7 6.8,-6.8s-2.7,-6.8 -6.8,-6.8zM244.4,428.7c4.1,0 6.8,-2.7 6.8,-6.8L251.2,210.3h400v109.2L764.6,319.5l4.1,4.1v379.6c0,4.1 2.7,6.8 6.8,6.8s6.8,-2.7 6.8,-6.8L782.3,318.1l-8.2,-8.2c0,-1.4 -2.7,-4.1 -4.1,-4.1l-107.9,-107.9 -1.4,-1.4h-423.3v225.3c0,4.1 2.7,6.8 6.8,6.8zM663.6,305.8v-86l86,86h-86zM244.4,518.8c4.1,0 6.8,-2.7 6.8,-6.8v-64.2c0,-4.1 -2.7,-6.8 -6.8,-6.8s-6.8,2.7 -6.8,6.8v64.2c0,4.1 2.7,6.8 6.8,6.8zM244.4,558.4c4.1,0 6.8,-2.7 6.8,-6.8L251.2,532.5c0,-4.1 -2.7,-6.8 -6.8,-6.8s-6.8,2.7 -6.8,6.8v19.1c0,4.1 2.7,6.8 6.8,6.8zM782.3,740c0,-4.1 -2.7,-6.8 -6.8,-6.8s-6.8,2.7 -6.8,6.8v84.7L251.2,824.7L251.2,570.7c0,-4.1 -2.7,-6.8 -6.8,-6.8s-6.8,2.7 -6.8,6.8v267.6h544.8v-98.3z"
android:fillColor="#666666"/>
<path
android:pathData="M460.1,434.2c-4.1,-1.4 -6.8,1.4 -8.2,5.5 -2.7,15 -12.3,27.3 -24.6,32.8 -24.6,9.6 -58.7,-8.2 -58.7,-9.6 -2.7,-1.4 -6.8,-1.4 -9.6,2.7 -1.4,2.7 -1.4,6.8 2.7,9.6 15,8.2 31.4,13.7 49.2,13.7 6.8,0 15,-1.4 21.8,-4.1 17.7,-8.2 30,-23.2 32.8,-42.3 0,-4.1 -1.4,-8.2 -5.5,-8.2zM584.4,490.2c5.5,2.7 10.9,2.7 17.7,2.7 16.4,-1.4 31.4,-6.8 45.1,-16.4 2.7,-2.7 4.1,-6.8 1.4,-9.6 -2.7,-2.7 -5.5,-4.1 -9.6,-1.4 -19.1,12.3 -35.5,16.4 -49.2,10.9 -21.8,-8.2 -31.4,-39.6 -31.4,-39.6 -1.4,-4.1 -5.5,-5.5 -8.2,-4.1 -4.1,1.4 -5.5,4.1 -4.1,8.2 0,2.7 9.6,38.2 38.2,49.2zM462.8,617.1c1.4,-1.4 36.9,-34.1 81.9,4.1 1.4,1.4 2.7,1.4 4.1,1.4 4.1,0 6.8,-2.7 6.8,-6.8 0,-2.7 -1.4,-4.1 -2.7,-5.5 -56,-45.1 -99.7,-2.7 -101,-2.7 -2.7,2.7 -2.7,6.8 0,9.6s8.2,2.7 10.9,0zM909.3,148.8c12.3,0 21.8,-9.6 21.8,-21.8s-9.6,-21.8 -21.8,-21.8c-12.3,0 -21.8,9.6 -21.8,21.8 1.4,12.3 10.9,21.8 21.8,21.8zM909.3,113.3c8.2,0 15,6.8 15,15s-6.8,15 -15,15c-8.2,0 -15,-6.8 -15,-15 1.4,-8.2 8.2,-15 15,-15zM73.7,296.3l13.7,8.2 -6.8,13.7c-1.4,2.7 0,5.5 2.7,6.8 2.7,1.4 5.5,0 6.8,-2.7l5.5,-12.3 12.3,8.2c1.4,0 1.4,1.4 2.7,1.4 2.7,0 5.5,-2.7 5.5,-5.5 0,-1.4 -1.4,-4.1 -2.7,-4.1l-13.7,-8.2 6.8,-13.7c1.4,-2.7 0,-5.5 -2.7,-6.8 -2.7,-1.4 -5.5,0 -6.8,2.7l-6.8,12.3 -10.9,-9.6c-2.7,-1.4 -5.5,-1.4 -6.8,1.4 -2.7,2.7 -1.4,6.8 1.4,8.2zM957.1,475.1l-19.1,-10.9 8.2,-20.5c1.4,-4.1 0,-6.8 -4.1,-9.6s-6.8,0 -9.6,4.1l-8.2,19.1 -17.7,-9.6c-2.7,-1.4 -6.8,0 -9.6,2.7 -1.4,2.7 0,6.8 2.7,9.6l19.1,10.9 -8.2,20.5c-1.4,4.1 0,6.8 4.1,9.6s6.8,0 9.6,-4.1l8.2,-19.1 17.7,9.6c2.7,1.4 6.8,0 9.6,-2.7s0,-8.2 -2.7,-9.6z"
android:fillColor="#666666"/>
</vector>

View File

@ -0,0 +1,25 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M972.8,0a51.2,51.2 0,0 1,51.2 51.2v921.6a51.2,51.2 0,0 1,-51.2 51.2H51.2a51.2,51.2 0,0 1,-51.2 -51.2V51.2a51.2,51.2 0,0 1,51.2 -51.2h921.6z"
android:fillColor="#BEBEBE"/>
<path
android:pathData="M755.2,448L1024,716.8v256a51.2,51.2 0,0 1,-51.2 51.2H51.2a51.2,51.2 0,0 1,-51.2 -51.2v-113.2l294.4,-294.4 171.8,171.8L755.2,448z"
android:strokeAlpha="0.694"
android:fillColor="#FFFFFF"
android:fillAlpha="0.694"/>
<path
android:pathData="M332.8,332.8m-102.4,0a102.4,102.4 0,1 0,204.8 0,102.4 102.4,0 1,0 -204.8,0Z"
android:strokeAlpha="0.694"
android:fillColor="#FFFFFF"
android:fillAlpha="0.694"/>
<path
android:pathData="M972.8,0a51.2,51.2 0,0 1,51.2 51.2v921.6a51.2,51.2 0,0 1,-51.2 51.2L51.2,1024a51.2,51.2 0,0 1,-51.2 -51.2L0,51.2a51.2,51.2 0,0 1,51.2 -51.2h921.6zM870.4,153.6L153.6,153.6v716.8h716.8L870.4,153.6z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M972.8,0a51.2,51.2 0,0 1,51.2 51.2v921.6a51.2,51.2 0,0 1,-51.2 51.2L51.2,1024a51.2,51.2 0,0 1,-51.2 -51.2L0,51.2a51.2,51.2 0,0 1,51.2 -51.2h921.6zM972.8,25.6L51.2,25.6a25.6,25.6 0,0 0,-25.4 22.6L25.6,51.2v921.6a25.6,25.6 0,0 0,22.6 25.4L51.2,998.4h921.6a25.6,25.6 0,0 0,25.4 -22.6L998.4,972.8L998.4,51.2a25.6,25.6 0,0 0,-22.6 -25.4L972.8,25.6z"
android:fillColor="#D9D9D9"/>
</vector>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="10dp" />
<solid android:color="@color/sub_title_color" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="10dp" />
<gradient
android:angle="0"
android:endColor="@color/color1"
android:centerColor="@color/color2"
android:startColor="@color/color3" />
</shape>
</clip>
</item>
</layer-list>

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/like_red" android:state_selected="true" />
<item android:drawable="@drawable/like_gray" />
</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/like_red" android:state_selected="true" />
<item android:drawable="@drawable/like_white" />
</selector>

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/color3"
android:pathData="M633.9,409.7c-74.9,-27.9 -152.4,-30.1 -230.4,-6.9 -51.7,11.1 -104.4,39 -151.9,80.7l-3.7,2.1 -2.1,3.2a471.7,471.7 0,0 0,-83.8 101.8c-59.1,94.9 -81.7,203 -60.6,289 13.2,53.8 42.7,95.4 84.4,120.2 27.4,16.3 59.1,24.3 92.3,24.3 34.8,0 71.7,-8.4 108.6,-25.8 15.3,-7.4 30.1,-15.3 43.8,-24.8 59.6,-24.8 118.6,-11.1 158.2,5.3 38.5,24.3 79.6,39.5 118.6,43.8 43.2,5.3 84.4,-2.6 118.1,-22.7 41.7,-24.8 71.2,-66.4 84.4,-120.2 21.1,-86 -1.6,-194 -60.6,-289 -54.8,-89.1 -133.4,-154.5 -215.1,-180.9zM220.3,465.1c22.1,-28.7 34.3,-67.2 34.3,-107.2s-12.2,-78.1 -34.3,-107.2c-24,-31 -57.8,-48.4 -92.6,-48.4 -35.3,0 -68.6,17.9 -92.6,48.9 -22.1,28.7 -34.3,66.8 -34.3,106.7s12.2,78.5 34.3,107.2c24,31 57.4,48.9 92.6,48.9 34.8,0 68.6,-17.9 92.6,-48.9zM658.9,312.2c34.8,0 68.7,-17.9 92.6,-48.9 22.1,-28.7 34.3,-67.2 34.3,-107.2s-12.2,-78.5 -34.3,-107.2C727.6,17.9 694.2,0 658.9,0s-68.6,17.9 -92.6,48.9c-22.1,28.7 -34.3,67.2 -34.3,107.2s12.2,78.1 34.3,107.2c23.5,31 57.4,48.9 92.6,48.9zM364.8,312.2c35.3,0 68.6,-17.9 92.6,-48.9 22.1,-28.7 34.3,-67.2 34.3,-107.2s-12.2,-78.5 -34.3,-107.2C433.5,17.9 399.6,0.4 364.8,0.4s-68.7,17.4 -92.6,48.4c-22.1,28.7 -34.3,67.2 -34.3,107.2s12.2,78.1 34.3,107.2c24,31.1 57.4,48.9 92.6,48.9zM988.9,250.7c-24,-31 -57.8,-48.4 -92.6,-48.4 -35.3,0 -68.7,17.9 -92.6,48.9 -22.1,28.7 -34.3,66.8 -34.3,106.7s12.2,78.5 34.3,107.2c24,31 57.4,48.9 92.6,48.9 34.8,0 68.6,-17.9 92.6,-48.9 22.1,-28.7 34.3,-67.2 34.3,-107.2s-12.2,-78.1 -34.3,-107.2z"/>
</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="M667.8,117.3C832.9,117.3 938.7,249.7 938.7,427.9c0,138.3 -125.1,290.5 -371.6,461.6a96.8,96.8 0,0 1,-110.2 0C210.4,718.4 85.3,566.1 85.3,427.9 85.3,249.7 191.1,117.3 356.2,117.3c59.6,0 100.1,20.8 155.8,68.1C567.7,138.2 608.2,117.3 667.8,117.3z"
android:fillColor="@color/color3"/>
</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="oval">
<solid android:color="@color/color1"/>
<size android:height="5dp" android:width="5dp"/>
</shape>

View File

@ -0,0 +1,169 @@
<?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"
tools:context="com.animal.wallpaper.ui.DetailInfoActivity">
<ImageView
android:id="@+id/imageview_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/imageview_back"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:layout_marginTop="38dp"
android:layout_marginStart="15dp"
android:background="@drawable/bg_white_oval"
android:padding="14dp"
android:src="@drawable/icon_black_back" />
<ProgressBar
android:id="@+id/progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminateTint="@color/color2"
android:visibility="gone" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="50dp"
android:background="@drawable/author_bg_header"
android:padding="12dp">
<RelativeLayout
android:id="@+id/layout_author"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/layout_set"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/image_header"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerVertical="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="15dp"
android:layout_marginEnd="10dp"
android:layout_toEndOf="@id/image_header"
android:orientation="vertical">
<TextView
android:id="@+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="15sp" />
<TextView
android:id="@+id/text_html"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/sub_title_color"
android:textSize="13sp"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_set"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="@+id/button_set"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="10dp"
app:cardBackgroundColor="@color/color1"
app:cardCornerRadius="200dp"
app:cardElevation="2dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:src="@mipmap/set_wallpaper" />
</androidx.cardview.widget.CardView>
<ProgressBar
android:id="@+id/pb_set"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/button_set"
android:layout_alignBottom="@id/button_set"
android:indeterminateTint="@color/color2"
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_download"
android:layout_width="0dp"
android:layout_height="40dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
app:layout_constraintLeft_toLeftOf="@id/layout_author"
app:layout_constraintRight_toLeftOf="@id/image_favorite"
app:layout_constraintTop_toBottomOf="@id/layout_author">
<ImageView
android:id="@+id/image_download"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerInParent="true"
android:src="@drawable/icon_download" />
<ProgressBar
android:id="@+id/pb_download"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerInParent="true"
android:indeterminateTint="@color/black"
android:visibility="gone" />
</RelativeLayout>
<ImageView
android:id="@+id/image_favorite"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_alignParentEnd="true"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:src="@drawable/selector_info_like"
app:layout_constraintLeft_toRightOf="@id/layout_download"
app:layout_constraintRight_toRightOf="@id/layout_author"
app:layout_constraintTop_toTopOf="@id/layout_download" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:paddingTop="30dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="@color/home_background"
tools:context="com.animal.wallpaper.ui.MainActivity">
<TextView
android:id="@+id/textview_wallpaper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:paddingStart="15dp"
android:textStyle="bold"
android:text="@string/app_name"
android:textColor="@color/color1"
android:textSize="19sp" />
<ImageView
android:id="@+id/btn_search"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_alignTop="@id/textview_wallpaper"
android:layout_alignBottom="@id/textview_wallpaper"
android:layout_alignParentEnd="true"
android:paddingStart="15dp"
android:paddingTop="6dp"
android:layout_marginEnd="12dp"
android:paddingEnd="15dp"
android:paddingBottom="6dp"
android:src="@drawable/im_search" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewpager2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/tab"
android:layout_below="@id/textview_wallpaper" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab"
android:layout_width="match_parent"
android:layout_height="45dp"
app:tabIndicatorHeight="0dp"
app:tabIndicator="@null"
app:tabBackground="@color/white"
android:layout_alignParentBottom="true" />
</RelativeLayout>

View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:paddingTop="30dp"
tools:context="com.animal.wallpaper.ui.SearchActivity">
<ImageView
android:id="@+id/back"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_alignParentStart="true"
android:layout_gravity="center"
android:padding="16dp"
android:src="@drawable/icon_black_back" />
<RelativeLayout
android:id="@+id/et_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/back"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_toStartOf="@id/btn_search"
android:background="@drawable/bg_search_et">
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:paddingStart="11dp"
android:paddingEnd="10dp"
android:maxLines="1"
android:inputType="text"
android:hint="@string/please_input_keyword"
android:textColorHint="@color/sub_title_color"
android:layout_height="46dp"
android:textSize="16sp"
android:background="@color/transparent"
android:imeOptions="actionSearch" />
</RelativeLayout>
<ImageView
android:id="@+id/btn_search"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_alignTop="@id/et_parent"
android:layout_alignBottom="@id/et_parent"
android:layout_alignParentEnd="true"
android:paddingStart="15dp"
android:paddingTop="6dp"
android:paddingEnd="15dp"
android:paddingBottom="6dp"
android:src="@drawable/im_search" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/result_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/et_parent"
android:layout_marginTop="10dp" />
<LinearLayout
android:id="@+id/empty_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/no_result" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/no_search_result"
android:textColor="@color/sub_title_color" />
</LinearLayout>
<ProgressBar
android:id="@+id/search_pb"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateTint="@color/color3"
android:layout_centerInParent="true" />
</RelativeLayout>

View File

@ -0,0 +1,54 @@
<?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/color3"
tools:context="com.animal.wallpaper.ui.WelcomeActivity">
<androidx.cardview.widget.CardView
android:id="@+id/card"
android:layout_width="94dp"
android:layout_height="94dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="200dp"
app:cardCornerRadius="12dp"
app:cardElevation="0dp">
<ImageView
android:id="@+id/imageview_logo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/logo" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/textview_appname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/card"
android:layout_centerHorizontal="true"
android:layout_marginTop="19dp"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="22sp" />
<ProgressBar
android:id="@+id/progressbar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginStart="33dp"
android:layout_marginEnd="33dp"
android:layout_marginBottom="40dp"
android:max="100"
android:progress="100"
android:progressDrawable="@drawable/progressbar" />
</RelativeLayout>

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:background="@drawable/dialog_bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="54dp"
android:gravity="center"
android:id="@+id/layout_home"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/icon_home" />
<TextView
android:id="@+id/home"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="21dp"
android:text="@string/type_home"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="54dp"
android:gravity="center"
android:id="@+id/layout_lock"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/icon_lock" />
<TextView
android:id="@+id/lock"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:text="@string/type_lock"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="54dp"
android:gravity="center"
android:id="@+id/layout_both"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/icon_both" />
<TextView
android:id="@+id/both"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:text="@string/type_both"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</FrameLayout>

View File

@ -0,0 +1,36 @@
<?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">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/layout_no_data"
android:visibility="gone"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/im_empty" />
<TextView
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:lineSpacingExtra="4dp"
android:text="@string/no_data"
android:textColor="@color/sub_title_color"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="com.animal.wallpaper.ui.MainFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_root"
android:layout_width="match_parent"
android:layout_height="180dp"
android:orientation="vertical">
<ImageView
android:id="@+id/wallpaper"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/image_favorite"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:padding="13dp"
android:src="@drawable/selector_main_like" />
</RelativeLayout>

View File

@ -0,0 +1,22 @@
<?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"
android:orientation="vertical">
<ImageView
android:id="@+id/image_icon"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/tab_anmials" />
<ImageView
android:id="@+id/image_indicator"
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_marginTop="5dp"
android:src="@drawable/tab_indicator_selected" />
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

View File

@ -0,0 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.WallpaperSelection" 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,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="color_main">#F6815C</color>
<!-- <color name="color_yellow">#F77D2B</color>-->
<color name="color_white_80">#80FFFFFF</color>
<color name="favorite_true">#C03B3B</color>
<color name="home_background">#4Dd3d3d3</color>
<color name="sub_title_color">#777272</color>
<color name="color1">#CC954B13</color>
<color name="color2">#b38a60</color>
<color name="color3">#dabba5</color>
<color name="transparent">#00000000</color>
</resources>

View File

@ -0,0 +1,13 @@
<resources>
<string name="app_name">Animal Wallpapers</string>
<string name="set_fail">Failed to set wallpaper, please try again</string>
<string name="set_success">Set wallpaper successfully</string>
<string name="download_fail">Download failed</string>
<string name="download_success">Download Success</string>
<string name="type_home">Home screen</string>
<string name="type_lock">Lock screen</string>
<string name="type_both">Both</string>
<string name="no_data">You haven not collected any wallpapers yet</string>
<string name="no_search_result">No data found</string>
<string name="please_input_keyword">Please enter a search term</string>
</resources>

View File

@ -0,0 +1,13 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.WallpaperSelection" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>
<style name="Theme.WallpaperSelection" parent="Base.Theme.WallpaperSelection" >
<item name="android:statusBarColor">@color/color_main</item>
<item name="colorOnSecondary">@color/white</item>
</style>
</resources>

View File

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

View File

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

View File

@ -0,0 +1,17 @@
package com.animal.wallpaper;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit live, 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);
}
}

14
build.gradle.kts Normal file
View File

@ -0,0 +1,14 @@
// 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
kotlin("kapt") version "1.9.0"
// id("com.google.gms.google-services") version "4.3.15" apply false
// id ("com.google.firebase.crashlytics") version "2.9.2" apply false
}
buildscript {
dependencies {
classpath("io.objectbox:objectbox-gradle-plugin:4.0.3")
}
}

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=-Xmx4096m -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 @@
#Wed Mar 06 17:02:01 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

6
keystore.properties Normal file
View File

@ -0,0 +1,6 @@
app_name=Animal Wallpapers
package_name=com.animal.wallpaper.camera
keystoreFile=app/AnimalWallpapers.jks
key_alias=AnimalWallpaperskey0
key_store_password=AnimalWallpapers
key_password=AnimalWallpapers

41
settings.gradle.kts Normal file
View File

@ -0,0 +1,41 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
//Anythink(Core)
// maven ("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
//
// //Appnext
// maven ("https://dl.appnext.com")
//
// //Ironsource
// maven ("https://android-sdk.is.com/")
//
// //Pangle
// maven ("https://artifact.bytedance.com/repository/pangle")
//
// //Mintegral
// maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
//
// //Chartboost
// maven ("https://cboost.jfrog.io/artifactory/chartboost-ads")
// maven ("https://cboost.jfrog.io/artifactory/chartboost-mediation")
//
// //TopOn集成测试工具
// maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
}
}
rootProject.name = "Animal Wallpapers"
include(":app")