V 1.0.3 (4) 增加壁纸和锁屏功能,修改设置功能为四个基础功能。

This commit is contained in:
gaolu 2024-08-14 13:47:39 +08:00
parent 067c1fcac4
commit aa55ad6169
41 changed files with 1056 additions and 146 deletions

Binary file not shown.

17
.safedk/app_sdks.lst Normal file
View File

@ -0,0 +1,17 @@
106f9be0e66f52f36eaaaff4dd231971
75939c4ce23c53ad9534d43be176b3e9
217e8f437c9fc4244d6e74653ac8a8c7
66b774de6608db14a84e972fba1ec954
e1c9ddef73e5621f62c717badf1be3f2
daaea35726ab7cd457ab61d4538fb822
1be9e72506f3307ce6a9e78d26d65bd0
4df96d3bc9afd17b812e65e6c6add1ef
eb3214f29c0a52815b41977d6cc9a46e
becf75b2cc99e82716da2e6697879509
7eec7b9476b99b3ce94533da4f2eb987
974322f19d813702ea048d95288d2b8c
29015bbfcc182d80e7f75bd2c38e4521
dd2971b0681141d57b221687791ad1bd
86a0d598cde251321e21a0da4ab94065
74616804a7dc29147dfb0afe122a9fd2

Binary file not shown.

Binary file not shown.

2
.safedk/hashes.safedk Normal file
View File

@ -0,0 +1,2 @@
#Wed Aug 14 12:01:11 GMT+08:00 2024
json=-1175523158

1
.safedk/list.enc Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
#
#Wed Aug 14 12:01:11 GMT+08:00 2024
QSHbR4fRiQsQS35GZQfoxKJ9qpWcpR3DgvLcRdgJaN3OWFBLouEs6hfZqh0FpC5thnqdRfMvZGFfDc5Vekvicw=B16JDnq2XTvLHqPBl7HpoKPpP15v1VLRuFdB8wtkJXGdiJHxXSbizUSrFaaz4t5rmRXbHbTcqO1o6tm779ymUf
sdk_analysis_plugin_version=5.4.4
set_multidex=true

View File

@ -0,0 +1,34 @@
-keep class androidx.multidex.** { *; }
-keep class androidx.browser.customtabs.CustomTabsIntent { *; }
-keep class androidx.** {
*** startActivityForResult(***);
*** startActivity(***);
}
-keep class android.support.multidex.** { *; }
-keep class android.support.v4.app.** { *; }
-keep class com.google.android.gms.location.FusedLocationProviderApi { *; }
-keep class com.google.android.gms.location.LocationListener { *; }
-keep class io.fabric.sdk.android.** { *; }
-keep class okio.** { *; }
-keep class retrofit2.** { *; }
-keep class okhttp3.** { *; }
-keep class com.squareup.okhttp.** { *; }
-keep class com.android.volley.** { *; }
-keep class com.flurry.** { *; }
-keep class org.apache.** { *; }
-keep class com.applovin.** { *; }
-keep class com.google.android.gms.ads.** { *; }
-keep class com.ironsource.** { *; }
-keep class com.fyber.inneractive.** { *; }
-keep class com.vungle.** { *; }
-keep class com.unity3d.ads.** { *; }
-keep class com.unity3d.services.** { *; }
-keep class com.mintegral.msdk.** { *; }
-keep class com.mbridge.msdk.** { *; }
-keep class com.adcolony.sdk.** { *; }
-keep class com.inmobi.** { *; }
-keep class com.five_corp.** { *; }
-keep class com.bytedance.** { *; }
-keep class com.smaato.** { *; }
-keep class com.safedk.** { *; }
-keep class com.applovin.quality.** { *; }

View File

