创建仓库

This commit is contained in:
lihongwei 2025-03-11 14:20:33 +08:00
commit 99588c120e
81 changed files with 13522 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

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

@ -0,0 +1,64 @@
import java.text.SimpleDateFormat
import java.util.Date
plugins {
alias(libs.plugins.android.application)
}
val timestamp: String = SimpleDateFormat("MM_dd_HH_mm").format(Date())
android {
namespace = "com.live.flowlivewallpaper"
compileSdk = 35
defaultConfig {
applicationId = "com.live.flowlivewallpaper"
minSdk = 23
targetSdk = 34
versionCode = 1
versionName = "1.0.0"
setProperty(
"archivesBaseName",
"Flow Live Wallpaper_V" + versionName + "(${versionCode})_$timestamp"
)
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
viewBinding = true
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.activity)
implementation(libs.constraintlayout)
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
implementation("com.github.bumptech.glide:glide:4.16.0")
annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")
implementation ("androidx.room:room-runtime:2.6.1")
annotationProcessor ("androidx.room:room-compiler:2.6.1")
implementation ("com.squareup.okhttp3:okhttp:4.12.0")
implementation ("com.google.android.exoplayer:exoplayer:2.19.1")
}

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

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

View File

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

View File

@ -0,0 +1,52 @@
<?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.BIND_WALLPAPER"
tools:ignore="ProtectedPermissions" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.FlowLiveWallpaper"
tools:targetApi="31">
<activity
android:name=".ui.activity.LiveActivity"
android:exported="false" />
<activity
android:name=".ui.activity.MainActivity"
android:exported="false" />
<activity
android:name=".ui.activity.SplashActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".service.LiveService"
android:exported="true"
android:label="My Live Wallpaper"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/live" />
</service>
</application>
</manifest>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
package com.live.flowlivewallpaper;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import com.live.flowlivewallpaper.data.dao.FlowEntityDao;
import com.live.flowlivewallpaper.data.database.AppDatabase;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.data.repository.FlowRepository;
import com.live.flowlivewallpaper.util.JsonUtil;
import java.util.ArrayList;
import java.util.List;
public class MyApplication extends Application {
public static MyApplication application;
public static final int DB_VERSION = 1;
public static final String DB_NAME = "cool_database";
private static final String PREF_NAME = "app_preferences";
private static final String KEY_INIT = "is_initialized";
@Override
public void onCreate() {
super.onCreate();
application = this;
SharedPreferences sharedPreferences = getSharedPreferences(PREF_NAME, MODE_PRIVATE);
boolean isDatabaseInitialized = sharedPreferences.getBoolean(KEY_INIT, false);
if (!isDatabaseInitialized) {
initDatabase();
sharedPreferences.edit().putBoolean(KEY_INIT, true).apply();
}
}
public static Context getContext() {
return application.getApplicationContext();
}
private void initDatabase() {
FlowEntityDao flowEntityDao = AppDatabase.getInstance(getContext()).flowEntityDao();
FlowRepository flowRepository = new FlowRepository(flowEntityDao);
String[] jsonFiles = {"trending.json", "Explore.json", "Shift.json"};
List<FlowEntity> allFlowEntities = new ArrayList<>();
for (String jsonFile : jsonFiles) {
List<FlowEntity> flowEntities = JsonUtil.parseJson(getContext(), jsonFile);
if (!flowEntities.isEmpty()) {
allFlowEntities.addAll(flowEntities);
}
}
if (!allFlowEntities.isEmpty()) {
flowRepository.insertAll(allFlowEntities);
}
}
}

View File

@ -0,0 +1,35 @@
package com.live.flowlivewallpaper.data.dao;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import java.util.List;
@Dao
public interface FlowEntityDao {
@Insert
void insertAll(List<FlowEntity> coolEntity);
@Update
void update(FlowEntity coolEntity);
@Query("SELECT * FROM flowentity WHERE wallpaperType = 0")
LiveData<List<FlowEntity>> getTrendingList();
@Query("SELECT * FROM flowentity WHERE wallpaperType = 3")
LiveData<List<FlowEntity>> getExploreList();
@Query("SELECT * FROM flowentity WHERE wallpaperType = 2")
LiveData<List<FlowEntity>> getShiftList();
@Query("SELECT * FROM flowentity WHERE isFavorite = 1")
LiveData<List<FlowEntity>> getFavoriteList();
@Query("SELECT * FROM flowentity WHERE wallpaperType = :type AND flowId = :flowId")
LiveData<FlowEntity> getLike(int type,int flowId);
}

View File

@ -0,0 +1,32 @@
package com.live.flowlivewallpaper.data.database;
import android.content.Context;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.live.flowlivewallpaper.MyApplication;
import com.live.flowlivewallpaper.data.dao.FlowEntityDao;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
@Database(entities = {FlowEntity.class}, version = MyApplication.DB_VERSION, exportSchema = false)
public abstract class AppDatabase extends RoomDatabase {
public abstract FlowEntityDao flowEntityDao();
private static volatile AppDatabase INSTANCE;
public static AppDatabase getInstance(Context context) {
if (INSTANCE == null) {
synchronized (AppDatabase.class) {
if (INSTANCE == null) {
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
AppDatabase.class, MyApplication.DB_NAME)
.build();
}
}
}
return INSTANCE;
}
}

View File

