From 1322b4654fd09505b1bc4ef5aecc3bfd205a923d Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Tue, 13 Jan 2009 17:44:53 +0000 Subject: A smaller fix to the ViewFlipper bug --- res/layout/act_console.xml | 3 +- src/org/connectbot/ConsoleActivity.java | 13 ++++-- src/org/connectbot/util/ViewFlipperFixed.java | 64 --------------------------- 3 files changed, 11 insertions(+), 69 deletions(-) delete mode 100644 src/org/connectbot/util/ViewFlipperFixed.java diff --git a/res/layout/act_console.xml b/res/layout/act_console.xml index 29b60d8..da58b8c 100644 --- a/res/layout/act_console.xml +++ b/res/layout/act_console.xml @@ -31,8 +31,7 @@ android:gravity="center" /> - - = flip.getChildCount()) + flip.setDisplayedChild(flip.getDisplayedChild()); + updateEmptyVisible(); break; } @@ -310,7 +317,7 @@ public class ConsoleActivity extends Activity { inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); - flip = (ViewFlipperFixed)findViewById(R.id.console_flip); + flip = (ViewFlipper)findViewById(R.id.console_flip); empty = (TextView)findViewById(android.R.id.empty); stringPromptGroup = (RelativeLayout) findViewById(R.id.console_password_group); diff --git a/src/org/connectbot/util/ViewFlipperFixed.java b/src/org/connectbot/util/ViewFlipperFixed.java deleted file mode 100644 index 157864c..0000000 --- a/src/org/connectbot/util/ViewFlipperFixed.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - ConnectBot: simple, powerful, open-source SSH client for Android - Copyright (C) 2007-2008 Kenny Root, Jeffrey Sharkey - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -package org.connectbot.util; - -import android.content.Context; -import android.util.AttributeSet; -import android.widget.ViewFlipper; - -/** - * @author Kenny Root - * - * This class simply overrides ViewFlipper until a fix can be released - * for tracking removal of views from a ViewAnimator. - * - * REMOVE THIS CLASS WHEN ViewAnimator IN ANDROID IS FIXED TO TRACK - * REMOVAL OF CHILD VIEWS! See also res/layout/act_console.xml - */ -public class ViewFlipperFixed extends ViewFlipper { - - /** - * @param context - */ - public ViewFlipperFixed(Context context) { - super(context); - // TODO Auto-generated constructor stub - } - - /** - * @param context - * @param attrs - */ - public ViewFlipperFixed(Context context, AttributeSet attrs) { - super(context, attrs); - // TODO Auto-generated constructor stub - } - - /** - * @param index child index - */ - @Override - public void removeViewAt(int index) { - // TODO Auto-generated method stub - super.removeViewAt(index); - - // Since we can't override removeViewInternal, we might as well do this. - if (getDisplayedChild() >= getChildCount()) - setDisplayedChild(index - 1); - } -} -- cgit v1.2.3