Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
670848654 committed May 18, 2020
1 parent 1e8abcf commit a9dd1b5
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 45 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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内核无限加载的问题"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -113,6 +115,10 @@ public class DescActivity extends BaseActivity<DescContract.View, DescPresenter>
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() {
Expand All @@ -136,14 +142,22 @@ 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();
initSwipe();
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);
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/java/my/project/sakuraproject/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
33 changes: 13 additions & 20 deletions app/src/main/res/layout/activity_desc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="280dp"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<com.google.android.material.appbar.CollapsingToolbarLayout
Expand Down Expand Up @@ -43,12 +43,9 @@
app:layout_anchor="@id/appBarLayout" />

<LinearLayout
android:id="@+id/desc_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginTop="90dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_height="180dp"
android:orientation="horizontal"
app:layout_anchor="@id/appBarLayout"
app:layout_collapseMode="parallax"
Expand All @@ -59,7 +56,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
app:cardBackgroundColor="@android:color/transparent"
app:cardBackgroundColor="@color/toolbar_layout_bg"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">

Expand Down Expand Up @@ -128,6 +125,7 @@
<LinearLayout
android:id="@+id/play_layout"
android:visibility="gone"
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
Expand All @@ -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="选集">
</androidx.appcompat.widget.AppCompatTextView>

Expand All @@ -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="展开全部" />
<ImageView
android:id="@+id/down_img"
Expand All @@ -183,17 +178,16 @@
<LinearLayout
android:id="@+id/multi_layout"
android:visibility="gone"
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
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="多季">
</androidx.appcompat.widget.AppCompatTextView>
<androidx.recyclerview.widget.RecyclerView
Expand All @@ -209,17 +203,16 @@
<LinearLayout
android:id="@+id/recommend_layout"
android:visibility="gone"
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
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="相关推荐">
</androidx.appcompat.widget.AppCompatTextView>
<androidx.recyclerview.widget.RecyclerView
Expand Down
38 changes: 18 additions & 20 deletions app/src/main/res/layout/dialog_drama.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,34 @@
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:text="@string/anthology"
android:textColor="@color/text_color_primary"
android:textSize="16sp"
android:textStyle="bold"/>
android:textColor="@color/text_color_primary" />

<ImageView
android:id="@+id/close_drama"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/baseline_close_white_48dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
android:src="@drawable/ic_keyboard_arrow_down_white_48dp"
android:tint="@color/jd_bg"
android:layout_alignParentRight="true"
/>
</RelativeLayout>

<LinearLayout
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
<LinearLayout
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/drama_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/drama_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingBottom="10dp"/>
</LinearLayout>
android:clipToPadding="false"
android:paddingBottom="10dp"/>
</LinearLayout>

</LinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<string name="test_model_desc">OnePlus 7 Pro\nAndroid 10</string>
<string name="now_version">当前版本</string>
<string name="final_compile">最后编译日期</string>
<string name="final_compile_time">2020年4月30日</string>
<string name="final_compile_time">2020年5月18日</string>
<string name="cache">缓存目录</string>
<string name="cache_text">/SakuraAnime/\n卸载后自行删除此目录</string>
<string name="github">Github</string>
Expand Down

0 comments on commit a9dd1b5

Please sign in to comment.