@ -0,0 +1,134 @@
package com.live.flowlivewallpaper.data.entity;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import java.io.Serializable;
@Entity
public class FlowEntity implements Serializable {
@PrimaryKey(autoGenerate = true)
private int id;
private String category;
private String description;
private int downloads;
private int flowId;
private String image;
private int pro;
private String resolution;
private String thumbnail;
private int wallpaperType;
private String wallpaperPath;
private boolean isFavorite;
public FlowEntity(String category, String description, int downloads, int flowId, String image, int pro, String resolution, String thumbnail, int wallpaperType, String wallpaperPath, boolean isFavorite) {
this.category = category;
this.description = description;
this.downloads = downloads;
this.flowId = flowId;
this.image = image;
this.pro = pro;
this.resolution = resolution;
this.thumbnail = thumbnail;
this.wallpaperType = wallpaperType;
this.wallpaperPath = wallpaperPath;
this.isFavorite = isFavorite;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getDownloads() {
return downloads;
}
public void setDownloads(int downloads) {
this.downloads = downloads;
}
public int getFlowId() {
return flowId;
}
public void setFlowId(int flowId) {
this.flowId = flowId;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public int getPro() {
return pro;
}
public void setPro(int pro) {
this.pro = pro;
}
public String getResolution() {
return resolution;
}
public void setResolution(String resolution) {
this.resolution = resolution;
}
public String getThumbnail() {
return thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public int getWallpaperType() {
return wallpaperType;
}
public void setWallpaperType(int wallpaperType) {
this.wallpaperType = wallpaperType;
}
public String getWallpaperPath() {
return wallpaperPath;
}
public void setWallpaperPath(String wallpaperPath) {
this.wallpaperPath = wallpaperPath;
}
public boolean isFavorite() {
return isFavorite;
}
public void setFavorite(boolean favorite) {
isFavorite = favorite;
}
}

View File

@ -0,0 +1,49 @@
package com.live.flowlivewallpaper.data.repository;
import androidx.lifecycle.LiveData;
import com.live.flowlivewallpaper.data.dao.FlowEntityDao;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class FlowRepository {
private final FlowEntityDao flowEntityDao;
private final ExecutorService executorService;
public FlowRepository(FlowEntityDao flowEntityDao) {
this.flowEntityDao = flowEntityDao;
this.executorService = Executors.newSingleThreadExecutor();
}
public void insertAll(List<FlowEntity> flowEntities) {
executorService.execute(() -> flowEntityDao.insertAll(flowEntities));
}
public void update(FlowEntity flowEntity) {
executorService.execute(() -> flowEntityDao.update(flowEntity));
}
public LiveData<List<FlowEntity>> getTrendingList() {
return flowEntityDao.getTrendingList();
}
public LiveData<List<FlowEntity>> getExploreList() {
return flowEntityDao.getExploreList();
}
public LiveData<List<FlowEntity>> getShiftList() {
return flowEntityDao.getShiftList();
}
public LiveData<List<FlowEntity>> getFavoriteList() {
return flowEntityDao.getFavoriteList();
}
public LiveData<FlowEntity> getLike(int type,int id) {
return flowEntityDao.getLike(type,id);
}
}

View File

@ -0,0 +1,98 @@
package com.live.flowlivewallpaper.service;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
import android.view.SurfaceHolder;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.upstream.DefaultDataSource;
import java.io.File;
public class LiveService extends WallpaperService {
@Override
public Engine onCreateEngine() {
return new VideoEngine();
}
private class VideoEngine extends Engine {
private ExoPlayer exoPlayer;
@Override
public void onCreate(SurfaceHolder surfaceHolder) {
super.onCreate(surfaceHolder);
initExoPlayer();
}
private void initExoPlayer() {
exoPlayer = new ExoPlayer.Builder(LiveService.this).build();
exoPlayer.setRepeatMode(ExoPlayer.REPEAT_MODE_ALL);
update();
}
@Override
public void onSurfaceCreated(SurfaceHolder holder) {
super.onSurfaceCreated(holder);
if (holder != null && exoPlayer != null) {
exoPlayer.setVideoSurface(holder.getSurface());
exoPlayer.setVideoScalingMode(C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
}
}
@Override
public void onVisibilityChanged(boolean visible) {
super.onVisibilityChanged(visible);
if (exoPlayer != null) {
if (visible) {
update();
exoPlayer.play();
} else {
exoPlayer.pause();
}
}
}
@Override
public void onSurfaceDestroyed(SurfaceHolder holder) {
super.onSurfaceDestroyed(holder);
if (exoPlayer != null) {
exoPlayer.release();
exoPlayer = null;
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (exoPlayer != null) {
exoPlayer.release();
exoPlayer = null;
}
}
private void update() {
Uri uri = getVideoUrl(LiveService.this);
if (uri != null && exoPlayer != null) {
MediaItem mediaItem = MediaItem.fromUri(uri);
ProgressiveMediaSource mediaSource = new ProgressiveMediaSource.Factory(
new DefaultDataSource.Factory(LiveService.this))
.createMediaSource(mediaItem);
exoPlayer.setMediaSource(mediaSource);
exoPlayer.prepare();
exoPlayer.setPlayWhenReady(true);
}
}
private Uri getVideoUrl(Context context) {
SharedPreferences prefs = context.getSharedPreferences("WallpaperPrefs", MODE_PRIVATE);
String path = prefs.getString("video_path", "");
File file = new File(path);
return (file.isFile() && file.exists()) ? Uri.fromFile(file) : null;
}
}
}

View File

@ -0,0 +1,165 @@
package com.live.flowlivewallpaper.ui.activity;
import android.app.WallpaperManager;
import android.content.ComponentName;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.lifecycle.ViewModelProvider;
import com.live.flowlivewallpaper.R;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.databinding.ActivityLiveBinding;
import com.live.flowlivewallpaper.service.LiveService;
import com.live.flowlivewallpaper.ui.viewmodel.FlowViewModel;
import com.live.flowlivewallpaper.util.WallpaperDownloader;
import java.io.File;
import java.util.Objects;
public class LiveActivity extends AppCompatActivity {
private ActivityLiveBinding binding;
private FlowEntity flowEntity;
private FlowViewModel flowViewModel;
private int flowId;
private String image;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
binding = ActivityLiveBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
initData();
initEvent();
}
private void initData() {
flowEntity = (FlowEntity) getIntent().getSerializableExtra("flowEntity");
if (flowEntity != null) {
flowId = flowEntity.getFlowId();
image = flowEntity.getImage();
} else {
finish();
}
showProgress();
flowViewModel = new ViewModelProvider(this).get(FlowViewModel.class);
String quality;
if (flowEntity.getWallpaperType() == 2) {
quality = "ViewShiftLive";
} else {
quality = "ViewLive";
}
if (Objects.equals(flowEntity.getWallpaperPath(), "")) {
WallpaperDownloader.downloadMp4FileAsync(this, flowId, image, quality, new WallpaperDownloader.OnDownloadCompleteListener() {
@Override
public void onSuccess(File file) {
flowEntity.setWallpaperPath(file.getAbsolutePath());
flowViewModel.update(flowEntity);
loadVideoSuccess();
hideProgress();
}
@Override
public void onFailure(Exception e) {
Log.d("onFailure", e.getMessage());
Log.d("onFailure", flowId + " " + image);
hideProgress();
}
});
} else {
loadVideoSuccess();
hideProgress();
}
loadFavorite();
}
private void initEvent() {
binding.back.setOnClickListener(v -> finish());
binding.like.setOnClickListener(v -> {
boolean newStatus = !flowEntity.isFavorite();
flowEntity.setFavorite(newStatus);
flowViewModel.update(flowEntity);
});
binding.setWallpaperButton.setOnClickListener(v -> setLiveWallpaper());
}
private void loadVideoSuccess() {
if (binding != null && flowEntity.getWallpaperPath() != null) {
File videoFile = new File(flowEntity.getWallpaperPath());
if (videoFile.exists()) {
binding.videoView.setVideoPath(flowEntity.getWallpaperPath());
Log.d("VideoPath", flowEntity.getWallpaperPath());
binding.videoView.start();
binding.videoView.setOnPreparedListener(mp -> mp.setLooping(true));
}
}
}
private void setLiveWallpaper() {
SharedPreferences prefs = getSharedPreferences("WallpaperPrefs", MODE_PRIVATE);
prefs.edit().putString("video_path", flowEntity.getWallpaperPath()).apply();
Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
new ComponentName(this, LiveService.class));
startActivity(intent);
finish();
}
private void loadFavorite() {
flowViewModel.getLike(flowEntity.getWallpaperType(), flowEntity.getFlowId()).observe(this, wallpaper -> setLike());
}
private void setLike() {
binding.like.setImageResource(
flowEntity.isFavorite() ? R.drawable.like : R.drawable.dislike
);
}
private void hideProgress() {
binding.progressBar.setVisibility(View.GONE);
binding.view.setVisibility(View.GONE);
}
private void showProgress() {
binding.progressBar.setVisibility(View.VISIBLE);
binding.view.setVisibility(View.VISIBLE);
}
@Override
protected void onResume() {
super.onResume();
if (flowEntity != null && flowEntity.getWallpaperPath() != null && !flowEntity.getWallpaperPath().isEmpty()) {
loadVideoSuccess();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
binding = null;
}
}

View File

@ -0,0 +1,138 @@
package com.live.flowlivewallpaper.ui.activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.Fragment;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import com.live.flowlivewallpaper.R;
import com.live.flowlivewallpaper.databinding.ActivityMainBinding;
import com.live.flowlivewallpaper.databinding.MainTabCustomBinding;
import com.live.flowlivewallpaper.ui.adapter.MainAdapter;
import com.live.flowlivewallpaper.ui.fragment.ExploreFragment;
import com.live.flowlivewallpaper.ui.fragment.FavoriteFragment;
import com.live.flowlivewallpaper.ui.fragment.ShiftFragment;
import com.live.flowlivewallpaper.ui.fragment.TrendingFragment;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private final List<Fragment> fragmentList = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
initData();
initEvent();
}
private void initData() {
fragmentList.add(new TrendingFragment());
fragmentList.add(new ExploreFragment());
fragmentList.add(new ShiftFragment());
fragmentList.add(new FavoriteFragment());
MainAdapter adapter = new MainAdapter(this, fragmentList);
binding.mainViewpager2.setAdapter(adapter);
}
private void initEvent() {
new TabLayoutMediator(binding.mainTabLayout, binding.mainViewpager2, (tab, position) -> {
MainTabCustomBinding mainTabCustomBinding = MainTabCustomBinding.inflate(LayoutInflater.from(this));
tab.setCustomView(mainTabCustomBinding.getRoot());
setTab(mainTabCustomBinding, position);
}).attach();
binding.mainTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
updateTab(tab, true);
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
updateTab(tab, false);
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
private void updateTab(TabLayout.Tab tab, boolean isSelected) {
if (tab.getCustomView() != null) {
MainTabCustomBinding mainTabCustomBinding = MainTabCustomBinding.bind(tab.getCustomView());
int iconResId = getIconResource(tab.getPosition(), isSelected);
mainTabCustomBinding.image.setImageResource(iconResId);
int textColor = isSelected ? R.color.black : R.color.gray;
mainTabCustomBinding.text.setTextColor(ContextCompat.getColor(MainActivity.this, textColor));
}
}
});
}
private void setTab(MainTabCustomBinding mainTabCustomBinding, int position) {
int iconResId = getIconResource(position, false);
int textColorResId = R.color.gray;
switch (position) {
case 1:
mainTabCustomBinding.text.setText("Explore");
break;
case 2:
mainTabCustomBinding.text.setText("Shift");
break;
case 3:
mainTabCustomBinding.text.setText("Favorite");
break;
default:
mainTabCustomBinding.text.setText("Trending");
iconResId = R.drawable.trending;
textColorResId = R.color.black;
break;
}
mainTabCustomBinding.image.setImageResource(iconResId);
mainTabCustomBinding.text.setTextColor(ContextCompat.getColor(this, textColorResId));
}
private int getIconResource(int position, boolean isSelected) {
switch (position) {
case 1:
return isSelected ? R.drawable.explore : R.drawable.un_explore;
case 2:
return isSelected ? R.drawable.shift : R.drawable.un_shift;
case 3:
return isSelected ? R.drawable.favorite : R.drawable.un_favorite;
default:
return isSelected ? R.drawable.trending : R.drawable.un_trending;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
binding = null;
}
}

View File

@ -0,0 +1,74 @@
package com.live.flowlivewallpaper.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.live.flowlivewallpaper.R;
import com.live.flowlivewallpaper.databinding.ActivitySplashBinding;
public class SplashActivity extends AppCompatActivity {
private ActivitySplashBinding binding;
private static final long TOTAL_TIME = 3000;
private CountDownTimer countDownTimer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
binding = ActivitySplashBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
Glide.with(this)
.load(R.mipmap.ic_launcher)
.transform(new RoundedCorners(16))
.into(binding.splashImage);
countDownTimer = new CountDownTimer(TOTAL_TIME, 100) {
@Override
public void onTick(long millisUntilFinished) {
int percentage = (int) (100 - (float) millisUntilFinished / TOTAL_TIME * 100);
binding.progressBar.setProgress(percentage);
}
@Override
public void onFinish() {
startMain();
}
};
countDownTimer.start();
}
private void startMain() {
binding.progressBar.setProgress(100);
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (countDownTimer != null) {
countDownTimer.cancel();
}
binding = null;
}
}

