issue 9: Button color for sorting uses app accent

This commit is contained in:
Daniele Verducci (Slimpenguin) 2022-01-15 08:49:44 +01:00
parent d3a21c93c1
commit 907fcb4cb1
4 changed files with 30 additions and 13 deletions

View File

@ -13,6 +13,7 @@
<entry key="app/src/main/res/drawable/round_button_background.xml" value="0.3614583333333333" /> <entry key="app/src/main/res/drawable/round_button_background.xml" value="0.3614583333333333" />
<entry key="app/src/main/res/layout/activity_geofavorite_detail.xml" value="0.4" /> <entry key="app/src/main/res/layout/activity_geofavorite_detail.xml" value="0.4" />
<entry key="app/src/main/res/layout/activity_list_view.xml" value="0.4" /> <entry key="app/src/main/res/layout/activity_list_view.xml" value="0.4" />
<entry key="app/src/main/res/layout/activity_login.xml" value="0.2630208333333333" />
<entry key="app/src/main/res/layout/activity_main.xml" value="0.5307291666666667" /> <entry key="app/src/main/res/layout/activity_main.xml" value="0.5307291666666667" />
<entry key="app/src/main/res/layout/activity_map_picker.xml" value="0.33016304347826086" /> <entry key="app/src/main/res/layout/activity_map_picker.xml" value="0.33016304347826086" />
<entry key="app/src/main/res/layout/item_geofav.xml" value="0.5307291666666667" /> <entry key="app/src/main/res/layout/item_geofav.xml" value="0.5307291666666667" />

View File

@ -32,6 +32,7 @@ import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.graphics.drawable.DrawableCompat;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
@ -130,10 +131,10 @@ public class SortingOrderDialogFragment extends DialogFragment {
if (view instanceof ImageButton) { if (view instanceof ImageButton) {
Drawable normalDrawable = ((ImageButton) view).getDrawable(); Drawable normalDrawable = ((ImageButton) view).getDrawable();
Drawable wrapDrawable = DrawableCompat.wrap(normalDrawable); Drawable wrapDrawable = DrawableCompat.wrap(normalDrawable);
DrawableCompat.setTint(wrapDrawable, this.getResources().getColor(R.color.defaultTint)); DrawableCompat.setTint(wrapDrawable, ContextCompat.getColor(getContext(), R.color.selector_item_selected));
} }
if (view instanceof TextView) { if (view instanceof TextView) {
((TextView)view).setTextColor(this.getResources().getColor(R.color.defaultTint)); ((TextView)view).setTextColor(ContextCompat.getColor(getContext(), R.color.selector_item_selected));
((TextView)view).setTypeface(Typeface.DEFAULT_BOLD); ((TextView)view).setTypeface(Typeface.DEFAULT_BOLD);
} }
} }

View File

