Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 4|回复: 4
打印 上一主题 下一主题

关于密码设置窗口

[复制链接]

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
跳转到指定楼层
楼主
发表于 2016-5-19 13:51:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1,窗口如下:
  Window #4 Window{1ad5b301 u0 ChinaNet-7Xna}:
    mDisplayId=0 mSession=Session{3fc1d208 2418:1000} mClient=android.os.BinderProxy@7d230e8
    mOwnerUid=1000 mShowToOwnerOnly=true package=com.android.settings appop=NONE
    mAttrs=WM.LayoutParams{(0,0)(wrapxwrap) gr=#11 sim=#110 ty=2 fl=#1800002 pfl=0x8 fmt=-3 wanim=0x1030462 surfaceInsets=Rect(30, 30 - 30, 30)}
    Requested w=1056 h=337 mLayoutSeq=112
    mHasSurface=true mShownFrame=[0.0,23.0][960.0,296.0] isReadyForDisplay()=true
    WindowStateAnimator{23ab8f83 ChinaNet-7Xna}:
      mAnimating=false mLocalAnimating=false mAnimationIsEntrance=true mAnimation=null
      Surface: shown=true layer=21020 alpha=1.0 rect=(-30.0,-7.0) 1020.0 x 333.0

2,mAttrs=WM.LayoutParams{(0,0)(wrapxwrap) gr=#11 sim=#110 ty=2 fl=#1800002 pfl=0x8 fmt=-3 wanim=0x1030462 surfaceInsets=Rect(30, 30 - 30, 30)}来自如下地方:::
./base/core/java/android/view/WindowManager.java::::
        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder(256);
            sb.append("WM.LayoutParams{");
            sb.append("(");
            sb.append(x);
            sb.append(',');
            sb.append(y);
            sb.append(")(");
            sb.append((width== MATCH_PARENT ?"fill"width==WRAP_CONTENT?"wrap":width)));
            sb.append('x');
            sb.append((height== MATCH_PARENT ?"fill"height==WRAP_CONTENT?"wrap":height)));
            sb.append(")");
            if (horizontalMargin != 0) {
                sb.append(" hm=");
                sb.append(horizontalMargin);
            }
            if (verticalMargin != 0) {
                sb.append(" vm=");
                sb.append(verticalMargin);
            }
            if (gravity != 0) {
                sb.append(" gr=#");
                sb.append(Integer.toHexString(gravity));
            }
            if (softInputMode != 0) {
                sb.append(" sim=#");
                sb.append(Integer.toHexString(softInputMode));
            }
            sb.append(" ty=");
            sb.append(type);
            sb.append(" fl=#");
            sb.append(Integer.toHexString(flags));
            if (privateFlags != 0) {
                if ((privateFlags & PRIVATE_FLAG_COMPATIBLE_WINDOW) != 0) {
                    sb.append(" compatible=true");
                }
                sb.append(" pfl=0x").append(Integer.toHexString(privateFlags));
            }
            if (format != PixelFormat.OPAQUE) {
                sb.append(" fmt=");
                sb.append(format);
            }
            if (windowAnimations != 0) {
                sb.append(" wanim=0x");
                sb.append(Integer.toHexString(windowAnimations));
            }
            if (screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
                sb.append(" or=");
                sb.append(screenOrientation);
            }
            if (alpha != 1.0f) {
                sb.append(" alpha=");
                sb.append(alpha);
            }
            if (screenBrightness != BRIGHTNESS_OVERRIDE_NONE) {
                sb.append(" sbrt=");
                sb.append(screenBrightness);
            }
            if (buttonBrightness != BRIGHTNESS_OVERRIDE_NONE) {
                sb.append(" bbrt=");
                sb.append(buttonBrightness);
            }
            if (rotationAnimation != ROTATION_ANIMATION_ROTATE) {
                sb.append(" rotAnim=");
                sb.append(rotationAnimation);
            }
            if (preferredRefreshRate != 0) {
                sb.append(" preferredRefreshRate=");
                sb.append(preferredRefreshRate);
            }
            if (systemUiVisibility != 0) {
                sb.append(" sysui=0x");
                sb.append(Integer.toHexString(systemUiVisibility));
            }
            if (subtreeSystemUiVisibility != 0) {
                sb.append(" vsysui=0x");
                sb.append(Integer.toHexString(subtreeSystemUiVisibility));
            }
            if (hasSystemUiListeners) {
                sb.append(" sysuil=");
                sb.append(hasSystemUiListeners);
            }
            if (inputFeatures != 0) {
                sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
            }
            if (userActivityTimeout >= 0) {
                sb.append(" userActivityTimeout=").append(userActivityTimeout);
            }
            if (!surfaceInsets.equals(Insets.NONE)) {
                sb.append(" surfaceInsets=").append(surfaceInsets);
            }

            sb.append('}');
            return sb.toString();
        }


