Skip to content

Commit

Permalink
使用androidX
Browse files Browse the repository at this point in the history
  • Loading branch information
Jlanglang committed Apr 19, 2020
1 parent 8f1850b commit 1d47237
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions app/src/main/java/com/baozi/mvp/base/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -200,12 +202,12 @@ public <V extends View> V findView(@IdRes int viewId) {
*/
protected View initView(@NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState) {
int layout = initView(savedInstanceState);
try {
return inflater.inflate(layout, null);
} catch (Exception e) {
e.printStackTrace();
return null;
}
// try {
return inflater.inflate(layout, null);
// } catch (Exception e) {
// e.printStackTrace();
// return null;
// }
}

/**
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/res/layout/at_viewpage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</com.google.android.material.appbar.AppBarLayout>

<androidx.viewpager.widget.ViewPager
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
android:id="@+id/vp_content"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/res/layout/fg_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
android:id="@+id/vp_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior" />
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 comments on commit 1d47237

Please sign in to comment.