View File

@ -0,0 +1,118 @@
package com.live.flowlivewallpaper.ui.adapter;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.live.flowlivewallpaper.R;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.ui.activity.LiveActivity;
import com.live.flowlivewallpaper.ui.viewmodel.FlowViewModel;
import java.util.List;
public class FlowAdapter extends RecyclerView.Adapter<FlowAdapter.ViewHolder> {
private final FlowViewModel flowViewModel;
private final Context context;
private List<FlowEntity> flowEntities;
private final Activity activity;
public FlowAdapter(FlowViewModel flowViewModel, Context context, List<FlowEntity> flowEntities, Activity activity) {
this.flowViewModel = flowViewModel;
this.context = context;
this.flowEntities = flowEntities;
this.activity = activity;
}
public void updateData(List<FlowEntity> newWallpaperEntries) {
this.flowEntities = newWallpaperEntries;
notifyDataSetChanged();
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item_flow, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
FlowEntity flowEntity = flowEntities.get(position);
holder.bind(flowEntity);
int randomHeight = (position % 2 == 0) ? 800 : 1000;
ViewGroup.LayoutParams params = holder.itemView.getLayoutParams();
params.height = randomHeight;
holder.itemView.setLayoutParams(params);
}
@Override
public int getItemCount() {
return flowEntities.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private final ImageView imageView;
private final ImageView favorite;
public ViewHolder(View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.item_image_view);
favorite = itemView.findViewById(R.id.item_like);
}
public void bind(FlowEntity flowEntity) {
String imagePath ="https://neutrolabgames.com/LiveLoop/CpanelPix/VideoThumb/" + flowEntity.getThumbnail();
Log.d("imagePath", imagePath);
loadImage(imagePath);
setClickListeners(flowEntity);
setFavoriteButton(flowEntity);
}
private void loadImage(String imagePath) {
Glide.with(context)
.load(imagePath)
.transform(new RoundedCorners(32))
.error(R.mipmap.placeholder)
.placeholder(R.mipmap.placeholder)
.into(imageView);
}
private void setFavoriteButton(FlowEntity flowEntity) {
favorite.setImageResource(flowEntity.isFavorite() ? R.drawable.like : R.drawable.dislike);
}
private void setClickListeners(FlowEntity flowEntity) {
imageView.setOnClickListener(view -> {
Intent intent;
intent = new Intent(activity, LiveActivity.class);
intent.putExtra("flowEntity", flowEntity);
activity.startActivity(intent);
});
favorite.setOnClickListener(view -> toggleFavorite(flowEntity));
}
private void toggleFavorite(FlowEntity flowEntity) {
boolean newStatus = !flowEntity.isFavorite();
flowEntity.setFavorite(newStatus);
updateImageInDatabase(flowEntity);
notifyItemChanged(getAdapterPosition());
}
private void updateImageInDatabase(FlowEntity flowEntity) {
flowViewModel.update(flowEntity);
}
}
}

View File

@ -0,0 +1,29 @@
package com.live.flowlivewallpaper.ui.adapter;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import java.util.ArrayList;
import java.util.List;
public class MainAdapter extends FragmentStateAdapter {
private final List<Fragment> fragmentList = new ArrayList<>();
public MainAdapter(@NonNull FragmentActivity fragmentActivity, List<Fragment> fragmentList) {
super(fragmentActivity);
this.fragmentList.addAll(fragmentList);
}
@NonNull
@Override
public Fragment createFragment(int position) {
return fragmentList.get(position);
}
@Override
public int getItemCount() {
return fragmentList.size();
}
}

View File