说明这个窗口的属性mAttr的属性是WRAP_CONTENT


回复

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
沙发
 楼主| 发表于 2016-5-19 13:52:09 | 只看该作者
这个窗口是哪里产生的,为何是WRAP_CONTENT的属性呢?
回复 支持 反对

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
板凳
 楼主| 发表于 2016-5-19 13:53:30 | 只看该作者
先看看对于WRAP_CONTENT是如何计算其大小的?
回复 支持 反对

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
地板
 楼主| 发表于 2016-5-19 14:38:12 | 只看该作者
res/layout/alert_dialog_material.xml:::::
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/parentPanel"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    androidrientation="vertical">

    <LinearLayout android:id="@+id/topPanel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        androidrientation="vertical">
        <LinearLayout android:id="@+id/title_template"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            androidrientation="horizontal"
            android:gravity="center_vertical|start"
            android:paddingStart="@dimen/alert_dialog_padding_material"
            android:paddingEnd="@dimen/alert_dialog_padding_material"
            android:paddingTop="@dimen/alert_dialog_padding_top_material">
            <ImageView android:id="@+id/icon"
                android:layout_width="32dip"
                android:layout_height="32dip"
                android:layout_marginEnd="8dip"
                android:scaleType="fitCenter"
                android:src="@null" />
            <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
                style="?attr/windowTitleStyle"
                android:singleLine="true"
                android:ellipsize="end"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textAlignment="viewStart" />
        </LinearLayout>
        <!-- If the client uses a customTitle, it will be added here. -->
    </LinearLayout>

    <LinearLayout android:id="@+id/contentPanel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        androidrientation="vertical"
        android:minHeight="48dp">
        <ScrollView android:id="@+id/scrollView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                androidrientation="vertical">
                <TextView android:id="@+id/message"
                          style="@style/TextAppearance.Material.Subhead"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:paddingStart="@dimen/alert_dialog_padding_material"
                          android:paddingTop="@dimen/alert_dialog_padding_top_material"
                          android:paddingEnd="@dimen/alert_dialog_padding_material" />
                <Space android:id="@+id/textSpacerNoButtons"
                       android:visibility="gone"
                       android:layout_width="0dp"
                       android:layout_height="@dimen/alert_dialog_padding_top_material" />
            </LinearLayout>
        </ScrollView>
    </LinearLayout>

    <FrameLayout android:id="@+id/customPanel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:minHeight="48dp">
        <FrameLayout android:id="@+id/custom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </FrameLayout>

    <LinearLayout android:id="@+id/buttonPanel"
        style="?attr/buttonBarStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layoutDirection="locale"
        androidrientation="horizontal"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:paddingTop="8dp"
        android:paddingBottom="8dp">
        <Button android:id="@+id/button3"
            style="?attr/buttonBarNeutralButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Space
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:visibility="invisible" />
        <Button android:id="@+id/button2"
            style="?attr/buttonBarNegativeButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button android:id="@+id/button1"
            style="?attr/buttonBarPositiveButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>
</LinearLayout>
回复 支持 反对

使用道具 举报

1198

主题

2060

帖子

7058

积分

超级版主

Rank: 8Rank: 8

积分
7058
5#
 楼主| 发表于 2016-5-19 14:59:44 | 只看该作者
暂时删除如下部分,可以使用
        <!--Space
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:visibility="invisible" /-->
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, 2025-12-15 02:05 , Processed in 0.014204 second(s), 8 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表