Skip to content

Commit

Permalink
replacing inefficient vector planet with scaled images, large VP vect…
Browse files Browse the repository at this point in the history
…or with same vector - but smaller viewport. (#667)

Co-authored-by: Andy Carra <rksh@wigle.net>
  • Loading branch information
rksh and Andy Carra authored Jan 5, 2024
1 parent 429cec7 commit e5d3bb8
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.os.Bundle;

Expand Down Expand Up @@ -343,12 +344,11 @@ public void onCreateOptionsMenu (final Menu menu, @NonNull final MenuInflater in
item.setIcon(android.R.drawable.ic_menu_myplaces);

item = menu.add(0, MENU_SITE_STATS, 0, getString(R.string.site_stats_app_name));
item.setIcon( R.drawable.wiglewifi_planet_ico );
item.setIcon(R.drawable.ic_planet_small_white);
MenuItemCompat.setShowAsAction(item, MenuItem.SHOW_AS_ACTION_IF_ROOM);

item = menu.add(0, MENU_SITE_STATS, 0, getString(R.string.site_stats_app_name));
item.setIcon(R.drawable.wiglewifi_planet_ico);

item.setIcon(R.drawable.ic_planet_small_white);
item = menu.add(0, MENU_RANK_SWAP, 0, getRankSwapString());
item.setIcon(android.R.drawable.ic_menu_sort_alphabetically);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ public void onCreateOptionsMenu (final Menu menu, @NonNull final MenuInflater in
item.setIcon(android.R.drawable.ic_menu_myplaces);

item = menu.add(0, MENU_SITE_STATS, 0, getString(R.string.site_stats_app_name));
item.setIcon( R.drawable.wiglewifi_planet_ico );
item.setIcon( R.drawable.ic_planet_small_white );
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);

item = menu.add(0, MENU_SITE_STATS, 0, getString(R.string.site_stats_app_name));
item.setIcon(R.drawable.wiglewifi_planet_ico);
item.setIcon(R.drawable.ic_planet_small_white);

super.onCreateOptionsMenu(menu, inflater);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ public void onConfigurationChanged(@NonNull final Configuration newConfig ) {
@Override
public void onCreateOptionsMenu (final Menu menu, @NonNull final MenuInflater inflater) {
MenuItem item = menu.add(0, MENU_SITE_STATS, 0, getString(R.string.site_stats_app_name));
item.setIcon( R.drawable.wiglewifi_planet_ico );
item.setIcon( R.drawable.ic_planet_small_white );
MenuItemCompat.setShowAsAction(item, MenuItem.SHOW_AS_ACTION_IF_ROOM);

item = menu.add(0, MENU_SITE_STATS, 0, getString(R.string.site_stats_app_name));
item.setIcon(R.drawable.wiglewifi_planet_ico);
item.setIcon(R.drawable.ic_planet_small_white);

item = menu.add(0, MENU_RANK_STATS, 0, getString(R.string.rank_stats_app_name));
item.setIcon(android.R.drawable.ic_menu_sort_by_size);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 23 additions & 23 deletions wiglewifiwardriving/src/main/res/drawable/ic_w_logo_simple.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<vector android:autoMirrored="true" android:height="170dp"
android:viewportHeight="170" android:viewportWidth="210"
android:width="210dp" xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#ffe000"
android:pathData="m178.453,99.493 l-34.332,40.657q-3.489,4.155 -13.119,4.155 -7.676,0 -13.956,-3.561 -1.116,-0.594 -1.535,-1.039l-26.377,-27.896q-0.977,-1.039 -0.977,-2.523 0,-2.968 4.466,-4.452 3.349,-1.187 6.838,-1.187 6.28,0 8.792,2.968l15.072,17.361 26.237,-32.496q3.349,-4.155 13.258,-4.155 5.443,0 10.327,1.781 6.838,2.226 6.838,6.826 0,1.781 -1.535,3.561zM87.6,143.118q-4.047,1.187 -8.792,1.187 -9.63,0 -13.119,-4.155l-34.332,-40.657q-1.535,-1.781 -1.535,-3.561 0,-4.6 6.838,-6.826 4.885,-1.781 10.327,-1.781 9.63,0 13.119,4.155l34.471,40.657q1.396,1.632 1.396,3.561 0,5.045 -8.374,7.419z" android:strokeColor="#00000000"/>
<path android:fillAlpha="1" android:fillColor="#ffe000"
android:pathData="M104.471,7.869A97.131,96.745 89.999,0 0,16.09 65.493l20.735,9.269A74.103,74.103 0,0 1,104.471 30.897,74.103 74.103,135 0,1 172.119,74.761L192.852,65.493A97.131,96.745 89.999,0 0,104.471 7.869Z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="1"/>
<path android:fillAlpha="1" android:fillColor="#ffe000"
android:pathData="M14.899,70.397a11.413,11.01 0,1 0,22.826 0a11.413,11.01 0,1 0,-22.826 0z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.349828"/>
<path android:fillAlpha="1" android:fillColor="#ffe000"
android:pathData="M171.282,70.653a11.413,11.01 0,1 0,22.826 0a11.413,11.01 0,1 0,-22.826 0z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.349828"/>
<path android:fillAlpha="1" android:fillColor="#ffe000"
android:pathData="M104.471,47.161A57.117,57.839 0,0 0,62.024 66.298L76.584,79.574A37.634,37.875 0,0 1,104.471 67.125,37.634 37.875,0 0,1 132.36,79.571L146.917,66.298A57.117,57.839 0,0 0,104.471 47.161Z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.264583"/>
<path android:fillAlpha="1" android:fillColor="#ffe000"
android:pathData="M128.828,72.122a10.054,9.708 0,1 0,20.108 0a10.054,9.708 0,1 0,-20.108 0z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.258767"/>
<path android:fillAlpha="1" android:fillColor="#ffe000"
android:pathData="M60.06,72.02a10.054,9.708 0,1 0,20.108 0a10.054,9.708 0,1 0,-20.108 0z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="0.258767"/>
<vector android:height="20dp" android:viewportHeight="210"
android:viewportWidth="210" android:width="20dp"
xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ffe000"
android:pathData="m178.45,99.49 l-34.33,40.66q-3.49,4.15 -13.12,4.15 -7.68,0 -13.96,-3.56 -1.12,-0.59 -1.54,-1.04l-26.38,-27.9q-0.98,-1.04 -0.98,-2.52 0,-2.97 4.47,-4.45 3.35,-1.19 6.84,-1.19 6.28,0 8.79,2.97l15.07,17.36 26.24,-32.5q3.35,-4.15 13.26,-4.15 5.44,0 10.33,1.78 6.84,2.23 6.84,6.83 0,1.78 -1.54,3.56zM87.6,143.12q-4.05,1.19 -8.79,1.19 -9.63,0 -13.12,-4.15l-34.33,-40.66q-1.54,-1.78 -1.54,-3.56 0,-4.6 6.84,-6.83 4.88,-1.78 10.33,-1.78 9.63,0 13.12,4.15l34.47,40.66q1.4,1.63 1.4,3.56 0,5.05 -8.37,7.42z" android:strokeColor="#00000000"/>
<path android:fillColor="#ffe000"
android:pathData="M104.47,7.87A97.13,96.74 90,0 0,16.09 65.49l20.73,9.27A74.1,74.1 0,0 1,104.47 30.9,74.1 74.1,135 0,1 172.12,74.76L192.85,65.49A97.13,96.74 90,0 0,104.47 7.87Z"
android:strokeColor="#00000000" android:strokeWidth="0.26"/>
<path android:fillColor="#ffe000"
android:pathData="M14.9,70.4a11.41,11.01 0,1 0,22.83 0a11.41,11.01 0,1 0,-22.83 0z"
android:strokeColor="#00000000" android:strokeWidth="0.349828"/>
<path android:fillColor="#ffe000"
android:pathData="M171.28,70.65a11.41,11.01 0,1 0,22.83 0a11.41,11.01 0,1 0,-22.83 0z"
android:strokeColor="#00000000" android:strokeWidth="0.349828"/>
<path android:fillColor="#ffe000"
android:pathData="M104.47,47.16A57.12,57.84 0,0 0,62.02 66.3L76.58,79.57A37.63,37.88 0,0 1,104.47 67.13,37.63 37.88,0 0,1 132.36,79.57L146.92,66.3A57.12,57.84 0,0 0,104.47 47.16Z"
android:strokeColor="#00000000" android:strokeWidth="0.264583"/>
<path android:fillColor="#ffe000"
android:pathData="M128.83,72.12a10.05,9.71 0,1 0,20.11 0a10.05,9.71 0,1 0,-20.11 0z"
android:strokeColor="#00000000" android:strokeWidth="0.258767"/>
<path android:fillColor="#ffe000"
android:pathData="M60.06,72.02a10.05,9.71 0,1 0,20.11 0a10.05,9.71 0,1 0,-20.11 0z"
android:strokeColor="#00000000" android:strokeWidth="0.258767"/>
</vector>
16 changes: 0 additions & 16 deletions wiglewifiwardriving/src/main/res/drawable/wigle_menu_item_exit.xml

This file was deleted.

12 changes: 0 additions & 12 deletions wiglewifiwardriving/src/main/res/drawable/wiglewifi_planet_ico.xml

This file was deleted.

8 changes: 4 additions & 4 deletions wiglewifiwardriving/src/main/res/layout/main.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>

<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down
17 changes: 15 additions & 2 deletions wiglewifiwardriving/src/main/res/menu/leftmenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,76 @@
android:id="@+id/nav_list"
android:icon="@android:drawable/ic_menu_sort_by_size"
android:title="@string/tab_list"
android:contentDescription="@string/tab_list"
/>
<item
android:id="@+id/nav_map"
android:icon="@android:drawable/ic_menu_mapmode"
android:title="@string/tab_map"
android:contentDescription="@string/tab_map"
/>
<item
android:id="@+id/nav_dash"
android:icon="@android:drawable/ic_menu_directions"
android:title="@string/tab_dash"
android:contentDescription="@string/tab_dash"
/>
<item
android:id="@+id/nav_data"
android:icon="@android:drawable/ic_menu_save"
android:title="@string/tab_data"
android:contentDescription="@string/tab_data"
/>
<item
android:id="@+id/nav_search"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/tab_search"
android:contentDescription="@string/tab_search"
/>
<item
android:id="@+id/nav_news"
android:icon="@android:drawable/ic_menu_agenda"
android:title="@string/tab_news"
android:contentDescription="@string/tab_news"
/>
<item
android:id="@+id/nav_stats"
android:icon="@android:drawable/ic_menu_today"
android:title="@string/tab_stats"/>
android:title="@string/tab_stats"
android:contentDescription="@string/tab_stats"/>
<group
android:id="@+id/stats_group">
<item
android:id="@+id/nav_user_stats"
android:icon="@android:drawable/ic_menu_myplaces"
android:title="@string/user_stats_app_name"
android:contentDescription="@string/user_stats_app_name"
/>
<item
android:id="@+id/nav_rank"
android:icon="@android:drawable/ic_menu_sort_alphabetically"
android:title="@string/tab_rank"
android:contentDescription="@string/tab_rank"
/>
<item
android:id="@+id/nav_site_stats"
android:icon="@drawable/wiglewifi_planet_ico"
android:icon="@drawable/ic_planet_small_white"
app:tint="?attr/colorControlNormal"
android:title="@string/site_stats_app_name"
android:contentDescription="@string/site_stats_app_name"
/>
</group>
<item
android:id="@+id/nav_uploads"
android:icon="@android:drawable/ic_menu_upload"
android:title="@string/tab_uploads"
android:contentDescription="@string/tab_uploads"
/>
<item
android:id="@+id/nav_settings"
android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/menu_settings"
android:contentDescription="@string/menu_settings"
/>
</group>
<item
Expand Down

0 comments on commit e5d3bb8

Please sign in to comment.