Added provider icons

pull/194/merge
M66B 3 years ago
parent c272ae259f
commit f93f81c36a

@ -27,6 +27,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
@ -228,22 +229,27 @@ public class FragmentSetup extends FragmentBase {
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, getViewLifecycleOwner(), btnQuick);
Menu menu = popupMenu.getMenu();
Resources res = context.getResources();
String pkg = context.getPackageName();
int order = 1;
String gmail = getString(R.string.title_setup_oauth, getString(R.string.title_setup_gmail));
menu.add(Menu.FIRST, R.string.title_setup_gmail, order++, gmail);
MenuItem item = menu.add(Menu.FIRST, R.string.title_setup_gmail, order++, gmail);
int resid = res.getIdentifier("provider_gmail", "drawable", pkg);
if (resid != 0)
item.setIcon(resid);
for (EmailProvider provider : EmailProvider.loadProfiles(context))
if (provider.oauth != null &&
(provider.oauth.enabled || BuildConfig.DEBUG)) {
MenuItem item = menu
item = menu
.add(Menu.FIRST, -1, order++, getString(R.string.title_setup_oauth, provider.description))
.setIntent(new Intent(ActivitySetup.ACTION_QUICK_OAUTH)
.putExtra("id", provider.id)
.putExtra("name", provider.description)
.putExtra("privacy", provider.oauth.privacy)
.putExtra("askAccount", provider.oauth.askAccount));
int resid = context.getResources()
.getIdentifier("provider_" + provider.id, "drawable", context.getPackageName());
resid = res.getIdentifier("provider_" + provider.id, "drawable", pkg);
if (resid != 0)
item.setIcon(resid);
}

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M23.745,12.27C23.745,11.48 23.675,10.73 23.555,10L12.255,10L12.255,14.51L18.725,14.51C18.435,15.99 17.585,17.24 16.325,18.09L16.325,21.09L20.185,21.09C22.445,19 23.745,15.92 23.745,12.27Z"
android:fillColor="#4285F4"/>
<path
android:pathData="M12.255,24C15.495,24 18.205,22.92 20.185,21.09L16.325,18.09C15.245,18.81 13.875,19.25 12.255,19.25C9.125,19.25 6.475,17.14 5.525,14.29L1.545,14.29L1.545,17.38C3.515,21.3 7.565,24 12.255,24Z"
android:fillColor="#34A853"/>
<path
android:pathData="M5.525,14.29C5.275,13.57 5.145,12.8 5.145,12C5.145,11.2 5.285,10.43 5.525,9.71L5.525,6.62L1.545,6.62C0.725,8.24 0.255,10.06 0.255,12C0.255,13.94 0.725,15.76 1.545,17.38L5.525,14.29Z"
android:fillColor="#FBBC05"/>
<path
android:pathData="M12.255,4.75C14.025,4.75 15.605,5.36 16.855,6.55L20.275,3.13C18.205,1.19 15.495,0 12.255,0C7.565,0 3.515,2.7 1.545,6.62L5.525,9.71C6.475,6.86 9.125,4.75 12.255,4.75Z"
android:fillColor="#EA4335"/>
</vector>

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="103.17322dp"
android:height="104.31332dp"
android:viewportWidth="103.17322"
android:viewportHeight="104.31332">
<path
android:pathData="m64.567,22.116v20.404l7.131,4.49c0.188,0.055 0.596,0.059 0.784,0L103.169,26.32c0,-2.449 -2.284,-4.204 -3.573,-4.204H64.567z"
android:fillColor="#0072c6"/>
<path
android:pathData="m64.567,50.133 l6.508,4.47c0.917,0.674 2.022,0 2.022,0 -1.101,0.674 30.077,-20.036 30.077,-20.036v37.502c0,4.082 -2.613,5.795 -5.552,5.795H64.563V50.133z"
android:fillColor="#0072c6"/>
<path
android:pathData="m30.873,40.726c-2.218,0 -3.984,1.042 -5.289,3.123 -1.305,2.08 -1.959,4.835 -1.959,8.263 0,3.479 0.654,6.229 1.959,8.251 1.305,2.026 3.017,3.032 5.132,3.032 2.182,0 3.914,-0.983 5.191,-2.95 1.277,-1.967 1.92,-4.698 1.92,-8.188 0,-3.64 -0.619,-6.472 -1.861,-8.498 -1.242,-2.022 -2.938,-3.032 -5.093,-3.032z"
android:fillColor="#0072c6"/>
<path
android:pathData="m-0,11.754l0,79.827l60.727,12.733L60.727,0l-60.727,11.754zM40.636,65.162c-2.566,3.377 -5.912,5.07 -10.042,5.07 -4.024,0 -7.299,-1.638 -9.834,-4.909C18.23,62.047 16.96,57.785 16.96,52.527c0,-5.552 1.285,-10.042 3.859,-13.47 2.574,-3.428 5.983,-5.144 10.226,-5.144 4.008,0 7.252,1.638 9.724,4.921 2.476,3.283 3.714,7.609 3.714,12.98 0.004,5.52 -1.281,9.971 -3.847,13.348z"
android:fillColor="#0072c6"/>
</vector>

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="103.17322dp"
android:height="104.31332dp"
android:viewportWidth="103.17322"
android:viewportHeight="104.31332">
<path
android:pathData="m64.567,22.116v20.404l7.131,4.49c0.188,0.055 0.596,0.059 0.784,0L103.169,26.32c0,-2.449 -2.284,-4.204 -3.573,-4.204H64.567z"
android:fillColor="#0072c6"/>
<path
android:pathData="m64.567,50.133 l6.508,4.47c0.917,0.674 2.022,0 2.022,0 -1.101,0.674 30.077,-20.036 30.077,-20.036v37.502c0,4.082 -2.613,5.795 -5.552,5.795H64.563V50.133z"
android:fillColor="#0072c6"/>
<path
android:pathData="m30.873,40.726c-2.218,0 -3.984,1.042 -5.289,3.123 -1.305,2.08 -1.959,4.835 -1.959,8.263 0,3.479 0.654,6.229 1.959,8.251 1.305,2.026 3.017,3.032 5.132,3.032 2.182,0 3.914,-0.983 5.191,-2.95 1.277,-1.967 1.92,-4.698 1.92,-8.188 0,-3.64 -0.619,-6.472 -1.861,-8.498 -1.242,-2.022 -2.938,-3.032 -5.093,-3.032z"
android:fillColor="#0072c6"/>
<path
android:pathData="m-0,11.754l0,79.827l60.727,12.733L60.727,0l-60.727,11.754zM40.636,65.162c-2.566,3.377 -5.912,5.07 -10.042,5.07 -4.024,0 -7.299,-1.638 -9.834,-4.909C18.23,62.047 16.96,57.785 16.96,52.527c0,-5.552 1.285,-10.042 3.859,-13.47 2.574,-3.428 5.983,-5.144 10.226,-5.144 4.008,0 7.252,1.638 9.724,4.921 2.476,3.283 3.714,7.609 3.714,12.98 0.004,5.52 -1.281,9.971 -3.847,13.348z"
android:fillColor="#0072c6"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="300dp"
android:height="300dp"
android:viewportWidth="300"
android:viewportHeight="300">
<path
android:pathData="m290.575,94.837c-5.201,0.514 -26.852,5.364 -34.129,6.924 -7.792,2.074 -78.984,57.075 -83.661,70.581 -1.037,4.674 -1.556,11.866 -1.556,18.624l-0.522,10.916c0,7.788 2.164,20.349 3.2,27.102 4.681,1.043 38.555,0.132 44.788,1.168l-0.767,13.97c-6.091,-0.444 -49.106,-0.34 -73.68,-0.34 -12.475,0 -52.576,1.375 -64.897,1.004l2.329,-13.285c6.756,-0.524 34.729,1.207 40.879,-5.284 3.055,-3.221 2.081,-6.672 2.081,-25.376v-8.832c0,-4.158 0,-11.956 -1.043,-19.233 -2.597,-7.796 -65.301,-86.09 -81.409,-98.558 -4.681,-1.557 -33.99,-4.489 -41.264,-6.051l-0.362,-11.968c3.629,-1.819 36.221,0.442 67.849,-0.728 20.787,-0.768 68.215,0 74.067,0.697l-1.499,10.547c-6.234,1.561 -36.266,2.138 -44.062,4.215 20.268,30.139 52.312,68.94 62.707,84.011 5.719,-8.313 55.954,-42.874 57.512,-54.825 -7.797,-1.565 -33.607,-5.279 -37.766,-5.279l-2.469,-13.607c7.075,-1.107 44.278,0 62.774,0 15.962,0 50.07,0 59.762,0.794l-8.863,12.813"
android:fillColor="#592c71"/>
</vector>
Loading…
Cancel
Save