1515import android .content .res .Configuration ;
1616import android .net .ConnectivityManager ;
1717import android .net .NetworkInfo ;
18+ import android .net .Uri ;
1819import android .os .Bundle ;
1920import android .util .Log ;
2021
@@ -102,7 +103,7 @@ public class AccountPreference extends PreferenceFragmentCompat {
102103 ServiceToggle .setChecked (false );
103104 }
104105 } else {
105- ServiceToggle .setEnabled (!prefs .getString ("UID" , "" ).equals ( "" ));
106+ ServiceToggle .setEnabled (!prefs .getString ("UID" , "" ).isEmpty ( ));
106107 }
107108 }
108109 };
@@ -129,7 +130,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
129130 AlreadySubscribed .setVisible (true );
130131
131132 String UID = prefs .getString ("UID" , "" );
132- if (!UID .equals ( "" )) {
133+ if (!UID .isEmpty ( )) {
133134 new Thread (() -> {
134135 try {
135136 Pushy .subscribe (UID , mContext );
@@ -174,11 +175,11 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
174175 AlreadySubscribed = findPreference ("AlreadySubscribed" );
175176 ServerInfo = findPreference ("ServerInfo" );
176177
177- boolean ifUIDBlank = prefs .getString ("UID" , "" ).equals ( "" );
178+ boolean ifUIDBlank = prefs .getString ("UID" , "" ).isEmpty ( );
178179 if (!ifUIDBlank ) {
179180 Login .setSummary ("Logined as " + prefs .getString ("Email" , "" ));
180181 Login .setTitle (R .string .Logout );
181- if (prefs .getString ("Email" , "" ).equals ( "" ) && mAuth .getCurrentUser () != null )
182+ if (prefs .getString ("Email" , "" ).isEmpty ( ) && mAuth .getCurrentUser () != null )
182183 prefs .edit ().putString ("Email" , mAuth .getCurrentUser ().getEmail ()).apply ();
183184 if (prefs .getString ("server" , "Firebase Cloud Message" ).equals ("Pushy" )) {
184185 if (mBillingHelper .isSubscribed ()) {
@@ -315,12 +316,16 @@ public boolean onPreferenceTreeClick(Preference preference) {
315316 case "serverSelect" :
316317 mContext .startActivity (new Intent (mContext , NetSelectActivity .class ));
317318 break ;
319+
320+ case "GithubSponsors" :
321+ startActivity (new Intent (Intent .ACTION_VIEW , Uri .parse ("https://github.com/sponsors/choiman1559" )));
322+ break ;
318323 }
319324 return super .onPreferenceTreeClick (preference );
320325 }
321326
322327 private void accountTask () {
323- if (prefs .getString ("UID" , "" ).equals ( "" )) {
328+ if (prefs .getString ("UID" , "" ).isEmpty ( )) {
324329 ConnectivityManager cm = (ConnectivityManager ) mContext .getSystemService (Context .CONNECTIVITY_SERVICE );
325330 NetworkInfo activeNetwork = cm .getActiveNetworkInfo ();
326331
0 commit comments