Merge "Add a "Do not show" checkbox in support disclaimer dialog." into nyc-mr1-dev
This commit is contained in:
@@ -24,6 +24,14 @@
|
|||||||
android:id="@+id/support_disclaimer_text"
|
android:id="@+id/support_disclaimer_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
android:text="@string/support_disclaimer_content"/>
|
android:text="@string/support_disclaimer_content"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/support_disclaimer_do_not_show_again"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/support_disclaimer_do_not_show"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -7546,6 +7546,9 @@
|
|||||||
<!-- Dialog content displayed before initiating real time support [CHAR LIMIT=NONE]-->
|
<!-- Dialog content displayed before initiating real time support [CHAR LIMIT=NONE]-->
|
||||||
<string name="support_disclaimer_content">To help address your issue quickly, we need system information for diagnosis.</string>
|
<string name="support_disclaimer_content">To help address your issue quickly, we need system information for diagnosis.</string>
|
||||||
|
|
||||||
|
<!-- Checkbox text, when checked dialog will not show again [CHAR LIMIT=80] -->
|
||||||
|
<string name="support_disclaimer_do_not_show">Do not show again</string>
|
||||||
|
|
||||||
<!-- [CHAR LIMIT=60] Title of work profile setting page -->
|
<!-- [CHAR LIMIT=60] Title of work profile setting page -->
|
||||||
<string name="managed_profile_settings_title">Work profile settings</string>
|
<string name="managed_profile_settings_title">Work profile settings</string>
|
||||||
<!-- [CHAR LIMIT=60] The preference title for enabling cross-profile remote contact search -->
|
<!-- [CHAR LIMIT=60] The preference title for enabling cross-profile remote contact search -->
|
||||||
|
@@ -58,6 +58,11 @@ public interface SupportFeatureProvider {
|
|||||||
*/
|
*/
|
||||||
boolean shouldShowDisclaimerDialog(Context context);
|
boolean shouldShowDisclaimerDialog(Context context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether or not a disclaimer dialog should be displayed.
|
||||||
|
*/
|
||||||
|
void setShouldShowDisclaimerDialog(Context context, boolean shouldShow);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an {@link Account} that's eligible for support options.
|
* Returns an {@link Account} that's eligible for support options.
|
||||||
*/
|
*/
|
||||||
|
@@ -29,6 +29,7 @@ import android.text.method.LinkMovementMethod;
|
|||||||
import android.text.style.URLSpan;
|
import android.text.style.URLSpan;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.CheckBox;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
@@ -67,15 +68,18 @@ public final class SupportDisclaimerDialogFragment extends DialogFragment implem
|
|||||||
disclaimer.setMovementMethod(LinkMovementMethod.getInstance());
|
disclaimer.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
stripUnderlines((Spannable) disclaimer.getText());
|
stripUnderlines((Spannable) disclaimer.getText());
|
||||||
return builder
|
return builder
|
||||||
.setView(content)
|
.setView(content)
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
final Activity activity = getActivity();
|
final Activity activity = getActivity();
|
||||||
|
final CheckBox doNotShow =
|
||||||
|
(CheckBox) getDialog().findViewById(R.id.support_disclaimer_do_not_show_again);
|
||||||
final SupportFeatureProvider supportFeatureProvider =
|
final SupportFeatureProvider supportFeatureProvider =
|
||||||
FeatureFactory.getFactory(activity).getSupportFeatureProvider(activity);
|
FeatureFactory.getFactory(activity).getSupportFeatureProvider(activity);
|
||||||
|
supportFeatureProvider.setShouldShowDisclaimerDialog(getContext(), !doNotShow.isChecked());
|
||||||
final Bundle bundle = getArguments();
|
final Bundle bundle = getArguments();
|
||||||
supportFeatureProvider.startSupport(getActivity(),
|
supportFeatureProvider.startSupport(getActivity(),
|
||||||
(Account) bundle.getParcelable(EXTRA_ACCOUNT), bundle.getInt(EXTRA_TYPE));
|
(Account) bundle.getParcelable(EXTRA_ACCOUNT), bundle.getInt(EXTRA_TYPE));
|
||||||
|
Reference in New Issue
Block a user