Sign in with Google (2)

This commit is contained in:
M66B
2022-07-12 14:46:03 +02:00
parent 320ab884bf
commit 4d1fd57546
4 changed files with 31 additions and 18 deletions

View File

@@ -29,7 +29,9 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
@@ -191,6 +193,21 @@ public class FragmentOAuth extends FragmentBase {
}
});
if ("gmail".equals(id)) {
final Context context = getContext();
int dp6 = Helper.dp2pixels(context, 6);
int dp12 = Helper.dp2pixels(context, 12);
int dp24 = Helper.dp2pixels(context, 24);
Drawable g = context.getDrawable(R.drawable.btn_google_light_normal);
g.setBounds(0, 0, dp24, dp24);
btnOAuth.setCompoundDrawablesRelative(g, null, null, null);
btnOAuth.setText(R.string.title_setup_google_sign_in);
btnOAuth.setCompoundDrawablePadding(dp6);
btnOAuth.setPaddingRelative(dp12, 0, dp12, 0);
btnOAuth.setTextColor(Color.DKGRAY);
btnOAuth.setBackground(context.getDrawable(R.drawable.btn_google_background));
}
btnOAuth.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {