diff --git a/app/build.gradle b/app/build.gradle index d5c865b..9f74558 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "my.project.sakuraproject" minSdkVersion 21 targetSdkVersion 29 - versionCode 17 - versionName "1.8.7" + versionCode 18 + versionName "1.8.8" ndk{abiFilters "armeabi", "armeabi-v7a", "x86"} resConfigs"zh" } diff --git a/app/src/main/java/my/project/sakuraproject/adapter/DramaAdapter.java b/app/src/main/java/my/project/sakuraproject/adapter/DramaAdapter.java index 53ad3ec..810f7a2 100644 --- a/app/src/main/java/my/project/sakuraproject/adapter/DramaAdapter.java +++ b/app/src/main/java/my/project/sakuraproject/adapter/DramaAdapter.java @@ -27,7 +27,7 @@ protected void convert(final BaseViewHolder helper, AnimeDescDetailsBean item) { helper.setText(R.id.tag_group, item.getTitle().replaceAll("第", "").replaceAll("集", "")); if (item.isSelected()) { helper.getView(R.id.tag_group).setBackgroundResource(R.drawable.button_selected); - btn.setTextColor(context.getResources().getColor(R.color.item_selected_color)); + btn.setTextColor(context.getResources().getColor(R.color.tabSelectedTextColor)); } else { helper.getView(R.id.tag_group).setBackgroundResource(R.drawable.button_default); diff --git a/app/src/main/java/my/project/sakuraproject/main/about/AboutActivity.java b/app/src/main/java/my/project/sakuraproject/main/about/AboutActivity.java index aedb56e..5f8faaa 100644 --- a/app/src/main/java/my/project/sakuraproject/main/about/AboutActivity.java +++ b/app/src/main/java/my/project/sakuraproject/main/about/AboutActivity.java @@ -168,6 +168,7 @@ public void showUpdateLogs() { public List createUpdateLogList() { List logsList = new ArrayList(); + logsList.add(new LogBean("版本:1.8.8","修复已知问题")); logsList.add(new LogBean("版本:1.8.7","部分界面UI改动\n修复番剧详情界面显示问题")); logsList.add(new LogBean("版本:1.8.6_b","修复内置播放器播放完毕后程序崩溃的问题")); logsList.add(new LogBean("版本:1.8.6_a","修复内置播放器使用Exo内核无限加载的问题")); diff --git a/app/src/main/java/my/project/sakuraproject/main/desc/DescActivity.java b/app/src/main/java/my/project/sakuraproject/main/desc/DescActivity.java index ddbb716..30a7da7 100644 --- a/app/src/main/java/my/project/sakuraproject/main/desc/DescActivity.java +++ b/app/src/main/java/my/project/sakuraproject/main/desc/DescActivity.java @@ -33,6 +33,8 @@ import com.fanchen.sniffing.SniffingUICallback; import com.fanchen.sniffing.SniffingVideo; import com.fanchen.sniffing.web.SniffingUtil; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.r0adkll.slidr.Slidr; @@ -113,6 +115,10 @@ public class DescActivity extends BaseActivity private ImageView closeDrama; private BottomSheetDialog mBottomSheetDialog; private AnimeDescDramaAdapter animeDescDramaAdapter; + @BindView(R.id.appBarLayout) + AppBarLayout appBarLayout; + @BindView(R.id.desc_view) + LinearLayout desc_view; @Override protected DescPresenter createPresenter() { @@ -136,7 +142,7 @@ protected void init() { Slidr.attach(this, Utils.defaultInit()); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) msg.getLayoutParams(); params.setMargins(0, 0, 0, Utils.getNavigationBarHeight(this) - 5); - msg.setLayoutParams(params); + setCollapsingToolbarLayoutHeight(); getBundle(); initToolbar(); initFab(); @@ -144,6 +150,14 @@ protected void init() { initAdapter(); } + private void setCollapsingToolbarLayoutHeight() { + appBarLayout.setLayoutParams(new CoordinatorLayout.LayoutParams(CoordinatorLayout.LayoutParams.MATCH_PARENT, Utils.getActionBarHeight() + Utils.getStatusBarHeight() + Utils.dpToPx(this,200))); + CollapsingToolbarLayout.LayoutParams params2 = (CollapsingToolbarLayout.LayoutParams) desc_view.getLayoutParams(); + int marginSize = Utils.dpToPx(this, 10); + params2.setMargins(marginSize, Utils.getActionBarHeight() + Utils.getStatusBarHeight() + marginSize, marginSize, marginSize); + } + + @Override protected void initBeforeView() { SwipeBackLayoutUtil.convertActivityToTranslucent(this); diff --git a/app/src/main/java/my/project/sakuraproject/util/Utils.java b/app/src/main/java/my/project/sakuraproject/util/Utils.java index 8837136..45a99db 100644 --- a/app/src/main/java/my/project/sakuraproject/util/Utils.java +++ b/app/src/main/java/my/project/sakuraproject/util/Utils.java @@ -21,6 +21,7 @@ import android.provider.Settings; import android.util.DisplayMetrics; import android.util.Log; +import android.util.TypedValue; import android.view.Display; import android.view.View; import android.view.WindowManager; @@ -582,6 +583,32 @@ public static int dpToPx(Context context, float dp) { return (int) ((dp * scale) + 0.5f); } + /** + * 获取状态栏高度 + * @return + */ + public static int getStatusBarHeight() { + int statusBarHeight = 20; + int resourceId = getContext().getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + statusBarHeight = getContext().getResources().getDimensionPixelSize(resourceId); + } + return statusBarHeight; + } + + /** + * 获取ActionBar 高度 + * @return + */ + public static int getActionBarHeight(){ + TypedValue tv = new TypedValue(); + if (getContext().getTheme().resolveAttribute(android.R.attr.actionBarSize,tv,true)){ + return TypedValue.complexToDimensionPixelSize(tv.data, + getContext().getResources().getDisplayMetrics()); + } + return 0; + } + /** * X5内核加载状态 * @return diff --git a/app/src/main/res/layout/activity_desc.xml b/app/src/main/res/layout/activity_desc.xml index 14a3e29..a7d1528 100644 --- a/app/src/main/res/layout/activity_desc.xml +++ b/app/src/main/res/layout/activity_desc.xml @@ -9,7 +9,7 @@ @@ -128,6 +125,7 @@ @@ -136,9 +134,8 @@ android:textColor="@color/text_color_primary" android:layout_width="match_parent" android:layout_height="wrap_content" - android:padding="5dp" - android:textSize="18sp" - android:textStyle="bold" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" android:text="选集"> @@ -165,8 +162,6 @@ android:textColor="@color/colorAccent" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textStyle="bold" - android:textSize="14sp" android:text="展开全部" /> @@ -190,10 +186,8 @@ android:textColor="@color/text_color_primary" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="5dp" - android:paddingLeft="5dp" - android:textSize="18sp" - android:textStyle="bold" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" android:text="多季"> @@ -216,10 +211,8 @@ android:textColor="@color/text_color_primary" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="5dp" - android:paddingLeft="5dp" - android:textSize="18sp" - android:textStyle="bold" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" android:text="相关推荐"> + android:textColor="@color/text_color_primary" /> - + + - - - + android:clipToPadding="false" + android:paddingBottom="10dp"/> + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a8312c6..8d276c3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -120,7 +120,7 @@ OnePlus 7 Pro\nAndroid 10 当前版本 最后编译日期 - 2020年4月30日 + 2020年5月18日 缓存目录 /SakuraAnime/\n卸载后自行删除此目录 Github