Remove char limit from owner info
Bug: 21959734 Change-Id: I21854309ca390cb126ba50feaa56fb9a35b862e1
This commit is contained in:
@@ -27,17 +27,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
android:hint="@string/owner_info_settings_edit_text_hint"
|
android:hint="@string/owner_info_settings_edit_text_hint"
|
||||||
android:maxLength="100"
|
|
||||||
android:inputType="textMultiLine|textCapSentences"
|
android:inputType="textMultiLine|textCapSentences"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/owner_info_status"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="end"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -24,13 +24,10 @@ import android.content.DialogInterface;
|
|||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.TextWatcher;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
import com.android.internal.widget.LockPatternUtils;
|
||||||
|
|
||||||
@@ -38,13 +35,10 @@ public class OwnerInfoSettings extends DialogFragment implements OnClickListener
|
|||||||
|
|
||||||
private static final String TAG_OWNER_INFO = "ownerInfo";
|
private static final String TAG_OWNER_INFO = "ownerInfo";
|
||||||
|
|
||||||
private static final int MAX_CHARS = 100;
|
|
||||||
|
|
||||||
private View mView;
|
private View mView;
|
||||||
private int mUserId;
|
private int mUserId;
|
||||||
private LockPatternUtils mLockPatternUtils;
|
private LockPatternUtils mLockPatternUtils;
|
||||||
private EditText mOwnerInfo;
|
private EditText mOwnerInfo;
|
||||||
private TextView mOwnerInfoStatus;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -72,33 +66,6 @@ public class OwnerInfoSettings extends DialogFragment implements OnClickListener
|
|||||||
if (!TextUtils.isEmpty(info)) {
|
if (!TextUtils.isEmpty(info)) {
|
||||||
mOwnerInfo.setText(info);
|
mOwnerInfo.setText(info);
|
||||||
}
|
}
|
||||||
mOwnerInfoStatus = (TextView) mView.findViewById(R.id.owner_info_status);
|
|
||||||
updateOwnerInfoStatus();
|
|
||||||
|
|
||||||
mOwnerInfo.addTextChangedListener(new TextWatcher() {
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s) {
|
|
||||||
updateOwnerInfoStatus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateOwnerInfoStatus() {
|
|
||||||
int chars = mOwnerInfo.getText().toString().length();
|
|
||||||
String status = getString(R.string.owner_info_settings_status,
|
|
||||||
chars, MAX_CHARS);
|
|
||||||
String accessibilityStatus = getString(R.string.accessibility_lock_screen_progress,
|
|
||||||
chars, MAX_CHARS);
|
|
||||||
mOwnerInfoStatus.setText(status);
|
|
||||||
mOwnerInfoStatus.setContentDescription(accessibilityStatus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user