Skip to content

Commit

Permalink
修复加载不出内容问题
Browse files Browse the repository at this point in the history
Signed-off-by: pikachu <[email protected]>
Signed-off-by: pkpk <[email protected]>
  • Loading branch information
pikachu0621 committed Oct 9, 2022
1 parent ae6aa45 commit 454698c
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 33 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
*.iml
.gradle
.idea
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
Expand Down
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

28 changes: 26 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,42 @@ android {
applicationId "com.pikachu.wallpaper"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionCode 7
versionName "1.0.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}


signingConfigs {
release {
storeFile file("key.jks")
storePassword "123456"
keyAlias "key0"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
}


buildTypes {
release {
// 未添加混淆
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

debug {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
Binary file modified app/key.jks
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ private void load(boolean isUpData) {

String url = AppInfo.getUrl(jsonHomeTabsList, page);

new LoadUrl(activity,url, new LoadUrl.OnCall() {
Tools.showToast(getContext(), url);
Log.i("TEST_TT", url);

new LoadUrl(activity, url, new LoadUrl.OnCall() {


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void finish(String str) {

JsonHomeTabsList jsonHomeTabsList = new JsonHomeTabsList();
jsonHomeTabsList.setTabStr("热门分类");
f2ItemData.add(new F2ItemData(jsonHomeTabsList,F2ItemData.TEXT,F2ItemData.TEXT_MAX));
f2ItemData.add(new F2ItemData(jsonHomeTabsList,F2ItemData.TEXT, F2ItemData.TEXT_MAX));

for (int i =0 ; i < jsonHomeTabsLists.size() ; i++){
if (i == AppInfo.APP_HOME_F2_RM ){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class AppInfo {

//////////// API ///////
//用于加载图片列表
public static final String APP_API_IMAGE_LIST = "https://api.ihansen.org/img/detail?page={page}&index=&orderBy={tabs}&tag={tag}&favorites=";
public static final String APP_API_IMAGE_LIST = "https://api.ihansen.org/img/detail?perPage=20&page={page}&index=&orderBy={tabs}&tag={tag}&favorites=";
public static final String APP_API_TABS_LIST = "https://photo.ihansen.org";
//必应每日一图
public static final String APP_API_DAY_ONE_IMAGE = "https://api.no0a.cn/api/bing/0";
Expand Down
14 changes: 9 additions & 5 deletions app/src/main/java/com/pikachu/wallpaper/util/app/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.content.res.Resources;
import android.net.Uri;
import android.provider.Settings;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -274,20 +275,23 @@ public static List<JsonHomeTabsList> strToTabsObject(String str){
ArrayList<JsonHomeTabsList> jsonHomeTabsLists = new ArrayList<>();

if (str != null && !str.equals("")){
String str1 = cutStr(str, "js-tag-container\">", "<div class=\"container-item");
String str1 = cutStr(str, "js-tag-container\"", "<div class=\"container-item");
if (str1 != null && !str1.equals("") ){
String replace = str1.replace(" ", "").replace("\n", "");
String[] dataS = replace.split("<divclass=\"tag-item\"");
for (String ob:dataS){
if (ob != null && !ob.equals("")){
for (String ob : dataS){
if (ob != null && ob.contains("background-image")){
boolean isTagTab = true;
String tabStr = cutStr(ob, "tag-item-text\"><b>", "<");
String imageURl = cutStr(ob, "url('", "');");
String tabE = cutStr(ob, "href=\"/tag/", "\"");
if (tabE == null || tabE.equals("")){
tabE = cutStr(ob, "href=\"/", "\"");
tabE = tabE.replace("trending","likes");
tabE = tabE.replace("discover","");
if (tabE != null){
tabE = tabE.replace("trending","likes");
tabE = tabE.replace("albums","likes");
tabE = tabE.replace("discover","");
}
isTagTab = false;
}
jsonHomeTabsLists.add(new JsonHomeTabsList(imageURl,tabStr,tabE,isTagTab));
Expand Down
Binary file modified image/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions image/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0",
"versionCode": 7,
"versionName": "1.0.6",
"outputFile": "app-release.apk"
}
]
Expand Down

0 comments on commit 454698c

Please sign in to comment.