@ -20,11 +20,11 @@ android {
applicationId = "com.wallpaper.magazine"
minSdk = 23
targetSdk = 34
versionCode = 3
versionName = "1.0.2"
versionCode = 4
versionName = "1.0.3"
setProperty(
"archivesBaseName",
"Wallpaper Magazine_V" + versionName + "(${versionCode})_$timestamp"
"Wallpaper MagaZine_HD WallArt" + versionName + "(${versionCode})_$timestamp"
)
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
@ -46,6 +46,10 @@ android {
kotlinOptions{
jvmTarget = "1.8"
}
buildFeatures {
viewBinding = true
}
}
dependencies {
@ -75,6 +79,4 @@ dependencies {
implementation("com.applovin.mediation:unityads-adapter:+")
}

View File

@ -2,21 +2,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"
tools:ignore="SelectedPhotoAccess" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"
<uses-permission
android:name="android.permission.READ_MEDIA_IMAGES"
tools:ignore="SelectedPhotoAccess" />
@ -31,6 +26,12 @@
android:supportsRtl="true"
android:theme="@style/Theme.WallpaperMagazine"
tools:targetApi="31">
<activity
android:name=".recylcle.SeeAllActivity"
android:exported="false" />
<activity
android:name=".PvPoActivity"
android:exported="false" />
<activity
android:name=".ViewActivity2"
android:exported="false" />

File diff suppressed because one or more lines are too long

View File

@ -2135,7 +2135,7 @@
"source": "https://resource-sg-public.lux-ad.com/wallpaper/0a42a3b35cfb1a570a6fdb97fd20fb47.jpg"
}
],
"name": "Editoru0027s Choice"
"name": "Editoru's Choice"
},
{
"data": [
@ -8639,12 +8639,6 @@
"previewThumb": "https://resource-sg-public.lux-ad.com/wallpaper/6593849a14f36eb0a7dabc8321f3473a.jpg",
"source": "https://resource-sg-public.lux-ad.com/wallpaper/d1320849ddef2a8e0ec3ea5c328f4286.jpg"
},
{
"banner": "https://resource-sg-public.lux-ad.com/wallpaper/f426b3d140021825ddfa0b8af77a8c04.jpg",
"original": "https://resource-sg-public.lux-ad.com/wallpaper/63b888960962c1e4f694e231ecea1f2c.jpg",
"previewThumb": "https://resource-sg-public.lux-ad.com/wallpaper/065138d5616c36a4a39ec35a8184c670.jpg",
"source": "https://resource-sg-public.lux-ad.com/wallpaper/1e26b04ea08dce32e20eb33535a9b78a.jpg"
},
{
"original": "https://resource-sg-public.lux-ad.com/wallpaper/f5e8b41786bf5e755c676ed586a3dc4c.jpg",
"previewThumb": "https://resource-sg-public.lux-ad.com/wallpaper/3bcf0baae6ebeadd6f4f2853cf6de591.jpg",
@ -10811,7 +10805,7 @@
"source": "https://resource-sg-public.lux-ad.com/wallpaper/1c19df178757013ce4a8a73c6795bbf0.jpg"
}
],
"name": "Cute cats"
"name": "Feline"
},
{
"data": [
@ -11485,7 +11479,7 @@
"source": "https://resource-sg-public.lux-ad.com/wallpaper/2dadccbdb7a13e63b2b3c45276342b2c.png"
}
],
"name": "Abstract"
"name": "Minimalism"
},
{
"data": [

View File

@ -7,6 +7,7 @@ import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
@ -20,6 +21,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
@ -30,6 +32,7 @@ import com.example.wallpapermagazine.adapter.adapter.MyFragmentAdapter;
import com.example.wallpapermagazine.fragment.FragmentCate;
import com.example.wallpapermagazine.fragment.FragmentHome;
import com.example.wallpapermagazine.fragment.FragmentLike;
import com.google.android.filament.BuildConfig;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationBarView;
import com.google.android.material.navigation.NavigationView;
@ -47,6 +50,7 @@ public class MainActivity extends AppCompatActivity {
private NavigationView navigationView;
private AlertDialog dialog;
private String my_package_name, versionName;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@ -55,6 +59,8 @@ public class MainActivity extends AppCompatActivity {
viewPager = findViewById(R.id.view_page_dis);
bt_view = findViewById(R.id.bt_view);
navigationView = findViewById(R.id.cata_navigation_view);
my_package_name = getPackageName();
versionName = getVersionName();
inData();
inint();
initDrawer();
@ -102,6 +108,16 @@ public class MainActivity extends AppCompatActivity {
}
private String getVersionName() {
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return "unknown"; // 或其他默认值
}
}
private void onPagerSelected(int position) {
switch (position) {
case 0:
@ -130,21 +146,28 @@ public class MainActivity extends AppCompatActivity {
@SuppressLint("QueryPermissionsNeeded")
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.menu_about) {
showDialog();
} else if (item.getItemId() == R.id.menu_face) {
if (item.getItemId() == R.id.menu_pv) {
Intent intent = new Intent(MainActivity.this, PvPoActivity.class);
startActivity(intent);
} else if (item.getItemId() == R.id.menu_rate) {
Intent intent = new Intent(Intent.ACTION_VIEW);
String packName = getPackageName();
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + packName));
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + my_package_name));
if (intent.resolveActivity(MainActivity.this.getPackageManager()) != null) {
startActivity(intent);
} else {
// 如果没有应用可以处理使用浏览器打开
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + packName));
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + my_package_name));
startActivity(intent);
}
} else if (item.getItemId() == R.id.menu_share) {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=" + my_package_name);
sendIntent.setType("text/plain");
startActivity(sendIntent);
} else {
showDialog();
}
return false;
}
});
@ -156,7 +179,7 @@ public class MainActivity extends AppCompatActivity {
@SuppressLint("InflateParams")
View dialogView = inflater.inflate(R.layout.alterdialog, null);
builder.setCustomTitle(dialogView);
builder.setMessage("The current version is 1.0.1")
builder.setMessage("The current version is " + versionName)
.setPositiveButton("Confirm", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@ -172,7 +195,6 @@ public class MainActivity extends AppCompatActivity {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
findViewById(R.id.dlt_main).setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
}
private void checkStoragePermission() {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
@ -184,7 +206,7 @@ public class MainActivity extends AppCompatActivity {
} else {
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_MEDIA_IMAGES) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{android.Manifest.permission.READ_MEDIA_IMAGES, Manifest.permission.READ_MEDIA_VIDEO, android.Manifest.permission.READ_MEDIA_AUDIO},
new String[]{android.Manifest.permission.READ_MEDIA_IMAGES},
STORAGE_PERMISSION_CODE);
}

View File

@ -0,0 +1,29 @@
package com.example.wallpapermagazine;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.ImageView;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class PvPoActivity extends AppCompatActivity {
private WebView webView;
private ImageView icon_back;
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_pv_po);
webView = findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("file:///android_asset/Privacy_Policy.html");
icon_back=findViewById(R.id.icon_back);
icon_back.setOnClickListener(view -> finish());
}
}