@ -16,8 +16,9 @@
~ along with this program. If not, see <http://www.gnu.org/licenses/>. ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<LinearLayout <LinearLayout
android:id="@+id/root"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minWidth="300dp" android:minWidth="300dp"
@ -29,7 +30,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_margin" android:layout_margin="@dimen/standard_margin"
android:text="@string/sort_by"/> android:text="@string/sort_by"
android:textColor="@color/defaultBrand"/>
<ScrollView <ScrollView
android:id="@+id/scrollableSortings" android:id="@+id/scrollableSortings"
@ -57,7 +59,8 @@
android:paddingEnd="@dimen/standard_half_padding" android:paddingEnd="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:contentDescription="@string/menu_item_sort_by_title_a_z" android:contentDescription="@string/menu_item_sort_by_title_a_z"
android:src="@drawable/ic_alphabetical_asc" /> android:src="@drawable/ic_alphabetical_asc"
app:tint="@color/selector_item_unselected"/>
<TextView <TextView
android:id="@+id/sortByTitleAscendingText" android:id="@+id/sortByTitleAscendingText"
@ -72,7 +75,8 @@
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:singleLine="true" android:singleLine="true"
android:text="@string/menu_item_sort_by_title_a_z" android:text="@string/menu_item_sort_by_title_a_z"
android:textSize="@dimen/two_line_primary_text_size"/> android:textSize="@dimen/two_line_primary_text_size"
android:textColor="@color/selector_item_unselected"/>
</TableRow> </TableRow>
@ -92,7 +96,8 @@
android:paddingEnd="@dimen/standard_half_padding" android:paddingEnd="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:contentDescription="@string/menu_item_sort_by_date_newest_first" android:contentDescription="@string/menu_item_sort_by_date_newest_first"
android:src="@drawable/ic_modification_asc"/> android:src="@drawable/ic_modification_asc"
app:tint="@color/selector_item_unselected"/>
<TextView <TextView
android:id="@+id/sortByCreationDateDescendingText" android:id="@+id/sortByCreationDateDescendingText"
@ -107,7 +112,8 @@
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:singleLine="true" android:singleLine="true"
android:text="@string/menu_item_sort_by_date_newest_first" android:text="@string/menu_item_sort_by_date_newest_first"
android:textSize="@dimen/two_line_primary_text_size" /> android:textSize="@dimen/two_line_primary_text_size"
android:textColor="@color/selector_item_unselected" />
</TableRow> </TableRow>
@ -127,7 +133,8 @@
android:paddingEnd="@dimen/standard_half_padding" android:paddingEnd="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:contentDescription="@string/menu_item_sort_by_category_a_z" android:contentDescription="@string/menu_item_sort_by_category_a_z"
android:src="@drawable/ic_category_asc"/> android:src="@drawable/ic_category_asc"
app:tint="@color/selector_item_unselected"/>
<TextView <TextView
android:id="@+id/sortByCategoryAscendingText" android:id="@+id/sortByCategoryAscendingText"
@ -142,7 +149,8 @@
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:singleLine="true" android:singleLine="true"
android:text="@string/menu_item_sort_by_category_a_z" android:text="@string/menu_item_sort_by_category_a_z"
android:textSize="@dimen/two_line_primary_text_size" /> android:textSize="@dimen/two_line_primary_text_size"
android:textColor="@color/selector_item_unselected" />
</TableRow> </TableRow>
@ -163,7 +171,8 @@
android:paddingEnd="@dimen/standard_half_padding" android:paddingEnd="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:contentDescription="@string/menu_item_sort_by_distance_nearest_first" android:contentDescription="@string/menu_item_sort_by_distance_nearest_first"
android:src="@drawable/ic_distance_asc"/> android:src="@drawable/ic_distance_asc"
app:tint="@color/selector_item_unselected"/>
<TextView <TextView
android:id="@+id/sortByDistanceAscendingText" android:id="@+id/sortByDistanceAscendingText"
@ -178,7 +187,8 @@
android:paddingBottom="@dimen/standard_half_padding" android:paddingBottom="@dimen/standard_half_padding"
android:singleLine="true" android:singleLine="true"
android:text="@string/menu_item_sort_by_distance_nearest_first" android:text="@string/menu_item_sort_by_distance_nearest_first"
android:textSize="@dimen/two_line_primary_text_size" /> android:textSize="@dimen/two_line_primary_text_size"
android:textColor="@color/selector_item_unselected" />
</TableRow> </TableRow>
@ -196,7 +206,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/common_cancel" android:text="@string/common_cancel"
android:layout_marginTop="@dimen/standard_half_margin"/> android:layout_marginTop="@dimen/standard_half_margin"
style="@style/Widget.AppCompat.Button.Colored"/>
</LinearLayout> </LinearLayout>

View File

@ -30,6 +30,10 @@
<color name="text_color">#333333</color> <color name="text_color">#333333</color>
<color name="secondary_text_color">#666666</color> <color name="secondary_text_color">#666666</color>
<!-- Selectors text/tint colors -->
<color name="selector_item_selected">@color/defaultBrand</color>
<color name="selector_item_unselected">#666666</color>
<!-- Generic Colors --> <!-- Generic Colors -->
<color name="white">#fff</color> <color name="white">#fff</color>
<color name="whiteAlpha">#cfff</color> <color name="whiteAlpha">#cfff</color>