次のレイアウトを取得しました。
<com.htc.idlescreen.base.widget.WorkspaceView android:id="@id/workspace" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.htc.idlescreen.base.widget.IdleViewContainer android:id="@id/background" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<RelativeLayout android:orientation="vertical" android:id="@id/unlockscreen_background" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@id/unlockbg_below" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<ImageView android:id="@id/unlockbg_upper" android:layout_width="fill_parent" android:layout_height="wrap_content" />
</RelativeLayout>
<LinearLayout android:orientation="vertical" android:id="@id/shortcut_shadowbg" android:layout_width="fill_parent" android:layout_height="@dimen/shortcut_shadowbg_height" android:layout_alignParentBottom="true">
<ImageView android:id="@id/shortcut_bg_upper" android:background="@drawable/lockscreen_shadow" android:layout_width="fill_parent" android:layout_height="@dimen/shortcut_shadowbg_upper_height" />
<ImageView android:id="@id/shortcut_bg_below" android:background="#33000000" android:layout_width="fill_parent" android:layout_height="0.0px" android:layout_weight="1.0" />
</LinearLayout>
<ImageView android:id="@id/button_shadowbg" android:background="@drawable/lockscreen_shadow_action" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/button_shadowbg_height" android:layout_alignParentBottom="true" />
<com.htc.idlescreen.base.ui.ForegroundContainer android:id="@id/foregroundcontainer" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.htc.idlescreen.base.widget.IdleViewContainer android:id="@id/plugin" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<com.htc.idlescreen.base.ui.MainContain android:id="@id/maincontain" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/shortcut_height" android:layout_alignParentBottom="true" />
<com.htc.idlescreen.base.ui.HeadBar android:id="@id/headerbar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" />
<com.htc.idlescreen.base.ui.ChargeView android:id="@id/chargeview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/chargeview_margintop" android:layout_below="@id/headerbar" />
</com.htc.idlescreen.base.ui.ForegroundContainer>
<include android:id="@id/buttonfooter" layout="@layout/buttonfooter" />
</com.htc.idlescreen.base.widget.WorkspaceView>
ここに追加されたビューを削除したい:
<include android:id="@id/buttonfooter" layout="@layout/buttonfooter" />
Workspace クラスで可視性を GONE に設定し、removeView(buttonfooter) も設定しようとしました。
ビューは正常に削除されますが、スペースが確保され、空白のフィールドが表示されます。
layout_height を wrap_content に設定し、invalidate() も呼び出そうとしました。まだ成功していません。
どんな助けでも大歓迎です。ありがとう!
編集:
ボタンフッター.xml
<com.htc.idlescreen.base.ui.footer.ButtonFooter android:gravity="bottom" android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.htc.idlescreen.base.ui.footer.LockIcon android:id="@id/lockiconsphere" android:layout_width="@dimen/lockicon_width" android:layout_height="@dimen/shortcut_height" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true">
<ImageView android:id="@id/lock_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/lockicon_margin_left" android:scaleType="centerInside" android:layout_centerVertical="true" />
</com.htc.idlescreen.base.ui.footer.LockIcon>
<com.htc.idlescreen.base.ui.footer.ShortcutPanel android:orientation="vertical" android:id="@id/shortcut_panel" android:layout_width="fill_parent" android:layout_height="@dimen/shortcut_panel_height" android:layout_alignParentBottom="true">
<ImageView android:id="@id/shortcut_divider" android:background="@drawable/home_all_apps_div" android:layout_width="fill_parent" android:layout_height="@dimen/shortcut_divide_height" />
<LinearLayout android:orientation="horizontal" android:paddingLeft="@dimen/shortcut_panel_padding_left" android:paddingRight="@dimen/shortcut_panel_padding_right" android:layout_width="fill_parent" android:layout_height="@dimen/shortcut_height">
<com.htc.idlescreen.base.ui.footer.ShortcutSphere android:id="@id/shortcutpanel_shortcut_01" android:layout_width="@dimen/shortcut_width" android:layout_height="@dimen/shortcut_height" />
<com.htc.idlescreen.base.ui.footer.ShortcutSphere android:id="@id/shortcutpanel_shortcut_02" android:layout_width="@dimen/shortcut_width" android:layout_height="@dimen/shortcut_height" />
<View android:layout_width="@dimen/shortcut_center_space" android:layout_height="@dimen/shortcut_height" />
<com.htc.idlescreen.base.ui.footer.ShortcutSphere android:id="@id/shortcutpanel_shortcut_03" android:layout_width="@dimen/shortcut_width" android:layout_height="@dimen/shortcut_height" />
<com.htc.idlescreen.base.ui.footer.ShortcutSphere android:id="@id/shortcutpanel_shortcut_04" android:layout_width="@dimen/shortcut_width" android:layout_height="@dimen/shortcut_height" />
</LinearLayout>
</com.htc.idlescreen.base.ui.footer.ShortcutPanel>
<com.htc.idlescreen.base.ui.footer.ReminderPanel android:layout_gravity="bottom" android:id="@id/reminder_panel" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" />
</com.htc.idlescreen.base.ui.footer.ButtonFooter>
編集2:
それを非表示にしようとする: (元のコードではなく、職場で)
public class WorkspaceView extends RelativeLayout
{
public void init(WorkspaceCtrl paramWorkspaceCtrl)
{
mButtonFooter = ((ButtonFooter)findViewById(R.id.buttonfooter));
setFooterVisibility(View.GONE);
}
private void setFooterVisibility(int visibility)
{
if(visibility == View.GONE)
{
mButtonFooter.setVisibility(View.GONE)
//this.removeView(mButtonFooter)
//invalidate();
}
}
}