Added hint

This commit is contained in:
M66B 2019-04-16 20:03:48 +02:00
parent 9b02e291f3
commit 59cb8290ed
3 changed files with 44 additions and 0 deletions

View File

@ -333,6 +333,21 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
showHints(); showHints();
} }
}); });
final LinearLayout llFairEmail = findViewById(R.id.llFairEmail);
TextView tvFairEmail = findViewById(R.id.tvFairEmail);
tvFairEmail.setMovementMethod(LinkMovementMethod.getInstance());
Button btnFairEmail = findViewById(R.id.btnFairEmail);
boolean hintFairEmail = prefs.getBoolean("hint_fairemail", true);
llFairEmail.setVisibility(hintFairEmail ? View.VISIBLE : View.GONE);
btnFairEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
prefs.edit().putBoolean("hint_fairemail", false).apply();
llFairEmail.setVisibility(View.GONE);
}
});
showHints(); showHints();
// Listen for preference changes // Listen for preference changes

View File

@ -54,6 +54,34 @@
android:textAppearance="@style/TextSmall" /> android:textAppearance="@style/TextSmall" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/llFairEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp"
android:visibility="gone">
<TextView
android:id="@+id/tvFairEmail"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@string/msg_fairemail"
android:textAppearance="@style/TextSmall" />
<Button
android:id="@+id/btnFairEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@android:string/ok"
android:textAppearance="@style/TextSmall" />
</LinearLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh" android:id="@+id/swipeRefresh"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -218,6 +218,7 @@ Your internet traffic is not being sent to a remote VPN server.</string>
<string name="msg_queue">NetGuard is busy</string> <string name="msg_queue">NetGuard is busy</string>
<string name="msg_update">Update available, tap to download</string> <string name="msg_update">Update available, tap to download</string>
<string name="msg_usage">You can allow (greenish) or deny (reddish) Wi-Fi or mobile internet access by tapping on the icons next to an app</string> <string name="msg_usage">You can allow (greenish) or deny (reddish) Wi-Fi or mobile internet access by tapping on the icons next to an app</string>
<string name="msg_fairemail">If you installed NetGuard to protect your privacy, you might be interested in <a href="https://email.faircode.eu/">FairEmail</a>, an open source, privacy friendly email app, too</string>
<string name="msg_whitelist">Internet access is allowed by default (blacklist mode), this can be changed in the settings</string> <string name="msg_whitelist">Internet access is allowed by default (blacklist mode), this can be changed in the settings</string>
<string name="msg_push">Incoming (push) messages are mostly handled by the system component Play services, which is allowed internet access by default</string> <string name="msg_push">Incoming (push) messages are mostly handled by the system component Play services, which is allowed internet access by default</string>
<string name="msg_system">Managing all (system) apps can be enabled in the settings</string> <string name="msg_system">Managing all (system) apps can be enabled in the settings</string>