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 Apr 30, 2020
1 parent eb337b3 commit 1e8abcf
Show file tree
Hide file tree
Showing 63 changed files with 1,363 additions and 943 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 16
versionName "1.8.6_b"
versionCode 17
versionName "1.8.7"
ndk{abiFilters "armeabi", "armeabi-v7a", "x86"}
resConfigs"zh"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package my.project.sakuraproject.adapter;

import android.content.Context;
import android.widget.Button;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import my.project.sakuraproject.R;
import my.project.sakuraproject.bean.AnimeDescDetailsBean;

/**
* 播放列表适配器
*/
public class AnimeDescDetailsAdapter extends BaseQuickAdapter<AnimeDescDetailsBean, BaseViewHolder> {
private Context context;

public AnimeDescDetailsAdapter(Context context, @Nullable List<AnimeDescDetailsBean> data) {
super(R.layout.item_desc_details, data);
this.context = context;
}

@Override
protected void convert(final BaseViewHolder helper, AnimeDescDetailsBean item) {
Button btn = helper.getView(R.id.tag_group);
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.tabSelectedTextColor));
} else {
helper.getView(R.id.tag_group).setBackgroundResource(R.drawable.button_default);
btn.setTextColor(context.getResources().getColor(R.color.text_color_primary));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package my.project.sakuraproject.adapter;

import android.content.Context;
import android.widget.Button;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import my.project.sakuraproject.R;
import my.project.sakuraproject.bean.AnimeDescDetailsBean;

/**
* 展开播放列表适配器
*/
public class AnimeDescDramaAdapter extends BaseQuickAdapter<AnimeDescDetailsBean, BaseViewHolder> {
private Context context;

public AnimeDescDramaAdapter(Context context, @Nullable List<AnimeDescDetailsBean> data) {
super(R.layout.item_desc_drama, data);
this.context = context;
}

@Override
protected void convert(final BaseViewHolder helper, AnimeDescDetailsBean item) {
Button btn = helper.getView(R.id.tag_group);
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.tabSelectedTextColor));
} else {
helper.getView(R.id.tag_group).setBackgroundResource(R.drawable.button_default);
btn.setTextColor(context.getResources().getColor(R.color.text_color_primary));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package my.project.sakuraproject.adapter;

import android.content.Context;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import my.project.sakuraproject.R;
import my.project.sakuraproject.bean.AnimeDescRecommendBean;
import my.project.sakuraproject.util.Utils;

/**
* 相关推荐适配器
*/
public class AnimeDescRecommendAdapter extends BaseQuickAdapter<AnimeDescRecommendBean, BaseViewHolder> {
private Context context;

public AnimeDescRecommendAdapter(Context context, @Nullable List<AnimeDescRecommendBean> data) {
super(R.layout.item_desc_recommend, data);
this.context = context;
}

@Override
protected void convert(final BaseViewHolder helper, AnimeDescRecommendBean item) {
Utils.setCardDefaultBg(context, helper.getView(R.id.card_view), helper.getView(R.id.title));
helper.setText(R.id.title, item.getTitle());
Utils.setDefaultImage(context, item.getImg(), helper.getView(R.id.img));
Utils.setCardBg(context, item.getImg(), helper.getView(R.id.card_view), helper.getView(R.id.title));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@
import java.util.List;

import my.project.sakuraproject.R;
import my.project.sakuraproject.bean.AnimeDescBean;
import my.project.sakuraproject.bean.AnimeDescDetailsBean;

public class DramaAdapter extends BaseQuickAdapter<AnimeDescBean, BaseViewHolder> {
public class DramaAdapter extends BaseQuickAdapter<AnimeDescDetailsBean, BaseViewHolder> {
private Context context;

public DramaAdapter(Context context, @Nullable List<AnimeDescBean> data) {
public DramaAdapter(Context context, @Nullable List<AnimeDescDetailsBean> data) {
super(R.layout.item_btn, data);
this.context = context;
}

@Override
protected void convert(final BaseViewHolder helper, AnimeDescBean item) {
String title = item.getTitle();
protected void convert(final BaseViewHolder helper, AnimeDescDetailsBean item) {
Button btn = helper.getView(R.id.tag_group);
helper.setText(R.id.tag_group, title.replaceAll("第", "").replaceAll("集", ""));
if (item.isSelect()) {
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));
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/my/project/sakuraproject/application/Sakura.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import android.app.Activity;
import android.app.Application;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.appcompat.app.AppCompatDelegate;

import com.bumptech.glide.Glide;
import com.google.android.material.snackbar.Snackbar;
import com.tencent.smtt.sdk.QbSdk;

import org.json.JSONObject;
Expand Down Expand Up @@ -109,6 +111,14 @@ public void showCustomToastMsg(String msg, @DrawableRes int iconRes, @ColorRes i
iconRes, color, Toast.LENGTH_LONG, true, true).show();
}

public void showSnackbarMsgAction(View view, String msg, String actionMsg, View.OnClickListener listener) {
Snackbar.make(view, msg, Snackbar.LENGTH_LONG).setAction(actionMsg, listener).show();
}

public void showSnackbarMsg(View view, String msg) {
Snackbar.make(view, msg, Snackbar.LENGTH_LONG).show();
}

public void addActivity(Activity activity) {
if (!oList.contains(activity)) {
oList.add(activity);
Expand Down
105 changes: 0 additions & 105 deletions app/src/main/java/my/project/sakuraproject/bean/AnimeDescBean.java

This file was deleted.

Loading

0 comments on commit 1e8abcf

Please sign in to comment.