add ability to display privacy policy link in menu
This commit is contained in:
parent
617dd76d2f
commit
59c23f5558
|
@ -97,7 +97,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 34
|
targetSdkVersion 34
|
||||||
versionCode 42090
|
versionCode 42091
|
||||||
versionName "2.13.2"
|
versionName "2.13.2"
|
||||||
archivesBaseName += "-$versionName"
|
archivesBaseName += "-$versionName"
|
||||||
applicationId "eu.siacs.conversations"
|
applicationId "eu.siacs.conversations"
|
||||||
|
@ -105,6 +105,7 @@ android {
|
||||||
def appName = "Conversations"
|
def appName = "Conversations"
|
||||||
resValue "string", "app_name", appName
|
resValue "string", "app_name", appName
|
||||||
buildConfigField "String", "APP_NAME", "\"$appName\""
|
buildConfigField "String", "APP_NAME", "\"$appName\""
|
||||||
|
buildConfigField "String", "PRIVACY_POLICY", "null"
|
||||||
}
|
}
|
||||||
|
|
||||||
splits {
|
splits {
|
||||||
|
@ -144,6 +145,7 @@ android {
|
||||||
def appName = "Quicksy"
|
def appName = "Quicksy"
|
||||||
resValue "string", "app_name", appName
|
resValue "string", "app_name", appName
|
||||||
buildConfigField "String", "APP_NAME", "\"$appName\""
|
buildConfigField "String", "APP_NAME", "\"$appName\""
|
||||||
|
buildConfigField "String", "PRIVACY_POLICY", "\"https://quicksy.im/privacy.htm\""
|
||||||
}
|
}
|
||||||
|
|
||||||
conversations {
|
conversations {
|
||||||
|
|
|
@ -57,12 +57,14 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
import eu.siacs.conversations.BuildConfig;
|
||||||
import eu.siacs.conversations.Config;
|
import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
import eu.siacs.conversations.databinding.FragmentConversationsOverviewBinding;
|
import eu.siacs.conversations.databinding.FragmentConversationsOverviewBinding;
|
||||||
import eu.siacs.conversations.entities.Account;
|
import eu.siacs.conversations.entities.Account;
|
||||||
import eu.siacs.conversations.entities.Conversation;
|
import eu.siacs.conversations.entities.Conversation;
|
||||||
import eu.siacs.conversations.entities.Conversational;
|
import eu.siacs.conversations.entities.Conversational;
|
||||||
|
import eu.siacs.conversations.services.QuickConversationsService;
|
||||||
import eu.siacs.conversations.ui.adapter.ConversationAdapter;
|
import eu.siacs.conversations.ui.adapter.ConversationAdapter;
|
||||||
import eu.siacs.conversations.ui.interfaces.OnConversationArchived;
|
import eu.siacs.conversations.ui.interfaces.OnConversationArchived;
|
||||||
import eu.siacs.conversations.ui.interfaces.OnConversationSelected;
|
import eu.siacs.conversations.ui.interfaces.OnConversationSelected;
|
||||||
|
@ -304,13 +306,19 @@ public class ConversationsOverviewFragment extends XmppFragment {
|
||||||
return binding.getRoot();
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
|
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
|
||||||
menuInflater.inflate(R.menu.fragment_conversations_overview, menu);
|
menuInflater.inflate(R.menu.fragment_conversations_overview, menu);
|
||||||
AccountUtils.showHideMenuItems(menu);
|
AccountUtils.showHideMenuItems(menu);
|
||||||
final MenuItem easyOnboardInvite = menu.findItem(R.id.action_easy_invite);
|
final MenuItem easyOnboardInvite = menu.findItem(R.id.action_easy_invite);
|
||||||
easyOnboardInvite.setVisible(EasyOnboardingInvite.anyHasSupport(activity == null ? null : activity.xmppConnectionService));
|
easyOnboardInvite.setVisible(
|
||||||
}
|
EasyOnboardingInvite.anyHasSupport(
|
||||||
|
activity == null ? null : activity.xmppConnectionService));
|
||||||
|
final MenuItem privacyPolicyMenuItem = menu.findItem(R.id.action_privacy_policy);
|
||||||
|
privacyPolicyMenuItem.setVisible(
|
||||||
|
BuildConfig.PRIVACY_POLICY != null
|
||||||
|
&& QuickConversationsService.isPlayStoreFlavor());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackendConnected() {
|
public void onBackendConnected() {
|
||||||
|
|
|
@ -62,6 +62,7 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
import eu.siacs.conversations.BuildConfig;
|
||||||
import eu.siacs.conversations.Config;
|
import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
import eu.siacs.conversations.databinding.ActivityStartConversationBinding;
|
import eu.siacs.conversations.databinding.ActivityStartConversationBinding;
|
||||||
|
@ -658,11 +659,15 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(final Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.start_conversation, menu);
|
getMenuInflater().inflate(R.menu.start_conversation, menu);
|
||||||
AccountUtils.showHideMenuItems(menu);
|
AccountUtils.showHideMenuItems(menu);
|
||||||
MenuItem menuHideOffline = menu.findItem(R.id.action_hide_offline);
|
final MenuItem menuHideOffline = menu.findItem(R.id.action_hide_offline);
|
||||||
MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code);
|
final MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code);
|
||||||
|
final MenuItem privacyPolicyMenuItem = menu.findItem(R.id.action_privacy_policy);
|
||||||
|
privacyPolicyMenuItem.setVisible(
|
||||||
|
BuildConfig.PRIVACY_POLICY != null
|
||||||
|
&& QuickConversationsService.isPlayStoreFlavor());
|
||||||
qrCodeScanMenuItem.setVisible(isCameraFeatureAvailable());
|
qrCodeScanMenuItem.setVisible(isCameraFeatureAvailable());
|
||||||
if (QuickConversationsService.isQuicksy()) {
|
if (QuickConversationsService.isQuicksy()) {
|
||||||
menuHideOffline.setVisible(false);
|
menuHideOffline.setVisible(false);
|
||||||
|
|
|
@ -56,6 +56,7 @@ import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
|
import eu.siacs.conversations.BuildConfig;
|
||||||
import eu.siacs.conversations.Config;
|
import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
import eu.siacs.conversations.crypto.PgpEngine;
|
import eu.siacs.conversations.crypto.PgpEngine;
|
||||||
|
@ -422,6 +423,9 @@ public abstract class XmppActivity extends ActionBarActivity {
|
||||||
case R.id.action_settings:
|
case R.id.action_settings:
|
||||||
startActivity(new Intent(this, SettingsActivity.class));
|
startActivity(new Intent(this, SettingsActivity.class));
|
||||||
break;
|
break;
|
||||||
|
case R.id.action_privacy_policy:
|
||||||
|
openPrivacyPolicy();
|
||||||
|
break;
|
||||||
case R.id.action_accounts:
|
case R.id.action_accounts:
|
||||||
AccountUtils.launchManageAccounts(this);
|
AccountUtils.launchManageAccounts(this);
|
||||||
break;
|
break;
|
||||||
|
@ -438,6 +442,20 @@ public abstract class XmppActivity extends ActionBarActivity {
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void openPrivacyPolicy() {
|
||||||
|
if (BuildConfig.PRIVACY_POLICY == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final var viewPolicyIntent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
viewPolicyIntent.setData(Uri.parse(BuildConfig.PRIVACY_POLICY));
|
||||||
|
try {
|
||||||
|
startActivity(viewPolicyIntent);
|
||||||
|
} catch (final ActivityNotFoundException e) {
|
||||||
|
Toast.makeText(this, R.string.no_application_found_to_open_link, Toast.LENGTH_SHORT)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void selectPresence(final Conversation conversation, final PresenceSelector.OnPresenceSelected listener) {
|
public void selectPresence(final Conversation conversation, final PresenceSelector.OnPresenceSelected listener) {
|
||||||
final Contact contact = conversation.getContact();
|
final Contact contact = conversation.getContact();
|
||||||
if (contact.showInRoster() || contact.isSelf()) {
|
if (contact.showInRoster() || contact.isSelf()) {
|
||||||
|
|
|
@ -75,9 +75,7 @@ public class FixedURLSpan extends URLSpan {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
|
||||||
}
|
|
||||||
//intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
|
//intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
|
||||||
try {
|
try {
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
|
|
|
@ -49,6 +49,11 @@
|
||||||
android:orderInCategory="90"
|
android:orderInCategory="90"
|
||||||
android:title="@string/action_account"
|
android:title="@string/action_account"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
<item android:id="@+id/action_privacy_policy"
|
||||||
|
android:visible="false"
|
||||||
|
android:orderInCategory="98"
|
||||||
|
android:title="@string/privacy_policy"
|
||||||
|
app:showAsAction="never"/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_settings"
|
android:id="@+id/action_settings"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_search"
|
android:id="@+id/action_search"
|
||||||
android:icon="?attr/icon_search"
|
android:icon="?attr/icon_search"
|
||||||
android:title="@string/search"
|
android:title="@string/search"
|
||||||
app:actionLayout="@layout/actionview_search"
|
app:actionLayout="@layout/actionview_search"
|
||||||
app:showAsAction="collapseActionView|always"/>
|
app:showAsAction="collapseActionView|always" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_scan_qr_code"
|
android:id="@+id/action_scan_qr_code"
|
||||||
android:title="@string/scan_qr_code"
|
|
||||||
android:icon="?attr/icon_scan_qr_code"
|
android:icon="?attr/icon_scan_qr_code"
|
||||||
app:showAsAction="always"/>
|
android:title="@string/scan_qr_code"
|
||||||
|
app:showAsAction="always" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_hide_offline"
|
android:id="@+id/action_hide_offline"
|
||||||
|
@ -20,21 +20,27 @@
|
||||||
android:checked="false"
|
android:checked="false"
|
||||||
android:orderInCategory="85"
|
android:orderInCategory="85"
|
||||||
android:title="@string/hide_offline"
|
android:title="@string/hide_offline"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_accounts"
|
android:id="@+id/action_accounts"
|
||||||
android:orderInCategory="90"
|
android:orderInCategory="90"
|
||||||
android:title="@string/action_accounts"
|
android:title="@string/action_accounts"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_account"
|
android:id="@+id/action_account"
|
||||||
android:orderInCategory="90"
|
android:orderInCategory="90"
|
||||||
android:title="@string/action_account"
|
android:title="@string/action_account"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_privacy_policy"
|
||||||
|
android:orderInCategory="98"
|
||||||
|
android:title="@string/privacy_policy"
|
||||||
|
android:visible="false"
|
||||||
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_settings"
|
android:id="@+id/action_settings"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
android:title="@string/action_settings"
|
android:title="@string/action_settings"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
|
@ -1023,4 +1023,5 @@
|
||||||
<string name="unverified_devices">You are using unverified devices. Scan the QR Code on your other devices to perform verification and impede active MITM attacks.</string>
|
<string name="unverified_devices">You are using unverified devices. Scan the QR Code on your other devices to perform verification and impede active MITM attacks.</string>
|
||||||
<string name="report_spam">Report spam</string>
|
<string name="report_spam">Report spam</string>
|
||||||
<string name="report_spam_and_block">Report spam and block spammer</string>
|
<string name="report_spam_and_block">Report spam and block spammer</string>
|
||||||
|
<string name="privacy_policy">Privacy policy</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue