mirror of https://github.com/tasks/tasks
New 'Add account' dialog
parent
55e60de0a6
commit
502b81555e
@ -0,0 +1,82 @@
|
||||
package org.tasks.sync;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.res.TypedArray;
|
||||
import android.net.Uri;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.todoroo.astrid.gtasks.auth.GtasksLoginActivity;
|
||||
import org.tasks.R;
|
||||
import org.tasks.caldav.CaldavAccountSettingsActivity;
|
||||
import org.tasks.dialogs.DialogBuilder;
|
||||
import org.tasks.etesync.EteSyncAccountSettingsActivity;
|
||||
import org.tasks.preferences.BasicPreferences;
|
||||
|
||||
public class AddAccountDialog {
|
||||
public static void showAddAccountDialog(Activity activity, DialogBuilder dialogBuilder) {
|
||||
String[] services = activity.getResources().getStringArray(R.array.synchronization_services);
|
||||
String[] descriptions =
|
||||
activity.getResources().getStringArray(R.array.synchronization_services_description);
|
||||
TypedArray typedArray =
|
||||
activity.getResources().obtainTypedArray(R.array.synchronization_services_icons);
|
||||
int[] icons = new int[typedArray.length()];
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = typedArray.getResourceId(i, 0);
|
||||
}
|
||||
typedArray.recycle();
|
||||
ArrayAdapter<String> adapter =
|
||||
new ArrayAdapter<String>(
|
||||
activity, R.layout.simple_list_item_2_themed, R.id.text1, services) {
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
View view = super.getView(position, convertView, parent);
|
||||
view.<TextView>findViewById(R.id.text1).setText(services[position]);
|
||||
view.<TextView>findViewById(R.id.text2).setText(descriptions[position]);
|
||||
view.<ImageView>findViewById(R.id.image_view).setImageResource(icons[position]);
|
||||
return view;
|
||||
}
|
||||
};
|
||||
|
||||
dialogBuilder
|
||||
.newDialog()
|
||||
.setTitle(R.string.choose_synchronization_service)
|
||||
.setSingleChoiceItems(
|
||||
adapter,
|
||||
-1,
|
||||
(dialog, which) -> {
|
||||
switch (which) {
|
||||
case 0:
|
||||
activity.startActivityForResult(
|
||||
new Intent(activity, GtasksLoginActivity.class),
|
||||
BasicPreferences.REQUEST_GOOGLE_TASKS);
|
||||
break;
|
||||
case 1:
|
||||
activity.startActivityForResult(
|
||||
new Intent(activity, CaldavAccountSettingsActivity.class),
|
||||
BasicPreferences.REQUEST_CALDAV_SETTINGS);
|
||||
break;
|
||||
case 2:
|
||||
activity.startActivityForResult(
|
||||
new Intent(activity, EteSyncAccountSettingsActivity.class),
|
||||
BasicPreferences.REQUEST_CALDAV_SETTINGS);
|
||||
break;
|
||||
}
|
||||
dialog.dismiss();
|
||||
})
|
||||
.setNeutralButton(
|
||||
R.string.help,
|
||||
(dialog, which) ->
|
||||
activity.startActivity(
|
||||
new Intent(
|
||||
Intent.ACTION_VIEW, Uri.parse(activity.getString(R.string.help_url_sync)))))
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.showThemedListView();
|
||||
}
|
||||
}
|
@ -1,326 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
|
||||
package org.tasks.sync;
|
||||
|
||||
import static com.todoroo.andlib.utility.DateUtilities.now;
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.tasks.PermissionUtil.verifyPermissions;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceCategory;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import com.google.common.base.Strings;
|
||||
import com.todoroo.astrid.gtasks.auth.GtasksLoginActivity;
|
||||
import com.todoroo.astrid.service.TaskDeleter;
|
||||
import javax.inject.Inject;
|
||||
import org.tasks.R;
|
||||
import org.tasks.analytics.Tracker;
|
||||
import org.tasks.analytics.Tracking;
|
||||
import org.tasks.billing.Inventory;
|
||||
import org.tasks.billing.PurchaseActivity;
|
||||
import org.tasks.caldav.CaldavAccountSettingsActivity;
|
||||
import org.tasks.etesync.EteSyncAccountSettingsActivity;
|
||||
import org.tasks.data.CaldavAccount;
|
||||
import org.tasks.data.CaldavDao;
|
||||
import org.tasks.data.GoogleTaskAccount;
|
||||
import org.tasks.data.GoogleTaskDao;
|
||||
import org.tasks.data.GoogleTaskListDao;
|
||||
import org.tasks.dialogs.DialogBuilder;
|
||||
import org.tasks.gtasks.GoogleAccountManager;
|
||||
import org.tasks.injection.ActivityComponent;
|
||||
import org.tasks.injection.InjectingPreferenceActivity;
|
||||
import org.tasks.jobs.WorkManager;
|
||||
import org.tasks.preferences.ActivityPermissionRequestor;
|
||||
import org.tasks.preferences.PermissionChecker;
|
||||
import org.tasks.preferences.PermissionRequestor;
|
||||
import org.tasks.preferences.Preferences;
|
||||
import org.tasks.ui.Toaster;
|
||||
|
||||
public class SynchronizationPreferences extends InjectingPreferenceActivity {
|
||||
|
||||
private static final int REQUEST_LOGIN = 0;
|
||||
private static final int REQUEST_CALDAV_SETTINGS = 101;
|
||||
private static final int REQUEST_CALDAV_SUBSCRIBE = 102;
|
||||
private static final int REQUEST_GOOGLE_TASKS_SUBSCRIBE = 103;
|
||||
private static final int REQUEST_ETESYNC_SETTINGS = 104;
|
||||
private static final int REQUEST_ETESYNC_SUBSCRIBE = 105;
|
||||
|
||||
@Inject ActivityPermissionRequestor permissionRequestor;
|
||||
@Inject PermissionChecker permissionChecker;
|
||||
@Inject Tracker tracker;
|
||||
@Inject DialogBuilder dialogBuilder;
|
||||
@Inject SyncAdapters syncAdapters;
|
||||
@Inject GoogleTaskDao googleTaskDao;
|
||||
@Inject GoogleTaskListDao googleTaskListDao;
|
||||
@Inject GoogleAccountManager googleAccountManager;
|
||||
@Inject Preferences preferences;
|
||||
@Inject WorkManager workManager;
|
||||
@Inject CaldavDao caldavDao;
|
||||
@Inject Inventory inventory;
|
||||
@Inject TaskDeleter taskDeleter;
|
||||
@Inject Toaster toaster;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setTitle(R.string.synchronization);
|
||||
|
||||
addPreferencesFromResource(R.xml.preferences_synchronization);
|
||||
|
||||
findPreference(getString(R.string.p_background_sync_unmetered_only))
|
||||
.setOnPreferenceChangeListener(
|
||||
(preference, o) -> {
|
||||
workManager.updateBackgroundSync(null, null, (Boolean) o);
|
||||
return true;
|
||||
});
|
||||
findPreference(getString(R.string.p_background_sync))
|
||||
.setOnPreferenceChangeListener(
|
||||
(preference, o) -> {
|
||||
workManager.updateBackgroundSync(null, (Boolean) o, null);
|
||||
return true;
|
||||
});
|
||||
Preference addGoogleTaskAccount = findPreference(R.string.p_add_google_task_account);
|
||||
if (inventory.hasPro() || googleTaskListDao.getAccounts().isEmpty()) {
|
||||
addGoogleTaskAccount.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
addGoogleTaskAccount();
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
addGoogleTaskAccount.setSummary(R.string.requires_pro_subscription);
|
||||
addGoogleTaskAccount.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
startActivityForResult(
|
||||
new Intent(this, PurchaseActivity.class), REQUEST_GOOGLE_TASKS_SUBSCRIBE);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
CheckBoxPreference positionHack =
|
||||
(CheckBoxPreference) findPreference(R.string.google_tasks_position_hack);
|
||||
positionHack.setChecked(preferences.isPositionHackEnabled());
|
||||
positionHack.setOnPreferenceChangeListener(
|
||||
(preference, newValue) -> {
|
||||
if (newValue == null) {
|
||||
return false;
|
||||
}
|
||||
preferences.setLong(
|
||||
R.string.p_google_tasks_position_hack, ((Boolean) newValue) ? now() : 0);
|
||||
return true;
|
||||
});
|
||||
|
||||
Preference addCaldavAccount = findPreference(R.string.p_add_caldav_account);
|
||||
if (inventory.hasPro()) {
|
||||
addCaldavAccount.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
addCaldavAccount();
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
addCaldavAccount.setSummary(R.string.requires_pro_subscription);
|
||||
addCaldavAccount.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
startActivityForResult(
|
||||
new Intent(this, PurchaseActivity.class), REQUEST_CALDAV_SUBSCRIBE);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
Preference addEteSyncAccount = findPreference(R.string.p_add_etesync_account);
|
||||
if (inventory.hasPro()) {
|
||||
addEteSyncAccount.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
addEteSyncAccount();
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
addEteSyncAccount.setSummary(R.string.requires_pro_subscription);
|
||||
addEteSyncAccount.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
startActivityForResult(
|
||||
new Intent(this, PurchaseActivity.class), REQUEST_ETESYNC_SUBSCRIBE);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void logoutConfirmation(GoogleTaskAccount account) {
|
||||
String name = account.getAccount();
|
||||
AlertDialog alertDialog =
|
||||
dialogBuilder
|
||||
.newDialog()
|
||||
.setMessage(R.string.logout_warning, name)
|
||||
.setPositiveButton(
|
||||
R.string.logout,
|
||||
(dialog, which) -> {
|
||||
taskDeleter.delete(account);
|
||||
restart();
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.create();
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
alertDialog.setCancelable(false);
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
private void requestLogin() {
|
||||
startActivityForResult(new Intent(this, GtasksLoginActivity.class), REQUEST_LOGIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
addGoogleTasksAccounts();
|
||||
addCaldavAccounts();
|
||||
}
|
||||
|
||||
private void addGoogleTasksAccounts() {
|
||||
PreferenceCategory googleTaskPreferences =
|
||||
(PreferenceCategory) findPreference(getString(R.string.gtasks_GPr_header));
|
||||
googleTaskPreferences.removeAll();
|
||||
for (GoogleTaskAccount googleTaskAccount : googleTaskListDao.getAccounts()) {
|
||||
String account = googleTaskAccount.getAccount();
|
||||
Preference accountPreferences = new Preference(this);
|
||||
accountPreferences.setTitle(account);
|
||||
accountPreferences.setSummary(googleTaskAccount.getError());
|
||||
accountPreferences.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
dialogBuilder
|
||||
.newDialog(account)
|
||||
.setItems(
|
||||
asList(getString(R.string.reinitialize_account), getString(R.string.logout)),
|
||||
(dialog, which) -> {
|
||||
if (which == 0) {
|
||||
addGoogleTaskAccount();
|
||||
} else {
|
||||
logoutConfirmation(googleTaskAccount);
|
||||
}
|
||||
})
|
||||
.showThemedListView();
|
||||
return false;
|
||||
});
|
||||
googleTaskPreferences.addPreference(accountPreferences);
|
||||
}
|
||||
}
|
||||
|
||||
private void addGoogleTaskAccount() {
|
||||
if (permissionRequestor.requestAccountPermissions()) {
|
||||
requestLogin();
|
||||
}
|
||||
}
|
||||
|
||||
private void addCaldavAccounts() {
|
||||
PreferenceCategory caldavPreferences =
|
||||
(PreferenceCategory) findPreference(getString(R.string.CalDAV));
|
||||
PreferenceCategory eteSyncPreferences =
|
||||
(PreferenceCategory) findPreference(R.string.etesync);
|
||||
caldavPreferences.removeAll();
|
||||
eteSyncPreferences.removeAll();
|
||||
for (CaldavAccount caldavAccount : caldavDao.getAccounts()) {
|
||||
Preference accountPreferences = new Preference(this);
|
||||
accountPreferences.setTitle(caldavAccount.getName());
|
||||
accountPreferences.setSummary(caldavAccount.getError());
|
||||
if (caldavAccount.isCaldavAccount()) {
|
||||
accountPreferences.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
Intent intent = new Intent(this, CaldavAccountSettingsActivity.class);
|
||||
intent.putExtra(CaldavAccountSettingsActivity.EXTRA_CALDAV_DATA, caldavAccount);
|
||||
startActivityForResult(intent, REQUEST_CALDAV_SETTINGS);
|
||||
return false;
|
||||
});
|
||||
caldavPreferences.addPreference(accountPreferences);
|
||||
} else if (caldavAccount.isEteSyncAccount()) {
|
||||
accountPreferences.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
Intent intent = new Intent(this, EteSyncAccountSettingsActivity.class);
|
||||
intent.putExtra(CaldavAccountSettingsActivity.EXTRA_CALDAV_DATA, caldavAccount);
|
||||
startActivityForResult(intent, REQUEST_ETESYNC_SETTINGS);
|
||||
return false;
|
||||
}
|
||||
);
|
||||
eteSyncPreferences.addPreference(accountPreferences);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addCaldavAccount() {
|
||||
startActivityForResult(
|
||||
new Intent(this, CaldavAccountSettingsActivity.class), REQUEST_CALDAV_SETTINGS);
|
||||
}
|
||||
|
||||
private void addEteSyncAccount() {
|
||||
startActivityForResult(
|
||||
new Intent(this, EteSyncAccountSettingsActivity.class), REQUEST_ETESYNC_SETTINGS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == REQUEST_LOGIN) {
|
||||
boolean enabled = resultCode == RESULT_OK;
|
||||
if (enabled) {
|
||||
tracker.reportEvent(Tracking.Events.GTASK_ENABLED);
|
||||
workManager.updateBackgroundSync();
|
||||
restart();
|
||||
} else if (data != null) {
|
||||
toaster.longToast(data.getStringExtra(GtasksLoginActivity.EXTRA_ERROR));
|
||||
}
|
||||
} else if (requestCode == REQUEST_CALDAV_SETTINGS || requestCode == REQUEST_ETESYNC_SETTINGS) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
workManager.updateBackgroundSync();
|
||||
restart();
|
||||
}
|
||||
} else if (requestCode == REQUEST_CALDAV_SUBSCRIBE) {
|
||||
if (inventory.hasPro()) {
|
||||
addCaldavAccount();
|
||||
}
|
||||
} else if (requestCode == REQUEST_GOOGLE_TASKS_SUBSCRIBE) {
|
||||
if (inventory.hasPro()) {
|
||||
requestLogin();
|
||||
}
|
||||
} else if (requestCode == REQUEST_ETESYNC_SUBSCRIBE) {
|
||||
if (inventory.hasPro()) {
|
||||
addEteSyncAccount();
|
||||
}
|
||||
} else {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
private void restart() {
|
||||
Intent intent = getIntent();
|
||||
finish();
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(
|
||||
int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
if (requestCode == PermissionRequestor.REQUEST_GOOGLE_ACCOUNTS) {
|
||||
if (verifyPermissions(grantResults)) {
|
||||
requestLogin();
|
||||
}
|
||||
} else {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getHelpUrl() {
|
||||
return "http://tasks.org/subscribe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inject(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="192" android:viewportWidth="192"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillAlpha="1" android:fillColor="#ffc107"
|
||||
android:pathData="M160,67.52V30H122.48L96,3.52 69.52,30H32V67.52L5.52,94 32,120.48V158H69.52L96,184.48 122.48,158H160V120.48L186.48,94Z" android:strokeWidth="8"/>
|
||||
<path android:fillAlpha="1" android:fillColor="#ffd740"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M79.939,93.956a16.102,16.103 0,1 0,32.204 0a16.102,16.103 0,1 0,-32.204 0z"
|
||||
android:strokeAlpha="1" android:strokeColor="#ffd740"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="60.96912003"/>
|
||||
<path android:fillAlpha="1" android:fillColor="#448aff"
|
||||
android:pathData="M96,47.47L96,30.02L72.705,53.286 96,76.553v-17.45c19.277,0 34.942,15.647 34.942,34.9 0,5.875 -1.456,11.459 -4.077,16.287l8.503,8.492c4.543,-7.154 7.221,-15.647 7.221,-24.779 0,-25.709 -20.849,-46.533 -46.59,-46.533zM96,128.902c-19.277,0 -34.942,-15.647 -34.942,-34.9 0,-5.875 1.456,-11.459 4.077,-16.287l-8.503,-8.492c-4.543,7.154 -7.221,15.647 -7.221,24.779 0,25.709 20.849,46.533 46.59,46.533v17.45L119.295,134.719 96,111.452Z" android:strokeWidth="5.82016563"/>
|
||||
</vector>
|
@ -0,0 +1,8 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="544.3" android:viewportWidth="533.5"
|
||||
android:width="23.523792dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#4285F4" android:pathData="M533.5,278.4c0,-18.5 -1.5,-37.1 -4.7,-55.3H272.1v104.8h147c-6.1,33.8 -25.7,63.7 -54.4,82.7v68h87.7C503.9,431.2 533.5,361.2 533.5,278.4z"/>
|
||||
<path android:fillColor="#34A853" android:pathData="M272.1,544.3c73.4,0 135.3,-24.1 180.4,-65.7l-87.7,-68c-24.4,16.6 -55.9,26 -92.6,26c-71,0 -131.2,-47.9 -152.8,-112.3H28.9v70.1C75.1,486.3 169.2,544.3 272.1,544.3z"/>
|
||||
<path android:fillColor="#FBBC04" android:pathData="M119.3,324.3c-11.4,-33.8 -11.4,-70.4 0,-104.2V150H28.9c-38.6,76.9 -38.6,167.5 0,244.4L119.3,324.3z"/>
|
||||
<path android:fillColor="#EA4335" android:pathData="M272.1,107.7c38.8,-0.6 76.3,14 104.4,40.8l0,0l77.7,-77.7C405,24.6 339.7,-0.8 272.1,0C169.2,0 75.1,58 28.9,150l90.4,70.1C140.8,155.6 201.1,107.7 272.1,107.7z"/>
|
||||
</vector>
|
@ -0,0 +1,8 @@
|
||||
<vector android:autoMirrored="true" android:height="35.4dp"
|
||||
android:viewportHeight="77.17024" android:viewportWidth="104.535675"
|
||||
android:width="47.95324dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#000000"
|
||||
android:pathData="M53.542,1.209c-4.9,1.7 -9.9,4.9 -12.9,8.2 -1.8,1.9 -0.9,1.5 2.9,-1.4 9.7,-7.3 18.6,-7.9 24.7,-1.8 3.9,3.9 5.4,9.1 5.2,17.1 -0.2,5.9 -0.2,5.9 -0.5,1 -0.6,-8.8 -0.9,-9.5 -4.9,-9.5 -2,-0 -3.7,0.6 -4,1.3 -0.3,0.8 2.2,10.3 5.5,21.3 3.2,10.9 6.4,21.8 7,24.1l1.2,4.3 6.9,-0 6.9,-0 -0.5,-3.2c-0.5,-3.2 0.8,-8.1 10.2,-36.8 3.6,-11.1 3.9,-12.4 2.6,-11.6 -0.5,0.3 -2.7,0.6 -5.1,0.7 -3.6,0.3 -4.2,0.7 -4.7,2.8 -0.4,1.5 -2.2,7.9 -4,14.4 -1.9,6.6 -3.4,12.5 -3.4,13.2 0,0.8 -0.4,1.6 -0.9,1.9 -0.5,0.3 -2.5,-5.8 -4.4,-13.6 -2,-8.1 -3.7,-13.4 -4,-12.3 -0.3,1.3 -0.5,1 -0.6,-1.2 -0.2,-4.6 -3,-12.4 -5.5,-15.2 -4.3,-4.8 -10.9,-6.2 -17.7,-3.7zM76.242,32.409c-0.5,2.4 -1.2,3.4 -2.6,3.4 -2.4,-0 -2.9,-0.9 -1.9,-4l0.7,-2.5 0.1,2.7c0.2,5.3 3,2.6 3.2,-3 0,-1.5 0.3,-2.1 0.6,-1.4 0.3,0.7 0.2,2.9 -0.1,4.8z" android:strokeColor="#00000000"/>
|
||||
<path android:fillColor="#000000"
|
||||
android:pathData="M13.042,13.509c-0.6,0.4 -1.9,5 -2.8,10.2 -1.9,9.8 -8.8,37.4 -10,40.3 -0.7,1.7 0,1.8 9.3,1.8l10.1,-0 0,-2.8c0.1,-2 0.5,-1.4 2,2.8 4.6,13.3 16.7,15.1 30.8,4.5 3.3,-2.5 7.5,-6.7 9.3,-9.5 3.7,-5.5 4.1,-5.7 5.9,-3.5 0.9,1 0.9,1.5 0.1,1.5 -0.6,-0 -1.1,-0.6 -1.1,-1.3 -0.1,-1.9 -5,4.6 -5,6.5 0,1.6 1,1.8 7.5,1.8l7.6,-0 -1.5,-2.7c-1.3,-2.8 -9.9,-29.8 -13.2,-42.1l-1.7,-6.3 -6.8,0.2 -6.7,0.2 0.5,3.8c0.6,4 -1,5.5 -2.1,2.1 -0.4,-1 -2,-3.1 -3.6,-4.7 -3,-2.8 -3.4,-2.9 -15.3,-3.3 -6.7,-0.1 -12.7,0.1 -13.3,0.5zM31.342,23.009c1.8,1.6 2.3,3.2 2.3,6.8 0,9.2 -5.4,24.8 -9,25.7 -2.2,0.6 -2.5,2.8 -1,6.7 0.8,2.3 1.2,2.5 3.6,1.6 1.5,-0.6 4,-2 5.6,-3.2l3,-2.1 -1.6,3.1c-0.9,1.7 -1.6,3.3 -1.6,3.7 0,0.3 2.5,0.5 5.5,0.5 3.7,-0 5.5,-0.4 5.5,-1.3 0,-0.6 0.5,-2.9 1.1,-5l1,-3.9 7.2,0.2c9.2,0.3 9.2,0.3 7.8,-1.4 -0.9,-1.1 -0.4,-1.8 2.4,-3.5 4.1,-2.4 4.5,-2.5 4.5,-1.1 0,0.6 -0.3,0.9 -0.7,0.8 -1.5,-0.4 -5.2,2.3 -4.8,3.5 0.8,2.1 -5.9,10 -11.7,14 -11.7,8.1 -21.8,6.6 -26.9,-3.9 -3.8,-8 -2.6,-21.4 3.2,-34.3 1.6,-3.5 2.8,-6.6 2.6,-6.8 -0.8,-0.7 -6.8,14 -8.2,20 -0.8,3.4 -1.5,8.7 -1.6,11.7 0,3.3 -0.3,4.8 -0.8,3.7 -0.4,-1 -1.1,-1.9 -1.6,-2 -1.3,-0.3 -1.1,-1.5 3.2,-20 3.5,-15.1 3.7,-15.7 6.2,-15.7 1.3,-0 3.5,1 4.8,2.2zM55.242,40.409c1.1,3.5 1.8,6.6 1.6,6.9 -0.9,0.9 -7.1,0.5 -7.6,-0.4 -0.7,-1.1 2.6,-14.2 3.4,-13.5 0.2,0.3 1.4,3.4 2.6,7z" android:strokeColor="#00000000"/>
|
||||
</vector>
|
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2006 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:mode="twoLine"
|
||||
android:paddingStart="@dimen/keyline_first"
|
||||
android:paddingLeft="@dimen/keyline_first"
|
||||
android:paddingTop="@dimen/list_item_spacing"
|
||||
android:paddingEnd="@dimen/keyline_first"
|
||||
android:paddingRight="@dimen/keyline_first"
|
||||
android:paddingBottom="@dimen/list_item_spacing">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginEnd="@dimen/keyline_first"
|
||||
android:layout_marginRight="@dimen/keyline_first"
|
||||
android:src="@drawable/ic_etesync" />
|
||||
|
||||
<TextView
|
||||
android:id="@id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toEndOf="@id/image_view"
|
||||
android:layout_toRightOf="@id/image_view"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
|
||||
<TextView
|
||||
android:id="@id/text2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/text1"
|
||||
android:layout_alignStart="@id/text1"
|
||||
android:layout_alignLeft="@id/text1"
|
||||
android:textAppearance="?attr/textAppearanceListItemSecondary" />
|
||||
|
||||
</TwoLineListItem>
|
@ -1,54 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="@string/gtasks_GPr_header"
|
||||
android:title="@string/gtasks_GPr_header"/>
|
||||
|
||||
<Preference
|
||||
android:key="@string/p_add_google_task_account"
|
||||
android:title="@string/add_account"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="@string/p_google_tasks_add_to_top"
|
||||
android:title="@string/google_tasks_add_to_top"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="@string/google_tasks_position_hack"
|
||||
android:title="@string/google_tasks_position_hack"
|
||||
android:summary="@string/google_tasks_position_hack_summary" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="@string/CalDAV"
|
||||
android:title="@string/CalDAV"/>
|
||||
|
||||
<Preference
|
||||
android:key="@string/p_add_caldav_account"
|
||||
android:title="@string/add_account"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="@string/etesync"
|
||||
android:title="@string/etesync" />
|
||||
|
||||
<Preference
|
||||
android:key="@string/p_add_etesync_account"
|
||||
android:title="@string/add_account"/>
|
||||
|
||||
<PreferenceCategory android:title="@string/sync_SPr_interval_title">
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="@string/p_background_sync"
|
||||
android:title="@string/enabled"/>
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:dependency="@string/p_background_sync"
|
||||
android:key="@string/p_background_sync_unmetered_only"
|
||||
android:title="@string/background_sync_unmetered_only"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
Loading…
Reference in New Issue