add missing icons in bright theme

* missing white icons
* update attrs.xml and styles.xml
This commit is contained in:
kapodamy 2018-12-14 14:51:55 -03:00
parent 6185c4ddcf
commit 8d1d4092aa
36 changed files with 35 additions and 17 deletions

View File

@ -7,9 +7,12 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.ServiceConnection; import android.content.ServiceConnection;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.AttrRes;
import android.support.annotation.DrawableRes;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
@ -89,7 +92,7 @@ public class MissionsFragment extends Fragment {
mEmpty = v.findViewById(R.id.list_empty_view); mEmpty = v.findViewById(R.id.list_empty_view);
mList = v.findViewById(R.id.mission_recycler); mList = v.findViewById(R.id.mission_recycler);
// Init // Init layouts managers
mGridManager = new GridLayoutManager(getActivity(), SPAN_SIZE); mGridManager = new GridLayoutManager(getActivity(), SPAN_SIZE);
mGridManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { mGridManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override @Override
@ -103,7 +106,6 @@ public class MissionsFragment extends Fragment {
} }
} }
}); });
mLinearManager = new LinearLayoutManager(getActivity()); mLinearManager = new LinearLayoutManager(getActivity());
setHasOptionsMenu(true); setHasOptionsMenu(true);
@ -120,7 +122,7 @@ public class MissionsFragment extends Fragment {
// Bug: in api< 23 this is never called // Bug: in api< 23 this is never called
// so mActivity=null // so mActivity=null
// so app crashes with nullpointer exception // so app crashes with null-pointer exception
mActivity = activity; mActivity = activity;
} }
@ -189,12 +191,21 @@ public class MissionsFragment extends Fragment {
mList.setAdapter(mAdapter); mList.setAdapter(mAdapter);
if (mSwitch != null) { if (mSwitch != null) {
mSwitch.setIcon(mLinear ? R.drawable.grid : R.drawable.list); mSwitch.setIcon(getDrawableFromAttribute(mLinear ? R.attr.ic_grid : R.attr.ic_list));
mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mSwitch.setTitle(mLinear ? R.string.grid : R.string.list);
mPrefs.edit().putBoolean("linear", mLinear).apply(); mPrefs.edit().putBoolean("linear", mLinear).apply();
} }
} }
@DrawableRes
private int getDrawableFromAttribute(@AttrRes int ic) {
TypedArray styledAttributes = mActivity.obtainStyledAttributes(new int[]{ic});
int resId = styledAttributes.getResourceId(0, -1);
styledAttributes.recycle();
return resId;
}
@Override @Override
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

View File

@ -239,7 +239,7 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@drawable/list" android:src="@drawable/ic_list_white_24dp"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
tools:ignore="ContentDescription,RtlHardcoded"/> tools:ignore="ContentDescription,RtlHardcoded"/>

View File

@ -237,7 +237,7 @@
android:focusable="true" android:focusable="true"
android:padding="5dp" android:padding="5dp"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@drawable/list" android:src="@drawable/ic_list_white_24dp"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
tools:ignore="ContentDescription,RtlHardcoded"/> tools:ignore="ContentDescription,RtlHardcoded"/>

View File

@ -3,17 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/switch_mode" <item android:id="@+id/switch_mode"
android:icon="@drawable/list" android:icon="?attr/ic_grid"
android:title="@string/grid" android:title="@string/grid"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item android:id="@+id/action_settings"
app:showAsAction="never"
android:title="@string/settings"/>
<item android:id="@+id/clear_list" <item android:id="@+id/clear_list"
android:visible="false" android:icon="?attr/ic_delete"
android:icon="@drawable/ic_delete_sweep_white_24dp" android:title="@string/clear_finished_download"
app:showAsAction="ifRoom" app:showAsAction="ifRoom" />
android:title="@string/clear_finished_download"/>
<item android:id="@+id/action_settings"
android:title="@string/settings"
app:showAsAction="never" />
</menu> </menu>

View File

