Fix 4462497: Make lockscreen preference screen layouts more dynamic
This reduces the dependency of LockScreen preference screens on a particular device size by using centering logic instead of absolute offsets/sizes. Change-Id: I6ff9e71dc122e12493148437dda647820ae0f308
This commit is contained in:
@@ -21,44 +21,41 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!-- left side: lock pattern widget -->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal|center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- left side: lock pattern -->
|
|
||||||
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
||||||
android:layout_width="354dip"
|
android:layout_width="354dip"
|
||||||
android:layout_height="354dip"
|
android:layout_height="354dip"
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="72dip"
|
|
||||||
android:layout_marginLeft="111dip"
|
|
||||||
aspect="square"/>
|
aspect="square"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<!-- right side: instructions and buttons -->
|
<!-- right side: instructions and buttons -->
|
||||||
<!-- header message -->
|
<RelativeLayout
|
||||||
<TextView android:id="@+id/headerText"
|
android:layout_width="0dip"
|
||||||
android:layout_width="542dip"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="78dip"
|
android:layout_weight="1"
|
||||||
android:layout_marginTop="88dip"
|
android:gravity="center_horizontal">
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_toRightOf="@id/lockPattern"
|
|
||||||
android:layout_marginLeft="100dip"
|
|
||||||
android:textSize="22sp"/>
|
|
||||||
|
|
||||||
<!-- footer message -->
|
<!-- footer message -->
|
||||||
<TextView android:id="@+id/footerText"
|
<TextView android:id="@+id/footerText"
|
||||||
android:layout_width="542dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/headerText"
|
android:layout_below="@id/headerText"
|
||||||
android:layout_marginTop="16dip"
|
android:layout_marginTop="16dip"
|
||||||
android:layout_toRightOf="@id/lockPattern"
|
android:layout_toRightOf="@id/lockPattern"
|
||||||
android:layout_marginLeft="100dip"
|
android:layout_marginLeft="100dip"
|
||||||
android:textSize="22sp"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<!-- confirm / restart buttons -->
|
<!-- confirm / restart buttons -->
|
||||||
<LinearLayout
|
<LinearLayout android:id="@+id/buttonContainer"
|
||||||
style="@style/SecurityPreferenceButtonContainer"
|
style="@style/SecurityPreferenceButtonContainer"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
@@ -76,6 +73,24 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- header message -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="20dip"
|
||||||
|
android:layout_marginLeft="20dip"
|
||||||
|
android:layout_above="@id/buttonContainer"
|
||||||
|
android:gravity="center_vertical|center_horizontal">
|
||||||
|
|
||||||
|
<TextView android:id="@+id/headerText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
||||||
|
@@ -21,33 +21,30 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!-- left side: lock pattern example widget -->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal|center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- left side: lock pattern -->
|
|
||||||
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
||||||
android:layout_width="354dip"
|
android:layout_width="354dip"
|
||||||
android:layout_height="354dip"
|
android:layout_height="354dip"
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="72dip"
|
|
||||||
android:layout_marginLeft="111dip"
|
|
||||||
aspect="square"/>
|
aspect="square"/>
|
||||||
|
|
||||||
<!-- right side: instructions and buttons -->
|
</RelativeLayout>
|
||||||
<!-- header message -->
|
|
||||||
<TextView android:id="@+id/headerText"
|
|
||||||
android:layout_width="542dip"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="88dip"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_toRightOf="@id/lockPattern"
|
|
||||||
android:layout_marginLeft="100dip"
|
|
||||||
android:text="@string/lock_intro_message"
|
|
||||||
android:textSize="22sp"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<!-- right side: instructions and buttons -->
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="0dip"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal">
|
||||||
|
|
||||||
|
<!-- navigation buttons -->
|
||||||
|
<LinearLayout android:id="@+id/buttonContainer"
|
||||||
style="@style/SecurityPreferenceButtonContainer"
|
style="@style/SecurityPreferenceButtonContainer"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
@@ -65,7 +62,25 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
<!-- header message -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="20dip"
|
||||||
|
android:layout_marginLeft="20dip"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:layout_above="@id/buttonContainer">
|
||||||
|
|
||||||
|
<TextView android:id="@+id/headerText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/lock_intro_message"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</RelativeLayout>>
|
||||||
|
|
||||||
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
||||||
|
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
|
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/topLayout"
|
android:id="@+id/topLayout"
|
||||||
@@ -21,41 +20,72 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!-- left side: lock pattern widget -->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal|center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- left side: lock pattern -->
|
|
||||||
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
||||||
android:layout_width="354dip"
|
android:layout_width="354dip"
|
||||||
android:layout_height="354dip"
|
android:layout_height="354dip"
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="72dip"
|
|
||||||
android:layout_marginLeft="111dip"
|
|
||||||
aspect="square"/>
|
aspect="square"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<!-- right side: instructions and buttons -->
|
<!-- right side: instructions and buttons -->
|
||||||
<!-- header message -->
|
<RelativeLayout
|
||||||
<TextView android:id="@+id/headerText"
|
android:layout_width="0dip"
|
||||||
android:layout_width="542dip"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
||||||
android:layout_marginTop="88dip"
|
android:gravity="center_horizontal">
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_toRightOf="@id/lockPattern"
|
<!-- confirm / restart buttons -->
|
||||||
android:layout_marginLeft="100dip"
|
<LinearLayout android:id="@+id/buttonContainer"
|
||||||
android:textSize="22sp"/>
|
style="@style/SecurityPreferenceButtonContainer"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- left / top button: skip, or re-try -->
|
||||||
|
<Button android:id="@+id/footerLeftButton"
|
||||||
|
style="@style/SecurityPreferenceButton"
|
||||||
|
android:text="@string/lockpattern_restart_button_text"/>
|
||||||
|
|
||||||
|
<!-- right / bottom button: confirm or ok -->
|
||||||
|
<Button android:id="@+id/footerRightButton"
|
||||||
|
style="@style/SecurityPreferenceButton"
|
||||||
|
android:text="@string/lockpattern_confirm_button_text"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- footer message -->
|
<!-- footer message -->
|
||||||
<TextView android:id="@+id/footerText"
|
<TextView android:id="@+id/footerText"
|
||||||
android:layout_width="542dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/headerText"
|
android:layout_above="@id/buttonContainer"
|
||||||
android:layout_marginTop="16dip"
|
android:layout_marginTop="16dip"
|
||||||
android:layout_toRightOf="@id/lockPattern"
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
android:layout_marginLeft="100dip"
|
|
||||||
|
<!-- header message -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="20dip"
|
||||||
|
android:layout_marginLeft="20dip"
|
||||||
|
android:layout_above="@id/footerText"
|
||||||
|
android:gravity="center_vertical|center_horizontal">
|
||||||
|
|
||||||
|
<TextView android:id="@+id/headerText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:textSize="22sp"/>
|
android:textSize="22sp"/>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
|
||||||
|
@@ -22,19 +22,26 @@
|
|||||||
android:gravity="center_horizontal">
|
android:gravity="center_horizontal">
|
||||||
|
|
||||||
<!-- top: instructions and buttons -->
|
<!-- top: instructions and buttons -->
|
||||||
|
|
||||||
<!-- header message -->
|
<!-- header message -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="96dip">
|
||||||
|
|
||||||
<TextView android:id="@+id/headerText"
|
<TextView android:id="@+id/headerText"
|
||||||
android:layout_width="542dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="78dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="96dip"
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
android:textSize="22sp"/>
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
<!-- footer message -->
|
<!-- footer message -->
|
||||||
<TextView android:id="@+id/footerText"
|
<TextView android:id="@+id/footerText"
|
||||||
android:layout_width="542dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="78dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dip"
|
android:layout_marginTop="16dip"
|
||||||
android:textSize="22sp"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<!-- bottom: lock pattern -->
|
<!-- bottom: lock pattern -->
|
||||||
|
@@ -23,13 +23,19 @@
|
|||||||
|
|
||||||
<!-- top: instructions and buttons -->
|
<!-- top: instructions and buttons -->
|
||||||
<!-- header message -->
|
<!-- header message -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="96dip">
|
||||||
|
|
||||||
<TextView android:id="@+id/headerText"
|
<TextView android:id="@+id/headerText"
|
||||||
android:layout_width="542dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="78dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="96dip"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:textSize="22sp"
|
|
||||||
android:text="@string/lock_intro_message"/>
|
android:text="@string/lock_intro_message"/>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
<!-- bottom: lock pattern -->
|
<!-- bottom: lock pattern -->
|
||||||
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
||||||
android:layout_width="354dip"
|
android:layout_width="354dip"
|
||||||
|
@@ -23,18 +23,24 @@
|
|||||||
|
|
||||||
<!-- top: instructions and buttons -->
|
<!-- top: instructions and buttons -->
|
||||||
<!-- header message -->
|
<!-- header message -->
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="96dip">
|
||||||
|
|
||||||
<TextView android:id="@+id/headerText"
|
<TextView android:id="@+id/headerText"
|
||||||
android:layout_width="542dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="78dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="96dip"
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
android:textSize="22sp"/>
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
<!-- footer message -->
|
<!-- footer message -->
|
||||||
<TextView android:id="@+id/footerText"
|
<TextView android:id="@+id/footerText"
|
||||||
android:layout_width="542dip"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="78dip"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dip"
|
android:layout_marginTop="16dip"
|
||||||
android:textSize="22sp"/>
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
<!-- bottom: lock pattern -->
|
<!-- bottom: lock pattern -->
|
||||||
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
|
||||||
|
Reference in New Issue
Block a user