Update text color

pull/123/head
FongMi 3 years ago
parent 0d74fe5c0a
commit c74a7b6d59
  1. 3
      app/src/leanback/java/com/fongmi/android/tv/ui/adapter/LiveAdapter.java
  2. 5
      app/src/leanback/java/com/fongmi/android/tv/ui/presenter/SitePresenter.java
  3. 2
      app/src/leanback/res/drawable/shape_text_activated.xml
  4. 2
      app/src/leanback/res/layout/adapter_live.xml
  5. 9
      app/src/leanback/res/layout/adapter_site.xml
  6. 4
      app/src/main/java/com/fongmi/android/tv/bean/Live.java
  7. 4
      app/src/main/java/com/fongmi/android/tv/bean/Site.java
  8. 3
      app/src/main/res/color/text.xml

@ -41,7 +41,8 @@ public class LiveAdapter extends RecyclerView.Adapter<LiveAdapter.ViewHolder> {
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Live item = mItems.get(position);
holder.binding.text.setText(item.getActivatedName());
holder.binding.text.setText(item.getName());
holder.binding.text.setActivated(item.isActivated());
holder.binding.getRoot().setSelected(item.isActivated());
holder.binding.text.setOnClickListener(v -> mListener.onItemClick(item));
}

@ -52,8 +52,11 @@ public class SitePresenter extends Presenter {
public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object object) {
Site item = (Site) object;
ViewHolder holder = (ViewHolder) viewHolder;
holder.binding.text.setText(item.getName());
holder.binding.text.setFocusable(!search || filter);
holder.binding.text.setText(item.getActivatedName());
holder.binding.text.setActivated(item.isActivated());
holder.binding.filter.setActivated(item.isActivated());
holder.binding.search.setActivated(item.isActivated());
holder.binding.filter.setImageResource(item.getFilterIcon());
holder.binding.search.setImageResource(item.getSearchIcon());
holder.binding.search.setVisibility(search ? View.VISIBLE : View.GONE);

@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/black_70" />
<solid android:color="@color/black_50" />
<corners android:radius="4dp" />

@ -10,6 +10,6 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/white"
android:textColor="@color/text"
android:textSize="18sp"
tools:text="https://fongmi.github.io/live.json" />

@ -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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -16,7 +17,7 @@
android:focusableInTouchMode="true"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/white"
android:textColor="@color/text"
android:textSize="18sp"
tools:text="泥巴" />
@ -30,7 +31,8 @@
android:focusableInTouchMode="true"
android:padding="8dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_search_on" />
android:src="@drawable/ic_search_on"
app:tint="@color/text" />
<ImageView
android:id="@+id/filter"
@ -42,6 +44,7 @@
android:focusableInTouchMode="true"
android:padding="8dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_filter_on" />
android:src="@drawable/ic_filter_on"
app:tint="@color/text" />
</LinearLayout>

@ -104,10 +104,6 @@ public class Live {
this.activated = item.equals(this);
}
public String getActivatedName() {
return (isActivated() ? "√ " : "").concat(getName());
}
public Live check() {
boolean proxy = getGroup().equals("redirect") && getChannels().size() > 0 && getChannels().get(0).getUrls().size() > 0 && getChannels().get(0).getUrls().get(0).startsWith("proxy") && getChannels().get(0).getUrls().get(0).contains("ext=");
if (proxy) this.url = getChannels().get(0).getUrls().get(0).split("ext=")[1];

@ -150,10 +150,6 @@ public class Site {
this.activated = item.equals(this);
}
public String getActivatedName() {
return (isActivated() ? "√ " : "").concat(getName());
}
public boolean isSearchable() {
return getSearchable() == 1;
}

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/yellow_600" android:state_activated="true" android:state_focused="true" />
<item android:color="@color/yellow_400" android:state_activated="true" />
<item android:color="@color/yellow_500" android:state_activated="true" />
<item android:color="@color/white" />
</selector>
Loading…
Cancel
Save