Comment #467 #464 - apply theme on buttons

This commit is contained in:
Thomas 2022-11-18 16:05:31 +01:00
parent b09e21a589
commit 58c3a5fc35
4 changed files with 9 additions and 3 deletions

View File

@ -159,6 +159,7 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
KeywordAdapter keywordAdapter = new KeywordAdapter(filterParams.keywords);
popupAddFilterBinding.lvKeywords.setAdapter(keywordAdapter);
popupAddFilterBinding.lvKeywords.setNestedScrollingEnabled(false);
popupAddFilterBinding.lvKeywords.setLayoutManager(new LinearLayoutManager(context));
popupAddFilterBinding.addKeyword.setOnClickListener(v -> {

View File

@ -29,6 +29,7 @@ import java.util.List;
import app.fedilab.android.R;
import app.fedilab.android.client.entities.api.Filter;
import app.fedilab.android.databinding.DrawerKeywordBinding;
import app.fedilab.android.helper.ThemeHelper;
public class KeywordAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final List<Filter.KeywordsParams> keywordsParamsList;
@ -86,6 +87,7 @@ public class KeywordAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
} else {
holder.binding.mainContainer.setVisibility(View.VISIBLE);
}
holder.binding.deleteKeyword.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context));
holder.binding.wholeWord.setOnCheckedChangeListener((compoundButton, checked) -> keywordsParams.whole_word = checked);
holder.binding.wholeWord.setChecked(keywordsParams.whole_word != null && keywordsParams.whole_word);
holder.binding.deleteKeyword.setOnClickListener(v -> {

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -17,7 +18,8 @@
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/whole_word"
android:layout_width="48dp"
android:layout_height="48dp" />
android:layout_height="48dp"
app:buttonTint="@color/cyanea_accent_dark_reference" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/delete_keyword"

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -220,6 +220,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/lv_keywords"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
@ -238,4 +239,4 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</ScrollView>
</androidx.core.widget.NestedScrollView>