View File

@ -48,7 +48,6 @@ public class ViewActivity extends AppCompatActivity {
private FrameLayout frameLayoutBack;
private ViewPager viewPagerPreview;
private List<Info> info;
private FavoriteImageAdapter adapter;
private AppDatabase appDatabase;
private WallpaperManager wallpaperManager;
private FloatingActionButton fab_download, fab_like, fab_share;
@ -59,9 +58,6 @@ public class ViewActivity extends AppCompatActivity {
private int recop;
private static final int STORAGE_PERMISSION_CODE = 1;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -93,11 +89,9 @@ public class ViewActivity extends AppCompatActivity {
showMax(new onActionListener() {
@Override
public void onAction() {
textViewLoading.setVisibility(View.VISIBLE);
if (selectPreImg != null) {
loadPreview(selectPreImg);
} else {
textViewLoading.setVisibility(View.GONE);
Toast.makeText(ViewActivity.this, "Sorry setting failed", Toast.LENGTH_SHORT).show();
}
}
@ -269,28 +263,16 @@ public class ViewActivity extends AppCompatActivity {
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
setPhoneWallpaper(resource);
WallpaperOptionsBottomSheet bottomSheet = new WallpaperOptionsBottomSheet();
bottomSheet.setWallpaperBitmap(resource);
bottomSheet.show(getSupportFragmentManager(), "wallpaper_options");
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
textViewLoading.setVisibility(View.GONE);
}
});
}
private void setPhoneWallpaper(Bitmap bitmap) {
try {
wallpaperManager.setBitmap(bitmap);
finish();
Toast.makeText(this, "Setting wallpaper successfully", Toast.LENGTH_SHORT).show();
} catch (IOException ioException) {
Toast.makeText(this, "Setting failed, ", Toast.LENGTH_SHORT).show();
}
textViewLoading.setVisibility(View.GONE);
}
private void inint() {
Window window = getWindow();
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);

View File

@ -94,11 +94,9 @@ public class ViewActivity2 extends AppCompatActivity {
showMax(new onActionListener() {
@Override
public void onAction() {
textViewLoading.setVisibility(View.VISIBLE);
if (lovePreImg != null) {
loadPreview(lovePreImg);
} else {
textViewLoading.setVisibility(View.GONE);
Toast.makeText(ViewActivity2.this, "Sorry setting failed", Toast.LENGTH_SHORT).show();
}
}
@ -228,28 +226,16 @@ public class ViewActivity2 extends AppCompatActivity {
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
setPhoneWallpaper(resource);
WallpaperOptionsBottomSheet bottomSheet = new WallpaperOptionsBottomSheet();
bottomSheet.setWallpaperBitmap(resource);
bottomSheet.show(getSupportFragmentManager(), "wallpaper_options");
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
textViewLoading.setVisibility(View.GONE);
}
});
}
private void setPhoneWallpaper(Bitmap bitmap) {
try {
wallpaperManager.setBitmap(bitmap);
finish();
Toast.makeText(this, "Setting wallpaper successfully", Toast.LENGTH_SHORT).show();
} catch (IOException ioException) {
Toast.makeText(this, "Setting failed, please wait...", Toast.LENGTH_SHORT).show();
}
textViewLoading.setVisibility(View.GONE);
}
private void showMax(onActionListener listener) {
MaxManager.ShowAd(ViewActivity2.this, new onAdStatusListener() {
@Override

View File

@ -63,6 +63,7 @@ public class WallPaperSelect extends Application {
}
public static List<Info_data> getCataName() {
return cataname;
}

View File

@ -0,0 +1,71 @@
package com.example.wallpapermagazine;
import android.app.WallpaperManager;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.wallpapermagazine.databinding.BottomSheetWallpaperOptionsBinding;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import java.io.IOException;
public class WallpaperOptionsBottomSheet extends BottomSheetDialogFragment {
private BottomSheetWallpaperOptionsBinding binding;
private Bitmap wallpaperBitmap;
public void setWallpaperBitmap(Bitmap bitmap) {
this.wallpaperBitmap = bitmap;
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = BottomSheetWallpaperOptionsBinding.inflate(inflater, container, false);
return binding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.setWallpaperButton.setOnClickListener(v -> {
// 设置壁纸逻辑
requireActivity().findViewById(R.id.textview_loading).setVisibility(View.GONE);
setPhoneWallpaper(wallpaperBitmap, WallpaperManager.FLAG_SYSTEM);
dismiss();
});
binding.setLockscreenButton.setOnClickListener(v -> {
// 设置锁屏逻辑
requireActivity().findViewById(R.id.textview_loading).setVisibility(View.GONE);
setPhoneWallpaper(wallpaperBitmap, WallpaperManager.FLAG_LOCK);
dismiss();
});
binding.setBothButton.setOnClickListener(v -> {
requireActivity().findViewById(R.id.textview_loading).setVisibility(View.GONE);
setPhoneWallpaper(wallpaperBitmap, WallpaperManager.FLAG_SYSTEM | WallpaperManager.FLAG_LOCK);
dismiss();
});
}
private void setPhoneWallpaper(Bitmap bitmap, int which) {
WallpaperManager wallpaperManager = WallpaperManager.getInstance(requireContext());
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
wallpaperManager.setBitmap(bitmap, null, true, which);
}
Toast.makeText(getContext(), "Wallpaper set successfully!", Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(getContext(), "Failed to set wallpaper!", Toast.LENGTH_SHORT).show();
}
}
}

View File

@ -1,9 +1,13 @@
package com.example.wallpapermagazine.fragment;
import static com.unity3d.services.core.properties.SdkProperties.getVersionName;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
@ -26,6 +30,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.example.wallpapermagazine.MainActivity;
import com.example.wallpapermagazine.PvPoActivity;
import com.example.wallpapermagazine.R;
import com.example.wallpapermagazine.ReadFile;
import com.example.wallpapermagazine.Recycle_view;
@ -33,6 +39,7 @@ import com.example.wallpapermagazine.ViewActivity;
import com.example.wallpapermagazine.WallPaperSelect;
import com.example.wallpapermagazine.action.InfoListWallPaperListener;
import com.example.wallpapermagazine.recylcle.RecommonedAdapter;
import com.example.wallpapermagazine.recylcle.SeeAllActivity;
import com.google.android.material.navigation.NavigationView;
import java.util.Collections;
@ -48,36 +55,52 @@ public class FragmentHome extends Fragment implements InfoListWallPaperListener
private DrawerLayout drawerLayout;
private RecyclerView recyclerView;
private NavigationView navigationView;
private TextView tv_seeAll;
private int opp;
private int rand;
private String my_package_name, versionName;
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
this.mContext = context;
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(mContext).inflate(R.layout.fragment_home, container, false);
recyclerView = view.findViewById(R.id.recycler_view_home);
imageView = view.findViewById(R.id.home_more);
my_package_name = requireActivity().getPackageName();
versionName = getVersionName();
navigationView = requireActivity().findViewById(R.id.cata_navigation_view);
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.menu_about) {
if (item.getItemId() == R.id.menu_pv) {
Intent intent = new Intent(requireContext(), PvPoActivity.class);
startActivity(intent);
} else if (item.getItemId() == R.id.menu_rate) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + my_package_name));
if (intent.resolveActivity(requireActivity().getPackageManager()) != null) {
startActivity(intent);
} else {
// 如果没有应用可以处理使用浏览器打开
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + my_package_name));
startActivity(intent);
}
} else if (item.getItemId() == R.id.menu_share) {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=" + my_package_name);
sendIntent.setType("text/plain");
startActivity(sendIntent);
} else {
showDialog();
} else if (item.getItemId() == R.id.menu_face) {
Intent intent = new Intent(Intent.ACTION_VIEW);
String packName=requireContext().getPackageName();
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id="+packName));
startActivity(intent);
}
else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://sites.google.com/view/originality-prank"));
startActivity(intent);
}
return false;
}
});
@ -89,6 +112,23 @@ public class FragmentHome extends Fragment implements InfoListWallPaperListener
}
});
findByIf(view);
Random randomRec = new Random();
rand = randomRec.nextInt(WallPaperSelect.getCataName().size());
// tv_seeAll.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent =new Intent(requireContext(), SeeAllActivity.class);
// intent.putExtra("nameop",rand);
// startActivity(intent);
// }
// });
defRecom();
setRecyclerviewWallpaper();
return view;
}
private void defRecom() {
textView1.setText(WallPaperSelect.getCataName().get(5).getName());
textView2.setText(WallPaperSelect.getCataName().get(7).getName());
textView3.setText(WallPaperSelect.getCataName().get(10).getName());
@ -97,7 +137,7 @@ public class FragmentHome extends Fragment implements InfoListWallPaperListener
setHimg(imageView2, 7);
setHimg(imageView3, 10);
setVimg(imageView_trop, 15);
setRecyclerviewWallpaper(12);
imageView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -134,11 +174,9 @@ public class FragmentHome extends Fragment implements InfoListWallPaperListener
startActivity(intent);
}
});
return view;
}
private void setRecyclerviewWallpaper(int rand) {
private void setRecyclerviewWallpaper() {
Recycle_view recycle_View = new Recycle_view(10, 10, 15);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 1);
@ -155,7 +193,7 @@ public class FragmentHome extends Fragment implements InfoListWallPaperListener
LayoutInflater inflater = getLayoutInflater();
View dialogView = inflater.inflate(R.layout.alterdialog, null);
builder.setCustomTitle(dialogView);
builder.setMessage("The current version is 1.0")
builder.setMessage("The current version is " + versionName)
.setPositiveButton("Confirm", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@ -164,6 +202,17 @@ public class FragmentHome extends Fragment implements InfoListWallPaperListener
AlertDialog dialog = builder.create();
dialog.show();
}
private String getVersionName() {
try {
PackageInfo packageInfo = requireActivity().getPackageManager().getPackageInfo(requireActivity().getPackageName(), 0);
return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return "unknown"; // 或其他默认值
}
}
private void findByIf(@NonNull View view) {
imageView1 = view.findViewById(R.id.img_big);
imageView2 = view.findViewById(R.id.img_nature);
@ -173,7 +222,9 @@ public class FragmentHome extends Fragment implements InfoListWallPaperListener
textView2 = view.findViewById(R.id.tv_nature);
textView3 = view.findViewById(R.id.tv_suoer);
textView4 = view.findViewById(R.id.tv_Trop);
tv_seeAll = view.findViewById(R.id.tv_see_more);
}
private int getDataOp(int data) {
int a;
a = data;

View File

@ -1,8 +1,12 @@
package com.example.wallpapermagazine.fragment;
import static com.unity3d.services.core.properties.SdkProperties.getVersionName;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
@ -20,6 +24,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.wallpapermagazine.LoveDAO.AppDatabase;
import com.example.wallpapermagazine.LoveDAO.FavoriteImage;
import com.example.wallpapermagazine.PvPoActivity;
import com.example.wallpapermagazine.R;
import com.example.wallpapermagazine.Recycle_view;
import com.example.wallpapermagazine.ViewActivity2;
@ -37,6 +42,7 @@ public class FragmentLike extends Fragment implements FavoriteLimage {
private DrawerLayout drawerLayout;
private ImageView imageView;
private NavigationView navigationView;
private String my_package_name,versionName;
@Nullable
@Override
@ -46,22 +52,32 @@ public class FragmentLike extends Fragment implements FavoriteLimage {
recyclerView = view.findViewById(R.id.recyl_like);
imageView = view.findViewById(R.id.like_more);
navigationView = requireActivity().findViewById(R.id.cata_navigation_view);
my_package_name=requireActivity().getPackageName();
versionName=getVersionName();
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.menu_about) {
if (item.getItemId() == R.id.menu_pv) {
Intent intent = new Intent(requireContext(), PvPoActivity.class);
startActivity(intent);
} else if (item.getItemId() == R.id.menu_rate) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + my_package_name));
if (intent.resolveActivity(requireActivity().getPackageManager()) != null) {
startActivity(intent);
} else {
// 如果没有应用可以处理使用浏览器打开
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + my_package_name));
startActivity(intent);
}
}else if(item.getItemId()==R.id.menu_share){
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "https://play.google.com/store/apps/details?id=" + my_package_name);
sendIntent.setType("text/plain");
startActivity(sendIntent);
}else {
showDialog();
} else if (item.getItemId() == R.id.menu_face) {
Intent intent = new Intent(Intent.ACTION_VIEW);
String packName=requireContext().getPackageName();
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id="+packName));
startActivity(intent);
}
else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://sites.google.com/view/originality-prank"));
startActivity(intent);
}
return false;
}
@ -80,7 +96,7 @@ public class FragmentLike extends Fragment implements FavoriteLimage {
private void setRecyclerviewWallpaper() {
Recycle_view recycle_View = new Recycle_view(10, 10, 15);
Recycle_view recycle_View = new Recycle_view(16, 20, 0);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.addItemDecoration(recycle_View);
@ -93,7 +109,7 @@ public class FragmentLike extends Fragment implements FavoriteLimage {
LayoutInflater inflater = getLayoutInflater();
View dialogView = inflater.inflate(R.layout.alterdialog, null);
builder.setCustomTitle(dialogView);
builder.setMessage("The current version is 1.0")
builder.setMessage("The current version is "+versionName)
.setPositiveButton("Confirm", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@ -104,7 +120,14 @@ public class FragmentLike extends Fragment implements FavoriteLimage {
AlertDialog dialog = builder.create();
dialog.show();
}
private String getVersionName() {
try {
PackageInfo packageInfo = requireActivity().getPackageManager().getPackageInfo(requireActivity().getPackageName(), 0);return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return "unknown"; // 或其他默认值
}
}
private void loadFavoriteImages() {
new Thread(new Runnable() {
@Override

View File

@ -54,16 +54,19 @@ public class PreviewFragment2 extends Fragment {
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
imageViewPreview.setImageBitmap(resource);
progressBar.setVisibility(View.GONE);
requireActivity().findViewById(R.id.set_wallpaper).setEnabled(true);
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
super.onLoadFailed(errorDrawable);
requireActivity().findViewById(R.id.set_wallpaper).setEnabled(false);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
progressBar.setVisibility(View.GONE);
requireActivity().findViewById(R.id.set_wallpaper).setEnabled(true);
}
});
return fragmentview;

View File

@ -42,7 +42,6 @@ public class FavoriteImageAdapter extends RecyclerView.Adapter<ImageViewHolder>
}
@NonNull
@Override
public ImageViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

View File

@ -25,8 +25,8 @@ import java.util.Objects;
public class RecommonedAdapter extends RecyclerView.Adapter<RecommonedHolder> {
private List<Info_data> datainfo;
private Context mycontext;
private final List<Info_data> datainfo;
private final Context mycontext;
private final int op;
private InfoListWallPaperListener infoWallPaperListener;
@ -78,6 +78,6 @@ public class RecommonedAdapter extends RecyclerView.Adapter<RecommonedHolder> {
@Override
public int getItemCount() {
return datainfo.get(op).getDatas().size();
return 6;
}
}

View File

@ -0,0 +1,52 @@
package com.example.wallpapermagazine.recylcle;
import android.content.Intent;
import android.os.Bundle;
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.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.wallpapermagazine.R;
import com.example.wallpapermagazine.Recycle_view;
import com.example.wallpapermagazine.ViewActivity;
import com.example.wallpapermagazine.WallPaperSelect;
import com.example.wallpapermagazine.action.InfoListWallPaperListener;
public class SeeAllActivity extends AppCompatActivity implements InfoListWallPaperListener{
private int op;
private RecyclerView recyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_see_all);
recyclerView=findViewById(R.id.recycler_view_see_all);
op=getIntent().getIntExtra("nameop",0);
setRecyclerviewWallpaper();
}
private void setRecyclerviewWallpaper() {
Recycle_view recycle_View = new Recycle_view(10, 10, 15);
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.addItemDecoration(recycle_View);
CataItemAdapter cataItemAdapter = new CataItemAdapter(WallPaperSelect.getCataName(),op ,this);
cataItemAdapter.setInfoWallPaperListener((InfoListWallPaperListener) this);
recyclerView.setAdapter(cataItemAdapter);
}
@Override
public void onItemClickAction(int nameop, int recop) {
Intent intent = new Intent(getBaseContext(), ViewActivity.class);
intent.putExtra("naop",nameop);
intent.putExtra("dataop",recop);
startActivity(intent);
}
}

15
app/src/main/new.xml Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:padding="16dp">
<Button android:id="@+id/setWallpaperButton" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="Set as Wallpaper" />
<Button android:id="@+id/setLockscreenButton" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="Set as Lockscreen" />
<Button android:id="@+id/setBothButton" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="Set Both" />
</LinearLayout>

View File

@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="44dp"
android:height="44dp"
android:viewportWidth="44"
android:viewportHeight="44">
<path
android:pathData="M16,0L28,0A16,16 0,0 1,44 16L44,28A16,16 0,0 1,28 44L16,44A16,16 0,0 1,0 28L0,16A16,16 0,0 1,16 0z"
android:fillColor="#80000000"
android:fillAlpha="0.5"/>
<path
android:pathData="M25.5,28L19.5,22L25.5,16"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#000000"
android:strokeLineCap="round"/>
</vector>

View File

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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/dlt_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/th"
tools:openDrawer="start"
android:orientation="vertical">
android:orientation="vertical"
tools:openDrawer="start">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_page_dis"
android:layout_width="match_parent"
@ -33,13 +35,13 @@
<com.google.android.material.navigation.NavigationView
android:id="@+id/cata_navigation_view"
android:background="@color/gray"
android:layout_width="270dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/gray"
app:headerLayout="@layout/nac_view_lay"
app:menu="@menu/view_nav"
app:itemTextColor="@color/white"
app:itemBackground="@color/gray"
app:itemIconTint="@color/white"
app:itemBackground="@color/gray" />
app:itemTextColor="@color/white"
app:menu="@menu/view_nav" />
</androidx.drawerlayout.widget.DrawerLayout>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="13dp"
android:layout_marginBottom="50dp" />
<ImageView
android:id="@+id/icon_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="20dp"
android:src="@drawable/icon_back" />
</RelativeLayout>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/wallpaper"
android:orientation="vertical"
android:paddingTop="30dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingEnd="20dp">
<ImageView
android:id="@+id/cate_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/more_back"
android:src="@drawable/more" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/see_all"
android:textColor="@color/white"
android:textSize="20sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_see_all"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp" />
</LinearLayout>

View File

@ -9,7 +9,7 @@
android:id="@+id/dialog_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/about"
android:text="@string/version"
android:textSize="20sp"
android:textAlignment="center" /> <!-- 使文本居中 -->
</LinearLayout>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/setWallpaperButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/home_screen"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/setLockscreenButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="41dp"
android:gravity="center"
android:text="@string/lock_screen"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/setBothButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="41dp"
android:gravity="center"
android:text="@string/both"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>

View File

@ -2,9 +2,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cata_item_lay"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:paddingTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"

View File

@ -173,29 +173,42 @@
</RelativeLayout>
<LinearLayout
<RelativeLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/relativeLayout"
android:layout_marginTop="16dp" />
<TextView
android:id="@+id/tv_recommend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayout"
android:text="@string/recommend"
android:textColor="@color/white"
android:textSize="20sp" />
<TextView
android:id="@+id/tv_see_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayout"
android:layout_alignParentEnd="true"
android:layout_marginEnd="20dp"
android:text="@string/see_all"
android:textColor="@color/white"
android:textSize="20sp"
android:visibility="gone"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_home"
android:layout_width="match_parent"
android:layout_height="216dp"
android:layout_marginTop="16dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:text="@string/recommend"
android:textColor="@color/white"
android:textSize="20sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_home"
android:layout_width="match_parent"
android:layout_height="216dp"
android:orientation="horizontal" />
</LinearLayout>
android:layout_below="@id/tv_recommend"
android:orientation="horizontal" />
</RelativeLayout>

View File

@ -33,6 +33,9 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyl_like"
android:layout_marginTop="20dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View File

@ -1,13 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/menu_about"
android:icon="@drawable/about"
android:title="@string/about"/>
<item
android:id="@+id/menu_face"
android:icon="@drawable/facebook"
android:title="@string/feedback"/>
<item
android:id="@+id/menu_pv"
android:icon="@mipmap/icon_pv"
android:title="@string/privacy_policy" />
<item
android:id="@+id/menu_rate"
android:icon="@mipmap/icon_rate"
android:title="@string/rate" />
<item
android:id="@+id/menu_share"
android:icon="@mipmap/icon_share"
android:title="@string/share" />
<item
android:id="@+id/menu_ver"
android:icon="@mipmap/icon_ver"
android:title="@string/version" />
</group>
</menu>

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,5 +1,5 @@
<resources>
<string name="app_name">Wallpaper Magazine</string>
<string name="app_name">Wallpaper MagaZine: HD WallArt</string>
<string name="welcome">WELCOME!</string>
<string name="discover">Discover</string>
<string name="recommend">Recommend</string>
@ -15,13 +15,17 @@
<string name="todo">TODO</string>
<string name="wallpaper_magazine">Wallpaper
Magazine</string>
<string name="about">About</string>
<string name="privacy_policy">Privacy Policy</string>
<string name="feedback">Feedback</string>
<string name="rate">Rate</string>
<string name="download">Downloading...</string>
<string name="set_wallpaper">SET Wallpaper</string>
<string name="love">love</string>
<string name="share">share</string>
<string name="share">Share</string>
<string name="viewpageback">viewpageback</string>
<string name="more_back">more_back</string>
<string name="version">Version</string>
<string name="see_all">See All</string>
<string name="home_screen">Home screen</string>
<string name="lock_screen">Lock screen</string>
<string name="both">Both</string>
</resources>

View File

@ -1,4 +1,4 @@
app_name=Wallpaper Magazine
app_name=Wallpaper MagaZine: HD WallArt
package_name=com.wallpaper.magazine
keystoreFile=app/wallpapermagazinetest.jks
key_alias=wallpapermagazinetestkey0