@ -38,6 +38,9 @@
<attr name="ic_add" format="reference"/> <attr name="ic_add" format="reference"/>
<attr name="ic_restore_defaults" format="reference"/> <attr name="ic_restore_defaults" format="reference"/>
<attr name="ic_blank_page" format="reference"/> <attr name="ic_blank_page" format="reference"/>
<attr name="ic_list" format="reference"/>
<attr name="ic_grid" format="reference"/>
<attr name="ic_delete" format="reference"/>
<!-- Can't refer to colors directly in drawable's xml--> <!-- Can't refer to colors directly in drawable's xml-->
<attr name="toolbar_shadow_drawable" format="reference"/> <attr name="toolbar_shadow_drawable" format="reference"/>

View File

@ -22,7 +22,6 @@
<item name="info">@drawable/ic_info_outline_black_24dp</item> <item name="info">@drawable/ic_info_outline_black_24dp</item>
<item name="bug">@drawable/ic_bug_report_black_24dp</item> <item name="bug">@drawable/ic_bug_report_black_24dp</item>
<item name="audio">@drawable/ic_headset_black_24dp</item> <item name="audio">@drawable/ic_headset_black_24dp</item>
<item name="clear_history">@drawable/ic_delete_sweep_white_24dp</item>
<item name="download">@drawable/ic_file_download_black_24dp</item> <item name="download">@drawable/ic_file_download_black_24dp</item>
<item name="share">@drawable/ic_share_black_24dp</item> <item name="share">@drawable/ic_share_black_24dp</item>
<item name="cast">@drawable/ic_cast_black_24dp</item> <item name="cast">@drawable/ic_cast_black_24dp</item>
@ -54,6 +53,9 @@
<item name="ic_add">@drawable/ic_add_black_24dp</item> <item name="ic_add">@drawable/ic_add_black_24dp</item>
<item name="ic_restore_defaults">@drawable/ic_settings_backup_restore_black_24dp</item> <item name="ic_restore_defaults">@drawable/ic_settings_backup_restore_black_24dp</item>
<item name="ic_blank_page">@drawable/ic_blank_page_black_24dp</item> <item name="ic_blank_page">@drawable/ic_blank_page_black_24dp</item>
<item name="ic_list">@drawable/ic_list_black_24dp</item>
<item name="ic_grid">@drawable/ic_grid_black_24dp</item>
<item name="ic_delete">@drawable/ic_delete_black_24dp</item>
<item name="separator_color">@color/light_separator_color</item> <item name="separator_color">@color/light_separator_color</item>
<item name="contrast_background_color">@color/light_contrast_background_color</item> <item name="contrast_background_color">@color/light_contrast_background_color</item>
@ -82,7 +84,6 @@
<item name="audio">@drawable/ic_headset_white_24dp</item> <item name="audio">@drawable/ic_headset_white_24dp</item>
<item name="info">@drawable/ic_info_outline_white_24dp</item> <item name="info">@drawable/ic_info_outline_white_24dp</item>
<item name="bug">@drawable/ic_bug_report_white_24dp</item> <item name="bug">@drawable/ic_bug_report_white_24dp</item>
<item name="clear_history">@drawable/ic_delete_sweep_black_24dp</item>
<item name="download">@drawable/ic_file_download_white_24dp</item> <item name="download">@drawable/ic_file_download_white_24dp</item>
<item name="share">@drawable/ic_share_white_24dp</item> <item name="share">@drawable/ic_share_white_24dp</item>
<item name="cast">@drawable/ic_cast_white_24dp</item> <item name="cast">@drawable/ic_cast_white_24dp</item>
@ -114,6 +115,9 @@
<item name="ic_add">@drawable/ic_add_white_24dp</item> <item name="ic_add">@drawable/ic_add_white_24dp</item>
<item name="ic_restore_defaults">@drawable/ic_settings_backup_restore_white_24dp</item> <item name="ic_restore_defaults">@drawable/ic_settings_backup_restore_white_24dp</item>
<item name="ic_blank_page">@drawable/ic_blank_page_white_24dp</item> <item name="ic_blank_page">@drawable/ic_blank_page_white_24dp</item>
<item name="ic_list">@drawable/ic_list_white_24dp</item>
<item name="ic_grid">@drawable/ic_grid_white_24dp</item>
<item name="ic_delete">@drawable/ic_delete_white_24dp</item>
<item name="separator_color">@color/dark_separator_color</item> <item name="separator_color">@color/dark_separator_color</item>
<item name="contrast_background_color">@color/dark_contrast_background_color</item> <item name="contrast_background_color">@color/dark_contrast_background_color</item>