Reverse description

This commit is contained in:
世界 2021-02-06 21:21:36 +08:00
parent 3146a49afd
commit b9624d14c6
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
3 changed files with 35 additions and 36 deletions

View File

@ -1925,36 +1925,6 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No
textView2.setLineSpacing(AndroidUtilities.dp(2), 1.0f);
addView(textView2, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, 0, 28, 0, 10));
infoCell = new CheckBoxCell(context, 2);
infoCell.setText(LocaleController.getString("UploadDeviceInfo", R.string.UploadDeviceInfo), "", uploadDeviceInfo, false);
addView(infoCell, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.LEFT | Gravity.TOP));
infoCell.setOnClickListener(new OnClickListener() {
private Toast visibleToast;
@Override
public void onClick(View v) {
if (getParentActivity() == null) {
return;
}
infoCell.setChecked(uploadDeviceInfo = !uploadDeviceInfo, true);
try {
if (visibleToast != null) {
visibleToast.cancel();
}
} catch (Exception e) {
FileLog.e(e);
}
if (uploadDeviceInfo) {
visibleToast = Toast.makeText(getParentActivity(), LocaleController.getString("UploadDeviceInfoOn", R.string.UploadDeviceInfoOn), Toast.LENGTH_SHORT);
visibleToast.show();
} else {
visibleToast = Toast.makeText(getParentActivity(), LocaleController.getString("UploadDeviceInfoOff", R.string.UploadDeviceInfoOff), Toast.LENGTH_SHORT);
visibleToast.show();
}
}
});
syncCell = new CheckBoxCell(context, 2);
syncCell.setText(LocaleController.getString("SyncContacts", R.string.SyncContacts), "", syncContacts, false);
addView(syncCell, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.LEFT | Gravity.TOP));
@ -1987,6 +1957,36 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No
}
});
infoCell = new CheckBoxCell(context, 2);
infoCell.setText(LocaleController.getString("HideDevieInfo", R.string.HideDeviceInfo), "", !uploadDeviceInfo, false);
addView(infoCell, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.LEFT | Gravity.TOP));
infoCell.setOnClickListener(new OnClickListener() {
private Toast visibleToast;
@Override
public void onClick(View v) {
if (getParentActivity() == null) {
return;
}
infoCell.setChecked(!(uploadDeviceInfo = !uploadDeviceInfo), true);
try {
if (visibleToast != null) {
visibleToast.cancel();
}
} catch (Exception e) {
FileLog.e(e);
}
if (!uploadDeviceInfo) {
visibleToast = Toast.makeText(getParentActivity(), LocaleController.getString("HideDeviceInfoOn", R.string.HideDeviceInfoOn), Toast.LENGTH_SHORT);
visibleToast.show();
} else {
visibleToast = Toast.makeText(getParentActivity(), LocaleController.getString("HideDeviceInfoOff", R.string.HideDeviceInfoOff), Toast.LENGTH_SHORT);
visibleToast.show();
}
}
});
TelephonyManager tm = (TelephonyManager) ApplicationLoader.applicationContext.getSystemService(Context.TELEPHONY_SERVICE);
if (BuildVars.DEBUG_VERSION) {
FileLog.d("sim status = " + tm.getSimState());

View File

@ -96,7 +96,7 @@ public class NekoAccountSettingsActivity extends BaseFragment {
getUserConfig().deviceInfo = !getUserConfig().deviceInfo;
getUserConfig().saveConfig(true);
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(getUserConfig().deviceInfo);
((TextCheckCell) view).setChecked(!getUserConfig().deviceInfo);
}
tooltip.showWithAction(0, UndoView.ACTION_NEED_RESATRT, null, null);
} else if (position == deleteAccountRow) {
@ -275,7 +275,7 @@ public class NekoAccountSettingsActivity extends BaseFragment {
TextCheckCell textCell = (TextCheckCell) holder.itemView;
textCell.setEnabled(true, null);
if (position == uploadDeviceInfoRow) {
textCell.setTextAndCheck(LocaleController.getString("UploadDeviceInfo", R.string.UploadDeviceInfo), getUserConfig().deviceInfo, true);
textCell.setTextAndCheck(LocaleController.getString("HideDeviceInfo", R.string.HideDeviceInfo), !getUserConfig().deviceInfo, true);
}
break;
}

View File

@ -275,9 +275,8 @@
<string name="TextReplace">Replace</string>
<string name="ReplaceRegex">Use regex</string>
<string name="DisableTrending">Disable Trending</string>
<string name="UploadDeviceInfo">Upload device info</string>
<string name="UploadDeviceInfoOn">Device info will be uploaded the second time after logging in.</string>
<string name="UploadDeviceInfoOff">You can change this in the settings later.</string>
<string name="HideDeviceInfo">Hide device model</string>
<string name="HideDeviceInfoOff">Device model will be uploaded the second time the app starts after logging in.</string>
<string name="HideDeviceInfoOn">You can change this in the settings later.</string>
</resources>