Add lists help text

This commit is contained in:
emanuele-f 2021-10-26 12:12:35 +02:00
parent b1a7d25389
commit eba3eaa572
5 changed files with 50 additions and 1 deletions

View File

@ -65,7 +65,7 @@ public class EditListActivity extends BaseActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.copy_share_menu, menu);
inflater.inflate(R.menu.list_edit_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@ -92,6 +92,9 @@ public class EditListActivity extends BaseActivity {
startActivity(Intent.createChooser(intent, getResources().getString(R.string.share)));
return true;
} else if(id == R.id.show_help) {
Utils.showToastLong(this, mListInfo.getHelpString());
return true;
}

View File

@ -72,4 +72,16 @@ public class ListInfo {
assert false;
return 0;
}
public int getHelpString() {
switch(mType) {
case VISUALIZATION_MASK:
return R.string.hidden_connections_help;
case MALWARE_WHITELIST:
return R.string.malware_whitelist_help;
}
assert false;
return 0;
}
}

View File

@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="?attr/colorControlNormal" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,19h-2v-2h2v2zM15.07,11.25l-0.9,0.92C13.45,12.9 13,13.5 13,15h-2v-0.5c0,-1.1 0.45,-2.1 1.17,-2.83l1.24,-1.26c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2L8,9c0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,0.88 -0.36,1.68 -0.93,2.25z"/>
</vector>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/show_help"
android:title="@string/show_help"
android:orderInCategory="10"
android:icon="@drawable/ic_help"
app:showAsAction="ifRoom" />
<item
android:id="@+id/copy_to_clipboard"
android:title="@string/copy_to_clipboard"
android:orderInCategory="20"
android:icon="@drawable/ic_content_copy"
app:showAsAction="never" />
<item
android:id="@+id/share"
android:title="@string/share"
android:orderInCategory="30"
android:icon="@drawable/ic_share"
app:showAsAction="never" />
</menu>

View File

@ -198,5 +198,8 @@
<string name="edit_malware_whitelist">Edit Malware Whitelist</string>
<string name="feature_not_available">This feature is currently unavailable for your device</string>
<string name="billing_connecting">The connection to Google Play is in progress, please retry in a while</string>
<string name="show_help">Show help</string>
<string name="malware_whitelist_help">This user-defined whitelist is used to inhibit malware detection. Connections matching any of these rules will not be marked as malware. You can create rules by long pressing a malicious connection.</string>
<string name="hidden_connections_help">This list contains rules to hide connections from the connections list. This allows you to focus on the relevant connections.</string>
</resources>