Skip to content

Commit

Permalink
support支持
Browse files Browse the repository at this point in the history
  • Loading branch information
hss01248 committed Oct 21, 2020
1 parent e37e9fd commit d21bf53
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 36 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'androidx.appcompat:appcompat:1.1.0'
compile 'com.android.support:appcompat-v7:28.0.0'
compile project(path: ':pagestate')
compile 'com.nineoldandroids:library:2.4.0'
//compile 'com.jakewharton:butterknife:10.2.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.hss01248.pagestate.demo;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package com.hss01248.pagestate.demo;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.Nullable;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;



import com.hss01248.pagestate.PageStateConfig;
import com.hss01248.pagestate.PageStateManager;


import java.util.Random;

/**
* Created by huangshuisheng on 2017/10/16.
*/

public class CustomUIActy extends Activity {
public class CustomUIActy extends AppCompatActivity {

PageStateManager pageStateManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;

import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.hss01248.pagestate.PageStateConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Build;
import androidx.core.content.ContextCompat;

import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/hss01248/pagestate/demo/SplashActy.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.hss01248.pagestate.demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;




/**
* Created by huangshuisheng on 2017/10/16.
*/

public class SplashActy extends Activity implements View.OnClickListener {
public class SplashActy extends AppCompatActivity implements View.OnClickListener {



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.hss01248.pagestate.PageStateConfig;
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/attr/loading_arrts.xml

This file was deleted.

3 changes: 2 additions & 1 deletion app/src/main/res/layout/load_view.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
Expand All @@ -17,7 +18,7 @@
android:layout_height="3dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="82dp"
android:src="@drawable/loading_shadow" />
app:srcCompat="@drawable/loading_shadow" />

<TextView
android:id="@+id/promptTV"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/pager_empty_2.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
android:gravity="center"
Expand All @@ -11,7 +12,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher" />
app:srcCompat="@mipmap/ic_launcher" />

<TextView
android:id="@+id/no_result_msg"
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/pager_error_2.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:gravity="center_horizontal"
Expand All @@ -12,7 +13,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="130dp"
android:src="@mipmap/network_error"/>
app:srcCompat="@mipmap/network_error"/>

<TextView
android:id="@+id/error_tips"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<declare-styleable name="LoadingView">
<attr name="loadingText" format="string"/>
<attr name="loadingTextAppearance" format="reference"/>
</declare-styleable>

</resources>
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
android.enableJetifier=false
android.useAndroidX=false
2 changes: 1 addition & 1 deletion pagestate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
api 'androidx.appcompat:appcompat:1.1.0'
api 'com.android.support:appcompat-v7:28.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import androidx.appcompat.app.AlertDialog;
import android.support.v7.app.AlertDialog;


/**
* time:2020/4/25
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.hss01248.pagestate;

import android.app.Activity;
import android.content.Context;
import androidx.fragment.app.Fragment;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;




/**
* Created by zhy on 15/8/27.
*/
Expand Down Expand Up @@ -36,8 +38,8 @@ public void onRetry(View retryView) {
private PageStateManager(Object activityOrView, PageStateConfig listener) {
ViewGroup contentParent = null;
Context context;
if (activityOrView instanceof Activity) {
Activity activity = (Activity) activityOrView;
if (activityOrView instanceof AppCompatActivity) {
AppCompatActivity activity = (AppCompatActivity) activityOrView;
context = activity;
contentParent = (ViewGroup) activity.findViewById(android.R.id.content);
} else if (activityOrView instanceof Fragment) {
Expand Down
3 changes: 2 additions & 1 deletion pagestate/src/main/res/layout/pager_empty.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:background="#ffffff"
android:orientation="vertical"
Expand All @@ -12,7 +13,7 @@
android:layout_height="228dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"
android:src="@drawable/ic_empty_page_2" />
app:srcCompat="@drawable/ic_empty_page_2" />
<TextView
android:id="@+id/tv_msg_empty"
android:layout_below="@id/empty_icon"
Expand Down
3 changes: 2 additions & 1 deletion pagestate/src/main/res/layout/pager_error.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -17,7 +18,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:src="@drawable/ic_error_page" />
app:srcCompat="@drawable/ic_error_page" />

<TextView
android:id="@+id/tv_msg_error"
Expand Down

0 comments on commit d21bf53

Please sign in to comment.