@ -0,0 +1,69 @@
package com.live.flowlivewallpaper.ui.fragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.databinding.FragmentExploreBinding;
import com.live.flowlivewallpaper.ui.adapter.FlowAdapter;
import com.live.flowlivewallpaper.ui.viewmodel.FlowViewModel;
import com.live.flowlivewallpaper.util.ItemDecoration;
import java.util.ArrayList;
import java.util.List;
public class ExploreFragment extends Fragment {
private FragmentExploreBinding binding;
private FlowViewModel flowViewModel;
private FlowAdapter adapter;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
binding = FragmentExploreBinding.inflate(inflater, container, false);
initData();
initEvent();
return binding.getRoot();
}
private void initData() {
flowViewModel = new ViewModelProvider(this).get(FlowViewModel.class);
binding.recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
adapter = new FlowAdapter(flowViewModel, requireContext(), new ArrayList<>(), requireActivity());
binding.recyclerView.setAdapter(adapter);
binding.recyclerView.addItemDecoration(new ItemDecoration(20, 15, 20));
}
private void initEvent() {
loadExploreList();
}
private void loadExploreList() {
flowViewModel
.getExploreList()
.observe(getViewLifecycleOwner(), new Observer<List<FlowEntity>>() {
@Override
public void onChanged(List<FlowEntity> flowEntities) {
adapter.updateData(flowEntities);
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
binding = null;
}
}

View File

@ -0,0 +1,74 @@
package com.live.flowlivewallpaper.ui.fragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.databinding.FragmentFavoriteBinding;
import com.live.flowlivewallpaper.ui.adapter.FlowAdapter;
import com.live.flowlivewallpaper.ui.viewmodel.FlowViewModel;
import com.live.flowlivewallpaper.util.ItemDecoration;
import java.util.ArrayList;
import java.util.List;
public class FavoriteFragment extends Fragment {
private FragmentFavoriteBinding binding;
private FlowViewModel flowViewModel;
private FlowAdapter adapter;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
binding = FragmentFavoriteBinding.inflate(inflater, container, false);
initData();
initEvent();
return binding.getRoot();
}
private void initData() {
flowViewModel = new ViewModelProvider(this).get(FlowViewModel.class);
binding.recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
adapter = new FlowAdapter(flowViewModel, requireContext(), new ArrayList<>(), requireActivity());
binding.recyclerView.setAdapter(adapter);
binding.recyclerView.addItemDecoration(new ItemDecoration(20, 15, 20));
}
private void initEvent() {
loadFavoriteList();
}
private void loadFavoriteList() {
flowViewModel
.getFavoriteList()
.observe(getViewLifecycleOwner(), new Observer<List<FlowEntity>>() {
@Override
public void onChanged(List<FlowEntity> flowEntities) {
if (flowEntities.isEmpty()) {
binding.text.setVisibility(View.VISIBLE);
} else {
binding.text.setVisibility(View.GONE);
}
adapter.updateData(flowEntities);
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
binding = null;
}
}

View File

@ -0,0 +1,69 @@
package com.live.flowlivewallpaper.ui.fragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.databinding.FragmentShiftBinding;
import com.live.flowlivewallpaper.ui.adapter.FlowAdapter;
import com.live.flowlivewallpaper.ui.viewmodel.FlowViewModel;
import com.live.flowlivewallpaper.util.ItemDecoration;
import java.util.ArrayList;
import java.util.List;
public class ShiftFragment extends Fragment {
private FragmentShiftBinding binding;
private FlowViewModel flowViewModel;
private FlowAdapter adapter;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
binding = FragmentShiftBinding.inflate(inflater, container, false);
initData();
initEvent();
return binding.getRoot();
}
private void initData() {
flowViewModel = new ViewModelProvider(this).get(FlowViewModel.class);
binding.recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
adapter = new FlowAdapter(flowViewModel, requireContext(), new ArrayList<>(), requireActivity());
binding.recyclerView.setAdapter(adapter);
binding.recyclerView.addItemDecoration(new ItemDecoration(20, 15, 20));
}
private void initEvent() {
loadShiftList();
}
private void loadShiftList() {
flowViewModel
.getShiftList()
.observe(getViewLifecycleOwner(), new Observer<List<FlowEntity>>() {
@Override
public void onChanged(List<FlowEntity> flowEntities) {
adapter.updateData(flowEntities);
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
binding = null;
}
}

View File

@ -0,0 +1,70 @@
package com.live.flowlivewallpaper.ui.fragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.databinding.FragmentTrendingBinding;
import com.live.flowlivewallpaper.ui.adapter.FlowAdapter;
import com.live.flowlivewallpaper.ui.viewmodel.FlowViewModel;
import com.live.flowlivewallpaper.util.ItemDecoration;
import java.util.ArrayList;
import java.util.List;
public class TrendingFragment extends Fragment {
private FragmentTrendingBinding binding;
private FlowViewModel flowViewModel;
private FlowAdapter adapter;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
binding = FragmentTrendingBinding.inflate(inflater, container, false);
initData();
initEvent();
return binding.getRoot();
}
private void initData() {
flowViewModel = new ViewModelProvider(this).get(FlowViewModel.class);
binding.recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
adapter = new FlowAdapter(flowViewModel, requireContext(), new ArrayList<>(), requireActivity());
binding.recyclerView.setAdapter(adapter);
binding.recyclerView.addItemDecoration(new ItemDecoration(20, 15, 20));
}
private void initEvent() {
loadTrendingList();
}
private void loadTrendingList() {
flowViewModel
.getTrendingList()
.observe(getViewLifecycleOwner(), new Observer<List<FlowEntity>>() {
@Override
public void onChanged(List<FlowEntity> flowEntities) {
adapter.updateData(flowEntities);
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
binding = null;
}
}

View File

@ -0,0 +1,48 @@
package com.live.flowlivewallpaper.ui.viewmodel;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import com.live.flowlivewallpaper.data.dao.FlowEntityDao;
import com.live.flowlivewallpaper.data.database.AppDatabase;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import com.live.flowlivewallpaper.data.repository.FlowRepository;
import java.util.List;
public class FlowViewModel extends AndroidViewModel {
private final FlowRepository flowRepository;
public FlowViewModel(@NonNull Application application) {
super(application);
FlowEntityDao flowEntityDao = AppDatabase.getInstance(application).flowEntityDao();
flowRepository = new FlowRepository(flowEntityDao);
}
public void update(FlowEntity flowEntity) {
this.flowRepository.update(flowEntity);
}
public LiveData<List<FlowEntity>> getTrendingList() {
return flowRepository.getTrendingList();
}
public LiveData<List<FlowEntity>> getExploreList() {
return flowRepository.getExploreList();
}
public LiveData<List<FlowEntity>> getShiftList() {
return flowRepository.getShiftList();
}
public LiveData<List<FlowEntity>> getFavoriteList() {
return flowRepository.getFavoriteList();
}
public LiveData<FlowEntity> getLike(int type,int id) {
return flowRepository.getLike(type,id);
}
}

View File

@ -0,0 +1,74 @@
package com.live.flowlivewallpaper.util;
import android.graphics.Rect;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.live.flowlivewallpaper.MyApplication;
public class ItemDecoration extends RecyclerView.ItemDecoration {
private final int v;
private final int h;
private final int ex;
public ItemDecoration(int v, int h, int ex) {
this.v = Math.round(dpToPx(v));
this.h = Math.round(dpToPx(h));
this.ex = Math.round(dpToPx(ex));
}
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
int spanCount = 1;
int spanSize = 1;
int spanIndex = 0;
int childAdapterPosition = parent.getChildAdapterPosition(view);
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
if (layoutManager instanceof StaggeredGridLayoutManager) {
StaggeredGridLayoutManager staggeredGridLayoutManager = (StaggeredGridLayoutManager) layoutManager;
StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
spanCount = staggeredGridLayoutManager.getSpanCount();
if (layoutParams.isFullSpan()) {
spanSize = spanCount;
}
spanIndex = layoutParams.getSpanIndex();
} else if (layoutManager instanceof GridLayoutManager) {
GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
GridLayoutManager.LayoutParams layoutParams = (GridLayoutManager.LayoutParams) view.getLayoutParams();
spanCount = gridLayoutManager.getSpanCount();
spanSize = gridLayoutManager.getSpanSizeLookup().getSpanSize(childAdapterPosition);
spanIndex = layoutParams.getSpanIndex();
} else if (layoutManager instanceof LinearLayoutManager) {
outRect.left = v;
outRect.right = v;
outRect.bottom = h;
}
if (spanSize == spanCount) {
outRect.left = v + ex;
outRect.right = v + ex;
} else {
int itemAllSpacing = (v * (spanCount + 1) + ex * 2) / spanCount;
int left = v * (spanIndex + 1) - itemAllSpacing * spanIndex + ex;
int right = itemAllSpacing - left;
outRect.left = left;
outRect.right = right;
}
outRect.bottom = h;
}
public static float dpToPx(float dpValue) {
float density = MyApplication.getContext().getResources().getDisplayMetrics().density;
return density * dpValue + 0.5f;
}
}

View File

@ -0,0 +1,65 @@
package com.live.flowlivewallpaper.util;
import android.content.Context;
import com.live.flowlivewallpaper.data.entity.FlowEntity;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class JsonUtil {
private static String loadJSONFromAsset(Context context, String fileName) {
StringBuilder jsonString = new StringBuilder();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
context.getAssets().open(fileName)));
String line;
while ((line = reader.readLine()) != null) {
jsonString.append(line);
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
return jsonString.toString();
}
public static List<FlowEntity> parseJson(Context context, String fileName) {
List<FlowEntity> flowEntityList = new ArrayList<>();
try {
String jsonString = loadJSONFromAsset(context, fileName);
if (jsonString.isEmpty()) {
throw new IllegalArgumentException("JSON file is empty or invalid.");
}
JSONArray jsonArray = new JSONArray(jsonString);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject categoryObject = jsonArray.getJSONObject(i);
String category = categoryObject.getString("category");
String description = categoryObject.getString("description");
int downloads = categoryObject.getInt("downloads");
int id = categoryObject.getInt("id");
String image = categoryObject.getString("image");
int pro = categoryObject.getInt("pro");
String resolution = categoryObject.getString("resolution");
String thumbnail = categoryObject.getString("thumbnail");
int wallpapertype = categoryObject.getInt("wallpapertype");
flowEntityList.add(new FlowEntity(category, description, downloads, id, image, pro, resolution, thumbnail, wallpapertype,"",false));
}
} catch (Exception e) {
e.printStackTrace();
}
return flowEntityList;
}
}

View File

@ -0,0 +1,110 @@
package com.live.flowlivewallpaper.util;
import android.content.Context;
import android.os.Environment;
import androidx.annotation.NonNull;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.TimeUnit;
import android.content.Context;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import androidx.annotation.NonNull;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.TimeUnit;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class WallpaperDownloader {
private static final String SERVER_URL = "https://neutrolabgames.com/LiveLoop/AppData/jmywall.php";
private static final OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.build();
private static final Handler mainHandler = new Handler(Looper.getMainLooper());
public static void downloadMp4FileAsync(Context context, int pi, String image,String quality, OnDownloadCompleteListener listener) {
RequestBody requestBody = new FormBody.Builder()
.add("pi", String.valueOf(pi))
.add("medium", "5eV6snEwfY7Yv6Ub")
.add("alpha", image)
.add("version", "DL8")
.add("quality", quality)
.build();
Request request = new Request.Builder()
.url(SERVER_URL)
.post(requestBody)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(@NonNull Call call, @NonNull IOException e) {
mainHandler.post(() -> listener.onFailure(e));
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
if (!response.isSuccessful()) {
mainHandler.post(() -> listener.onFailure(new IOException("Download failure: " + response.code())));
return;
}
if (response.body() == null) {
mainHandler.post(() -> listener.onFailure(new IOException("The response body is empty")));
return;
}
String fileName = "wallpaper_" + System.currentTimeMillis() + pi + image + ".mp4";
File dir = context.getExternalFilesDir(Environment.DIRECTORY_MOVIES);
File file = new File(dir, fileName);
try (InputStream inputStream = response.body().byteStream();
FileOutputStream outputStream = new FileOutputStream(file)) {
byte[] buffer = new byte[8192];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
mainHandler.post(() -> listener.onSuccess(file));
} catch (IOException e) {
mainHandler.post(() -> listener.onFailure(e));
}
}
});
}
public interface OnDownloadCompleteListener {
void onSuccess(File file);
void onFailure(Exception e);
}
}

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,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M486.4,305.7V128L0,473.6 486.4,819.2v-177.7c12.1,-0.5 24.2,-0.6 36.5,-0.4A640.8,640.8 0,0 1,1024 896c-17,-298.4 -243,-543.4 -537.6,-590.3z"
android:fillColor="#00C080"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,896h-6.4C356.3,853.3 64,633.6 64,384 64,243.2 179.2,128 320,128c40.5,0 81.1,10.7 117.3,27.7 8.5,4.3 12.8,12.8 10.7,23.5l-19.2,108.8 179.2,100.3c6.4,4.3 10.7,8.5 10.7,17.1s-2.1,12.8 -6.4,19.2l-136.5,117.3 55.5,91.7c6.4,10.7 2.1,23.5 -6.4,29.9 -10.7,6.4 -23.5,2.1 -29.9,-6.4l-64,-106.7c-6.4,-8.5 -4.3,-21.3 4.3,-27.7l125.9,-108.8 -164.3,-91.7c-8.5,-4.3 -12.8,-12.8 -10.7,-21.3l19.2,-106.7C377.6,177.1 349.9,170.7 320,170.7 202.7,170.7 106.7,266.7 106.7,384c0,215.5 258.1,422.4 405.3,469.3 147.2,-44.8 405.3,-251.7 405.3,-469.3 0,-117.3 -96,-213.3 -213.3,-213.3 -34.1,0 -66.1,8.5 -96,23.5 -10.7,6.4 -23.5,2.1 -27.7,-8.5 -6.4,-10.7 -2.1,-23.5 8.5,-27.7C622.9,136.5 663.5,128 704,128c140.8,0 256,115.2 256,256 0,249.6 -292.3,469.3 -441.6,512H512z"
android:fillColor="#333333"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FF000000"
android:pathData="M54.3,506.7a43.6,43.6 0,0 1,59.7 -15c84.5,-141 243.1,-240.1 397.8,-240.1 154.8,0 313.8,99.2 398.3,240.1a43.6,43.6 0,0 1,74.7 -44.8c-99.6,-166 -286.1,-282.3 -473,-282.3 -186.8,0 -372.8,116.2 -472.5,282.3a43.6,43.6 0,0 1,15 59.7zM969.7,606.2a43.6,43.6 0,0 1,-59.7 15C827.5,758.7 669.6,852.6 511.7,852.6c-157.8,0 -315.2,-93.8 -397.8,-231.4a43.6,43.6 0,0 1,-74.7 44.8c98,163.2 283.4,273.6 472.6,273.6 189.3,0 375.2,-110.5 473,-273.7a43.6,43.6 0,0 1,-15.1 -59.6zM323.4,556.5c0,104.2 84.4,188.6 188.6,188.6 104.2,0 188.6,-84.4 188.6,-188.6S616.2,367.9 512,367.9c-104.2,0 -188.6,84.3 -188.6,188.6zM613.6,556.5A101.5,101.5 0,0 0,512 658.1a101.5,101.5 0,0 0,-101.6 -101.6A101.5,101.5 0,0 0,512 454.9c56.1,-0.1 101.6,45.4 101.6,101.6z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FF000000"
android:pathData="M92.6,497.6c7.7,10.6 7.7,24 0,34.6l-16.4,23.1c-12.5,18.3 -17.3,41.4 -12.5,62.5 4.8,22.1 19.2,40.4 38.5,51l24,13.5c11.5,5.8 17.3,18.3 15.4,30.8l-4.8,26.9c-3.9,22.1 1.9,44.2 16.4,61.6 14.4,17.3 34.6,27.9 56.8,28.9l27.9,1c12.5,1 24,8.7 26.9,21.2l7.7,26.9c9.6,32.7 40.4,55.8 75,55.8 10.6,0 21.2,-1.9 30.8,-6.7l26,-10.6a29.8,29.8 0,0 1,33.7 7.7l18.3,21.2c14.4,16.4 35.6,26 57.7,26s44.3,-9.6 58.7,-26.9l18.3,-21.2c7.7,-9.6 22.1,-12.5 33.7,-7.7l26,10.6a78.4,78.4 0,0 0,29.8 5.8c34.6,0 65.4,-23.1 75,-56.8l7.7,-26.9c2.9,-12.5 14.4,-21.2 26.9,-22.1l27.9,-1.9c22.1,-1 43.3,-12.5 56.8,-29.8 13.5,-17.3 19.2,-40.4 15.4,-61.6l-4.8,-26.9c-1.9,-12.5 3.9,-25 14.4,-30.8l24,-13.5c19.2,-10.6 33.7,-29.8 38.5,-51 4.8,-22.1 0,-44.3 -13.5,-62.5l-16.4,-22.1c-7.7,-10.6 -7.7,-24 0,-34.6l16.4,-23.1c12.5,-18.3 17.3,-41.4 12.5,-62.5 -4.8,-22.1 -19.2,-40.4 -38.5,-51l-25,-13.5c-11.5,-5.8 -17.3,-18.3 -15.4,-30.8l4.8,-26.9c3.8,-22.1 -1.9,-44.3 -16.4,-61.6 -14.4,-17.3 -34.6,-27.9 -56.8,-28.9l-27.9,-1c-12.5,-1 -24.1,-8.7 -26.9,-21.2l-7.7,-26.9c-10.6,-34.6 -40.4,-56.8 -75,-56.8 -10.6,0 -21.2,1.9 -30.8,6.7l-26,10.6c-10.6,4.8 -25,1 -33.7,-7.7l-18.3,-21.2C553.4,60.8 532.2,51.2 510.1,51.2s-44.3,9.6 -58.7,26.9l-18.3,21.2c-7.7,9.6 -22.1,12.5 -33.7,7.7l-26,-10.6a78.4,78.4 0,0 0,-29.8 -5.8c-34.6,0 -65.4,23.1 -75,56.8l-7.7,26.9c-2.9,12.5 -14.4,21.2 -26.9,22.1l-27.9,1.9c-22.1,1 -43.3,12.5 -56.8,29.8 -13.5,17.3 -19.2,40.4 -15.4,61.6l4.8,26.9c1.9,12.5 -3.8,25 -14.4,30.8l-24.1,13.5c-19.2,10.6 -33.7,29.8 -38.5,51 -4.8,21.2 0,44.3 13.5,62.5l17.3,23.1zM109.9,423.5c1.9,-8.7 6.7,-15.4 14.4,-19.2l24,-13.5c28.9,-16.3 45.2,-49.1 38.5,-81.8l-3.9,-27.9c-1.9,-8.7 1,-17.3 5.8,-24 5.8,-6.7 12.5,-10.6 21.2,-11.5l27.9,-1.9a77.1,77.1 0,0 0,70.2 -56.8l7.7,-26.9c3.8,-12.5 15.4,-22.1 28.9,-22.1 3.8,0 7.7,1 11.5,1.9l26,10.6a78.3,78.3 0,0 0,29.8 5.8c22.1,0 44.3,-9.6 58.7,-26.9l18.3,-21.2c5.8,-6.7 13.5,-10.6 22.1,-10.6 8.7,0 16.4,3.9 22.1,9.6l18.3,21.2c14.4,16.4 35.6,26 57.7,26 10.6,0 21.2,-1.9 30.8,-6.7l26,-10.6h10.6c13.5,0 25,8.7 28.9,21.2l7.7,26.9c9.6,31.7 37.5,54.8 71.2,55.8l27.9,1c8.7,0 16.4,3.9 22.1,10.6 5.8,6.7 7.7,15.4 5.8,23.1l-4.8,26.9c-5.8,32.7 10.6,65.4 40.4,81.8l24,13.5c7.7,3.9 12.5,10.6 14.4,19.2a30,30 0,0 1,-4.8 24l-15.4,23.1c-19.2,26.9 -19.2,63.5 1,90.4l16.4,22.1a30.1,30.1 0,0 1,4.8 24c-1.9,8.7 -6.7,15.4 -14.4,19.2l-24,13.5c-28.9,16.3 -45.2,49.1 -38.5,81.8l4.8,26.9c1.9,8.7 -1,17.3 -5.8,24 -5.8,6.7 -12.5,10.6 -21.2,11.5l-27.9,1.9a77.1,77.1 0,0 0,-70.2 56.8l-7.7,26.9c-3.8,12.5 -15.4,22.1 -28.9,22.1 -3.9,0 -7.7,-1 -11.5,-1.9l-26,-10.6a78.3,78.3 0,0 0,-29.8 -5.8c-22.1,0 -44.3,9.6 -58.7,26.9l-18.3,21.2c-5.8,6.7 -13.5,10.6 -22.1,10.6s-16.4,-3.8 -22.1,-9.6l-18.3,-21.2a77.3,77.3 0,0 0,-57.7 -26c-10.6,0 -21.2,1.9 -30.8,6.7l-26,10.6c-3.9,1 -7.7,1 -11.5,1 -13.5,0 -25,-8.7 -28.9,-21.2l-7.7,-26.9c-9.6,-31.7 -37.5,-54.8 -71.2,-55.8l-26.9,-1c-8.7,0 -16.3,-3.9 -22.1,-10.6s-7.7,-15.4 -5.8,-23.1l4.8,-26.9c5.8,-32.7 -10.6,-65.4 -40.4,-81.8l-24,-13.5c-7.7,-3.9 -12.5,-10.6 -14.4,-19.2 -1.9,-8.7 0,-17.3 4.8,-24l16.4,-23.1c19.2,-26.9 19.2,-63.5 -1,-90.4l-16.4,-22.1c-6.7,-7.7 -7.7,-15.4 -6.7,-24.1zM484.1,726.5c7.7,7.7 17.3,11.5 28.9,11.5 10.6,0 21.2,-3.8 28.9,-11.5l145.3,-145.3c25,-25 38.5,-57.7 38.5,-92.4s-13.5,-68.3 -38.5,-92.4c-25,-25 -57.7,-38.5 -92.4,-38.5 -29.8,0 -58.7,9.6 -81.8,28.9 -23.1,-18.3 -52,-28.9 -81.8,-28.9 -34.6,0 -67.3,13.5 -92.4,38.5 -25,25 -38.5,57.7 -38.5,92.4s13.5,67.3 38.5,92.4l145.3,145.3zM372.5,429.3c15.4,-15.4 36.6,-24 58.7,-24 22.1,0 43.3,8.7 58.7,24l5.8,5.8c9.6,9.6 25,9.6 33.7,0l5.8,-5.8c15.4,-15.4 36.6,-24 58.7,-24s43.3,8.7 58.7,24c15.4,15.4 24.1,36.6 24.1,58.7 0,22.1 -8.7,43.3 -24.1,58.7l-139.5,140.5 -139.5,-140.5c-15.4,-15.4 -24,-36.6 -24,-58.7 0,-22.1 7.7,-42.3 23.1,-58.7z"/>
</vector>

View File

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

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,926h-6c-6,0 -12,-3 -15,-9L143,569C92,518 62,449 62,374s30,-144 81,-195c51,-51 120,-81 195,-81 63,0 126,21 174,63 108,-90 270,-81 369,18 108,108 108,282 0,390L533,917c-6,6 -12,9 -21,9z"
android:fillColor="#ff0000"/>
</vector>

View File

@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="45"
android:startColor="#80CBC4"
android:endColor="#0288D1"
android:type="linear"
android:useLevel="false" />
<corners android:radius="16dp" />
</shape>

View File

@ -0,0 +1,30 @@
<!-- res/drawable/seekbar_progress_drawable.xml -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="5dp" />
<solid android:color="#D3D3D3" /> <!-- 背景颜色 -->
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<corners android:radius="5dp" />
<solid android:color="#FFD700" /> <!-- 次级进度颜色 -->
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="5dp" />
<gradient
android:startColor="#4891FF"
android:endColor="#6CE89E"
android:angle="0" />
</shape>
</clip>
</item>
</layer-list>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FF000000"
android:pathData="M362.5,671.7a66,66 0,0 0,58.5 -43.9l56.7,-154.5 148.1,-63.3a68.9,68.9 0,0 0,-2.9 -127l-405.2,-154.2a64,64 0,0 0,-70.7 16.6,68.6 68.6,0 0,0 -13.7,73.3l164,410.6a66.3,66.3 0,0 0,62.3 42.5zM588.3,347.3l-165.8,71.3 -63.6,172.8 -156.1,-390.9zM193.5,197.1zM166.6,511.6c-23.3,326.1 364.2,463.5 588.8,241.5a340.6,340.6 0,0 0,-243.2 -587,39.5 39.5,0 0,1 0,-79c378.5,-10 571,453 299.1,721.8C540.5,1076.7 59.5,908.7 87.9,511.6c3.6,-50.4 82.6,-50.8 78.9,0z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M401.9,9.2A65,65 0,0 1,466.6 8c291.6,135.5 456.7,416.8 446.5,652 -4.4,98.9 -39.7,190.3 -108.3,257.1 -68.6,66.9 -167.1,105.9 -291.8,106.1a379.4,379.4 0,0 1,-402.4 -363.4v-0.5a320.4,320.4 0,0 1,164.6 -288.2,36.6 36.6,0 0,1 51.2,17.2A366.1,366.1 0,0 0,400.1 497.1c36.1,-47.2 52.8,-108.1 52.3,-175.1 -0.6,-79.7 -25.6,-165.2 -67.6,-238A55.6,55.6 0,0 1,401.9 9.1zM471.4,92.1c33.6,72 53.5,152 54.1,229.4 0.7,94 -27.4,187 -97.9,254a36.6,36.6 0,0 1,-48.8 1.5,439.2 439.2,0 0,1 -100.1,-120.7 247.2,247.2 0,0 0,-95.1 200.9,306.3 306.3,0 0,0 328.2,292.9c109.6,0 189.1,-33.9 241.9,-85.4 53.1,-51.7 82.7,-124.3 86.3,-207.9m-368.6,-564.8c245.5,130 377,372.1 368.6,564.7z"
android:fillColor="#000000"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="@color/gray"
android:pathData="M54.3,506.7a43.6,43.6 0,0 1,59.7 -15c84.5,-141 243.1,-240.1 397.8,-240.1 154.8,0 313.8,99.2 398.3,240.1a43.6,43.6 0,0 1,74.7 -44.8c-99.6,-166 -286.1,-282.3 -473,-282.3 -186.8,0 -372.8,116.2 -472.5,282.3a43.6,43.6 0,0 1,15 59.7zM969.7,606.2a43.6,43.6 0,0 1,-59.7 15C827.5,758.7 669.6,852.6 511.7,852.6c-157.8,0 -315.2,-93.8 -397.8,-231.4a43.6,43.6 0,0 1,-74.7 44.8c98,163.2 283.4,273.6 472.6,273.6 189.3,0 375.2,-110.5 473,-273.7a43.6,43.6 0,0 1,-15.1 -59.6zM323.4,556.5c0,104.2 84.4,188.6 188.6,188.6 104.2,0 188.6,-84.4 188.6,-188.6S616.2,367.9 512,367.9c-104.2,0 -188.6,84.3 -188.6,188.6zM613.6,556.5A101.5,101.5 0,0 0,512 658.1a101.5,101.5 0,0 0,-101.6 -101.6A101.5,101.5 0,0 0,512 454.9c56.1,-0.1 101.6,45.4 101.6,101.6z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="@color/gray"
android:pathData="M92.6,497.6c7.7,10.6 7.7,24 0,34.6l-16.4,23.1c-12.5,18.3 -17.3,41.4 -12.5,62.5 4.8,22.1 19.2,40.4 38.5,51l24,13.5c11.5,5.8 17.3,18.3 15.4,30.8l-4.8,26.9c-3.9,22.1 1.9,44.2 16.4,61.6 14.4,17.3 34.6,27.9 56.8,28.9l27.9,1c12.5,1 24,8.7 26.9,21.2l7.7,26.9c9.6,32.7 40.4,55.8 75,55.8 10.6,0 21.2,-1.9 30.8,-6.7l26,-10.6a29.8,29.8 0,0 1,33.7 7.7l18.3,21.2c14.4,16.4 35.6,26 57.7,26s44.3,-9.6 58.7,-26.9l18.3,-21.2c7.7,-9.6 22.1,-12.5 33.7,-7.7l26,10.6a78.4,78.4 0,0 0,29.8 5.8c34.6,0 65.4,-23.1 75,-56.8l7.7,-26.9c2.9,-12.5 14.4,-21.2 26.9,-22.1l27.9,-1.9c22.1,-1 43.3,-12.5 56.8,-29.8 13.5,-17.3 19.2,-40.4 15.4,-61.6l-4.8,-26.9c-1.9,-12.5 3.9,-25 14.4,-30.8l24,-13.5c19.2,-10.6 33.7,-29.8 38.5,-51 4.8,-22.1 0,-44.3 -13.5,-62.5l-16.4,-22.1c-7.7,-10.6 -7.7,-24 0,-34.6l16.4,-23.1c12.5,-18.3 17.3,-41.4 12.5,-62.5 -4.8,-22.1 -19.2,-40.4 -38.5,-51l-25,-13.5c-11.5,-5.8 -17.3,-18.3 -15.4,-30.8l4.8,-26.9c3.8,-22.1 -1.9,-44.3 -16.4,-61.6 -14.4,-17.3 -34.6,-27.9 -56.8,-28.9l-27.9,-1c-12.5,-1 -24.1,-8.7 -26.9,-21.2l-7.7,-26.9c-10.6,-34.6 -40.4,-56.8 -75,-56.8 -10.6,0 -21.2,1.9 -30.8,6.7l-26,10.6c-10.6,4.8 -25,1 -33.7,-7.7l-18.3,-21.2C553.4,60.8 532.2,51.2 510.1,51.2s-44.3,9.6 -58.7,26.9l-18.3,21.2c-7.7,9.6 -22.1,12.5 -33.7,7.7l-26,-10.6a78.4,78.4 0,0 0,-29.8 -5.8c-34.6,0 -65.4,23.1 -75,56.8l-7.7,26.9c-2.9,12.5 -14.4,21.2 -26.9,22.1l-27.9,1.9c-22.1,1 -43.3,12.5 -56.8,29.8 -13.5,17.3 -19.2,40.4 -15.4,61.6l4.8,26.9c1.9,12.5 -3.8,25 -14.4,30.8l-24.1,13.5c-19.2,10.6 -33.7,29.8 -38.5,51 -4.8,21.2 0,44.3 13.5,62.5l17.3,23.1zM109.9,423.5c1.9,-8.7 6.7,-15.4 14.4,-19.2l24,-13.5c28.9,-16.3 45.2,-49.1 38.5,-81.8l-3.9,-27.9c-1.9,-8.7 1,-17.3 5.8,-24 5.8,-6.7 12.5,-10.6 21.2,-11.5l27.9,-1.9a77.1,77.1 0,0 0,70.2 -56.8l7.7,-26.9c3.8,-12.5 15.4,-22.1 28.9,-22.1 3.8,0 7.7,1 11.5,1.9l26,10.6a78.3,78.3 0,0 0,29.8 5.8c22.1,0 44.3,-9.6 58.7,-26.9l18.3,-21.2c5.8,-6.7 13.5,-10.6 22.1,-10.6 8.7,0 16.4,3.9 22.1,9.6l18.3,21.2c14.4,16.4 35.6,26 57.7,26 10.6,0 21.2,-1.9 30.8,-6.7l26,-10.6h10.6c13.5,0 25,8.7 28.9,21.2l7.7,26.9c9.6,31.7 37.5,54.8 71.2,55.8l27.9,1c8.7,0 16.4,3.9 22.1,10.6 5.8,6.7 7.7,15.4 5.8,23.1l-4.8,26.9c-5.8,32.7 10.6,65.4 40.4,81.8l24,13.5c7.7,3.9 12.5,10.6 14.4,19.2a30,30 0,0 1,-4.8 24l-15.4,23.1c-19.2,26.9 -19.2,63.5 1,90.4l16.4,22.1a30.1,30.1 0,0 1,4.8 24c-1.9,8.7 -6.7,15.4 -14.4,19.2l-24,13.5c-28.9,16.3 -45.2,49.1 -38.5,81.8l4.8,26.9c1.9,8.7 -1,17.3 -5.8,24 -5.8,6.7 -12.5,10.6 -21.2,11.5l-27.9,1.9a77.1,77.1 0,0 0,-70.2 56.8l-7.7,26.9c-3.8,12.5 -15.4,22.1 -28.9,22.1 -3.9,0 -7.7,-1 -11.5,-1.9l-26,-10.6a78.3,78.3 0,0 0,-29.8 -5.8c-22.1,0 -44.3,9.6 -58.7,26.9l-18.3,21.2c-5.8,6.7 -13.5,10.6 -22.1,10.6s-16.4,-3.8 -22.1,-9.6l-18.3,-21.2a77.3,77.3 0,0 0,-57.7 -26c-10.6,0 -21.2,1.9 -30.8,6.7l-26,10.6c-3.9,1 -7.7,1 -11.5,1 -13.5,0 -25,-8.7 -28.9,-21.2l-7.7,-26.9c-9.6,-31.7 -37.5,-54.8 -71.2,-55.8l-26.9,-1c-8.7,0 -16.3,-3.9 -22.1,-10.6s-7.7,-15.4 -5.8,-23.1l4.8,-26.9c5.8,-32.7 -10.6,-65.4 -40.4,-81.8l-24,-13.5c-7.7,-3.9 -12.5,-10.6 -14.4,-19.2 -1.9,-8.7 0,-17.3 4.8,-24l16.4,-23.1c19.2,-26.9 19.2,-63.5 -1,-90.4l-16.4,-22.1c-6.7,-7.7 -7.7,-15.4 -6.7,-24.1zM484.1,726.5c7.7,7.7 17.3,11.5 28.9,11.5 10.6,0 21.2,-3.8 28.9,-11.5l145.3,-145.3c25,-25 38.5,-57.7 38.5,-92.4s-13.5,-68.3 -38.5,-92.4c-25,-25 -57.7,-38.5 -92.4,-38.5 -29.8,0 -58.7,9.6 -81.8,28.9 -23.1,-18.3 -52,-28.9 -81.8,-28.9 -34.6,0 -67.3,13.5 -92.4,38.5 -25,25 -38.5,57.7 -38.5,92.4s13.5,67.3 38.5,92.4l145.3,145.3zM372.5,429.3c15.4,-15.4 36.6,-24 58.7,-24 22.1,0 43.3,8.7 58.7,24l5.8,5.8c9.6,9.6 25,9.6 33.7,0l5.8,-5.8c15.4,-15.4 36.6,-24 58.7,-24s43.3,8.7 58.7,24c15.4,15.4 24.1,36.6 24.1,58.7 0,22.1 -8.7,43.3 -24.1,58.7l-139.5,140.5 -139.5,-140.5c-15.4,-15.4 -24,-36.6 -24,-58.7 0,-22.1 7.7,-42.3 23.1,-58.7z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="@color/gray"
android:pathData="M362.5,671.7a66,66 0,0 0,58.5 -43.9l56.7,-154.5 148.1,-63.3a68.9,68.9 0,0 0,-2.9 -127l-405.2,-154.2a64,64 0,0 0,-70.7 16.6,68.6 68.6,0 0,0 -13.7,73.3l164,410.6a66.3,66.3 0,0 0,62.3 42.5zM588.3,347.3l-165.8,71.3 -63.6,172.8 -156.1,-390.9zM193.5,197.1zM166.6,511.6c-23.3,326.1 364.2,463.5 588.8,241.5a340.6,340.6 0,0 0,-243.2 -587,39.5 39.5,0 0,1 0,-79c378.5,-10 571,453 299.1,721.8C540.5,1076.7 59.5,908.7 87.9,511.6c3.6,-50.4 82.6,-50.8 78.9,0z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M401.9,9.2A65,65 0,0 1,466.6 8c291.6,135.5 456.7,416.8 446.5,652 -4.4,98.9 -39.7,190.3 -108.3,257.1 -68.6,66.9 -167.1,105.9 -291.8,106.1a379.4,379.4 0,0 1,-402.4 -363.4v-0.5a320.4,320.4 0,0 1,164.6 -288.2,36.6 36.6,0 0,1 51.2,17.2A366.1,366.1 0,0 0,400.1 497.1c36.1,-47.2 52.8,-108.1 52.3,-175.1 -0.6,-79.7 -25.6,-165.2 -67.6,-238A55.6,55.6 0,0 1,401.9 9.1zM471.4,92.1c33.6,72 53.5,152 54.1,229.4 0.7,94 -27.4,187 -97.9,254a36.6,36.6 0,0 1,-48.8 1.5,439.2 439.2,0 0,1 -100.1,-120.7 247.2,247.2 0,0 0,-95.1 200.9,306.3 306.3,0 0,0 328.2,292.9c109.6,0 189.1,-33.9 241.9,-85.4 53.1,-51.7 82.7,-124.3 86.3,-207.9m-368.6,-564.8c245.5,130 377,372.1 368.6,564.7z"
android:fillColor="@color/gray"/>
</vector>

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activity.LiveActivity">
<VideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="32dp"
android:src="@drawable/back"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/set_wallpaper_button"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_margin="48dp"
android:background="@drawable/rounded_rectangle_gradient"
android:gravity="center"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingTop="5dp"
android:paddingEnd="10dp"
android:paddingBottom="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Set as wallpaper"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<ImageView
android:id="@+id/like"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_margin="32dp"
android:background="@drawable/rounded_rectangle_gradient"
android:padding="5dp"
android:src="@drawable/dislike"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:focusable="true"
android:visibility="gone" />
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activity.MainActivity">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/main_viewpager2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toTopOf="@+id/main_tab_layout"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/main_tab_layout"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginBottom="25dp"
android:background="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:tabIndicatorHeight="0dp"
app:tabRippleColor="@android:color/transparent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activity.SplashActivity">
<ImageView
android:id="@+id/splash_image"
android:layout_width="150dp"
android:layout_height="150dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.388" />
<TextView
android:id="@+id/splash_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="@string/app_name"
android:textSize="25sp"
android:textStyle="bold"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/splash_image" />
<ProgressBar
android:id="@+id/progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="5dp"
android:layout_marginStart="53dp"
android:layout_marginEnd="53dp"
android:layout_marginBottom="80dp"
android:max="100"
android:progress="0"
android:progressDrawable="@drawable/seek_bar_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.fragment.ExploreFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="25dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
</FrameLayout>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.fragment.FavoriteFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="25dp" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/you_haven_t_added_any_favorites_yet"
android:textColor="@color/black"
android:visibility="gone"
android:layout_marginTop="100dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.fragment.ShiftFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="25dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
</FrameLayout>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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=".ui.fragment.TrendingFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="25dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
</FrameLayout>

View File

@ -0,0 +1,22 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/item_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/item_like"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:src="@drawable/dislike"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<ImageView
android:id="@+id/image"
android:layout_width="16dp"
android:layout_height="16dp"
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:gravity="center"
android:layout_marginTop="5dp"
android:text="@string/app_name"
android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@+id/image" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.FlowLiveWallpaper" 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,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="gray">#9C979D</color>
</resources>

View File

@ -0,0 +1,6 @@
<resources>
<string name="app_name">Flow Live Wallpaper</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="you_haven_t_added_any_favorites_yet">You haven\'t added any favorites yet💖</string>
</resources>

View File

@ -0,0 +1,9 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.FlowLiveWallpaper" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>
<style name="Theme.FlowLiveWallpaper" parent="Base.Theme.FlowLiveWallpaper" />
</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,5 @@
<?xml version="1.0" encoding="utf-8"?>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/app_name"
android:thumbnail="@mipmap/placeholder">
</wallpaper>

View File

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

4
build.gradle.kts Normal file
View File

@ -0,0 +1,4 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
}

21
gradle.properties Normal file
View File

@ -0,0 +1,21 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-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

22
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,22 @@
[versions]
agp = "8.9.0"
junit = "4.13.2"
junitVersion = "1.2.1"
espressoCore = "3.6.1"
appcompat = "1.7.0"
material = "1.12.0"
activity = "1.10.1"
constraintlayout = "2.2.1"
[libraries]
junit = { group = "junit", name = "junit", version.ref = "junit" }
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }

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

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Tue Mar 04 15:41:12 CST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-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=Flow Live Wallpaper
package_name=com.live.flowlivewallpaper
keystoreFile=app/FlowLiveWallpaper.jks
key_alias=FlowLiveWallpaperkey0
key_store_password=FlowLiveWallpaper
key_password=FlowLiveWallpaper

24
settings.gradle.kts Normal file
View File

@ -0,0 +1,24 @@
pluginManagement {
repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Flow Live Wallpaper"
include(":app")