Minor fixes to sync upgrade prompts

pull/14/head
Sam Bosley 12 years ago
parent 1ea5d2cbf6
commit 9fe7f30373

@ -8,6 +8,7 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.DateUtilities;
@ -62,6 +63,7 @@ public class SyncUpgradePrompt {
@Override
public void run() {
new ActFmSyncV2Provider().signOut();
Toast.makeText(activity, R.string.sync_upgr_logged_out, Toast.LENGTH_LONG).show();
}
});
setLastPromptDate(Long.MAX_VALUE);
@ -85,10 +87,17 @@ public class SyncUpgradePrompt {
private static Dialog getDialog(Activity activity, int title, int body, Object... buttonsAndListeners) {
final Dialog d = new Dialog(activity, R.style.ReminderDialog);
d.setContentView(R.layout.astrid_reminder_view);
d.setContentView(R.layout.astrid_reminder_view_portrait);
((TextView) d.findViewById(R.id.reminder_title)).setText(title);
((TextView) d.findViewById(R.id.reminder_message)).setText(body);
d.findViewById(R.id.dismiss).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
d.dismiss();
}
});
d.findViewById(R.id.reminder_complete).setVisibility(View.GONE);
TypedValue tv = new TypedValue();
activity.getTheme().resolveAttribute(R.attr.asThemeTextColor, tv, false);
@ -105,7 +114,7 @@ public class SyncUpgradePrompt {
listener1.run();
}
});
b1.setTextColor(activity.getResources().getColor(tv.data));
b1.setBackgroundColor(activity.getResources().getColor(tv.data));
if (buttonsAndListeners.length < 3) {
d.findViewById(R.id.reminder_snooze).setVisibility(View.GONE);
@ -122,7 +131,7 @@ public class SyncUpgradePrompt {
listener2.run();
}
});
b2.setTextColor(activity.getResources().getColor(tv.data));
b2.setBackgroundColor(activity.getResources().getColor(tv.data));
}
return d;

@ -356,5 +356,7 @@
<string name="sync_upgr_neither_body">Don\'t put your to-dos at risk! New and improved Astrid sync to keep and access your tasks from anywhere.</string>
<string name="sync_upgr_neither_btn1">Sign up now</string>
<string name="sync_upgr_logged_out">You have been logged out of Astrid</string>
</resources>

Loading…
Cancel
Save